config 3.33 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
set -x

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

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

intrigeri's avatar
intrigeri committed
17 18
export LB_BOOTSTRAP_INCLUDE='eatmydata'

19
# init variables
20
RUN_LB_CONFIG="lb config noauto"
amnesia's avatar
amnesia committed
21

22
# init config/ with defaults for the target distribution
23
$RUN_LB_CONFIG --distribution jessie ${@}
amnesia's avatar
amnesia committed
24

25
# set up everything for time-based snapshots:
26
apt-snapshots-serials prepare-build
27

28 29
MIRROR="$(apt-mirror debian)"

amnesia's avatar
amnesia committed
30
# set Amnesia's general options
31
$RUN_LB_CONFIG \
32
   --verbose \
33
   --apt-recommends false \
Tails developers's avatar
Tails developers committed
34
   --backports false \
35
   --binary-images iso \
36
   --binary-indices false \
37
   --checksums none \
amnesia's avatar
amnesia committed
38
   --bootappend-live "${AMNESIA_APPEND}" \
Cyril Brulebois's avatar
Cyril Brulebois committed
39
   --bootstrap debootstrap \
40
   --bootstrap-config tails-wheezy \
41
   --archive-areas "main contrib non-free" \
42
   --includes none \
43
   --iso-application="The Amnesic Incognito Live System" \
44
   --iso-publisher="https://tails.boum.org/" \
amnesia's avatar
amnesia committed
45
   --iso-volume="TAILS ${AMNESIA_FULL_VERSION}" \
amnesia's avatar
amnesia committed
46
   --memtest none \
47 48 49
   --mirror-binary    "$MIRROR" \
   --mirror-bootstrap "$MIRROR" \
   --mirror-chroot    "$MIRROR" \
50
   --packages-lists="standard" \
51
   --tasks="standard" \
52
   --linux-packages="linux-image-3.16.0-4" \
53
   --syslinux-menu vesamenu \
T(A)ILS developers's avatar
T(A)ILS developers committed
54
   --syslinux-splash data/splash.png \
amnesia's avatar
amnesia committed
55
   --syslinux-timeout 4 \
56
   --initramfs=live-boot \
amnesia's avatar
amnesia committed
57 58
   ${@}

59
# build i386 images on amd64 as well, include a bunch of kernels
amnesia's avatar
amnesia committed
60 61
hw_arch="`dpkg --print-architecture`"
if [ "$hw_arch" = i386 -o "$hw_arch" = amd64 ]; then
62
   $RUN_LB_CONFIG \
amnesia's avatar
amnesia committed
63
      --architecture i386 \
64
      --linux-flavours "586 amd64" \
amnesia's avatar
amnesia committed
65
      ${@}
66 67
# build powerpc images on powerpc64 as well, include only powerpc kernel
elif [ "$hw_arch" = powerpc -o "$hw_arch" = powerpc64 ]; then
68
   $RUN_LB_CONFIG \
69 70 71
      --architecture powerpc \
      --linux-flavours powerpc \
      ${@}
amnesia's avatar
amnesia committed
72 73
fi

74 75 76 77 78 79 80 81
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
82
# version
83
echo "${AMNESIA_FULL_VERSION}" > config/chroot_local-includes/etc/amnesia/version
amnesia's avatar
amnesia committed
84
if git rev-list HEAD 2>&1 >/dev/null; then
85 86
   git rev-list HEAD | head -n 1 >> config/chroot_local-includes/etc/amnesia/version
fi
87 88
echo "live-build: `dpkg-query -W -f='${Version}\n' live-build`" \
   >> config/chroot_local-includes/etc/amnesia/version
89 90 91 92 93
# os-release
cat >> config/chroot_local-includes/etc/os-release <<EOF
TAILS_PRODUCT_NAME="Tails"
TAILS_VERSION_ID="$AMNESIA_VERSION"
EOF
94 95

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

98 99 100 101 102 103
# 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
104 105 106

# custom APT sources
tails-custom-apt-sources > config/chroot_sources/tails.chroot
Cyril Brulebois's avatar
Cyril Brulebois committed
107 108 109

# custom debootstrap script, setting some APT magic to log downloads:
sed "s,%%topdir%%,$(pwd)," data/debootstrap/tails-wheezy > /usr/share/debootstrap/scripts/tails-wheezy