Gentoo Archives: gentoo-dev

From: Jonathan Callen <jcallen@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: Making a common sub-profile for no-multilib
Date: Thu, 03 Jul 2014 07:05:55
Message-Id: 53B500CA.4080609@gentoo.org
In Reply to: [gentoo-dev] Re: Making a common sub-profile for no-multilib by Duncan <1i5t5.duncan@cox.net>
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA512
3
4 On 07/03/2014 12:59 AM, Duncan wrote:
5 > Jonathan Callen posted on Wed, 02 Jul 2014 19:06:59 -0400 as
6 > excerpted:
7 >
8 >> On 07/02/2014 02:14 PM, Duncan wrote:
9 >>> Rich Freeman posted on Wed, 02 Jul 2014 09:30:50 -0400 as
10 >>> excerpted:
11 >>>
12 >>>> Some things to think about include multilib (just another
13 >>>> arch?), systemd, and usr-merge.
14 >>>
15 >>> FWIW, systemd with merge to / (/usr being a symlink to . and
16 >>> sbin to bin) here. In particular, the merge "just works" with
17 >>> current portage. I'm no-multilib.
18 >>>
19 >> That merge only works because you happened to get lucky, and
20 >> have portage merge coreutils in a particular manner
21 >> (/usr/bin/uname installed before /bin/uname). If portage had
22 >> installed /bin/uname first, you would have ended up with a
23 >> /bin/uname symlink pointing to /bin/uname. The same is also true
24 >> of basename, chroot, cut, dir, dirname, du, env, expr, head,
25 >> mkfifo, mktemp, readlink, seq, sleep, sort, tail, touch, tr, tty,
26 >> vdir, wc, and yes.
27 >
28 > No, it works because, as I specifically asked the portage folks
29 > about before I tried it, portage has had symlink merge intelligence
30 > for some time now. Apparently well before I asked (in May, 2013,
31 > according to my portage-devel list archives), some portage dev
32 > considered the possibility of directory symlinks triggering
33 > overwrites of targets with the symlinks pointing to them, and
34 > ensured that portage's qmerge code "just did the right thing."
35 >
36 > I did nothing with the answer for some time, but eventually decided
37 > to try it. As I was a bit skeptical/careful at first, after doing
38 > the initial manual moves and thus finding which files existed in
39 > both target dirs, then deleting the individual file symlinks,
40 > moving the remaining files to the new location and making the old
41 > directory a symlink, I equery-belonged the symlinks and manually
42 > remerged (from binpkg, which still stores the symlinks in their
43 > usual location in the binpkg tarball) several of the packages one
44 > at a time, first a non-critical one, then I think coreutils itself,
45 > just to be sure, then 2-3 others together, and sure enough, it
46 > "just worked" the way it was supposed to work.
47 >
48 > =:^)
49 >
50 >> I myself am currently running a system with the opposite merge
51 >> (/bin, /lib, /lib64, and /sbin are symlinks to /usr/bin,
52 >> /usr/lib, /usr/lib64, and /usr/sbin) although I do not yet have
53 >> the sbin -> bin merge yet.
54 >
55 > FWIW I decided the single /usr -> . symlink was simpler, and
56 > besides, I liked the shorter direct paths. =:^) And I did the /usr
57 > merge first, thinking I wanted to keep the bin/sbin distinction at
58 > first, until sometime later I decided to simplify my PATH var to
59 > remove /usr, and realized I had sbin in my normal user's PATH too.
60 > Completing the merge would/did allow me to simplify PATH even
61 > further, and since I has sbin in my normal user's PATH, there
62 > really wasn't a reason to keep them separate at that point, and I
63 > was already comfortable with merged bins by then anyway, so it
64 > wasn't much of a stretch at all.
65 >
66 >> I added a post_src_install and post_pkg_preinst hook in my
67 >> /etc/portage/bashrc to ensure that there are no conflicts before
68 >> the package is merged and a pre_pkg_setup hook to disarm
69 >> gen_usr_ldscript (so as not to create a conflict).
70 >
71 > That's all unnecessary, because as I said, in general portage "just
72 > works" with the merge now, since it's designed to work with pretty
73 > much /any/ strange site-specific symlinking local gentoo admins
74 > might throw at it, altho I expect the ldcache stuff is still doing
75 > a bunch of extra work by going over all the dirs that are actually
76 > the same thing, and I suspect revdep-rebuild (which I still run
77 > religiously after every @world update) is doing a bunch of extra
78 > scanning too. But as I'm on SSD the extra filesystem IO isn't a
79 > big issue, meaning it's simply the CPU cycle cost, and so far
80 > simply spending the extra CPU cycles has been cheaper for me than
81 > actually researching what I might do about it, so...
82 >
83
84 That is good to know. I did, however test when a package installs two
85 (different) regular files into paths that end up symlinked, and found
86 that portage does break in that case (as the only sensible option at
87 that point is to fail, as something will be lost in either case).
88
89 - --
90 Jonathan
91 -----BEGIN PGP SIGNATURE-----
92 Version: GnuPG v2
93 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
94
95 iQIcBAEBCgAGBQJTtQDKAAoJELHSF2kinlg4eIIP/0Jmia/151IPAAt3oG7OalVr
96 1SyUSdAchM/cCb6m8uf3BDPIxMQa704Zh/TKd3wAxz64BJGmJtDmEBlAq+04nXnw
97 UFB+dJVJsphN/X/jS7iln1tVqn8099mntYWG9mjv4nQLXNf6U0H1i9iBQtz+uvi5
98 9tzO6Ghoen6VvyV7ykI/r2uByI4Y4+anVgXKT2s99akbIWFR9qQuHOHWlcxZxurd
99 QA17Wfnxene7FfpGtsanORvpiKaQamUo75zXlR7l5FydiANH5QKt1Qw5RZIC/k27
100 PVc+oV2A+7HJVWHrMqEBwwGyn8LokzzX644TpiL17rTHkGa9jYYnsfwO/mIksEh2
101 O7HzbHyGjD6yUVbY/G3bxUfjpEi0C02DASSlOrHnDsZf4U5joYf9D//jTFQhCkp8
102 TtPcU7h4HIlyniberknM/WMqQ8B4lnjlCGNcVoaZtqabQ6YtIV+9eu32Gzd0LP29
103 TN/MQFm98pRGTwAAoyoq8QzOUUpoEBZP05htsW5UvgSe5CAzfi2Tm2TEsF/ulbMs
104 IoZBdovmv1mpTnNESJ6rTos9QesAbErV0FQn6NC5WcvtWpTrpiRFf3QeqOCcgpZY
105 ogH241MJaaxnu3vUdKnCD5zd4UBJOjWaViLKIK29v3pWVAgbMeHhC0inNW6gIZIu
106 Nn8aKkjoyjyEhyJT9/tj
107 =3Nrz
108 -----END PGP SIGNATURE-----

Replies

Subject Author
[gentoo-dev] Re: Making a common sub-profile for no-multilib Duncan <1i5t5.duncan@×××.net>