From 11a583d61954dc54afaf7733674605cdd000e59e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 30 Mar 2023 14:09:04 +0200 Subject: [PATCH 01/78] Initial implementation of canary image builds. --- debian/control | 1 + live-build/auto/config | 64 +++++++++- live-build/lb_binary_layered | 4 +- .../hooks.d/base/disk-image-uefi.binary | 6 +- .../hooks/020-canary-enhanced-sb.binary | 111 ++++++++++++++++++ .../ubuntu/hooks/020-canary-live.binary | 96 +++++++++++++++ .../ubuntu/hooks/020-canary-live.chroot_early | 26 ++++ .../hooks/040-hyperv-desktop-images.binary | 2 +- update-source-catalog | 71 ++++++----- 9 files changed, 346 insertions(+), 35 deletions(-) create mode 100644 live-build/ubuntu/hooks/020-canary-enhanced-sb.binary create mode 100755 live-build/ubuntu/hooks/020-canary-live.binary create mode 100755 live-build/ubuntu/hooks/020-canary-live.chroot_early diff --git a/debian/control b/debian/control index 438239e0..0307b539 100644 --- a/debian/control +++ b/debian/control @@ -34,6 +34,7 @@ Depends: ${misc:Depends}, python3-launchpadlib [!i386], python3-yaml, qemu-utils [!i386], + rsync, snapd (>= 2.39) [!i386], squashfs-tools (>= 1:3.3-1), sudo, diff --git a/live-build/auto/config b/live-build/auto/config index 1f812180..bb38f7d0 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -95,6 +95,13 @@ _register_pass () { PASSES="$PASSES $1" } +add_pass () +{ + local pass="$1" + _check_immutable_passes_to_layers + _register_pass "$pass" +} + add_task () { local pass="$1" @@ -724,6 +731,59 @@ case $PROJECT in ;; esac ;; + canary) + PASSES_TO_LAYERS="true" + # the minimal layer, for minimal installs + add_task minimal minimal standard ubuntu-desktop-minimal ubuntu-desktop-minimal-default-languages + add_package minimal cloud-init + # the standard layer, contains all base common packages for later layers (we're splitting out the snaps) + add_task minimal.standard ubuntu-desktop ubuntu-desktop-default-languages + # the classic layer, basically only contains snaps from the standard tasks + add_pass minimal.standard.classic + mv config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full \ + config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + # the live layer, contains all packages for the live session installer + # TODO: we should probably add the kernel per KERNEL_FLAVOURS + add_package minimal.standard.live linux-generic casper lvm2 mdadm + remove_package minimal.standard.live ubiquity-frontend-gtk + # the enhanced-secureboot layer, contains all packages for the enhanced secureboot install + add_package minimal.standard.enhanced-secureboot cryptsetup + # now let's create the neccessary catalog files + cat <<-EOF > config/minimal.catalog-in.yaml + name: "Ubuntu Desktop (minimized)" + description: >- + A minimal but usable Ubuntu Desktop. + id: ubuntu-desktop-minimal + type: fsimage-layered + variant: desktop + locale_support: langpack + EOF + cat <<-EOF > config/minimal.standard.catalog-in.yaml + name: "Ubuntu Desktop" + description: >- + A full featured Ubuntu Desktop. + id: ubuntu-desktop + type: fsimage-layered + variant: desktop + locale_support: langpack + default: yes + EOF + cat <<-EOF > config/minimal.standard.classic.catalog-in.yaml + id: ubuntu-desktop + variations: + classic: + path: minimal.standard.squashfs + EOF + cat <<-EOF > config/minimal.standard.enhanced-secureboot.catalog-in.yaml + id: ubuntu-desktop + variations: + enhanced-secureboot: + path: minimal.standard.enhanced-secureboot.squashfs + snapd_system_label: enhanced-secureboot-desktop + EOF + /usr/share/livecd-rootfs/checkout-translations-branch \ + https://git.launchpad.net/subiquity po config/catalog-translations + ;; *) touch config/universe-enabled PASSES_TO_LAYERS="true" @@ -1182,7 +1242,7 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in esac case $PROJECT:${SUBPROJECT:-} in - ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*) + ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*|ubuntu:canary) OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" KERNEL_FLAVOURS=none BINARY_REMOVE_LINUX=false @@ -1426,7 +1486,7 @@ EOF fi ;; - ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled|ubuntu-wsl:*|ubuntu-mini-iso:*) + ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled|ubuntu-wsl:*|ubuntu-mini-iso:*|ubuntu:canary) # Ensure that most things e.g. includes.chroot are copied as is for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do case $entry in diff --git a/live-build/lb_binary_layered b/live-build/lb_binary_layered index f31d5e22..146978d3 100755 --- a/live-build/lb_binary_layered +++ b/live-build/lb_binary_layered @@ -116,7 +116,9 @@ build_layered_squashfs () { create_manifest "chroot" "${squashfs_f_manifest}.full" # Delta manifest - diff -NU0 ${PWD}/livecd.${PROJECT_FULL}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest + diff -NU0 ${PWD}/livecd.${PROJECT_FULL}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest || true + echo "Delta manifest:" + cat $squashfs_f_manifest squashfs_f_size="${base}.size" du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_size}" diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index bbe271ad..0bf6c190 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -9,7 +9,11 @@ case $ARCH in ;; esac -case ${PROJECT:-} in +case ${PROJECT:-}:${SUBPROJECT:-} in + *:canary) + echo "We don't create EFI images for canary." + exit 0 + ;; ubuntu) IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process" FS_LABEL="desktop-rootfs" diff --git a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary new file mode 100644 index 00000000..e6829744 --- /dev/null +++ b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary @@ -0,0 +1,111 @@ +#! /bin/sh + +set -eux + +case $PASS in + minimal.standard.enhanced-secureboot) + ;; + *) + exit 0 + ;; +esac + +case ${SUBPROJECT:-} in + canary) + ;; + *) + echo "We don't run canary hooks for this project." + exit 0 + ;; +esac + +/usr/lib/snapd/snap-preseed --reset $(realpath "chroot") +rm -rf chroot/var/lib/snapd/seed/* + +# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-classic-2304-amd64 > config/classic-model.model +cat < config/classic-model.model +type: model +authority-id: canonical +series: 16 +brand-id: canonical +model: ubuntu-classic-2304-amd64 +architecture: amd64 +base: core22 +classic: true +distribution: ubuntu +grade: signed +snaps: + - + default-channel: classic-23.04/stable + id: UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH + name: pc + type: gadget + - + default-channel: 24-hwe/stable + id: pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza + name: pc-kernel + type: kernel + - + default-channel: latest/stable + id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT + name: core22 + type: base + - + default-channel: latest/stable + id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4 + name: snapd + type: snapd + - + default-channel: latest/stable + id: DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q + name: core20 + type: base + - + default-channel: latest/stable + id: EISPgh06mRh1vordZY9OZ34QHdd7OrdR + name: bare + type: base + - + default-channel: latest/stable + id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk + name: firefox + type: app + - + default-channel: latest/stable + id: lATO8HzwVvrAPrlZRAWpfyrJKlAJrZS3 + name: gnome-42-2204 + type: app + - + default-channel: latest/stable + id: jZLfBRzf1cYlYysIjD2bwSzNtngY0qit + name: gtk-common-themes + type: app + - + default-channel: latest/stable + id: gjf3IPXoRiipCu9K0kVu52f0H56fIksg + name: snap-store + type: app + - + default-channel: latest/stable + id: IrwRHakqtzhFRHJOOPxKVPU0Kk7Erhcu + name: snapd-desktop-integration + type: app +timestamp: 2023-03-19T12:00:00.0Z +sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn + +AcLBXAQAAQoABgUCZBxqbQAKCRDgT5vottzAEudYD/49FlV7VOhnZ1+c/jxQgu6ucGNjjOsZdmqi +2tJEz7tGyStMe2yDnBOjEBb6yvghzzXZX+gLIolHReXYWzrdB0UScPdXJvSRhngeAgn70hEC2H5S +Pb3/r3tXl3QQs0hd+5Szg31qICoW8ASOsvM/ymULTECOWOemCDnFRJ8wpAleNQ0LEACY/RD2814F +mmkunA6yXto1OhUySpaH5xXWoHjfvZsq/nXd4P1aI42aPxkB1JBHBwIl0ECVbzofCvh4f8NbbvgA +FuGfvFrNa9ifUh7m0L3XwZML9sVZKvLviG6tANHWl8sCJ02W+Hw4Lq93OC6rN5Kfii+1zhapFE8Q +tF0KtN6HPp69PzOzhYB52J66i1hrmWRkdoB4lqxOzpANYEXGCKopwTDP+eX3xIjiLft+sMmIHzXn +ITA2WLD31AxLXk4IKBWBLh3NgJa/A7tRjGnOhZaEfRA1clSsvSA45PXCDY9fuH3ejMvgi1qvO/TW +m2S+MgKSvJL6n5KRs5amBiiLqVuAs+WFOIr6c1d6PR6DoM4D7WJxR31jOJdAPh/VeT+DbOkFYybg +PXNB7cgStSAyvustnx6T8UgueAXy1QknO7TMco06R2MXS9DMWSOMMfyCJAbKvx9epkSXWpL487ag +h88GPKYhsiv85hZNB65Cpnz7MJJVWg0WIhGMwG9clg== +EOF + +env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model.model chroot +mv chroot/system-seed/systems/* chroot/system-seed/systems/classic +rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed +rm -rf chroot/system-seed/ diff --git a/live-build/ubuntu/hooks/020-canary-live.binary b/live-build/ubuntu/hooks/020-canary-live.binary new file mode 100755 index 00000000..9c53b281 --- /dev/null +++ b/live-build/ubuntu/hooks/020-canary-live.binary @@ -0,0 +1,96 @@ +#! /bin/sh + +set -eux + +case $PASS in + minimal.standard.live) + ;; + *) + exit 0 + ;; +esac + +case ${SUBPROJECT:-} in + canary) + ;; + *) + echo "We don't run canary hooks for this project." + exit 0 + ;; +esac + +# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-server-installer-classic-2304-amd64 > config/classic-model-installer.model +cat < config/classic-model-installer.model +type: model +authority-id: canonical +series: 16 +brand-id: canonical +model: ubuntu-server-installer-classic-2304-amd64 +architecture: amd64 +base: core22 +classic: true +distribution: ubuntu +grade: signed +snaps: + - + default-channel: latest/stable + id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT + name: core22 + type: base + - + default-channel: latest/stable + id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4 + name: snapd + type: snapd + - + classic: true + default-channel: latest/stable/canary-23.04 + id: ba2aj8guta0zSRlT3QM5aJNAUXPlBtf9 + name: subiquity + type: app +timestamp: 2023-03-19T12:00:00.0Z +sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn + +AcLBXAQAAQoABgUCZCT4iAAKCRDgT5vottzAEkmPD/46nms8edTFkoiiH/SjAdyo8MW2FhR3tW03 +CyH1NQwrNJtHiqb7EcWQHDPexM3Wxvwj2iPN04IWlGugge7Fw12AmhVsYYCnCjYjDL8uBa9ixBj3 +kghOsFlVbDBk+f5tLmNGNncQfPbV6TvywK9a+2zgVEdRdLlmNeorX3b7P0woCIWg9wEikX+vcLi/ +q1GvWtI4Gb/rAIN+/OaD4DFgbJSUdSaayGX90hbNtvsZc0K7KPTeNlF0IGKg72yvqBGDX/0m2IDb +6HozMxGg7xcq+WwHU3hucBNqw6kWKKDd1gzZJICrJf9kLEZ7GoGa8Oj9eET+bp2KYVHzjNzHvQbd +v4odCG3Wn7m5ogpPmt/mUoTOhVtY/RNGnk46eHAFHuFcPAjR1BnIfLLmh4EmEnkIboTrlBKFgHMW +ddFSOFYonboYu7R9Gad3J+9VD5IyyNqJNpCrEqLfw81QaFz1+KM00XD+wns2+ZqnI90a6olXcmUH +t1Fv0QIDNCG0x8Lf+My/gJycNCEbUj+TA6xOL9NH0EFU6myKyR74sC5tlMZPMN2RKdZglOZUnkyC +lpuhRVI3fcNZL2sVGwmvoKUDj7QaLrETpCUqDXMzNw73NOS3zA8+gQr/X438KpEFscszS1g+FtJ4 +LVOcgLrDw/S61ciBuOBeOaskqZdZ4xYmm1wKMzecXg== +EOF + +env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model-installer.model chroot +mv chroot/system-seed/systems/* chroot/system-seed/systems/classic-installer +rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed +rm -rf chroot/system-seed/ + +cat < chroot/var/lib/snapd/modeenv +mode=run +recovery_system=classic-installer +EOF + +# Temporary while we still use the subiquity TUI for the live system +cat > chroot/usr/lib/systemd/user/subiquity-tui.service << EOF +[Unit] +Description=subiquity tui +PartOf=graphical-session.target +After=graphical-session.target + +# Never run in GDM +Conflicts=gnome-session@gnome-login.target + +[Service] +Type=simple +ExecStart=/usr/bin/gnome-terminal --wait -- sudo sh -c 'echo waiting for snapd; snap wait system seed.loaded; sleep 5; snap run subiquity' +Restart=no +EOF +mkdir chroot/etc/systemd/user/graphical-session.target.wants/ +ln -vs /usr/lib/systemd/user/subiquity-tui.service chroot/etc/systemd/user/graphical-session.target.wants/ + +mv chroot/boot/initrd.img-* ${PWD}/livecd.${PROJECT}.initrd-generic +mv chroot/boot/vmlinu?-* ${PWD}/livecd.${PROJECT}.kernel-generic +chmod a+r ${PWD}/livecd.${PROJECT}.initrd-generic ${PWD}/livecd.${PROJECT}.kernel-generic diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early new file mode 100755 index 00000000..00b98477 --- /dev/null +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -0,0 +1,26 @@ +#! /bin/sh + +case $PASS in + minimal.standard.live) + ;; + *) + exit 0 + ;; +esac + +case ${SUBPROJECT:-} in + canary) + ;; + *) + echo "We don't run canary hooks for this project." + exit 0 + ;; +esac + +cat < /etc/initramfs-tools/conf.d/casperize.conf +export CASPER_GENERATE_UUID=1 +EOF + +cat < /etc/initramfs-tools/conf.d/default-layer.conf +LAYERFS_PATH=${PASS}.squashfs +EOF diff --git a/live-build/ubuntu/hooks/040-hyperv-desktop-images.binary b/live-build/ubuntu/hooks/040-hyperv-desktop-images.binary index 9ed8f4c4..b27114ab 100644 --- a/live-build/ubuntu/hooks/040-hyperv-desktop-images.binary +++ b/live-build/ubuntu/hooks/040-hyperv-desktop-images.binary @@ -3,7 +3,7 @@ echo "Creating Hyper-V image with Desktop..." case ${SUBPROJECT:-} in - minimized) + minimized|canary) echo "We don't create minimized images for $0." exit 0 ;; diff --git a/update-source-catalog b/update-source-catalog index 6616d609..f2177844 100755 --- a/update-source-catalog +++ b/update-source-catalog @@ -28,45 +28,56 @@ with open(opts.template) as fp: template = yaml.safe_load(fp) -template['size'] = int(opts.size) -template['path'] = opts.squashfs - -en_name = template['name'] -en_description = template['description'] - -template['name'] = {'en': en_name} -template['description'] = {'en': en_description} - -for mo in glob.glob(os.path.join(opts.translations, '*.mo')): - with open(mo, 'rb') as fp: - t = gettext.GNUTranslations(fp=fp) - t_name = t.gettext(en_name) - if t_name != en_name: - lang = os.path.splitext(os.path.basename(mo))[0] - template['name'][lang] = t_name - t_description = t.gettext(en_description) - if t_description != en_description: - lang = os.path.splitext(os.path.basedescription(mo))[0] - template['description'][lang] = t_description - if opts.langs is not None: - template['preinstalled_langs'] = opts.langs.split(',') - -output.append(template) +id = template['id'] +for entry in output: + # First, look if this source catalogue template id is already present. + # If so, use the template to extend the existing entry with additional + # variations. + if entry['id'] == id: + if 'variations' not in template: + print("Non unique id in source catalog but no variations!") + sys.exit(1) + if 'variations' not in entry: + entry['variations'] = {} + for k, variation in template['variations'].items(): + variation['size'] = int(opts.size) + entry['variations'].update(template['variations']) + break +else: + # No entry with this id found, so add a new one. + template['size'] = int(opts.size) + template['path'] = opts.squashfs + + en_name = template['name'] + en_description = template['description'] + + template['name'] = {'en': en_name} + template['description'] = {'en': en_description} + + for mo in glob.glob(os.path.join(opts.translations, '*.mo')): + with open(mo, 'rb') as fp: + t = gettext.GNUTranslations(fp=fp) + t_name = t.gettext(en_name) + if t_name != en_name: + lang = os.path.splitext(os.path.basename(mo))[0] + template['name'][lang] = t_name + t_description = t.gettext(en_description) + if t_description != en_description: + lang = os.path.splitext(os.path.basedescription(mo))[0] + template['description'][lang] = t_description + if opts.langs is not None: + template['preinstalled_langs'] = opts.langs.split(',') + + output.append(template) default_count = 0 -ids = set() for entry in output: if entry.get('default', False): default_count += 1 - ids.add(entry['id']) - if default_count > 1: print("Too many defaults in source catalog!") sys.exit(1) -if len(ids) != len(output): - print("Non unique ids in %s!" % output) - with open(opts.output, 'w') as fp: yaml.dump(output, fp) From 0518f73a7f49ea0d5f2ec269cd3dabe3090caa90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 5 Apr 2023 20:51:42 +0200 Subject: [PATCH 02/78] Changelog entry. --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index ef831f37..f7c6f80c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.820) UNRELEASED; urgency=medium + + * Initial implementation of canary image builds for 23.04. + + -- Łukasz 'sil2100' Zemczak Wed, 05 Apr 2023 20:50:35 +0200 + livecd-rootfs (2.819) lunar; urgency=medium [ Heinrich Schuchardt ] From 959011d5fcf611b78742d1a65d8b581277a46a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 5 Apr 2023 22:29:40 +0200 Subject: [PATCH 03/78] Some fixes per review - thanks Dan! --- live-build/auto/config | 5 +++-- update-source-catalog | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index b582e3c2..a0a76838 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -756,6 +756,7 @@ case $PROJECT in # the enhanced-secureboot layer, contains all packages for the enhanced secureboot install add_package minimal.standard.enhanced-secureboot cryptsetup # now let's create the neccessary catalog files + # TODO: make sure that we handle locale_support: langpack correctly cat <<-EOF > config/minimal.catalog-in.yaml name: "Ubuntu Desktop (minimized)" description: >- @@ -763,7 +764,7 @@ case $PROJECT in id: ubuntu-desktop-minimal type: fsimage-layered variant: desktop - locale_support: langpack + locale_support: none EOF cat <<-EOF > config/minimal.standard.catalog-in.yaml name: "Ubuntu Desktop" @@ -772,7 +773,7 @@ case $PROJECT in id: ubuntu-desktop type: fsimage-layered variant: desktop - locale_support: langpack + locale_support: none default: yes EOF cat <<-EOF > config/minimal.standard.classic.catalog-in.yaml diff --git a/update-source-catalog b/update-source-catalog index f2177844..0869dd39 100755 --- a/update-source-catalog +++ b/update-source-catalog @@ -37,11 +37,9 @@ for entry in output: if 'variations' not in template: print("Non unique id in source catalog but no variations!") sys.exit(1) - if 'variations' not in entry: - entry['variations'] = {} for k, variation in template['variations'].items(): variation['size'] = int(opts.size) - entry['variations'].update(template['variations']) + entry.setdefault('variations', {}).update(template['variations']) break else: # No entry with this id found, so add a new one. From 4997edb190d61b75efc22658ea32701b99cf5147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 09:21:27 +0200 Subject: [PATCH 04/78] Use never model assertion. --- .../hooks/020-canary-enhanced-sb.binary | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary index e6829744..6bffc439 100644 --- a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary +++ b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary @@ -70,6 +70,11 @@ snaps: id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk name: firefox type: app + - + default-channel: latest/stable + id: rw36mkAjdIKl13dzfwyxP87cejpyIcct + name: gnome-3-38-2004 + type: app - default-channel: latest/stable id: lATO8HzwVvrAPrlZRAWpfyrJKlAJrZS3 @@ -93,16 +98,16 @@ snaps: timestamp: 2023-03-19T12:00:00.0Z sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn -AcLBXAQAAQoABgUCZBxqbQAKCRDgT5vottzAEudYD/49FlV7VOhnZ1+c/jxQgu6ucGNjjOsZdmqi -2tJEz7tGyStMe2yDnBOjEBb6yvghzzXZX+gLIolHReXYWzrdB0UScPdXJvSRhngeAgn70hEC2H5S -Pb3/r3tXl3QQs0hd+5Szg31qICoW8ASOsvM/ymULTECOWOemCDnFRJ8wpAleNQ0LEACY/RD2814F -mmkunA6yXto1OhUySpaH5xXWoHjfvZsq/nXd4P1aI42aPxkB1JBHBwIl0ECVbzofCvh4f8NbbvgA -FuGfvFrNa9ifUh7m0L3XwZML9sVZKvLviG6tANHWl8sCJ02W+Hw4Lq93OC6rN5Kfii+1zhapFE8Q -tF0KtN6HPp69PzOzhYB52J66i1hrmWRkdoB4lqxOzpANYEXGCKopwTDP+eX3xIjiLft+sMmIHzXn -ITA2WLD31AxLXk4IKBWBLh3NgJa/A7tRjGnOhZaEfRA1clSsvSA45PXCDY9fuH3ejMvgi1qvO/TW -m2S+MgKSvJL6n5KRs5amBiiLqVuAs+WFOIr6c1d6PR6DoM4D7WJxR31jOJdAPh/VeT+DbOkFYybg -PXNB7cgStSAyvustnx6T8UgueAXy1QknO7TMco06R2MXS9DMWSOMMfyCJAbKvx9epkSXWpL487ag -h88GPKYhsiv85hZNB65Cpnz7MJJVWg0WIhGMwG9clg== +AcLBXAQAAQoABgUCZC4CDgAKCRDgT5vottzAEiFvEACU9KsUFmAcShhpIz+NRGVP6d1Z+bW1FcUf +Cxl2UParnXR7Kv12htnw5u837MZjI3gG8kti2L2SxRcg/fy3iJLkTRBEaR/q6rY4O0fkasJUKxHh +z6xx2jaNhsUqnplU5gba9xmmaI5AQp4yf1ktF71HAeM4OzUFrCkjXNTbf7xfkKENxuAOfsPetu5c +6Xc8UtQymtYnjsyvtaLNoXl9vVN59nqk/sxWkwJRtYrFX+Fjt1R/ft4Fo1U7x/OeUX1qpFHSEgnR +NPxzJQ0uzaCamXY1qu1iq6R925eah22auOQM2m/CTzOMdI3IuRAqnLsrk9HpGXz2gWKLS/UEfAlr +OMOoV64DHnQ6k8pwjiYt4K9zNxNKK1MB9hnUBOWYb69pgqoQ2djo6codlxknANN4g3zsUH8KDHb8 +9wNEu7WuYS8JIDpdrNGB5XKo+N5+WswfqX0Oh1mtPMw+DqIA8GkxJFC452Afv7+VDQUZs5wIe7OX +oQ5Q/u5X7WyKpqTdRi0J4/Eq61HidYOOW26Vc8MNArn1u0eabZBtHrxMOHCxu0hmsLHaXQSBljdr +Ekm0W8qT4AT0GSk5CY8kx+UvCn6FLxMuv8xjWoX3OLcQx31yO6Uy6c2LN6nSlovDghKP5V1KvlKl +WiXM9CPKCZv/Es3uOp/ke0wWL7v0MZhzUJ+QhOtTNg== EOF env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model.model chroot From edc6a7d5765b3119b4b2cfcece248ccdb7967a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 16:45:13 +0200 Subject: [PATCH 05/78] SUBPROJECT is not defined by default in chroot_early hooks. --- live-build/ubuntu/hooks/020-canary-live.chroot_early | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early index 00b98477..8a75ac78 100755 --- a/live-build/ubuntu/hooks/020-canary-live.chroot_early +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -8,6 +8,8 @@ case $PASS in ;; esac +. /root/config/chroot + case ${SUBPROJECT:-} in canary) ;; From 3752ea7cf15d373d3997428ec4ccaac7d834bf4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 16:47:59 +0200 Subject: [PATCH 06/78] Add -eu to the early hook as well. --- live-build/ubuntu/hooks/020-canary-live.chroot_early | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early index 8a75ac78..64a3d7de 100755 --- a/live-build/ubuntu/hooks/020-canary-live.chroot_early +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -1,5 +1,7 @@ #! /bin/sh +set -eu + case $PASS in minimal.standard.live) ;; From 3ec8601febc286162439aaa099e2f213f092f7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 19:25:44 +0200 Subject: [PATCH 07/78] Ok, early hooks do not have the environment. Just case on canary being the only one using hooks for now. --- live-build/ubuntu/hooks/020-canary-live.chroot_early | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early index 64a3d7de..884b05b5 100755 --- a/live-build/ubuntu/hooks/020-canary-live.chroot_early +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -10,16 +10,7 @@ case $PASS in ;; esac -. /root/config/chroot - -case ${SUBPROJECT:-} in - canary) - ;; - *) - echo "We don't run canary hooks for this project." - exit 0 - ;; -esac +# TODO: Make sure this is only executed for canary builds cat < /etc/initramfs-tools/conf.d/casperize.conf export CASPER_GENERATE_UUID=1 From 1dd00d9795aff2380fea438b3f931d881d83e56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 21:42:12 +0200 Subject: [PATCH 08/78] Add the includes as well. --- .../etc/cloud/cloud.cfg | 117 ++++++++++++++++++ .../etc/cloud/cloud.cfg.d/06_quiet.cfg | 4 + .../journald.conf.d/no-rate-limit.conf | 2 + .../override.conf" | 3 + .../no-compact.conf | 4 + .../no-hardening.conf | 4 + .../usr/bin/subiquity-shell | 3 + .../system/getty@.service.d/autologin.conf | 3 + .../usr/lib/systemd/system/getty@tty1.service | 1 + .../media-filesystem.mount | 1 + .../subiquity-serial.conf | 9 ++ .../subiquity-serial.conf | 4 + .../subiquity.conf | 14 +++ .../system/snapd.service.d/no-reexec.conf | 2 + .../lib/systemd/system/subiquity_config.mount | 4 + .../lib/systemd/systemd-networkd-wait-online | 1 + .../var/lib/cloud/seed/nocloud/meta-data | 0 .../var/lib/cloud/seed/nocloud/user-data | 0 18 files changed, 176 insertions(+) create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg.d/06_quiet.cfg create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/journald.conf.d/no-rate-limit.conf create mode 100644 "live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-compact.conf create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-hardening.conf create mode 100755 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/bin/subiquity-shell create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@.service.d/autologin.conf create mode 120000 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@tty1.service create mode 120000 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snapd.service.d/no-reexec.conf create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/subiquity_config.mount create mode 120000 live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/systemd-networkd-wait-online create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/meta-data create mode 100644 live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/user-data diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg new file mode 100644 index 00000000..e9571afd --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg @@ -0,0 +1,117 @@ +# The top level settings are used as module +# and system configuration. + +# A set of users which may be applied and/or used by various modules +# when a 'default' entry is found it will reference the 'default_user' +# from the distro configuration specified below +users: + - default + +# If this is set, 'root' will not be able to ssh in and they +# will get a message to login instead as the default $user +disable_root: true + +# This will cause the set+update hostname module to not operate (if true) +preserve_hostname: true + +ssh_pwauth: yes +chpasswd: + expire: false + +# This is the initial network config. +# It can be overwritten by cloud-init or subiquity. +network: + version: 2 + ethernets: + zz-all-en: + match: + name: "en*" + dhcp4: true + zz-all-eth: + match: + name: "eth*" + dhcp4: true + +# We used to have a custom final_message here. Just use the default instead. + +# Example datasource config +# datasource: +# Ec2: +# metadata_urls: [ 'blah.com' ] +# timeout: 5 # (defaults to 50 seconds) +# max_wait: 10 # (defaults to 120 seconds) + +# The modules that run in the 'init' stage +cloud_init_modules: + - bootcmd + - write-files + - ca-certs + - rsyslog + - users-groups + - ssh + +# The modules that run in the 'config' stage +cloud_config_modules: +# Emit the cloud config ready event +# this can be used by upstart jobs for 'start on cloud-config'. + - ssh-import-id + - set-passwords + - timezone + - disable-ec2-metadata + - runcmd + +# The modules that run in the 'final' stage +cloud_final_modules: + - scripts-per-once + - scripts-user + - ssh-authkey-fingerprints + - keys-to-console + - phone-home + - final-message + +# System and/or distro specific settings +# (not accessible to handlers/transforms) +system_info: + # This will affect which distro class gets used + distro: ubuntu + # Default user name + that default users groups (if added/used) + default_user: + name: installer + lock_passwd: false + gecos: Ubuntu + groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video] + sudo: ["ALL=(ALL) NOPASSWD:ALL"] + shell: /usr/bin/subiquity-shell + # Automatically discover the best ntp_client + ntp_client: auto + # Other config here will be given to the distro class and/or path classes + paths: + cloud_dir: /var/lib/cloud/ + templates_dir: /etc/cloud/templates/ + upstart_dir: /etc/init/ + package_mirrors: + - arches: [i386, amd64] + failsafe: + primary: http://archive.ubuntu.com/ubuntu + security: http://security.ubuntu.com/ubuntu + search: + primary: + - http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/ + - http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/ + - http://%(region)s.clouds.archive.ubuntu.com/ubuntu/ + security: [] + - arches: [arm64, armel, armhf] + failsafe: + primary: http://ports.ubuntu.com/ubuntu-ports + security: http://ports.ubuntu.com/ubuntu-ports + search: + primary: + - http://%(ec2_region)s.ec2.ports.ubuntu.com/ubuntu-ports/ + - http://%(availability_zone)s.clouds.ports.ubuntu.com/ubuntu-ports/ + - http://%(region)s.clouds.ports.ubuntu.com/ubuntu-ports/ + security: [] + - arches: [default] + failsafe: + primary: http://ports.ubuntu.com/ubuntu-ports + security: http://ports.ubuntu.com/ubuntu-ports + ssh_svcname: ssh diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg.d/06_quiet.cfg b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg.d/06_quiet.cfg new file mode 100644 index 00000000..a614e723 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/cloud/cloud.cfg.d/06_quiet.cfg @@ -0,0 +1,4 @@ +output: {all: '>> /var/log/cloud-init-output.log'} +no_ssh_fingerprints: true +ssh: + emit_keys_to_console: false diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/journald.conf.d/no-rate-limit.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/journald.conf.d/no-rate-limit.conf new file mode 100644 index 00000000..fbaab956 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/journald.conf.d/no-rate-limit.conf @@ -0,0 +1,2 @@ +[Journal] +RateLimitIntervalSec=0 diff --git "a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" "b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" new file mode 100644 index 00000000..90ac2590 --- /dev/null +++ "b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/dev-disk-by\\x2duuid-00c629d6\\x2d06ab\\x2d4dfd\\x2db21e\\x2dc3186f34105d.device.d/override.conf" @@ -0,0 +1,3 @@ +[Unit] +JobRunningTimeoutSec=0s +Wants=subiquity_config.mount diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-compact.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-compact.conf new file mode 100644 index 00000000..a0701e52 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-compact.conf @@ -0,0 +1,4 @@ +# systemd in 23.04+ uses a newer "compact" format by default which is not +# understood by the systemd libraries from jammy used in the subiquity snap. +[Service] +Environment="SYSTEMD_JOURNAL_COMPACT=0" diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-hardening.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-hardening.conf new file mode 100644 index 00000000..c4262d26 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/etc/systemd/system/systemd-journald.service.d/no-hardening.conf @@ -0,0 +1,4 @@ +# systemd in 22.04+ uses "hash table hardening" by default which is not +# understood by the systemd libraries from focal used in the subiquity snap. +[Service] +Environment="SYSTEMD_JOURNAL_KEYED_HASH=0" diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/bin/subiquity-shell b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/bin/subiquity-shell new file mode 100755 index 00000000..d739d86f --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/bin/subiquity-shell @@ -0,0 +1,3 @@ +#!/bin/sh +exec sudo snap run subiquity + diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@.service.d/autologin.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@.service.d/autologin.conf new file mode 100644 index 00000000..a166aab4 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@.service.d/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --noclear -n --autologin ubuntu-server %I $TERM diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@tty1.service b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@tty1.service new file mode 120000 index 00000000..dc1dc0cd --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/getty@tty1.service @@ -0,0 +1 @@ +/dev/null \ No newline at end of file diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount new file mode 120000 index 00000000..0a663081 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/local-fs.target.wants/media-filesystem.mount @@ -0,0 +1 @@ +../media-filesystem.mount \ No newline at end of file diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf new file mode 100644 index 00000000..eebf38b4 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@.service.d/subiquity-serial.conf @@ -0,0 +1,9 @@ +[Unit] +Description=Subiquity, the installer for Ubuntu Server %I +After=snapd.seeded.service +StartLimitInterval=0 + +[Service] +Environment=SNAP_REEXEC=0 +ExecStart= +ExecStart=/usr/bin/snap run subiquity.subiquity-service %I diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf new file mode 100644 index 00000000..56900a35 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/serial-getty@sclp_line0.service.d/subiquity-serial.conf @@ -0,0 +1,4 @@ +[Service] +StandardOutput=tty +ExecStart= +ExecStart=/usr/bin/snap run subiquity --ssh diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf new file mode 100644 index 00000000..c1af5666 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snap.subiquity.subiquity-service.service.d/subiquity.conf @@ -0,0 +1,14 @@ +[Unit] +IgnoreOnIsolate=yes +After=systemd-user-sessions.service plymouth-quit-wait.service snap.seeded.service + +[Service] +Environment=SNAP_REEXEC=0 +UtmpIdentifier=tty1 +TTYPath=/dev/tty1 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +KillMode=process +IgnoreSIGPIPE=no +SendSIGHUP=yes diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snapd.service.d/no-reexec.conf b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snapd.service.d/no-reexec.conf new file mode 100644 index 00000000..14a6b477 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/snapd.service.d/no-reexec.conf @@ -0,0 +1,2 @@ +[Service] +Environment=SNAP_REEXEC=0 diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/subiquity_config.mount b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/subiquity_config.mount new file mode 100644 index 00000000..af33494b --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/system/subiquity_config.mount @@ -0,0 +1,4 @@ +[Mount] +What=/dev/disk/by-uuid/00c629d6-06ab-4dfd-b21e-c3186f34105d +Where=/subiquity_config +Type=ext4 diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/systemd-networkd-wait-online b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/systemd-networkd-wait-online new file mode 120000 index 00000000..63b10de4 --- /dev/null +++ b/live-build/ubuntu/includes.chroot.minimal.standard.live/usr/lib/systemd/systemd-networkd-wait-online @@ -0,0 +1 @@ +/bin/true \ No newline at end of file diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/meta-data b/live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/meta-data new file mode 100644 index 00000000..e69de29b diff --git a/live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/user-data b/live-build/ubuntu/includes.chroot.minimal.standard.live/var/lib/cloud/seed/nocloud/user-data new file mode 100644 index 00000000..e69de29b From fce09c0e057b63aadb5b6380dbc90679c54f6d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 6 Apr 2023 21:43:35 +0200 Subject: [PATCH 09/78] releasing package livecd-rootfs version 2.820 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f7c6f80c..55293f78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.820) UNRELEASED; urgency=medium +livecd-rootfs (2.820) lunar; urgency=medium * Initial implementation of canary image builds for 23.04. From 9a82720f1c0b6ccbaaa82d59a50e57ce9b50a653 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 7 Apr 2023 16:15:51 -0600 Subject: [PATCH 10/78] cloud-init: prefer netplan to handle all network manager config Cloud-init cannot write directly to /etc/NetworkManager/system-connections because subiquity may need to emit config to /etc/netplan/00-installer.yaml and call netplan apply for autoinstall.network use-cases. When cloud-init's config is written directly to /etc/NetworkManager, neither netplan nor subiquity has knowledge of this config and this results in namespace collisions in NetworkManager due to `netplan-` named connections and `cloud-init` connection ids fighting over which config own a given interface name. Deleting this config overlay allows subiquity to manage all network setup when it needs to with netplan directly. Subiquity already has logic to rename any unwanted netplan configuration when it intends to write cfg and run netplan apply[1]. This should allow subiquity full control of network config when needed. [1] https://github.com/canonical/subiquity/blob/ 92ac6544cdfedfd332d8cd94dbcfad0aab994575/subiquitycore/ controllers/network.py#L267 LP: #2015605 --- live-build/functions | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/live-build/functions b/live-build/functions index a3cbadfd..f16c9445 100644 --- a/live-build/functions +++ b/live-build/functions @@ -1008,17 +1008,18 @@ network: version: 2 renderer: NetworkManager EOF - - # inform cloud-init of the same (LP: #1982855) - mkdir -p chroot/etc/cloud/cloud.cfg.d - cat < chroot/etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg -${AUTOMATION_HEADER} -# Let NetworkManager manage all devices on this system -system_info: - network: - renderers: ['network-manager'] - activators: ['network-manager'] -EOF + # Do not limit cloud-init renderers to network-manager as suggested + # in LP: #1982855 because subiquity needs to render full networking + # in ephemeral boot time when autoinstall.network is provided. + # Neither subiquity nor netplan is aware of /etc/NetworkManager config + # artifacts emmitted by cloud-init. It's best if cloud-init reports + # network config directly to /etc/netplan with the configured netplan + # backend: NetworkManager per 01-network-manager-all.yaml above. + + # cloud-init's default renderer discovery will prefer netplan. + # Any time subiquity needs to write and apply network config + # it disables all previous network config in /etc/netplan so + # any previous 50-cloud-init.yaml will be rendered inert. # Position cloud-init.service After=NetworkManager.service. # (LP: #2008952). From bec24064757f93be7aade1a2fbcf379b177d4eaa Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 7 Apr 2023 16:56:19 -0600 Subject: [PATCH 11/78] changelog entry --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 55293f78..6978f529 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +livecd-rootfs (2.821) UNRELEASED; urgency=medium + + [ Chad Smith ] + * desktop livecd: allow cloud-init to write netplan config instead of + directly to /etc/NetworkManager because ubuntu-desktop-installer + will write netplan config in ephemeral boot stage when + autoinstall.network is provided. This allows ubuntu-desktop-installer + to control all netplan config written and apply to the ephemeral boot + as generated from /etc/netplan/*. (LP: #2015605) + + -- Chad Smith Fri, 07 Apr 2023 16:48:58 -0600 + livecd-rootfs (2.820) lunar; urgency=medium * Initial implementation of canary image builds for 23.04. From 3d8d08015aa42f984fd5fbea6e8f4563e549e522 Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Fri, 7 Apr 2023 16:56:38 -0600 Subject: [PATCH 12/78] releasing package livecd-rootfs version 2.821 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6978f529..ce9e95ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.821) UNRELEASED; urgency=medium +livecd-rootfs (2.821) lunar; urgency=medium [ Chad Smith ] * desktop livecd: allow cloud-init to write netplan config instead of From a7d66f6bc4da5a10892d2f9fa2a8ad942f388d57 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Fri, 7 Apr 2023 17:24:00 -0600 Subject: [PATCH 13/78] d/control: fix uninstallability - rsync vs i386 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 0307b539..c8c78a76 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Depends: ${misc:Depends}, python3-launchpadlib [!i386], python3-yaml, qemu-utils [!i386], - rsync, + rsync [!i386], snapd (>= 2.39) [!i386], squashfs-tools (>= 1:3.3-1), sudo, From 38cb20bd88e307aae7b1cd353c77f38c7de6c0ac Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Fri, 7 Apr 2023 17:25:00 -0600 Subject: [PATCH 14/78] changelog entry for i386 fix --- debian/changelog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ce9e95ae..04c69fe0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,7 +8,11 @@ livecd-rootfs (2.821) lunar; urgency=medium to control all netplan config written and apply to the ephemeral boot as generated from /etc/netplan/*. (LP: #2015605) - -- Chad Smith Fri, 07 Apr 2023 16:48:58 -0600 + [ Dan Bungert ] + * d/control: fix uninstallability of livecd-rootfs due to rsync not being on + i386. + + -- Dan Bungert Fri, 07 Apr 2023 17:24:28 -0600 livecd-rootfs (2.820) lunar; urgency=medium From c0af2ca443436930a12407ac6027af910c7fad37 Mon Sep 17 00:00:00 2001 From: John Chittum Date: Mon, 10 Apr 2023 07:27:46 -0500 Subject: [PATCH 15/78] fix: riscv64 efi conditional missing a && between icicle and visionfive, led to /boot/efi still being in place, and grub-install running instead of exiting the func. fixes LP:2015750 --- live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index cf4628d0..91e77516 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -455,7 +455,7 @@ EOF if [ "${SUBARCH:-}" != "nezha" ] && \ [ "${SUBARCH:-}" != "licheerv" ] && \ - [ "${SUBARCH:-}" != "icicle" ] \ + [ "${SUBARCH:-}" != "icicle" ] && \ [ "${SUBARCH:-}" != "visionfive" ] && \ [ "${SUBARCH:-}" != "visionfive2" ]; then ## TODO remove below once we have grub-efi-riscv64 for the platforms From d49cd0e37357af238c0e61942925b368836487d3 Mon Sep 17 00:00:00 2001 From: John Chittum Date: Mon, 10 Apr 2023 07:35:56 -0500 Subject: [PATCH 16/78] changelog entry --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 04c69fe0..4086269c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.822) UNRELEASED; urgency=medium + + * riscv64: fix conditional check in install-grub to correctly check if + platform supports grub-efi-64, or exit func. (LP: #2015750) + + -- jchittum Mon, 10 Apr 2023 07:34:21 -0500 + livecd-rootfs (2.821) lunar; urgency=medium [ Chad Smith ] From b88d4e62def8c3fa27a4a69811e552e05ec32acb Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 10 Apr 2023 08:37:37 -0700 Subject: [PATCH 17/78] releasing package livecd-rootfs version 2.822 --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4086269c..c552a566 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,10 @@ -livecd-rootfs (2.822) UNRELEASED; urgency=medium +livecd-rootfs (2.822) lunar; urgency=medium + [ jchittum ] * riscv64: fix conditional check in install-grub to correctly check if platform supports grub-efi-64, or exit func. (LP: #2015750) - -- jchittum Mon, 10 Apr 2023 07:34:21 -0500 + -- Steve Langasek Mon, 10 Apr 2023 08:37:30 -0700 livecd-rootfs (2.821) lunar; urgency=medium From 9fc5d2ce13015f7a94c77d9647ba306fa983626e Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 12 Apr 2023 09:38:00 -0700 Subject: [PATCH 18/78] Update infinite_scream URL to mastodon --- debian/changelog | 6 ++++++ live-build/auto/build | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c552a566..7cb4bf03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.823) UNRELEASED; urgency=medium + + * Update infinite_scream URL to mastodon + + -- Steve Langasek Wed, 12 Apr 2023 09:37:47 -0700 + livecd-rootfs (2.822) lunar; urgency=medium [ jchittum ] diff --git a/live-build/auto/build b/live-build/auto/build index ddbb7332..8c7688a5 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -348,7 +348,7 @@ EOF fi if [ -d chroot/etc/apt/preferences.d.save ]; then - # https://twitter.com/infinite_scream + # https://mastodon.social/@scream@botsin.space mv chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/ rmdir chroot/etc/apt/preferences.d.save fi From a13f7299279768834d615b76a161771b1e9b950f Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 12 Apr 2023 10:40:53 -0700 Subject: [PATCH 19/78] Make PROPOSED=1 builds work with NotAutomatic (lunar and later). LP: #2016022. --- debian/changelog | 2 ++ live-build/auto/config | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7cb4bf03..685a0779 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ livecd-rootfs (2.823) UNRELEASED; urgency=medium * Update infinite_scream URL to mastodon + * Make PROPOSED=1 builds work with NotAutomatic (lunar and later). + LP: #2016022. -- Steve Langasek Wed, 12 Apr 2023 09:37:47 -0700 diff --git a/live-build/auto/config b/live-build/auto/config index a0a76838..483beeff 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1476,6 +1476,14 @@ deb $LB_PARENT_MIRROR_BINARY_VOLATILE $SUITE-proposed $LB_PARENT_ARCHIVE_AREAS EOF cp -a config/archives/proposed.list.chroot \ config/archives/proposed.list.binary + + mkdir -p config/chroot_apt/ + cat > config/chroot_apt/proposed.pref < Date: Wed, 12 Apr 2023 10:40:58 -0700 Subject: [PATCH 20/78] releasing package livecd-rootfs version 2.823 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 685a0779..92eb2d53 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.823) UNRELEASED; urgency=medium +livecd-rootfs (2.823) lunar; urgency=medium * Update infinite_scream URL to mastodon * Make PROPOSED=1 builds work with NotAutomatic (lunar and later). LP: #2016022. - -- Steve Langasek Wed, 12 Apr 2023 09:37:47 -0700 + -- Steve Langasek Wed, 12 Apr 2023 10:40:56 -0700 livecd-rootfs (2.822) lunar; urgency=medium From b8649c321ff103be6e93d947d10fb07f968a7088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 09:45:04 +0200 Subject: [PATCH 21/78] Add default values to PASS in canary hooks. --- debian/changelog | 7 +++++++ live-build/ubuntu/hooks/020-canary-enhanced-sb.binary | 2 +- live-build/ubuntu/hooks/020-canary-live.binary | 2 +- live-build/ubuntu/hooks/020-canary-live.chroot_early | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 92eb2d53..b0c7fb55 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.824) UNRELEASED; urgency=medium + + * Fix build failures of desktop raspi images due to canary hooks + interfering. + + -- Łukasz 'sil2100' Zemczak Thu, 13 Apr 2023 09:43:58 +0200 + livecd-rootfs (2.823) lunar; urgency=medium * Update infinite_scream URL to mastodon diff --git a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary index 6bffc439..3c668b30 100644 --- a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary +++ b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary @@ -2,7 +2,7 @@ set -eux -case $PASS in +case ${PASS:-} in minimal.standard.enhanced-secureboot) ;; *) diff --git a/live-build/ubuntu/hooks/020-canary-live.binary b/live-build/ubuntu/hooks/020-canary-live.binary index 9c53b281..8c834d5b 100755 --- a/live-build/ubuntu/hooks/020-canary-live.binary +++ b/live-build/ubuntu/hooks/020-canary-live.binary @@ -2,7 +2,7 @@ set -eux -case $PASS in +case ${PASS:-} in minimal.standard.live) ;; *) diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early index 884b05b5..5bd741dd 100755 --- a/live-build/ubuntu/hooks/020-canary-live.chroot_early +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -2,7 +2,7 @@ set -eu -case $PASS in +case ${PASS:-} in minimal.standard.live) ;; *) From fc69c546def37eb7f4e8e934bf97748141a78206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 09:45:31 +0200 Subject: [PATCH 22/78] releasing package livecd-rootfs version 2.824 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b0c7fb55..d68220da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.824) UNRELEASED; urgency=medium +livecd-rootfs (2.824) lunar; urgency=medium * Fix build failures of desktop raspi images due to canary hooks interfering. From 735db252edae8a1068efd4651a0f0b34ac0f5646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 11:47:47 +0200 Subject: [PATCH 23/78] For canary images, actually consider moving the seed listed snaps from both minimal and standard layers to the classic layer. --- debian/changelog | 7 +++++++ live-build/auto/config | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d68220da..264eb4f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.825) UNRELEASED; urgency=medium + + * For canary images, actually consider moving the seed listed snaps from + both minimal and standard layers to the classic layer. + + -- Łukasz 'sil2100' Zemczak Thu, 13 Apr 2023 11:46:37 +0200 + livecd-rootfs (2.824) lunar; urgency=medium * Fix build failures of desktop raspi images due to canary hooks diff --git a/live-build/auto/config b/live-build/auto/config index 483beeff..46ba25fd 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -745,10 +745,16 @@ case $PROJECT in add_package minimal cloud-init # the standard layer, contains all base common packages for later layers (we're splitting out the snaps) add_task minimal.standard ubuntu-desktop ubuntu-desktop-default-languages - # the classic layer, basically only contains snaps from the standard tasks + # the classic layer, basically only contains snaps from the standard and minimal tasks add_pass minimal.standard.classic - mv config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full \ - config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + if [ -e "config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full" ]; then + cat config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full >>config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + rm config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full + fi + if [ -e "config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full" ]; then + cat config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full >>config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + rm config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full + fi # the live layer, contains all packages for the live session installer # TODO: we should probably add the kernel per KERNEL_FLAVOURS add_package minimal.standard.live linux-generic casper lvm2 mdadm From 6fcdd3b01a48715789181b1a50634da87bd9b932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 11:48:16 +0200 Subject: [PATCH 24/78] releasing package livecd-rootfs version 2.825 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 264eb4f1..fc8de620 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.825) UNRELEASED; urgency=medium +livecd-rootfs (2.825) lunar; urgency=medium * For canary images, actually consider moving the seed listed snaps from both minimal and standard layers to the classic layer. From 97f379928961b268b5bb3201f92771b416dc90d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 14:48:09 +0200 Subject: [PATCH 25/78] Do not reset seeds for canary. --- debian/changelog | 7 +++++++ live-build/ubuntu/hooks/020-canary-enhanced-sb.binary | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index fc8de620..c438ae21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.826) UNRELEASED; urgency=medium + + * Now that we moved the seeding for canary into further layers, a resed of + the preseeding is not required. + + -- Łukasz 'sil2100' Zemczak Thu, 13 Apr 2023 14:46:43 +0200 + livecd-rootfs (2.825) lunar; urgency=medium * For canary images, actually consider moving the seed listed snaps from diff --git a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary index 3c668b30..89060624 100644 --- a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary +++ b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary @@ -19,9 +19,6 @@ case ${SUBPROJECT:-} in ;; esac -/usr/lib/snapd/snap-preseed --reset $(realpath "chroot") -rm -rf chroot/var/lib/snapd/seed/* - # env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-classic-2304-amd64 > config/classic-model.model cat < config/classic-model.model type: model From b540ca780612139c27b062e60c1894e3517befc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 14:48:44 +0200 Subject: [PATCH 26/78] releasing package livecd-rootfs version 2.826 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c438ae21..4c3f3e99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.826) UNRELEASED; urgency=medium +livecd-rootfs (2.826) lunar; urgency=medium * Now that we moved the seeding for canary into further layers, a resed of the preseeding is not required. From ac8f964b198a966cb20a1b1e92d85fe7695f8b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 19:41:16 +0200 Subject: [PATCH 27/78] Fix for netboot tarballs generation. --- debian/changelog | 7 +++++++ .../ubuntu-server/hooks/05-netboot-tarball.binary | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4c3f3e99..78050981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.827) UNRELEASED; urgency=medium + + * Fix netboot tarball generation code to properly handle the recent change + of shim to use alternatives (and the path becoming a symlink). + + -- Łukasz 'sil2100' Zemczak Thu, 13 Apr 2023 19:28:46 +0200 + livecd-rootfs (2.826) lunar; urgency=medium * Now that we moved the seeding for canary into further layers, a resed of diff --git a/live-build/ubuntu-server/hooks/05-netboot-tarball.binary b/live-build/ubuntu-server/hooks/05-netboot-tarball.binary index 658af15f..eef58f64 100755 --- a/live-build/ubuntu-server/hooks/05-netboot-tarball.binary +++ b/live-build/ubuntu-server/hooks/05-netboot-tarball.binary @@ -33,7 +33,12 @@ case $ARCH in amd64) mv chroot/usr/lib/PXELINUX/pxelinux.0 tarball/amd64/pxelinux.0 mv chroot/usr/lib/syslinux/modules/bios/ldlinux.c32 tarball/amd64/ldlinux.c32 - mv chroot/usr/lib/shim/shimx64.efi.signed tarball/amd64/bootx64.efi + # For shim we're now using alternatives + if [ -e chroot/usr/lib/shim/shimx64.efi.signed.latest ]; then + mv chroot/usr/lib/shim/shimx64.efi.signed.latest tarball/amd64/bootx64.efi + else + mv chroot/usr/lib/shim/shimx64.efi.signed tarball/amd64/bootx64.efi + fi mv chroot/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed tarball/amd64/grubx64.efi mkdir tarball/amd64/grub tarball/amd64/pxelinux.cfg @@ -54,7 +59,12 @@ EOF ;; arm64) - mv chroot/usr/lib/shim/shimaa64.efi.signed tarball/arm64/bootaa64.efi + # For shim we're now using alternatives + if [ -e chroot/usr/lib/shim/shimaa64.efi.signed.latest ]; then + mv chroot/usr/lib/shim/shimaa64.efi.signed.latest tarball/arm64/bootaa64.efi + else + mv chroot/usr/lib/shim/shimaa64.efi.signed tarball/arm64/bootaa64.efi + fi mv chroot/usr/lib/grub/arm64-efi-signed/grubnetaa64.efi.signed tarball/arm64/grubaa64.efi mkdir tarball/arm64/grub From bfcf01f9d35c01afabd6163db950776f608d45af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 13 Apr 2023 19:44:44 +0200 Subject: [PATCH 28/78] releasing package livecd-rootfs version 2.827 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 78050981..c892ee70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.827) UNRELEASED; urgency=medium +livecd-rootfs (2.827) lunar; urgency=medium * Fix netboot tarball generation code to properly handle the recent change of shim to use alternatives (and the path becoming a symlink). From b6f1f7b7b3528f4f4456c1ae0a10a09c003ead23 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 14 Apr 2023 10:59:01 +0100 Subject: [PATCH 29/78] Remove redundant creation of oem user --- .../ubuntu/hooks/099-ubuntu-image-customization.chroot | 5 ----- 1 file changed, 5 deletions(-) diff --git a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot index 91449b61..82005f42 100644 --- a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot +++ b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot @@ -18,11 +18,6 @@ if [ "$IMAGEFORMAT" == "none" ]; then touch "/var/lib/oem-config/run" fi - /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem - - /usr/sbin/oem-config-prepare --quiet - touch "/var/lib/oem-config/run" - # Update the fstab to include the "discard" option awk \ -v root_fs_label="writable" \ From 18955e31bb176706a16573a488647c8b9c7baf94 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 14 Apr 2023 10:59:14 +0100 Subject: [PATCH 30/78] changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index c892ee70..a5ed4130 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.828) UNRELEASED; urgency=medium + + * 099-ubuntu-image-customization.chroot: Remove redundant creation of oem + user and oem-config-prepare (LP: #2016285) + + -- Dave Jones Fri, 14 Apr 2023 09:48:31 +0100 + livecd-rootfs (2.827) lunar; urgency=medium * Fix netboot tarball generation code to properly handle the recent change From 22152cfad58d334c498b847a5a2f6d89e5465cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Fri, 14 Apr 2023 17:42:29 +0200 Subject: [PATCH 31/78] releasing package livecd-rootfs version 2.828 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a5ed4130..f48a7b4d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.828) UNRELEASED; urgency=medium +livecd-rootfs (2.828) lunar; urgency=medium * 099-ubuntu-image-customization.chroot: Remove redundant creation of oem user and oem-config-prepare (LP: #2016285) From 9f3b345b06c58d2826cf68d3da876dc062caab01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Fri, 14 Apr 2023 23:17:41 +0000 Subject: [PATCH 32/78] Initial support for NVIDIA Tegra live-build/auto/config: - for Ubuntu Server live images and the arm64+tegra full arch, build a tegra variant with linux-nvidia-tegra as the flavor and linux-nvidia-tegra as the kernel meta-package - default to nvidia-$SUBARCH as the kernel flavor for all images using arm64+tegra as full arch hooks/03-kernel-metapkg.chroot_early: - use linux-nvidia-tegra as kernel meta-package for the nvidia-tegra flavor --- live-build/auto/config | 11 +++++++++++ .../hooks/03-kernel-metapkg.chroot_early | 2 ++ 2 files changed, 13 insertions(+) diff --git a/live-build/auto/config b/live-build/auto/config index a0a76838..0a2598cf 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -969,6 +969,9 @@ case $PROJECT in intel-iot) variants='intel' ;; + tegra) + variants='tegra' + ;; *) # variants='ga hwe' variants='ga' @@ -985,6 +988,9 @@ case $PROJECT in elif [ "$variant" = "intel" ]; then kernel_metapkg=linux-intel-iotg flavor=intel-iotg + elif [ "$variant" = "tegra" ]; then + kernel_metapkg=linux-nvidia-tegra + flavor=nvidia-tegra else echo "bogus variant: $variant" exit 1 @@ -1237,6 +1243,11 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in add_package install linux-firmware-raspi pi-bluetooth u-boot-rpi u-boot-tools BINARY_REMOVE_LINUX=false ;; + arm64+tegra) + # Common configuration for all NVIDIA Tegra image variants (server, + # desktop etc.) + KERNEL_FLAVOURS="nvidia-$SUBARCH" + ;; riscv*+*) if [ "${SUBARCH:-}" = "licheerv" ]; then # The wifi driver of the licheerv is an out-of-tree driver packaged diff --git a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early index a6a19f86..ed02f8b6 100755 --- a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early +++ b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early @@ -13,6 +13,8 @@ case $PASS in kernel_metapkg=linux-generic-hwe-$(lsb_release -sr) elif [ "$flavor" = "intel-iotg" ]; then kernel_metapkg=linux-intel-iotg + elif [ "$flavor" = "nvidia-tegra" ]; then + kernel_metapkg=linux-nvidia-tegra else echo "bogus flavor: $flavor" exit 1 From 5e4b2d3cc35d2a89c4e05c55021c0d934596e8e0 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 14 Apr 2023 22:47:09 -0700 Subject: [PATCH 33/78] Use losetup instead of kpartx to set up loopback partitions kpartx on riscv64 appears to be racy. Rather than trying to debug these fraught races somewhere between udev and libdevmapper, we can use losetup which should be simpler and less error-prone. --- debian/control | 2 +- live-build/functions | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/debian/control b/debian/control index c8c78a76..9578e589 100644 --- a/debian/control +++ b/debian/control @@ -22,11 +22,11 @@ Depends: ${misc:Depends}, git, gnupg, grep-dctrl, - kpartx, live-build (>= 3.0~a57-1ubuntu31~), lsb-release, lzma, make, + mount, parted, procps, python3, diff --git a/live-build/functions b/live-build/functions index f16c9445..c8695486 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,16 +12,13 @@ loop_raw= backing_img= clean_loops() { - local kpartx_ret - local kpartx_stdout - if [ -n "${backing_img}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - kpartx -v -d "${backing_img}" + losetup -v -d "${backing_img}" unset backing_img fi @@ -65,18 +62,15 @@ mount_image() { trap clean_loops EXIT backing_img="$1" local rootpart="$2" - kpartx_mapping="$(kpartx -s -v -a ${backing_img})" + loop_device=$(losetup --show -f -P -v ${backing_img}) - # Find the loop device - loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" - loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 fi # Find the rootfs location - rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" + rootfs_dev_mapper="/dev/mapper/${loop_device}p${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 From eb8fb325916b7ed05e3e182a2348b2ca25471716 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 07:46:09 -0700 Subject: [PATCH 34/78] Retain dependency on kpartx - not used by us but by cpc sauce. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index 9578e589..b1ad7323 100644 --- a/debian/control +++ b/debian/control @@ -22,6 +22,7 @@ Depends: ${misc:Depends}, git, gnupg, grep-dctrl, + kpartx, live-build (>= 3.0~a57-1ubuntu31~), lsb-release, lzma, From a40d9de803893440bc6783362ad6acb21ff13a17 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 08:22:18 -0700 Subject: [PATCH 35/78] changelog --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1ede381e..bfa0af90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ livecd-rootfs (2.829) UNRELEASED; urgency=medium [ Loïc Minier ] * Initial support for NVIDIA Tegra. LP: #2015644. + [ Steve Langasek ] + * Use losetup instead of kpartx to try to resolve race conditions in + riscv64 image builds. + -- Steve Langasek Fri, 14 Apr 2023 16:44:32 -0700 livecd-rootfs (2.828) lunar; urgency=medium From fa29b731309ab9924ef545d32225a88a7f928f0e Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 08:22:25 -0700 Subject: [PATCH 36/78] releasing package livecd-rootfs version 2.829 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bfa0af90..79e3c8c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.829) UNRELEASED; urgency=medium +livecd-rootfs (2.829) lunar; urgency=medium [ Loïc Minier ] * Initial support for NVIDIA Tegra. LP: #2015644. @@ -7,7 +7,7 @@ livecd-rootfs (2.829) UNRELEASED; urgency=medium * Use losetup instead of kpartx to try to resolve race conditions in riscv64 image builds. - -- Steve Langasek Fri, 14 Apr 2023 16:44:32 -0700 + -- Steve Langasek Mon, 17 Apr 2023 08:22:21 -0700 livecd-rootfs (2.828) lunar; urgency=medium From a130ee17c39ac20ac5ab69fa4f919c0bbf173ab1 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 12:22:17 -0700 Subject: [PATCH 37/78] Call losetup -d properly. --- debian/changelog | 6 ++++++ live-build/functions | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 79e3c8c8..ee2b65e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.830) UNRELEASED; urgency=medium + + * Call losetup -d properly. + + -- Steve Langasek Mon, 17 Apr 2023 12:22:06 -0700 + livecd-rootfs (2.829) lunar; urgency=medium [ Loïc Minier ] diff --git a/live-build/functions b/live-build/functions index c8695486..25093e16 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,13 +12,13 @@ loop_raw= backing_img= clean_loops() { - if [ -n "${backing_img}" ]; then + if [ -n "${loop_device}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - losetup -v -d "${backing_img}" + losetup -v -d "${loop_device}" unset backing_img fi From bdc2037bd17f7a98d7af3f2e4516845ae4585c28 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 12:22:21 -0700 Subject: [PATCH 38/78] releasing package livecd-rootfs version 2.830 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ee2b65e1..98e02610 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.830) UNRELEASED; urgency=medium +livecd-rootfs (2.830) lunar; urgency=medium * Call losetup -d properly. - -- Steve Langasek Mon, 17 Apr 2023 12:22:06 -0700 + -- Steve Langasek Mon, 17 Apr 2023 12:22:19 -0700 livecd-rootfs (2.829) lunar; urgency=medium From 6b4031740451e30928b63439e8039be02add5f60 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 16:11:50 -0700 Subject: [PATCH 39/78] Use the correct path for the loop device. --- debian/changelog | 6 ++++++ live-build/functions | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 98e02610..205673c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.831) UNRELEASED; urgency=medium + + * Use the correct path for the loop device. + + -- Steve Langasek Mon, 17 Apr 2023 16:11:40 -0700 + livecd-rootfs (2.830) lunar; urgency=medium * Call losetup -d properly. diff --git a/live-build/functions b/live-build/functions index 25093e16..d7b8eabe 100644 --- a/live-build/functions +++ b/live-build/functions @@ -70,7 +70,7 @@ mount_image() { fi # Find the rootfs location - rootfs_dev_mapper="/dev/mapper/${loop_device}p${rootpart}" + rootfs_dev_mapper="${loop_device}p${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 From 863883793ced33117e1d9f512470d0ba3e53ebef Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 16:11:57 -0700 Subject: [PATCH 40/78] releasing package livecd-rootfs version 2.831 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 205673c1..f7588a5e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.831) UNRELEASED; urgency=medium +livecd-rootfs (2.831) lunar; urgency=medium * Use the correct path for the loop device. - -- Steve Langasek Mon, 17 Apr 2023 16:11:40 -0700 + -- Steve Langasek Mon, 17 Apr 2023 16:11:52 -0700 livecd-rootfs (2.830) lunar; urgency=medium From a631afcb7f6ac3c2c1041cf63d6fc89a42b0d811 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 16:52:23 -0700 Subject: [PATCH 41/78] Unconditionally enable i386 in the chroot for Ubuntu Desktop; the new installer doesn't handle enabling this at install time, and late enablement also misses us some recommends. --- debian/changelog | 8 ++++++++ live-build/ubuntu/hooks/020-canary-live.chroot_early | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index f7588a5e..ac02c8c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.832) UNRELEASED; urgency=medium + + * Unconditionally enable i386 in the chroot for Ubuntu Desktop; the new + installer doesn't handle enabling this at install time, and late + enablement also misses us some recommends. + + -- Steve Langasek Mon, 17 Apr 2023 16:51:13 -0700 + livecd-rootfs (2.831) lunar; urgency=medium * Use the correct path for the loop device. diff --git a/live-build/ubuntu/hooks/020-canary-live.chroot_early b/live-build/ubuntu/hooks/020-canary-live.chroot_early index 5bd741dd..4fb89b37 100755 --- a/live-build/ubuntu/hooks/020-canary-live.chroot_early +++ b/live-build/ubuntu/hooks/020-canary-live.chroot_early @@ -19,3 +19,10 @@ EOF cat < /etc/initramfs-tools/conf.d/default-layer.conf LAYERFS_PATH=${PASS}.squashfs EOF + +if [ "$(dpkg --print-architecture)" = amd64 ]; then + echo "I: Enabling amd64 multiarch support on amd64" + dpkg --add-architecture i386 + + apt-get -y update +fi From 1e0daf6af95dd08fcd6f89bb08bc245d05b6890b Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 18:50:00 -0700 Subject: [PATCH 42/78] Clean up some remaining references to /dev/mapper. --- debian/changelog | 6 ++++ .../buildd/hooks/02-disk-image-uefi.binary | 2 +- live-build/functions | 4 +-- .../hooks.d/base/disk-image-ppc64el.binary | 2 +- .../hooks.d/base/disk-image-uefi.binary | 28 +++++++++---------- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/debian/changelog b/debian/changelog index f7588a5e..b2d8e482 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.832) UNRELEASED; urgency=medium + + * Clean up some remaining references to /dev/mapper. + + -- Steve Langasek Mon, 17 Apr 2023 18:49:47 -0700 + livecd-rootfs (2.831) lunar; urgency=medium * Use the correct path for the loop device. diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index 280db0ab..cd8af1a7 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -41,7 +41,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" diff --git a/live-build/functions b/live-build/functions index d7b8eabe..dfed45cc 100644 --- a/live-build/functions +++ b/live-build/functions @@ -207,7 +207,7 @@ mount_disk_image() { mount_image ${disk_image} 1 mount_partition "${rootfs_dev_mapper}" $mountpoint - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then mount "${uefi_dev}" $mountpoint/boot/efi fi @@ -248,7 +248,7 @@ umount_partition() { umount_disk_image() { mountpoint="$1" - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then # zero fill free space in UEFI partition cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index dc87a361..b5b7cffc 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -49,7 +49,7 @@ GRUB_TIMEOUT=0 # Set the default commandline GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk" EOF - prep_partition="/dev/mapper${loop_device///dev/}p2" + prep_partition="${loop_device}p2" chroot mountpoint grub-install "${prep_partition}" \ --no-nvram \ --boot-directory=/boot \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 91e77516..042db427 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -197,7 +197,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" @@ -234,7 +234,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -246,7 +246,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -258,7 +258,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p13" + cidata_dev="${loop_device}p13" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -285,10 +285,10 @@ install_grub() { efi_target=riscv64-efi # The real U-Boot chroot mountpoint apt-get install -qqy u-boot-microchip - loader="/dev/mapper${loop_device///dev/}p13" + loader="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -330,10 +330,10 @@ install_grub() { chroot mountpoint apt-get install -qqy u-boot-nezha # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. # Package nezha-boot0 is not needed anymore. - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -359,7 +359,7 @@ install_grub() { efi_target=riscv64-efi # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="/dev/mapper${loop_device///dev/}p3" + uenv_dev="${loop_device}p3" mkfs.ext4 "${uenv_dev}" uenv_mnt_dir=`mktemp -d uenvXXX` mount "${uenv_dev}" "${uenv_mnt_dir}" @@ -387,7 +387,7 @@ EOF umount "${uenv_mnt_dir}" rmdir "${uenv_mnt_dir}" # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -406,7 +406,7 @@ EOF chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -431,13 +431,13 @@ EOF fi chroot mountpoint apt-get install -qqy u-boot-sifive # FSBL, which gets U-Boot SPL - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" # The real U-Boot - loader2="/dev/mapper${loop_device///dev/}p14" + loader2="${loop_device}p14" dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, From 2f2eb7b5f3e1097a96e7c419d9148a8ecfcfd7dd Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 17 Apr 2023 18:50:26 -0700 Subject: [PATCH 43/78] releasing package livecd-rootfs version 2.832 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b2d8e482..62eeff84 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.832) UNRELEASED; urgency=medium +livecd-rootfs (2.832) lunar; urgency=medium * Clean up some remaining references to /dev/mapper. - -- Steve Langasek Mon, 17 Apr 2023 18:49:47 -0700 + -- Steve Langasek Mon, 17 Apr 2023 18:50:18 -0700 livecd-rootfs (2.831) lunar; urgency=medium From 7b07db91110a3dda2723bc853a43f81c4e2a2f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Tue, 18 Apr 2023 10:10:28 +0100 Subject: [PATCH 44/78] Revert the recent kpartx->losetup changes, as we need to put some other changes on top. Let's try to re-introduce this for MM. --- debian/control | 1 - .../buildd/hooks/02-disk-image-uefi.binary | 2 +- live-build/functions | 18 ++++++++---- .../hooks.d/base/disk-image-ppc64el.binary | 2 +- .../hooks.d/base/disk-image-uefi.binary | 28 +++++++++---------- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/debian/control b/debian/control index b1ad7323..c8c78a76 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,6 @@ Depends: ${misc:Depends}, lsb-release, lzma, make, - mount, parted, procps, python3, diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index cd8af1a7..280db0ab 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -41,7 +41,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="${loop_device}p15" + uefi_dev="/dev/mapper${loop_device///dev/}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" diff --git a/live-build/functions b/live-build/functions index dfed45cc..f16c9445 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,13 +12,16 @@ loop_raw= backing_img= clean_loops() { - if [ -n "${loop_device}" ]; then + local kpartx_ret + local kpartx_stdout + + if [ -n "${backing_img}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - losetup -v -d "${loop_device}" + kpartx -v -d "${backing_img}" unset backing_img fi @@ -62,15 +65,18 @@ mount_image() { trap clean_loops EXIT backing_img="$1" local rootpart="$2" - loop_device=$(losetup --show -f -P -v ${backing_img}) + kpartx_mapping="$(kpartx -s -v -a ${backing_img})" + # Find the loop device + loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" + loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 fi # Find the rootfs location - rootfs_dev_mapper="${loop_device}p${rootpart}" + rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 @@ -207,7 +213,7 @@ mount_disk_image() { mount_image ${disk_image} 1 mount_partition "${rootfs_dev_mapper}" $mountpoint - local uefi_dev="${loop_device}p15" + local uefi_dev="/dev/mapper${loop_device///dev/}p15" if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then mount "${uefi_dev}" $mountpoint/boot/efi fi @@ -248,7 +254,7 @@ umount_partition() { umount_disk_image() { mountpoint="$1" - local uefi_dev="${loop_device}p15" + local uefi_dev="/dev/mapper${loop_device///dev/}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then # zero fill free space in UEFI partition cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index b5b7cffc..dc87a361 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -49,7 +49,7 @@ GRUB_TIMEOUT=0 # Set the default commandline GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk" EOF - prep_partition="${loop_device}p2" + prep_partition="/dev/mapper${loop_device///dev/}p2" chroot mountpoint grub-install "${prep_partition}" \ --no-nvram \ --boot-directory=/boot \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 042db427..91e77516 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -197,7 +197,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="${loop_device}p15" + uefi_dev="/dev/mapper${loop_device///dev/}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" @@ -234,7 +234,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p14" + cidata_dev="/dev/mapper${loop_device///dev/}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -246,7 +246,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p14" + cidata_dev="/dev/mapper${loop_device///dev/}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -258,7 +258,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p13" + cidata_dev="/dev/mapper${loop_device///dev/}p13" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -285,10 +285,10 @@ install_grub() { efi_target=riscv64-efi # The real U-Boot chroot mountpoint apt-get install -qqy u-boot-microchip - loader="${loop_device}p13" + loader="/dev/mapper${loop_device///dev/}p13" dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -330,10 +330,10 @@ install_grub() { chroot mountpoint apt-get install -qqy u-boot-nezha # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. # Package nezha-boot0 is not needed anymore. - loader1="${loop_device}p13" + loader1="/dev/mapper${loop_device///dev/}p13" dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -359,7 +359,7 @@ install_grub() { efi_target=riscv64-efi # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="${loop_device}p3" + uenv_dev="/dev/mapper${loop_device///dev/}p3" mkfs.ext4 "${uenv_dev}" uenv_mnt_dir=`mktemp -d uenvXXX` mount "${uenv_dev}" "${uenv_mnt_dir}" @@ -387,7 +387,7 @@ EOF umount "${uenv_mnt_dir}" rmdir "${uenv_mnt_dir}" # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -406,7 +406,7 @@ EOF chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -431,13 +431,13 @@ EOF fi chroot mountpoint apt-get install -qqy u-boot-sifive # FSBL, which gets U-Boot SPL - loader1="${loop_device}p13" + loader1="/dev/mapper${loop_device///dev/}p13" # The real U-Boot - loader2="${loop_device}p14" + loader2="/dev/mapper${loop_device///dev/}p14" dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2 # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, From 2d234ac689b5160e81547c68d9ad5d39ee53d559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Tue, 18 Apr 2023 10:19:30 +0100 Subject: [PATCH 45/78] Changelog entry. --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 62eeff84..718bc1ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.833) UNRELEASED; urgency=medium + + * Revert all the losetup related changes introduced in versions between + 2.829 and 2.832. Those are not quite good for lunar due to CPC + incompatibilities. + + -- Łukasz 'sil2100' Zemczak Tue, 18 Apr 2023 10:17:26 +0100 + livecd-rootfs (2.832) lunar; urgency=medium * Clean up some remaining references to /dev/mapper. From fba9d176a66004acc1601abf9b7dd4d5d53e76cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Tue, 18 Apr 2023 10:24:07 +0100 Subject: [PATCH 46/78] Add cinnamon, unity and edubuntu to the workaround list. --- debian/changelog | 3 +++ live-build/auto/build | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 718bc1ae..6a47f352 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ livecd-rootfs (2.833) UNRELEASED; urgency=medium * Revert all the losetup related changes introduced in versions between 2.829 and 2.832. Those are not quite good for lunar due to CPC incompatibilities. + * Add ubuntucinnamon, ubuntu-unity and edubuntu to the workaround for the + invalid apt cache issue we encountered during all of our previous + releases. -- Łukasz 'sil2100' Zemczak Tue, 18 Apr 2023 10:17:26 +0100 diff --git a/live-build/auto/build b/live-build/auto/build index 8c7688a5..2568057e 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -499,7 +499,7 @@ EOF # affected by this, we manually clear out the archive-related Packages # files in the cache. case $PROJECT in - ubuntu|xubuntu|kubuntu|ubuntu-budgie|ubuntukylin|ubuntu-mate) + ubuntu|xubuntu|kubuntu|ubuntu-budgie|ubuntukylin|ubuntu-mate|ubuntucinnamon|ubuntu-unity|edubuntu) rm -f chroot/var/lib/apt/lists/*ubuntu.com*_Packages ;; esac From a418f52bd471cc8a621d427fc69227db2f9d4ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 26 Apr 2023 13:40:17 +0200 Subject: [PATCH 47/78] Switch canary desktop installer model. --- debian/changelog | 3 +- .../ubuntu/hooks/020-canary-live.binary | 28 +++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6a47f352..0dfd16d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,9 @@ livecd-rootfs (2.833) UNRELEASED; urgency=medium * Add ubuntucinnamon, ubuntu-unity and edubuntu to the workaround for the invalid apt cache issue we encountered during all of our previous releases. + * Switch to use the desktop model for the installer for the canary images. - -- Łukasz 'sil2100' Zemczak Tue, 18 Apr 2023 10:17:26 +0100 + -- Łukasz 'sil2100' Zemczak Wed, 26 Apr 2023 13:36:30 +0200 livecd-rootfs (2.832) lunar; urgency=medium diff --git a/live-build/ubuntu/hooks/020-canary-live.binary b/live-build/ubuntu/hooks/020-canary-live.binary index 8c834d5b..f7fe266b 100755 --- a/live-build/ubuntu/hooks/020-canary-live.binary +++ b/live-build/ubuntu/hooks/020-canary-live.binary @@ -19,13 +19,13 @@ case ${SUBPROJECT:-} in ;; esac -# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-server-installer-classic-2304-amd64 > config/classic-model-installer.model +# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-installer-classic-2304-amd64 > config/classic-model-installer.model cat < config/classic-model-installer.model type: model authority-id: canonical series: 16 brand-id: canonical -model: ubuntu-server-installer-classic-2304-amd64 +model: ubuntu-installer-classic-2304-amd64 architecture: amd64 base: core22 classic: true @@ -45,22 +45,22 @@ snaps: - classic: true default-channel: latest/stable/canary-23.04 - id: ba2aj8guta0zSRlT3QM5aJNAUXPlBtf9 - name: subiquity + id: rQm0TtMOYOtEslvEXgxQDhgy1JNn38Wz + name: ubuntu-desktop-installer type: app timestamp: 2023-03-19T12:00:00.0Z sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn -AcLBXAQAAQoABgUCZCT4iAAKCRDgT5vottzAEkmPD/46nms8edTFkoiiH/SjAdyo8MW2FhR3tW03 -CyH1NQwrNJtHiqb7EcWQHDPexM3Wxvwj2iPN04IWlGugge7Fw12AmhVsYYCnCjYjDL8uBa9ixBj3 -kghOsFlVbDBk+f5tLmNGNncQfPbV6TvywK9a+2zgVEdRdLlmNeorX3b7P0woCIWg9wEikX+vcLi/ -q1GvWtI4Gb/rAIN+/OaD4DFgbJSUdSaayGX90hbNtvsZc0K7KPTeNlF0IGKg72yvqBGDX/0m2IDb -6HozMxGg7xcq+WwHU3hucBNqw6kWKKDd1gzZJICrJf9kLEZ7GoGa8Oj9eET+bp2KYVHzjNzHvQbd -v4odCG3Wn7m5ogpPmt/mUoTOhVtY/RNGnk46eHAFHuFcPAjR1BnIfLLmh4EmEnkIboTrlBKFgHMW -ddFSOFYonboYu7R9Gad3J+9VD5IyyNqJNpCrEqLfw81QaFz1+KM00XD+wns2+ZqnI90a6olXcmUH -t1Fv0QIDNCG0x8Lf+My/gJycNCEbUj+TA6xOL9NH0EFU6myKyR74sC5tlMZPMN2RKdZglOZUnkyC -lpuhRVI3fcNZL2sVGwmvoKUDj7QaLrETpCUqDXMzNw73NOS3zA8+gQr/X438KpEFscszS1g+FtJ4 -LVOcgLrDw/S61ciBuOBeOaskqZdZ4xYmm1wKMzecXg== +AcLBXAQAAQoABgUCZCT4iAAKCRDgT5vottzAEtZbD/sGNgbOV4nv6XXPaY1mR8qGoZ+rTYzk0KuE +Ql6fbVIpkAYdTZhiR6JW+YvEQleL4pRAZIGgdyHIhlQpkjcjWgouzwJCBwL7eGhKMxguUefrxGYc +l+1/lx9JsE3N+FEWk/Q1LprbekoDLQwrNm9d0XC2zcrX10O9v3O1Nl7eCor/tQ10lj6D/uzKKuQD +6J3NQm2rY6HUGwcvEXErm/A64vKr6OS/Vd2BLLi2tWptMxvux4xAADuyeJQwWBUvnv/oVm+KnEad +KlzBVLHJPH1CDCgJy79d21J4kq7+17uipNC9uCJI3Ljd+0+pdiboEt2vvURYnaLyEiMtfzQzoYEH +5WuXcTheLkt0d57ZwU/8G65qcMPXEyRd2A7lYWbsoslKaZ2ITpMCG6PEBT0riwsXoR4JuPma6CB+ +76tZDekCVg1Kie20lRkdt80c3mDMMBZ/F1Rry6O4VuiOxVW4ji4p3mkC/lDKdAERGkCXozQKwRQZ +TwpcnIbyyvMPddxP37sJImXKVVuPvD5paTNxnPirgm0jYyID2u5UILozEXT109k4ijrl9TbZutjQ +oPijs/y+KJ4DbdrmiwwWCxQZcx2T5GG4HB38eIsnmEWTyml02lOL9sWq6qKuk95a3DhF+Q02+zkG +c3kEHr8kcSEkJtgwre/RjjlvGYhur1rZ4i0G6gGBLw== EOF env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model-installer.model chroot From ada1f09b39332ec828369e0a30f2870df5c4dc3e Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 2 May 2023 15:24:37 +0200 Subject: [PATCH 48/78] Revert "Revert the recent kpartx->losetup changes, as we need to put some other changes on top. Let's try to re-introduce this for MM." This reverts commit 7b07db91110a3dda2723bc853a43f81c4e2a2f75. --- debian/changelog | 3 -- debian/control | 1 + .../buildd/hooks/02-disk-image-uefi.binary | 2 +- live-build/functions | 18 ++++-------- .../hooks.d/base/disk-image-ppc64el.binary | 2 +- .../hooks.d/base/disk-image-uefi.binary | 28 +++++++++---------- 6 files changed, 23 insertions(+), 31 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0dfd16d1..ddf7c02a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,5 @@ livecd-rootfs (2.833) UNRELEASED; urgency=medium - * Revert all the losetup related changes introduced in versions between - 2.829 and 2.832. Those are not quite good for lunar due to CPC - incompatibilities. * Add ubuntucinnamon, ubuntu-unity and edubuntu to the workaround for the invalid apt cache issue we encountered during all of our previous releases. diff --git a/debian/control b/debian/control index c8c78a76..b1ad7323 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,7 @@ Depends: ${misc:Depends}, lsb-release, lzma, make, + mount, parted, procps, python3, diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index 280db0ab..cd8af1a7 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -41,7 +41,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" diff --git a/live-build/functions b/live-build/functions index f16c9445..dfed45cc 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,16 +12,13 @@ loop_raw= backing_img= clean_loops() { - local kpartx_ret - local kpartx_stdout - - if [ -n "${backing_img}" ]; then + if [ -n "${loop_device}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - kpartx -v -d "${backing_img}" + losetup -v -d "${loop_device}" unset backing_img fi @@ -65,18 +62,15 @@ mount_image() { trap clean_loops EXIT backing_img="$1" local rootpart="$2" - kpartx_mapping="$(kpartx -s -v -a ${backing_img})" + loop_device=$(losetup --show -f -P -v ${backing_img}) - # Find the loop device - loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" - loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 fi # Find the rootfs location - rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" + rootfs_dev_mapper="${loop_device}p${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 @@ -213,7 +207,7 @@ mount_disk_image() { mount_image ${disk_image} 1 mount_partition "${rootfs_dev_mapper}" $mountpoint - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then mount "${uefi_dev}" $mountpoint/boot/efi fi @@ -254,7 +248,7 @@ umount_partition() { umount_disk_image() { mountpoint="$1" - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then # zero fill free space in UEFI partition cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index dc87a361..b5b7cffc 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -49,7 +49,7 @@ GRUB_TIMEOUT=0 # Set the default commandline GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk" EOF - prep_partition="/dev/mapper${loop_device///dev/}p2" + prep_partition="${loop_device}p2" chroot mountpoint grub-install "${prep_partition}" \ --no-nvram \ --boot-directory=/boot \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 91e77516..042db427 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -197,7 +197,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" @@ -234,7 +234,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -246,7 +246,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -258,7 +258,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p13" + cidata_dev="${loop_device}p13" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -285,10 +285,10 @@ install_grub() { efi_target=riscv64-efi # The real U-Boot chroot mountpoint apt-get install -qqy u-boot-microchip - loader="/dev/mapper${loop_device///dev/}p13" + loader="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -330,10 +330,10 @@ install_grub() { chroot mountpoint apt-get install -qqy u-boot-nezha # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. # Package nezha-boot0 is not needed anymore. - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -359,7 +359,7 @@ install_grub() { efi_target=riscv64-efi # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="/dev/mapper${loop_device///dev/}p3" + uenv_dev="${loop_device}p3" mkfs.ext4 "${uenv_dev}" uenv_mnt_dir=`mktemp -d uenvXXX` mount "${uenv_dev}" "${uenv_mnt_dir}" @@ -387,7 +387,7 @@ EOF umount "${uenv_mnt_dir}" rmdir "${uenv_mnt_dir}" # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -406,7 +406,7 @@ EOF chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -431,13 +431,13 @@ EOF fi chroot mountpoint apt-get install -qqy u-boot-sifive # FSBL, which gets U-Boot SPL - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" # The real U-Boot - loader2="/dev/mapper${loop_device///dev/}p14" + loader2="${loop_device}p14" dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, From ef146db89529fc7fbc48052e0b684f7cb95f34ee Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 8 May 2023 15:47:04 -0700 Subject: [PATCH 49/78] Try to use udevadm settle after losetup to resolve race in riscv64 image builds. --- debian/changelog | 5 +++++ live-build/functions | 2 ++ 2 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index ddf7c02a..56c47254 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,15 @@ livecd-rootfs (2.833) UNRELEASED; urgency=medium + [ Łukasz 'sil2100' Zemczak ] * Add ubuntucinnamon, ubuntu-unity and edubuntu to the workaround for the invalid apt cache issue we encountered during all of our previous releases. * Switch to use the desktop model for the installer for the canary images. + [ Steve Langasek ] + * Try to use udevadm settle after losetup to resolve race in riscv64 image + builds. + -- Łukasz 'sil2100' Zemczak Wed, 26 Apr 2023 13:36:30 +0200 livecd-rootfs (2.832) lunar; urgency=medium diff --git a/live-build/functions b/live-build/functions index dfed45cc..3a25e995 100644 --- a/live-build/functions +++ b/live-build/functions @@ -64,6 +64,8 @@ mount_image() { local rootpart="$2" loop_device=$(losetup --show -f -P -v ${backing_img}) + udevadm settle + if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 From 66f22e173073e81b0997bbf18b3c7df414f7da50 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 8 May 2023 15:47:12 -0700 Subject: [PATCH 50/78] releasing package livecd-rootfs version 2.833 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 56c47254..2d5c6309 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.833) UNRELEASED; urgency=medium +livecd-rootfs (2.833) mantic; urgency=medium [ Łukasz 'sil2100' Zemczak ] * Add ubuntucinnamon, ubuntu-unity and edubuntu to the workaround for the @@ -10,7 +10,7 @@ livecd-rootfs (2.833) UNRELEASED; urgency=medium * Try to use udevadm settle after losetup to resolve race in riscv64 image builds. - -- Łukasz 'sil2100' Zemczak Wed, 26 Apr 2023 13:36:30 +0200 + -- Steve Langasek Mon, 08 May 2023 15:47:08 -0700 livecd-rootfs (2.832) lunar; urgency=medium From cfbcf2d690173e096878fec862a6711a2721a7b3 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 9 May 2023 19:06:48 -0700 Subject: [PATCH 51/78] Use the correct seed base for edubuntu. LP: #2019060. --- debian/changelog | 6 ++++++ live-build/auto/config | 3 +++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2d5c6309..73edfbae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.834) UNRELEASED; urgency=medium + + * Use the correct seed base for edubuntu. LP: #2019060. + + -- Steve Langasek Tue, 09 May 2023 19:06:28 -0700 + livecd-rootfs (2.833) mantic; urgency=medium [ Łukasz 'sil2100' Zemczak ] diff --git a/live-build/auto/config b/live-build/auto/config index ca25d54b..5346c6a7 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1180,6 +1180,9 @@ case $PROJECT:${SUBPROJECT:-} in ;; xubuntu:minimal) ;; + edubuntu:*) + BASE_SEED='desktop' + ;; *) BASE_SEED='desktop' ;; From 6d66b8d602a34e856ef0884aaf5223bd87e914bb Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 9 May 2023 19:06:53 -0700 Subject: [PATCH 52/78] releasing package livecd-rootfs version 2.834 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 73edfbae..062ca99d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.834) UNRELEASED; urgency=medium +livecd-rootfs (2.834) mantic; urgency=medium * Use the correct seed base for edubuntu. LP: #2019060. - -- Steve Langasek Tue, 09 May 2023 19:06:28 -0700 + -- Steve Langasek Tue, 09 May 2023 19:06:50 -0700 livecd-rootfs (2.833) mantic; urgency=medium From 6bc353602f723773d7da863fa2fa3c79ce0388b9 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Tue, 9 May 2023 18:33:32 -0600 Subject: [PATCH 53/78] canary: fix systems directory --- live-build/ubuntu/hooks/020-canary-enhanced-sb.binary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary index 89060624..3083e3dc 100644 --- a/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary +++ b/live-build/ubuntu/hooks/020-canary-enhanced-sb.binary @@ -108,6 +108,6 @@ WiXM9CPKCZv/Es3uOp/ke0wWL7v0MZhzUJ+QhOtTNg== EOF env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic config/classic-model.model chroot -mv chroot/system-seed/systems/* chroot/system-seed/systems/classic +mv chroot/system-seed/systems/* chroot/system-seed/systems/enhanced-secureboot-desktop rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed rm -rf chroot/system-seed/ From 56952ad06d4699a7571de1bb3286e7c0f739bc09 Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Tue, 9 May 2023 18:34:35 -0600 Subject: [PATCH 54/78] rev changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 062ca99d..b4535513 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.835) UNRELEASED; urgency=medium + + * canary: fix the lookup location for 'enhanced-secureboot-desktop' + + -- Dan Bungert Wed, 10 May 2023 07:30:05 -0600 + livecd-rootfs (2.834) mantic; urgency=medium * Use the correct seed base for edubuntu. LP: #2019060. From 11e3de7847cec52858244ec7f8608fa20bbafcfe Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Wed, 10 May 2023 16:02:39 -0600 Subject: [PATCH 55/78] releasing package livecd-rootfs version 2.835 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b4535513..26b503d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.835) UNRELEASED; urgency=medium +livecd-rootfs (2.835) mantic; urgency=medium * canary: fix the lookup location for 'enhanced-secureboot-desktop' - -- Dan Bungert Wed, 10 May 2023 07:30:05 -0600 + -- Dan Bungert Wed, 10 May 2023 16:01:02 -0600 livecd-rootfs (2.834) mantic; urgency=medium From 55ecac3ca7cff2bd6ff5ae1daeb9f29495456e1b Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Thu, 11 May 2023 17:57:05 -0600 Subject: [PATCH 56/78] canary: include cryptsetup in the live layer --- debian/changelog | 6 ++++++ live-build/auto/config | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 26b503d8..a36fcf41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.836) UNRELEASED; urgency=medium + + * canary: include cryptsetup in the live layer + + -- Dan Bungert Thu, 11 May 2023 17:53:56 -0600 + livecd-rootfs (2.835) mantic; urgency=medium * canary: fix the lookup location for 'enhanced-secureboot-desktop' diff --git a/live-build/auto/config b/live-build/auto/config index 5346c6a7..ff0abd60 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -757,7 +757,7 @@ case $PROJECT in fi # the live layer, contains all packages for the live session installer # TODO: we should probably add the kernel per KERNEL_FLAVOURS - add_package minimal.standard.live linux-generic casper lvm2 mdadm + add_package minimal.standard.live linux-generic casper lvm2 mdadm cryptsetup remove_package minimal.standard.live ubiquity-frontend-gtk # the enhanced-secureboot layer, contains all packages for the enhanced secureboot install add_package minimal.standard.enhanced-secureboot cryptsetup From db029cd387b5bb67a8399023138de93a65cf02ee Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Thu, 11 May 2023 19:16:53 -0600 Subject: [PATCH 57/78] releasing package livecd-rootfs version 2.836 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a36fcf41..0906c7d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.836) UNRELEASED; urgency=medium +livecd-rootfs (2.836) mantic; urgency=medium * canary: include cryptsetup in the live layer - -- Dan Bungert Thu, 11 May 2023 17:53:56 -0600 + -- Dan Bungert Thu, 11 May 2023 19:16:18 -0600 livecd-rootfs (2.835) mantic; urgency=medium From a65c1815965cd72347433a29b5a4fecc87161558 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 23 Sep 2022 10:58:43 +1200 Subject: [PATCH 58/78] auto/config: Rewrite add_task to use a Python script that cribs the logic from lp:ubuntu-archive-publishing's generate_extra_overrides.py. This means we can avoid some dubious hacks around seeding snaps and no longer depend on the Task headers in the archive. --- debian/changelog | 9 +++++ live-build/auto/config | 89 ++++++++++++++++-------------------------- live-build/expand-task | 84 +++++++++++++++++++++++++++++++++++++++ live-build/functions | 50 ------------------------ 4 files changed, 126 insertions(+), 106 deletions(-) create mode 100755 live-build/expand-task diff --git a/debian/changelog b/debian/changelog index 0906c7d6..52429984 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.837) UNRELEASED; urgency=medium + + * auto/config: Rewrite add_task to use a Python script that cribs the logic + from lp:ubuntu-archive-publishing's generate_extra_overrides.py. This + means we can avoid some dubious hacks around seeding snaps and no longer + depend on the Task headers in the archive. (LP: #2019265) + + -- Michael Hudson-Doyle Fri, 23 Sep 2022 10:58:29 +1200 + livecd-rootfs (2.836) mantic; urgency=medium * canary: include cryptsetup in the live layer diff --git a/live-build/auto/config b/live-build/auto/config index ff0abd60..801e6aaf 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -36,6 +36,7 @@ mkdir -p config cp -af /usr/share/livecd-rootfs/live-build/functions config/functions cp -af /usr/share/livecd-rootfs/live-build/lb_*_layered config/ cp -af /usr/share/livecd-rootfs/live-build/snap-seed-parse.py config/snap-seed-parse +cp -af /usr/share/livecd-rootfs/live-build/expand-task config/expand-task cp -af /usr/share/livecd-rootfs/live-build/squashfs-exclude-files config/ mkdir -p config/package-lists @@ -106,55 +107,36 @@ add_task () { local pass="$1" shift - local task - local snap_list_file - local snap_list_files - local curseed + local file pkg_file snap_file task _check_immutable_passes_to_layers _register_pass "$pass" - # The removal of direct task installation support from live-build - # poses some problems. If the chroot has multiarch configured - for - # example, if we're building for amd64 - then dumpavail will show - # foreign-architecture packages which will have their own Task - # lines, but which we don't want to install. (Compare - # PackageContainerInterface::FromTask in apt, which restricts task - # expansion to the native architecture.) We therefore restrict our - # search to stanzas with Architecture: $ARCH or all. - # - # However, even this may not be accurate enough. At the moment I - # have no idea what happens if an Architecture: all package has - # different Task fields on different architectures. This is - # probably a lurking timebomb that we need to fix. In the meantime, - # the Architecture restriction at least saves us from abject - # failure. - # - # We want as well to grab the snap list for each PASS. Resolve for all - # given task, and deduplicate them to generate snaps for the PASS. + if [ ! -e config/germinate-output/structure ]; then + echo "add_task too soon" >&2 + exit 1 + fi + + pkg_file="config/package-lists/livecd-rootfs.list.chroot_$pass" + + if [ $PASSES_TO_LAYERS = "true" ]; then + snap_file="config/package-lists/livecd-rootfs.snaplist.chroot_$pass.full" + else + snap_file="config/seeded-snaps" + fi for task; do - # We need a ridiculous number of backslashes to protect - # parentheses from eval. - echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" - - curseed=$(seed_from_task ${task}) - if [ -z "${curseed}" ]; then - echo "W: No seed matching task ${task}" - continue - fi - snap_list_file="config/package-lists/seed.${curseed}.snaplist.full" - snap_from_seed "${curseed}" $snap_list_file - if [ -e "$snap_list_file" ]; then - snap_list_files="${snap_list_files} $snap_list_file" + ./config/expand-task config/germinate-output $FLAVOUR $task packages >> "$pkg_file" + ./config/expand-task config/germinate-output $FLAVOUR $task snaps >> "$snap_file" + done + + for file in $pkg_file $snap_file; do + if [ -s $file ]; then + sort -u -o $file $file + else + rm -f $file fi done - # The snap list is one line, and could be duplicated between seeds via inheritance. - # Uniquely sort them and store them back in one line. - if [ -n "${snap_list_files}" ]; then - cat ${snap_list_files}|xargs -n1|sort -u > "config/package-lists/livecd-rootfs.snaplist.chroot_${pass}.full" - rm ${snap_list_files} - fi } add_package () @@ -639,34 +621,34 @@ fi mkdir -p config/germinate-output case $PROJECT in kubuntu*) - SEED=kubuntu.$SUITE + FLAVOUR=kubuntu ;; xubuntu*) - SEED=xubuntu.$SUITE + FLAVOUR=xubuntu ;; ubuntu-mate*) - SEED=ubuntu-mate.$SUITE + FLAVOUR=ubuntu-mate ;; ubuntu-unity*) - SEED=ubuntu-unity.$SUITE + FLAVOUR=ubuntu-unity ;; lubuntu*) - SEED=lubuntu.$SUITE + FLAVOUR=lubuntu ;; ubuntu-budgie*) - SEED=ubuntu-budgie.$SUITE + FLAVOUR=ubuntu-budgie ;; ubuntukylin*) - SEED=ubuntukylin.$SUITE + FLAVOUR=ubuntukylin ;; ubuntustudio*) - SEED=ubuntustudio.$SUITE + FLAVOUR=ubuntustudio ;; ubuntucinnamon*) SEED=ubuntucinnamon.$SUITE ;; *) - SEED=ubuntu.$SUITE + FLAVOUR=ubuntu ;; esac @@ -694,7 +676,7 @@ if ! [ -e config/germinate-output/structure ]; then GERMINATE_ARG="-c $(echo $COMPONENTS | sed -e's/ \+/,/g')" fi (cd config/germinate-output && germinate --no-rdepends --no-installer \ - -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $SEED \ + -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $FLAVOUR.$SUITE \ $GERMINATE_ARG -a $ARCH) fi @@ -957,8 +939,6 @@ case $PROJECT in add_task ubuntu-server-minimal server-minimal add_package ubuntu-server-minimal lxd-installer add_task ubuntu-server-minimal.ubuntu-server minimal standard server - # add_task really should do this itself but for now... - snap_from_seed server config/package-lists/livecd-rootfs.snaplist.chroot_ubuntu-server-minimal.ubuntu-server.full add_package ubuntu-server-minimal.ubuntu-server cloud-init add_package ubuntu-server-minimal.ubuntu-server.installer linux-firmware casper openssh-server @@ -1188,9 +1168,6 @@ case $PROJECT:${SUBPROJECT:-} in ;; esac -if [ "$PASSES_TO_LAYERS" != "true" ] && [ -n "${BASE_SEED}" ]; then - snap_from_seed "${BASE_SEED}" config/seeded-snaps -fi if [ "$PROJECT:${SUBPROJECT:-}" = ubuntu-cpc:minimized ]; then # We install a lxc script that installs the snap when invoked. We don't # want any other snaps to come in without due consideration, so fail the diff --git a/live-build/expand-task b/live-build/expand-task new file mode 100755 index 00000000..fb309e7b --- /dev/null +++ b/live-build/expand-task @@ -0,0 +1,84 @@ +#!/usr/bin/python3 + +import argparse +import glob +import os +import re + +p = argparse.ArgumentParser() +p.add_argument('output_dir') +p.add_argument('flavour') +p.add_argument('task') +p.add_argument('what', choices=['packages', 'snaps']) +args = p.parse_args() + +if args.what == 'snaps': + ext = '.snaps' +else: + ext = '' + + +# begin copy/paste from ubuntu-archive-publishing's generate_extra_overrides. +def parseTaskHeaders(seedtext): + """Parse a seed for Task headers. + + seedtext is a file-like object. Return a dictionary of Task headers, + with keys canonicalised to lower-case. + """ + task_headers = {} + task_header_regex = re.compile( + r"task-(.*?):(.*)", flags=re.IGNORECASE) + for line in seedtext: + match = task_header_regex.match(line) + if match is not None: + key, value = match.groups() + task_headers[key.lower()] = value.strip() + return task_headers + + +def getTaskName(task_headers, flavour, seedname, primary_flavour): + """Work out the name of the Task to be generated from this seed. + + If there is a Task-Name header, it wins; otherwise, seeds with a + Task-Per-Derivative header are honoured for all flavours and put in + an appropriate namespace, while other seeds are only honoured for + the first flavour and have archive-global names. + """ + if "name" in task_headers: + return task_headers["name"] + elif "per-derivative" in task_headers: + return "%s-%s" % (flavour, seedname) + elif primary_flavour: + return seedname + else: + return None + + +def getTaskSeeds(task_headers, seedname): + """Return the list of seeds used to generate a task from this seed. + + The list of packages in this task comes from this seed plus any + other seeds listed in a Task-Seeds header. + """ + scan_seeds = set([seedname]) + if "seeds" in task_headers: + scan_seeds.update(task_headers["seeds"].split()) + return sorted(scan_seeds) +# end copy/paste from ubuntu-archive-publishing's generate_extra_overrides. + + +for seedtext in glob.glob(f'{args.output_dir}/*.seedtext'): + hs = parseTaskHeaders(open(seedtext)) + if not hs: + continue + seedname = os.path.splitext(os.path.basename(seedtext))[0] + tn = getTaskName(hs, args.flavour, seedname, args.flavour == 'ubuntu') + if tn != args.task: + continue + for seed in getTaskSeeds(hs, seedname): + for line in open(f'{args.output_dir}/{seed}{ext}'): + if re.match('^[a-z0-9]', line): + print(line.split()[0]) + break +else: + raise Exception("did not find task %r" % (args.task,)) diff --git a/live-build/functions b/live-build/functions index 3a25e995..208b8f28 100644 --- a/live-build/functions +++ b/live-build/functions @@ -766,56 +766,6 @@ snap_validate_seed() { fi } -snap_from_seed() { - local base_seed=$1 - local out=$2 - local all_snaps - local seeds_expanded - - seeds_expanded=$(inheritance ${base_seed}) - for seed in ${seeds_expanded}; do - echo "snap: considering ${seed}" - file=config/germinate-output/${seed}.snaps - [ -e "${file}" ] || continue - # extract the first column (snap package name) from germinate's output - # translate the human-readable "foo (classic)" into a - # more machine readable "foo/classic" - seed_snaps=$(sed -rn '1,/-----/d;/-----/,$d; s/(.*) \|.*/\1/; s, \(classic\),/classic,; p' "${file}") - for snap in ${seed_snaps}; do - echo "snap: found ${snap}" - all_snaps="${all_snaps:+${all_snaps} }${snap}" - done - done - if [ -n "${all_snaps}" ]; then - echo "${all_snaps}" > $out - fi -} - -seed_from_task () -{ - # Retrieve the name of the seed from a task name - local task=$1 - local seed - local seedfile - local seedfiles - - seedfile="$(grep -lE "^Task-Key: +${task}\$" config/germinate-output/*seedtext|head -1)" - if [ -n "$seedfile" ]; then - basename $seedfile .seedtext - return - fi - - seedfiles="$(grep -lE "^Task-Per-Derivative: *1\$" config/germinate-output/*seedtext)" - if [ -n "$seedfiles" ]; then - for seed in $(echo $seedfiles | xargs basename -s .seedtext); do - if [ ${PROJECT}-${seed} = $task ]; then - echo ${seed} - return - fi - done - fi -} - list_packages_from_seed () { # Store all packages for a given seed, including its seed dependency # $1: Name of the seed to expand to a package list From 6b92be950421f27e9b739aec38da0714ae9971bd Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 15 May 2023 09:36:46 +1200 Subject: [PATCH 59/78] releasing package livecd-rootfs version 2.837 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52429984..bcf1d89c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,11 @@ -livecd-rootfs (2.837) UNRELEASED; urgency=medium +livecd-rootfs (2.837) mantic; urgency=medium * auto/config: Rewrite add_task to use a Python script that cribs the logic from lp:ubuntu-archive-publishing's generate_extra_overrides.py. This means we can avoid some dubious hacks around seeding snaps and no longer depend on the Task headers in the archive. (LP: #2019265) - -- Michael Hudson-Doyle Fri, 23 Sep 2022 10:58:29 +1200 + -- Michael Hudson-Doyle Mon, 15 May 2023 09:36:29 +1200 livecd-rootfs (2.836) mantic; urgency=medium From 01b851e16210924cea8067e858ed73e05fd74ff4 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 13:25:21 +1200 Subject: [PATCH 60/78] auto/config: Set FLAVOUR appropriately for flavours added since the expand-task branch was created. --- debian/changelog | 7 +++++++ live-build/auto/config | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bcf1d89c..a90ba22f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.838) UNRELEASED; urgency=medium + + * auto/config: Set FLAVOUR appropriately for flavours added since the + expand-task branch was created. + + -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 + livecd-rootfs (2.837) mantic; urgency=medium * auto/config: Rewrite add_task to use a Python script that cribs the logic diff --git a/live-build/auto/config b/live-build/auto/config index 801e6aaf..ed3bf197 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -620,6 +620,9 @@ fi mkdir -p config/germinate-output case $PROJECT in + edubuntu*) + FLAVOUR=edubuntu + ;; kubuntu*) FLAVOUR=kubuntu ;; @@ -645,7 +648,7 @@ case $PROJECT in FLAVOUR=ubuntustudio ;; ubuntucinnamon*) - SEED=ubuntucinnamon.$SUITE + FLAVOUR=ubuntucinnamon ;; *) FLAVOUR=ubuntu From 734da44d00bb3d786c388ca908a89d4791071df1 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 15:45:12 +1200 Subject: [PATCH 61/78] live-build/expand-task: Fix expansion of tasks with non-flavour specific name (e.g. "minimal") when building a non-Ubuntu flavour. --- debian/changelog | 2 ++ live-build/expand-task | 39 +++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/debian/changelog b/debian/changelog index a90ba22f..b92ac415 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ livecd-rootfs (2.838) UNRELEASED; urgency=medium * auto/config: Set FLAVOUR appropriately for flavours added since the expand-task branch was created. + * live-build/expand-task: Fix expansion of tasks with non-flavour specific + name (e.g. "minimal") when building a non-Ubuntu flavour. -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 diff --git a/live-build/expand-task b/live-build/expand-task index fb309e7b..7219089f 100755 --- a/live-build/expand-task +++ b/live-build/expand-task @@ -35,25 +35,6 @@ def parseTaskHeaders(seedtext): task_headers[key.lower()] = value.strip() return task_headers - -def getTaskName(task_headers, flavour, seedname, primary_flavour): - """Work out the name of the Task to be generated from this seed. - - If there is a Task-Name header, it wins; otherwise, seeds with a - Task-Per-Derivative header are honoured for all flavours and put in - an appropriate namespace, while other seeds are only honoured for - the first flavour and have archive-global names. - """ - if "name" in task_headers: - return task_headers["name"] - elif "per-derivative" in task_headers: - return "%s-%s" % (flavour, seedname) - elif primary_flavour: - return seedname - else: - return None - - def getTaskSeeds(task_headers, seedname): """Return the list of seeds used to generate a task from this seed. @@ -66,13 +47,31 @@ def getTaskSeeds(task_headers, seedname): return sorted(scan_seeds) # end copy/paste from ubuntu-archive-publishing's generate_extra_overrides. +# This is not quite the same as the one in generate_extra_overrides, +# because for seeds that do not have flavour specific names, the Task +# override is only generated for the Ubuntu flavour rather than +# redundantly doing it for each flavour. +def getTaskName(task_headers, flavour, seedname): + """Work out the name of the Task to be generated from this seed. + + If there is a Task-Name header, it wins; otherwise, seeds with a + Task-Per-Derivative get put in an appropriate namespace. Other seeds + have a task name that matches the seed name. + """ + if "name" in task_headers: + return task_headers["name"] + elif "per-derivative" in task_headers: + return "%s-%s" % (flavour, seedname) + else: + return seedname + for seedtext in glob.glob(f'{args.output_dir}/*.seedtext'): hs = parseTaskHeaders(open(seedtext)) if not hs: continue seedname = os.path.splitext(os.path.basename(seedtext))[0] - tn = getTaskName(hs, args.flavour, seedname, args.flavour == 'ubuntu') + tn = getTaskName(hs, args.flavour, seedname) if tn != args.task: continue for seed in getTaskSeeds(hs, seedname): From 7c4fb6b8040572cf810cb621c9cb5b2f9c550d6b Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 15:40:32 +1200 Subject: [PATCH 62/78] auto/config: Do not include the ubuntu-desktop-minimal task in edubuntu. Cross flavour task references do not work with the approach expand-task takes, and the ubuntu-desktop-minimal package is part of the edubuntu-desktop-gnome task already. --- debian/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index b92ac415..d6f42966 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ livecd-rootfs (2.838) UNRELEASED; urgency=medium expand-task branch was created. * live-build/expand-task: Fix expansion of tasks with non-flavour specific name (e.g. "minimal") when building a non-Ubuntu flavour. + * auto/config: Do not include the ubuntu-desktop-minimal task in edubuntu. + Cross flavour task references do not work with the approach expand-task + takes, and the ubuntu-desktop-minimal package is part of the + edubuntu-desktop-gnome task already. -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 From 8704aafecc33b2ed06a058d423e87740066119eb Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 14:48:48 +1200 Subject: [PATCH 63/78] live-build/expand-task: handle seeding of classic snaps correctly. --- debian/changelog | 1 + live-build/expand-task | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d6f42966..fbd6c88d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ livecd-rootfs (2.838) UNRELEASED; urgency=medium Cross flavour task references do not work with the approach expand-task takes, and the ubuntu-desktop-minimal package is part of the edubuntu-desktop-gnome task already. + * live-build/expand-task: handle seeding of classic snaps correctly. -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 diff --git a/live-build/expand-task b/live-build/expand-task index 7219089f..1ac44881 100755 --- a/live-build/expand-task +++ b/live-build/expand-task @@ -77,7 +77,10 @@ for seedtext in glob.glob(f'{args.output_dir}/*.seedtext'): for seed in getTaskSeeds(hs, seedname): for line in open(f'{args.output_dir}/{seed}{ext}'): if re.match('^[a-z0-9]', line): - print(line.split()[0]) + name = line.split()[0] + if args.what == 'snaps' and '(classic)' in line: + name += '/classic' + print(name) break else: raise Exception("did not find task %r" % (args.task,)) From cafbd6f7d68f72abfe1cfd9d1f562dc2a9d43903 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 15:53:46 +1200 Subject: [PATCH 64/78] actual content change to drop edubuntu referencing ubuntu-desktop-minimal task --- live-build/auto/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/auto/config b/live-build/auto/config index ed3bf197..db75472c 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -842,7 +842,7 @@ case $PROJECT in ;; edubuntu) - add_task install minimal standard ubuntu-desktop-minimal edubuntu-desktop-gnome + add_task install minimal standard edubuntu-desktop-gnome LIVE_TASK='edubuntu-live' ;; From 51fe90d31e1c2573d6a55376ed9763edd117d8ad Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 17 May 2023 15:54:01 +1200 Subject: [PATCH 65/78] releasing package livecd-rootfs version 2.838 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fbd6c88d..e337c2d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.838) UNRELEASED; urgency=medium +livecd-rootfs (2.838) mantic; urgency=medium * auto/config: Set FLAVOUR appropriately for flavours added since the expand-task branch was created. @@ -10,7 +10,7 @@ livecd-rootfs (2.838) UNRELEASED; urgency=medium edubuntu-desktop-gnome task already. * live-build/expand-task: handle seeding of classic snaps correctly. - -- Michael Hudson-Doyle Wed, 17 May 2023 13:24:43 +1200 + -- Michael Hudson-Doyle Wed, 17 May 2023 15:53:50 +1200 livecd-rootfs (2.837) mantic; urgency=medium From d377e535b26e80fc6ef4bce08f22197650659083 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 17 May 2023 09:27:03 -0700 Subject: [PATCH 66/78] Drop use of --removable flag to grub-install from buildd/hooks This now matches the cloud images (7c760864fdcb278ca37396f06f5e3f297428d63d) fixing bootloader updates in the buildd images, but also fixing compatibility with using devtmpfs for losetup. --- debian/changelog | 10 ++++++++++ live-build/buildd/hooks/02-disk-image-uefi.binary | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index e337c2d4..51169f9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +livecd-rootfs (2.839) UNRELEASED; urgency=medium + + * Drop use of --removable flag to grub-install from + live-build/buildd/hooks/02-disk-image-uefi.binary, to match the cloud + images (7c760864fdcb278ca37396f06f5e3f297428d63d). This fixes + bootloader updates in the buildd images, but also fixes compatibility + with using devtmpfs for losetup. + + -- Steve Langasek Wed, 17 May 2023 09:25:55 -0700 + livecd-rootfs (2.838) mantic; urgency=medium * auto/config: Set FLAVOUR appropriately for flavours added since the diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index cd8af1a7..44a7ff42 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -102,19 +102,9 @@ install_grub() { --boot-directory=/boot \ --efi-directory=/boot/efi \ --target=${efi_target} \ - --removable \ --uefi-secure-boot \ --no-nvram - if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then - sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg - sed -i "1i${IMAGE_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg - # For some reason the grub disk is looking for /boot/grub/grub.cfg on - # part 15.... - chroot mountpoint mkdir -p /boot/efi/boot/grub - chroot mountpoint cp /boot/efi/EFI/BOOT/grub.cfg /boot/efi/boot/grub - fi - if [ "$ARCH" = "amd64" ]; then # Install the BIOS/GPT bits. Since GPT boots from the ESP partition, # it means that we just run this simple command and we're done From e8ea466483b0eee50388f80b284cb1f6f2760744 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 17 May 2023 09:28:03 -0700 Subject: [PATCH 67/78] releasing package livecd-rootfs version 2.839 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 51169f9c..01e89bdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.839) UNRELEASED; urgency=medium +livecd-rootfs (2.839) mantic; urgency=medium * Drop use of --removable flag to grub-install from live-build/buildd/hooks/02-disk-image-uefi.binary, to match the cloud @@ -6,7 +6,7 @@ livecd-rootfs (2.839) UNRELEASED; urgency=medium bootloader updates in the buildd images, but also fixes compatibility with using devtmpfs for losetup. - -- Steve Langasek Wed, 17 May 2023 09:25:55 -0700 + -- Steve Langasek Wed, 17 May 2023 09:27:56 -0700 livecd-rootfs (2.838) mantic; urgency=medium From 35a56a5e03dfeffea8837c7e7d5834007378d331 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 18 May 2023 09:27:41 +1200 Subject: [PATCH 68/78] auto/config: switch ubuntucinnamon and ubuntu-unity builds to use add_task to get their desktop packages. Previously most (all?) flavour builds got the snaps from that flavour's "desktop" seed implicitly added, but now an explicit add_task is needed. --- debian/changelog | 9 +++++++++ live-build/auto/config | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 01e89bdf..e240d416 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.840) UNRELEASED; urgency=medium + + * auto/config: switch ubuntucinnamon and ubuntu-unity builds to use add_task + to get their desktop packages. Previously most (all?) flavour builds got + the snaps from that flavour's "desktop" seed implicitly added, but now an + explicit add_task is needed. + + -- Michael Hudson-Doyle Thu, 18 May 2023 09:25:38 +1200 + livecd-rootfs (2.839) mantic; urgency=medium * Drop use of --removable flag to grub-install from diff --git a/live-build/auto/config b/live-build/auto/config index db75472c..4d6c080f 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -847,8 +847,7 @@ case $PROJECT in ;; ubuntucinnamon) - add_task install minimal standard - add_package install ubuntucinnamon-desktop + add_task install minimal standard ubuntucinnamon-desktop # XXX: Adding live packages manually temporarily until we have # the live task for ubuntucinnamon set up properly. add_package live ubiquity-frontend-gtk @@ -910,8 +909,7 @@ case $PROJECT in ;; ubuntu-unity) - add_task install minimal standard - add_package install ubuntu-unity-desktop + add_task install minimal standard ubuntu-unity-desktop # XXX: Adding live packages manually temporarily until we have # the live task for ubuntu-unity set up properly. add_package live metacity ubiquity-frontend-gtk From 628134dfe79294e459650292d06133cad9fddaaf Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 18 May 2023 11:21:58 +1200 Subject: [PATCH 69/78] auto/config: alter check for unexpectedly seeded snaps in ubuntu-cpc:minimized build. As the build no longer implicitly seeds the snaps from the server seed, we can just assert no snaps are seeded. This fixes an autopkgtest regression but also cleaner. --- debian/changelog | 4 ++++ live-build/auto/config | 23 ++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index e240d416..094335a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ livecd-rootfs (2.840) UNRELEASED; urgency=medium to get their desktop packages. Previously most (all?) flavour builds got the snaps from that flavour's "desktop" seed implicitly added, but now an explicit add_task is needed. + * auto/config: alter check for unexpectedly seeded snaps in + ubuntu-cpc:minimized build. As the build no longer implicitly seeds the + snaps from the server seed, we can just assert no snaps are seeded. This + fixes an autopkgtest regression but also cleaner. -- Michael Hudson-Doyle Thu, 18 May 2023 09:25:38 +1200 diff --git a/live-build/auto/config b/live-build/auto/config index 4d6c080f..b7bec968 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1170,22 +1170,15 @@ case $PROJECT:${SUBPROJECT:-} in esac if [ "$PROJECT:${SUBPROJECT:-}" = ubuntu-cpc:minimized ]; then - # We install a lxc script that installs the snap when invoked. We don't - # want any other snaps to come in without due consideration, so fail the - # build if we see such a snap. - for snap in `cat config/seeded-snaps`; do - case $snap in - lxd | lxd=*) - ;; - *) - echo "Unexpected seeded snap for ubuntu-cpc:minimized build: $snap" - exit 1 - ;; - esac - done + # We install a lxc script that installs the snap when invoked and + # don't want any other snaps. + if [ -s config/seeded-snaps ]; then + echo "Unexpected seeded snaps for ubuntu-cpc:minimized build:" + cat config/seeded-snaps + exit 1 + fi - # Truncate but don't delete to a) prevent any snaps from being seeded, - # while at the same time b) triggering initialization of assertions. + # Create an empty file to trigger initialization of assertions. truncate --size 0 config/seeded-snaps fi From 3e5931c19b322f154914aad0e7622f55e506a6a7 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 18 May 2023 11:34:21 +1200 Subject: [PATCH 70/78] releasing package livecd-rootfs version 2.840 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 094335a6..0d4b8f6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.840) UNRELEASED; urgency=medium +livecd-rootfs (2.840) mantic; urgency=medium * auto/config: switch ubuntucinnamon and ubuntu-unity builds to use add_task to get their desktop packages. Previously most (all?) flavour builds got @@ -9,7 +9,7 @@ livecd-rootfs (2.840) UNRELEASED; urgency=medium snaps from the server seed, we can just assert no snaps are seeded. This fixes an autopkgtest regression but also cleaner. - -- Michael Hudson-Doyle Thu, 18 May 2023 09:25:38 +1200 + -- Michael Hudson-Doyle Thu, 18 May 2023 11:33:59 +1200 livecd-rootfs (2.839) mantic; urgency=medium From 5157d775f9c919860e97aa9fa395aff9eaadc14b Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 17 May 2023 23:48:23 -0700 Subject: [PATCH 71/78] The base seed for edubuntu is desktop-gnome, not desktop. LP: #2019060. --- debian/changelog | 6 ++++++ live-build/auto/config | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0d4b8f6e..c2e89b0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.841) UNRELEASED; urgency=medium + + * The base seed for edubuntu is desktop-gnome, not desktop. LP: #2019060. + + -- Steve Langasek Wed, 17 May 2023 23:48:12 -0700 + livecd-rootfs (2.840) mantic; urgency=medium * auto/config: switch ubuntucinnamon and ubuntu-unity builds to use add_task diff --git a/live-build/auto/config b/live-build/auto/config index b7bec968..c9d1e793 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1162,7 +1162,7 @@ case $PROJECT:${SUBPROJECT:-} in xubuntu:minimal) ;; edubuntu:*) - BASE_SEED='desktop' + BASE_SEED='desktop-gnome' ;; *) BASE_SEED='desktop' From 25b92777a013ae8e68328640154c30f310491341 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 17 May 2023 23:51:01 -0700 Subject: [PATCH 72/78] releasing package livecd-rootfs version 2.841 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2e89b0a..711cd484 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.841) UNRELEASED; urgency=medium +livecd-rootfs (2.841) mantic; urgency=medium * The base seed for edubuntu is desktop-gnome, not desktop. LP: #2019060. - -- Steve Langasek Wed, 17 May 2023 23:48:12 -0700 + -- Steve Langasek Wed, 17 May 2023 23:50:57 -0700 livecd-rootfs (2.840) mantic; urgency=medium From 4dbd985231495f8ad9bea2b7df1360a8054c3775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 24 May 2023 11:05:47 +0200 Subject: [PATCH 73/78] Revert "Try to use udevadm settle after losetup to resolve race in riscv64 image builds." This reverts commit ef146db89529fc7fbc48052e0b684f7cb95f34ee. --- live-build/functions | 2 -- 1 file changed, 2 deletions(-) diff --git a/live-build/functions b/live-build/functions index 208b8f28..b21a8518 100644 --- a/live-build/functions +++ b/live-build/functions @@ -64,8 +64,6 @@ mount_image() { local rootpart="$2" loop_device=$(losetup --show -f -P -v ${backing_img}) - udevadm settle - if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 From 1931bbcb194febe241aa82f03a6730ba82a84409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 24 May 2023 11:06:56 +0200 Subject: [PATCH 74/78] Revert "Revert "Revert the recent kpartx->losetup changes, as we need to put some other changes on top. Let's try to re-introduce this for MM."" This reverts commit ada1f09b39332ec828369e0a30f2870df5c4dc3e. --- debian/control | 1 - .../buildd/hooks/02-disk-image-uefi.binary | 2 +- live-build/functions | 18 ++++++++---- .../hooks.d/base/disk-image-ppc64el.binary | 2 +- .../hooks.d/base/disk-image-uefi.binary | 28 +++++++++---------- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/debian/control b/debian/control index b1ad7323..c8c78a76 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,6 @@ Depends: ${misc:Depends}, lsb-release, lzma, make, - mount, parted, procps, python3, diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index 44a7ff42..d358596a 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -41,7 +41,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="${loop_device}p15" + uefi_dev="/dev/mapper${loop_device///dev/}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" diff --git a/live-build/functions b/live-build/functions index b21a8518..c00a06b5 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,13 +12,16 @@ loop_raw= backing_img= clean_loops() { - if [ -n "${loop_device}" ]; then + local kpartx_ret + local kpartx_stdout + + if [ -n "${backing_img}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - losetup -v -d "${loop_device}" + kpartx -v -d "${backing_img}" unset backing_img fi @@ -62,15 +65,18 @@ mount_image() { trap clean_loops EXIT backing_img="$1" local rootpart="$2" - loop_device=$(losetup --show -f -P -v ${backing_img}) + kpartx_mapping="$(kpartx -s -v -a ${backing_img})" + # Find the loop device + loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" + loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 fi # Find the rootfs location - rootfs_dev_mapper="${loop_device}p${rootpart}" + rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 @@ -207,7 +213,7 @@ mount_disk_image() { mount_image ${disk_image} 1 mount_partition "${rootfs_dev_mapper}" $mountpoint - local uefi_dev="${loop_device}p15" + local uefi_dev="/dev/mapper${loop_device///dev/}p15" if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then mount "${uefi_dev}" $mountpoint/boot/efi fi @@ -248,7 +254,7 @@ umount_partition() { umount_disk_image() { mountpoint="$1" - local uefi_dev="${loop_device}p15" + local uefi_dev="/dev/mapper${loop_device///dev/}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then # zero fill free space in UEFI partition cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index b5b7cffc..dc87a361 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -49,7 +49,7 @@ GRUB_TIMEOUT=0 # Set the default commandline GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk" EOF - prep_partition="${loop_device}p2" + prep_partition="/dev/mapper${loop_device///dev/}p2" chroot mountpoint grub-install "${prep_partition}" \ --no-nvram \ --boot-directory=/boot \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 042db427..91e77516 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -197,7 +197,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="${loop_device}p15" + uefi_dev="/dev/mapper${loop_device///dev/}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" @@ -234,7 +234,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p14" + cidata_dev="/dev/mapper${loop_device///dev/}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -246,7 +246,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p14" + cidata_dev="/dev/mapper${loop_device///dev/}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -258,7 +258,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="${loop_device}p13" + cidata_dev="/dev/mapper${loop_device///dev/}p13" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -285,10 +285,10 @@ install_grub() { efi_target=riscv64-efi # The real U-Boot chroot mountpoint apt-get install -qqy u-boot-microchip - loader="${loop_device}p13" + loader="/dev/mapper${loop_device///dev/}p13" dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -330,10 +330,10 @@ install_grub() { chroot mountpoint apt-get install -qqy u-boot-nezha # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. # Package nezha-boot0 is not needed anymore. - loader1="${loop_device}p13" + loader1="/dev/mapper${loop_device///dev/}p13" dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -359,7 +359,7 @@ install_grub() { efi_target=riscv64-efi # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="${loop_device}p3" + uenv_dev="/dev/mapper${loop_device///dev/}p3" mkfs.ext4 "${uenv_dev}" uenv_mnt_dir=`mktemp -d uenvXXX` mount "${uenv_dev}" "${uenv_mnt_dir}" @@ -387,7 +387,7 @@ EOF umount "${uenv_mnt_dir}" rmdir "${uenv_mnt_dir}" # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -406,7 +406,7 @@ EOF chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -431,13 +431,13 @@ EOF fi chroot mountpoint apt-get install -qqy u-boot-sifive # FSBL, which gets U-Boot SPL - loader1="${loop_device}p13" + loader1="/dev/mapper${loop_device///dev/}p13" # The real U-Boot - loader2="${loop_device}p14" + loader2="/dev/mapper${loop_device///dev/}p14" dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2 # Provide end-user modifyable CIDATA - cidata_dev="${loop_device}p12" + cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, From 9f6f689b6d0d87f840d1065123b6d53f2f67095c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 24 May 2023 11:09:08 +0200 Subject: [PATCH 75/78] Add changelog entry for recent reverts. --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 711cd484..82d81680 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.842) UNRELEASED; urgency=medium + + * Revert once again the kpartx->losetup changes as those are causing + constant build failures for RISC-V images. This clearly needs some more + investigation before proceeding. This means that we're back to using + kpartx for loop device setup. + + -- Łukasz 'sil2100' Zemczak Wed, 24 May 2023 11:07:21 +0200 + livecd-rootfs (2.841) mantic; urgency=medium * The base seed for edubuntu is desktop-gnome, not desktop. LP: #2019060. From f343191384f84a93117fe59b368e8504fb5f9f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 24 May 2023 11:09:34 +0200 Subject: [PATCH 76/78] releasing package livecd-rootfs version 2.842 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 82d81680..4f066a67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.842) UNRELEASED; urgency=medium +livecd-rootfs (2.842) mantic; urgency=medium * Revert once again the kpartx->losetup changes as those are causing constant build failures for RISC-V images. This clearly needs some more From 6fac77b481c65638879e26479958ffe7535c1ae7 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 26 May 2023 09:41:32 -0700 Subject: [PATCH 77/78] Revert "Revert "Revert "Revert the recent kpartx->losetup changes, as we need to put some other changes on top. Let's try to re-introduce this for MM.""" This reverts commit 1931bbcb194febe241aa82f03a6730ba82a84409. --- debian/changelog | 2 ++ debian/control | 1 + .../buildd/hooks/02-disk-image-uefi.binary | 2 +- live-build/functions | 18 ++++-------- .../hooks.d/base/disk-image-ppc64el.binary | 2 +- .../hooks.d/base/disk-image-uefi.binary | 28 +++++++++---------- 6 files changed, 25 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7c530508..a9994476 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ livecd-rootfs (2.843) UNRELEASED; urgency=medium * Unconditionally enable i386 in the chroot for Ubuntu Desktop; the new installer doesn't handle enabling this at install time, and late enablement also misses us some recommends. + * Restore losetup code, the necessary launchpad-buildd changes were being + deployed just as this revert landed. -- Steve Langasek Mon, 17 Apr 2023 16:51:13 -0700 diff --git a/debian/control b/debian/control index c8c78a76..b1ad7323 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,7 @@ Depends: ${misc:Depends}, lsb-release, lzma, make, + mount, parted, procps, python3, diff --git a/live-build/buildd/hooks/02-disk-image-uefi.binary b/live-build/buildd/hooks/02-disk-image-uefi.binary index d358596a..44a7ff42 100755 --- a/live-build/buildd/hooks/02-disk-image-uefi.binary +++ b/live-build/buildd/hooks/02-disk-image-uefi.binary @@ -41,7 +41,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" diff --git a/live-build/functions b/live-build/functions index c00a06b5..b21a8518 100644 --- a/live-build/functions +++ b/live-build/functions @@ -12,16 +12,13 @@ loop_raw= backing_img= clean_loops() { - local kpartx_ret - local kpartx_stdout - - if [ -n "${backing_img}" ]; then + if [ -n "${loop_device}" ]; then # If something just finished writing to the device or a # partition (e.g. the zerofree in umount_partition) udev might # still be processing the device. udevadm settle sync - kpartx -v -d "${backing_img}" + losetup -v -d "${loop_device}" unset backing_img fi @@ -65,18 +62,15 @@ mount_image() { trap clean_loops EXIT backing_img="$1" local rootpart="$2" - kpartx_mapping="$(kpartx -s -v -a ${backing_img})" + loop_device=$(losetup --show -f -P -v ${backing_img}) - # Find the loop device - loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')" - loop_device="/dev/${loop_p1%p[0-9]*}" if [ ! -b ${loop_device} ]; then echo "unable to find loop device for ${backing_img}" exit 1 fi # Find the rootfs location - rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}" + rootfs_dev_mapper="${loop_device}p${rootpart}" if [ ! -b "${rootfs_dev_mapper}" ]; then echo "${rootfs_dev_mapper} is not a block device"; exit 1 @@ -213,7 +207,7 @@ mount_disk_image() { mount_image ${disk_image} 1 mount_partition "${rootfs_dev_mapper}" $mountpoint - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then mount "${uefi_dev}" $mountpoint/boot/efi fi @@ -254,7 +248,7 @@ umount_partition() { umount_disk_image() { mountpoint="$1" - local uefi_dev="/dev/mapper${loop_device///dev/}p15" + local uefi_dev="${loop_device}p15" if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then # zero fill free space in UEFI partition cat < /dev/zero > "$mountpoint/boot/efi/bloat_file" 2> /dev/null || true diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index dc87a361..b5b7cffc 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -49,7 +49,7 @@ GRUB_TIMEOUT=0 # Set the default commandline GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk" EOF - prep_partition="/dev/mapper${loop_device///dev/}p2" + prep_partition="${loop_device}p2" chroot mountpoint grub-install "${prep_partition}" \ --no-nvram \ --boot-directory=/boot \ diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 91e77516..042db427 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -197,7 +197,7 @@ create_partitions() { } create_and_mount_uefi_partition() { - uefi_dev="/dev/mapper${loop_device///dev/}p15" + uefi_dev="${loop_device}p15" mountpoint="$1" mkfs.vfat -F 32 -n UEFI "${uefi_dev}" @@ -234,7 +234,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -246,7 +246,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p14" + cidata_dev="${loop_device}p14" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -258,7 +258,7 @@ install_grub() { # Server preinstalled image # Setup cidata sample data & nocloud fallback # Allows login on first boot with or without metadata - cidata_dev="/dev/mapper${loop_device///dev/}p13" + cidata_dev="${loop_device}p13" setup_cidata "${cidata_dev}" setup_cinocloud mountpoint fi @@ -285,10 +285,10 @@ install_grub() { efi_target=riscv64-efi # The real U-Boot chroot mountpoint apt-get install -qqy u-boot-microchip - loader="/dev/mapper${loop_device///dev/}p13" + loader="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/microchip_icicle/u-boot.payload of=$loader # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -330,10 +330,10 @@ install_grub() { chroot mountpoint apt-get install -qqy u-boot-nezha # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. # Package nezha-boot0 is not needed anymore. - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -359,7 +359,7 @@ install_grub() { efi_target=riscv64-efi # factory u-boot requires a p3 partition with /boot/uEnv.txt file - uenv_dev="/dev/mapper${loop_device///dev/}p3" + uenv_dev="${loop_device}p3" mkfs.ext4 "${uenv_dev}" uenv_mnt_dir=`mktemp -d uenvXXX` mount "${uenv_dev}" "${uenv_mnt_dir}" @@ -387,7 +387,7 @@ EOF umount "${uenv_mnt_dir}" rmdir "${uenv_mnt_dir}" # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, @@ -406,7 +406,7 @@ EOF chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal board, @@ -431,13 +431,13 @@ EOF fi chroot mountpoint apt-get install -qqy u-boot-sifive # FSBL, which gets U-Boot SPL - loader1="/dev/mapper${loop_device///dev/}p13" + loader1="${loop_device}p13" # The real U-Boot - loader2="/dev/mapper${loop_device///dev/}p14" + loader2="${loop_device}p14" dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2 # Provide end-user modifyable CIDATA - cidata_dev="/dev/mapper${loop_device///dev/}p12" + cidata_dev="${loop_device}p12" setup_cidata "${cidata_dev}" # Provide stock nocloud datasource # Allow interactive login on baremetal SiFive board, From 99f54dd2b6abaa56e1234301fdcca32a1d81c3cc Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 26 May 2023 13:51:21 -0700 Subject: [PATCH 78/78] releasing package livecd-rootfs version 2.843 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a9994476..83b02ec8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.843) UNRELEASED; urgency=medium +livecd-rootfs (2.843) mantic; urgency=medium * Unconditionally enable i386 in the chroot for Ubuntu Desktop; the new installer doesn't handle enabling this at install time, and late @@ -6,7 +6,7 @@ livecd-rootfs (2.843) UNRELEASED; urgency=medium * Restore losetup code, the necessary launchpad-buildd changes were being deployed just as this revert landed. - -- Steve Langasek Mon, 17 Apr 2023 16:51:13 -0700 + -- Steve Langasek Fri, 26 May 2023 13:51:18 -0700 livecd-rootfs (2.842) mantic; urgency=medium