7 VERSIONS
="6.0~testoverlayfs 6.2~testoverlayfs 6.3~testoverlayfs"
8 SOURCE_DATE_EPOCH
=$
(date --utc '+%s')
9 export SOURCE_DATE_EPOCH
11 [ -d "$TAILS_CHECKOUT" ] ||
exit 2
15 for version
in $VERSIONS; do
16 ISO_SRC
="$WORKDIR/$version"/iso_src
17 for dir
in EFI
/BOOT isolinux live utils
/linux utils
/mbr
; do
18 mkdir
-p "$ISO_SRC/$dir"
20 SQUASHFS_SRC
="$WORKDIR/$version"/squashfs_src
21 mkdir
-p "$SQUASHFS_SRC"
22 mkdir
-p "$SQUASHFS_SRC"/etc
/amnesia
"$SQUASHFS_SRC"/usr
/share
24 cp -a /usr
/share
/common-licenses
"$SQUASHFS_SRC"/usr
/share
/
25 mkdir
-p "$SQUASHFS_SRC"/usr
/share
/doc
26 if [ "$version" = '6.0~testoverlayfs' ]; then
27 mkdir
-p "$SQUASHFS_SRC"/usr
/share
/doc
/tor
28 echo "Some content" > "$SQUASHFS_SRC"/usr
/share
/doc
/tor
/README.Debian
30 if [ "$version" != '6.0~testoverlayfs' ]; then
31 echo "Some content" > "$SQUASHFS_SRC"/some_new_file
32 rm "$SQUASHFS_SRC"/usr
/share
/common-licenses
/BSD
34 if [ "$version" = '6.3~testoverlayfs' ]; then
35 echo "Some content 6.3" > "$SQUASHFS_SRC"/some_new_file_6.3
36 rm "$SQUASHFS_SRC"/usr
/share
/common-licenses
/MPL-1.1
38 cat > "$SQUASHFS_SRC"/etc
/os-release
<<EOF
44 "$ISO_SRC"/live
/filesystem.squashfs \
45 -no-progress -noappend -comp xz
-Xbcj x86
-b 1024K
-Xdict-size 1024K \
48 echo vmlinuz
> "$ISO_SRC"/live
/vmlinuz
49 echo initrd
> "$ISO_SRC"/live
/initrd.img
50 echo isolinux
> "$ISO_SRC"/isolinux
/isolinux.cfg
51 echo 'filesystem.squashfs' > "$ISO_SRC"/live
/Tails.module
52 cp /usr
/lib
/syslinux
/mbr
/gptmbr.bin
"$ISO_SRC"/utils
/mbr
/mbr.bin
53 if [ "$version" = '6.0~testoverlayfs' ]; then
54 cp /usr
/bin
/syslinux
"$ISO_SRC"/utils
/linux
56 if [ "$version" = '6.3~testoverlayfs' ]; then
57 rm "$ISO_SRC"/utils
/mbr
/mbr.bin
60 -as mkisofs
-R -r -J -joliet-long -l -cache-inodes -iso-level 3 \
61 --modification-date=2019112316114600 \
62 -o "$WORKDIR/$version.iso" "$ISO_SRC"
65 for dest_version
in 6.2~testoverlayfs
6.3~testoverlayfs
; do
66 echo "Generating IUK file from 6.0~testoverlayfs to $dest_version"
68 "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH \
70 TMPDIR=\"${TMPDIR:-/tmp}\" \
71 PERL5LIB=\"${TAILS_CHECKOUT:?}/config/chroot_local-includes/usr/src/perl5lib/lib\" \
72 ${TAILS_CHECKOUT:?}/config/chroot_local-includes/usr/src/iuk/bin/tails-create-iuk \
73 --squashfs_diff_name \"${dest_version}.squashfs\" \
74 --old_iso \"$WORKDIR/6.0~testoverlayfs.iso\" \
75 --new_iso \"$WORKDIR/${dest_version}.iso\" \
76 --outfile \"$WORKDIR/Tails_amd64_6.0~testoverlayfs_to_${dest_version}.iuk\""
79 echo "Generated test IUKS:"
80 ls -lh "$WORKDIR"/*.iuk