From b3cf7b90135e9827f7d3849089e064cbfb7053a8 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 8 Nov 2017 12:11:40 -0800 Subject: [PATCH 1/6] The target for x86 ubuntu-core images is VMs, so create them with a buffer of free space in order to work if booted in place. --- debian/changelog | 7 +++++++ live-build/auto/build | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c92eb540..b738b3f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.481) UNRELEASED; urgency=medium + + * The target for x86 ubuntu-core images is VMs, so create them with + a buffer of free space in order to work if booted in place. + + -- Steve Langasek Wed, 08 Nov 2017 12:01:25 -0800 + livecd-rootfs (2.480) bionic; urgency=medium [ Gary Wang ] diff --git a/live-build/auto/build b/live-build/auto/build index e2d9359e..78936050 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -17,8 +17,20 @@ fi if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # Use ubuntu-image instead of live-build + + # this should actually be per-model instead of per-architecture, + # but for the moment all our x86 models follow this rule. + case $ARCH in + amd64|i386) + extra_args="--image-size 3700M" + ;; + *) + extra_args="" + ;; + esac + env SNAPPY_STORE_NO_CDN=1 \ - ubuntu-image -c edge \ + ubuntu-image -c edge $extra_args \ -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion xz -0 -T4 livecd."$PROJECT".img exit 0 From e96fa8b87802d819b10216c1d42bfffd7ae469d7 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 8 Nov 2017 12:22:05 -0800 Subject: [PATCH 2/6] ubuntu-image now produces a manifest file listing the snap revisions used; publish this so that it's picked up by launchpad-buildd. --- debian/changelog | 2 ++ live-build/auto/build | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index b738b3f7..2d0e04f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ livecd-rootfs (2.481) UNRELEASED; urgency=medium * The target for x86 ubuntu-core images is VMs, so create them with a buffer of free space in order to work if booted in place. + * ubuntu-image now produces a manifest file listing the snap revisions + used; publish this so that it's picked up by launchpad-buildd. -- Steve Langasek Wed, 08 Nov 2017 12:01:25 -0800 diff --git a/live-build/auto/build b/live-build/auto/build index 78936050..5a6d6c5b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -33,6 +33,7 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then ubuntu-image -c edge $extra_args \ -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion xz -0 -T4 livecd."$PROJECT".img + mv seed.manifest livecd."$PROJECT".manifest exit 0 fi From 696ae6e1eb7b90c5e1f208eea6c83ca2e4b93caf Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 8 Nov 2017 12:35:38 -0800 Subject: [PATCH 3/6] Name the manifest the way ubuntu-cdimage expects it for subarchs --- live-build/auto/build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index 5a6d6c5b..141d8947 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -15,6 +15,9 @@ if [ -z "${PROJECT:-}" ]; then exit 1 fi +# Link output files somewhere BuildLiveCD will be able to find them. +PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" + if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # Use ubuntu-image instead of live-build @@ -33,7 +36,7 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then ubuntu-image -c edge $extra_args \ -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion xz -0 -T4 livecd."$PROJECT".img - mv seed.manifest livecd."$PROJECT".manifest + mv seed.manifest "PREFIX".manifest exit 0 fi @@ -456,9 +459,6 @@ else exit 1 fi -# Link output files somewhere BuildLiveCD will be able to find them. -PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" - case $LB_INITRAMFS in casper) INITFS="casper" From 02246dbf8403af227d6447305c9dbb9b2e51d5ef Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 9 Nov 2017 15:55:45 -0800 Subject: [PATCH 4/6] move configuration bits into live-build/auto/config from live-build/auto/build, per Adam --- live-build/auto/build | 13 +------------ live-build/auto/config | 8 ++++++++ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index 141d8947..467e1b60 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -21,19 +21,8 @@ PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # Use ubuntu-image instead of live-build - # this should actually be per-model instead of per-architecture, - # but for the moment all our x86 models follow this rule. - case $ARCH in - amd64|i386) - extra_args="--image-size 3700M" - ;; - *) - extra_args="" - ;; - esac - env SNAPPY_STORE_NO_CDN=1 \ - ubuntu-image -c edge $extra_args \ + ubuntu-image -c edge $UBUNTU_IMAGE_ARGS \ -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion xz -0 -T4 livecd."$PROJECT".img mv seed.manifest "PREFIX".manifest diff --git a/live-build/auto/config b/live-build/auto/config index 092f7d07..4c3c5b14 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -171,7 +171,15 @@ case $IMAGEFORMAT in exit 1 ;; esac + case $MODEL in + pc-amd64|pc-i386) + UBUNTU_IMAGE_ARGS="--image-size 3700M" ;; + *) + UBUNTU_IMAGE_ARGS="" ;; + esac + 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 env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion echo "Configured ubuntu-image for the following model assertion:" From 7c07f8a65b281ca906d32f08accd9dc9f3968ad6 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 9 Nov 2017 16:13:08 -0800 Subject: [PATCH 5/6] Change ubuntu-core image builds to use the standard "$PREFIX" naming for artifacts instead of being gratuitously different; requires a matching change to ubuntu-cdimage. --- debian/changelog | 3 +++ live-build/auto/build | 4 ++-- live-build/auto/config | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2d0e04f0..4987b59a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ livecd-rootfs (2.481) UNRELEASED; urgency=medium a buffer of free space in order to work if booted in place. * ubuntu-image now produces a manifest file listing the snap revisions used; publish this so that it's picked up by launchpad-buildd. + * Change ubuntu-core image builds to use the standard "$PREFIX" naming for + artifacts instead of being gratuitously different; requires a matching + change to ubuntu-cdimage. -- Steve Langasek Wed, 08 Nov 2017 12:01:25 -0800 diff --git a/live-build/auto/build b/live-build/auto/build index 467e1b60..c19d31e3 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -23,8 +23,8 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then env SNAPPY_STORE_NO_CDN=1 \ ubuntu-image -c edge $UBUNTU_IMAGE_ARGS \ - -o livecd."$PROJECT".img livecd."$PROJECT".model-assertion - xz -0 -T4 livecd."$PROJECT".img + -o "$PREFIX".img "$PREFIX".model-assertion + xz -0 -T4 "$PREFIX".img mv seed.manifest "PREFIX".manifest exit 0 fi diff --git a/live-build/auto/config b/live-build/auto/config index 4c3c5b14..71ce31c0 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -90,6 +90,7 @@ LIVE_TASK= PREINSTALLED=false PREINSTALL_POOL= PREINSTALL_POOL_SEEDS= +PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" CHROOT_HOOKS= BINARY_HOOKS= @@ -181,7 +182,7 @@ case $IMAGEFORMAT in 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 - env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > livecd."$PROJECT".model-assertion + env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion echo "Configured ubuntu-image for the following model assertion:" cat livecd."$PROJECT".model-assertion echo "----------------------------------------------------------" From ea2840ddfcbb990292b62de767f780042560f744 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 9 Nov 2017 16:13:25 -0800 Subject: [PATCH 6/6] fix wrong use of PREFIX literal --- live-build/auto/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/auto/build b/live-build/auto/build index c19d31e3..7c263336 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -25,7 +25,7 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then ubuntu-image -c edge $UBUNTU_IMAGE_ARGS \ -o "$PREFIX".img "$PREFIX".model-assertion xz -0 -T4 "$PREFIX".img - mv seed.manifest "PREFIX".manifest + mv seed.manifest "$PREFIX".manifest exit 0 fi