Bug#1064408: [PATCH] duplicate aliased diversions for DEP17

2024-02-21 Thread Helmut Grohne
Package: live-build
Versrion: 1:20230502
User: helm...@debian.org
Usertags: dep17p3
Tags: patch

/bin/hostname and /sbin/start-stop-daemon are being moved from / to /usr
in trixie. Hence, these diversions become ineffective. Temporarily add
both diversions to handle both variants.
---
 scripts/build/chroot_dpkg | 15 ---
 scripts/build/chroot_hostname | 17 +
 2 files changed, 25 insertions(+), 7 deletions(-)

I note that while live-build has MRs on salsa, I cannot seem to create
one. Hence sending a patch via bugs.d.o.

diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg
index c43c0eb01..d64820f72 100755
--- a/scripts/build/chroot_dpkg
+++ b/scripts/build/chroot_dpkg
@@ -38,8 +38,14 @@ case "${_ACTION}" in
Acquire_lockfile
 
# Create custom start-stop-daemon program
-   Chroot chroot dpkg-divert --rename --quiet --add 
/sbin/start-stop-daemon
-   ln -fs /bin/true chroot/sbin/start-stop-daemon
+   Chroot chroot dpkg-divert --rename --quiet --add 
/usr/sbin/start-stop-daemon
+   # begin-remove-after: released:trixie
+   # In the bookworm to trixie upgrade, dpkg moves
+   # start-stop-daemon from /sbin to /usr/sbin. Duplicate the
+   # diversion to cover both. DEP17 P3 M18
+   Chroot chroot dpkg-divert --rename --quiet --add --divert 
/sbin/start-stop-daemon.distrib.usr-is-merged
+   # end-remove-after
+   ln -fs /bin/true chroot/usr/sbin/start-stop-daemon
 
# Disable dpkg syncing
 
@@ -79,8 +85,11 @@ EOF
Chroot chroot dpkg-divert --rename --quiet --remove 
/usr/sbin/flash-kernel
 
# Remove custom start-stop-daemon program
-   rm -f chroot/sbin/start-stop-daemon
+   rm -f chroot/usr/sbin/start-stop-daemon
+   # begin-remove-after: released:trixie
Chroot chroot dpkg-divert --rename --quiet --remove 
/sbin/start-stop-daemon
+   # end-remove-after
+   Chroot chroot dpkg-divert --rename --quiet --remove 
/usr/sbin/start-stop-daemon
 
# Remove dpkg sync configuration
rm -f chroot/etc/dpkg/dpkg.cfg.d/live-build
diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname
index 836ce09bb..befe58f43 100755
--- a/scripts/build/chroot_hostname
+++ b/scripts/build/chroot_hostname
@@ -43,15 +43,21 @@ case "${_ACTION}" in
# Create custom hostname
Echo_message "Configuring file /bin/hostname"
 
-   Chroot chroot dpkg-divert --rename --quiet --add /bin/hostname
-
-cat > chroot/bin/hostname << EOF
+   Chroot chroot dpkg-divert --rename --quiet --add 
/usr/bin/hostname
+   # begin-remove-after: released:trixie
+   # In the bookworm to trixie upgrade, hostname moves hostname
+   # from /bin to /usr/bin. Duplicate the diversion to cover both.
+   # DEP17 P3 M18
+   Chroot chroot dpkg-divert --rename --quiet --add --divert 
/bin/hostname.distrib.usr-is-merged /bin/hostname
+   # end-remove-after
+
+cat > chroot/usr/bin/hostname << EOF
 #!/bin/sh
 
 echo "localhost.localdomain"
 EOF
 
-   chmod 755 chroot/bin/hostname
+   chmod 755 chroot/usr/bin/hostname
 
# Creating stage file
Create_stagefile
@@ -84,7 +90,10 @@ EOF
 
# Remove custom hostname
rm -f chroot/bin/hostname
+   # begin-remove-after: released:trixie
Chroot chroot dpkg-divert --rename --quiet --remove 
/bin/hostname
+   # end-remove-after
+   Chroot chroot dpkg-divert --rename --quiet --remove 
/usr/bin/hostname
 
# Removing stage file
Remove_stagefile
-- 
2.39.2



Bug#887278: live-build should depend on e2fsprogs explicitly

2018-01-14 Thread Helmut Grohne
Package: live-build
Version: 1:20171207
User: helm...@debian.org
Usertags: nonessentiale2fsprogs

Dear maintainer,

We want to make removing e2fsprogs from installations possible. For standard
installations this is not useful, but embedded applications and chroots benefit
from such an option.  For getting there all packages that use e2fsprogs must be
identified and gain a dependency on it as e2fsprogs currently is essential.

live-build was identified as potentially needing such a dependency,
because it mentions tool names from e2fsprogs in the following files:

/usr/share/live/build/functions/losetup.sh contains mke2fs. According to file 
it is a POSIX shell script, ASCII text executable

Please investigate whether these cases are actually uses of a tool from
e2fsprogs. Care has been taken to shrink the number of candidates as much as
possible, but a few false positives will remain. After doing so, do one of the
following:

 * Add e2fsprogs to Depends.
 * Add e2fsprogs to Recommends.
 * Close this bug explaining why e2fsprogs is not used by this package.

Once e2fsprogs drops the "Essential: yes" flag, this bug will be upgraded to RC
severity. Please note that lintian will warn about such a dependency before
lintian 2.5.56.

Thanks for your help

Helmut