#!/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 . config/functions . config/common # somehow i don't have LB_DISTRIBUTION set ?! . config/bootstrap FILESYSTEM_ROOT=binary/boot/squashfs.dir INSTALLER_ROOT=binary/boot/installer.squashfs.dir OVERLAY_ROOT=binary/overlay mkdir -p "$INSTALLER_ROOT" "$OVERLAY_ROOT" # Create an installer squashfs layer mount_overlay "$FILESYSTEM_ROOT/" "$OVERLAY_ROOT/" "$INSTALLER_ROOT/" setup_mountpoint binary/boot/squashfs.dir # 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! 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" < "$INSTALLER_ROOT/etc/systemd/system/$AUTOINSTALL_DEVICE_UNIT.d.d/override.conf" < "$INSTALLER_ROOT"/etc/initramfs-tools/scripts/init-bottom/copy-autoinstall #!/bin/sh case \$1 in prereqs) exit 0;; esac [ -f /autoinstall.yaml ] && cp /autoinstall.yaml /run/initrd-autoinstall.yaml EOF chmod +x "$INSTALLER_ROOT"/etc/initramfs-tools/scripts/init-bottom/copy-autoinstall teardown_mountpoint "$INSTALLER_ROOT" squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs" (cd "$OVERLAY_ROOT/" && mksquashfs . ${squashfs_f} \ -no-progress -xattrs -comp xz )