[neon/forks/live-build/Neon/release] debian: rebase to noble
Carlos De Maine
null at kde.org
Thu May 16 07:42:13 BST 2024
Git commit 9904067077cd88dc91345041d5f79fa31f981010 by Carlos De Maine.
Committed on 16/05/2024 at 06:41.
Pushed by carlosdem into branch 'Neon/release'.
rebase to noble
M +51 -0 debian/changelog
A +95 -0 debian/patches/lp-2033308-backup-and-restore-packaged-preferences.patch
A +54 -0 debian/patches/new-memtest-version
M +5 -1 debian/patches/series
A +24 -0 debian/patches/ubuntu-apt-preferences.d-removal
D +0 -36 debian/patches/ubuntu-kernel-img-conf.patch
A +29 -0 debian/patches/ubuntu-silence-fdisk-noise.patch
A +31 -0 debian/patches/umount-sys-properly.patch
https://invent.kde.org/neon/forks/live-build/-/commit/9904067077cd88dc91345041d5f79fa31f981010
diff --git a/debian/changelog b/debian/changelog
index 0c01bec..626ae4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,54 @@
+live-build (3.0~a57-1ubuntu49) mantic; urgency=medium
+
+ * To avoid removing packaged preferences.d files, in lb_chroot_archives install stage,
+ only remove apt/preferences.d/* files after we backup any existing preferences.d/ files.
+ Then during remove stage or lb_chroot_archives restore the backed up packaged
+ preferences.d files. LP: #2033308
+
+ -- Phil Roche <phil.roche at canonical.com> Tue, 12 Sep 2023 22:36:21 +1200
+
+live-build (3.0~a57-1ubuntu48) mantic; urgency=medium
+
+ * d/patches/umount-sys-properly.patch: fix do_umount to actually unmount the
+ passed mountpoint :/.
+
+ -- Michael Hudson-Doyle <michael.hudson at ubuntu.com> Wed, 30 Aug 2023 08:59:13 +1200
+
+live-build (3.0~a57-1ubuntu47) mantic; urgency=medium
+
+ * d/patches/umount-sys-properly.patch: Unmount any submounts of /sys that
+ have appeared since it was mounted.
+
+ -- Michael Hudson-Doyle <michael.hudson at ubuntu.com> Tue, 29 Aug 2023 20:40:51 +1200
+
+live-build (3.0~a57-1ubuntu46) mantic; urgency=medium
+
+ * debian/patches/ubuntu-kernel-img-conf.patch: drop; kernel-img.conf is
+ obsolete and should no longer be created on new images. LP: #2033110.
+
+ -- Steve Langasek <steve.langasek at ubuntu.com> Mon, 28 Aug 2023 23:18:41 +0000
+
+live-build (3.0~a57-1ubuntu45) mantic; urgency=medium
+
+ * debian/patches/ubuntu-silence-fdisk-noise.patch: silence warning
+ when fdisk is not present.
+
+ -- Steve Langasek <steve.langasek at ubuntu.com> Sat, 26 Aug 2023 16:33:03 -0700
+
+live-build (3.0~a57-1ubuntu44) lunar; urgency=medium
+
+ * lb_chroot_apt: Fix removal handling of apt preferences.d files.
+
+ -- Steve Langasek <steve.langasek at ubuntu.com> Wed, 12 Apr 2023 19:55:37 +0000
+
+live-build (3.0~a57-1ubuntu43) lunar; urgency=medium
+
+ * scripts/build/lb_binary_memtest:
+ - update inspired from Debian #15e78a3e to handle the memtest86+.bin
+ naming changes in the newest version of the package
+
+ -- Sebastien Bacher <seb128 at ubuntu.com> Tue, 22 Nov 2022 21:02:44 +0100
+
live-build (3.0~a57-1ubuntu41) groovy; urgency=medium
* Drop bzip2 from bootstrap package set, this is a long-obsolete
diff --git a/debian/patches/lp-2033308-backup-and-restore-packaged-preferences.patch b/debian/patches/lp-2033308-backup-and-restore-packaged-preferences.patch
new file mode 100644
index 0000000..3e38da1
--- /dev/null
+++ b/debian/patches/lp-2033308-backup-and-restore-packaged-preferences.patch
@@ -0,0 +1,95 @@
+Description:
+ * To avoid removing packaged preferences.d files, in lb_chroot_archives install stage,
+ only remove apt/preferences.d/* files after we backup any existing preferences.d/ files.
+ Then during remove stage or lb_chroot_archives restore the backed up packaged
+ preferences.d files. LP: #2033308
+Author: Phil Roche <phil.roche at canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/2033308
+
+
+Index: live-build-3.0~a57/functions/apt_preferences.sh
+===================================================================
+--- /dev/null
++++ live-build-3.0~a57/functions/apt_preferences.sh
+@@ -0,0 +1,27 @@
++#!/bin/sh
++
++## live-build(7) - System Build Scripts
++## Copyright (C) 2023 Phil Roche <phil.roche at canonical.com>
++##
++## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
++## This is free software, and you are welcome to redistribute it
++## under certain conditions; see COPYING for details.
++
++
++Restore_packaged_apt_preferences ()
++{
++ if [ -d chroot/etc/apt/preferences.d.save ]; then
++ Echo_message "Restoring backed up packaged preferences.d files"
++ mv --verbose chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/
++ rmdir --verbose chroot/etc/apt/preferences.d.save
++ fi
++}
++
++Backup_packaged_apt_preferences ()
++{
++ if [ -n "$(ls -A chroot/etc/apt/preferences.d)" ]; then
++ Echo_message "Backing up packaged preferences.d/* files ..."
++ cp --archive --verbose chroot/etc/apt/preferences.d chroot/etc/apt/preferences.d.save
++ fi
++}
++
+Index: live-build-3.0~a57/scripts/build/lb_chroot_archives
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_archives
++++ live-build-3.0~a57/scripts/build/lb_chroot_archives
+@@ -189,8 +189,12 @@ EOF
+ fi
+ fi
+
+- # probably too bold, needs refinment (FIXME)
+- rm -f chroot/etc/apt/preferences.d/*
++ # Only remove apt/preferences.d/* files after we backup any existing preferences.d/ files
++ # for later restoration
++ Backup_packaged_apt_preferences
++
++ Echo_message "Clean up /etc/apt/preferences.d/* now that we have persisted the existing files for later restoration ..."
++ rm --verbose --force chroot/etc/apt/preferences.d/*
+
+ # Configure third-party archives
+ if [ -n "${LB_ARCHIVES}" ]
+@@ -625,6 +629,11 @@ EOF
+ # Removing stage file
+ rm -f .build/chroot_archives
+
++ # Now that we are exiting early from the remove stage, we still need to cleanup /etc/apt/preferences.d and if
++ # there existed a preferences.d.save directory, move the files back
++ # These were backed up in the install stage before any local preferences were added
++ Restore_packaged_apt_preferences
++
+ exit 0
+ fi
+
+@@ -755,8 +764,9 @@ EOF
+ fi
+ fi
+
+- # probably too bold, needs refinment (FIXME)
+- rm -f chroot/etc/apt/preferences.d/*
++
++ Echo_message "Clean up /etc/apt/preferences.d/*. Any previous packaged files have been backed up to chroot/etc/apt/preferences.d.save in the install stage for later restoration ..."
++ rm --verbose --force chroot/etc/apt/preferences.d/*
+
+ # Configure third-party archives
+ if [ -n "${LB_ARCHIVES}" ]
+@@ -889,6 +899,10 @@ EOF
+ apt-key del ${_LB_LOCAL_KEY_EMAIL}
+ fi
+
++ # If there existed a preferences.d.save directory, move the files back
++ # These were backed up before any local preferences were added
++ Restore_packaged_apt_preferences
++
+ # Removing stage file
+ rm -f .build/chroot_archives
+ ;;
diff --git a/debian/patches/new-memtest-version b/debian/patches/new-memtest-version
new file mode 100644
index 0000000..7b280c8
--- /dev/null
+++ b/debian/patches/new-memtest-version
@@ -0,0 +1,54 @@
+Origin: updated from https://salsa.debian.org/live-team/live-build/-/commit/15e78a3e
+Forwarded: not-needed
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_memtest
++++ live-build-3.0~a57/scripts/build/lb_binary_memtest
+@@ -62,13 +62,14 @@ then
+ fi
+
+ # Checking depends
++MEMTEST_BIN="${LB_MEMTEST}"
+ case "${LB_MEMTEST}" in
+ memtest86)
+ Check_package chroot/boot/memtest86.bin memtest86
+ ;;
+
+ memtest86+)
+- Check_package chroot/boot/memtest86+.bin memtest86+
++ Check_package chroot/usr/share/doc/memtest86+/copyright memtest86+
+ ;;
+ esac
+
+@@ -78,6 +79,19 @@ Restore_cache cache/packages.binary
+ # Installing depends
+ Install_package
+
++case "${LB_MEMTEST}" in
++ memtest86+)
++ case "${LB_BUILD_WITH_CHROOT}" in
++ true)
++ [ -e "chroot/boot/${LB_MEMTEST}x64.bin" ] && _MEMTEST_BIN="${LB_MEMTEST}x64"
++ ;;
++ false)
++ [ -e "/boot/${LB_MEMTEST}x64.bin" ] && _MEMTEST_BIN="${LB_MEMTEST}x64"
++ ;;
++ esac
++ ;;
++esac
++
+ # Setting destination directory
+ case "${LB_INITRAMFS}" in
+ casper)
+@@ -101,11 +115,11 @@ mkdir -p "${DESTDIR}"
+ # Installing memtest
+ case "${LB_BUILD_WITH_CHROOT}" in
+ true)
+- cp chroot/boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
++ cp "chroot/boot/${_MEMTEST_BIN}.bin" "${DESTDIR}"/memtest
+ ;;
+
+ false)
+- cp /boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
++ cp "/boot/${_MEMTEST_BIN}.bin" "${DESTDIR}"/memtest
+ ;;
+ esac
+
diff --git a/debian/patches/series b/debian/patches/series
index 58d4c79..7c27b21 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,7 +5,6 @@ ubuntu-wubi-initramfs-framebuffer.patch
ubuntu-i386-generic-pae.patch
ubuntu-resolvconf.patch
ubuntu-powerpc-smp.patch
-ubuntu-kernel-img-conf.patch
ubuntu-chroot_headers_tidy.patch
ubuntu-package-lists-without-chroot.patch
ubuntu-fix-hooks.patch
@@ -43,3 +42,8 @@ drop-default-initramfs-compression-override.patch
add-riscv64.patch
ubuntu-make-genisoimage-more-flexible.patch
ubuntu-no-bzip2-bootstrap.patch
+new-memtest-version
+ubuntu-apt-preferences.d-removal
+ubuntu-silence-fdisk-noise.patch
+umount-sys-properly.patch
+lp-2033308-backup-and-restore-packaged-preferences.patch
diff --git a/debian/patches/ubuntu-apt-preferences.d-removal b/debian/patches/ubuntu-apt-preferences.d-removal
new file mode 100644
index 0000000..fb3937c
--- /dev/null
+++ b/debian/patches/ubuntu-apt-preferences.d-removal
@@ -0,0 +1,24 @@
+Description: lb_chroot_apt: Fix removal handling of apt preferences.d files.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Forwarded: no
+Last-Update: 2023-04-12
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_apt
++++ live-build-3.0~a57/scripts/build/lb_chroot_apt
+@@ -291,14 +291,8 @@ EOF
+ then
+ for _FILE in config/chroot_apt/*.pref
+ do
+- if [ -f chroot/etc/apt/preferences.d/$(basename ${_FILE}) ]
+- then
+- mv chroot/etc/apt/preferences.d/$(basename ${_FILE}) chroot/etc/apt/preferences.d/$(basename ${_FILE}).orig
+- fi
+-
+- cp -aL ${_FILE} chroot/etc/apt/preferences.d
+-
+- if [ -f chroot/etc/apt/preferences.d/$(basename ${_FILE}) ]
++ rm -f chroot/etc/apt/preferences.d/$(basename ${_FILE})
++ if [ -f chroot/etc/apt/preferences.d/$(basename ${_FILE}).orig ]
+ then
+ mv chroot/etc/apt/preferences.d/$(basename ${_FILE}).orig chroot/etc/apt/preferences.d/$(basename ${_FILE})
+ fi
diff --git a/debian/patches/ubuntu-kernel-img-conf.patch b/debian/patches/ubuntu-kernel-img-conf.patch
deleted file mode 100644
index db373e6..0000000
--- a/debian/patches/ubuntu-kernel-img-conf.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Description: Put kernel symlinks in /boot on some architectures
- This matches base-installer/library.sh more closely.
-Author: Colin Watson <cjwatson at ubuntu.com>
-Bug-Ubuntu: https://bugs.launchpad.net/bugs/958839
-Forwarded: no
-Last-Update: 2012-04-18
-
-Index: b/scripts/build/lb_chroot_linux-image
-===================================================================
---- a/scripts/build/lb_chroot_linux-image
-+++ b/scripts/build/lb_chroot_linux-image
-@@ -118,6 +118,24 @@
-
- fi
-
-+ cat > chroot/etc/kernel-img.conf << EOF
-+# Kernel Image management overrides
-+# See kernel-img.conf(5) for details
-+do_symlinks = yes
-+do_bootloader = no
-+EOF
-+
-+ case "${LB_ARCHITECTURES}" in
-+ alpha|amd64|hppa|i386|ia64|m68k|mips|mipsel)
-+ ;;
-+
-+ *)
-+ cat >> chroot/etc/kernel-img.conf << EOF
-+link_in_boot = yes
-+EOF
-+ ;;
-+ esac
-+
- # Creating stage file
- Create_stagefile .build/chroot_linux-image
- fi
diff --git a/debian/patches/ubuntu-silence-fdisk-noise.patch b/debian/patches/ubuntu-silence-fdisk-noise.patch
new file mode 100644
index 0000000..5220376
--- /dev/null
+++ b/debian/patches/ubuntu-silence-fdisk-noise.patch
@@ -0,0 +1,29 @@
+Description: silence warning when fdisk is not present
+ livefs build logs are FULL of warnings about missing fdisk, one for
+ every invocation of an lb command:
+ .
+ Can't process file /sbin/fdisk
+ .
+ This function is in functions/defaults.sh so is included everywhere.
+ But the only thing that ever uses fdisk in live-build is
+ lb_{source,binary}_hdd, which we don't use in Ubuntu; and live-build
+ could just DEPEND on fdisk but doesn't. Instead it pollutes logs with
+ hundreds of lines warning about the absence of a program nobody has ever
+ missed.
+Author: Steve Langasek <steve.langasek at ubuntu.com>
+Forwarded: not-needed
+Last-Update: 2023-08-26
+
+Index: live-build/functions/defaults.sh
+===================================================================
+--- live-build.orig/functions/defaults.sh
++++ live-build/functions/defaults.sh
+@@ -254,8 +254,6 @@
+ elif [ -x /sbin/fdisk ]
+ then
+ LB_FDISK="fdisk"
+- else
+- Echo_error "Can't process file /sbin/fdisk"
+ fi
+ fi
+
diff --git a/debian/patches/umount-sys-properly.patch b/debian/patches/umount-sys-properly.patch
new file mode 100644
index 0000000..c0e4113
--- /dev/null
+++ b/debian/patches/umount-sys-properly.patch
@@ -0,0 +1,31 @@
+--- a/scripts/build/lb_chroot_sysfs
++++ b/scripts/build/lb_chroot_sysfs
+@@ -30,6 +30,19 @@
+ # Requiring stage file
+ Require_stagefile .build/config .build/bootstrap
+
++do_umount () {
++ mountpoint=$(realpath "$1")
++
++ # ensure we have no trailing slashes, and escape all slashes for awk
++ mountpoint_match=$(echo "$mountpoint" | sed -e's,/$,,; s,/,\\/,g;')
++ # sort -r ensures that deeper mountpoints are unmounted first
++ for submount in $(awk </proc/self/mounts "\$2 ~ /$mountpoint_match/ \
++ { print \$2 }" | LC_ALL=C sort -r); do
++ ${LB_ROOT_COMMAND} mount --make-private "$submount"
++ ${LB_ROOT_COMMAND} umount "$submount"
++ done
++}
++
+ case "${1}" in
+ install)
+ Echo_message "Begin mounting /sys..."
+@@ -74,7 +87,7 @@
+ #fuser -km chroot/sys
+ if [ -e chroot/sys/class ]
+ then
+- ${LB_ROOT_COMMAND} umount chroot/sys
++ do_umount chroot/sys
+ fi
+ else
+ rm -rf chroot/sys
More information about the Neon-commits
mailing list