Preserve apt preferences created by any package we install (i.e. ubuntu-advantage-tools) against live-build's attempt to delete them. (LP: #1855354)

xenial-1855354
Michael Hudson-Doyle 5 years ago
parent 1f4b996077
commit d70309b7e0

8
debian/changelog vendored

@ -1,3 +1,11 @@
livecd-rootfs (2.408.57) 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 <michael.hudson@ubuntu.com> Thu, 19 Dec 2019 15:43:56 +1300
livecd-rootfs (2.408.56) xenial; urgency=medium livecd-rootfs (2.408.56) xenial; urgency=medium
* Backport enabling of adding extra snaps to ubuntu-core images via the * Backport enabling of adding extra snaps to ubuntu-core images via the

@ -220,6 +220,12 @@ EOF
lb chroot "$@" lb chroot "$@"
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
if [ "${SUBPROJECT:-}" = minimized ]; then if [ "${SUBPROJECT:-}" = minimized ]; then
# and if initramfs-tools was configured before our kernel, # and if initramfs-tools was configured before our kernel,
# /etc/kernel/postinst.d/initramfs-tools will have created # /etc/kernel/postinst.d/initramfs-tools will have created

@ -875,6 +875,19 @@ EOF
;; ;;
esac esac
if [ $PROJECT != ubuntu-cpc ]; then
cat > config/hooks/100-preserve-apt-prefs.chroot <<\EOF
#! /bin/sh -ex
# live-build "helpfully" removes /etc/apt/preferences.d/* so we put a
# copy somewhere it won't touch it.
if [ -n "$(ls -A /etc/apt/preferences.d)" ]; then
cp -a /etc/apt/preferences.d /etc/apt/preferences.d.save
fi
EOF
fi
if $BINARY_REMOVE_LINUX; then if $BINARY_REMOVE_LINUX; then
cat > config/binary_rootfs/excludes << EOF cat > config/binary_rootfs/excludes << EOF
boot/vmlinu?-* boot/vmlinu?-*

@ -0,0 +1,8 @@
#! /bin/sh -ex
# live-build "helpfully" removes /etc/apt/preferences.d/* so we put a
# copy somewhere it won't touch it.
if [ -n "$(ls -A /etc/apt/preferences.d)" ]; then
cp -a /etc/apt/preferences.d /etc/apt/preferences.d.save
fi
Loading…
Cancel
Save