2017-03-20 20:57:45 -04:00
|
|
|
#!/bin/bash -ex
|
|
|
|
# vi: ts=4 noexpandtab
|
|
|
|
#
|
|
|
|
# Generate a squashfs root and manifest
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
echo "032-installer-squashfs.binary"
|
|
|
|
|
|
|
|
case $IMAGE_TARGETS in
|
|
|
|
""|*squashfs*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Skipping squashfs build"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -n "$SUBARCH" ]; then
|
|
|
|
echo "Skipping rootfs build for subarch flavor build"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-07-17 18:57:46 +01:00
|
|
|
. config/binary
|
2017-04-11 17:16:35 -04:00
|
|
|
. config/functions
|
2018-02-23 14:58:03 +13:00
|
|
|
. config/common
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2018-12-13 11:10:44 +13:00
|
|
|
FILESYSTEM_ROOT=binary/boot/squashfs.dir
|
|
|
|
INSTALLER_ROOT=binary/boot/installer.squashfs.dir
|
2018-11-12 20:39:25 +00:00
|
|
|
OVERLAY_ROOT=binary/overlay
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2018-12-13 11:10:44 +13:00
|
|
|
mkdir -p "$INSTALLER_ROOT" "$OVERLAY_ROOT"
|
2017-03-20 20:57:45 -04:00
|
|
|
|
|
|
|
# Create an installer squashfs layer
|
2018-12-13 11:10:44 +13:00
|
|
|
mount_overlay "$FILESYSTEM_ROOT/" "$OVERLAY_ROOT/" "$INSTALLER_ROOT/"
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2020-02-10 23:50:03 +00:00
|
|
|
setup_mountpoint "$INSTALLER_ROOT"
|
2017-09-13 12:03:34 -07:00
|
|
|
|
2018-02-20 15:22:43 +13:00
|
|
|
# Override JobRunningTimeoutSec to 0s on the .device unit that
|
|
|
|
# subiquity_config.mount depends on to avoid a 5s delay on switching
|
|
|
|
# to a new VT when there is no device there (LP: #1750117).
|
|
|
|
# It would be better to have this in ../includes.binary/overlay but
|
|
|
|
# you can't have backslashes in filenames in bzr branches!
|
2019-11-08 15:39:45 +13:00
|
|
|
ANSWERS_DEVICE_UNIT='dev-disk-by\x2duuid-00c629d6\x2d06ab\x2d4dfd\x2db21e\x2dc3186f34105d.device'
|
|
|
|
mkdir -p "$INSTALLER_ROOT/etc/systemd/system/$ANSWERS_DEVICE_UNIT.d"
|
|
|
|
cat > "$INSTALLER_ROOT/etc/systemd/system/$ANSWERS_DEVICE_UNIT.d/override.conf" <<EOF
|
2018-02-20 15:22:43 +13:00
|
|
|
[Unit]
|
|
|
|
JobRunningTimeoutSec=0s
|
2018-12-19 10:06:27 +11:00
|
|
|
Wants=subiquity_config.mount
|
2018-02-20 15:22:43 +13:00
|
|
|
EOF
|
|
|
|
|
2017-03-20 20:57:45 -04:00
|
|
|
# Prepare installer layer.
|
|
|
|
|
2020-03-03 14:09:42 +01:00
|
|
|
# Install:
|
|
|
|
# 1. linux-firmware for kernel to upload into hardware.
|
|
|
|
# 2. casper for live session magic.
|
|
|
|
# 3. openssh-server to enable the "ssh into live session" feature
|
|
|
|
chroot $INSTALLER_ROOT apt-get -y install linux-firmware lupin-casper openssh-server
|
2020-02-07 22:11:54 +00:00
|
|
|
|
|
|
|
# Make sure NoCloud is last
|
|
|
|
values=$(echo get cloud-init/datasources | chroot $INSTALLER_ROOT debconf-communicate | sed 's/^0 //;s/NoCloud, //;s/None/NoCloud, None/')
|
|
|
|
printf "%s\t%s\t%s\t%s\n" \
|
|
|
|
cloud-init cloud-init/datasources multiselect "$values" |
|
|
|
|
chroot $INSTALLER_ROOT debconf-set-selections
|
|
|
|
chroot $INSTALLER_ROOT dpkg-reconfigure --frontend=noninteractive cloud-init
|
|
|
|
|
2019-06-20 23:26:13 +01:00
|
|
|
if [ `dpkg --print-architecture` = s390x ]; then
|
2020-04-16 23:54:27 +01:00
|
|
|
chroot $INSTALLER_ROOT apt-get -y install s390-tools-zkey
|
|
|
|
# because z/VM x3270 is just ttyS0
|
|
|
|
cp -r $INSTALLER_ROOT/usr/lib/systemd/system/serial-getty@sclp_line0.service.d $INSTALLER_ROOT/usr/lib/systemd/system/serial-getty@ttyS0.service.d
|
2019-06-20 23:26:13 +01:00
|
|
|
fi
|
2018-12-17 13:37:36 +13:00
|
|
|
chroot $INSTALLER_ROOT apt-get clean
|
|
|
|
|
2018-03-15 20:26:00 +13:00
|
|
|
# For bug #1743643 "Install to dirty disk with swap fails" remove the
|
|
|
|
# "helpful" casper script that mounts any swap partitions it finds.
|
2018-12-13 11:10:44 +13:00
|
|
|
rm -f $INSTALLER_ROOT/usr/share/initramfs-tools/scripts/casper-bottom/*swap
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2020-10-15 08:33:23 +13:00
|
|
|
# For bug #1893818 "Several blockprobe errors if trying to install the
|
|
|
|
# groovy daily live on LPAR", remove a udev rule that removes
|
|
|
|
# partition nodes for multipathed disks that breaks the installer.
|
|
|
|
rm -f $INSTALLER_ROOT/lib/udev/rules.d/68-del-part-nodes.rules
|
|
|
|
|
2019-05-16 13:03:30 +02:00
|
|
|
# Preseed subiquity into installer layer
|
|
|
|
snap_prepare $INSTALLER_ROOT
|
|
|
|
snap_preseed $INSTALLER_ROOT subiquity/classic
|
|
|
|
# Drop lxd from the installer layer preseed
|
|
|
|
sed -i -e'N;/name: lxd/,+2d' $INSTALLER_ROOT/var/lib/snapd/seed/seed.yaml
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2018-12-13 11:10:44 +13:00
|
|
|
teardown_mountpoint "$INSTALLER_ROOT"
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2020-07-17 18:57:46 +01:00
|
|
|
# Drop core/lxd/snapd that got copied up from base layer, due to
|
|
|
|
# snap-preseed tool doing --reset & speedup
|
|
|
|
find $OVERLAY_ROOT/var/lib/snapd/ -name 'core*.snap' -delete
|
|
|
|
find $OVERLAY_ROOT/var/lib/snapd/ -name 'snapd_*.snap' -delete
|
|
|
|
find $OVERLAY_ROOT/var/lib/snapd/ -name 'lxd_*.snap' -delete
|
|
|
|
|
2017-04-06 14:04:29 -04:00
|
|
|
squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"
|
2017-03-20 20:57:45 -04:00
|
|
|
|
2020-08-27 08:51:07 -07:00
|
|
|
create_squashfs "$OVERLAY_ROOT/" ${squashfs_f}
|