From cb221772870057fe4cd3cb427b9a373fd105a19e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Apr 2018 16:07:44 +0100 Subject: [PATCH 01/43] Add a buildd subproject. --- debian/changelog | 6 ++ live-build/auto/build | 9 +++ live-build/auto/config | 56 +++++++++++++++++++ live-build/buildd/hooks/apt.chroot | 14 +++++ live-build/buildd/hooks/fstab.chroot | 5 ++ live-build/buildd/hooks/kernel-img.chroot | 5 ++ .../buildd/hooks/pkgbinarymangler.chroot | 10 ++++ live-build/buildd/hooks/policy-rc.d.chroot | 20 +++++++ live-build/buildd/hooks/user.chroot | 9 +++ .../buildd/includes.chroot/etc/hostname | 1 + live-build/buildd/includes.chroot/etc/hosts | 9 +++ live-build/buildd/preseed/debconf.preseed | 2 + live-build/buildd/preseed/man-db.preseed | 3 + live-build/buildd/preseed/sun-java6.preseed | 3 + 14 files changed, 152 insertions(+) create mode 100644 live-build/buildd/hooks/apt.chroot create mode 100644 live-build/buildd/hooks/fstab.chroot create mode 100644 live-build/buildd/hooks/kernel-img.chroot create mode 100644 live-build/buildd/hooks/pkgbinarymangler.chroot create mode 100644 live-build/buildd/hooks/policy-rc.d.chroot create mode 100644 live-build/buildd/hooks/user.chroot create mode 100644 live-build/buildd/includes.chroot/etc/hostname create mode 100644 live-build/buildd/includes.chroot/etc/hosts create mode 100644 live-build/buildd/preseed/debconf.preseed create mode 100644 live-build/buildd/preseed/man-db.preseed create mode 100644 live-build/buildd/preseed/sun-java6.preseed diff --git a/debian/changelog b/debian/changelog index 817e0429..523937c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.525+lp1) UNRELEASED; urgency=medium + + * Add a buildd subproject. + + -- Colin Watson Thu, 26 Apr 2018 14:22:27 +0100 + livecd-rootfs (2.525) bionic; urgency=medium * Don't fail to build CPC images if /lib/modules already exists in the diff --git a/live-build/auto/build b/live-build/auto/build index 01dcc182..735dd2e9 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -460,6 +460,15 @@ 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,' \ + -czf "$PREFIX.rootfs.tar.gz" binary fi if [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-core:system-image" ]; then diff --git a/live-build/auto/config b/live-build/auto/config index e07aeb85..4fd845ff 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -668,6 +668,56 @@ case $PROJECT in ;; esac +case $SUBPROJECT in + buildd) + OPTS="${OPTS:+$OPTS }--archive-areas main" + COMPONENTS='main restricted universe multiverse' + KERNEL_FLAVOURS=none + OPTS="${OPTS:+$OPTS }--apt-recommends false" + OPTS="${OPTS:+$OPTS }--apt-secure false" + OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" + INITRAMFS_COMPRESSION=none + OPTS="${OPTS:+$OPTS }--mirror-binary ${MIRROR}" + # XXX cjwatson 2018-04-27: We need to work out how to make + # this conditional so that we can do things like building + # buildd chroots with -updates. This probably involves + # either extending the PROPOSED hack or fixing the strange + # way that SUITE is in fact a series; in either case it's + # likely to involve work both here and in launchpad-buildd. + OPTS="${OPTS:+$OPTS }--security false --volatile false" + OPTS="${OPTS:+$OPTS }--binary-images none" + + add_package install adduser + add_package install policyrcd-script-zg2 + add_package install pkgbinarymangler + add_package install ca-certificates + add_package install gpg + add_package install gpg-agent + case $SUITE in + precise|trusty|xenial) + # no longer needed in >= artful + add_package install pkg-create-dbgsym + # no longer needed in >= bionic + add_package install apt-transport-https + # no longer needed in >= CC + add_package install tzdata + ;; + artful) + # no longer needed in >= bionic + add_package install apt-transport-https + # no longer needed in >= CC + add_package install tzdata + ;; + bionic) + # no longer needed in >= CC + add_package install tzdata + ;; + esac + add_package install fakeroot + add_package install build-essential + ;; +esac + # we'll expand the base seed given here according to the STRUCTURE file, and # then look in all of the seeds found to see which snaps are seeded case $PROJECT:${SUBPROJECT:-} in @@ -977,6 +1027,12 @@ EOF ;; esac +case $SUBPROJECT in + buildd) + cp -af /usr/share/livecd-rootfs/live-build/buildd/* config/ + ;; +esac + if [ "$EXTRA_PPAS" ]; then rm -f config/archives/extra-ppas.list.chroot \ config/archives/extra-ppas.pref.chroot \ diff --git a/live-build/buildd/hooks/apt.chroot b/live-build/buildd/hooks/apt.chroot new file mode 100644 index 00000000..6f0d828d --- /dev/null +++ b/live-build/buildd/hooks/apt.chroot @@ -0,0 +1,14 @@ +#! /bin/sh +set -e + +# Configure APT. +cat >/etc/apt/apt.conf.d/99buildd </etc/apt/preferences.d/backports </etc/fstab diff --git a/live-build/buildd/hooks/kernel-img.chroot b/live-build/buildd/hooks/kernel-img.chroot new file mode 100644 index 00000000..3517b443 --- /dev/null +++ b/live-build/buildd/hooks/kernel-img.chroot @@ -0,0 +1,5 @@ +#! /bin/sh +set -e + +# At one point, kernel builds needed this. +echo do_initrd = Yes >>/etc/kernel-img.conf diff --git a/live-build/buildd/hooks/pkgbinarymangler.chroot b/live-build/buildd/hooks/pkgbinarymangler.chroot new file mode 100644 index 00000000..ab901957 --- /dev/null +++ b/live-build/buildd/hooks/pkgbinarymangler.chroot @@ -0,0 +1,10 @@ +#! /bin/sh +set -e + +# Configure pkgbinarymangler. +sed -i /^enable/s/false/true/ \ + /etc/pkgbinarymangler/maintainermangler.conf \ + /etc/pkgbinarymangler/striptranslations.conf || true +sed -i /^invalid_current/s/ignore/fail/ \ + /etc/pkgbinarymangler/maintainermangler.conf \ + /etc/pkgbinarymangler/striptranslations.conf || true diff --git a/live-build/buildd/hooks/policy-rc.d.chroot b/live-build/buildd/hooks/policy-rc.d.chroot new file mode 100644 index 00000000..4f8980ec --- /dev/null +++ b/live-build/buildd/hooks/policy-rc.d.chroot @@ -0,0 +1,20 @@ +#! /bin/sh +set -e + +# Configure policy-rc.d. +cat >/usr/local/sbin/policy-rc.d <<'EOF' +#!/bin/sh + +# policy-rc.d script for chroots. +# Copyright (c) 2007 Peter Palfrader +# License: MIT, if you want one. + +while true; do + case "$1" in + -*) shift ;; + makedev) exit 0;; + *) echo "Not running services in chroot."; exit 101 ;; + esac +done +EOF +chmod 755 /usr/local/sbin/policy-rc.d diff --git a/live-build/buildd/hooks/user.chroot b/live-build/buildd/hooks/user.chroot new file mode 100644 index 00000000..86000bf2 --- /dev/null +++ b/live-build/buildd/hooks/user.chroot @@ -0,0 +1,9 @@ +#! /bin/sh +set -e + +# Create the buildd user and group. +addgroup --gid 2501 buildd +adduser --system --disabled-password --gecos 'Build Daemon user' \ + --ingroup buildd --uid 2001 --shell /bin/bash buildd +mkdir -p /build/buildd +chown buildd:buildd /build/buildd diff --git a/live-build/buildd/includes.chroot/etc/hostname b/live-build/buildd/includes.chroot/etc/hostname new file mode 100644 index 00000000..e420fe4d --- /dev/null +++ b/live-build/buildd/includes.chroot/etc/hostname @@ -0,0 +1 @@ +INVALID diff --git a/live-build/buildd/includes.chroot/etc/hosts b/live-build/buildd/includes.chroot/etc/hosts new file mode 100644 index 00000000..7a0cb5d4 --- /dev/null +++ b/live-build/buildd/includes.chroot/etc/hosts @@ -0,0 +1,9 @@ +127.0.0.1 localhost.localdomain localhost + +# The following lines are desirable for IPv6 capable hosts +::1 ip6-localhost ip6-loopback +fe00::0 ip6-localnet +ff00::0 ip6-mcastprefix +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +ff02::3 ip6-allhosts diff --git a/live-build/buildd/preseed/debconf.preseed b/live-build/buildd/preseed/debconf.preseed new file mode 100644 index 00000000..4e8c607b --- /dev/null +++ b/live-build/buildd/preseed/debconf.preseed @@ -0,0 +1,2 @@ +# We never want debconf interaction. +debconf debconf/frontend select Noninteractive diff --git a/live-build/buildd/preseed/man-db.preseed b/live-build/buildd/preseed/man-db.preseed new file mode 100644 index 00000000..7281ae4d --- /dev/null +++ b/live-build/buildd/preseed/man-db.preseed @@ -0,0 +1,3 @@ +# Avoid unnecessary manual page database builds (see +# https://bugs.debian.org/554914). +man-db man-db/auto-update boolean false diff --git a/live-build/buildd/preseed/sun-java6.preseed b/live-build/buildd/preseed/sun-java6.preseed new file mode 100644 index 00000000..53011956 --- /dev/null +++ b/live-build/buildd/preseed/sun-java6.preseed @@ -0,0 +1,3 @@ +# Pre-accept interactive EULA prompts. +sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true +sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true From 0bd2526ac511177bf483748d2d9fe3d691de0afa Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 29 Apr 2018 21:41:58 +0100 Subject: [PATCH 02/43] Use a more generic version number. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 523937c4..0c88811d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.525+lp1) UNRELEASED; urgency=medium +livecd-rootfs (2.526) UNRELEASED; urgency=medium * Add a buildd subproject. From 416093beece6a60e24d65b5bf4e984c812ab7a9a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 29 Apr 2018 21:42:41 +0100 Subject: [PATCH 03/43] Use a public-facing mirror URL in the final buildd /etc/apt/sources.list. --- live-build/auto/config | 2 +- live-build/buildd/hooks/mirror.binary | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 live-build/buildd/hooks/mirror.binary diff --git a/live-build/auto/config b/live-build/auto/config index 4fd845ff..d6fbf531 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -677,7 +677,7 @@ case $SUBPROJECT in OPTS="${OPTS:+$OPTS }--apt-secure false" OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" INITRAMFS_COMPRESSION=none - OPTS="${OPTS:+$OPTS }--mirror-binary ${MIRROR}" + OPTS="${OPTS:+$OPTS }--parent-mirror-binary ${MIRROR}" # XXX cjwatson 2018-04-27: We need to work out how to make # this conditional so that we can do things like building # buildd chroots with -updates. This probably involves diff --git a/live-build/buildd/hooks/mirror.binary b/live-build/buildd/hooks/mirror.binary new file mode 100755 index 00000000..5aea13d0 --- /dev/null +++ b/live-build/buildd/hooks/mirror.binary @@ -0,0 +1,12 @@ +#! /bin/sh +set -e + +. config/bootstrap + +# Use a public-facing mirror URL, for the benefit of +# sbuild-launchpad-chroot. We deliberately do this only after live-build +# has run "apt-get update" for the last time, in order that +# /var/lib/apt/lists/ has suitable cached Packages files; this speeds up +# builds on buildds. +sed "s,${LB_PARENT_MIRROR_BINARY},${LB_MIRROR_BINARY},g" \ + binary/etc/apt/sources.list From 07487675b6da199cc5f069e3d717553f27dd1355 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 29 Apr 2018 21:43:46 +0100 Subject: [PATCH 04/43] Sort buildd tarballs by name and use numeric user and group IDs. --- live-build/auto/build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/live-build/auto/build b/live-build/auto/build index 735dd2e9..405802c5 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -467,7 +467,8 @@ elif [ "$SUBPROJECT" = buildd ]; then # 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,' \ + tar --transform='s,^binary,chroot-autobuild,' \ + --sort=name --numeric-owner \ -czf "$PREFIX.rootfs.tar.gz" binary fi From 9e99d9f1cf16ce8d237ef5e7a9f00f455c73d2de Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 29 Apr 2018 22:54:24 +0100 Subject: [PATCH 05/43] Fix sedding of /etc/apt/sources.list. --- live-build/buildd/hooks/mirror.binary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/buildd/hooks/mirror.binary b/live-build/buildd/hooks/mirror.binary index 5aea13d0..7f3cdba4 100755 --- a/live-build/buildd/hooks/mirror.binary +++ b/live-build/buildd/hooks/mirror.binary @@ -8,5 +8,5 @@ set -e # has run "apt-get update" for the last time, in order that # /var/lib/apt/lists/ has suitable cached Packages files; this speeds up # builds on buildds. -sed "s,${LB_PARENT_MIRROR_BINARY},${LB_MIRROR_BINARY},g" \ +sed -i "s,${LB_PARENT_MIRROR_BINARY},${LB_MIRROR_BINARY},g" \ binary/etc/apt/sources.list From b77de06bfda78cc689fef7644813df9a715ed266 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 30 Apr 2018 09:54:28 +0100 Subject: [PATCH 06/43] Remove some unnecessary buildd configuration. --- live-build/auto/config | 4 ---- 1 file changed, 4 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index d6fbf531..a0c99db7 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -672,11 +672,8 @@ case $SUBPROJECT in buildd) OPTS="${OPTS:+$OPTS }--archive-areas main" COMPONENTS='main restricted universe multiverse' - KERNEL_FLAVOURS=none OPTS="${OPTS:+$OPTS }--apt-recommends false" OPTS="${OPTS:+$OPTS }--apt-secure false" - OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" - INITRAMFS_COMPRESSION=none OPTS="${OPTS:+$OPTS }--parent-mirror-binary ${MIRROR}" # XXX cjwatson 2018-04-27: We need to work out how to make # this conditional so that we can do things like building @@ -685,7 +682,6 @@ case $SUBPROJECT in # way that SUITE is in fact a series; in either case it's # likely to involve work both here and in launchpad-buildd. OPTS="${OPTS:+$OPTS }--security false --volatile false" - OPTS="${OPTS:+$OPTS }--binary-images none" add_package install adduser add_package install policyrcd-script-zg2 From 2a9efb44a6fcd52af14fc41da3cdb5bee02ea1e4 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 30 Apr 2018 09:57:12 +0100 Subject: [PATCH 07/43] Move some buildd hooks to includes.chroot. --- live-build/buildd/hooks/apt.chroot | 14 -------------- live-build/buildd/hooks/fstab.chroot | 5 ----- .../includes.chroot/etc/apt/apt.conf.d/99buildd | 2 ++ .../etc/apt/preferences.d/backports | 3 +++ live-build/buildd/includes.chroot/etc/fstab | 1 + .../usr/local/sbin/policy-rc.d} | 7 ------- 6 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 live-build/buildd/hooks/apt.chroot delete mode 100644 live-build/buildd/hooks/fstab.chroot create mode 100644 live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd create mode 100644 live-build/buildd/includes.chroot/etc/apt/preferences.d/backports create mode 100644 live-build/buildd/includes.chroot/etc/fstab rename live-build/buildd/{hooks/policy-rc.d.chroot => includes.chroot/usr/local/sbin/policy-rc.d} (70%) mode change 100644 => 100755 diff --git a/live-build/buildd/hooks/apt.chroot b/live-build/buildd/hooks/apt.chroot deleted file mode 100644 index 6f0d828d..00000000 --- a/live-build/buildd/hooks/apt.chroot +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh -set -e - -# Configure APT. -cat >/etc/apt/apt.conf.d/99buildd </etc/apt/preferences.d/backports </etc/fstab diff --git a/live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd b/live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd new file mode 100644 index 00000000..0fd77978 --- /dev/null +++ b/live-build/buildd/includes.chroot/etc/apt/apt.conf.d/99buildd @@ -0,0 +1,2 @@ +DPkg::Options {"--force-unsafe-io";}; +DPkg::Use-Pty "false"; diff --git a/live-build/buildd/includes.chroot/etc/apt/preferences.d/backports b/live-build/buildd/includes.chroot/etc/apt/preferences.d/backports new file mode 100644 index 00000000..605907ec --- /dev/null +++ b/live-build/buildd/includes.chroot/etc/apt/preferences.d/backports @@ -0,0 +1,3 @@ +Package: * +Pin: release a=*-backports +Pin-Priority: 500 diff --git a/live-build/buildd/includes.chroot/etc/fstab b/live-build/buildd/includes.chroot/etc/fstab new file mode 100644 index 00000000..b67dd265 --- /dev/null +++ b/live-build/buildd/includes.chroot/etc/fstab @@ -0,0 +1 @@ +/dev/root / ext2 noatime,errors=remount-ro 0 1 diff --git a/live-build/buildd/hooks/policy-rc.d.chroot b/live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d old mode 100644 new mode 100755 similarity index 70% rename from live-build/buildd/hooks/policy-rc.d.chroot rename to live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d index 4f8980ec..cf2290b6 --- a/live-build/buildd/hooks/policy-rc.d.chroot +++ b/live-build/buildd/includes.chroot/usr/local/sbin/policy-rc.d @@ -1,8 +1,3 @@ -#! /bin/sh -set -e - -# Configure policy-rc.d. -cat >/usr/local/sbin/policy-rc.d <<'EOF' #!/bin/sh # policy-rc.d script for chroots. @@ -16,5 +11,3 @@ while true; do *) echo "Not running services in chroot."; exit 101 ;; esac done -EOF -chmod 755 /usr/local/sbin/policy-rc.d From 9bd386caa1d132de81aedf4c0693e32dcc05af89 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 30 Apr 2018 09:57:54 +0100 Subject: [PATCH 08/43] Explicitly order remaining buildd hooks. --- .../buildd/hooks/{kernel-img.chroot => 00-kernel-img.chroot} | 0 live-build/buildd/hooks/{mirror.binary => 00-mirror.binary} | 0 .../hooks/{pkgbinarymangler.chroot => 01-pkgbinarymangler.chroot} | 0 live-build/buildd/hooks/{user.chroot => 02-user.chroot} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename live-build/buildd/hooks/{kernel-img.chroot => 00-kernel-img.chroot} (100%) mode change 100644 => 100755 rename live-build/buildd/hooks/{mirror.binary => 00-mirror.binary} (100%) rename live-build/buildd/hooks/{pkgbinarymangler.chroot => 01-pkgbinarymangler.chroot} (100%) mode change 100644 => 100755 rename live-build/buildd/hooks/{user.chroot => 02-user.chroot} (100%) mode change 100644 => 100755 diff --git a/live-build/buildd/hooks/kernel-img.chroot b/live-build/buildd/hooks/00-kernel-img.chroot old mode 100644 new mode 100755 similarity index 100% rename from live-build/buildd/hooks/kernel-img.chroot rename to live-build/buildd/hooks/00-kernel-img.chroot diff --git a/live-build/buildd/hooks/mirror.binary b/live-build/buildd/hooks/00-mirror.binary similarity index 100% rename from live-build/buildd/hooks/mirror.binary rename to live-build/buildd/hooks/00-mirror.binary diff --git a/live-build/buildd/hooks/pkgbinarymangler.chroot b/live-build/buildd/hooks/01-pkgbinarymangler.chroot old mode 100644 new mode 100755 similarity index 100% rename from live-build/buildd/hooks/pkgbinarymangler.chroot rename to live-build/buildd/hooks/01-pkgbinarymangler.chroot diff --git a/live-build/buildd/hooks/user.chroot b/live-build/buildd/hooks/02-user.chroot old mode 100644 new mode 100755 similarity index 100% rename from live-build/buildd/hooks/user.chroot rename to live-build/buildd/hooks/02-user.chroot From 1fab544a84d6660de52e83d49dd7004f3ccb3dbd Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 30 Apr 2018 16:39:01 +0100 Subject: [PATCH 09/43] Add init to buildd chroots, since it's needed for LXD-based builds. --- live-build/auto/config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live-build/auto/config b/live-build/auto/config index a0c99db7..ee846c53 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -711,6 +711,8 @@ case $SUBPROJECT in esac add_package install fakeroot add_package install build-essential + # Needed for LXD-based builds. + add_package install init ;; esac From 2c782e076c0bbc52b0ca410b6bb7dc4dff64b054 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 1 May 2018 11:30:51 +0100 Subject: [PATCH 10/43] Add an empty /etc/resolv.conf to buildd chroots. We don't want the symlink to /run/systemd/resolve/stub-resolv.conf, and launchpad-buildd will inject its own version if it doesn't get confused by a symlink. --- live-build/buildd/includes.chroot/etc/resolv.conf | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 live-build/buildd/includes.chroot/etc/resolv.conf diff --git a/live-build/buildd/includes.chroot/etc/resolv.conf b/live-build/buildd/includes.chroot/etc/resolv.conf new file mode 100644 index 00000000..e69de29b From baee4ed403498b7b2e8f5e57f2fadea2a24b705a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 29 Jun 2018 21:57:15 +0100 Subject: [PATCH 11/43] We know cosmic's name now. --- live-build/auto/config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index ee846c53..1bcb9772 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -695,17 +695,17 @@ case $SUBPROJECT in add_package install pkg-create-dbgsym # no longer needed in >= bionic add_package install apt-transport-https - # no longer needed in >= CC + # no longer needed in >= cosmic add_package install tzdata ;; artful) # no longer needed in >= bionic add_package install apt-transport-https - # no longer needed in >= CC + # no longer needed in >= cosmic add_package install tzdata ;; bionic) - # no longer needed in >= CC + # no longer needed in >= cosmic add_package install tzdata ;; esac From 013dff431ef1ce207f8971b5ba8c9d28d0e4a59b Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 17 Jul 2018 12:02:34 +1200 Subject: [PATCH 12/43] Remove device nodes from Docker images. (LP: #1645468) --- debian/changelog | 3 +++ live-build/auto/build | 3 +++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3975252a..151fee95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ livecd-rootfs (2.533) UNRELEASED; urgency=medium * Update unminimize script text and install ubuntu-standard when unminimizing a minimal image (LP: #1778777) + [ Michael Hudson-Doyle ] + * Remove device nodes from Docker images. (LP: #1645468) + -- Robert C Jennings Fri, 08 Jun 2018 10:10:53 -0700 livecd-rootfs (2.532) cosmic; urgency=medium diff --git a/live-build/auto/build b/live-build/auto/build index 519ce1e7..c217bbe1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -266,6 +266,9 @@ EOF # Save even more size by removing apt lists (that are currently removed # downstream anyway) rm -rf chroot/var/lib/apt/lists/* + # Having device notes in the docker image can cause problems: + # https://github.com/tianon/docker-brew-ubuntu-core/issues/62 + rm -rf chroot/dev/* fi if [ -f config/oem-config-preinstalled ]; then From 092b316357b53bdce9e2d1c2723e1df43892bd74 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 17 Jul 2018 13:34:01 +1200 Subject: [PATCH 13/43] add a comment explaining why /dev cleaning is docker-only --- live-build/auto/build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index c217bbe1..fdb216c3 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -266,8 +266,11 @@ EOF # Save even more size by removing apt lists (that are currently removed # downstream anyway) rm -rf chroot/var/lib/apt/lists/* - # Having device notes in the docker image can cause problems: - # https://github.com/tianon/docker-brew-ubuntu-core/issues/62 + # Having device notes in the docker image can cause problems + # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) + # so remove them. We only do this for docker because the rootfs + # for system booting without initramfs needs a minimal /dev to + # get to the point of running udev. rm -rf chroot/dev/* fi From 333a3e2b1b71a77fcdf6bcc624c78d40f72fd238 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 18 Jul 2018 10:11:25 +1200 Subject: [PATCH 14/43] moderate comment --- live-build/auto/build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index fdb216c3..de06b566 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -268,9 +268,8 @@ EOF rm -rf chroot/var/lib/apt/lists/* # Having device notes in the docker image can cause problems # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) - # so remove them. We only do this for docker because the rootfs - # for system booting without initramfs needs a minimal /dev to - # get to the point of running udev. + # so remove them. We only do this for docker out of an + # abundance of caution. rm -rf chroot/dev/* fi From 9360135b2c2a346ae6b1c309445564ade6daa6b1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 09:01:12 +0200 Subject: [PATCH 15/43] Minimize the number of manually installed packages in images by marking dependencies of metapackages as automatically installed. --- debian/changelog | 7 +++++ debian/control | 1 + live-build/auto/build | 2 ++ live-build/auto/minimize-manual.py | 48 ++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 live-build/auto/minimize-manual.py diff --git a/debian/changelog b/debian/changelog index e773ad65..76e885e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.536ubuntu1) UNRELEASED; urgency=medium + + * Minimize the number of manually installed packages in images by marking + dependencies of metapackages as automatically installed. + + -- Julian Andres Klode Tue, 18 Sep 2018 08:55:04 +0200 + livecd-rootfs (2.536) cosmic; urgency=medium * Fix live-server journald config snippet to actually disable journald rate diff --git a/debian/control b/debian/control index f6468b91..9d47c949 100644 --- a/debian/control +++ b/debian/control @@ -26,6 +26,7 @@ Depends: ${misc:Depends}, parted, procps, python-minimal | python, + python3-apt, python3-software-properties, qemu-utils, rsync, diff --git a/live-build/auto/build b/live-build/auto/build index 50831ba2..160f471a 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -445,6 +445,8 @@ EOF (cd chroot && find usr/share/doc -maxdepth 1 -type d | xargs du -s | sort -nr) echo END docdirs + live-build/auto/minimize-manual.py chroot + lb binary "$@" touch binary.success ) 2>&1 | tee binary.log diff --git a/live-build/auto/minimize-manual.py b/live-build/auto/minimize-manual.py new file mode 100644 index 00000000..712f35a4 --- /dev/null +++ b/live-build/auto/minimize-manual.py @@ -0,0 +1,48 @@ +#!/usr/bin/python3 +"""Minimize the number of manually installed packages in the image. + +Finds all manually meta packages and marks their dependencies as +automatically installed. +""" +import apt +import sys + + +def is_root(pkg): + return (pkg.is_installed and + not pkg.is_auto_installed and + (pkg.section == "metapackages" or + pkg.section.endswith("/metapackages"))) + + +c = apt.Cache(rootdir=sys.argv[1] if len(sys.argv) > 1 else None) + +roots = set(pkg for pkg in c if is_root(pkg)) +workset = set(roots) +seen = set() + +with c.actiongroup(): + while True: + + print("Iteration", file=sys.stderr) + to_proc = workset - seen + if not to_proc: + break + for pkg in sorted(to_proc): + print(" Visiting", pkg, file=sys.stderr) + + # Mark every + if pkg not in roots: + pkg.mark_auto() + + for dep in pkg.installed.dependencies + pkg.installed.recommends: + if dep.rawtype not in ('Depends', 'PreDepends', 'Recommends'): + continue + for bdep in dep.or_dependencies: + for v in bdep.target_versions: + if v.package.is_installed: + workset.add(v.package) + + seen.add(pkg) + + c.commit() From 2e9349c543b970aea09c5a2bed1aad30e830c1eb Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 09:15:42 +0200 Subject: [PATCH 16/43] minimize-manual.py: Followup with some cleanup, correct permissions --- live-build/auto/minimize-manual.py | 58 ++++++++++++++++-------------- 1 file changed, 31 insertions(+), 27 deletions(-) mode change 100644 => 100755 live-build/auto/minimize-manual.py diff --git a/live-build/auto/minimize-manual.py b/live-build/auto/minimize-manual.py old mode 100644 new mode 100755 index 712f35a4..6bd18780 --- a/live-build/auto/minimize-manual.py +++ b/live-build/auto/minimize-manual.py @@ -1,48 +1,52 @@ #!/usr/bin/python3 """Minimize the number of manually installed packages in the image. -Finds all manually meta packages and marks their dependencies as -automatically installed. +Finds all manually installed meta packages, and marks their dependencies +as automatically installed. """ -import apt import sys +import apt + def is_root(pkg): + """Check if the package is a root package (manually inst. meta)""" return (pkg.is_installed and not pkg.is_auto_installed and (pkg.section == "metapackages" or pkg.section.endswith("/metapackages"))) -c = apt.Cache(rootdir=sys.argv[1] if len(sys.argv) > 1 else None) +def main(): + """Main function""" + cache = apt.Cache(rootdir=sys.argv[1] if len(sys.argv) > 1 else None) + roots = set(pkg for pkg in cache if is_root(pkg)) + workset = set(roots) + seen = set() -roots = set(pkg for pkg in c if is_root(pkg)) -workset = set(roots) -seen = set() + with cache.actiongroup(): + while True: + print("Iteration", file=sys.stderr) + to_proc = workset - seen + if not to_proc: + break + for pkg in sorted(to_proc): + print(" Visiting", pkg, file=sys.stderr) -with c.actiongroup(): - while True: + if pkg not in roots: + pkg.mark_auto() - print("Iteration", file=sys.stderr) - to_proc = workset - seen - if not to_proc: - break - for pkg in sorted(to_proc): - print(" Visiting", pkg, file=sys.stderr) + for dep in (pkg.installed.dependencies + + pkg.installed.recommends): + for bdep in dep.or_dependencies: + for ver in bdep.target_versions: + if ver.package.is_installed: + workset.add(ver.package) - # Mark every - if pkg not in roots: - pkg.mark_auto() + seen.add(pkg) - for dep in pkg.installed.dependencies + pkg.installed.recommends: - if dep.rawtype not in ('Depends', 'PreDepends', 'Recommends'): - continue - for bdep in dep.or_dependencies: - for v in bdep.target_versions: - if v.package.is_installed: - workset.add(v.package) + cache.commit() - seen.add(pkg) - c.commit() +if __name__ == '__main__': + main() From fc6907b701c526bc8030ac7ac6f5dd20955d82a7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 09:27:27 +0200 Subject: [PATCH 17/43] fixup: Do not assume current directory --- 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 160f471a..cd738855 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -445,7 +445,7 @@ EOF (cd chroot && find usr/share/doc -maxdepth 1 -type d | xargs du -s | sort -nr) echo END docdirs - live-build/auto/minimize-manual.py chroot + /usr/share/livecd-rootfs/live-build/auto/minimize-manual.py chroot lb binary "$@" touch binary.success From 08376f8e64c6ed110ad6ed3f08bfd1cd81d271f4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 09:29:58 +0200 Subject: [PATCH 18/43] Fix version number --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 76e885e8..a42e5981 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.536ubuntu1) UNRELEASED; urgency=medium +livecd-rootfs (2.537) UNRELEASED; urgency=medium * Minimize the number of manually installed packages in images by marking dependencies of metapackages as automatically installed. From 3bb028c86dcb46f6d7aebec53f5e474314ace152 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 10:39:59 +0200 Subject: [PATCH 19/43] Fix debian/rules test for shell scripts to ignore python --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 5e853009..ed27747b 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_test: dh_auto_test set -e; for x in live-build/auto/*; do \ - sh -n "$$x"; \ + echo "$$x" | grep -q .py || sh -n "$$x"; \ done override_dh_install: From 1746e65953eb9ef9e0c4777804cf90f78dc4a216 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 11:44:06 +0200 Subject: [PATCH 20/43] Reorganize minimal-manual file location. This also gets rid of the change to debian/rules --- debian/install | 1 + debian/rules | 2 +- live-build/auto/build | 2 +- live-build/auto/minimize-manual.py => minimize-manual | 0 4 files changed, 3 insertions(+), 2 deletions(-) rename live-build/auto/minimize-manual.py => minimize-manual (100%) diff --git a/debian/install b/debian/install index 91d6ea37..4eb70070 100644 --- a/debian/install +++ b/debian/install @@ -1,2 +1,3 @@ live-build usr/share/livecd-rootfs get-ppa-fingerprint usr/share/livecd-rootfs +minimize-manual usr/share/livecd-rootfs diff --git a/debian/rules b/debian/rules index ed27747b..5e853009 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) override_dh_auto_test: dh_auto_test set -e; for x in live-build/auto/*; do \ - echo "$$x" | grep -q .py || sh -n "$$x"; \ + sh -n "$$x"; \ done override_dh_install: diff --git a/live-build/auto/build b/live-build/auto/build index cd738855..ec3d61bc 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -445,7 +445,7 @@ EOF (cd chroot && find usr/share/doc -maxdepth 1 -type d | xargs du -s | sort -nr) echo END docdirs - /usr/share/livecd-rootfs/live-build/auto/minimize-manual.py chroot + /usr/share/livecd-rootfs/minimize-manual chroot lb binary "$@" touch binary.success diff --git a/live-build/auto/minimize-manual.py b/minimize-manual similarity index 100% rename from live-build/auto/minimize-manual.py rename to minimize-manual From 1e2e25deb531b11e02447cf9b6916c1947887ce9 Mon Sep 17 00:00:00 2001 From: Adam Conrad Date: Tue, 18 Sep 2018 04:15:23 -0600 Subject: [PATCH 21/43] Releasing version 2.537. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a42e5981..9c7360a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.537) UNRELEASED; urgency=medium +livecd-rootfs (2.537) cosmic; urgency=medium * Minimize the number of manually installed packages in images by marking dependencies of metapackages as automatically installed. From c4c5c1f3495c27b0d08479cace7082ea41c3fc0d Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 19 Sep 2018 16:19:17 +0200 Subject: [PATCH 22/43] Generate tar file with --xattrs. --- 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 74e0bdcf..9b5b5548 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -499,7 +499,7 @@ elif [ "$SUBPROJECT" = buildd ]; then # 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 \ + --sort=name --numeric-owner --xattrs \ -czf "$PREFIX.rootfs.tar.gz" binary fi From e33fd318ba4d6548cdd7619f2beac0d9f9355379 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 19 Sep 2018 16:37:17 +0200 Subject: [PATCH 23/43] releasing package livecd-rootfs version 2.538 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9c793643..8ae7b4a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -livecd-rootfs (2.538) UNRELEASED; urgency=medium +livecd-rootfs (2.538) cosmic; urgency=medium * Add a buildd subproject. - -- Colin Watson Wed, 19 Sep 2018 16:19:58 +0200 + -- Colin Watson Wed, 19 Sep 2018 16:35:54 +0200 livecd-rootfs (2.537) cosmic; urgency=medium From 94230324e0d0a3a7a468a483273368e91ad96363 Mon Sep 17 00:00:00 2001 From: Adam Conrad Date: Thu, 20 Sep 2018 02:56:56 -0600 Subject: [PATCH 24/43] Stop building buildd chroots with --xattrs until we move to python3. --- debian/changelog | 6 ++++++ live-build/auto/build | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8ae7b4a1..121bd892 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.539) cosmic; urgency=medium + + * Stop building buildd chroots with --xattrs until we move to python3. + + -- Adam Conrad Thu, 20 Sep 2018 02:52:10 -0600 + livecd-rootfs (2.538) cosmic; urgency=medium * Add a buildd subproject. diff --git a/live-build/auto/build b/live-build/auto/build index 9d901bc7..70088cf1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -505,7 +505,7 @@ elif [ "$SUBPROJECT" = buildd ]; then # 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 --xattrs \ + --sort=name --numeric-owner \ -czf "$PREFIX.rootfs.tar.gz" binary fi From 08c9c26e58e4425d1283fdf13b6fdb2daf2fac5a Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Thu, 20 Sep 2018 13:37:25 +0200 Subject: [PATCH 25/43] Ensure /lib/modules exists in root tarballs and sqashfs. (LP: #1792905) --- debian/changelog | 7 +++++++ live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary | 3 +++ 2 files changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index 121bd892..e9695751 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.540) cosmic; urgency=medium + + * Ensure /lib/modules exists in root tarballs and sqashfs. + (LP: #1792905) + + -- Tobias Koch Thu, 20 Sep 2018 09:38:34 +0200 + livecd-rootfs (2.539) cosmic; urgency=medium * Stop building buildd chroots with --xattrs until we move to python3. diff --git a/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary b/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary index 9a916658..a4d77bd7 100755 --- a/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary +++ b/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary @@ -21,6 +21,9 @@ env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get --purge remove --a env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes rm -rf $rootfs_dir/boot/grub +# Keep this as some derivatives mount a tempfs here +mkdir -p $rootfs_dir/lib/modules + teardown_mountpoint $rootfs_dir dpkg-query --admindir=$rootfs_dir/var/lib/dpkg -W > $rootfs_dir.manifest From c241a3e3f848614a8494710605db351500b2ef73 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 26 Sep 2018 12:43:50 +1200 Subject: [PATCH 26/43] fix changelog --- debian/changelog | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 26638736..33233a26 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.541) UNRELEASED; urgency=medium + + * Remove device nodes from Docker images. (LP: #1645468) + + -- Michael Hudson-Doyle Wed, 26 Sep 2018 12:43:23 +1200 + livecd-rootfs (2.540) cosmic; urgency=medium * Ensure /lib/modules exists in root tarballs and sqashfs. @@ -64,9 +70,6 @@ livecd-rootfs (2.533) cosmic; urgency=medium * Update unminimize script text and install ubuntu-standard when unminimizing a minimal image (LP: #1778777) - [ Michael Hudson-Doyle ] - * Remove device nodes from Docker images. (LP: #1645468) - -- Adam Conrad Wed, 18 Jul 2018 11:06:54 -0600 livecd-rootfs (2.532) cosmic; urgency=medium From 9f96dcb4dee690be46a6d1a09b0535692d32b7a6 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 11:36:01 -0500 Subject: [PATCH 27/43] Add the server snap seed to the ubuntu-cpc project --- debian/changelog | 3 +++ live-build/auto/config | 3 +++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 33233a26..5f3288e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ livecd-rootfs (2.541) UNRELEASED; urgency=medium * Remove device nodes from Docker images. (LP: #1645468) + [ Robert C Jennings ] + * Add the server snap seed to the ubuntu-cpc project + -- Michael Hudson-Doyle Wed, 26 Sep 2018 12:43:23 +1200 livecd-rootfs (2.540) cosmic; urgency=medium diff --git a/live-build/auto/config b/live-build/auto/config index fd2ce64d..5ab67fac 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -696,6 +696,9 @@ case $PROJECT:${SUBPROJECT:-} in ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*) BASE_SEED='desktop' ;; + ubuntu-cpc:*) + BASE_SEED='server' + ;; ubuntu-server:live) BASE_SEED='server' # subiquity is seeded but in a separate squashfs via hooks; set HOOK_SNAPS and ALL_SNAPS. From 52e5a2b25b48f6b6f8d992b452fab42715f5bbc0 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 11:36:53 -0500 Subject: [PATCH 28/43] Allow hooks to replace generic snap assertion The generic assertion will be put in place if there are preseeded snaps. A hook that wants to add its own model should be able to overwrite the generic assertion. This patch allows a hook to continue unchanged calling snap_prepare_assertions with a custom brand/model. The patch will replace the generic brand/model if a custom brand/model is specified. Prior to this patch the generic brand/model would remain in place. --- debian/changelog | 1 + live-build/functions | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 5f3288e3..41b3beda 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ livecd-rootfs (2.541) UNRELEASED; urgency=medium [ Robert C Jennings ] * Add the server snap seed to the ubuntu-cpc project + * Allow hooks to replace generic snap assertion -- Michael Hudson-Doyle Wed, 26 Sep 2018 12:43:23 +1200 diff --git a/live-build/functions b/live-build/functions index 4441f2b1..263f4c07 100644 --- a/live-build/functions +++ b/live-build/functions @@ -427,6 +427,22 @@ snap_prepare_assertions() { local brand="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 1)" local model="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 2)" + # Clear the assertions if a hook wants to prepare a new + # assertion that isn't the default generic:generic-classic + if [ -e "$model_assertion" ] ; then + existing_model=$(sed -n 's/^model: \(.*\)$/\1/p' $model_assertion) + existing_brand=$(sed -n 's/^brand-id: \(.*\)$/\1/p' $model_assertion) + if [ "$existing_model" == "generic-classic" ] && + [ "$existing_brand" == "generic" ] && + ( [ "$existing_model" != "$model" ] || + [ "$existing_brand" != "$brand" ] ); then + echo "snap_prepare_assertions: clearing $existing_brand:$existing_model for $brand:$model" + rm "$model_assertion" + rm "$account_key_assertion" + rm "$account_assertion" + fi + fi + if ! [ -e "$model_assertion" ] ; then snap known --remote model series=16 \ model=$model brand-id=$brand \ From 97b0bbeed364cb74eb984c78fb8b1407734c542a Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 12:55:57 -0500 Subject: [PATCH 29/43] Add logging when snap assertions are not replaced --- live-build/functions | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live-build/functions b/live-build/functions index 263f4c07..2da0e2a0 100644 --- a/live-build/functions +++ b/live-build/functions @@ -440,6 +440,8 @@ snap_prepare_assertions() { rm "$model_assertion" rm "$account_key_assertion" rm "$account_assertion" + else + echo "snap_prepare_assertions: not replacing $existing_brand:$existing_model with $brand:$model" fi fi From 8d603cc87f857af24420e755fe19d6ec8c113423 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 13:09:50 -0500 Subject: [PATCH 30/43] Simplify snap model assertion customization --- live-build/functions | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/live-build/functions b/live-build/functions index 2da0e2a0..e932c7b3 100644 --- a/live-build/functions +++ b/live-build/functions @@ -432,17 +432,10 @@ snap_prepare_assertions() { if [ -e "$model_assertion" ] ; then existing_model=$(sed -n 's/^model: \(.*\)$/\1/p' $model_assertion) existing_brand=$(sed -n 's/^brand-id: \(.*\)$/\1/p' $model_assertion) - if [ "$existing_model" == "generic-classic" ] && - [ "$existing_brand" == "generic" ] && - ( [ "$existing_model" != "$model" ] || - [ "$existing_brand" != "$brand" ] ); then - echo "snap_prepare_assertions: clearing $existing_brand:$existing_model for $brand:$model" - rm "$model_assertion" - rm "$account_key_assertion" - rm "$account_assertion" - else - echo "snap_prepare_assertions: not replacing $existing_brand:$existing_model with $brand:$model" - fi + echo "snap_prepare_assertions: replacing $existing_brand:$existing_model with $brand:$model" + rm "$model_assertion" + rm "$account_key_assertion" + rm "$account_assertion" fi if ! [ -e "$model_assertion" ] ; then @@ -486,13 +479,12 @@ snap_prepare() { } snap_preseed() { - # Preseed a snap in the image + # Preseed a snap in the image (snap_prepare must be called once prior) local CHROOT_ROOT=$1 local SNAP=$2 # Per Ubuntu policy, all seeded snaps (with the exception of the core # snap) must pull from stable/ubuntu-$(release_ver) as their channel. local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"} - snap_prepare $CHROOT_ROOT _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL } From 0e00214cc6124a8c0abc1d63d382e0beeb6ce988 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 15:15:34 -0500 Subject: [PATCH 31/43] Ensure snap models have been added prior to snap preseeding --- live-build/functions | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/live-build/functions b/live-build/functions index e932c7b3..e6471b77 100644 --- a/live-build/functions +++ b/live-build/functions @@ -427,8 +427,7 @@ snap_prepare_assertions() { local brand="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 1)" local model="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 2)" - # Clear the assertions if a hook wants to prepare a new - # assertion that isn't the default generic:generic-classic + # Clear the assertions if they already exist if [ -e "$model_assertion" ] ; then existing_model=$(sed -n 's/^model: \(.*\)$/\1/p' $model_assertion) existing_brand=$(sed -n 's/^brand-id: \(.*\)$/\1/p' $model_assertion) @@ -452,7 +451,6 @@ snap_prepare_assertions() { > "$account_key_assertion" fi - if ! [ -e "$account_assertion" ] ; then local account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") snap known --remote account account-id=$account \ @@ -486,5 +484,9 @@ snap_preseed() { # snap) must pull from stable/ubuntu-$(release_ver) as their channel. local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"} + if [ ! -e "$CHROOT_ROOT/var/lib/snapd/seed/assertions/model" ]; then + echo "ERROR: Snap model assertion not present, snap_prepare must be called" + exit 1 + fi _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL } From 5bbb8e6b3f21fa26b35106580b4f0f3d42b79668 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Thu, 27 Sep 2018 15:15:55 -0500 Subject: [PATCH 32/43] Improve snap model assertion code for readability --- live-build/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/live-build/functions b/live-build/functions index e6471b77..cf68ba16 100644 --- a/live-build/functions +++ b/live-build/functions @@ -429,8 +429,8 @@ snap_prepare_assertions() { # Clear the assertions if they already exist if [ -e "$model_assertion" ] ; then - existing_model=$(sed -n 's/^model: \(.*\)$/\1/p' $model_assertion) - existing_brand=$(sed -n 's/^brand-id: \(.*\)$/\1/p' $model_assertion) + existing_model=$(awk '/^model: / {print $2}' $model_assertion) + existing_brand=$(awk '/^brand-id: / {print $2}' $model_assertion) echo "snap_prepare_assertions: replacing $existing_brand:$existing_model with $brand:$model" rm "$model_assertion" rm "$account_key_assertion" From b85cf0fc586354b0465702a674ba9a3246c90f18 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 27 Sep 2018 15:22:13 -0700 Subject: [PATCH 33/43] releasing package livecd-rootfs version 2.541 --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 41b3beda..0c1e3411 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,13 @@ -livecd-rootfs (2.541) UNRELEASED; urgency=medium +livecd-rootfs (2.541) cosmic; urgency=medium + [ Michael Hudson-Doyle ] * Remove device nodes from Docker images. (LP: #1645468) [ Robert C Jennings ] * Add the server snap seed to the ubuntu-cpc project * Allow hooks to replace generic snap assertion - -- Michael Hudson-Doyle Wed, 26 Sep 2018 12:43:23 +1200 + -- Steve Langasek Thu, 27 Sep 2018 15:21:49 -0700 livecd-rootfs (2.540) cosmic; urgency=medium From c184977a90ff187acd4e3f18fff4ae5d853b5852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 3 Oct 2018 11:51:49 +0200 Subject: [PATCH 34/43] Decide what model assertion series to fetch depending on the suite. For xenial use 16 and for others (so bionic+): 18. --- live-build/auto/config | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/live-build/auto/config b/live-build/auto/config index 5ab67fac..7cfd4c17 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -185,11 +185,17 @@ case $IMAGEFORMAT in *) UBUNTU_IMAGE_ARGS="" ;; esac + case $SUITE in + xenial) + CORE_SERIES=16 ;; + *) + CORE_SERIES=18 ;; + 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 > "$PREFIX".model-assertion + env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=$CORE_SERIES model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion echo "Configured ubuntu-image for the following model assertion:" cat "$PREFIX".model-assertion echo "----------------------------------------------------------" From 1d8aea6f20449a66a733e9ede4d676af9d1b77fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 3 Oct 2018 11:53:59 +0200 Subject: [PATCH 35/43] Changelog entry --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0c1e3411..ac42ad52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.542) UNRELEASED; urgency=medium + + * Decide what model assertion series to fetch depending on the suite. Use 16 + for xenial and 18 for other series (bionic+). This enables core18 image + builds. + + -- Ɓukasz 'sil2100' Zemczak Wed, 03 Oct 2018 11:51:59 +0200 + livecd-rootfs (2.541) cosmic; urgency=medium [ Michael Hudson-Doyle ] From 1498baada550d381d1aff7833bc8638b3f4be461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 10 Oct 2018 21:57:55 +0200 Subject: [PATCH 36/43] The model assertions for 18 don't actually use series=18 because that would be too logical. --- live-build/auto/config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index 7cfd4c17..6d4b9086 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -187,15 +187,17 @@ case $IMAGEFORMAT in esac case $SUITE in xenial) - CORE_SERIES=16 ;; + # Ubuntu Core 16 + ;; *) - CORE_SERIES=18 ;; + # Ubuntu Core 18 + MODEL="ubuntu-core-18-$MODEL" ;; 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=$CORE_SERIES model="$MODEL" brand-id=canonical > "$PREFIX".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 "$PREFIX".model-assertion echo "----------------------------------------------------------" From aba10dc702d86d68369c5b851fab45e9d016d4b9 Mon Sep 17 00:00:00 2001 From: Aleksandr Bogdanov Date: Thu, 11 Oct 2018 12:01:48 +0200 Subject: [PATCH 37/43] vagrant: disabling automatic console log file --- live-build/ubuntu-cpc/hooks/042-vagrant.binary | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index cb6c593c..26a2c424 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -163,7 +163,8 @@ Vagrant.configure("2") do |config| config.vm.provider "virtualbox" do |vb| vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ] - vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ] +# Creating a console log file is not an expected behavior for vagrant boxes. LP #1777827 +# vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ] end end EOF From 4f6e5dc11e00b0728efc4ff64d99e9bd45a9ac4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 11 Oct 2018 17:12:50 +0200 Subject: [PATCH 38/43] For the pc model, the name changed so we need to special case it a bit. --- 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 6d4b9086..75fd11aa 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -191,7 +191,7 @@ case $IMAGEFORMAT in ;; *) # Ubuntu Core 18 - MODEL="ubuntu-core-18-$MODEL" ;; + MODEL="ubuntu-core-18-${MODEL#pc-}" ;; esac echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common From 7dbb2c8d608b547509f5419f839abf64a8ecdeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Fri, 12 Oct 2018 14:19:18 +0200 Subject: [PATCH 39/43] releasing package livecd-rootfs version 2.542 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ac42ad52..50ee1908 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.542) UNRELEASED; urgency=medium +livecd-rootfs (2.542) cosmic; urgency=medium * Decide what model assertion series to fetch depending on the suite. Use 16 for xenial and 18 for other series (bionic+). This enables core18 image From 5bee1ade70b3c2ee57ae47e4bcda3438ea2e2de2 Mon Sep 17 00:00:00 2001 From: Cody Shepherd Date: Mon, 22 Oct 2018 10:21:50 -0700 Subject: [PATCH 40/43] Ensure pre-seeded snaps are now published in the image manifests. --- debian/changelog | 6 ++ live-build/auto/build | 1 + live-build/auto/config | 1 + live-build/functions | 11 ++++ live-build/snap-seed-parse.py | 56 +++++++++++++++++++ .../hooks/031-0-create-root-dir.binary | 2 +- .../hooks/030-root-squashfs.binary | 2 +- 7 files changed, 77 insertions(+), 2 deletions(-) create mode 100755 live-build/snap-seed-parse.py diff --git a/debian/changelog b/debian/changelog index 50ee1908..fa58e031 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.543) cosmic; urgency=medium + + * Ensure pre-seeded snaps are now published in the image manifests. + + -- Cody Shepherd Mon, 22 Oct 2018 10:16:19 -0700 + livecd-rootfs (2.542) cosmic; urgency=medium * Decide what model assertion series to fetch depending on the suite. Use 16 diff --git a/live-build/auto/build b/live-build/auto/build index 4b6fdc2e..4e23dccd 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -551,6 +551,7 @@ fi # '--initramfs none' produces different manifest names. if [ -e "binary/$INITFS/filesystem.packages" ]; then + /build/config/snap-seed-parse "chroot/" >> "binary/${INITFS}/filesystem.packages" ln "binary/$INITFS/filesystem.packages" "$PREFIX.manifest" chmod 644 "$PREFIX.manifest" fi diff --git a/live-build/auto/config b/live-build/auto/config index 75fd11aa..bffbb7f7 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -33,6 +33,7 @@ fi mkdir -p config cp -af /usr/share/livecd-rootfs/live-build/functions config/functions +cp -af /usr/share/livecd-rootfs/live-build/snap-seed-parse.py config/snap-seed-parse mkdir -p config/package-lists diff --git a/live-build/functions b/live-build/functions index cf68ba16..bd84c242 100644 --- a/live-build/functions +++ b/live-build/functions @@ -43,6 +43,17 @@ create_empty_disk_image() { dd if=/dev/zero of="$1" bs=1 count=0 seek="${imagesize}" } +create_manifest() { + local chroot_root=${1} + local target_file=${2} + echo "create_manifest chroot_root: ${chroot_root}" + dpkg-query --show --admindir="${chroot_root}/var/lib/dpkg" > ${target_file} + echo "create_manifest call to dpkg-query finished." + /build/config/snap-seed-parse "${chroot_root}" >> ${target_file} + echo "create_manifest call to snap_seed_parse finished." + echo "create_manifest finished" +} + make_ext4_partition() { device="$1" label=${fs_label:+-L "${fs_label}"} diff --git a/live-build/snap-seed-parse.py b/live-build/snap-seed-parse.py new file mode 100755 index 00000000..c441dc5a --- /dev/null +++ b/live-build/snap-seed-parse.py @@ -0,0 +1,56 @@ +#!/usr/bin/python3 + +""" +Usage: snap-seed-parse ${chroot_dir} > somefile.manifest + +This script looks for a seed.yaml path in the given root directory, parsing +it and printing generated manifest lines to stdout for easy redirection. +""" + +import re +import sys +import yaml +import os.path + + +def log(msg): + sys.stderr.write("snap-seed-parse: {}\n".format(msg)) + + +log("Parsing seed.yaml") + +CHROOT_ROOT = sys.argv[1] if len(sys.argv) > 1 and len(sys.argv[1]) > 0 \ + else '' + +# Trim any trailing slashes for correct appending +log("CHROOT_ROOT: {}".format(CHROOT_ROOT)) +if len(CHROOT_ROOT) > 0 and CHROOT_ROOT[-1] == '/': + CHROOT_ROOT = CHROOT_ROOT[:-1] + +# This is where we expect to find the seed.yaml file +YAML_PATH = CHROOT_ROOT + '/var/lib/snapd/seed/seed.yaml' + +# Snaps are prepended with this string in the manifest +LINE_PREFIX = 'snap:' + +log("yaml path: {}".format(YAML_PATH)) +if not os.path.isfile(YAML_PATH): + log("WARNING: yaml path not found; no seeded snaps found.") + exit(0) +else: + log("yaml path found.") + +with open(YAML_PATH, 'r') as fh: + yaml_lines = yaml.safe_load(fh)['snaps'] + +# Loop over dict items, outputting one manifest line from each triplet +for item in yaml_lines: + filestring = item['file'] + # Pull the revision number off the file name + revision = filestring[filestring.rindex('_')+1:] + revision = re.sub(r'[^0-9]', '', revision) + print("{}{}\t{}\t{}".format(LINE_PREFIX, + item['name'], + item['channel'], + revision, + )) diff --git a/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary b/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary index a4d77bd7..6ba4fe9c 100755 --- a/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary +++ b/live-build/ubuntu-cpc/hooks/031-0-create-root-dir.binary @@ -26,4 +26,4 @@ mkdir -p $rootfs_dir/lib/modules teardown_mountpoint $rootfs_dir -dpkg-query --admindir=$rootfs_dir/var/lib/dpkg -W > $rootfs_dir.manifest +create_manifest "${rootfs_dir}" "${rootfs_dir}.manifest" diff --git a/live-build/ubuntu-server/hooks/030-root-squashfs.binary b/live-build/ubuntu-server/hooks/030-root-squashfs.binary index ad34e76a..41c15001 100755 --- a/live-build/ubuntu-server/hooks/030-root-squashfs.binary +++ b/live-build/ubuntu-server/hooks/030-root-squashfs.binary @@ -28,7 +28,7 @@ cp -a chroot/* binary/boot/squashfs.dir squashfs_f="${PWD}/livecd.${PROJECT}.squashfs" squashfs_f_manifest="${squashfs_f}.manifest" -dpkg-query --admindir=binary/boot/squashfs.dir/var/lib/dpkg -W > ${squashfs_f_manifest} +create_manifest "binary/boot/squashfs.dir" "${squashfs_f_manifest}" (cd "binary/boot/squashfs.dir/" && mksquashfs . ${squashfs_f} \ From 28192903523e9b2ee1a1249b1d9ac742a7585b1e Mon Sep 17 00:00:00 2001 From: Cody Shepherd Date: Tue, 23 Oct 2018 10:32:52 -0700 Subject: [PATCH 41/43] Changed absoluted paths to relative; set changelog message to UNRELEASED --- debian/changelog | 2 +- live-build/auto/build | 2 +- live-build/functions | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index fa58e031..d605af52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.543) cosmic; urgency=medium +livecd-rootfs (2.543) UNRELEASED; urgency=medium * Ensure pre-seeded snaps are now published in the image manifests. diff --git a/live-build/auto/build b/live-build/auto/build index 4e23dccd..86a269c5 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -551,7 +551,7 @@ fi # '--initramfs none' produces different manifest names. if [ -e "binary/$INITFS/filesystem.packages" ]; then - /build/config/snap-seed-parse "chroot/" >> "binary/${INITFS}/filesystem.packages" + ./config/snap-seed-parse "chroot/" >> "binary/${INITFS}/filesystem.packages" ln "binary/$INITFS/filesystem.packages" "$PREFIX.manifest" chmod 644 "$PREFIX.manifest" fi diff --git a/live-build/functions b/live-build/functions index bd84c242..9f4f02fd 100644 --- a/live-build/functions +++ b/live-build/functions @@ -49,7 +49,7 @@ create_manifest() { echo "create_manifest chroot_root: ${chroot_root}" dpkg-query --show --admindir="${chroot_root}/var/lib/dpkg" > ${target_file} echo "create_manifest call to dpkg-query finished." - /build/config/snap-seed-parse "${chroot_root}" >> ${target_file} + ./config/snap-seed-parse "${chroot_root}" >> ${target_file} echo "create_manifest call to snap_seed_parse finished." echo "create_manifest finished" } From 03add93632f030ddd7225834eb6a4b6995c959dd Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 26 Oct 2018 14:56:42 -0600 Subject: [PATCH 42/43] Add changelog entry for previous change --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index d605af52..31d51f2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ livecd-rootfs (2.543) UNRELEASED; urgency=medium * Ensure pre-seeded snaps are now published in the image manifests. + [ Aleksandr Bogdanov ] + * vagrant: disabling automatic console log file + -- Cody Shepherd Mon, 22 Oct 2018 10:16:19 -0700 livecd-rootfs (2.542) cosmic; urgency=medium From a9935923f8efbe91e262b22e443a1c010ca9159f Mon Sep 17 00:00:00 2001 From: Cody Shepherd Date: Mon, 29 Oct 2018 09:28:50 -0700 Subject: [PATCH 43/43] Changes to include grub efi packages and dependencies in uefi image manifests. --- live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary index 56328150..6f6aef30 100755 --- a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary @@ -93,6 +93,12 @@ install_grub() { ;; esac + # This call to generate the package manifest is added here to capture + # grub-efi packages that otherwise would not make it into the base + # manifest. filesystem.packages is moved into place via symlinking to + # livecd.ubuntu-cpc.manifest by live-build/auto/build after lb_binary runs + create_manifest "mountpoint" "binary/boot/filesystem.packages" + chroot mountpoint grub-install "${loop_device}" \ --boot-directory=/boot \ --efi-directory=/boot/efi \