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

4
5
# we require building from git
if ! git rev-parse --is-inside-work-tree; then
Tails developers's avatar
Typos.  
Tails developers committed
6
    echo "${PWD} is not a Git tree. Exiting."
7
8
9
    exit 1
fi

10
11
12
. config/amnesia
if [ -e config/amnesia.local ] ; then
   . config/amnesia.local
amnesia's avatar
amnesia committed
13
14
fi

15
# init variables
16
RUN_LB_CONFIG="lb config noauto"
amnesia's avatar
amnesia committed
17

18
# init config/ with defaults for the target distribution
Tails developers's avatar
Tails developers committed
19
$RUN_LB_CONFIG --distribution wheezy ${@}
amnesia's avatar
amnesia committed
20
21

# set Amnesia's general options
22
$RUN_LB_CONFIG \
23
   --apt-recommends false \
Tails developers's avatar
Tails developers committed
24
   --backports false \
25
   --binary-images iso \
26
   --binary-indices false \
27
   --checksums none \
amnesia's avatar
amnesia committed
28
   --bootappend-live "${AMNESIA_APPEND}" \
29
   --bootstrap "cdebootstrap" \
30
   --archive-areas "main contrib non-free" \
31
   --includes none \
32
   --iso-application="The Amnesic Incognito Live System" \
33
   --iso-publisher="https://tails.boum.org/" \
amnesia's avatar
amnesia committed
34
   --iso-volume="TAILS ${AMNESIA_FULL_VERSION}" \
amnesia's avatar
amnesia committed
35
   --memtest none \
36
   --packages-lists="standard" \
37
   --tasks="standard" \
38
   --linux-packages="linux-image-3.16-3" \
39
   --syslinux-menu vesamenu \
T(A)ILS developers's avatar
T(A)ILS developers committed
40
   --syslinux-splash data/splash.png \
amnesia's avatar
amnesia committed
41
   --syslinux-timeout 4 \
42
   --initramfs=live-boot \
amnesia's avatar
amnesia committed
43
44
   ${@}

45
# build i386 images on amd64 as well, include a bunch of kernels
amnesia's avatar
amnesia committed
46
47
hw_arch="`dpkg --print-architecture`"
if [ "$hw_arch" = i386 -o "$hw_arch" = amd64 ]; then
48
   $RUN_LB_CONFIG \
amnesia's avatar
amnesia committed
49
      --architecture i386 \
50
      --linux-flavours "486 amd64" \
amnesia's avatar
amnesia committed
51
      ${@}
52
53
# build powerpc images on powerpc64 as well, include only powerpc kernel
elif [ "$hw_arch" = powerpc -o "$hw_arch" = powerpc64 ]; then
54
   $RUN_LB_CONFIG \
55
56
57
      --architecture powerpc \
      --linux-flavours powerpc \
      ${@}
amnesia's avatar
amnesia committed
58
59
fi

60
61
62
63
64
65
66
67
install -d config/chroot_local-includes/etc/amnesia/

# environment
TAILS_WIKI_SUPPORTED_LANGUAGES="$(ikiwiki-supported-languages ikiwiki.setup)"
[ -n "$TAILS_WIKI_SUPPORTED_LANGUAGES" ] || exit 16
echo "TAILS_WIKI_SUPPORTED_LANGUAGES='${TAILS_WIKI_SUPPORTED_LANGUAGES}'" \
   >> config/chroot_local-includes/etc/amnesia/environment

amnesia's avatar
amnesia committed
68
# version
69
echo "${AMNESIA_FULL_VERSION}" > config/chroot_local-includes/etc/amnesia/version
amnesia's avatar
amnesia committed
70
if git rev-list HEAD 2>&1 >/dev/null; then
71
72
   git rev-list HEAD | head -n 1 >> config/chroot_local-includes/etc/amnesia/version
fi
73
74
echo "live-build: `dpkg-query -W -f='${Version}\n' live-build`" \
   >> config/chroot_local-includes/etc/amnesia/version
75
76
77
78
79
# os-release
cat >> config/chroot_local-includes/etc/os-release <<EOF
TAILS_PRODUCT_NAME="Tails"
TAILS_VERSION_ID="$AMNESIA_VERSION"
EOF
80
81

# changelog
82
cp debian/changelog config/chroot_local-includes/usr/share/doc/amnesia/Changelog
83

84
85
86
87
88
89
# 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
90
91
92

# custom APT sources
tails-custom-apt-sources > config/chroot_sources/tails.chroot