From cb221772870057fe4cd3cb427b9a373fd105a19e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Apr 2018 16:07:44 +0100 Subject: [PATCH 01/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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 c9aaddd56a47ff683746f62732ed5ea6d1945dc5 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 15 Jun 2018 14:36:24 +1200 Subject: [PATCH 11/38] Disable journald rate limiting in the live-server live session. (LP: #1776891) --- debian/changelog | 5 +++++ .../overlay/etc/systemd/journald.conf.d/no-rate-limit.conf | 1 + 2 files changed, 6 insertions(+) create mode 100644 live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf diff --git a/debian/changelog b/debian/changelog index 23d888a5..3f2c804c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,12 @@ livecd-rootfs (2.533) UNRELEASED; urgency=medium + [ Robert C Jennings ] * ubuntu-cpc: Remove git-man for minimized images + [ Michael Hudson-Doyle ] + * Disable journald rate limiting in the live-server live session. + (LP: #1776891) + -- Robert C Jennings Fri, 08 Jun 2018 10:10:53 -0700 livecd-rootfs (2.532) cosmic; urgency=medium diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf new file mode 100644 index 00000000..1d8af89a --- /dev/null +++ b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf @@ -0,0 +1 @@ +RateLimitIntervalSec=0 From baee4ed403498b7b2e8f5e57f2fadea2a24b705a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 29 Jun 2018 21:57:15 +0100 Subject: [PATCH 12/38] 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 c3f5ee6716dcdbede2753e308002bbf016890861 Mon Sep 17 00:00:00 2001 From: Robert C Jennings Date: Wed, 11 Jul 2018 15:06:16 -0500 Subject: [PATCH 13/38] Disable checksum generation These checksums are unused, integrity checking in launchpad is performed separately. --- debian/changelog | 1 + live-build/auto/config | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 3975252a..bcdc9989 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ livecd-rootfs (2.533) UNRELEASED; urgency=medium [ Robert C Jennings ] * ubuntu-cpc: Remove git-man for minimized images + * Disable checksum generation [ Colin Watson ] * live-build/auto/config: Drop "lp-*" hostname filter for Launchpad diff --git a/live-build/auto/config b/live-build/auto/config index bd25e49f..821977df 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -795,6 +795,7 @@ lb config noauto \ --initsystem none \ --bootloader "$BOOTLOADER" \ ${INITRAMFS_COMPRESSION:+--initramfs-compression "$INITRAMFS_COMPRESSION"} \ + --checksums none \ --cache false \ ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \ $OPTS \ From dee54ed412d3084a66aa24f0db39b27d0f16cdd7 Mon Sep 17 00:00:00 2001 From: Adam Conrad Date: Wed, 18 Jul 2018 11:07:30 -0600 Subject: [PATCH 14/38] Releasing 2.533 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bcdc9989..edc5317a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.533) UNRELEASED; urgency=medium +livecd-rootfs (2.533) cosmic; urgency=medium [ Robert C Jennings ] * ubuntu-cpc: Remove git-man for minimized images @@ -12,7 +12,7 @@ livecd-rootfs (2.533) UNRELEASED; urgency=medium * Update unminimize script text and install ubuntu-standard when unminimizing a minimal image (LP: #1778777) - -- Robert C Jennings Fri, 08 Jun 2018 10:10:53 -0700 + -- Adam Conrad Wed, 18 Jul 2018 11:06:54 -0600 livecd-rootfs (2.532) cosmic; urgency=medium From 3db2340c545b30788becc596b674b26ec4b03669 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Wed, 1 Aug 2018 18:02:13 -0700 Subject: [PATCH 15/38] generate all tar files with --xattrs. LP: #1302192. --- debian/changelog | 6 ++++++ live-build/auto/build | 4 ++-- live-build/ubuntu-cpc/hooks/031-1-root-xz.binary | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index edc5317a..9c3e0dfb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.534) UNRELEASED; urgency=medium + + * generate all tar files with --xattrs. LP: #1302192. + + -- Steve Langasek Wed, 01 Aug 2018 17:59:41 -0700 + livecd-rootfs (2.533) cosmic; urgency=medium [ Robert C Jennings ] diff --git a/live-build/auto/build b/live-build/auto/build index 519ce1e7..c71b7b10 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -490,7 +490,7 @@ for ISO in binary.iso binary.hybrid.iso; do done if [ -e "binary/$INITFS/filesystem.dir" ]; then - (cd "binary/$INITFS/filesystem.dir/" && tar -c *) | \ + (cd "binary/$INITFS/filesystem.dir/" && tar -c --xattrs *) | \ gzip -9 --rsyncable > "$PREFIX.rootfs.tar.gz" chmod 644 "$PREFIX.rootfs.tar.gz" elif [ -e binary-tar.tar.gz ]; then @@ -527,7 +527,7 @@ EOF fi if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then - (cd "binary/$INITFS/custom.dir/" && tar -c *) | \ + (cd "binary/$INITFS/custom.dir/" && tar -c --xattrs *) | \ gzip -9 --rsyncable > "$PREFIX.custom.tar.gz" chmod 644 "$PREFIX.custom.tar.gz" fi diff --git a/live-build/ubuntu-cpc/hooks/031-1-root-xz.binary b/live-build/ubuntu-cpc/hooks/031-1-root-xz.binary index fab8a834..5695f96d 100755 --- a/live-build/ubuntu-cpc/hooks/031-1-root-xz.binary +++ b/live-build/ubuntu-cpc/hooks/031-1-root-xz.binary @@ -12,4 +12,4 @@ fi rootfs_dir=rootfs.dir cp $rootfs_dir.manifest livecd.ubuntu-cpc.rootfs.manifest -(cd $rootfs_dir/ && tar -c *) | xz > livecd.ubuntu-cpc.rootfs.tar.xz +(cd $rootfs_dir/ && tar -c --xattrs *) | xz > livecd.ubuntu-cpc.rootfs.tar.xz From 67142507ae0034c5f3d230fb316bebd9742b7107 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 6 Aug 2018 13:12:05 -0700 Subject: [PATCH 16/38] releasing package livecd-rootfs version 2.534 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3c7a8388..6a426743 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.534) UNRELEASED; urgency=medium +livecd-rootfs (2.534) cosmic; urgency=medium [ Michael Hudson-Doyle ] * Disable journald rate limiting in the live-server live session. @@ -7,7 +7,7 @@ livecd-rootfs (2.534) UNRELEASED; urgency=medium [ Steve Langasek ] * generate all tar files with --xattrs. LP: #1302192. - -- Steve Langasek Wed, 01 Aug 2018 23:28:47 -0700 + -- Steve Langasek Mon, 06 Aug 2018 13:12:02 -0700 livecd-rootfs (2.533) cosmic; urgency=medium From 00151c5e0bcccfa225281ff181a50ef594b8411f Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 16 Aug 2018 21:28:52 +1200 Subject: [PATCH 17/38] Set PREINSTALLED=true for live-server so that universe ends up being enabled in the image. --- debian/changelog | 7 +++++++ live-build/auto/config | 1 + 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6a426743..aa7c804b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.535~ppa1) cosmic; urgency=medium + + * Set PREINSTALLED=true for live-server so that universe ends up being + enabled in the image. + + -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 + livecd-rootfs (2.534) cosmic; urgency=medium [ Michael Hudson-Doyle ] diff --git a/live-build/auto/config b/live-build/auto/config index 821977df..5ea1f6fe 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -151,6 +151,7 @@ case $IMAGEFORMAT in # by skipping lb_chroot_live-packages. skip_lb_stage chroot_live-packages INITRAMFS_TYPE=auto + PREINSTALLED=true ;; *) PREINSTALLED=true From 1aa8b9d882b44e1237b556f552f7c979740a5f95 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 10:09:57 +1200 Subject: [PATCH 18/38] ffs --- debian/changelog | 4 ++-- live-build/auto/config | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index aa7c804b..83ba3237 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ -livecd-rootfs (2.535~ppa1) cosmic; urgency=medium +livecd-rootfs (2.535~ppa2) cosmic; urgency=medium * Set PREINSTALLED=true for live-server so that universe ends up being - enabled in the image. + enabled in the image. But make sure PREINSTALLED_POOL_SEEDS is not set. -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 diff --git a/live-build/auto/config b/live-build/auto/config index 5ea1f6fe..c4b67e5b 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -495,9 +495,11 @@ case $PROJECT in amd64) add_package live linux-signed-generic ;; esac ;; + *) + PREINSTALL_POOL_SEEDS='server-ship' + ;; esac COMPONENTS='main' - PREINSTALL_POOL_SEEDS='server-ship' ;; ubuntu-core) @@ -695,6 +697,10 @@ export APT_OPTIONS if [ "$PREINSTALLED" != "true" ] && [ "$LIVE_TASK" ]; then add_task live "$LIVE_TASK" fi +if [ -n "$LIVE_TASK" ] && [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-server:live" ]; then + add_task live "$LIVE_TASK" +fi + case $PROJECT in ubuntu-dvd) From e80459b96755b984b22acc8726cd7292ac732c4e Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 11:09:37 +1200 Subject: [PATCH 19/38] grumble --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 83ba3237..dc3a9177 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,8 @@ -livecd-rootfs (2.535~ppa2) cosmic; urgency=medium +livecd-rootfs (2.535~ppa3) cosmic; urgency=medium * Set PREINSTALLED=true for live-server so that universe ends up being enabled in the image. But make sure PREINSTALLED_POOL_SEEDS is not set. + And that the LIVE_TASK gets installed. -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 From a2614719699eb2d72f6ba77f1d25dd5982574be5 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 12:00:41 +1200 Subject: [PATCH 20/38] a less hackish approach --- live-build/auto/build | 2 +- live-build/auto/config | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index c71b7b10..50831ba2 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -268,7 +268,7 @@ EOF rm -rf chroot/var/lib/apt/lists/* fi - if [ -f config/oem-config-preinstalled ]; then + if [ -f config/universe-enabled ]; then # This is cargo-culted almost verbatim (with some syntax changes for # preinstalled being slightly different in what it doesn't ask) from diff --git a/live-build/auto/config b/live-build/auto/config index c4b67e5b..070d73f3 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -151,7 +151,7 @@ case $IMAGEFORMAT in # by skipping lb_chroot_live-packages. skip_lb_stage chroot_live-packages INITRAMFS_TYPE=auto - PREINSTALLED=true + touch config/universe-enabled ;; *) PREINSTALLED=true @@ -214,9 +214,9 @@ case $IMAGEFORMAT in esac if [ "$PREINSTALLED" = "true" ]; then - # This is an oem-config preinstalled image, touch a random file that - # we can refer back to during build, cause that's wildly hackish - touch config/oem-config-preinstalled + # Touch a random file that we can refer back to during build, + # cause that's wildly hackish + touch config/universe-enabled case $PROJECT in kubuntu*) add_package live oem-config-kde ubiquity-frontend-kde @@ -495,10 +495,8 @@ case $PROJECT in amd64) add_package live linux-signed-generic ;; esac ;; - *) - PREINSTALL_POOL_SEEDS='server-ship' - ;; esac + PREINSTALL_POOL_SEEDS='server-ship' COMPONENTS='main' ;; @@ -697,10 +695,6 @@ export APT_OPTIONS if [ "$PREINSTALLED" != "true" ] && [ "$LIVE_TASK" ]; then add_task live "$LIVE_TASK" fi -if [ -n "$LIVE_TASK" ] && [ "$PROJECT:${SUBPROJECT:-}" = "ubuntu-server:live" ]; then - add_task live "$LIVE_TASK" -fi - case $PROJECT in ubuntu-dvd) From e804cc4e00d53a4d20a822911da11e07fb76a488 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 12:01:27 +1200 Subject: [PATCH 21/38] a less hackish approach --- 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 070d73f3..4d492d31 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -496,8 +496,8 @@ case $PROJECT in esac ;; esac - PREINSTALL_POOL_SEEDS='server-ship' COMPONENTS='main' + PREINSTALL_POOL_SEEDS='server-ship' ;; ubuntu-core) From 59b8eb76e2d35d004aa6aa47cdc717acb298a043 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 12:04:12 +1200 Subject: [PATCH 22/38] Disentangle enabling universe in the final image a little from having PREINSTALLED=true set and enable it for a live-server build. --- debian/changelog | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index dc3a9177..4a95350d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,9 @@ -livecd-rootfs (2.535~ppa3) cosmic; urgency=medium +livecd-rootfs (2.535~ppa4) cosmic; urgency=medium - * Set PREINSTALLED=true for live-server so that universe ends up being - enabled in the image. But make sure PREINSTALLED_POOL_SEEDS is not set. - And that the LIVE_TASK gets installed. + * Disentangle enabling universe in the final image a little from having + PREINSTALLED=true set and enable it for a live-server build. - -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 + -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 livecd-rootfs (2.534) cosmic; urgency=medium From 15505866a8ad903b3baa1e0e68f1ee4f824540ec Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 13:51:55 +1200 Subject: [PATCH 23/38] add bug ref to changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 4a95350d..1eca5b5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ livecd-rootfs (2.535~ppa4) cosmic; urgency=medium * Disentangle enabling universe in the final image a little from having PREINSTALLED=true set and enable it for a live-server build. + (LP: #1783129) -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 From 061ea269840dd52dc4fdc0c8603283df91f95dad Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 17 Aug 2018 16:14:41 +1200 Subject: [PATCH 24/38] fix changelog --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1eca5b5c..229d6d5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.535~ppa4) cosmic; urgency=medium +livecd-rootfs (2.535) UNRELEASED; urgency=medium * Disentangle enabling universe in the final image a little from having PREINSTALLED=true set and enable it for a live-server build. From 2c76f50499ec0f1336f89ffd793a14da26e382b5 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 24 Aug 2018 13:04:56 +1200 Subject: [PATCH 25/38] releasing package livecd-rootfs version 2.535 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 229d6d5b..0442d2b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -livecd-rootfs (2.535) UNRELEASED; urgency=medium +livecd-rootfs (2.535) cosmic; urgency=medium * Disentangle enabling universe in the final image a little from having PREINSTALLED=true set and enable it for a live-server build. (LP: #1783129) - -- Michael Hudson-Doyle Thu, 16 Aug 2018 21:28:00 +1200 + -- Michael Hudson-Doyle Fri, 24 Aug 2018 13:04:51 +1200 livecd-rootfs (2.534) cosmic; urgency=medium From ae4a760edb605fbab9443abed9159461f8eaa8f3 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 28 Aug 2018 10:55:19 +1200 Subject: [PATCH 26/38] Fix live-server journald config snippet to actually disable journald rate limiting. --- debian/changelog | 7 +++++++ .../overlay/etc/systemd/journald.conf.d/no-rate-limit.conf | 1 + 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0442d2b6..66cd1415 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.536) UNRELEASED; urgency=medium + + * Fix live-server journald config snippet to actually disable journald rate + limiting. + + -- Michael Hudson-Doyle Tue, 28 Aug 2018 10:54:38 +1200 + livecd-rootfs (2.535) cosmic; urgency=medium * Disentangle enabling universe in the final image a little from having diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf index 1d8af89a..fbaab956 100644 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf +++ b/live-build/ubuntu-server/includes.binary/overlay/etc/systemd/journald.conf.d/no-rate-limit.conf @@ -1 +1,2 @@ +[Journal] RateLimitIntervalSec=0 From f04caf6104e7d6db7a8ad83049a0e595f5a3ff57 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 28 Aug 2018 11:00:43 +1200 Subject: [PATCH 27/38] releasing package livecd-rootfs version 2.536 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 66cd1415..e773ad65 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -livecd-rootfs (2.536) UNRELEASED; urgency=medium +livecd-rootfs (2.536) cosmic; urgency=medium * Fix live-server journald config snippet to actually disable journald rate limiting. - -- Michael Hudson-Doyle Tue, 28 Aug 2018 10:54:38 +1200 + -- Michael Hudson-Doyle Tue, 28 Aug 2018 11:00:39 +1200 livecd-rootfs (2.535) cosmic; urgency=medium From 9360135b2c2a346ae6b1c309445564ade6daa6b1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 18 Sep 2018 09:01:12 +0200 Subject: [PATCH 28/38] 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 29/38] 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 30/38] 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 31/38] 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 32/38] 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 33/38] 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 34/38] 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 35/38] 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 36/38] 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 37/38] 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 38/38] 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