Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 203687 - Support symlinks bin -> usr/bin and lib -> usr/lib
Summary: Support symlinks bin -> usr/bin and lib -> usr/lib
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-29 15:43 UTC by Matthias B.
Modified: 2011-10-26 22:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias B. 2007-12-29 15:43:44 UTC
When I have everything on one partition (as I usually do for workstation installations), I prefer to have only one lib and one bin directory. Gentoo already has /usr/X11R6 as symlink to ../usr but I take it one step further and symlink bin -> usr/bin and lib -> usr/lib. I've been doing this for years and it's saved me a lot of which'ing around, it gives me the good feeling of always knowing where my stuff is, I never have the problem that some package/script expects a file in the wrong bin directory,.... Now that I've switched from LFS to Gentoo I naturally want to keep this layout, but it proves to be more painful than I expected. When installing libraries, Gentoo creates dummy libraries (gen_usr_ldscript) and some packages (e.g. wpa_supplicant) have symlinks to make their binaries appear in both bin directories. 

Not only are those crutches not necessary when bin and lib are symlinked with /usr/bin and /usr/lib, they're even harmful, because when merging, the dummy libraries and symlinks will happily overwrite the real libraries and binaries.

My feature request ist to make the merge step smart enough to recognize the case that 2 files from the same package will install to the same target location, and in that case if one of the conflicting files is a symlink, the non-symlink should take preference. Likewise for libraries, if one of the conflicting libraries is just a linker script, the real library should take preference. 

Another way to deal with the library case would be to provide a switch to disable gen_usr_ldscript or even better to make gen_usr_ldscript smart enough to automatically realize that $ROOT/usr/lib and $ROOT/lib are the same directory and to do nothing in that case (the smartness would have to be put into the QA check, too, to avoid spurious QA notices).

The way I currently solve the problem is with a custom prepall script that scans for conflicts and resolves them.

Reproducible: Always

Steps to Reproduce:
Comment 1 SpanKY gentoo-dev 2007-12-29 16:12:39 UTC
while true, when you only have 1 bin/lib directory, things will collide, this is an issue to be taken up on the gentoo-dev mailing list to see if we care in general (i know i dont)

this certainly is not a portage bug

making gen_usr_ldscript change its behavior based on $ROOT is wrong.  that breaks accepted methodology (packages in src_* should never peek in $ROOT).
Comment 2 Martin von Gagern 2011-10-26 21:14:20 UTC
It should be possible to write a /etc/portage/bashrc with a post_src_install function that does the required magic: compare dirs, resolve conflicts as described. Possibly die if any conflicts cannot be resolved this way.

This should provide a working solution for those few people using such setups, without burdening common gentoo setups with code or performance penalties for this.
Comment 3 SpanKY gentoo-dev 2011-10-26 22:16:32 UTC
use a mount bind and be done with it:
mount --bind /bin /usr/bin
mount --bind /sbin /usr/sbin