From 2720f4bdb3bed95b3c10c40276d24e2b518ba2ba Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Fri, 31 Jul 2020 10:51:50 +0000 Subject: [PATCH] Imported 2.525.45 No reason for CPC update specified. --- debian/changelog | 26 ++++++ live-build/auto/config | 2 +- live-build/functions | 51 +++++------ .../hooks/031-maas-squashfs.binary | 91 ------------------- .../hooks/032-installer-squashfs.binary | 36 ++------ .../lib/systemd/system/media-rack.lower.mount | 5 - .../systemd/system/media-region.lower.mount | 5 - 7 files changed, 57 insertions(+), 159 deletions(-) delete mode 100755 live-build/ubuntu-server/hooks/031-maas-squashfs.binary delete mode 100644 live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-rack.lower.mount delete mode 100644 live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-region.lower.mount diff --git a/debian/changelog b/debian/changelog index 3e103094..cd7ae28d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,29 @@ +livecd-rootfs (2.525.45) bionic; urgency=medium + + [ Francis Ginther ] + * Use the linux-raspi-hwe-18.04 kernel for raspi3 classic image builds. + (LP: #1889188) + + [ Michael Hudson-Doyle ] + * Backport snap seeding and other fixes for live-server ISOs. (LP: #1883156) + * Stop building and mounting the mass-rack and maas-region squashfses for + the server-live build as subiquity does not use them any more. + + [ Dimitri John Ledkov ] + * Run snap info on the downloaded snap, rather than against the + store. First of all snap info doesn't have --channel argument, thus + queries the wrong channel, and depening on the cohort, a different + snap might be visible too. Thus seed the base of the snap revision we + dowanloaded, rather than some random one from the store. + * Use snap-tool to seed subiquity snap. + * Subiquity: install linux-firmware in the installer layer, to make + firmware blobs available in the live session. LP: #1847835 + + [ Robert C Jennings ] + * Fix logic to ensure snapd is seeded in core18-only images (LP: #1871919) + + -- Michael Hudson-Doyle Wed, 22 Jul 2020 14:44:38 +1200 + livecd-rootfs (2.525.44) bionic; urgency=medium * Add support for building uc18 appliance images (LP: #1887673). diff --git a/live-build/auto/config b/live-build/auto/config index 03d88193..5534cc91 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -906,7 +906,7 @@ case $ARCH in ;; raspi3) COMPONENTS='main restricted universe multiverse' - KERNEL_FLAVOURS=raspi2-hwe-18.04 + KERNEL_FLAVOURS=raspi-hwe-18.04 add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools wpasupplicant BINARY_REMOVE_LINUX=false ;; diff --git a/live-build/functions b/live-build/functions index 17be9eb6..6f02277d 100644 --- a/live-build/functions +++ b/live-build/functions @@ -439,6 +439,24 @@ _snap_preseed() { return fi + sh -c " + set -x; + cd \"$CHROOT_ROOT/var/lib/snapd/seed\"; + SNAPPY_STORE_NO_CDN=1 snap download \ + --cohort="${COHORT_KEY:-}" \ + --channel=\"$CHANNEL\" \"$SNAP_NAME\"" || snap_download_failed=1 + if [ $snap_download_failed = 1 ] ; then + echo "If the channel ($CHANNEL) includes '*/ubuntu-##.##' track per " + echo "Ubuntu policy (ex. stable/ubuntu-18.04) the publisher will need " + echo "to temporarily create the channel/track to allow fallback during" + echo "download (ex. stable/ubuntu-18.04 falls back to stable if the" + echo "prior had been created in the past)." + exit 1 + fi + + mv -v $seed_dir/*.assert $assertions_dir + mv -v $seed_dir/*.snap $snaps_dir + # Pre-seed snap's base local core_snap="" case $SNAP_NAME in @@ -452,7 +470,8 @@ _snap_preseed() { # Determine which core snap is needed local snap_info - snap_info=$(snap info --verbose "${SNAP_NAME}") + # snap info doesn't have --channel, so must run agains the downloaded snap + snap_info=$(snap info --verbose ${snaps_dir}/${SNAP_NAME}_[0-9]*.snap) if [ $? -ne 0 ]; then echo "Failed to retrieve base of $SNAP_NAME!" @@ -468,24 +487,6 @@ _snap_preseed() { ;; esac - sh -c " - set -x; - cd \"$CHROOT_ROOT/var/lib/snapd/seed\"; - SNAPPY_STORE_NO_CDN=1 snap download \ - --cohort=\"${COHORT_KEY:-}\" \ - --channel=\"$CHANNEL\" \"$SNAP_NAME\"" || snap_download_failed=1 - if [ $snap_download_failed = 1 ] ; then - echo "If the channel ($CHANNEL) includes '*/ubuntu-##.##' track per " - echo "Ubuntu policy (ex. stable/ubuntu-18.04) the publisher will need " - echo "to temporarily create the channel/track to allow fallback during" - echo "download (ex. stable/ubuntu-18.04 falls back to stable if the" - echo "prior had been created in the past)." - exit 1 - fi - - mv -v $seed_dir/*.assert $assertions_dir - mv -v $seed_dir/*.snap $snaps_dir - # Add the snap to the seed.yaml ! [ -e $seed_yaml ] && echo "snaps:" > $seed_yaml cat <> $seed_yaml @@ -499,11 +500,7 @@ EOF echo -n " file: " >> $seed_yaml (cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml - # If $core_snap is the empty string then SNAP itself *may be* a core snap, - # and we run some post-processing logic. - if [ -z "$core_snap" ]; then - _snap_post_process $CHROOT_ROOT $SNAP_NAME - fi + _snap_post_process $CHROOT_ROOT $SNAP_NAME } snap_prepare_assertions() { @@ -559,12 +556,6 @@ snap_prepare() { local snaps_dir="$seed_dir/snaps" snap_prepare_assertions "$CHROOT_ROOT" "$CUSTOM_BRAND_MODEL" - - # ubuntu-cpc:minimized has its own special snap handling - if [ "$PROJECT:${SUBPROJECT:-}" != ubuntu-cpc:minimized ]; then - # Download the core snap - _snap_preseed "$CHROOT_ROOT" core stable - fi } snap_preseed() { diff --git a/live-build/ubuntu-server/hooks/031-maas-squashfs.binary b/live-build/ubuntu-server/hooks/031-maas-squashfs.binary deleted file mode 100755 index ba348ba3..00000000 --- a/live-build/ubuntu-server/hooks/031-maas-squashfs.binary +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -ex -# vi: ts=4 noexpandtab -# -# Generate a squashfs root and manifest - -set -x - -echo "031-maas-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 - -SQUASH_ROOT=binary/boot/squashfs.dir - -RACK_ROOT=binary/boot/squashfs-rack.dir -REGION_ROOT=binary/boot/squashfs-region.dir - -OVERLAY_RACK_ROOT=binary/overlay-maas-rack -OVERLAY_REGION_ROOT=binary/overlay-maas-region - -mkdir -p "$RACK_ROOT" -mkdir -p "$REGION_ROOT" - -mkdir -p "$OVERLAY_RACK_ROOT" -mkdir -p "$OVERLAY_REGION_ROOT" - -# RACK is on top of the regular squashfs - -mount_overlay "$SQUASH_ROOT/" "$OVERLAY_RACK_ROOT/" "$RACK_ROOT/" "RACK" - -setup_mountpoint $RACK_ROOT -env DEBIAN_FRONTEND=noninteractive chroot $RACK_ROOT apt-get -y install maas-rack-controller -rm -f $RACK_ROOT/etc/maas/rackd.conf -chroot $RACK_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common' -chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-common' -chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-rack-controller' -teardown_mountpoint $RACK_ROOT - -umount "$RACK_ROOT" - -# Full MAAS (Region) is on top of the rack -# in overlayfs lowerdir are mounted right to left, colon separated -mount_overlay "$OVERLAY_RACK_ROOT/:$SQUASH_ROOT/" "$OVERLAY_REGION_ROOT/" "$REGION_ROOT/" "REGION" - -setup_mountpoint $REGION_ROOT - -env DEBIAN_FRONTEND=noninteractive chroot $REGION_ROOT apt-get -y install maas - -# Forget how things had to be configured -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.prerm remove -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm remove -chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm purge -chroot $REGION_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common' -chroot $REGION_ROOT sudo -u postgres psql -c 'alter role maas password null;' -rm -f $REGION_ROOT/etc/maas/rackd.conf -rm -f $REGION_ROOT/etc/maas/regiond.conf -chroot $REGION_ROOT pg_ctlcluster $(/bin/ls $REGION_ROOT/var/lib/postgresql/) main stop || : - -# After the install, one may call the below to "reconfigure" maas-region-controller -## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.config configure -## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postinst configure - -teardown_mountpoint "$REGION_ROOT" - -umount "$REGION_ROOT" - -squashfs_rack_f="${PWD}/livecd.${PROJECT}.maas-rack.squashfs" - -(cd "$OVERLAY_RACK_ROOT/" && - mksquashfs . ${squashfs_rack_f} \ - -no-progress -xattrs -comp xz ) - -squashfs_region_f="${PWD}/livecd.${PROJECT}.maas-region.squashfs" - -(cd "$OVERLAY_REGION_ROOT/" && - mksquashfs . ${squashfs_region_f} \ - -no-progress -xattrs -comp xz ) diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index cff32321..f7290c4c 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -23,6 +23,8 @@ 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 @@ -52,6 +54,8 @@ EOF # Install casper for live session magic. chroot $INSTALLER_ROOT apt-get -y install lupin-casper +# Install linux-firmware for kernel to upload into hardware. +chroot $INSTALLER_ROOT apt-get -y install linux-firmware chroot $INSTALLER_ROOT apt-get clean # For bug #1743643 "Install to dirty disk with swap fails" remove the @@ -61,33 +65,11 @@ rm -f $INSTALLER_ROOT/usr/share/initramfs-tools/scripts/casper-bottom/*swap # Don't let cloud-init run in the live session. touch $INSTALLER_ROOT/etc/cloud/cloud-init.disabled -# Do the snap seeding dance. -chroot $INSTALLER_ROOT mkdir -p /var/lib/snapd/seed/snaps /var/lib/snapd/seed/assertions -chroot $INSTALLER_ROOT sh -c ' -set -x; -mkdir -p /var/lib/snapd/seed/snaps/ -cd /var/lib/snapd/seed/snaps/; -if [ ! -e core_*.snap ]; then - SNAPPY_STORE_NO_CDN=1 snap download core -fi -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/; - -cat < /var/lib/snapd/seed/seed.yaml -snaps: - - name: core - channel: stable - file: ${CORE_SNAP} - - name: subiquity - channel: stable - classic: true - file: ${SUBIQUITY_SNAP} -EOF -' +# 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 teardown_mountpoint "$INSTALLER_ROOT" diff --git a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-rack.lower.mount b/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-rack.lower.mount deleted file mode 100644 index 8d1079f8..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-rack.lower.mount +++ /dev/null @@ -1,5 +0,0 @@ -[Mount] -What=/cdrom/casper/maas/maas-rack.squashfs -Where=/media/rack.lower -Type=squashfs -Options=ro diff --git a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-region.lower.mount b/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-region.lower.mount deleted file mode 100644 index ee220c0d..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/media-region.lower.mount +++ /dev/null @@ -1,5 +0,0 @@ -[Mount] -What=/cdrom/casper/maas/maas-region.squashfs -Where=/media/region.lower -Type=squashfs -Options=ro