From a5a4f4e0d8295becb3a6f485891099c355b83bdc Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 15 Mar 2018 13:22:22 +1300 Subject: [PATCH 01/29] * Rename the directory containing the systemd override file for subiquity to the correct name :/ * Add Environment=SNAP_REEXEC=0 to the above override file. * Remove the snap.subiquity.started overrides, that service is long gone. --- debian/changelog | 9 +++++++++ .../snap.subiquity.started.service.d/no-reexec.conf | 3 --- .../overlay/etc/systemd/system/snapd.refresh.timer | 1 - .../subiquity.conf | 1 + .../systemd/system/snapd.service.d/no-reexec.conf | 0 5 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snap.subiquity.started.service.d/no-reexec.conf delete mode 120000 live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.refresh.timer rename live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/{snap.subiquity.subquity-service.d => snap.subiquity.subiquity-service.service.d}/subiquity.conf (91%) rename live-build/ubuntu-server/includes.binary/overlay/{etc => lib}/systemd/system/snapd.service.d/no-reexec.conf (100%) diff --git a/debian/changelog b/debian/changelog index 8089d062..d76c624c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.510) UNRELEASED; urgency=medium + + * Rename the directory containing the systemd override file for subiquity to + the correct name :/ + * Add Environment=SNAP_REEXEC=0 to the above override file. + * Remove the snap.subiquity.started overrides, that service is long gone. + + -- Michael Hudson-Doyle Thu, 15 Mar 2018 13:19:22 +1300 + livecd-rootfs (2.509) bionic; urgency=medium [ Steve Langasek ] diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snap.subiquity.started.service.d/no-reexec.conf b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snap.subiquity.started.service.d/no-reexec.conf deleted file mode 100644 index 52bf88df..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snap.subiquity.started.service.d/no-reexec.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -RemainAfterExit=yes -Environment=SNAP_REEXEC=0 diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.refresh.timer b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.refresh.timer deleted file mode 120000 index dc1dc0cd..00000000 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.refresh.timer +++ /dev/null @@ -1 +0,0 @@ -/dev/null \ No newline at end of file diff --git a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subquity-service.d/subiquity.conf b/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf similarity index 91% rename from live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subquity-service.d/subiquity.conf rename to live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf index 9ae26356..f5da92cd 100644 --- a/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subquity-service.d/subiquity.conf +++ b/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf @@ -4,6 +4,7 @@ After=systemd-user-sessions.service plymouth-quit-wait.service ConditionPathExists=!/run/subiquity/complete [Service] +Environment=SNAP_REEXEC=0 UtmpIdentifier=tty1 TTYPath=/dev/tty1 TTYReset=yes diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.service.d/no-reexec.conf b/live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snapd.service.d/no-reexec.conf similarity index 100% rename from live-build/ubuntu-server/includes.binary/overlay/etc/systemd/system/snapd.service.d/no-reexec.conf rename to live-build/ubuntu-server/includes.binary/overlay/lib/systemd/system/snapd.service.d/no-reexec.conf From 44e7d70046a42168f1dfcb233dc671589e67bbdb Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 15 Mar 2018 14:10:02 +1300 Subject: [PATCH 03/29] releasing package livecd-rootfs version 2.510 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d76c624c..4a922a40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -livecd-rootfs (2.510) UNRELEASED; urgency=medium +livecd-rootfs (2.510) bionic; urgency=medium * Rename the directory containing the systemd override file for subiquity to the correct name :/ * Add Environment=SNAP_REEXEC=0 to the above override file. * Remove the snap.subiquity.started overrides, that service is long gone. - -- Michael Hudson-Doyle Thu, 15 Mar 2018 13:19:22 +1300 + -- Michael Hudson-Doyle Thu, 15 Mar 2018 14:09:57 +1300 livecd-rootfs (2.509) bionic; urgency=medium From 8ece245153da9fa0562946c15634d2fe5048fe2e Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 15 Mar 2018 20:26:00 +1300 Subject: [PATCH 04/29] In the live-server build, prevent casper from mounting any existing swap partitions from drives we might later be installing to. --- debian/changelog | 7 +++++++ .../ubuntu-server/hooks/032-installer-squashfs.binary | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4a922a40..42d45fc3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.511) UNRELEASED; urgency=medium + + * In the live-server build, prevent casper from mounting any existing swap + partitions from drives we might later be installing to. + + -- Michael Hudson-Doyle Thu, 15 Mar 2018 20:23:27 +1300 + livecd-rootfs (2.510) bionic; urgency=medium * Rename the directory containing the systemd override file for subiquity to diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index a0b77a20..bab6ab76 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -53,6 +53,10 @@ EOF chroot $SQUASH_ROOT apt-get update chroot $SQUASH_ROOT apt-get -y install user-setup curtin lupin-casper +# For bug #1743643 "Install to dirty disk with swap fails" remove the +# "helpful" casper script that mounts any swap partitions it finds. +rm -f $SQUASH_ROOT/usr/share/initramfs-tools/scripts/casper-bottom/*swap + # Installing casper means we need a new initramfs UPDATE_INITRAMFS_OPTIONS=CASPER_GENERATE_UUID=1 recreate_initramfs $SQUASH_ROOT From 815c3dfc10693770df241322cb039d3336716f07 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Fri, 16 Mar 2018 18:38:22 +0000 Subject: [PATCH 05/29] Whitelist preserving "unowned" /var/log/journal. Maybe systemd package should own the directory, and only adjust the permissions in postinst. LP: #1754332 --- debian/changelog | 8 ++++++++ live-build/ubuntu-cpc/hooks/099-cleanup.chroot | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4a922a40..5c8e621b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.511) bionic; urgency=medium + + * Whitelist preserving "unowned" /var/log/journal. Maybe systemd package + should own the directory, and only adjust the permissions in + postinst. LP: #1754332 + + -- Dimitri John Ledkov Fri, 16 Mar 2018 18:36:56 +0000 + livecd-rootfs (2.510) bionic; urgency=medium * Rename the directory containing the systemd override file for subiquity to diff --git a/live-build/ubuntu-cpc/hooks/099-cleanup.chroot b/live-build/ubuntu-cpc/hooks/099-cleanup.chroot index cf2b7dd1..ec0b05c6 100755 --- a/live-build/ubuntu-cpc/hooks/099-cleanup.chroot +++ b/live-build/ubuntu-cpc/hooks/099-cleanup.chroot @@ -27,7 +27,7 @@ do done # Remove un-owned log directories -whitelisted_dirs=(/var/log/fsck) +whitelisted_dirs=(/var/log/fsck /var/log/journal) for log_d in $(find /var/log/* -type d) do From 12339422c50cd19994a58d90013dcb6251907baa Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 20 Mar 2018 14:30:27 -0400 Subject: [PATCH 06/29] ubuntu-cpc: When performing a minimized build, don't generate artifacts that won't boot with the linux-kvm kernel (LP: #1757223). --- debian/changelog | 7 +++++++ live-build/ubuntu-cpc/hooks/040-vmdk-image.binary | 9 +++++++++ live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary | 9 +++++++++ live-build/ubuntu-cpc/hooks/042-vagrant.binary | 9 +++++++++ 4 files changed, 34 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5c8e621b..f0d0def6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.512) bionic; urgency=medium + + * ubuntu-cpc: When performing a minimized build, don't generate artifacts + that won't boot with the linux-kvm kernel (LP: #1757223). + + -- Daniel Watkins Tue, 20 Mar 2018 13:42:50 -0400 + livecd-rootfs (2.511) bionic; urgency=medium * Whitelist preserving "unowned" /var/log/journal. Maybe systemd package diff --git a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary index 95b1d9a3..32740127 100755 --- a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary @@ -3,6 +3,15 @@ # # Generate VMDK files +case ${SUBPROJECT:-} in + minimized) + echo "Skipping minimized $0 build as images won't boot with linux-kvm" + exit 0 + ;; + *) + ;; +esac + case $ARCH in amd64) ;; *) echo "VMDK images are not supported for $ARCH yet."; diff --git a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary index 48d77789..77a4b11a 100755 --- a/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary +++ b/live-build/ubuntu-cpc/hooks/041-vmdk-ova-image.binary @@ -9,6 +9,15 @@ # # For this step, we re-use the VMDK's made in 040-vmdk-image.binary +case ${SUBPROJECT:-} in + minimized) + echo "Skipping minimized $0 build as images won't boot with linux-kvm" + exit 0 + ;; + *) + ;; +esac + # Switch on $ARCH to determine which ID and description to use in the produced # OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index d92b7080..cb6c593c 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -15,6 +15,15 @@ # some packages in it, convert it to a vmdk, and then assemble the vagrant # box. +case ${SUBPROJECT:-} in + minimized) + echo "Skipping minimized $0 build as images won't boot with linux-kvm" + exit 0 + ;; + *) + ;; +esac + case $IMAGE_TARGETS in ""|*vagrant*) ;; From 2cb679b281e7d8d3104ce58631275be54f3794af Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 21 Mar 2018 15:58:05 +1300 Subject: [PATCH 07/29] releasing package livecd-rootfs version 2.513 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 993771bf..b6c93731 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.513) UNRELEASED; urgency=medium +livecd-rootfs (2.513) bionic; urgency=medium * In the live-server build, prevent casper from mounting any existing swap partitions from drives we might later be installing to. (LP: #1743643) - -- Michael Hudson-Doyle Wed, 21 Mar 2018 15:50:27 +1300 + -- Michael Hudson-Doyle Wed, 21 Mar 2018 15:58:02 +1300 livecd-rootfs (2.512) bionic; urgency=medium From bfa43c1c5ca2b253cf0e404569dbbd83027221c0 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Wed, 21 Mar 2018 11:05:46 +0000 Subject: [PATCH 08/29] On amd64, if building minimal images for bionic, xenial, or extra ppa, use kvm kernel, otherwise fallback to virtual. --- debian/changelog | 7 +++++++ live-build/auto/config | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b6c93731..419a00f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.514) bionic; urgency=medium + + * On amd64, if building minimal images for bionic, xenial, or extra ppa, + use kvm kernel, otherwise fallback to virtual. + + -- Dimitri John Ledkov Wed, 21 Mar 2018 11:02:25 +0000 + livecd-rootfs (2.513) bionic; urgency=medium * In the live-server build, prevent casper from mounting any existing diff --git a/live-build/auto/config b/live-build/auto/config index 6dc8881f..e02f0512 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -624,10 +624,10 @@ case $PROJECT in # linux-kvm is available since you control the # archive and can provide this metapackage as # necessary. - if [ "$ARCH" != "amd64" ] || ([ -z "$EXTRA_PPAS" ] && [ "$SUITE" != xenial ]); then - KERNEL_FLAVOURS=virtual - else + if [ "$ARCH" = "amd64" ] && ([ -n "$EXTRA_PPAS" ] || [ "$SUITE" = xenial ] || [ "$SUITE" = bionic ]); then KERNEL_FLAVOURS=kvm + else + KERNEL_FLAVOURS=virtual fi else add_task install minimal standard cloud-image From 0b2239c0695912a32c5a4122a56889ead15fb9e6 Mon Sep 17 00:00:00 2001 From: Christopher Glass Date: Thu, 22 Mar 2018 10:24:44 +0100 Subject: [PATCH 09/29] Parametrize BUILD_NAME in /etc/cloud/build.info to make it "minimal-aware". --- live-build/auto/build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/live-build/auto/build b/live-build/auto/build index e28e6ca7..b553c74b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -409,8 +409,13 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS fi fi if [ "$PROJECT" = "ubuntu-cpc" ]; then + if [ "${SUBPROJECT:-}" = minimized ]; then + BUILD_NAME=minimal + else + BUILD_NAME=server + fi cat > chroot/etc/cloud/build.info << EOF -build_name: server +build_name: $BUILD_NAME serial: $BUILDSTAMP EOF fi From 10ebe98d842f88b1fba2994cb7e3bc5a21b18b4a Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sun, 25 Mar 2018 10:06:13 -0500 Subject: [PATCH 10/29] Special-case Lubuntu's seeds so that the minimal install works. --- live-build/auto/config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/live-build/auto/config b/live-build/auto/config index e02f0512..fab37dc6 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -667,9 +667,14 @@ esac # we'll expand the base seed given here according to the STRUCTURE file, and # then look in all of the seeds found to see which snaps are seeded case $PROJECT:${SUBPROJECT:-} in - ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*) + ubuntu:*|kubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*) BASE_SEED='desktop' ;; + lubuntu-next*:*) + BASE_SEED='desktop-qt' + ;; + lubuntu*:*) + BASE_SEED='desktop-gtk' ubuntu-server:live) BASE_SEED='server' # subiquity is seeded but in a separate squashfs via hooks; set HOOK_SNAPS and ALL_SNAPS. From e4151ca741b58b55095abd070478bafe066b2535 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sun, 25 Mar 2018 10:10:39 -0500 Subject: [PATCH 11/29] Proper bash is rad, let's do it. --- live-build/auto/config | 1 + 1 file changed, 1 insertion(+) diff --git a/live-build/auto/config b/live-build/auto/config index fab37dc6..2e749096 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -675,6 +675,7 @@ case $PROJECT:${SUBPROJECT:-} in ;; lubuntu*:*) BASE_SEED='desktop-gtk' + ;; ubuntu-server:live) BASE_SEED='server' # subiquity is seeded but in a separate squashfs via hooks; set HOOK_SNAPS and ALL_SNAPS. From 3cb1f38cf2869b3a3d38f4e2ab95863c40b9309b Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 27 Mar 2018 09:47:12 +1300 Subject: [PATCH 12/29] Set the default locale to C.UTF-8 in all server and cloud images. (LP: #1751051, #1759003) --- debian/changelog | 7 +++++++ live-build/auto/build | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 419a00f1..07c684b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.515) UNRELEASED; urgency=medium + + * Set the default locale to C.UTF-8 in all server and cloud images. + (LP: #1751051, #1759003) + + -- Michael Hudson-Doyle Tue, 27 Mar 2018 09:41:59 +1300 + livecd-rootfs (2.514) bionic; urgency=medium * On amd64, if building minimal images for bionic, xenial, or extra ppa, diff --git a/live-build/auto/build b/live-build/auto/build index e28e6ca7..9343208d 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -94,6 +94,16 @@ Expire-Date: 0 lb bootstrap "$@" + case $PROJECT in + ubuntu-server|ubuntu-cpc) + # Set locale to C.UTF-8 by default. We should + # probably do this for all images early in the + # 18.10 cycle but for now just do it for + # server and cpc products. + echo "LANG=C.UTF-8" > chroot/etc/default/locale + ;; + esac + if [ "${SUBPROJECT:-}" = minimized ] \ && ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then # workaround for tzdata purge not removing these files From 51c663a8920326a4d27c26df791722dad137c9f7 Mon Sep 17 00:00:00 2001 From: Christopher Glass Date: Tue, 27 Mar 2018 16:09:35 +0200 Subject: [PATCH 13/29] Fixed whitespace/tabs. --- live-build/auto/build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index b553c74b..e9352ead 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -409,11 +409,11 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS fi fi if [ "$PROJECT" = "ubuntu-cpc" ]; then - if [ "${SUBPROJECT:-}" = minimized ]; then - BUILD_NAME=minimal - else - BUILD_NAME=server - fi + if [ "${SUBPROJECT:-}" = minimized ]; then + BUILD_NAME=minimal + else + BUILD_NAME=server + fi cat > chroot/etc/cloud/build.info << EOF build_name: $BUILD_NAME serial: $BUILDSTAMP From 4be1b98517bf1e7bdab56dcd9b5033656e061da9 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 27 Mar 2018 12:10:29 -0700 Subject: [PATCH 14/29] releasing package livecd-rootfs version 2.515 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 07c684b5..8d632ba8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -livecd-rootfs (2.515) UNRELEASED; urgency=medium +livecd-rootfs (2.515) bionic; urgency=medium * Set the default locale to C.UTF-8 in all server and cloud images. (LP: #1751051, #1759003) - -- Michael Hudson-Doyle Tue, 27 Mar 2018 09:41:59 +1300 + -- Michael Hudson-Doyle Tue, 27 Mar 2018 09:59:02 +1300 livecd-rootfs (2.514) bionic; urgency=medium From 2be57e7e60183d16edf7280e603bb8c551de4336 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 27 Mar 2018 12:12:35 -0700 Subject: [PATCH 15/29] releasing package livecd-rootfs version 2.516 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 025c1ad2..4ca89443 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.516) UNRELEASED; urgency=medium +livecd-rootfs (2.516) bionic; urgency=medium [ Chris Glass ] * Make sure we call the build "minimal" within the cloud build info, when building a minimized image. - -- Steve Langasek Tue, 27 Mar 2018 12:11:36 -0700 + -- Steve Langasek Tue, 27 Mar 2018 12:12:31 -0700 livecd-rootfs (2.515) bionic; urgency=medium From 152adcaa04d9ed7af03a7eca416d300965535063 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 3 Apr 2018 05:12:22 -0500 Subject: [PATCH 16/29] live-build/functions: add snap preseeding support --- live-build/functions | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/live-build/functions b/live-build/functions index 66aadff1..f74d9d44 100644 --- a/live-build/functions +++ b/live-build/functions @@ -360,3 +360,90 @@ recreate_initramfs() { esac mv "$CHROOT"/boot/initrd.img-* $DESTDIR } + +_snap_preseed() { + # Download the snap/assertion and add to the preseed + local CHROOT_ROOT=$1 + local SNAP=$2 + local SNAP_NAME=${SNAP%/*} + local CHANNEL=${3:?Snap channel must be specified} + + local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed" + local snaps_dir="$seed_dir/snaps" + local seed_yaml="$seed_dir/seed.yaml" + local assertions_dir="$seed_dir/assertions" + + # Download the snap & assertion + chroot $CHROOT_ROOT sh -c " + set -x; + cd /var/lib/snapd/seed; + SNAPPY_STORE_NO_CDN=1 snap download \ + --channel=$CHANNEL \"$SNAP_NAME\"" + 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 +- name: ${SNAP_NAME} + channel: ${CHANNEL} +EOF + + case ${SNAP} in */classic) echo " classic: true" >> $seed_yaml;; esac + + echo -n " file: " >> $seed_yaml + (cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml +} + +snap_prepare() { + # Configure basic snapd assertions and pre-seeds the 'core' snap + local CHROOT_ROOT=$1 + + local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed" + local snaps_dir="$seed_dir/snaps" + local assertions_dir="$seed_dir/assertions" + local model_assertion="$assertions_dir/generic-classic.model" + local account_key_assertion="$assertions_dir/generic.account-key" + local account_assertion="$assertions_dir/generic.account" + + mkdir -p "$assertions_dir" + mkdir -p "$snaps_dir" + + if ! [ -e "$model_assertion" ] ; then + snap known --remote model series=16 \ + model=generic-classic brand-id=generic \ + > "$model_assertion" + fi + + if ! [ -e "$account_key_assertion" ] ; then + local account_key=$(sed -n -e's/sign-key-sha3-384: //p' \ + < "$model_assertion") + snap known --remote account-key \ + public-key-sha3-384="$account_key" \ + > "$account_key_assertion" + fi + + # XXX Copied from auto/build this value is never used. + # Is that correct in that file or was there a reason for this? + # account=$(sed -n -e's/account-id: //p' \ < "$account_key_assertion") + + if ! [ -e "$account_assertion" ] ; then + snap known --remote account account-id=generic \ + > "$account_assertion" + fi + + # Download the core snap + if ! [ -f $snaps_dir/core_[0-9]*.snap ] ; then + _snap_preseed $CHROOT_ROOT core stable + fi +} + +snap_preseed() { + # Preseeed a snap in the image + local CHROOT_ROOT=$1 + local SNAP=$2 + local CHANNEL=${3:-stable} + + snap_prepare $CHROOT_ROOT + _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL +} From f73c0f4068ce9ce131e3fcb16aa5bc3294efb24d Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Tue, 3 Apr 2018 11:56:34 +0100 Subject: [PATCH 17/29] releasing package livecd-rootfs version 2.517 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fcc3dae9..1a66cf1a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -livecd-rootfs (2.517) UNRELEASED; urgency=medium +livecd-rootfs (2.517) bionic; urgency=medium [ Simon Quigley ] * Add proper lubuntu support in BASE_SEED. - -- Iain Lane Tue, 03 Apr 2018 11:32:08 +0100 + -- Iain Lane Tue, 03 Apr 2018 11:56:32 +0100 livecd-rootfs (2.516) bionic; urgency=medium From 8d5af150cd6cb1f8dbefbbbc65b0ca5692b79dc8 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 3 Apr 2018 14:56:34 +0100 Subject: [PATCH 18/29] Make subiquity installer boot quicker, by making dhcp interfaces optional, such that wait-online is not blocking bringing up the installer UI. --- debian/changelog | 8 ++++++++ .../overlay/etc/netplan/00-installer-config.yaml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1a66cf1a..1f43f3b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.518) UNRELEASED; urgency=medium + + * Make subiquity installer boot quicker, by making dhcp interfaces + optional, such that wait-online is not blocking bringing up the + installer UI. + + -- Dimitri John Ledkov Tue, 03 Apr 2018 14:36:43 +0100 + livecd-rootfs (2.517) bionic; urgency=medium [ Simon Quigley ] diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml b/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml index b8399cb6..bfa19a26 100644 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml +++ b/live-build/ubuntu-server/includes.binary/overlay/etc/netplan/00-installer-config.yaml @@ -7,7 +7,9 @@ network: match: name: "en*" dhcp4: true + optional: true all-eth: match: name: "eth*" dhcp4: true + optional: true From e65b912d892c9f0eeb6e578cd7ac094e45dd600a Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 3 Apr 2018 14:57:02 +0100 Subject: [PATCH 19/29] releasing package livecd-rootfs version 2.518 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f43f3b8..b5829624 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.518) UNRELEASED; urgency=medium +livecd-rootfs (2.518) bionic; urgency=medium * Make subiquity installer boot quicker, by making dhcp interfaces optional, such that wait-online is not blocking bringing up the installer UI. - -- Dimitri John Ledkov Tue, 03 Apr 2018 14:36:43 +0100 + -- Dimitri John Ledkov Tue, 03 Apr 2018 14:56:58 +0100 livecd-rootfs (2.517) bionic; urgency=medium From e655aff7b162eada31dbd5c4f45d3d685cd0098e Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 6 Apr 2018 12:51:47 -0500 Subject: [PATCH 20/29] live-build/functions: Migrate from generic snap account-id --- live-build/functions | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/live-build/functions b/live-build/functions index f74d9d44..ceef5d78 100644 --- a/live-build/functions +++ b/live-build/functions @@ -423,12 +423,10 @@ snap_prepare() { > "$account_key_assertion" fi - # XXX Copied from auto/build this value is never used. - # Is that correct in that file or was there a reason for this? - # account=$(sed -n -e's/account-id: //p' \ < "$account_key_assertion") + account=$(sed -n -e's/account-id: //p' \ < "$account_key_assertion") if ! [ -e "$account_assertion" ] ; then - snap known --remote account account-id=generic \ + snap known --remote account account-id=$account \ > "$account_assertion" fi From 57261c3edfe39051a245a2a43e89a4194d217e4a Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 6 Apr 2018 13:12:53 -0500 Subject: [PATCH 21/29] auto/build: Install snaps using common functions --- live-build/auto/build | 59 ++++--------------------------------------- 1 file changed, 5 insertions(+), 54 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index 22863f8e..6a8f58f3 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -15,6 +15,8 @@ if [ -z "${PROJECT:-}" ]; then exit 1 fi +. config/functions + # Link output files somewhere BuildLiveCD will be able to find them. PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" @@ -35,45 +37,14 @@ Setup_cleanup preinstall_snaps() { lb chroot_resolv install + snap_prepare chroot + snap_channel="stable/ubuntu-$(distro-info --series="$LB_DISTRIBUTION" \ -r | awk '{ print $1 }')" - chroot chroot sh -c ' - set -x; - cd /var/lib/snapd/seed; - SNAPPY_STORE_NO_CDN=1 snap download core' for snap in "$@"; do - chroot chroot sh -c " - set -x; - cd /var/lib/snapd/seed; - SNAPPY_STORE_NO_CDN=1 snap download --channel=$snap_channel \"${snap%/*}\"" + snap_preseed chroot "${snap}" "$snap_channel" done lb chroot_resolv remove - - CORE_SNAP=$(cd chroot/var/lib/snapd/seed; ls -1 core_*.snap) - - cat < chroot/var/lib/snapd/seed/seed.yaml -snaps: - - name: core - channel: stable - file: ${CORE_SNAP} -EOF - for snap in "$@"; do - snap_name=${snap%/*} - cat <> chroot/var/lib/snapd/seed/seed.yaml - - name: ${snap_name} - channel: $snap_channel -EOF - case ${snap} in */classic) echo " classic: true" >> chroot/var/lib/snapd/seed/seed.yaml;; esac - echo -n " file: " >> chroot/var/lib/snapd/seed/seed.yaml - (cd chroot/var/lib/snapd/seed; ls -1 ${snap_name}_*.snap) \ - >> chroot/var/lib/snapd/seed/seed.yaml - done - - mkdir -p chroot/var/lib/snapd/seed/snaps \ - chroot/var/lib/snapd/seed/assertions - mv chroot/var/lib/snapd/seed/*.assert \ - chroot/var/lib/snapd/seed/assertions/ - mv chroot/var/lib/snapd/seed/*.snap chroot/var/lib/snapd/seed/snaps/ } rm -f binary.success @@ -384,26 +355,6 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS case $PROJECT:$SUBPROJECT in *) if [ -e "config/seeded-snaps" ]; then - assertions_dir="chroot/var/lib/snapd/seed/assertions" - model_assertion="$assertions_dir/generic-classic.model" - account_key_assertion="$assertions_dir/generic.account-key" - account_assertion="$assertions_dir/generic.account" - - mkdir -p "$assertions_dir" - snap known --remote model series=16 \ - model=generic-classic brand-id=generic \ - > "$model_assertion" - account_key=$(sed -n -e's/sign-key-sha3-384: //p' \ - < "$model_assertion") - - snap known --remote account-key \ - public-key-sha3-384="$account_key" \ - > "$account_key_assertion" - account=$(sed -n -e's/account-id: //p' \ - < "$account_key_assertion") - - snap known --remote account account-id=generic \ - > "$account_assertion" snap_list=$(cat config/seeded-snaps) preinstall_snaps $snap_list fi From 829716a6d72a794a90639e28f62cbc2fe73dcf6e Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 6 Apr 2018 17:03:27 -0500 Subject: [PATCH 22/29] live-build/functions: Change arithmetic to make the file 'sh' friendly --- live-build/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/live-build/functions b/live-build/functions index ceef5d78..dc78b953 100644 --- a/live-build/functions +++ b/live-build/functions @@ -1,6 +1,7 @@ # vi: ts=4 expandtab syntax=sh -imagesize=${IMAGE_SIZE:-$((2252*1024**2))} # 2.2G (the current size we ship) +#imagesize=${IMAGE_SIZE:-$((2252*1024**2))} # 2.2G (the current size we ship) +imagesize=${IMAGE_SIZE:-2361393152} # 2.2G (the current size we ship) fs_label="${FS_LABEL:-rootfs}" rootfs_dev_mapper= From 936c3dbc797345a31b879b248bb701d2ec72503c Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 6 Apr 2018 17:05:15 -0500 Subject: [PATCH 23/29] live-build/functions: Update snap seed.yaml format to comply with yaml spec --- live-build/functions | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/live-build/functions b/live-build/functions index dc78b953..298f7f08 100644 --- a/live-build/functions +++ b/live-build/functions @@ -386,13 +386,14 @@ _snap_preseed() { # Add the snap to the seed.yaml ! [ -e $seed_yaml ] && echo "snaps:" > $seed_yaml cat <> $seed_yaml -- name: ${SNAP_NAME} - channel: ${CHANNEL} + - + name: ${SNAP_NAME} + channel: ${CHANNEL} EOF - case ${SNAP} in */classic) echo " classic: true" >> $seed_yaml;; esac + case ${SNAP} in */classic) echo " classic: true" >> $seed_yaml;; esac - echo -n " file: " >> $seed_yaml + echo -n " file: " >> $seed_yaml (cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml } From 0dbaf4cc9d7f638b74f7b50a81b97bff2a7d0a83 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Fri, 6 Apr 2018 20:14:23 -0500 Subject: [PATCH 24/29] live-build/functions: Drop spurious backslash --- live-build/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/functions b/live-build/functions index 298f7f08..5af5c293 100644 --- a/live-build/functions +++ b/live-build/functions @@ -425,7 +425,7 @@ snap_prepare() { > "$account_key_assertion" fi - account=$(sed -n -e's/account-id: //p' \ < "$account_key_assertion") + account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") if ! [ -e "$account_assertion" ] ; then snap known --remote account account-id=$account \ From cbcb5d3ed80278e202ddf5fed31cc4f320b6c703 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 10:09:26 -0500 Subject: [PATCH 25/29] live-build/functions: reduce scope of snap account variable * Only shell out to set $account when we need to use it. * Reduce scope of $account to make it local to the function * Fix indenting within an 'if' block --- live-build/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/live-build/functions b/live-build/functions index 5af5c293..6f97592d 100644 --- a/live-build/functions +++ b/live-build/functions @@ -425,11 +425,11 @@ snap_prepare() { > "$account_key_assertion" fi - account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") if ! [ -e "$account_assertion" ] ; then - snap known --remote account account-id=$account \ - > "$account_assertion" + local account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") + snap known --remote account account-id=$account \ + > "$account_assertion" fi # Download the core snap From 73dba1f31a3bf78488f3b6083dde9f585d6e0b23 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 11:59:19 -0500 Subject: [PATCH 26/29] snap preseeding: capture Ubuntu snap seeding policy in code When no channel is given for a pre-seeded snap, the channel should be stable/ubuntu-XX.YY to match Ubuntu policy. This patch adds the LB_DISTRIBUTION var to config/{binary,chroot} to have a common way of determining the Ubuntu XX.YY version number between hooks and auto/build. --- live-build/auto/build | 4 +--- live-build/auto/config | 2 ++ live-build/functions | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index 6a8f58f3..8689bcf1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -39,10 +39,8 @@ preinstall_snaps() { lb chroot_resolv install snap_prepare chroot - snap_channel="stable/ubuntu-$(distro-info --series="$LB_DISTRIBUTION" \ - -r | awk '{ print $1 }')" for snap in "$@"; do - snap_preseed chroot "${snap}" "$snap_channel" + snap_preseed chroot "${snap}" done lb chroot_resolv remove } diff --git a/live-build/auto/config b/live-build/auto/config index e02f0512..b0c6f7f6 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -825,9 +825,11 @@ lb config noauto \ echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot +echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/chroot echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary +echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary case $ARCH+$SUBARCH in armhf+raspi2) diff --git a/live-build/functions b/live-build/functions index 6f97592d..04fc25dd 100644 --- a/live-build/functions +++ b/live-build/functions @@ -362,6 +362,11 @@ recreate_initramfs() { mv "$CHROOT"/boot/initrd.img-* $DESTDIR } +release_ver() { + # Return the release version number + distro-info --series="$LB_DISTRIBUTION" -r | awk '{ print $1 }' +} + _snap_preseed() { # Download the snap/assertion and add to the preseed local CHROOT_ROOT=$1 @@ -442,7 +447,9 @@ snap_preseed() { # Preseeed a snap in the image local CHROOT_ROOT=$1 local SNAP=$2 - local CHANNEL=${3:-stable} + # Per Ubuntu policy, all seeded snaps (with the exception of the core + # snap) must pull from stable/ubuntu-$(release_ver) as their channel. + local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"} snap_prepare $CHROOT_ROOT _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL From 5f12253791c98898477d20d04b6ef4e13493eb90 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 15:03:23 -0500 Subject: [PATCH 27/29] live-build/functions: Help developers resolve snap download issues --- live-build/functions | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/live-build/functions b/live-build/functions index 04fc25dd..cea6e042 100644 --- a/live-build/functions +++ b/live-build/functions @@ -380,11 +380,21 @@ _snap_preseed() { local assertions_dir="$seed_dir/assertions" # Download the snap & assertion + local snap_download_failed=0 chroot $CHROOT_ROOT sh -c " set -x; cd /var/lib/snapd/seed; SNAPPY_STORE_NO_CDN=1 snap download \ - --channel=$CHANNEL \"$SNAP_NAME\"" + --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 From 26f31fbd9cfef2c2c43e7b906427b1fee987064e Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Tue, 10 Apr 2018 16:33:22 -0500 Subject: [PATCH 28/29] live-build/functions: spelling fix --- live-build/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/functions b/live-build/functions index cea6e042..f3e1df0b 100644 --- a/live-build/functions +++ b/live-build/functions @@ -454,7 +454,7 @@ snap_prepare() { } snap_preseed() { - # Preseeed a snap in the image + # Preseed a snap in the image local CHROOT_ROOT=$1 local SNAP=$2 # Per Ubuntu policy, all seeded snaps (with the exception of the core From e5a57e5cc0f5ddccd8062f0e7296a3f0ec423b26 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 10 Apr 2018 15:59:37 -0700 Subject: [PATCH 29/29] releasing package livecd-rootfs version 2.519 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7e4810c7..f96bf01f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.519) UNRELEASED; urgency=medium +livecd-rootfs (2.519) bionic; urgency=medium [ Robert C Jennings ] * Refactor snap preseeding to allow additional snaps to be preseeded from hooks - -- Steve Langasek Tue, 10 Apr 2018 15:58:56 -0700 + -- Steve Langasek Tue, 10 Apr 2018 15:59:33 -0700 livecd-rootfs (2.518) bionic; urgency=medium