mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-11 13:17:21 +00:00
Imported using git-ubuntu import. Changelog parent: ed2c2791c88812e791cd5462a9d11c7cb9dbb505 New changelog entries: [ Michael Hudson-Doyle ] * Two last minute server-live fixes: - Seed the subiquity snap to track the stable channel (LP: #1724410) - Remove snap.subiquity.started from subiquity's After=/Requires= as it does not fix the race condition they were intended to address and causes subiquity to be killed when snapd refreshes subiquity (LP: #1724411)
83 lines
1.8 KiB
Bash
Executable File
83 lines
1.8 KiB
Bash
Executable File
#!/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
|
|
|
|
SQUASH_ROOT=binary/boot/squashfs.dir
|
|
OVERLAY_ROOT=binary/overlay
|
|
|
|
mkdir -p "$OVERLAY_ROOT"
|
|
|
|
# Create an installer squashfs layer
|
|
mount_overlay "$SQUASH_ROOT/" "$OVERLAY_ROOT/" "$SQUASH_ROOT/"
|
|
|
|
setup_mountpoint binary/boot/squashfs.dir
|
|
|
|
# Prepare installer layer.
|
|
|
|
# Install any requirements for the installer, for things we don't want
|
|
# to see on the installed system
|
|
chroot $SQUASH_ROOT apt-get update
|
|
chroot $SQUASH_ROOT apt-get -y install user-setup
|
|
chroot $SQUASH_ROOT apt-get -y install curtin
|
|
|
|
# Don't let cloud-init run in the live session.
|
|
touch $SQUASH_ROOT/etc/cloud/cloud-init.disabled
|
|
|
|
# Do the snap seeding dance.
|
|
chroot $SQUASH_ROOT mkdir -p /var/lib/snapd/seed/snaps /var/lib/snapd/seed/assertions
|
|
chroot $SQUASH_ROOT sh -c '
|
|
set -x;
|
|
cd /var/lib/snapd/seed;
|
|
sudo SNAPPY_STORE_NO_CDN=1 snap download core;
|
|
sudo SNAPPY_STORE_NO_CDN=1 snap download subiquity;
|
|
|
|
CORE_SNAP=$(ls -1 core*.snap);
|
|
SUBIQUITY_SNAP=$(ls -1 subiquity*.snap);
|
|
|
|
mv *.assert /var/lib/snapd/seed/assertions/;
|
|
mv *.snap /var/lib/snapd/seed/snaps/;
|
|
|
|
cat <<EOF > /var/lib/snapd/seed/seed.yaml
|
|
snaps:
|
|
- name: core
|
|
channel: stable
|
|
file: ${CORE_SNAP}
|
|
- name: subiquity
|
|
channel: stable
|
|
classic: true
|
|
file: ${SUBIQUITY_SNAP}
|
|
EOF
|
|
'
|
|
|
|
teardown_mountpoint "$SQUASH_ROOT"
|
|
|
|
# Then unmount the overlay
|
|
umount "$SQUASH_ROOT"
|
|
|
|
squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"
|
|
|
|
(cd "$OVERLAY_ROOT/" &&
|
|
mksquashfs . ${squashfs_f} \
|
|
-no-progress -xattrs -comp xz )
|