Skip to content

implement merged-/usr by post-merging

Helmut Grohne requested to merge helmutg/debootstrap:bootstrap-protocol into master

The implementation of merged-/usr in debootstrap currently creates the aliasing symlinks prior to initial unpack. Since it also passes -k to tar, this method will fail once base-files ships the aliasing symlinks. To avoid this failure, we swap the initial unpack and the /usr-merge. Shipping these links in a package is a mitigation (DEP17-M4) to avoid accidentally deleting the aliasing links during a package upgrade (DEP17-P9).

This swap comes at a complexity. Earlier we only had to create a few directories and a few symlinks in an empty tree, but after unpack, we have to actually perform the same task as the usrmerge package without the atomicity requirement.

On the flip side, this swap allows us to determine the required multilib directories from the unpacked filesystem tree rather than hard coding them into debootstrap.

This post-merging implementation also comes with other limitations.

  • We assume that there are no non-directory conflicts between files in / and files in /usr. This property is required by Debian policy 10.1.
  • We assume that all symbolic links to be merged are either absolute or point below the location it points from. This is a little stronger than what Debian policy 10.5 requires, but we only need this for the essential package set and it happens to be the case. In the event that this turns out to be problematic, the code may be extended to cover this case.

Merge request reports

Loading