Bug 6439

Summary: package gzip tries to use hard links between /bin and /usr/bin
Product: [Runtime] General Runtime Reporter: Paul Gortmaker <paulg>
Component: General RuntimeAssignee: Randy MacLeod <randy.macleod>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Low CC: richard.purdie
Version: 1.7   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Gortmaker 2014-06-12 18:10:38 UTC
A common deployment is to have the root dir (i.e. / which contains /lib /bin /etc and so on) on a separate partition than /usr  (and possibly /usr being shared over NFS or similar, or on a separate partition)

However when I tried to deploy such a yocto rootfs, with / on sda1 and /usr on sdb1, I got the following error:

# tar --numeric-owner -xpf ~/yocto-builder-intel-corei7-64.tar.bz2
tar: ./bin/gunzip.gzip: Cannot hard link to `./usr/bin/uncompress': Invalid cross-device link
tar: Exiting with failure status due to previous errors
#

Looking in the tarball, I see the following:

hrwxr-xr-x root/root            0 2014-06-11 14:52 ./bin/gunzip.gzip link to ./usr/bin/uncompress
lrwxrwxrwx root/root            0 2014-06-12 10:58 ./bin/zcat -> /bin/zcat.gzip
lrwxrwxrwx root/root            0 2014-06-12 10:58 ./bin/gunzip -> /bin/gunzip.gzip
lrwxrwxrwx root/root            0 2014-06-12 10:58 ./bin/gzip -> /bin/gzip.gzip

Note that there are three perfectly normal symlinks, and one offending hardlink which crosses the /bin vs. /usr/bin boundary.  If it was also a symlink, this would not be a problem.

Workaround is to manually create the softlink after seeing the deployment error.
Comment 1 Richard Purdie 2014-06-19 14:36:44 UTC
I've previously asked that rather than fixing these issues piecemeal, we come up with a comprehensive plan for the / and /usr split. WindRiver are the people we keep hearing request for this support from.
Comment 2 Randy MacLeod 2017-08-03 13:34:15 UTC
We do not have anyone that requires this feature (separate root and usr). Most linux distros are going this way so it seems pointless to resist the trend. There a good summary of the Debian rational and starting point to read more here:
   https://lwn.net/Articles/670071/