From 14f181960668d9ab5a6d5d61d8eec70f7b15d748 Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Thu, 7 Nov 2019 16:47:06 +0000 Subject: [PATCH] Imported 2.525.33 No reason for CPC update specified. --- debian/changelog | 18 +++++++++++++ live-build/auto/build | 2 +- live-build/auto/config | 21 ++++++++++++---- .../hooks.d/chroot/999-cpc-fixes.chroot | 25 ++++++++----------- .../999-ubuntu-image-customization.chroot | 23 +++++++++++++++++ 5 files changed, 68 insertions(+), 21 deletions(-) create mode 100755 live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot diff --git a/debian/changelog b/debian/changelog index a96e32d1..5ed35523 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +livecd-rootfs (2.525.33) bionic; urgency=medium + + * Add support for the 'kassel' subflavor of UC18 images. (LP: #1850674) + + -- Łukasz 'sil2100' Zemczak Wed, 30 Oct 2019 18:09:02 +0100 + +livecd-rootfs (2.525.32) bionic; urgency=medium + + * Fix a terrible typo in auto/build that causes all core18 builds to fail on + this series (LP: #1849343). + * Backport 999-ubuntu-image-customization.chroot to have a common place for + our cloud-init datasource. Add some modifications on top to make sure the + legacy raspi2 configuration stays the same (LP: #1849472). + * Backport enabling of adding extra snaps to ubuntu-core images via the + EXTRA_SNAPS environment (LP: #1849491). + + -- Łukasz 'sil2100' Zemczak Tue, 22 Oct 2019 17:34:31 +0200 + livecd-rootfs (2.525.31) bionic; urgency=medium * magic-proxy: dump proxy log to stdout on failure (LP: #1847300) diff --git a/live-build/auto/build b/live-build/auto/build index d57eaef3..ae6d2806 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -47,7 +47,7 @@ PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # Use ubuntu-image instead of live-build - if [ "$PROJECT" = "ubuntu-core"]; then + if [ "$PROJECT" = "ubuntu-core" ]; then CHANNEL="${CHANNEL:-edge}" env SNAPPY_STORE_NO_CDN=1 \ ubuntu-image snap -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \ diff --git a/live-build/auto/config b/live-build/auto/config index 0bd786f8..d536022a 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -174,6 +174,7 @@ case $IMAGEFORMAT in ;; ubuntu-image) + UBUNTU_IMAGE_ARGS="" case "$ARCH+${SUBARCH:-}" in amd64+*) MODEL=pc-amd64 ;; @@ -200,11 +201,20 @@ case $IMAGEFORMAT in case $MODEL in pc-amd64|pc-i386) - UBUNTU_IMAGE_ARGS="--image-size 3700M" ;; - *) - UBUNTU_IMAGE_ARGS="" ;; + [ -z "${SUBARCH:-}" ] \ + && UBUNTU_IMAGE_ARGS="--image-size 3700M" + ;; esac - + + case "$ARCH+${SUBARCH:-}" in + amd64+kassel) + EXTRA_SNAPS="core bluez alsa-utils" + ;; + *) ;; + esac + for snap in $EXTRA_SNAPS; do + UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --extra-snaps $snap" + done echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common # Store model assertion in top dir to get it picked up later as a build artifact @@ -215,7 +225,6 @@ case $IMAGEFORMAT in else # classic images - UBUNTU_IMAGE_ARGS="" UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}" UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}" @@ -930,6 +939,8 @@ echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary echo "BUILDSTAMP=\"$NOW\"" >> config/binary echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary +echo "IMAGEFORMAT=\"$IMAGEFORMAT\"" >> config/chroot +echo "SUBARCH=\"$SUBARCH\"" >> config/chroot case $ARCH+$SUBARCH in armhf+raspi2|armhf+raspi3|arm64+raspi3) diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot index 16e1be5a..ed68736d 100755 --- a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot @@ -142,22 +142,17 @@ fi #### END COMMON ARCH FUNCTIONS -case $arch in - # ARM images are special - armhf|arm64) - # Dirty hack because SUBARCH doesn't exist when running chroot hooks, - # and we don't want raspi2 images to depend on a cloud data source: - if _xchroot "${rootd}" dpkg -l linux-image-raspi2 2>/dev/null | grep -q '^.i'; then - fake_cloud_init - fi +case $arch+${SUBARCH:-} in + # raspi2 images are special + armhf+raspi2) + fake_cloud_init + echo "Image architecture is ARM. Existing vmbuilder-fixups" + exit 0 + ;; - echo "Image architecture is ARM. Existing vmbuilder-fixups" - - exit 0 - ;; - powerpc|ppc64el|s390x) - exit 0 - ;; + armhf+*|arm64+*|powerpc+*|ppc64el+*|s390x+*) + exit 0 + ;; esac psuedo_grub_probe() { diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot new file mode 100755 index 00000000..491bd863 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot @@ -0,0 +1,23 @@ +#!/bin/bash -ex + +. /root/config/chroot + +# Specific ubuntu-image chroot configuration goes here. +# Currently the none IMAGEFORMAT is equivalent to building a rootfs for an image +# for a physical device, not a cloud instance. For such images we want some +# special cloud-init configuration that should not be happening for cloud +# cases. This check should be changed to a per-MODEL/per-SUBARCH check once +# we support building cloud images via ubuntu-image. +if [ "$IMAGEFORMAT" == "none" ]; then + # If the cloud does not provide a meta-data service this should be run + # This will setup a nocloud datasource on the boot partition. + # This is the default behavior for our ubuntu-image built preinstalled + # images. + cat << EOF > /etc/cloud/cloud.cfg.d/99-fake_cloud.cfg +# configure cloud-init for NoCloud +datasource_list: [ NoCloud, None ] +datasource: + NoCloud: + fs_label: system-boot +EOF +fi