From 625ace84835dc0283fa3fff924c9a04fab0a66d8 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 18 Dec 2018 15:18:00 +1300 Subject: [PATCH 1/9] Do not include curtin in the live-server installer.squashfs as the version of subiquity that includes it in the snap has now been released to stable. --- debian/changelog | 8 ++++++++ .../ubuntu-server/hooks/032-installer-squashfs.binary | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 52ec26e7..981e333f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.552) UNRELEASED; urgency=medium + + * Do not include curtin in the live-server installer.squashfs as the + version of subiquity that includes it in the snap has now been released to + stable. + + -- Michael Hudson-Doyle Tue, 18 Dec 2018 15:17:08 +1300 + livecd-rootfs (2.551) disco; urgency=medium * Do no install openssh-server in the base filsystem for the live server diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index d08b4cd9..518fc724 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -49,12 +49,10 @@ EOF # Prepare installer layer. -# Install any requirements for the installer, for things we don't want -# to see on the installed system -chroot $INSTALLER_ROOT apt-get -y install curtin lupin-casper +# Install casper for live session magic. +chroot $INSTALLER_ROOT apt-get -y install lupin-casper chroot $INSTALLER_ROOT apt-get clean - # For bug #1743643 "Install to dirty disk with swap fails" remove the # "helpful" casper script that mounts any swap partitions it finds. rm -f $INSTALLER_ROOT/usr/share/initramfs-tools/scripts/casper-bottom/*swap From 65397a6e6259f6c1ae4480712da45aaf56d8310f Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 19 Dec 2018 11:00:20 +1300 Subject: [PATCH 2/9] releasing package livecd-rootfs version 2.552 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 981e333f..2673f96c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.552) UNRELEASED; urgency=medium +livecd-rootfs (2.552) disco; urgency=medium * Do not include curtin in the live-server installer.squashfs as the version of subiquity that includes it in the snap has now been released to stable. - -- Michael Hudson-Doyle Tue, 18 Dec 2018 15:17:08 +1300 + -- Michael Hudson-Doyle Wed, 19 Dec 2018 11:00:08 +1300 livecd-rootfs (2.551) disco; urgency=medium From 082a2046e7242832719cea58676e668e4f2c3e0b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 19 Dec 2018 22:11:16 +0000 Subject: [PATCH 3/9] Add a LXD image to builds for the buildd subproject --- debian/changelog | 6 ++++ live-build/auto/build | 12 ++++++++ live-build/auto/config | 2 ++ live-build/make-lxd-metadata.py | 49 +++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100755 live-build/make-lxd-metadata.py diff --git a/debian/changelog b/debian/changelog index 2673f96c..b0fdca1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.553) UNRELEASED; urgency=medium + + * Add a LXD image to builds for the buildd subproject. + + -- Colin Watson Wed, 19 Dec 2018 22:10:19 +0000 + livecd-rootfs (2.552) disco; urgency=medium * Do not include curtin in the live-server installer.squashfs as the diff --git a/live-build/auto/build b/live-build/auto/build index 9648e78f..8e38516b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -531,6 +531,18 @@ elif [ "$SUBPROJECT" = buildd ]; then tar --transform='s,^binary,chroot-autobuild,' \ --sort=name --numeric-owner \ -czf "$PREFIX.rootfs.tar.gz" binary + + # Build a LXD image as well, which is preferable for some build types. + TMPDIR="$(mktemp -d)" + config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" >"$TMPDIR/metadata.yaml" + tar --numeric-owner -cf "$PREFIX.lxd.tar" -C "$TMPDIR" metadata.yaml + rm -rf "$TMPDIR" + # When using the combined metadata/rootfs form, the rootfs must be + # under rootfs/ rather than under chroot-autobuild/. + tar --transform='s,^binary,rootfs,' \ + --sort=name --numeric-owner \ + -rf "$PREFIX.lxd.tar" binary + gzip -9 "$PREFIX.lxd.tar" fi if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then diff --git a/live-build/auto/config b/live-build/auto/config index 496e8dea..2cafdb4e 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -707,6 +707,8 @@ case $SUBPROJECT in add_package install build-essential # Needed for LXD-based builds. add_package install init + + cp -af /usr/share/livecd-rootfs/live-build/make-lxd-metadata.py config/make-lxd-metadata ;; esac diff --git a/live-build/make-lxd-metadata.py b/live-build/make-lxd-metadata.py new file mode 100755 index 00000000..896f811a --- /dev/null +++ b/live-build/make-lxd-metadata.py @@ -0,0 +1,49 @@ +#! /usr/bin/python3 + +"""Make a metadata.yaml file for a LXD image.""" + +import argparse +import json +import sys +import time + + +# Map dpkg architecture names to LXD architecture names. +lxd_arches = { + "amd64": "x86_64", + "arm64": "aarch64", + "armhf": "armv7l", + "i386": "i686", + "powerpc": "ppc", + "ppc64el": "ppc64le", + "s390x": "s390x", + } + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("series", help="Ubuntu series name") + parser.add_argument("architecture", help="Ubuntu architecture name") + args = parser.parse_args() + + metadata = { + "architecture": lxd_arches[args.architecture], + "creation_date": int(time.time()), + "properties": { + "os": "Ubuntu", + "series": args.series, + "architecture": args.architecture, + "description": "Ubuntu buildd %s %s" % ( + args.series, args.architecture), + }, + } + + # Encoding this as JSON is good enough, and saves pulling in a YAML + # library dependency. + json.dump( + metadata, sys.stdout, sort_keys=True, indent=4, separators=(",", ": "), + ensure_ascii=False) + + +if __name__ == "__main__": + main() From 46942330d8a090545d743e2cbcd3ef811eb75369 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 20 Dec 2018 01:20:57 +0000 Subject: [PATCH 4/9] Move buildd image building to binary hooks --- debian/changelog | 1 + live-build/auto/build | 24 +------------------- live-build/buildd/hooks/50-buildd-tar.binary | 10 ++++++++ live-build/buildd/hooks/51-buildd-lxd.binary | 16 +++++++++++++ 4 files changed, 28 insertions(+), 23 deletions(-) create mode 100755 live-build/buildd/hooks/50-buildd-tar.binary create mode 100755 live-build/buildd/hooks/51-buildd-lxd.binary diff --git a/debian/changelog b/debian/changelog index b0fdca1e..c09755de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ livecd-rootfs (2.553) UNRELEASED; urgency=medium * Add a LXD image to builds for the buildd subproject. + * Move buildd image building to binary hooks. -- Colin Watson Wed, 19 Dec 2018 22:10:19 +0000 diff --git a/live-build/auto/build b/live-build/auto/build index 8e38516b..a980c26c 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -17,7 +17,7 @@ fi . config/functions -# Link output files somewhere BuildLiveCD will be able to find them. +# Link output files somewhere launchpad-buildd will be able to find them. PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then @@ -521,28 +521,6 @@ if [ -e "binary/$INITFS/filesystem.dir" ]; then chmod 644 "$PREFIX.rootfs.tar.gz" elif [ -e binary-tar.tar.gz ]; then cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz" -elif [ "$SUBPROJECT" = buildd ]; then - # A few things (launchpad-buildd, sbuild-launchpad-chroot) rely on - # the top-level directory being "chroot-autobuild", so we have to do - # this ourselves. - # gzip was chosen for fastest decompression speed: it decompresses - # buildd chroots about twice as fast as xz and about five times as - # fast as bzip2. - tar --transform='s,^binary,chroot-autobuild,' \ - --sort=name --numeric-owner \ - -czf "$PREFIX.rootfs.tar.gz" binary - - # Build a LXD image as well, which is preferable for some build types. - TMPDIR="$(mktemp -d)" - config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" >"$TMPDIR/metadata.yaml" - tar --numeric-owner -cf "$PREFIX.lxd.tar" -C "$TMPDIR" metadata.yaml - rm -rf "$TMPDIR" - # When using the combined metadata/rootfs form, the rootfs must be - # under rootfs/ rather than under chroot-autobuild/. - tar --transform='s,^binary,rootfs,' \ - --sort=name --numeric-owner \ - -rf "$PREFIX.lxd.tar" binary - gzip -9 "$PREFIX.lxd.tar" fi if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then diff --git a/live-build/buildd/hooks/50-buildd-tar.binary b/live-build/buildd/hooks/50-buildd-tar.binary new file mode 100755 index 00000000..8be7b618 --- /dev/null +++ b/live-build/buildd/hooks/50-buildd-tar.binary @@ -0,0 +1,10 @@ +#! /bin/sh +# A few things (launchpad-buildd, sbuild-launchpad-chroot) rely on the +# top-level directory being "chroot-autobuild", so we have to do this +# ourselves. +set -e + +# gzip was chosen for fastest decompression speed: it decompresses buildd +# chroots about twice as fast as xz and about five times as fast as bzip2. +tar --transform='s,^binary,chroot-autobuild,' --sort=name --numeric-owner \ + -czf "livecd.$PROJECT.rootfs.tar.gz" binary diff --git a/live-build/buildd/hooks/51-buildd-lxd.binary b/live-build/buildd/hooks/51-buildd-lxd.binary new file mode 100755 index 00000000..b4b782d9 --- /dev/null +++ b/live-build/buildd/hooks/51-buildd-lxd.binary @@ -0,0 +1,16 @@ +#! /bin/sh +# Some build types prefer a LXD image over a traditional chroot tarball. +set -e + +. config/bootstrap + +TMPDIR="$(mktemp -d)" +config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" \ + >"$TMPDIR/metadata.yaml" +tar --numeric-owner -cf "livecd.$PROJECT.lxd.tar" -C "$TMPDIR" metadata.yaml +rm -rf "$TMPDIR" +# When using the combined metadata/rootfs form, the rootfs must be under +# rootfs/ rather than under chroot-autobuild/. +tar --transform='s,^binary,rootfs,' --sort=name --numeric-owner \ + -rf "livecd.$PROJECT.lxd.tar" binary +gzip -9 "livecd.$PROJECT.lxd.tar" From 75fa8802ec623e3e8a8f52a113c5344dd3742ee2 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 7 Jan 2019 21:24:38 +0000 Subject: [PATCH 5/9] releasing package livecd-rootfs version 2.553 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c09755de..638b7e38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -livecd-rootfs (2.553) UNRELEASED; urgency=medium +livecd-rootfs (2.553) disco; urgency=medium * Add a LXD image to builds for the buildd subproject. * Move buildd image building to binary hooks. - -- Colin Watson Wed, 19 Dec 2018 22:10:19 +0000 + -- Colin Watson Mon, 07 Jan 2019 21:23:31 +0000 livecd-rootfs (2.552) disco; urgency=medium From e60bcbaecdf9669a921eea1ae45ea475cd7a31bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 9 Jan 2019 10:47:24 +0100 Subject: [PATCH 6/9] Add proper IMAGAFORMAT for raspi3 classic builds, output the images with the expected naming. --- debian/changelog | 8 ++++++++ live-build/auto/build | 7 +++++-- live-build/auto/config | 7 ++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 638b7e38..ed16447f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.554) UNRELEASED; urgency=medium + + * Default to IMAGEFORMAT=ubuntu-image for raspi3 ubuntu-cpc builds. + * Rename the resulting raspi3 image file to *.disk1.img.xz to be compatible + with how raspi2 images are provided. + + -- Łukasz 'sil2100' Zemczak Wed, 09 Jan 2019 10:34:59 +0100 + livecd-rootfs (2.553) disco; urgency=medium * Add a LXD image to builds for the buildd subproject. diff --git a/live-build/auto/build b/live-build/auto/build index a980c26c..970d66af 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -43,8 +43,11 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # XXX: currently we only have one image generated, but really # we should be supporting more than one for models that # define those. - mv output/*.img "$PREFIX".img - xz -0 -T4 "$PREFIX".img + # Also, we use the .disk1.img suffix so that the resulting + # image path is compatible with how raspi2 images are consumed + # by cdimage. + mv output/*.img "$PREFIX".disk1.img + xz -0 -T4 "$PREFIX".disk1.img mv output/filesystem.manifest "$PREFIX".manifest fi diff --git a/live-build/auto/config b/live-build/auto/config index 2cafdb4e..c9ec49f1 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -109,7 +109,12 @@ add_binary_hook () if [ -z "${IMAGEFORMAT:-}" ]; then case $PROJECT:${SUBPROJECT:-} in ubuntu-cpc:*) - IMAGEFORMAT=ext4 + if [ "$SUBARCH" = "raspi3" ]; then + # For now only raspi3, but others are soon to follow + IMAGEFORMAT=ubuntu-image + else + IMAGEFORMAT=ext4 + fi ;; ubuntu-server:live) IMAGEFORMAT=plain From 7a2a551ca09ef07ec936bd0261534cd41346d7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 9 Jan 2019 10:48:11 +0100 Subject: [PATCH 7/9] releasing package livecd-rootfs version 2.554 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ed16447f..221e6b5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.554) UNRELEASED; urgency=medium +livecd-rootfs (2.554) disco; urgency=medium * Default to IMAGEFORMAT=ubuntu-image for raspi3 ubuntu-cpc builds. * Rename the resulting raspi3 image file to *.disk1.img.xz to be compatible From abec4f4c1d48ffdfd8d9aa253fc8936ba59b411e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 10 Jan 2019 22:58:07 +0100 Subject: [PATCH 8/9] Link to the proper name instead. --- debian/changelog | 8 ++++++++ live-build/auto/build | 9 ++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 221e6b5d..b29f343f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.555) UNRELEASED; urgency=medium + + * Apparently the last raspi3 image rename was not what cdimage expected. + Link to the expected name instead, so that we can change it to something + more sensible once raspi2 is migrated to ubuntu-image. + + -- Łukasz 'sil2100' Zemczak Thu, 10 Jan 2019 22:54:23 +0100 + livecd-rootfs (2.554) disco; urgency=medium * Default to IMAGEFORMAT=ubuntu-image for raspi3 ubuntu-cpc builds. diff --git a/live-build/auto/build b/live-build/auto/build index 970d66af..70287baa 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -43,11 +43,10 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # XXX: currently we only have one image generated, but really # we should be supporting more than one for models that # define those. - # Also, we use the .disk1.img suffix so that the resulting - # image path is compatible with how raspi2 images are consumed - # by cdimage. - mv output/*.img "$PREFIX".disk1.img - xz -0 -T4 "$PREFIX".disk1.img + mv output/*.img "$PREFIX".img + xz -0 -T4 "$PREFIX".img + # Also link the output image to a filename that cdimage expects + ln "$PREFIX".img.xz livecd.ubuntu-cpc.disk1.img.xz mv output/filesystem.manifest "$PREFIX".manifest fi From 480eab7e32db957223056726f408f111cb8774f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 10 Jan 2019 22:58:28 +0100 Subject: [PATCH 9/9] releasing package livecd-rootfs version 2.555 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b29f343f..8accb849 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.555) UNRELEASED; urgency=medium +livecd-rootfs (2.555) disco; urgency=medium * Apparently the last raspi3 image rename was not what cdimage expected. Link to the expected name instead, so that we can change it to something