Gentoo Archives: gentoo-dev

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Making a common sub-profile for no-multilib
Date: Thu, 03 Jul 2014 05:10:15
Message-Id: pan$93a7b$49b3d035$39a407f5$773fbe07@cox.net
In Reply to: [gentoo-dev] Re: Making a common sub-profile for no-multilib by Jonathan Callen
1 Jonathan Callen posted on Wed, 02 Jul 2014 19:06:59 -0400 as excerpted:
2
3 > On 07/02/2014 02:14 PM, Duncan wrote:
4 >> Rich Freeman posted on Wed, 02 Jul 2014 09:30:50 -0400 as excerpted:
5 >>
6 >>> Some things to think about include multilib (just another arch?),
7 >>> systemd, and usr-merge.
8 >>
9 >> FWIW, systemd with merge to / (/usr being a symlink to . and sbin to
10 >> bin) here. In particular, the merge "just works" with current portage.
11 >> I'm no-multilib.
12 >>
13 > That merge only works because you happened to get lucky, and have
14 > portage merge coreutils in a particular manner (/usr/bin/uname installed
15 > before /bin/uname). If portage had installed /bin/uname first, you
16 > would have ended up with a /bin/uname symlink pointing to /bin/uname.
17 > The same is also true of basename, chroot, cut, dir, dirname, du, env,
18 > expr, head, mkfifo, mktemp, readlink, seq, sleep, sort, tail, touch, tr,
19 > tty, vdir, wc, and yes.
20
21 No, it works because, as I specifically asked the portage folks about
22 before I tried it, portage has had symlink merge intelligence for some
23 time now. Apparently well before I asked (in May, 2013, according to my
24 portage-devel list archives), some portage dev considered the possibility
25 of directory symlinks triggering overwrites of targets with the symlinks
26 pointing to them, and ensured that portage's qmerge code "just did the
27 right thing."
28
29 I did nothing with the answer for some time, but eventually decided to
30 try it. As I was a bit skeptical/careful at first, after doing the
31 initial manual moves and thus finding which files existed in both target
32 dirs, then deleting the individual file symlinks, moving the remaining
33 files to the new location and making the old directory a symlink, I
34 equery-belonged the symlinks and manually remerged (from binpkg, which
35 still stores the symlinks in their usual location in the binpkg tarball)
36 several of the packages one at a time, first a non-critical one, then I
37 think coreutils itself, just to be sure, then 2-3 others together, and
38 sure enough, it "just worked" the way it was supposed to work.
39
40 =:^)
41
42 > I myself am currently running a system with the opposite merge (/bin,
43 > /lib, /lib64, and /sbin are symlinks to /usr/bin, /usr/lib, /usr/lib64,
44 > and /usr/sbin) although I do not yet have the sbin -> bin merge yet.
45
46 FWIW I decided the single /usr -> . symlink was simpler, and besides, I
47 liked the shorter direct paths. =:^) And I did the /usr merge first,
48 thinking I wanted to keep the bin/sbin distinction at first, until
49 sometime later I decided to simplify my PATH var to remove /usr, and
50 realized I had sbin in my normal user's PATH too. Completing the merge
51 would/did allow me to simplify PATH even further, and since I has sbin in
52 my normal user's PATH, there really wasn't a reason to keep them separate
53 at that point, and I was already comfortable with merged bins by then
54 anyway, so it wasn't much of a stretch at all.
55
56 > I
57 > added a post_src_install and post_pkg_preinst hook in my
58 > /etc/portage/bashrc to ensure that there are no conflicts before the
59 > package is merged and a pre_pkg_setup hook to disarm gen_usr_ldscript
60 > (so as not to create a conflict).
61
62 That's all unnecessary, because as I said, in general portage "just
63 works" with the merge now, since it's designed to work with pretty much
64 /any/ strange site-specific symlinking local gentoo admins might throw at
65 it, altho I expect the ldcache stuff is still doing a bunch of extra work
66 by going over all the dirs that are actually the same thing, and I
67 suspect revdep-rebuild (which I still run religiously after every @world
68 update) is doing a bunch of extra scanning too. But as I'm on SSD the
69 extra filesystem IO isn't a big issue, meaning it's simply the CPU cycle
70 cost, and so far simply spending the extra CPU cycles has been cheaper
71 for me than actually researching what I might do about it, so...
72
73 > The only two packages I have installed that I had to modify to make this
74 > work were coreutils (as noted above) and plymouth.
75
76 I did find one package with a specific post-install quirk, that was there
77 to work around a binary move from many years ago, that ended up
78 specifically removing the binary after portage had done its thing and
79 actually put the binary in place instead of the symlink, but that binary
80 wasn't a system-critical binary (dircolors, FWIW, pkg=coreutils), and
81 upon investigation and filing a bug suggesting to test that it was a
82 symlink, not the actual binary removed, the maintainer (vapier) decided
83 that the reason that particular post-install quirk was there was far
84 enough back in history he could just remove it from the ebuild. I didn't
85 check whether he removed it from stable, but at least leading ~arch
86 coreutils doesn't have that quirk any longer, and leaves dircolors alone.
87
88 FWIW, https://bugs.gentoo.org/show_bug.cgi?id=509596
89
90
91 The only other relatively minor irritation that remains is a portage bug,
92 but as I said it's relatively minor as it doesn't affect functionality.
93
94 But what it /does/ mean is that for nearly EVERY package upgrade, I have
95 an identical message complaining about /usr being a possibly stale
96 symlink, with no easy/apparent way to quite the warning using
97 UNINSTALL_IGNORE, as I can and have with other symlinks such as
98 /var/run -> run, etc.
99
100 When it stops being a relatively minor irritation and gets big enough to
101 really annoy me (if simply mentioning it here doesn't get it fixed before
102 I actually get to that point), I'll file a bug on it and I expect that
103 annoyance will go away as well. =:^)
104
105 --
106 Duncan - List replies preferred. No HTML msgs.
107 "Every nonfree program has a lord, a master --
108 and if you use the program, he is your master." Richard Stallman

Replies

Subject Author
[gentoo-dev] Re: Making a common sub-profile for no-multilib Jonathan Callen <jcallen@g.o>