From 0e5b19259d8bff41972f9fe678cc22a73905ac4e Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 6 Jun 2018 11:24:10 -0700 Subject: [PATCH 1/4] ubuntu-cpc: Reintroduce the -root.tar.xz artifact (LP: #1585233). --- debian/changelog | 6 ++++ .../ubuntu-cpc/hooks/031-root-xz.binary | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 live-build/ubuntu-cpc/hooks/031-root-xz.binary diff --git a/debian/changelog b/debian/changelog index f7871c15..422c7128 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.530) UNRELEASED; urgency=medium + + * ubuntu-cpc: Reintroduce the -root.tar.xz artifact (LP: #1585233). + + -- Daniel Watkins Wed, 06 Jun 2018 11:21:57 -0700 + livecd-rootfs (2.529) cosmic; urgency=medium * Improvements to the ubuntu-base (i.e. Docker) build: diff --git a/live-build/ubuntu-cpc/hooks/031-root-xz.binary b/live-build/ubuntu-cpc/hooks/031-root-xz.binary new file mode 100644 index 00000000..4e52369b --- /dev/null +++ b/live-build/ubuntu-cpc/hooks/031-root-xz.binary @@ -0,0 +1,30 @@ +#!/bin/bash -ex +# vi: ts=4 expandtab +# +# Generate the rootfs.tar.xz and manifest + +if [ -n "$SUBARCH" ]; then + echo "Skipping rootfs build for subarch flavor build" + exit 0 +fi + +. /build/config/functions + +tardir=filesystem.dir +mkdir $tardir +cp -a chroot/* $tardir + +setup_mountpoint $tardir + +env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+' +env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assume-yes '^grub-.*' +env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get autoremove --purge --assume-yes +chroot $tardir mkdir -p /lib/modules + +teardown_mountpoint $tardir + +dpkg-query --admindir=$tardir/var/lib/dpkg -W > livecd.ubuntu-cpc.rootfs.manifest + +(cd "$tardir/" && tar -c *) | xz > "livecd.ubuntu-cpc.rootfs.tar.xz" + +rm -rf $tardir From 8e344b1f6b4773baceeda15f640592cb9e094b5e Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 6 Jun 2018 14:53:58 -0700 Subject: [PATCH 2/4] Add comment explaining /lib/modules creation --- live-build/ubuntu-cpc/hooks/031-root-xz.binary | 3 +++ 1 file changed, 3 insertions(+) diff --git a/live-build/ubuntu-cpc/hooks/031-root-xz.binary b/live-build/ubuntu-cpc/hooks/031-root-xz.binary index 4e52369b..ab91adb1 100644 --- a/live-build/ubuntu-cpc/hooks/031-root-xz.binary +++ b/live-build/ubuntu-cpc/hooks/031-root-xz.binary @@ -19,6 +19,9 @@ setup_mountpoint $tardir env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+' env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assume-yes '^grub-.*' env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get autoremove --purge --assume-yes + +# This directory is required downstream by MAAS (LP: #1543204), so ensure it +# exists chroot $tardir mkdir -p /lib/modules teardown_mountpoint $tardir From 136e2e2200d5e8b2c1a67a93c2156ef9ff1eda5f Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 6 Jun 2018 15:32:06 -0700 Subject: [PATCH 3/4] Drop /lib/modules creation as MAAS handles it downstream --- live-build/ubuntu-cpc/hooks/031-root-xz.binary | 4 ---- 1 file changed, 4 deletions(-) diff --git a/live-build/ubuntu-cpc/hooks/031-root-xz.binary b/live-build/ubuntu-cpc/hooks/031-root-xz.binary index ab91adb1..9d710d73 100644 --- a/live-build/ubuntu-cpc/hooks/031-root-xz.binary +++ b/live-build/ubuntu-cpc/hooks/031-root-xz.binary @@ -20,10 +20,6 @@ env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assum env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get --purge remove --assume-yes '^grub-.*' env DEBIAN_FRONTEND=noninteractive chroot $tardir apt-get autoremove --purge --assume-yes -# This directory is required downstream by MAAS (LP: #1543204), so ensure it -# exists -chroot $tardir mkdir -p /lib/modules - teardown_mountpoint $tardir dpkg-query --admindir=$tardir/var/lib/dpkg -W > livecd.ubuntu-cpc.rootfs.manifest From a9bb37c661d3c89232e7440817de0ea34645cecf Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 6 Jun 2018 16:04:45 -0700 Subject: [PATCH 4/4] Use a relative path for config/functions --- live-build/ubuntu-cpc/hooks/031-root-xz.binary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live-build/ubuntu-cpc/hooks/031-root-xz.binary b/live-build/ubuntu-cpc/hooks/031-root-xz.binary index 9d710d73..62881cd8 100644 --- a/live-build/ubuntu-cpc/hooks/031-root-xz.binary +++ b/live-build/ubuntu-cpc/hooks/031-root-xz.binary @@ -8,7 +8,7 @@ if [ -n "$SUBARCH" ]; then exit 0 fi -. /build/config/functions +. config/functions tardir=filesystem.dir mkdir $tardir