1 |
Alexis Ballier posted on Mon, 04 Apr 2016 09:12:16 +0200 as excerpted: |
2 |
|
3 |
>> The /usr merge is a separate issue, which I agree with as well, but |
4 |
>> that was never brought to council, and it is controversial in the |
5 |
>> Gentoo camp because some folks claim fhs doesn't allow it. |
6 |
> |
7 |
> Getting a bit OT, but can you explain in what ways it violates fhs ? |
8 |
> What worries me more about /usr merge is that I've never seen a plan for |
9 |
> it. I think it'd be necessary to have portage gain some intra-package |
10 |
> collision check (e.g. a package installing /bin/foo and /usr/bin/foo |
11 |
> should be reported), which would then allow building /usr-merged stages, |
12 |
> but the main issue for me is how to migrate installed systems properly. |
13 |
|
14 |
FWIW, I actually run a (reverse) merged /usr here, along with the bin/sbin |
15 |
merge. |
16 |
|
17 |
Obviously it's symlinks as the packages still install where they will |
18 |
install, but: |
19 |
|
20 |
/usr -> . |
21 |
/sbin -> bin |
22 |
|
23 |
As a result I have the following "semi-flattened" directory structure |
24 |
directly on /, including everything that would normally be under /usr: |
25 |
|
26 |
/bin |
27 |
/boot |
28 |
/dev |
29 |
/etc |
30 |
/games -> . |
31 |
/home |
32 |
/include |
33 |
/lib -> /lib64 |
34 |
/lib64 |
35 |
/libexec |
36 |
/local |
37 |
/media |
38 |
/proc |
39 |
/root |
40 |
/run |
41 |
/sbin -> bin |
42 |
/share |
43 |
/src |
44 |
/srv |
45 |
/sys |
46 |
/tmp |
47 |
/usr -> . |
48 |
/var |
49 |
/x86_64-pc-linux-gnu |
50 |
|
51 |
(That excludes some unrelated additional changes of my own, again mostly |
52 |
to shorten paths, such as /home actually being /home -> /h (/h being the |
53 |
actual mountpoint for what would normally be /home in fstab), /local, |
54 |
what would be /usr/local, actually being /local -> /l, and /var/log -> / |
55 |
lg (with /lg being a mountpoint as well, isolating logs and keeping |
56 |
runaway logging from creating havoc on anything but /lg itself).) |
57 |
|
58 |
|
59 |
You will be glad to note that portage has in fact been smart enough to |
60 |
avoid symlinks overwriting the files they would normally point at for |
61 |
quite some time -- in fact, I specifically asked about this on the |
62 |
portage list before I tried it myself. So that's not a problem at all. |
63 |
|
64 |
There are, however, occasional bugs when specific packages try to clean |
65 |
up old versions and end up deleting the new version instead, because they |
66 |
don't dereference symlinks to a canonical path before they do the rm. |
67 |
One current example of that is gcc-config: |
68 |
|
69 |
[Bug 554334] sys-devel/gcc-config pkg-postinst rm -f /usr/sbin/gcc-config |
70 |
breaks when using /usr/sbin->bin symlinks |
71 |
|
72 |
https://bugs.gentoo.org/show_bug.cgi?id=554334 |
73 |
|
74 |
The result of that bug is that gcc-config deletes its own executable. |
75 |
However, it's worth repeating that the bug is because the ebuild itself |
76 |
executes rm -f on an arbitrary path without resolving both it and the |
77 |
canonical path of its executable and comparing them -- it's not a bug in |
78 |
portage itself, portage itself behaves correctly in terms of resolving to |
79 |
canonical paths. |
80 |
|
81 |
Fortunately for me, while that bug has been open for 8 months+, my sync |
82 |
script can automatically patch ebuilds using patches in /etc/portage/ |
83 |
patches.ebuild, much like the portage implementation of eapply_user |
84 |
patches sources with patches found in /etc/portage/patches. So now I've |
85 |
worked around that bug by patching out the offending rm line in the |
86 |
ebuild. Hey, when eight months and counting later a critical bug in a |
87 |
toolchain package remains open, a good gentooer tends to find |
88 |
workarounds. What can I say? |
89 |
|
90 |
|
91 |
Packages that use cmake can sometimes have issues too, depending on the |
92 |
version of cmake, as it apparently doesn't always properly resolve to |
93 |
canonical paths. As I'm a kde5/plasma user and one such affected package |
94 |
has been baloo, a plasma dependency, that has been a headache for me. |
95 |
But being a USE=-semantic-desktop user in the kde4 era, I didn't really |
96 |
want baloo on my system anyway, so rather than spend the time researching |
97 |
how to fix the bad cmake/symlinks interaction, I was motivated to |
98 |
research killing the baloo deps instead, and ultimately source-patched |
99 |
(as opposed to ebuild-patched, as I did gcc-config) the two plasma |
100 |
packages requiring it to kill the baloo-based modules. With the sources |
101 |
patched to no longer require baloo, I simply placed a baloo null-package |
102 |
in my overlay (the other alternatives would be package.provided, but |
103 |
that's deprecated, or to use the ebuild patching sync-script mentioned |
104 |
above to delete the baloo-deps in the ebuild) to fill the ebuild |
105 |
dependency, and that's what I'm running with today. |
106 |
|
107 |
The merged /usr and bin/sbin cmake related bugs I've filed are: |
108 |
|
109 |
cmake/baloo: https://bugs.gentoo.org/show_bug.cgi?id=561956 |
110 |
|
111 |
(Unrelated to /usr or bin/sbin merge but mentioned above as my resolution |
112 |
for the cmake/baloo bug, the no-baloo patches bug: |
113 |
https://bugs.gentoo.org/show_bug.cgi?id=578664 ) |
114 |
|
115 |
Older cmake/libraw bug, resolved with newer versions of one or the other: |
116 |
https://bugs.gentoo.org/show_bug.cgi?id=532426 |
117 |
|
118 |
Older plasma5 plasma-desktop bug that kept the plasma5 desktop from |
119 |
coming up properly, as I was switching to it from kde/plasma4, so I'm not |
120 |
sure if it was a regression from earlier plasma5 or not. Fixed in |
121 |
current plasma: https://bugs.gentoo.org/show_bug.cgi?id=570210 |
122 |
|
123 |
IIRC I had one other /usr or bin/sbin related bug a couple years ago |
124 |
shortly after I first did the merge, but IDR what it was well enough to |
125 |
search my bugmail archive for it and get a link. |
126 |
|
127 |
With nearly 1000 packages installed and 316 listed in various sets found |
128 |
in my world_sets file, that's all the /usr and bin/sbin merge bugs I've |
129 |
seen in what I'd guess to be two years plus of running merged, so it's |
130 |
obviously not a common problem at all. |
131 |
|
132 |
And of course if gentoo more officially supported the /usr and bin/sbin |
133 |
merges, I'd have probably never seen half those bugs, as they'd have been |
134 |
caught before I ever saw them, even on ~arch. Tho of course there'd be |
135 |
other bugs filed by others, for packages I don't have installed here. |
136 |
|
137 |
But a merge-related bug is still relatively rare. It's gotta be less |
138 |
than half the bugs I file and I'd guess 20% or less, and my setup is rare |
139 |
enough that were it mainstream, most users, certainly by stable, would be |
140 |
unlikely to ever see a /usr or bin/sbin merge related bug at all. |
141 |
|
142 |
-- |
143 |
Duncan - List replies preferred. No HTML msgs. |
144 |
"Every nonfree program has a lord, a master -- |
145 |
and if you use the program, he is your master." Richard Stallman |