Hi Roland, On Fri, Aug 02, 2024 at 03:01:51PM +0200, Roland Clobus wrote: > I've prepared a MR which takes a different approach. > https://salsa.debian.org/live-team/live-build/-/merge_requests/359
Thank you for working on this matter. > Since the support of live-build starts from bullseye, and symlinks are > present since then, should using only '/usr/X' be sufficient? The unfortunate answer is "no". dpkg-diversions apply to the path as seen by the dpkg database only and are not affected by symlinks such as /bin -> usr/bin. Even if the symlink moves /bin/hostname to /usr/bin/hostname, as long as hostname is still named as /bin/hostname in the hostname package, it can only be diverted via /bin/hostname. As long as you want to support bullseye or bookworm, the diversions should be duplicated. > I was able to generate functional ISO images for bullseye, bookworm, trixie > and sid. Despite me claiming your MR to be buggy, this test result of yours is plausible. > Since the live-build scripts do no need an upgrade (they are used for fixed > version) do I need the doubled diversion? You convey a very crucial bit of information in this question. The diversions (doubled or not) are only really needed for upgrading. If you just create a chroot and then replace a few files normally owned some package and you never intend to use the package manager again, the benefit of using a diversion becomes questionable. It is not clear to me whether you install or upgrade packages after setting up diversions. If you do, you should keep and double diversions (as long as bookworm is supported in live-build). If you do not, you may just overwrite the files without doing any diversions. > Also: do I need to update all shebangs from `/bin/sh` to `/usr/bin/sh` as > well? Please don't. You already changed more places than I recommend to change. What really needs to change is the placement of files in the data.tar inside Debian binary packages (to eliminate aliasing problems). As a result of this move, the diversions need to be duplicated. However, accessing files can use either path and I recommend leaving such references as is. We will forever rely on the aliasing links. For instance, the dynamic loader explicitly uses an aliased path. Hence there is little benefit in referencing files via their /usr paths. For instance, `Chroot chroot "/bin/bash --login"` and `Check_package host /sbin/fdisk fdisk` are still fully valid. Would you reconsider my patch with this explanation? Helmut