Draft: Removed dpkg-divert via symlink path
Hi, this is my first time using GitLab and I think this Merge Request definitely should have been an Issue, but I can not figure out how to create one so here goes. The changes in this MR shows the "solution" to the problems I am seeing but I am not quite sure what the implications are. So see this as more of a question/discussion rather that a thoroughly tested and insightfully crafted bugfix.
I am building a netboot image for Ubuntu 22.04 with this auto/config:
#!/bin/sh
lb config noauto \
--mode ubuntu \
--system live \
--distribution jammy \
--archive-areas "main restricted universe multiverse" \
--memtest memtest86+ \
--initramfs live-boot \
--linux-flavours 5.15.0-126-generic \
--initsystem systemd \
--chroot-filesystem squashfs \
--build-with-chroot true \
--debootstrap-options "--keyring=/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg" \
--cache false \
--cache-stages "" \
--cache-indices false \
--cache-packages false \
--apt apt-get \
--apt-secure true \
--apt-indices false \
--apt-recommends true \
--apt-source-archives false \
--backports false \
--security true \
--source false \
--updates true \
--parent-mirror-bootstrap https://artifactory/artifactory/ubuntu.com-snapshots-generic-se/241202/ubuntu \
--parent-mirror-chroot https://artifactory/artifactory/ubuntu.com-snapshots-generic-se/241202/ubuntu \
--parent-mirror-binary https://artifactory/artifactory/ubuntu.com-snapshots-generic-se/241202/ubuntu \
--net-tarball false \
--binary-image netboot \
"${@}"
When the build comes to the chroot_dpkg step I get this error:
[2024-12-20 13:34:58] lb chroot_dpkg remove
P: Deconfiguring file /sbin/start-stop-daemon
dpkg-divert: error: rename involves overwriting '/usr/sbin/start-stop-daemon' with
different file '/usr/sbin/start-stop-daemon.distrib', not allowed
E: An unexpected failure occurred, exiting...
P: Begin unmounting filesystems...
P: Saving caches...
Removing the dpkg-divert that this MR contains makes the problem go away and the build finishes successfully. Note that the removed line is not the one failing but the line after. They both point to the same file since /sbin
is a symlink to /usr/sbin
. Maybe it is not needed to do dpkg-divert twice?
The weird thing is that if I go into the failing build and run the lb chroot_dpkg
task manually everything works fine. If I run the whole build from the top with lb config
followed by lb build
everything also works fine. But a lb clean
will make the next run fail in the way described above.
Is there something I can, or should, do differently? The issue appeared with the latest debian%20240810 tag where there were some changes made to the chroot_dpkg file.