duplicate aliased diversions for DEP17

/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.

Closes: #1064408
This commit is contained in:
Helmut Grohne 2024-08-09 23:53:02 +01:00 committed by Luca Boccassi
parent 24bfe093f8
commit 0eb97d9c36
2 changed files with 24 additions and 6 deletions

View File

@ -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:forky
# 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 /sbin/start-stop-daemon
# 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:forky
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

View File

@ -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
Chroot chroot dpkg-divert --rename --quiet --add /usr/bin/hostname
# begin-remove-after: released:forky
# 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/bin/hostname << EOF
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:forky
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