config 3.1 KB
Newer Older
amnesia's avatar
amnesia committed
1
#! /bin/sh
2
# automatically run by "lh config"
amnesia's avatar
amnesia committed
3

4 5 6
. config/amnesia
if [ -e config/amnesia.local ] ; then
   . config/amnesia.local
amnesia's avatar
amnesia committed
7 8
fi

9
# init variables
amnesia's avatar
amnesia committed
10 11
RUN_LH_CONFIG="lh config noautoconfig"

12 13
# init config/ with defaults for the target distribution
$RUN_LH_CONFIG --distribution lenny ${@}
amnesia's avatar
amnesia committed
14 15 16

# set Amnesia's general options
$RUN_LH_CONFIG \
17
   --apt-recommends false \
amnesia's avatar
amnesia committed
18
   --cache-stages "bootstrap rootfs" \
19
   --archive-areas "main contrib non-free" \
amnesia's avatar
amnesia committed
20 21 22
   --hostname="amnesia" \
   --iso-application="Amnesia live system" \
   --iso-publisher="https://amnesia.boum.org/" \
23
   --iso-volume="Amnesia ${AMNESIA_FULL_VERSION}" \
amnesia's avatar
amnesia committed
24
   --memtest none \
25
   --packages-lists="standard" \
amnesia's avatar
amnesia committed
26
   --username="amnesia" \
27
   --syslinux-menu vesamenu \
amnesia's avatar
amnesia committed
28 29 30
   --syslinux-timeout 4 \
   ${@}

31
# build i386 images on amd64 as well, include only 686 kernel
amnesia's avatar
amnesia committed
32 33 34 35 36 37
hw_arch="`dpkg --print-architecture`"
if [ "$hw_arch" = i386 -o "$hw_arch" = amd64 ]; then
   $RUN_LH_CONFIG \
      --architecture i386 \
      --linux-flavours 686 \
      ${@}
38 39 40 41 42 43
# build powerpc images on powerpc64 as well, include only powerpc kernel
elif [ "$hw_arch" = powerpc -o "$hw_arch" = powerpc64 ]; then
   $RUN_LH_CONFIG \
      --architecture powerpc \
      --linux-flavours powerpc \
      ${@}
amnesia's avatar
amnesia committed
44 45 46
fi

# locale-dependent configuration
47
. config/chroot
amnesia's avatar
amnesia committed
48 49 50 51
case "${LH_LANGUAGE}" in
   de)
      AMNESIA_APPEND="${AMNESIA_APPEND} locale=de_DE.UTF-8 keyb=de timezone=Europe/Berlin"
      ;;
52 53 54
   en)
      AMNESIA_APPEND="${AMNESIA_APPEND} locale=en_US.UTF-8 keyb=us timezone=America/Detroit"
      ;;
amnesia's avatar
amnesia committed
55 56 57 58 59 60 61 62 63
   fr)
      AMNESIA_APPEND="${AMNESIA_APPEND} locale=fr_FR.UTF-8 keyb=fr timezone=Europe/Paris"
      ;;
   *)
      ;;
esac
$RUN_LH_CONFIG --bootappend-live "${AMNESIA_APPEND}" ${@}

case "${LH_LANGUAGE}" in
64
   de|fr|en)
65
      ADD_PACKAGES_LISTS="amnesia-${AMNESIA_BASE} amnesia-${LH_LANGUAGE}"
amnesia's avatar
amnesia committed
66 67
      ;;
   *)
68
      ADD_PACKAGES_LISTS="amnesia-${AMNESIA_BASE}"
amnesia's avatar
amnesia committed
69 70
      ;;
esac
71 72 73 74
for basename in ${ADD_PACKAGES_LISTS} ; do
   cp "config/chroot_local-packageslists/${basename}" \
      "config/chroot_local-packageslists/${basename}.list"
done
amnesia's avatar
amnesia committed
75

amnesia's avatar
amnesia committed
76 77 78 79 80 81 82 83 84 85 86
case "${LH_LANGUAGE}" in
   fr)
      ln -s "/usr/local/bin/nautilus-wipe.${LH_LANGUAGE}" \
	 config/chroot_local-includes/home/amnesia/.gnome2/nautilus-scripts/Effacer_definitivement
      ;;
   *)
      ln -s "/usr/local/bin/nautilus-wipe" \
	 config/chroot_local-includes/home/amnesia/.gnome2/nautilus-scripts/Securely_erase
      ;;
esac

amnesia's avatar
amnesia committed
87
# version
88
mkdir -p config/chroot_local-includes/etc/amnesia/
89
echo "${AMNESIA_FULL_VERSION}" > config/chroot_local-includes/etc/amnesia/version
amnesia's avatar
amnesia committed
90
if git rev-list HEAD 2>&1 >/dev/null; then
91 92
   git rev-list HEAD | head -n 1 >> config/chroot_local-includes/etc/amnesia/version
fi
93 94

# changelog
95
cp debian/changelog config/chroot_local-includes/usr/share/doc/amnesia/Changelog
96 97 98

# GnuPG key
cp wiki/src/amnesia.asc config/chroot_local-includes/usr/share/doc/amnesia/
99 100 101 102 103 104 105

# create readahead-list from squashfs.sort
if [ -e config/binary_rootfs/squashfs.sort ]; then
    mkdir -p config/chroot_local-includes/usr/share/amnesia
    sort -k2 -n -r config/binary_rootfs/squashfs.sort |
        cut -d' ' -f1 > config/chroot_local-includes/usr/share/amnesia/readahead-list
fi