From 94c2d606ca6c8078ad36701b66a469b8cfb3c9d8 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 12 Dec 2019 12:55:25 +1300 Subject: [PATCH] Preserve apt preferences created by any package we install (i.e. ubuntu-advantage-tools) against live-build's attempt to delete them. (LP: #1855354) --- debian/changelog | 8 ++++++++ live-build/auto/build | 6 ++++++ live-build/auto/config | 11 +++++++++++ 3 files changed, 25 insertions(+) diff --git a/debian/changelog b/debian/changelog index 63baa1aa..e68f9f16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.634) UNRELEASED; urgency=medium + + * Preserve apt preferences created by any package we install (i.e. + ubuntu-advantage-tools) against live-build's attempt to delete them. + (LP: #1855354) + + -- Michael Hudson-Doyle Thu, 12 Dec 2019 12:55:17 +1300 + livecd-rootfs (2.633) focal; urgency=medium * Snapd for uc20 model assertions does not support global channel overrides. diff --git a/live-build/auto/build b/live-build/auto/build index 43a706be..c12ba331 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -314,6 +314,12 @@ EOF undivert_grub chroot fi + if [ -d chroot/etc/apt/preferences.d.save ]; then + # https://twitter.com/infinite_scream + mv chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/ + rmdir chroot/etc/apt/preferences.d.save + fi + # Let all configuration non multi-layered project here. # If those are moving to a multi-layer layout, this needs to be # done in chroot hooks. diff --git a/live-build/auto/config b/live-build/auto/config index 6ed05a42..58c0367b 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -1096,6 +1096,17 @@ rm -f /etc/fstab EOF fi +if [ $PROJECT = ubuntu-base ]; then + cat > config/hooks/100-preserve-ua-tools-prefs.chroot < config/hooks/100-ubuntukylin.chroot <