[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: merged /usr



Hi,

On 7/27/21 11:44 AM, Wouter Verhelst wrote:

A package in the essential set could work around the issue by moving a
file around and creating a necessary symlink in preinst rather than
shipping things. The set of Essential packages is small however, and
most packages can ship a compat symlink.

In debootstrap (which is the important use case for Essential packages and their constraints), all Essential packages are unpacked first, and then, individually, their preinst is run, the files unpacked again (this time from dpkg), and then we're in normal dpkg land, although in a chroot.

So the concept of a preinst script for an Essential package is wobbly at best. For debootstrap --foreign, this might be even more complicated.

Also, take care when moving shell commands from a shell script: the bash shell at least keeps a cache of commands to paths so it doesn't have to do a full path search every time. A shell script that calls

    mv /bin/cp /usr/bin/cp
    ln -s ../usr/bin/cp bin/cp
    mv /bin/ln /usr/bin/ln
    ln -s ../usr/bin/ln bin/ln

could fall over because it cached the location of "ln" as /bin/ln in the beginning, then after the move cannot find it anymore. That needs at least a "hash -d ln".

   Simon

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: