Gentoo Archives: gentoo-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] timezone configuration - why copying, not symlinking /etc/localtime ?
Date: Sun, 28 Mar 2021 02:51:19
Message-Id: 0ea4b2d5-627d-eff3-50e5-03cb38a8a14a@gentoo.org
In Reply to: Re: [gentoo-dev] timezone configuration - why copying, not symlinking /etc/localtime ? by William Hubbs
1 On 3/27/2021 20:32, William Hubbs wrote:
2 > On Sat, Mar 27, 2021 at 05:43:34PM -0400, Joshua Kinard wrote:
3 >> On 3/23/2021 07:31, Rich Freeman wrote:
4 >>> On Mon, Mar 22, 2021 at 6:54 PM Andreas K. Huettel <dilfridge@g.o> wrote:
5 >>>>
6 >>>>>> Council decided years ago that we don't support separate /usr without
7 >>>>>> an initramfs, but we haven't completed that transition yet.
8 >>>>>
9 >>>>> Which doesn't imply that we deliberately break things.
10 >>>>
11 >>>> That's right. Though we should at some point start thinking about an end of support for separate usr without initramfs.
12 >>>>
13 >>>
14 >>> Just to clarify - it is already unsupported at a distro level. It is
15 >>> just that some individual packages still work with it.
16 >>>
17 >>> The current Council decisions on the issue are (just providing for
18 >>> general reference):
19 >>>
20 >>> - "Since that particular setup may already be subtly broken today
21 >>> depending on the installed software, Council recommends using an
22 >>> early boot mount mechanism, e.g. initramfs, to mount /usr if /usr
23 >>> is on a separate partition."
24 >>> Accepted unanimously. [1]
25 >>>
26 >>> - "The intention is to eventually not require maintainers to support
27 >>> a separate /usr without an early boot mechanism once the Council
28 >>> agrees that the necessary docs/migration path is in place."
29 >>> Accepted with 4 yes votes, 1 no vote, 2 abstentions. [1]
30 >>>
31 >>> - "The Council agrees that all preparations for dropping support for
32 >>> separate /usr without an initramfs or similar boot mechanism are
33 >>> complete. A news item will be prepared, and users will be given one
34 >>> month to switch after the news item has been sent."
35 >>> Accepted with 5 yes votes, 1 no vote, 1 abstention. [2]
36 >>>
37 >>> Current policy documentation:
38 >>> Developers are not required to support using separate /usr filesystem
39 >>> without an initramfs. [3]
40 >>>
41 >>> 1 - https://projects.gentoo.org/council/meeting-logs/20130813-summary.txt
42 >>> 2 - https://projects.gentoo.org/council/meeting-logs/20130924-summary.txt
43 >>> 3 - https://projects.gentoo.org/qa/policy-guide/filesystem.html#pg0202
44 >>
45 >> Is there a list of software/ebuilds that currently do this "subtle" handling
46 >> of separate /usr w/o initramfs?
47 >>
48 >> I've got just my MIPS systems left that use a separate /usr and do not boot
49 >> with initramfs because I build fully monolithic kernels and that makes the
50 >> resulting vmlinux images run up against hard size limits in the SGI PROM
51 >> (firmware, BIOS, etc) on these machines if I try to pack too large of an
52 >> initramfs in. I can check for any software that may be switched over soon
53 >> to a hard initramfs requirement and look at my options.
54 >
55 > One group of packages involved in this is any package that calls
56 > gen_usr_ldscript. We have this function for a couple of reasons.
57 >
58 > Gentoo has a policy that bans *.a static libraries from being
59 > installed in /lib*. I think this policy is unique to Gentoo,
60 > because Most build systems I've seen do not
61 > have separate paths for static vs dynamic libraries, so all libraries
62 > from a package are installed in /usr/lib* or /lib*. This policy was
63 > originally hard coded into portage some time back (I can find the commit
64 > if you want it) before it was made a formal policy by the qa team.
65 > It has since become a formal policy.
66 >
67 > Because of this policy, we have to tell upstream build systems to
68 > install libraries in ${ED}/usr/$(get_libdir). This is fine unless you
69 > have separate usr with no initramfs. In that case, you have binaries on
70 > / that link to shared libraries on /usr. When we saw this happening, we
71 > started manually moving shared libraries from /usr/lib* to /lib* if
72 > someone needed the package at boot time. Then we hit bug 4411 [1]
73 > where the linker was prioritizing static libraries in /usr/lib* over shared
74 > libraries in /lib*.
75 >
76 > I don't know if we tried to address that upstream or not, but ultimately
77 > gen_usr_ldscript came out of it.
78 >
79 > Several folks have wanted to get rid of this function for years [2].
80 >
81 > I have looked into it before, and there are several things that can be done.
82 >
83 > We can have packages that currently build static libraries and
84 > use gen_usr_ldscript stop building static libraries and use the
85 > appropriate setting in their build systems to install libraries in
86 > /$(get_libdir). This is the path OpenRC is taking per request of the qa
87 > lead. The next release will not support the static-libs use flag. This
88 > will actively break anyone who is expecting this use flag to exist for OpenRC.
89 >
90 > If a package does not build static libraries in the first place, there is
91 > really no reason to call gen_usr_ldscript; the ebuild should be using
92 > the upstream build system to put the libraries where they need to be.
93
94 The number of packages calling gen_usr_ldscript looks to be fairly small.
95 Creating a TRACKER bug and sub-bugs for checking or removing the need for
96 gen_usr_ldscript might be a way to go to pair the list down and reduce the
97 footprint:
98
99 app-accessibility/brltty sys-apps/util-linux
100 app-arch/xz-utils sys-apps/systemd
101 app-arch/bzip2 sys-apps/dmapi
102 dev-libs/libiconv sys-auth/skey
103 dev-libs/libaio sys-fs/reiserfsprogs
104 dev-libs/libpcre2 sys-fs/zfs
105 dev-libs/libedit sys-fs/sysfsutils
106 dev-libs/lzo sys-fs/udev
107 dev-libs/libusb-compat sys-fs/e2fsprogs
108 dev-libs/libpwquality sys-fs/xfsprogs
109 dev-libs/libintl sys-fs/reiser4progs
110 dev-libs/libusb sys-libs/gpm
111 dev-libs/expat sys-libs/libcap
112 dev-libs/libpcre sys-libs/pam
113 eclass/usr-ldscript.eclass sys-libs/ncurses
114 eclass/toolchain-funcs.eclass sys-libs/glibc
115 net-firewall/iptables sys-libs/pwdb
116 net-libs/libnftnl sys-libs/cracklib
117 net-libs/libtirpc sys-libs/libaal
118 net-libs/libmnl sys-libs/zlib
119 sys-apps/keyutils sys-libs/readline
120 sys-apps/acl sys-libs/e2fsprogs-libs
121 sys-apps/openrc sys-process/audit
122 sys-apps/attr sys-process/procps
123 sys-apps/tcp-wrappers
124
125
126 > If static libraries are needed for a package that is using
127 > gen_usr_ldscript to move shared libraries to /lib*, the only option you
128 > have is to drop the gen_usr_ldscript call. If you do that, all of the
129 > libraries will stay in /usr/lib*, but as soon as one package takes this
130 > path, there will be active breakage for someone who is using a separate
131 > /usr without an initramfs.
132
133 Correct me if wrong, but static libraries are only needed during
134 compilation, right? The *.a files are merged into the binary at link time
135 and thus that binary can stand on its own regardless of whether the *.a
136 files are available or not. They're not like shared libs which are needed
137 by the loader to resolve symbols at run time.
138
139 A scenario where the *.a static libs aren't available because such a /usr is
140 unmounted, but are needed for some function, would be an anomalous system
141 state in the first place. That would imply one was trying to do something
142 like executing part of the system toolchain, which should be impossible in
143 that case because the actual binaries for gcc, ld, as, and others live on /usr.
144
145 We're mostly talking about the small window during boot where, on a system
146 with /usr on a separate disk partition, /usr might not be available until
147 some userspace tool in /bin or /sbin runs to make it available. Running the
148 system compiler during boot would be a rare and very unique scenario (not to
149 mention a sign of questionable development processes).
150
151
152 > The most controversial thing to do would be the /usr merge. It would
153 > affect far more users than the other paths for getting rid of
154 > gen_usr_ldscript, but it would make all "separate /usr" concerns go
155 > away along with giving us a number of other benefits.
156 >
157 > The short version is, anything we do to remove the gen_usr_ldscript
158 > function will actively break some group of users.
159
160 If I read the temperature right, it seems like there is desire to eliminate
161 gen_usr_ldscript regardless of sep-usr or not. If so, then that seems the
162 way to go. Make the eventual /usr merge a separate issue to tackle some
163 time further down the road.
164
165
166 > William
167 >
168 > [1] https://bugs.gentoo.org/4411
169 > [2] https://bugs.gentoo.org/417451
170 >
171
172
173 --
174 Joshua Kinard
175 Gentoo/MIPS
176 kumba@g.o
177 rsa6144/5C63F4E3F5C6C943 2015-04-27
178 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
179
180 "The past tempts us, the present confuses us, the future frightens us. And
181 our lives slip away, moment by moment, lost in that vast, terrible in-between."
182
183 --Emperor Turhan, Centauri Republic

Replies