Hi,

On 8/24/21 2:48 AM, Theodore Ts'o wrote:

So.... in theory, if we had a program which looked for the top-level
symlinks /{bin,lib,sbin} -> /usr/{bin,lib,sbin}, and if they exist,
scans dpkg database is scanned looking for of the form
/{bin,lib,sbin}/$1, and updates them with /usr/{bin,lib,sbin}/$1, and
then in the future, if dpkg sees the top-level symlink, canonicalizes
any files referenced in the packages to /usr/{bin,lib,sbin}/$1, with a
fallback searching for /{bin,lib,sbin}/$1 in the file system, this
would solve the problem.

Yes. To apply the transformation, this would likely have to happen in the dpkg package itself, so the one-time transformation is applied only when dpkg can maintain the workaround from that point on.

That is the half that is missing from my proposal, as I was focusing on how to transition non-usrmerged systems from within dpkg.

Let's ignore how we would deploy this helper program and the update
dpkg from a stable upgrade perspective, but in terms of preventing
potential problems during the testing window, getting an update to
dpkg which included the database fixup program and which ran from the
maintainer script would be a potential solution path.

Yes-ish. We'd also need to make sure that installing the usrmerge package after that dpkg upgrade does not make things inconsistent again, so it would make sense for the dpkg source package to provide a "usrmerge" package that is well integrated, and for dpkg to conflict with older versions of usrmerge.

Furthermore, if dpkg knew to always canonicalize filenames from
/{bin,lib,sbin}/XXX to /usr/{bin,lib,sbin}XXX when adding to the
database, and when it looked for files in the file system looked first
in /usr/{bin,lib,sbin}/XXX, with a fallback to /usr/{bin,lib,sbin}/XXX
the file names in the package would not need to change all, since all
of the magic fixup work would be happening inside dpkg.

Yes. In an ideal world, we wouldn't hardcode the list of symlinks in dpkg though, that's why I proposed shipping symlinks in base-files and having dpkg recognize the symlink-vs-directory conflict as intent to move a filesystem tree around.

   Simon

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to