Hello Helmut,

On 02/08/2024 15:48, Helmut Grohne wrote:
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.

There is another bit of information that I didn't share yet: these diversions are only temporary. The diversions are made during the construction of the live image (when other packages are installed and the packages that have diversions will not upgrade), and reverted before the image is finalised. They are not present inside the live images. They 'only' serve the purpose of saving time by performing a no-op during the construction of the live image.

Since during the construction the symlinks work properly and there are no upgrades in the mean time, do we need to patch anything at all?

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.

Ah, I (erroneously) thought that the whole purpose of moving the files to /usr was to (eventually) get rid of the symlinks (in forky+N).

With kind regards,
Roland Clobus

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to