1 |
commit: 22e17afdf3972504ccca959e51bf8ea7254d5513 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 7 07:19:05 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 7 07:19:05 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22e17afd |
7 |
|
8 |
sys-apps/systemd: remove old |
9 |
|
10 |
Bug: https://bugs.gentoo.org/693156 |
11 |
Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24 |
12 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
13 |
|
14 |
sys-apps/systemd/Manifest | 1 - |
15 |
sys-apps/systemd/files/242-file-max.patch | 31 -- |
16 |
sys-apps/systemd/files/242-gcc-9.patch | 163 ------- |
17 |
sys-apps/systemd/files/242-network-domains.patch | 57 --- |
18 |
.../systemd/files/242-networkd-ipv6-token.patch | 152 ------- |
19 |
sys-apps/systemd/files/242-rdrand-ryzen.patch | 353 --------------- |
20 |
.../files/242-socket-util-flush-accept.patch | 46 -- |
21 |
.../systemd/files/242-wireguard-listenport.patch | 49 -- |
22 |
sys-apps/systemd/files/CVE-2019-15718.patch | 31 -- |
23 |
sys-apps/systemd/metadata.xml | 1 - |
24 |
sys-apps/systemd/systemd-242-r6.ebuild | 499 -------------------- |
25 |
sys-apps/systemd/systemd-242-r7.ebuild | 500 --------------------- |
26 |
sys-apps/systemd/systemd-243.ebuild | 492 -------------------- |
27 |
13 files changed, 2375 deletions(-) |
28 |
|
29 |
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest |
30 |
index c751d06835a..ca6af94c9ac 100644 |
31 |
--- a/sys-apps/systemd/Manifest |
32 |
+++ b/sys-apps/systemd/Manifest |
33 |
@@ -1,3 +1,2 @@ |
34 |
-DIST systemd-242.tar.gz 7831435 BLAKE2B 288e65d0a8e133ef5885689eb16118a83d93c730e342da63115cea0892fc999104c3a4856c83f3e7ef909ba2f3311146730b05ee02d84cc0400851ccbdcd54cd SHA512 578f68a3c8f2d454198fc04ff8d943abcfb390531d57f9603d185857f7afa7f4dc641dafecf49ce50fe22f5837b252b181400891e8efd4459fd4f69bb4283cb4 |
35 |
DIST systemd-243.tar.gz 8242522 BLAKE2B 89e3ebbea5a99061329f7c78220a66c1e075d5ba90dfdf5ee8d0d9b762ef4600dc82d8ca2054632e5e343b6272cd8046c92f7f99dcfa8287c5ef2b42fb96d4cb SHA512 56b52a297aa5ac04d9667eb3afb1598725b197de73ff72baa1aabbc2844e36fba7b7fccdf6d214ae8b5b926616b2b7e15772763aaa80ec938d74333ff9c8673e |
36 |
DIST systemd-244.tar.gz 8445963 BLAKE2B 19751fb9c058a079694ee1b991259fd3f1fa30ae98ca38bbe8caadfc5628db7848c7f742a1b11781fbd67f911adda917d7a4da1dddb63064907f86f47e5a3256 SHA512 08f260fb15b5eb273faafda826dd9154e9a02841b4c5911cc1c7e1445072ad51389f8cced7b9acf112737c20fd56b2fbf48b3f914733c934c774d38a23b616fb |
37 |
|
38 |
diff --git a/sys-apps/systemd/files/242-file-max.patch b/sys-apps/systemd/files/242-file-max.patch |
39 |
deleted file mode 100644 |
40 |
index 0a1fe950e29..00000000000 |
41 |
--- a/sys-apps/systemd/files/242-file-max.patch |
42 |
+++ /dev/null |
43 |
@@ -1,31 +0,0 @@ |
44 |
-From 6e2f78948403a4cce45b9e34311c9577c624f066 Mon Sep 17 00:00:00 2001 |
45 |
-From: Lennart Poettering <lennart@××××××××××.net> |
46 |
-Date: Mon, 17 Jun 2019 10:51:25 +0200 |
47 |
-Subject: [PATCH] core: set fs.file-max sysctl to LONG_MAX rather than |
48 |
- ULONG_MAX |
49 |
- |
50 |
-Since kernel 5.2 the kernel thankfully returns proper errors when we |
51 |
-write a value out of range to the sysctl. Which however breaks writing |
52 |
-ULONG_MAX to request the maximum value. Hence let's write the new |
53 |
-maximum value instead, LONG_MAX. |
54 |
---- |
55 |
- src/core/main.c | 6 +++--- |
56 |
- 1 file changed, 3 insertions(+), 3 deletions(-) |
57 |
- |
58 |
-diff --git a/src/core/main.c b/src/core/main.c |
59 |
-index b33ea1b5b52..e7f51815f07 100644 |
60 |
---- a/src/core/main.c |
61 |
-+++ b/src/core/main.c |
62 |
-@@ -1245,9 +1245,9 @@ static void bump_file_max_and_nr_open(void) { |
63 |
- #endif |
64 |
- |
65 |
- #if BUMP_PROC_SYS_FS_FILE_MAX |
66 |
-- /* I so wanted to use STRINGIFY(ULONG_MAX) here, but alas we can't as glibc/gcc define that as |
67 |
-- * "(0x7fffffffffffffffL * 2UL + 1UL)". Seriously. 😢 */ |
68 |
-- if (asprintf(&t, "%lu\n", ULONG_MAX) < 0) { |
69 |
-+ /* The maximum the kernel allows for this since 5.2 is LONG_MAX, use that. (Previously thing where |
70 |
-+ * different but the operation would fail silently.) */ |
71 |
-+ if (asprintf(&t, "%li\n", LONG_MAX) < 0) { |
72 |
- log_oom(); |
73 |
- return; |
74 |
- } |
75 |
|
76 |
diff --git a/sys-apps/systemd/files/242-gcc-9.patch b/sys-apps/systemd/files/242-gcc-9.patch |
77 |
deleted file mode 100644 |
78 |
index e9f690a65be..00000000000 |
79 |
--- a/sys-apps/systemd/files/242-gcc-9.patch |
80 |
+++ /dev/null |
81 |
@@ -1,163 +0,0 @@ |
82 |
-From c98b3545008d8e984ab456dcf79787418fcbfe13 Mon Sep 17 00:00:00 2001 |
83 |
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl> |
84 |
-Date: Tue, 7 May 2019 13:46:55 +0200 |
85 |
-Subject: [PATCH] network: remove redunant link name in message |
86 |
- |
87 |
-Fixes #12454. |
88 |
- |
89 |
-gcc was complaining that the link->ifname argument is NULL. Adding |
90 |
-assert(link->ifname) right before the call has no effect. It seems that |
91 |
-gcc is confused by the fact that log_link_warning_errno() internally |
92 |
-calls log_object(), with link->ifname passed as the object. log_object() |
93 |
-is also a macro and is does a check whether the passed object is NULL. |
94 |
-So we have a check if something is NULL right next an unconditional use |
95 |
-of it where it cannot be NULL. I think it's a bug in gcc. |
96 |
- |
97 |
-Anyway, we don't need to use link->ifname here. log_object() already prepends |
98 |
-the object name to the message. |
99 |
---- |
100 |
- src/network/networkd-link.c | 3 +-- |
101 |
- 1 file changed, 1 insertion(+), 2 deletions(-) |
102 |
- |
103 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
104 |
-index 533193ac932..6fc82940033 100644 |
105 |
---- a/src/network/networkd-link.c |
106 |
-+++ b/src/network/networkd-link.c |
107 |
-@@ -338,8 +338,7 @@ static int link_enable_ipv6(Link *link) { |
108 |
- |
109 |
- r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled); |
110 |
- if (r < 0) |
111 |
-- log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m", |
112 |
-- enable_disable(!disabled), link->ifname); |
113 |
-+ log_link_warning_errno(link, r, "Cannot %s IPv6: %m", enable_disable(!disabled)); |
114 |
- else |
115 |
- log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled)); |
116 |
- |
117 |
-From bcb846f30f9ca8f42e79d109706aee9f2032261b Mon Sep 17 00:00:00 2001 |
118 |
-From: Mike Gilbert <floppym@g.o> |
119 |
-Date: Wed, 22 May 2019 10:31:01 -0400 |
120 |
-Subject: [PATCH] shared/machine-image: avoid passing NULL to log_debug_errno |
121 |
- |
122 |
-Fixes: https://github.com/systemd/systemd/issues/12534 |
123 |
---- |
124 |
- src/shared/machine-image.c | 11 ++++++++--- |
125 |
- 1 file changed, 8 insertions(+), 3 deletions(-) |
126 |
- |
127 |
-diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c |
128 |
-index 6b9d8fb97a6..6a6d952b424 100644 |
129 |
---- a/src/shared/machine-image.c |
130 |
-+++ b/src/shared/machine-image.c |
131 |
-@@ -201,11 +201,13 @@ static int image_make( |
132 |
- Image **ret) { |
133 |
- |
134 |
- _cleanup_free_ char *pretty_buffer = NULL; |
135 |
-+ _cleanup_free_ char *cwd = NULL; |
136 |
- struct stat stbuf; |
137 |
- bool read_only; |
138 |
- int r; |
139 |
- |
140 |
- assert(dfd >= 0 || dfd == AT_FDCWD); |
141 |
-+ assert(path || dfd == AT_FDCWD); |
142 |
- assert(filename); |
143 |
- |
144 |
- /* We explicitly *do* follow symlinks here, since we want to allow symlinking trees, raw files and block |
145 |
-@@ -221,6 +223,9 @@ static int image_make( |
146 |
- st = &stbuf; |
147 |
- } |
148 |
- |
149 |
-+ if (!path) |
150 |
-+ safe_getcwd(&cwd); |
151 |
-+ |
152 |
- read_only = |
153 |
- (path && path_startswith(path, "/usr")) || |
154 |
- (faccessat(dfd, filename, W_OK, AT_EACCESS) < 0 && errno == EROFS); |
155 |
-@@ -359,7 +364,7 @@ static int image_make( |
156 |
- |
157 |
- block_fd = openat(dfd, filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY); |
158 |
- if (block_fd < 0) |
159 |
-- log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path, filename); |
160 |
-+ log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
161 |
- else { |
162 |
- /* Refresh stat data after opening the node */ |
163 |
- if (fstat(block_fd, &stbuf) < 0) |
164 |
-@@ -373,13 +378,13 @@ static int image_make( |
165 |
- int state = 0; |
166 |
- |
167 |
- if (ioctl(block_fd, BLKROGET, &state) < 0) |
168 |
-- log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path, filename); |
169 |
-+ log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
170 |
- else if (state) |
171 |
- read_only = true; |
172 |
- } |
173 |
- |
174 |
- if (ioctl(block_fd, BLKGETSIZE64, &size) < 0) |
175 |
-- log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path, filename); |
176 |
-+ log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
177 |
- |
178 |
- block_fd = safe_close(block_fd); |
179 |
- } |
180 |
-From 2570578d908a8e010828fa1f88826b1c45d534ff Mon Sep 17 00:00:00 2001 |
181 |
-From: Lennart Poettering <lennart@××××××××××.net> |
182 |
-Date: Fri, 24 May 2019 10:54:09 +0200 |
183 |
-Subject: [PATCH] machine-image: openat() doesn't operate on the cwd if the |
184 |
- first argument is specified |
185 |
- |
186 |
-A fix-up for bcb846f30f9ca8f42e79d109706aee9f2032261b. |
187 |
---- |
188 |
- src/shared/machine-image.c | 17 ++++++++++------- |
189 |
- 1 file changed, 10 insertions(+), 7 deletions(-) |
190 |
- |
191 |
-diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c |
192 |
-index 6a6d952b424..55e5f08f91e 100644 |
193 |
---- a/src/shared/machine-image.c |
194 |
-+++ b/src/shared/machine-image.c |
195 |
-@@ -200,8 +200,7 @@ static int image_make( |
196 |
- const struct stat *st, |
197 |
- Image **ret) { |
198 |
- |
199 |
-- _cleanup_free_ char *pretty_buffer = NULL; |
200 |
-- _cleanup_free_ char *cwd = NULL; |
201 |
-+ _cleanup_free_ char *pretty_buffer = NULL, *parent = NULL; |
202 |
- struct stat stbuf; |
203 |
- bool read_only; |
204 |
- int r; |
205 |
-@@ -223,8 +222,12 @@ static int image_make( |
206 |
- st = &stbuf; |
207 |
- } |
208 |
- |
209 |
-- if (!path) |
210 |
-- safe_getcwd(&cwd); |
211 |
-+ if (!path) { |
212 |
-+ if (dfd == AT_FDCWD) |
213 |
-+ (void) safe_getcwd(&parent); |
214 |
-+ else |
215 |
-+ (void) fd_get_path(dfd, &parent); |
216 |
-+ } |
217 |
- |
218 |
- read_only = |
219 |
- (path && path_startswith(path, "/usr")) || |
220 |
-@@ -364,7 +367,7 @@ static int image_make( |
221 |
- |
222 |
- block_fd = openat(dfd, filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY); |
223 |
- if (block_fd < 0) |
224 |
-- log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
225 |
-+ log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(parent), filename); |
226 |
- else { |
227 |
- /* Refresh stat data after opening the node */ |
228 |
- if (fstat(block_fd, &stbuf) < 0) |
229 |
-@@ -378,13 +381,13 @@ static int image_make( |
230 |
- int state = 0; |
231 |
- |
232 |
- if (ioctl(block_fd, BLKROGET, &state) < 0) |
233 |
-- log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
234 |
-+ log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(parent), filename); |
235 |
- else if (state) |
236 |
- read_only = true; |
237 |
- } |
238 |
- |
239 |
- if (ioctl(block_fd, BLKGETSIZE64, &size) < 0) |
240 |
-- log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename); |
241 |
-+ log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(parent), filename); |
242 |
- |
243 |
- block_fd = safe_close(block_fd); |
244 |
- } |
245 |
|
246 |
diff --git a/sys-apps/systemd/files/242-network-domains.patch b/sys-apps/systemd/files/242-network-domains.patch |
247 |
deleted file mode 100644 |
248 |
index 166a8ee5b76..00000000000 |
249 |
--- a/sys-apps/systemd/files/242-network-domains.patch |
250 |
+++ /dev/null |
251 |
@@ -1,57 +0,0 @@ |
252 |
-From fe0e16db093a7da09fcb52a2bc7017197047443d Mon Sep 17 00:00:00 2001 |
253 |
-From: Yu Watanabe <watanabe.yu+github@×××××.com> |
254 |
-Date: Mon, 13 May 2019 05:40:31 +0900 |
255 |
-Subject: [PATCH] network: do not use ordered_set_printf() for DOMAINS= or |
256 |
- ROUTE_DOMAINS= |
257 |
- |
258 |
-This partially reverts 5e2a51d588dde4b52c6017ea80b75c16e6e23431. |
259 |
- |
260 |
-Fixes #12531. |
261 |
---- |
262 |
- src/network/networkd-link.c | 17 +++++++++++------ |
263 |
- 1 file changed, 11 insertions(+), 6 deletions(-) |
264 |
- |
265 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
266 |
-index f8ee48802cb..1dc10c65a1b 100644 |
267 |
---- a/src/network/networkd-link.c |
268 |
-+++ b/src/network/networkd-link.c |
269 |
-@@ -3495,12 +3495,11 @@ int link_save(Link *link) { |
270 |
- admin_state, oper_state); |
271 |
- |
272 |
- if (link->network) { |
273 |
-- bool space; |
274 |
-+ char **dhcp6_domains = NULL, **dhcp_domains = NULL; |
275 |
-+ const char *dhcp_domainname = NULL, *p; |
276 |
- sd_dhcp6_lease *dhcp6_lease = NULL; |
277 |
-- const char *dhcp_domainname = NULL; |
278 |
-- char **dhcp6_domains = NULL; |
279 |
-- char **dhcp_domains = NULL; |
280 |
- unsigned j; |
281 |
-+ bool space; |
282 |
- |
283 |
- fprintf(f, "REQUIRED_FOR_ONLINE=%s\n", |
284 |
- yes_no(link->network->required_for_online)); |
285 |
-@@ -3617,7 +3616,10 @@ int link_save(Link *link) { |
286 |
- (void) sd_dhcp6_lease_get_domains(dhcp6_lease, &dhcp6_domains); |
287 |
- } |
288 |
- |
289 |
-- ordered_set_print(f, "DOMAINS=", link->network->search_domains); |
290 |
-+ fputs("DOMAINS=", f); |
291 |
-+ space = false; |
292 |
-+ ORDERED_SET_FOREACH(p, link->network->search_domains, i) |
293 |
-+ fputs_with_space(f, p, NULL, &space); |
294 |
- |
295 |
- if (link->network->dhcp_use_domains == DHCP_USE_DOMAINS_YES) { |
296 |
- NDiscDNSSL *dd; |
297 |
-@@ -3635,7 +3637,10 @@ int link_save(Link *link) { |
298 |
- |
299 |
- fputc('\n', f); |
300 |
- |
301 |
-- ordered_set_print(f, "ROUTE_DOMAINS=", link->network->route_domains); |
302 |
-+ fputs("ROUTE_DOMAINS=", f); |
303 |
-+ space = false; |
304 |
-+ ORDERED_SET_FOREACH(p, link->network->route_domains, i) |
305 |
-+ fputs_with_space(f, p, NULL, &space); |
306 |
- |
307 |
- if (link->network->dhcp_use_domains == DHCP_USE_DOMAINS_ROUTE) { |
308 |
- NDiscDNSSL *dd; |
309 |
|
310 |
diff --git a/sys-apps/systemd/files/242-networkd-ipv6-token.patch b/sys-apps/systemd/files/242-networkd-ipv6-token.patch |
311 |
deleted file mode 100644 |
312 |
index 87a85f6f6ab..00000000000 |
313 |
--- a/sys-apps/systemd/files/242-networkd-ipv6-token.patch |
314 |
+++ /dev/null |
315 |
@@ -1,152 +0,0 @@ |
316 |
-From 4eb086a38712ea98faf41e075b84555b11b54362 Mon Sep 17 00:00:00 2001 |
317 |
-From: Susant Sahani <ssahani@×××××.com> |
318 |
-Date: Thu, 9 May 2019 07:35:35 +0530 |
319 |
-Subject: [PATCH] networkd: fix link_up() (#12505) |
320 |
- |
321 |
-Fillup IFLA_INET6_ADDR_GEN_MODE while we do link_up. |
322 |
- |
323 |
-Fixes the following error: |
324 |
-``` |
325 |
-dummy-test: Could not bring up interface: Invalid argument |
326 |
-``` |
327 |
- |
328 |
-After reading the kernel code when we do a link up |
329 |
-``` |
330 |
-net/core/rtnetlink.c |
331 |
-IFLA_AF_SPEC |
332 |
- af_ops->set_link_af(dev, af); |
333 |
- inet6_set_link_af |
334 |
- if (tb[IFLA_INET6_ADDR_GEN_MODE]) |
335 |
- Here it looks for IFLA_INET6_ADDR_GEN_MODE |
336 |
-``` |
337 |
-Since link up we didn't filling up that it's failing. |
338 |
- |
339 |
-Closes #12504. |
340 |
---- |
341 |
- src/network/networkd-link.c | 15 +++++++++++++++ |
342 |
- 1 file changed, 15 insertions(+) |
343 |
- |
344 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
345 |
-index 3c8b5c5cb43..4db9f3f980f 100644 |
346 |
---- a/src/network/networkd-link.c |
347 |
-+++ b/src/network/networkd-link.c |
348 |
-@@ -2031,6 +2031,8 @@ static int link_up(Link *link) { |
349 |
- } |
350 |
- |
351 |
- if (link_ipv6_enabled(link)) { |
352 |
-+ uint8_t ipv6ll_mode; |
353 |
-+ |
354 |
- r = sd_netlink_message_open_container(req, IFLA_AF_SPEC); |
355 |
- if (r < 0) |
356 |
- return log_link_error_errno(link, r, "Could not open IFLA_AF_SPEC container: %m"); |
357 |
-@@ -2046,6 +2048,19 @@ static int link_up(Link *link) { |
358 |
- return log_link_error_errno(link, r, "Could not append IFLA_INET6_TOKEN: %m"); |
359 |
- } |
360 |
- |
361 |
-+ if (!link_ipv6ll_enabled(link)) |
362 |
-+ ipv6ll_mode = IN6_ADDR_GEN_MODE_NONE; |
363 |
-+ else if (sysctl_read_ip_property(AF_INET6, link->ifname, "stable_secret", NULL) < 0) |
364 |
-+ /* The file may not exist. And event if it exists, when stable_secret is unset, |
365 |
-+ * reading the file fails with EIO. */ |
366 |
-+ ipv6ll_mode = IN6_ADDR_GEN_MODE_EUI64; |
367 |
-+ else |
368 |
-+ ipv6ll_mode = IN6_ADDR_GEN_MODE_STABLE_PRIVACY; |
369 |
-+ |
370 |
-+ r = sd_netlink_message_append_u8(req, IFLA_INET6_ADDR_GEN_MODE, ipv6ll_mode); |
371 |
-+ if (r < 0) |
372 |
-+ return log_link_error_errno(link, r, "Could not append IFLA_INET6_ADDR_GEN_MODE: %m"); |
373 |
-+ |
374 |
- r = sd_netlink_message_close_container(req); |
375 |
- if (r < 0) |
376 |
- return log_link_error_errno(link, r, "Could not close AF_INET6 container: %m"); |
377 |
-From 9f6e82e6eb3b6e73d66d00d1d6eee60691fb702f Mon Sep 17 00:00:00 2001 |
378 |
-From: Yu Watanabe <watanabe.yu+github@×××××.com> |
379 |
-Date: Thu, 9 May 2019 14:39:46 +0900 |
380 |
-Subject: [PATCH] network: do not send ipv6 token to kernel |
381 |
- |
382 |
-We disabled kernel RA support. Then, we should not send |
383 |
-IFLA_INET6_TOKEN. |
384 |
-Thus, we do not need to send IFLA_INET6_ADDR_GEN_MODE twice. |
385 |
- |
386 |
-Follow-up for 0e2fdb83bb5e22047e0c7cc058b415d0e93f02cf and |
387 |
-4eb086a38712ea98faf41e075b84555b11b54362. |
388 |
---- |
389 |
- src/network/networkd-link.c | 51 +++++-------------------------------- |
390 |
- 1 file changed, 6 insertions(+), 45 deletions(-) |
391 |
- |
392 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
393 |
-index 2b6ff2b6c58..b6da4ea70b7 100644 |
394 |
---- a/src/network/networkd-link.c |
395 |
-+++ b/src/network/networkd-link.c |
396 |
-@@ -1954,6 +1954,9 @@ static int link_configure_addrgen_mode(Link *link) { |
397 |
- assert(link->manager); |
398 |
- assert(link->manager->rtnl); |
399 |
- |
400 |
-+ if (!socket_ipv6_is_supported()) |
401 |
-+ return 0; |
402 |
-+ |
403 |
- log_link_debug(link, "Setting address genmode for link"); |
404 |
- |
405 |
- r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex); |
406 |
-@@ -2047,46 +2050,6 @@ static int link_up(Link *link) { |
407 |
- return log_link_error_errno(link, r, "Could not set MAC address: %m"); |
408 |
- } |
409 |
- |
410 |
-- if (link_ipv6_enabled(link)) { |
411 |
-- uint8_t ipv6ll_mode; |
412 |
-- |
413 |
-- r = sd_netlink_message_open_container(req, IFLA_AF_SPEC); |
414 |
-- if (r < 0) |
415 |
-- return log_link_error_errno(link, r, "Could not open IFLA_AF_SPEC container: %m"); |
416 |
-- |
417 |
-- /* if the kernel lacks ipv6 support setting IFF_UP fails if any ipv6 options are passed */ |
418 |
-- r = sd_netlink_message_open_container(req, AF_INET6); |
419 |
-- if (r < 0) |
420 |
-- return log_link_error_errno(link, r, "Could not open AF_INET6 container: %m"); |
421 |
-- |
422 |
-- if (!in_addr_is_null(AF_INET6, &link->network->ipv6_token)) { |
423 |
-- r = sd_netlink_message_append_in6_addr(req, IFLA_INET6_TOKEN, &link->network->ipv6_token.in6); |
424 |
-- if (r < 0) |
425 |
-- return log_link_error_errno(link, r, "Could not append IFLA_INET6_TOKEN: %m"); |
426 |
-- } |
427 |
-- |
428 |
-- if (!link_ipv6ll_enabled(link)) |
429 |
-- ipv6ll_mode = IN6_ADDR_GEN_MODE_NONE; |
430 |
-- else if (sysctl_read_ip_property(AF_INET6, link->ifname, "stable_secret", NULL) < 0) |
431 |
-- /* The file may not exist. And event if it exists, when stable_secret is unset, |
432 |
-- * reading the file fails with EIO. */ |
433 |
-- ipv6ll_mode = IN6_ADDR_GEN_MODE_EUI64; |
434 |
-- else |
435 |
-- ipv6ll_mode = IN6_ADDR_GEN_MODE_STABLE_PRIVACY; |
436 |
-- |
437 |
-- r = sd_netlink_message_append_u8(req, IFLA_INET6_ADDR_GEN_MODE, ipv6ll_mode); |
438 |
-- if (r < 0) |
439 |
-- return log_link_error_errno(link, r, "Could not append IFLA_INET6_ADDR_GEN_MODE: %m"); |
440 |
-- |
441 |
-- r = sd_netlink_message_close_container(req); |
442 |
-- if (r < 0) |
443 |
-- return log_link_error_errno(link, r, "Could not close AF_INET6 container: %m"); |
444 |
-- |
445 |
-- r = sd_netlink_message_close_container(req); |
446 |
-- if (r < 0) |
447 |
-- return log_link_error_errno(link, r, "Could not close IFLA_AF_SPEC container: %m"); |
448 |
-- } |
449 |
-- |
450 |
- r = netlink_call_async(link->manager->rtnl, NULL, req, link_up_handler, |
451 |
- link_netlink_destroy_callback, link); |
452 |
- if (r < 0) |
453 |
-@@ -3226,11 +3189,9 @@ static int link_configure(Link *link) { |
454 |
- if (r < 0) |
455 |
- return r; |
456 |
- |
457 |
-- if (socket_ipv6_is_supported()) { |
458 |
-- r = link_configure_addrgen_mode(link); |
459 |
-- if (r < 0) |
460 |
-- return r; |
461 |
-- } |
462 |
-+ r = link_configure_addrgen_mode(link); |
463 |
-+ if (r < 0) |
464 |
-+ return r; |
465 |
- |
466 |
- return link_configure_after_setting_mtu(link); |
467 |
- } |
468 |
|
469 |
diff --git a/sys-apps/systemd/files/242-rdrand-ryzen.patch b/sys-apps/systemd/files/242-rdrand-ryzen.patch |
470 |
deleted file mode 100644 |
471 |
index ec690c1b3f6..00000000000 |
472 |
--- a/sys-apps/systemd/files/242-rdrand-ryzen.patch |
473 |
+++ /dev/null |
474 |
@@ -1,353 +0,0 @@ |
475 |
-From d351699739471734666230ae3c6f9ba56ce5ce45 Mon Sep 17 00:00:00 2001 |
476 |
-From: Lennart Poettering <lennart@××××××××××.net> |
477 |
-Date: Tue, 7 May 2019 16:18:13 -0400 |
478 |
-Subject: [PATCH 1/6] =?UTF-8?q?random-util:=20rename=20RANDOM=5FDONT=5FDRA?= |
479 |
- =?UTF-8?q?IN=20=E2=86=92=20RANDOM=5FMAY=5FFAIL?= |
480 |
-MIME-Version: 1.0 |
481 |
-Content-Type: text/plain; charset=UTF-8 |
482 |
-Content-Transfer-Encoding: 8bit |
483 |
- |
484 |
-The old flag name was a bit of a misnomer, as /dev/urandom cannot be |
485 |
-"drained". Once it's initialized it's initialized and then is good |
486 |
-forever. (Only /dev/random has a concept of 'draining', but we never use |
487 |
-that, as it's an obsolete interface). |
488 |
- |
489 |
-The flag is still useful though, since it allows us to suppress accesses |
490 |
-to the random pool while it is not initialized, as that trips up the |
491 |
-kernel and it logs about any such attempts, which we really don't want. |
492 |
- |
493 |
-(cherry picked from commit 1a0ffa1e737e65312abac63dcf4b44e1ac0e1642) |
494 |
---- |
495 |
- src/basic/random-util.c | 36 +++++++++++++++++++----------------- |
496 |
- src/basic/random-util.h | 4 ++-- |
497 |
- 2 files changed, 21 insertions(+), 19 deletions(-) |
498 |
- |
499 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
500 |
-index ca25fd2420..de29e07549 100644 |
501 |
---- a/src/basic/random-util.c |
502 |
-+++ b/src/basic/random-util.c |
503 |
-@@ -71,21 +71,22 @@ int genuine_random_bytes(void *p, size_t n, RandomFlags flags) { |
504 |
- bool got_some = false; |
505 |
- int r; |
506 |
- |
507 |
-- /* Gathers some randomness from the kernel (or the CPU if the RANDOM_ALLOW_RDRAND flag is set). This call won't |
508 |
-- * block, unless the RANDOM_BLOCK flag is set. If RANDOM_DONT_DRAIN is set, an error is returned if the random |
509 |
-- * pool is not initialized. Otherwise it will always return some data from the kernel, regardless of whether |
510 |
-- * the random pool is fully initialized or not. */ |
511 |
-+ /* Gathers some randomness from the kernel (or the CPU if the RANDOM_ALLOW_RDRAND flag is set). This |
512 |
-+ * call won't block, unless the RANDOM_BLOCK flag is set. If RANDOM_MAY_FAIL is set, an error is |
513 |
-+ * returned if the random pool is not initialized. Otherwise it will always return some data from the |
514 |
-+ * kernel, regardless of whether the random pool is fully initialized or not. */ |
515 |
- |
516 |
- if (n == 0) |
517 |
- return 0; |
518 |
- |
519 |
- if (FLAGS_SET(flags, RANDOM_ALLOW_RDRAND)) |
520 |
-- /* Try x86-64' RDRAND intrinsic if we have it. We only use it if high quality randomness is not |
521 |
-- * required, as we don't trust it (who does?). Note that we only do a single iteration of RDRAND here, |
522 |
-- * even though the Intel docs suggest calling this in a tight loop of 10 invocations or so. That's |
523 |
-- * because we don't really care about the quality here. We generally prefer using RDRAND if the caller |
524 |
-- * allows us too, since this way we won't drain the kernel randomness pool if we don't need it, as the |
525 |
-- * pool's entropy is scarce. */ |
526 |
-+ /* Try x86-64' RDRAND intrinsic if we have it. We only use it if high quality randomness is |
527 |
-+ * not required, as we don't trust it (who does?). Note that we only do a single iteration of |
528 |
-+ * RDRAND here, even though the Intel docs suggest calling this in a tight loop of 10 |
529 |
-+ * invocations or so. That's because we don't really care about the quality here. We |
530 |
-+ * generally prefer using RDRAND if the caller allows us to, since this way we won't upset |
531 |
-+ * the kernel's random subsystem by accessing it before the pool is initialized (after all it |
532 |
-+ * will kmsg log about every attempt to do so)..*/ |
533 |
- for (;;) { |
534 |
- unsigned long u; |
535 |
- size_t m; |
536 |
-@@ -153,12 +154,13 @@ int genuine_random_bytes(void *p, size_t n, RandomFlags flags) { |
537 |
- break; |
538 |
- |
539 |
- } else if (errno == EAGAIN) { |
540 |
-- /* The kernel has no entropy whatsoever. Let's remember to use the syscall the next |
541 |
-- * time again though. |
542 |
-+ /* The kernel has no entropy whatsoever. Let's remember to use the syscall |
543 |
-+ * the next time again though. |
544 |
- * |
545 |
-- * If RANDOM_DONT_DRAIN is set, return an error so that random_bytes() can produce some |
546 |
-- * pseudo-random bytes instead. Otherwise, fall back to /dev/urandom, which we know is empty, |
547 |
-- * but the kernel will produce some bytes for us on a best-effort basis. */ |
548 |
-+ * If RANDOM_MAY_FAIL is set, return an error so that random_bytes() can |
549 |
-+ * produce some pseudo-random bytes instead. Otherwise, fall back to |
550 |
-+ * /dev/urandom, which we know is empty, but the kernel will produce some |
551 |
-+ * bytes for us on a best-effort basis. */ |
552 |
- have_syscall = true; |
553 |
- |
554 |
- if (got_some && FLAGS_SET(flags, RANDOM_EXTEND_WITH_PSEUDO)) { |
555 |
-@@ -167,7 +169,7 @@ int genuine_random_bytes(void *p, size_t n, RandomFlags flags) { |
556 |
- return 0; |
557 |
- } |
558 |
- |
559 |
-- if (FLAGS_SET(flags, RANDOM_DONT_DRAIN)) |
560 |
-+ if (FLAGS_SET(flags, RANDOM_MAY_FAIL)) |
561 |
- return -ENODATA; |
562 |
- |
563 |
- /* Use /dev/urandom instead */ |
564 |
-@@ -250,7 +252,7 @@ void pseudo_random_bytes(void *p, size_t n) { |
565 |
- |
566 |
- void random_bytes(void *p, size_t n) { |
567 |
- |
568 |
-- if (genuine_random_bytes(p, n, RANDOM_EXTEND_WITH_PSEUDO|RANDOM_DONT_DRAIN|RANDOM_ALLOW_RDRAND) >= 0) |
569 |
-+ if (genuine_random_bytes(p, n, RANDOM_EXTEND_WITH_PSEUDO|RANDOM_MAY_FAIL|RANDOM_ALLOW_RDRAND) >= 0) |
570 |
- return; |
571 |
- |
572 |
- /* If for some reason some user made /dev/urandom unavailable to us, or the kernel has no entropy, use a PRNG instead. */ |
573 |
-diff --git a/src/basic/random-util.h b/src/basic/random-util.h |
574 |
-index 3e8c288d3d..148b6c7813 100644 |
575 |
---- a/src/basic/random-util.h |
576 |
-+++ b/src/basic/random-util.h |
577 |
-@@ -8,11 +8,11 @@ |
578 |
- typedef enum RandomFlags { |
579 |
- RANDOM_EXTEND_WITH_PSEUDO = 1 << 0, /* If we can't get enough genuine randomness, but some, fill up the rest with pseudo-randomness */ |
580 |
- RANDOM_BLOCK = 1 << 1, /* Rather block than return crap randomness (only if the kernel supports that) */ |
581 |
-- RANDOM_DONT_DRAIN = 1 << 2, /* If we can't get any randomness at all, return early with -EAGAIN */ |
582 |
-+ RANDOM_MAY_FAIL = 1 << 2, /* If we can't get any randomness at all, return early with -ENODATA */ |
583 |
- RANDOM_ALLOW_RDRAND = 1 << 3, /* Allow usage of the CPU RNG */ |
584 |
- } RandomFlags; |
585 |
- |
586 |
--int genuine_random_bytes(void *p, size_t n, RandomFlags flags); /* returns "genuine" randomness, optionally filled upwith pseudo random, if not enough is available */ |
587 |
-+int genuine_random_bytes(void *p, size_t n, RandomFlags flags); /* returns "genuine" randomness, optionally filled up with pseudo random, if not enough is available */ |
588 |
- void pseudo_random_bytes(void *p, size_t n); /* returns only pseudo-randommess (but possibly seeded from something better) */ |
589 |
- void random_bytes(void *p, size_t n); /* returns genuine randomness if cheaply available, and pseudo randomness if not. */ |
590 |
- |
591 |
--- |
592 |
-2.22.0 |
593 |
- |
594 |
- |
595 |
-From 1f492b9ecc31aa3782f9ce82058d8fb72a5c323f Mon Sep 17 00:00:00 2001 |
596 |
-From: Lennart Poettering <lennart@××××××××××.net> |
597 |
-Date: Tue, 7 May 2019 16:21:44 -0400 |
598 |
-Subject: [PATCH 2/6] random-util: use gcc's bit_RDRND definition if it exists |
599 |
- |
600 |
-(cherry picked from commit cc28145d51f62711fdc4b4c229aecd5778806419) |
601 |
---- |
602 |
- src/basic/random-util.c | 7 ++++++- |
603 |
- 1 file changed, 6 insertions(+), 1 deletion(-) |
604 |
- |
605 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
606 |
-index de29e07549..205d5501e5 100644 |
607 |
---- a/src/basic/random-util.c |
608 |
-+++ b/src/basic/random-util.c |
609 |
-@@ -45,7 +45,12 @@ int rdrand(unsigned long *ret) { |
610 |
- return -EOPNOTSUPP; |
611 |
- } |
612 |
- |
613 |
-- have_rdrand = !!(ecx & (1U << 30)); |
614 |
-+/* Compat with old gcc where bit_RDRND didn't exist yet */ |
615 |
-+#ifndef bit_RDRND |
616 |
-+#define bit_RDRND (1U << 30) |
617 |
-+#endif |
618 |
-+ |
619 |
-+ have_rdrand = !!(ecx & bit_RDRND); |
620 |
- } |
621 |
- |
622 |
- if (have_rdrand == 0) |
623 |
--- |
624 |
-2.22.0 |
625 |
- |
626 |
- |
627 |
-From 6460c540e6183dd19de89b7f0672b3b47c4d41cc Mon Sep 17 00:00:00 2001 |
628 |
-From: Lennart Poettering <lennart@××××××××××.net> |
629 |
-Date: Tue, 7 May 2019 17:26:55 -0400 |
630 |
-Subject: [PATCH 3/6] random-util: hash AT_RANDOM getauxval() value before |
631 |
- using it |
632 |
- |
633 |
-Let's be a bit paranoid and hash the 16 bytes we get from getauxval() |
634 |
-before using them. AFter all they might be used by other stuff too (in |
635 |
-particular ASLR), and we probably shouldn't end up leaking that seed |
636 |
-though our crappy pseudo-random numbers. |
637 |
- |
638 |
-(cherry picked from commit 80eb560a5bd7439103036867d5e09a5e0393e5d3) |
639 |
---- |
640 |
- src/basic/random-util.c | 18 ++++++++++++------ |
641 |
- 1 file changed, 12 insertions(+), 6 deletions(-) |
642 |
- |
643 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
644 |
-index 205d5501e5..40f1928936 100644 |
645 |
---- a/src/basic/random-util.c |
646 |
-+++ b/src/basic/random-util.c |
647 |
-@@ -28,6 +28,7 @@ |
648 |
- #include "io-util.h" |
649 |
- #include "missing.h" |
650 |
- #include "random-util.h" |
651 |
-+#include "siphash24.h" |
652 |
- #include "time-util.h" |
653 |
- |
654 |
- int rdrand(unsigned long *ret) { |
655 |
-@@ -203,14 +204,19 @@ void initialize_srand(void) { |
656 |
- return; |
657 |
- |
658 |
- #if HAVE_SYS_AUXV_H |
659 |
-- /* The kernel provides us with 16 bytes of entropy in auxv, so let's |
660 |
-- * try to make use of that to seed the pseudo-random generator. It's |
661 |
-- * better than nothing... */ |
662 |
-+ /* The kernel provides us with 16 bytes of entropy in auxv, so let's try to make use of that to seed |
663 |
-+ * the pseudo-random generator. It's better than nothing... But let's first hash it to make it harder |
664 |
-+ * to recover the original value by watching any pseudo-random bits we generate. After all the |
665 |
-+ * AT_RANDOM data might be used by other stuff too (in particular: ASLR), and we probably shouldn't |
666 |
-+ * leak the seed for that. */ |
667 |
- |
668 |
-- auxv = (const void*) getauxval(AT_RANDOM); |
669 |
-+ auxv = ULONG_TO_PTR(getauxval(AT_RANDOM)); |
670 |
- if (auxv) { |
671 |
-- assert_cc(sizeof(x) <= 16); |
672 |
-- memcpy(&x, auxv, sizeof(x)); |
673 |
-+ static const uint8_t auxval_hash_key[16] = { |
674 |
-+ 0x92, 0x6e, 0xfe, 0x1b, 0xcf, 0x00, 0x52, 0x9c, 0xcc, 0x42, 0xcf, 0xdc, 0x94, 0x1f, 0x81, 0x0f |
675 |
-+ }; |
676 |
-+ |
677 |
-+ x = (unsigned) siphash24(auxv, 16, auxval_hash_key); |
678 |
- } else |
679 |
- #endif |
680 |
- x = 0; |
681 |
--- |
682 |
-2.22.0 |
683 |
- |
684 |
- |
685 |
-From 17d52f6320b45d1728af6007b4df4aaccc6fdaf4 Mon Sep 17 00:00:00 2001 |
686 |
-From: Lennart Poettering <lennart@××××××××××.net> |
687 |
-Date: Tue, 7 May 2019 18:51:26 -0400 |
688 |
-Subject: [PATCH 4/6] random-util: rename "err" to "success" |
689 |
- |
690 |
-After all rdrand returns 1 on success, and 0 on failure, hence let's |
691 |
-name this accordingly. |
692 |
- |
693 |
-(cherry picked from commit 328f850e36e86d14ab06d11fa8f2397e9575a7f9) |
694 |
---- |
695 |
- src/basic/random-util.c | 8 ++++---- |
696 |
- 1 file changed, 4 insertions(+), 4 deletions(-) |
697 |
- |
698 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
699 |
-index 40f1928936..7c64857592 100644 |
700 |
---- a/src/basic/random-util.c |
701 |
-+++ b/src/basic/random-util.c |
702 |
-@@ -35,7 +35,7 @@ int rdrand(unsigned long *ret) { |
703 |
- |
704 |
- #if defined(__i386__) || defined(__x86_64__) |
705 |
- static int have_rdrand = -1; |
706 |
-- unsigned char err; |
707 |
-+ uint8_t success; |
708 |
- |
709 |
- if (have_rdrand < 0) { |
710 |
- uint32_t eax, ebx, ecx, edx; |
711 |
-@@ -60,9 +60,9 @@ int rdrand(unsigned long *ret) { |
712 |
- asm volatile("rdrand %0;" |
713 |
- "setc %1" |
714 |
- : "=r" (*ret), |
715 |
-- "=qm" (err)); |
716 |
-- msan_unpoison(&err, sizeof(err)); |
717 |
-- if (!err) |
718 |
-+ "=qm" (success)); |
719 |
-+ msan_unpoison(&success, sizeof(sucess)); |
720 |
-+ if (!success) |
721 |
- return -EAGAIN; |
722 |
- |
723 |
- return 0; |
724 |
--- |
725 |
-2.22.0 |
726 |
- |
727 |
- |
728 |
-From a6c72245ba5ba688cd6544650b9c6e313b39b53e Mon Sep 17 00:00:00 2001 |
729 |
-From: Evgeny Vereshchagin <evvers@××.ru> |
730 |
-Date: Wed, 8 May 2019 15:50:53 +0200 |
731 |
-Subject: [PATCH 5/6] util-lib: fix a typo in rdrand |
732 |
- |
733 |
-Otherwise, the fuzzers will fail to compile with MSan: |
734 |
-``` |
735 |
-../../src/systemd/src/basic/random-util.c:64:40: error: use of undeclared identifier 'sucess'; did you mean 'success'? |
736 |
- msan_unpoison(&success, sizeof(sucess)); |
737 |
- ^~~~~~ |
738 |
- success |
739 |
-../../src/systemd/src/basic/alloc-util.h:169:50: note: expanded from macro 'msan_unpoison' |
740 |
- ^ |
741 |
-../../src/systemd/src/basic/random-util.c:38:17: note: 'success' declared here |
742 |
- uint8_t success; |
743 |
- ^ |
744 |
-1 error generated. |
745 |
-[80/545] Compiling C object 'src/basic/a6ba3eb@@basic@sta/process-util.c.o'. |
746 |
-ninja: build stopped: subcommand failed. |
747 |
-Fuzzers build failed |
748 |
-``` |
749 |
- |
750 |
-(cherry picked from commit 7f2cdceaed4d37c4e601e531c7d863fca1bd1460) |
751 |
---- |
752 |
- src/basic/random-util.c | 2 +- |
753 |
- 1 file changed, 1 insertion(+), 1 deletion(-) |
754 |
- |
755 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
756 |
-index 7c64857592..b8bbf2d418 100644 |
757 |
---- a/src/basic/random-util.c |
758 |
-+++ b/src/basic/random-util.c |
759 |
-@@ -61,7 +61,7 @@ int rdrand(unsigned long *ret) { |
760 |
- "setc %1" |
761 |
- : "=r" (*ret), |
762 |
- "=qm" (success)); |
763 |
-- msan_unpoison(&success, sizeof(sucess)); |
764 |
-+ msan_unpoison(&success, sizeof(success)); |
765 |
- if (!success) |
766 |
- return -EAGAIN; |
767 |
- |
768 |
--- |
769 |
-2.22.0 |
770 |
- |
771 |
- |
772 |
-From 47eec0ae61c887cb8cc05ce8d49b8d151bc4ef25 Mon Sep 17 00:00:00 2001 |
773 |
-From: Lennart Poettering <lennart@××××××××××.net> |
774 |
-Date: Fri, 10 May 2019 15:16:16 -0400 |
775 |
-Subject: [PATCH 6/6] random-util: eat up bad RDRAND values seen on AMD CPUs |
776 |
- |
777 |
-An ugly, ugly work-around for #11810. And no, we shouldn't have to do |
778 |
-this. This is something for AMD, the firmware or the kernel to |
779 |
-fix/work-around, not us. But nonetheless, this should do it for now. |
780 |
- |
781 |
-Fixes: #11810 |
782 |
-(cherry picked from commit 1c53d4a070edbec8ad2d384ba0014d0eb6bae077) |
783 |
---- |
784 |
- src/basic/random-util.c | 15 ++++++++++++++- |
785 |
- 1 file changed, 14 insertions(+), 1 deletion(-) |
786 |
- |
787 |
-diff --git a/src/basic/random-util.c b/src/basic/random-util.c |
788 |
-index b8bbf2d418..0561f0cb22 100644 |
789 |
---- a/src/basic/random-util.c |
790 |
-+++ b/src/basic/random-util.c |
791 |
-@@ -35,6 +35,7 @@ int rdrand(unsigned long *ret) { |
792 |
- |
793 |
- #if defined(__i386__) || defined(__x86_64__) |
794 |
- static int have_rdrand = -1; |
795 |
-+ unsigned long v; |
796 |
- uint8_t success; |
797 |
- |
798 |
- if (have_rdrand < 0) { |
799 |
-@@ -59,12 +60,24 @@ int rdrand(unsigned long *ret) { |
800 |
- |
801 |
- asm volatile("rdrand %0;" |
802 |
- "setc %1" |
803 |
-- : "=r" (*ret), |
804 |
-+ : "=r" (v), |
805 |
- "=qm" (success)); |
806 |
- msan_unpoison(&success, sizeof(success)); |
807 |
- if (!success) |
808 |
- return -EAGAIN; |
809 |
- |
810 |
-+ /* Apparently on some AMD CPUs RDRAND will sometimes (after a suspend/resume cycle?) report success |
811 |
-+ * via the carry flag but nonetheless return the same fixed value -1 in all cases. This appears to be |
812 |
-+ * a bad bug in the CPU or firmware. Let's deal with that and work-around this by explicitly checking |
813 |
-+ * for this special value (and also 0, just to be sure) and filtering it out. This is a work-around |
814 |
-+ * only however and something AMD really should fix properly. The Linux kernel should probably work |
815 |
-+ * around this issue by turning off RDRAND altogether on those CPUs. See: |
816 |
-+ * https://github.com/systemd/systemd/issues/11810 */ |
817 |
-+ if (v == 0 || v == ULONG_MAX) |
818 |
-+ return log_debug_errno(SYNTHETIC_ERRNO(EUCLEAN), |
819 |
-+ "RDRAND returned suspicious value %lx, assuming bad hardware RNG, not using value.", v); |
820 |
-+ |
821 |
-+ *ret = v; |
822 |
- return 0; |
823 |
- #else |
824 |
- return -EOPNOTSUPP; |
825 |
--- |
826 |
-2.22.0 |
827 |
- |
828 |
|
829 |
diff --git a/sys-apps/systemd/files/242-socket-util-flush-accept.patch b/sys-apps/systemd/files/242-socket-util-flush-accept.patch |
830 |
deleted file mode 100644 |
831 |
index 4849c4c0789..00000000000 |
832 |
--- a/sys-apps/systemd/files/242-socket-util-flush-accept.patch |
833 |
+++ /dev/null |
834 |
@@ -1,46 +0,0 @@ |
835 |
-From f3d75364fbebf2ddb6393e54db5e10b6f6234e14 Mon Sep 17 00:00:00 2001 |
836 |
-From: Lennart Poettering <lennart@××××××××××.net> |
837 |
-Date: Thu, 18 Apr 2019 15:13:54 +0200 |
838 |
-Subject: [PATCH] socket-util: make sure flush_accept() doesn't hang on |
839 |
- unexpected EOPNOTSUPP |
840 |
- |
841 |
-So apparently there are two reasons why accept() can return EOPNOTSUPP: |
842 |
-because the socket is not a listening stream socket (or similar), or |
843 |
-because the incoming TCP connection for some reason wasn't acceptable to |
844 |
-the host. THe latter should be a transient error, as suggested on |
845 |
-accept(2). The former however should be considered fatal for |
846 |
-flush_accept(). Let's fix this by explicitly checking whether the socket |
847 |
-is a listening socket beforehand. |
848 |
---- |
849 |
- src/basic/socket-util.c | 17 +++++++++++++++-- |
850 |
- 1 file changed, 15 insertions(+), 2 deletions(-) |
851 |
- |
852 |
-diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c |
853 |
-index 904bafb76f9..e787d53d8f4 100644 |
854 |
---- a/src/basic/socket-util.c |
855 |
-+++ b/src/basic/socket-util.c |
856 |
-@@ -1225,9 +1225,22 @@ int flush_accept(int fd) { |
857 |
- .fd = fd, |
858 |
- .events = POLLIN, |
859 |
- }; |
860 |
-- int r; |
861 |
-+ int r, b; |
862 |
-+ socklen_t l = sizeof(b); |
863 |
-+ |
864 |
-+ /* Similar to flush_fd() but flushes all incoming connection by accepting them and immediately |
865 |
-+ * closing them. */ |
866 |
-+ |
867 |
-+ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &b, &l) < 0) |
868 |
-+ return -errno; |
869 |
- |
870 |
-- /* Similar to flush_fd() but flushes all incoming connection by accepting them and immediately closing them. */ |
871 |
-+ assert(l == sizeof(b)); |
872 |
-+ if (!b) /* Let's check if this is a socket accepting connections before calling accept(). That's |
873 |
-+ * because accept4() can return EOPNOTSUPP in the fd we are called on is not a listening |
874 |
-+ * socket, or in case the incoming TCP connection transiently triggered that (see accept(2) |
875 |
-+ * man page for details). The latter case is a transient error we should continue looping |
876 |
-+ * on. The former case however is fatal. */ |
877 |
-+ return -ENOTTY; |
878 |
- |
879 |
- for (;;) { |
880 |
- int cfd; |
881 |
|
882 |
diff --git a/sys-apps/systemd/files/242-wireguard-listenport.patch b/sys-apps/systemd/files/242-wireguard-listenport.patch |
883 |
deleted file mode 100644 |
884 |
index 39b3c7c0a54..00000000000 |
885 |
--- a/sys-apps/systemd/files/242-wireguard-listenport.patch |
886 |
+++ /dev/null |
887 |
@@ -1,49 +0,0 @@ |
888 |
-From a62b7bb79e9a2aa683624c32cde1c756d8466fb4 Mon Sep 17 00:00:00 2001 |
889 |
-From: Yu Watanabe <watanabe.yu+github@×××××.com> |
890 |
-Date: Thu, 25 Apr 2019 00:39:04 +0200 |
891 |
-Subject: [PATCH] network: fix ListenPort= in [WireGuard] section |
892 |
- |
893 |
-This fixes a bug introduced by f1368a333e5e08575f0b45dfe41e936b106a8627. |
894 |
- |
895 |
-Fixes #12377. |
896 |
---- |
897 |
- src/network/netdev/wireguard.c | 19 ++++++++++--------- |
898 |
- 1 file changed, 10 insertions(+), 9 deletions(-) |
899 |
- |
900 |
-diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c |
901 |
-index f3084c0773f..5ebc5dfed84 100644 |
902 |
---- a/src/network/netdev/wireguard.c |
903 |
-+++ b/src/network/netdev/wireguard.c |
904 |
-@@ -452,22 +452,23 @@ int config_parse_wireguard_listen_port( |
905 |
- void *userdata) { |
906 |
- |
907 |
- uint16_t *s = data; |
908 |
-- uint16_t port = 0; |
909 |
- int r; |
910 |
- |
911 |
- assert(rvalue); |
912 |
- assert(data); |
913 |
- |
914 |
-- if (!streq(rvalue, "auto")) { |
915 |
-- r = parse_ip_port(rvalue, s); |
916 |
-- if (r < 0) { |
917 |
-- log_syntax(unit, LOG_ERR, filename, line, r, |
918 |
-- "Invalid port specification, ignoring assignment: %s", rvalue); |
919 |
-- return 0; |
920 |
-- } |
921 |
-+ if (isempty(rvalue) || streq(rvalue, "auto")) { |
922 |
-+ *s = 0; |
923 |
-+ return 0; |
924 |
-+ } |
925 |
-+ |
926 |
-+ r = parse_ip_port(rvalue, s); |
927 |
-+ if (r < 0) { |
928 |
-+ log_syntax(unit, LOG_ERR, filename, line, r, |
929 |
-+ "Invalid port specification, ignoring assignment: %s", rvalue); |
930 |
-+ return 0; |
931 |
- } |
932 |
- |
933 |
-- *s = port; |
934 |
- return 0; |
935 |
- } |
936 |
- |
937 |
|
938 |
diff --git a/sys-apps/systemd/files/CVE-2019-15718.patch b/sys-apps/systemd/files/CVE-2019-15718.patch |
939 |
deleted file mode 100644 |
940 |
index 8186f7096f8..00000000000 |
941 |
--- a/sys-apps/systemd/files/CVE-2019-15718.patch |
942 |
+++ /dev/null |
943 |
@@ -1,31 +0,0 @@ |
944 |
-From 35e528018f315798d3bffcb592b32a0d8f5162bd Mon Sep 17 00:00:00 2001 |
945 |
-From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl> |
946 |
-Date: Tue, 27 Aug 2019 19:00:34 +0200 |
947 |
-Subject: [PATCH] shared/but-util: drop trusted annotation from |
948 |
- bus_open_system_watch_bind_with_description() |
949 |
- |
950 |
-https://bugzilla.redhat.com/show_bug.cgi?id=1746057 |
951 |
- |
952 |
-This only affects systemd-resolved. bus_open_system_watch_bind_with_description() |
953 |
-is also used in timesyncd, but it has no methods, only read-only properties, and |
954 |
-in networkd, but it annotates all methods with SD_BUS_VTABLE_UNPRIVILEGED and does |
955 |
-polkit checks. |
956 |
---- |
957 |
- src/shared/bus-util.c | 4 ---- |
958 |
- 1 file changed, 4 deletions(-) |
959 |
- |
960 |
-diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c |
961 |
-index 6af115e7aa..821339d4ae 100644 |
962 |
---- a/src/shared/bus-util.c |
963 |
-+++ b/src/shared/bus-util.c |
964 |
-@@ -1705,10 +1705,6 @@ int bus_open_system_watch_bind_with_description(sd_bus **ret, const char *descri |
965 |
- if (r < 0) |
966 |
- return r; |
967 |
- |
968 |
-- r = sd_bus_set_trusted(bus, true); |
969 |
-- if (r < 0) |
970 |
-- return r; |
971 |
-- |
972 |
- r = sd_bus_negotiate_creds(bus, true, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EFFECTIVE_CAPS); |
973 |
- if (r < 0) |
974 |
- return r; |
975 |
|
976 |
diff --git a/sys-apps/systemd/metadata.xml b/sys-apps/systemd/metadata.xml |
977 |
index 540f7dbef65..d62c5159c4b 100644 |
978 |
--- a/sys-apps/systemd/metadata.xml |
979 |
+++ b/sys-apps/systemd/metadata.xml |
980 |
@@ -21,7 +21,6 @@ |
981 |
<flag name="http">Enable embedded HTTP server in journald</flag> |
982 |
<flag name="importd">Enable import daemon</flag> |
983 |
<flag name="kmod">Enable kernel module loading via <pkg>sys-apps/kmod</pkg></flag> |
984 |
- <flag name="libidn2">If IDN support is enabled, use <pkg>net-dns/libidn2</pkg> instead of <pkg>net-dns/libidn</pkg></flag> |
985 |
<flag name="lz4">Enable lz4 compression for the journal</flag> |
986 |
<flag name="nat">Enable support for network address translation in networkd</flag> |
987 |
<flag name="qrcode">Enable qrcode output support in journal</flag> |
988 |
|
989 |
diff --git a/sys-apps/systemd/systemd-242-r6.ebuild b/sys-apps/systemd/systemd-242-r6.ebuild |
990 |
deleted file mode 100644 |
991 |
index 4af69fa7ac6..00000000000 |
992 |
--- a/sys-apps/systemd/systemd-242-r6.ebuild |
993 |
+++ /dev/null |
994 |
@@ -1,499 +0,0 @@ |
995 |
-# Copyright 2011-2020 Gentoo Authors |
996 |
-# Distributed under the terms of the GNU General Public License v2 |
997 |
- |
998 |
-EAPI=7 |
999 |
- |
1000 |
-if [[ ${PV} == 9999 ]]; then |
1001 |
- EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
1002 |
- inherit git-r3 |
1003 |
-else |
1004 |
- MY_PV=${PV/_/-} |
1005 |
- MY_P=${PN}-${MY_PV} |
1006 |
- S=${WORKDIR}/${MY_P} |
1007 |
- SRC_URI="https://github.com/systemd/systemd/archive/v${MY_PV}/${MY_P}.tar.gz" |
1008 |
- KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86" |
1009 |
-fi |
1010 |
- |
1011 |
-PYTHON_COMPAT=( python{3_6,3_7} ) |
1012 |
- |
1013 |
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev |
1014 |
- |
1015 |
-DESCRIPTION="System and service manager for Linux" |
1016 |
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
1017 |
- |
1018 |
-LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
1019 |
-SLOT="0/2" |
1020 |
-IUSE="acl apparmor audit build cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr +sysv-utils test vanilla xkb" |
1021 |
- |
1022 |
-REQUIRED_USE="importd? ( curl gcrypt lzma )" |
1023 |
-RESTRICT="!test? ( test )" |
1024 |
- |
1025 |
-MINKV="3.11" |
1026 |
- |
1027 |
-COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] |
1028 |
- sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
1029 |
- !<sys-libs/glibc-2.16 |
1030 |
- acl? ( sys-apps/acl:0= ) |
1031 |
- apparmor? ( sys-libs/libapparmor:0= ) |
1032 |
- audit? ( >=sys-process/audit-2:0= ) |
1033 |
- cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) |
1034 |
- curl? ( net-misc/curl:0= ) |
1035 |
- dns-over-tls? ( >=net-libs/gnutls-3.5.3:0= ) |
1036 |
- elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
1037 |
- gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
1038 |
- http? ( |
1039 |
- >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] |
1040 |
- >=net-libs/gnutls-3.1.4:0= |
1041 |
- ) |
1042 |
- idn? ( |
1043 |
- libidn2? ( net-dns/libidn2:= ) |
1044 |
- !libidn2? ( net-dns/libidn:= ) |
1045 |
- ) |
1046 |
- importd? ( |
1047 |
- app-arch/bzip2:0= |
1048 |
- sys-libs/zlib:0= |
1049 |
- ) |
1050 |
- kmod? ( >=sys-apps/kmod-15:0= ) |
1051 |
- lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
1052 |
- lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
1053 |
- nat? ( net-firewall/iptables:0= ) |
1054 |
- pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] ) |
1055 |
- pcre? ( dev-libs/libpcre2 ) |
1056 |
- qrcode? ( media-gfx/qrencode:0= ) |
1057 |
- seccomp? ( >=sys-libs/libseccomp-2.3.3:0= ) |
1058 |
- selinux? ( sys-libs/libselinux:0= ) |
1059 |
- xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )" |
1060 |
- |
1061 |
-# Newer linux-headers needed by ia64, bug #480218 |
1062 |
-DEPEND="${COMMON_DEPEND} |
1063 |
- >=sys-kernel/linux-headers-${MINKV} |
1064 |
- gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
1065 |
-" |
1066 |
- |
1067 |
-# baselayout-2.2 has /run |
1068 |
-RDEPEND="${COMMON_DEPEND} |
1069 |
- acct-group/adm |
1070 |
- acct-group/wheel |
1071 |
- acct-group/kmem |
1072 |
- acct-group/tty |
1073 |
- acct-group/utmp |
1074 |
- acct-group/audio |
1075 |
- acct-group/cdrom |
1076 |
- acct-group/dialout |
1077 |
- acct-group/disk |
1078 |
- acct-group/input |
1079 |
- acct-group/kvm |
1080 |
- acct-group/render |
1081 |
- acct-group/tape |
1082 |
- acct-group/video |
1083 |
- acct-group/systemd-journal |
1084 |
- acct-user/systemd-journal-remote |
1085 |
- acct-user/systemd-coredump |
1086 |
- acct-user/systemd-network |
1087 |
- acct-user/systemd-resolve |
1088 |
- acct-user/systemd-timesync |
1089 |
- >=sys-apps/baselayout-2.2 |
1090 |
- selinux? ( sec-policy/selinux-base-policy[systemd] ) |
1091 |
- sysv-utils? ( !sys-apps/sysvinit ) |
1092 |
- !sysv-utils? ( sys-apps/sysvinit ) |
1093 |
- resolvconf? ( !net-dns/openresolv ) |
1094 |
- !build? ( || ( |
1095 |
- sys-apps/util-linux[kill(-)] |
1096 |
- sys-process/procps[kill(+)] |
1097 |
- sys-apps/coreutils[kill(-)] |
1098 |
- ) ) |
1099 |
- !sys-auth/nss-myhostname |
1100 |
- !<sys-kernel/dracut-044 |
1101 |
- !sys-fs/eudev |
1102 |
- !sys-fs/udev |
1103 |
-" |
1104 |
- |
1105 |
-# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
1106 |
-PDEPEND=">=sys-apps/dbus-1.9.8[systemd] |
1107 |
- >=sys-apps/hwids-20150417[udev] |
1108 |
- >=sys-fs/udev-init-scripts-25 |
1109 |
- policykit? ( sys-auth/polkit ) |
1110 |
- !vanilla? ( sys-apps/gentoo-systemd-integration )" |
1111 |
- |
1112 |
-BDEPEND=" |
1113 |
- app-arch/xz-utils:0 |
1114 |
- dev-util/gperf |
1115 |
- >=dev-util/meson-0.46 |
1116 |
- >=dev-util/intltool-0.50 |
1117 |
- >=sys-apps/coreutils-8.16 |
1118 |
- sys-devel/m4 |
1119 |
- virtual/pkgconfig[${MULTILIB_USEDEP}] |
1120 |
- test? ( sys-apps/dbus ) |
1121 |
- app-text/docbook-xml-dtd:4.2 |
1122 |
- app-text/docbook-xml-dtd:4.5 |
1123 |
- app-text/docbook-xsl-stylesheets |
1124 |
- dev-libs/libxslt:0 |
1125 |
- $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') |
1126 |
-" |
1127 |
- |
1128 |
-pkg_pretend() { |
1129 |
- if [[ ${MERGE_TYPE} != buildonly ]]; then |
1130 |
- if use test && has pid-sandbox ${FEATURES}; then |
1131 |
- ewarn "Tests are known to fail with PID sandboxing enabled." |
1132 |
- ewarn "See https://bugs.gentoo.org/674458." |
1133 |
- fi |
1134 |
- |
1135 |
- local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
1136 |
- ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE |
1137 |
- ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS |
1138 |
- ~TIMERFD ~TMPFS_XATTR ~UNIX |
1139 |
- ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH |
1140 |
- ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
1141 |
- ~!SYSFS_DEPRECATED_V2" |
1142 |
- |
1143 |
- use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
1144 |
- use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" |
1145 |
- kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
1146 |
- kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" |
1147 |
- kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF" |
1148 |
- |
1149 |
- if linux_config_exists; then |
1150 |
- local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
1151 |
- if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then |
1152 |
- ewarn "It's recommended to set an empty value to the following kernel config option:" |
1153 |
- ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
1154 |
- fi |
1155 |
- if linux_chkconfig_present X86; then |
1156 |
- CONFIG_CHECK+=" ~DMIID" |
1157 |
- fi |
1158 |
- fi |
1159 |
- |
1160 |
- if kernel_is -lt ${MINKV//./ }; then |
1161 |
- ewarn "Kernel version at least ${MINKV} required" |
1162 |
- fi |
1163 |
- |
1164 |
- check_extra_config |
1165 |
- fi |
1166 |
-} |
1167 |
- |
1168 |
-pkg_setup() { |
1169 |
- : |
1170 |
-} |
1171 |
- |
1172 |
-src_unpack() { |
1173 |
- default |
1174 |
- [[ ${PV} != 9999 ]] || git-r3_src_unpack |
1175 |
-} |
1176 |
- |
1177 |
-src_prepare() { |
1178 |
- # Do NOT add patches here |
1179 |
- local PATCHES=() |
1180 |
- |
1181 |
- [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) |
1182 |
- |
1183 |
- # Add local patches here |
1184 |
- PATCHES+=( |
1185 |
- "${FILESDIR}"/242-gcc-9.patch |
1186 |
- "${FILESDIR}"/242-socket-util-flush-accept.patch |
1187 |
- "${FILESDIR}"/242-wireguard-listenport.patch |
1188 |
- "${FILESDIR}"/242-file-max.patch |
1189 |
- "${FILESDIR}"/242-rdrand-ryzen.patch |
1190 |
- "${FILESDIR}"/242-networkd-ipv6-token.patch |
1191 |
- "${FILESDIR}"/242-network-domains.patch |
1192 |
- ) |
1193 |
- |
1194 |
- if ! use vanilla; then |
1195 |
- PATCHES+=( |
1196 |
- "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch" |
1197 |
- "${FILESDIR}/gentoo-systemd-user-pam.patch" |
1198 |
- "${FILESDIR}/gentoo-generator-path-r1.patch" |
1199 |
- ) |
1200 |
- fi |
1201 |
- |
1202 |
- default |
1203 |
-} |
1204 |
- |
1205 |
-src_configure() { |
1206 |
- # Prevent conflicts with i686 cross toolchain, bug 559726 |
1207 |
- tc-export AR CC NM OBJCOPY RANLIB |
1208 |
- |
1209 |
- python_setup |
1210 |
- |
1211 |
- multilib-minimal_src_configure |
1212 |
-} |
1213 |
- |
1214 |
-meson_use() { |
1215 |
- usex "$1" true false |
1216 |
-} |
1217 |
- |
1218 |
-meson_multilib() { |
1219 |
- if multilib_is_native_abi; then |
1220 |
- echo true |
1221 |
- else |
1222 |
- echo false |
1223 |
- fi |
1224 |
-} |
1225 |
- |
1226 |
-meson_multilib_native_use() { |
1227 |
- if multilib_is_native_abi && use "$1"; then |
1228 |
- echo true |
1229 |
- else |
1230 |
- echo false |
1231 |
- fi |
1232 |
-} |
1233 |
- |
1234 |
-multilib_src_configure() { |
1235 |
- local myconf=( |
1236 |
- --localstatedir="${EPREFIX}/var" |
1237 |
- -Dsupport-url="https://gentoo.org/support/" |
1238 |
- -Dpamlibdir="$(getpam_mod_dir)" |
1239 |
- # avoid bash-completion dep |
1240 |
- -Dbashcompletiondir="$(get_bashcompdir)" |
1241 |
- # make sure we get /bin:/sbin in PATH |
1242 |
- -Dsplit-usr=$(usex split-usr true false) |
1243 |
- -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" |
1244 |
- -Dsysvinit-path= |
1245 |
- -Dsysvrcnd-path= |
1246 |
- # Avoid infinite exec recursion, bug 642724 |
1247 |
- -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" |
1248 |
- # no deps |
1249 |
- -Defi=$(meson_multilib) |
1250 |
- -Dima=true |
1251 |
- # Optional components/dependencies |
1252 |
- -Dacl=$(meson_multilib_native_use acl) |
1253 |
- -Dapparmor=$(meson_multilib_native_use apparmor) |
1254 |
- -Daudit=$(meson_multilib_native_use audit) |
1255 |
- -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup) |
1256 |
- -Dlibcurl=$(meson_multilib_native_use curl) |
1257 |
- -Ddns-over-tls=$(meson_multilib_native_use dns-over-tls) |
1258 |
- -Delfutils=$(meson_multilib_native_use elfutils) |
1259 |
- -Dgcrypt=$(meson_use gcrypt) |
1260 |
- -Dgnu-efi=$(meson_multilib_native_use gnuefi) |
1261 |
- -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)" |
1262 |
- -Dmicrohttpd=$(meson_multilib_native_use http) |
1263 |
- -Dimportd=$(meson_multilib_native_use importd) |
1264 |
- -Dbzip2=$(meson_multilib_native_use importd) |
1265 |
- -Dzlib=$(meson_multilib_native_use importd) |
1266 |
- -Dkmod=$(meson_multilib_native_use kmod) |
1267 |
- -Dlz4=$(meson_use lz4) |
1268 |
- -Dxz=$(meson_use lzma) |
1269 |
- -Dlibiptc=$(meson_multilib_native_use nat) |
1270 |
- -Dpam=$(meson_use pam) |
1271 |
- -Dpcre2=$(meson_multilib_native_use pcre) |
1272 |
- -Dpolkit=$(meson_multilib_native_use policykit) |
1273 |
- -Dqrencode=$(meson_multilib_native_use qrcode) |
1274 |
- -Dseccomp=$(meson_multilib_native_use seccomp) |
1275 |
- -Dselinux=$(meson_multilib_native_use selinux) |
1276 |
- -Ddbus=$(meson_multilib_native_use test) |
1277 |
- -Dxkbcommon=$(meson_multilib_native_use xkb) |
1278 |
- -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
1279 |
- # Breaks screen, tmux, etc. |
1280 |
- -Ddefault-kill-user-processes=false |
1281 |
- -Dcreate-log-dirs=false |
1282 |
- |
1283 |
- # multilib options |
1284 |
- -Dbacklight=$(meson_multilib) |
1285 |
- -Dbinfmt=$(meson_multilib) |
1286 |
- -Dcoredump=$(meson_multilib) |
1287 |
- -Denvironment-d=$(meson_multilib) |
1288 |
- -Dfirstboot=$(meson_multilib) |
1289 |
- -Dhibernate=$(meson_multilib) |
1290 |
- -Dhostnamed=$(meson_multilib) |
1291 |
- -Dhwdb=$(meson_multilib) |
1292 |
- -Dldconfig=$(meson_multilib) |
1293 |
- -Dlocaled=$(meson_multilib) |
1294 |
- -Dman=$(meson_multilib) |
1295 |
- -Dnetworkd=$(meson_multilib) |
1296 |
- -Dquotacheck=$(meson_multilib) |
1297 |
- -Drandomseed=$(meson_multilib) |
1298 |
- -Drfkill=$(meson_multilib) |
1299 |
- -Dsysusers=$(meson_multilib) |
1300 |
- -Dtimedated=$(meson_multilib) |
1301 |
- -Dtimesyncd=$(meson_multilib) |
1302 |
- -Dtmpfiles=$(meson_multilib) |
1303 |
- -Dvconsole=$(meson_multilib) |
1304 |
- ) |
1305 |
- |
1306 |
- if multilib_is_native_abi && use idn; then |
1307 |
- myconf+=( |
1308 |
- -Dlibidn2=$(usex libidn2 true false) |
1309 |
- -Dlibidn=$(usex libidn2 false true) |
1310 |
- ) |
1311 |
- else |
1312 |
- myconf+=( |
1313 |
- -Dlibidn2=false |
1314 |
- -Dlibidn=false |
1315 |
- ) |
1316 |
- fi |
1317 |
- |
1318 |
- meson_src_configure "${myconf[@]}" |
1319 |
-} |
1320 |
- |
1321 |
-multilib_src_compile() { |
1322 |
- eninja |
1323 |
-} |
1324 |
- |
1325 |
-multilib_src_test() { |
1326 |
- unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR |
1327 |
- eninja test |
1328 |
-} |
1329 |
- |
1330 |
-multilib_src_install() { |
1331 |
- DESTDIR="${D}" eninja install |
1332 |
-} |
1333 |
- |
1334 |
-multilib_src_install_all() { |
1335 |
- local rootprefix=$(usex split-usr '' /usr) |
1336 |
- |
1337 |
- # meson doesn't know about docdir |
1338 |
- mv "${ED}"/usr/share/doc/{systemd,${PF}} || die |
1339 |
- |
1340 |
- einstalldocs |
1341 |
- dodoc "${FILESDIR}"/nsswitch.conf |
1342 |
- |
1343 |
- if ! use resolvconf; then |
1344 |
- rm -f "${ED}${rootprefix}"/sbin/resolvconf || die |
1345 |
- fi |
1346 |
- |
1347 |
- if ! use sysv-utils; then |
1348 |
- rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die |
1349 |
- rm "${ED}"/usr/share/man/man1/init.1 || die |
1350 |
- rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die |
1351 |
- fi |
1352 |
- |
1353 |
- if ! use resolvconf && ! use sysv-utils; then |
1354 |
- rmdir "${ED}${rootprefix}"/sbin || die |
1355 |
- fi |
1356 |
- |
1357 |
- # Preserve empty dirs in /etc & /var, bug #437008 |
1358 |
- keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d} |
1359 |
- keepdir /etc/kernel/install.d |
1360 |
- keepdir /etc/systemd/{network,user} |
1361 |
- keepdir /etc/udev/{hwdb.d,rules.d} |
1362 |
- keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown} |
1363 |
- keepdir /usr/lib/{binfmt.d,modules-load.d} |
1364 |
- keepdir /usr/lib/systemd/user-generators |
1365 |
- keepdir /var/lib/systemd |
1366 |
- keepdir /var/log/journal |
1367 |
- |
1368 |
- # Symlink /etc/sysctl.conf for easy migration. |
1369 |
- dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf |
1370 |
- |
1371 |
- local udevdir=/lib/udev |
1372 |
- use split-usr || udevdir=/usr/lib/udev |
1373 |
- |
1374 |
- rm -r "${ED}${udevdir}/hwdb.d" || die |
1375 |
- |
1376 |
- if use split-usr; then |
1377 |
- # Avoid breaking boot/reboot |
1378 |
- dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd |
1379 |
- dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown |
1380 |
- fi |
1381 |
-} |
1382 |
- |
1383 |
-migrate_locale() { |
1384 |
- local envd_locale_def="${EROOT}/etc/env.d/02locale" |
1385 |
- local envd_locale=( "${EROOT}"/etc/env.d/??locale ) |
1386 |
- local locale_conf="${EROOT}/etc/locale.conf" |
1387 |
- |
1388 |
- if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
1389 |
- # If locale.conf does not exist... |
1390 |
- if [[ -e ${envd_locale} ]]; then |
1391 |
- # ...either copy env.d/??locale if there's one |
1392 |
- ebegin "Moving ${envd_locale} to ${locale_conf}" |
1393 |
- mv "${envd_locale}" "${locale_conf}" |
1394 |
- eend ${?} || FAIL=1 |
1395 |
- else |
1396 |
- # ...or create a dummy default |
1397 |
- ebegin "Creating ${locale_conf}" |
1398 |
- cat > "${locale_conf}" <<-EOF |
1399 |
- # This file has been created by the sys-apps/systemd ebuild. |
1400 |
- # See locale.conf(5) and localectl(1). |
1401 |
- |
1402 |
- # LANG=${LANG} |
1403 |
- EOF |
1404 |
- eend ${?} || FAIL=1 |
1405 |
- fi |
1406 |
- fi |
1407 |
- |
1408 |
- if [[ ! -L ${envd_locale} ]]; then |
1409 |
- # now, if env.d/??locale is not a symlink (to locale.conf)... |
1410 |
- if [[ -e ${envd_locale} ]]; then |
1411 |
- # ...warn the user that he has duplicate locale settings |
1412 |
- ewarn |
1413 |
- ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
1414 |
- ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
1415 |
- ewarn "and create the symlink with the following command:" |
1416 |
- ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
1417 |
- ewarn |
1418 |
- else |
1419 |
- # ...or just create the symlink if there's nothing here |
1420 |
- ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
1421 |
- ln -n -s ../locale.conf "${envd_locale_def}" |
1422 |
- eend ${?} || FAIL=1 |
1423 |
- fi |
1424 |
- fi |
1425 |
-} |
1426 |
- |
1427 |
-save_enabled_units() { |
1428 |
- ENABLED_UNITS=() |
1429 |
- type systemctl &>/dev/null || return |
1430 |
- for x; do |
1431 |
- if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then |
1432 |
- ENABLED_UNITS+=( "${x}" ) |
1433 |
- fi |
1434 |
- done |
1435 |
-} |
1436 |
- |
1437 |
-pkg_preinst() { |
1438 |
- save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@××××.service |
1439 |
-} |
1440 |
- |
1441 |
-pkg_postinst() { |
1442 |
- systemd_update_catalog |
1443 |
- |
1444 |
- # Keep this here in case the database format changes so it gets updated |
1445 |
- # when required. Despite that this file is owned by sys-apps/hwids. |
1446 |
- if has_version "sys-apps/hwids[udev]"; then |
1447 |
- udevadm hwdb --update --root="${EROOT}" |
1448 |
- fi |
1449 |
- |
1450 |
- udev_reload || FAIL=1 |
1451 |
- |
1452 |
- # Bug 465468, make sure locales are respect, and ensure consistency |
1453 |
- # between OpenRC & systemd |
1454 |
- migrate_locale |
1455 |
- |
1456 |
- systemd_reenable systemd-networkd.service systemd-resolved.service |
1457 |
- |
1458 |
- if [[ ${ENABLED_UNITS[@]} ]]; then |
1459 |
- systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}" |
1460 |
- fi |
1461 |
- |
1462 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
1463 |
- if type systemctl &>/dev/null; then |
1464 |
- systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1 |
1465 |
- fi |
1466 |
- elog "To enable a useful set of services, run the following:" |
1467 |
- elog " systemctl preset-all --preset-mode=enable-only" |
1468 |
- fi |
1469 |
- |
1470 |
- if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then |
1471 |
- rm "${EROOT}/var/lib/systemd/timesync" |
1472 |
- fi |
1473 |
- |
1474 |
- if [[ -z ${ROOT} && -d /run/systemd/system ]]; then |
1475 |
- ebegin "Reexecuting system manager" |
1476 |
- systemctl daemon-reexec |
1477 |
- eend $? |
1478 |
- fi |
1479 |
- |
1480 |
- if [[ ${FAIL} ]]; then |
1481 |
- eerror "One of the postinst commands failed. Please check the postinst output" |
1482 |
- eerror "for errors. You may need to clean up your system and/or try installing" |
1483 |
- eerror "systemd again." |
1484 |
- eerror |
1485 |
- fi |
1486 |
-} |
1487 |
- |
1488 |
-pkg_prerm() { |
1489 |
- # If removing systemd completely, remove the catalog database. |
1490 |
- if [[ ! ${REPLACED_BY_VERSION} ]]; then |
1491 |
- rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
1492 |
- fi |
1493 |
-} |
1494 |
|
1495 |
diff --git a/sys-apps/systemd/systemd-242-r7.ebuild b/sys-apps/systemd/systemd-242-r7.ebuild |
1496 |
deleted file mode 100644 |
1497 |
index 0313fd20051..00000000000 |
1498 |
--- a/sys-apps/systemd/systemd-242-r7.ebuild |
1499 |
+++ /dev/null |
1500 |
@@ -1,500 +0,0 @@ |
1501 |
-# Copyright 2011-2020 Gentoo Authors |
1502 |
-# Distributed under the terms of the GNU General Public License v2 |
1503 |
- |
1504 |
-EAPI=7 |
1505 |
- |
1506 |
-if [[ ${PV} == 9999 ]]; then |
1507 |
- EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
1508 |
- inherit git-r3 |
1509 |
-else |
1510 |
- MY_PV=${PV/_/-} |
1511 |
- MY_P=${PN}-${MY_PV} |
1512 |
- S=${WORKDIR}/${MY_P} |
1513 |
- SRC_URI="https://github.com/systemd/systemd/archive/v${MY_PV}/${MY_P}.tar.gz" |
1514 |
- KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 sparc x86" |
1515 |
-fi |
1516 |
- |
1517 |
-PYTHON_COMPAT=( python{3_6,3_7} ) |
1518 |
- |
1519 |
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev |
1520 |
- |
1521 |
-DESCRIPTION="System and service manager for Linux" |
1522 |
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
1523 |
- |
1524 |
-LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
1525 |
-SLOT="0/2" |
1526 |
-IUSE="acl apparmor audit build cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod libidn2 +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr +sysv-utils test vanilla xkb" |
1527 |
- |
1528 |
-REQUIRED_USE="importd? ( curl gcrypt lzma )" |
1529 |
-RESTRICT="!test? ( test )" |
1530 |
- |
1531 |
-MINKV="3.11" |
1532 |
- |
1533 |
-COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] |
1534 |
- sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
1535 |
- !<sys-libs/glibc-2.16 |
1536 |
- acl? ( sys-apps/acl:0= ) |
1537 |
- apparmor? ( sys-libs/libapparmor:0= ) |
1538 |
- audit? ( >=sys-process/audit-2:0= ) |
1539 |
- cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) |
1540 |
- curl? ( net-misc/curl:0= ) |
1541 |
- dns-over-tls? ( >=net-libs/gnutls-3.5.3:0= ) |
1542 |
- elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
1543 |
- gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
1544 |
- http? ( |
1545 |
- >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] |
1546 |
- >=net-libs/gnutls-3.1.4:0= |
1547 |
- ) |
1548 |
- idn? ( |
1549 |
- libidn2? ( net-dns/libidn2:= ) |
1550 |
- !libidn2? ( net-dns/libidn:= ) |
1551 |
- ) |
1552 |
- importd? ( |
1553 |
- app-arch/bzip2:0= |
1554 |
- sys-libs/zlib:0= |
1555 |
- ) |
1556 |
- kmod? ( >=sys-apps/kmod-15:0= ) |
1557 |
- lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
1558 |
- lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
1559 |
- nat? ( net-firewall/iptables:0= ) |
1560 |
- pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] ) |
1561 |
- pcre? ( dev-libs/libpcre2 ) |
1562 |
- qrcode? ( media-gfx/qrencode:0= ) |
1563 |
- seccomp? ( >=sys-libs/libseccomp-2.3.3:0= ) |
1564 |
- selinux? ( sys-libs/libselinux:0= ) |
1565 |
- xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )" |
1566 |
- |
1567 |
-# Newer linux-headers needed by ia64, bug #480218 |
1568 |
-DEPEND="${COMMON_DEPEND} |
1569 |
- >=sys-kernel/linux-headers-${MINKV} |
1570 |
- gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
1571 |
-" |
1572 |
- |
1573 |
-# baselayout-2.2 has /run |
1574 |
-RDEPEND="${COMMON_DEPEND} |
1575 |
- acct-group/adm |
1576 |
- acct-group/wheel |
1577 |
- acct-group/kmem |
1578 |
- acct-group/tty |
1579 |
- acct-group/utmp |
1580 |
- acct-group/audio |
1581 |
- acct-group/cdrom |
1582 |
- acct-group/dialout |
1583 |
- acct-group/disk |
1584 |
- acct-group/input |
1585 |
- acct-group/kvm |
1586 |
- acct-group/render |
1587 |
- acct-group/tape |
1588 |
- acct-group/video |
1589 |
- acct-group/systemd-journal |
1590 |
- acct-user/systemd-journal-remote |
1591 |
- acct-user/systemd-coredump |
1592 |
- acct-user/systemd-network |
1593 |
- acct-user/systemd-resolve |
1594 |
- acct-user/systemd-timesync |
1595 |
- >=sys-apps/baselayout-2.2 |
1596 |
- selinux? ( sec-policy/selinux-base-policy[systemd] ) |
1597 |
- sysv-utils? ( !sys-apps/sysvinit ) |
1598 |
- !sysv-utils? ( sys-apps/sysvinit ) |
1599 |
- resolvconf? ( !net-dns/openresolv ) |
1600 |
- !build? ( || ( |
1601 |
- sys-apps/util-linux[kill(-)] |
1602 |
- sys-process/procps[kill(+)] |
1603 |
- sys-apps/coreutils[kill(-)] |
1604 |
- ) ) |
1605 |
- !sys-auth/nss-myhostname |
1606 |
- !<sys-kernel/dracut-044 |
1607 |
- !sys-fs/eudev |
1608 |
- !sys-fs/udev |
1609 |
-" |
1610 |
- |
1611 |
-# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
1612 |
-PDEPEND=">=sys-apps/dbus-1.9.8[systemd] |
1613 |
- >=sys-apps/hwids-20150417[udev] |
1614 |
- >=sys-fs/udev-init-scripts-25 |
1615 |
- policykit? ( sys-auth/polkit ) |
1616 |
- !vanilla? ( sys-apps/gentoo-systemd-integration )" |
1617 |
- |
1618 |
-BDEPEND=" |
1619 |
- app-arch/xz-utils:0 |
1620 |
- dev-util/gperf |
1621 |
- >=dev-util/meson-0.46 |
1622 |
- >=dev-util/intltool-0.50 |
1623 |
- >=sys-apps/coreutils-8.16 |
1624 |
- sys-devel/m4 |
1625 |
- virtual/pkgconfig[${MULTILIB_USEDEP}] |
1626 |
- test? ( sys-apps/dbus ) |
1627 |
- app-text/docbook-xml-dtd:4.2 |
1628 |
- app-text/docbook-xml-dtd:4.5 |
1629 |
- app-text/docbook-xsl-stylesheets |
1630 |
- dev-libs/libxslt:0 |
1631 |
- $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') |
1632 |
-" |
1633 |
- |
1634 |
-pkg_pretend() { |
1635 |
- if [[ ${MERGE_TYPE} != buildonly ]]; then |
1636 |
- if use test && has pid-sandbox ${FEATURES}; then |
1637 |
- ewarn "Tests are known to fail with PID sandboxing enabled." |
1638 |
- ewarn "See https://bugs.gentoo.org/674458." |
1639 |
- fi |
1640 |
- |
1641 |
- local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
1642 |
- ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE |
1643 |
- ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS |
1644 |
- ~TIMERFD ~TMPFS_XATTR ~UNIX |
1645 |
- ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH |
1646 |
- ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
1647 |
- ~!SYSFS_DEPRECATED_V2" |
1648 |
- |
1649 |
- use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
1650 |
- use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" |
1651 |
- kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
1652 |
- kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" |
1653 |
- kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF" |
1654 |
- |
1655 |
- if linux_config_exists; then |
1656 |
- local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
1657 |
- if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then |
1658 |
- ewarn "It's recommended to set an empty value to the following kernel config option:" |
1659 |
- ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
1660 |
- fi |
1661 |
- if linux_chkconfig_present X86; then |
1662 |
- CONFIG_CHECK+=" ~DMIID" |
1663 |
- fi |
1664 |
- fi |
1665 |
- |
1666 |
- if kernel_is -lt ${MINKV//./ }; then |
1667 |
- ewarn "Kernel version at least ${MINKV} required" |
1668 |
- fi |
1669 |
- |
1670 |
- check_extra_config |
1671 |
- fi |
1672 |
-} |
1673 |
- |
1674 |
-pkg_setup() { |
1675 |
- : |
1676 |
-} |
1677 |
- |
1678 |
-src_unpack() { |
1679 |
- default |
1680 |
- [[ ${PV} != 9999 ]] || git-r3_src_unpack |
1681 |
-} |
1682 |
- |
1683 |
-src_prepare() { |
1684 |
- # Do NOT add patches here |
1685 |
- local PATCHES=() |
1686 |
- |
1687 |
- [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) |
1688 |
- |
1689 |
- # Add local patches here |
1690 |
- PATCHES+=( |
1691 |
- "${FILESDIR}"/242-gcc-9.patch |
1692 |
- "${FILESDIR}"/242-socket-util-flush-accept.patch |
1693 |
- "${FILESDIR}"/242-wireguard-listenport.patch |
1694 |
- "${FILESDIR}"/242-file-max.patch |
1695 |
- "${FILESDIR}"/242-rdrand-ryzen.patch |
1696 |
- "${FILESDIR}"/242-networkd-ipv6-token.patch |
1697 |
- "${FILESDIR}"/242-network-domains.patch |
1698 |
- "${FILESDIR}"/CVE-2019-15718.patch |
1699 |
- ) |
1700 |
- |
1701 |
- if ! use vanilla; then |
1702 |
- PATCHES+=( |
1703 |
- "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch" |
1704 |
- "${FILESDIR}/gentoo-systemd-user-pam.patch" |
1705 |
- "${FILESDIR}/gentoo-generator-path-r1.patch" |
1706 |
- ) |
1707 |
- fi |
1708 |
- |
1709 |
- default |
1710 |
-} |
1711 |
- |
1712 |
-src_configure() { |
1713 |
- # Prevent conflicts with i686 cross toolchain, bug 559726 |
1714 |
- tc-export AR CC NM OBJCOPY RANLIB |
1715 |
- |
1716 |
- python_setup |
1717 |
- |
1718 |
- multilib-minimal_src_configure |
1719 |
-} |
1720 |
- |
1721 |
-meson_use() { |
1722 |
- usex "$1" true false |
1723 |
-} |
1724 |
- |
1725 |
-meson_multilib() { |
1726 |
- if multilib_is_native_abi; then |
1727 |
- echo true |
1728 |
- else |
1729 |
- echo false |
1730 |
- fi |
1731 |
-} |
1732 |
- |
1733 |
-meson_multilib_native_use() { |
1734 |
- if multilib_is_native_abi && use "$1"; then |
1735 |
- echo true |
1736 |
- else |
1737 |
- echo false |
1738 |
- fi |
1739 |
-} |
1740 |
- |
1741 |
-multilib_src_configure() { |
1742 |
- local myconf=( |
1743 |
- --localstatedir="${EPREFIX}/var" |
1744 |
- -Dsupport-url="https://gentoo.org/support/" |
1745 |
- -Dpamlibdir="$(getpam_mod_dir)" |
1746 |
- # avoid bash-completion dep |
1747 |
- -Dbashcompletiondir="$(get_bashcompdir)" |
1748 |
- # make sure we get /bin:/sbin in PATH |
1749 |
- -Dsplit-usr=$(usex split-usr true false) |
1750 |
- -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" |
1751 |
- -Dsysvinit-path= |
1752 |
- -Dsysvrcnd-path= |
1753 |
- # Avoid infinite exec recursion, bug 642724 |
1754 |
- -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" |
1755 |
- # no deps |
1756 |
- -Defi=$(meson_multilib) |
1757 |
- -Dima=true |
1758 |
- # Optional components/dependencies |
1759 |
- -Dacl=$(meson_multilib_native_use acl) |
1760 |
- -Dapparmor=$(meson_multilib_native_use apparmor) |
1761 |
- -Daudit=$(meson_multilib_native_use audit) |
1762 |
- -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup) |
1763 |
- -Dlibcurl=$(meson_multilib_native_use curl) |
1764 |
- -Ddns-over-tls=$(meson_multilib_native_use dns-over-tls) |
1765 |
- -Delfutils=$(meson_multilib_native_use elfutils) |
1766 |
- -Dgcrypt=$(meson_use gcrypt) |
1767 |
- -Dgnu-efi=$(meson_multilib_native_use gnuefi) |
1768 |
- -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)" |
1769 |
- -Dmicrohttpd=$(meson_multilib_native_use http) |
1770 |
- -Dimportd=$(meson_multilib_native_use importd) |
1771 |
- -Dbzip2=$(meson_multilib_native_use importd) |
1772 |
- -Dzlib=$(meson_multilib_native_use importd) |
1773 |
- -Dkmod=$(meson_multilib_native_use kmod) |
1774 |
- -Dlz4=$(meson_use lz4) |
1775 |
- -Dxz=$(meson_use lzma) |
1776 |
- -Dlibiptc=$(meson_multilib_native_use nat) |
1777 |
- -Dpam=$(meson_use pam) |
1778 |
- -Dpcre2=$(meson_multilib_native_use pcre) |
1779 |
- -Dpolkit=$(meson_multilib_native_use policykit) |
1780 |
- -Dqrencode=$(meson_multilib_native_use qrcode) |
1781 |
- -Dseccomp=$(meson_multilib_native_use seccomp) |
1782 |
- -Dselinux=$(meson_multilib_native_use selinux) |
1783 |
- -Ddbus=$(meson_multilib_native_use test) |
1784 |
- -Dxkbcommon=$(meson_multilib_native_use xkb) |
1785 |
- -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
1786 |
- # Breaks screen, tmux, etc. |
1787 |
- -Ddefault-kill-user-processes=false |
1788 |
- -Dcreate-log-dirs=false |
1789 |
- |
1790 |
- # multilib options |
1791 |
- -Dbacklight=$(meson_multilib) |
1792 |
- -Dbinfmt=$(meson_multilib) |
1793 |
- -Dcoredump=$(meson_multilib) |
1794 |
- -Denvironment-d=$(meson_multilib) |
1795 |
- -Dfirstboot=$(meson_multilib) |
1796 |
- -Dhibernate=$(meson_multilib) |
1797 |
- -Dhostnamed=$(meson_multilib) |
1798 |
- -Dhwdb=$(meson_multilib) |
1799 |
- -Dldconfig=$(meson_multilib) |
1800 |
- -Dlocaled=$(meson_multilib) |
1801 |
- -Dman=$(meson_multilib) |
1802 |
- -Dnetworkd=$(meson_multilib) |
1803 |
- -Dquotacheck=$(meson_multilib) |
1804 |
- -Drandomseed=$(meson_multilib) |
1805 |
- -Drfkill=$(meson_multilib) |
1806 |
- -Dsysusers=$(meson_multilib) |
1807 |
- -Dtimedated=$(meson_multilib) |
1808 |
- -Dtimesyncd=$(meson_multilib) |
1809 |
- -Dtmpfiles=$(meson_multilib) |
1810 |
- -Dvconsole=$(meson_multilib) |
1811 |
- ) |
1812 |
- |
1813 |
- if multilib_is_native_abi && use idn; then |
1814 |
- myconf+=( |
1815 |
- -Dlibidn2=$(usex libidn2 true false) |
1816 |
- -Dlibidn=$(usex libidn2 false true) |
1817 |
- ) |
1818 |
- else |
1819 |
- myconf+=( |
1820 |
- -Dlibidn2=false |
1821 |
- -Dlibidn=false |
1822 |
- ) |
1823 |
- fi |
1824 |
- |
1825 |
- meson_src_configure "${myconf[@]}" |
1826 |
-} |
1827 |
- |
1828 |
-multilib_src_compile() { |
1829 |
- eninja |
1830 |
-} |
1831 |
- |
1832 |
-multilib_src_test() { |
1833 |
- unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR |
1834 |
- eninja test |
1835 |
-} |
1836 |
- |
1837 |
-multilib_src_install() { |
1838 |
- DESTDIR="${D}" eninja install |
1839 |
-} |
1840 |
- |
1841 |
-multilib_src_install_all() { |
1842 |
- local rootprefix=$(usex split-usr '' /usr) |
1843 |
- |
1844 |
- # meson doesn't know about docdir |
1845 |
- mv "${ED}"/usr/share/doc/{systemd,${PF}} || die |
1846 |
- |
1847 |
- einstalldocs |
1848 |
- dodoc "${FILESDIR}"/nsswitch.conf |
1849 |
- |
1850 |
- if ! use resolvconf; then |
1851 |
- rm -f "${ED}${rootprefix}"/sbin/resolvconf || die |
1852 |
- fi |
1853 |
- |
1854 |
- if ! use sysv-utils; then |
1855 |
- rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die |
1856 |
- rm "${ED}"/usr/share/man/man1/init.1 || die |
1857 |
- rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die |
1858 |
- fi |
1859 |
- |
1860 |
- if ! use resolvconf && ! use sysv-utils; then |
1861 |
- rmdir "${ED}${rootprefix}"/sbin || die |
1862 |
- fi |
1863 |
- |
1864 |
- # Preserve empty dirs in /etc & /var, bug #437008 |
1865 |
- keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d} |
1866 |
- keepdir /etc/kernel/install.d |
1867 |
- keepdir /etc/systemd/{network,user} |
1868 |
- keepdir /etc/udev/{hwdb.d,rules.d} |
1869 |
- keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown} |
1870 |
- keepdir /usr/lib/{binfmt.d,modules-load.d} |
1871 |
- keepdir /usr/lib/systemd/user-generators |
1872 |
- keepdir /var/lib/systemd |
1873 |
- keepdir /var/log/journal |
1874 |
- |
1875 |
- # Symlink /etc/sysctl.conf for easy migration. |
1876 |
- dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf |
1877 |
- |
1878 |
- local udevdir=/lib/udev |
1879 |
- use split-usr || udevdir=/usr/lib/udev |
1880 |
- |
1881 |
- rm -r "${ED}${udevdir}/hwdb.d" || die |
1882 |
- |
1883 |
- if use split-usr; then |
1884 |
- # Avoid breaking boot/reboot |
1885 |
- dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd |
1886 |
- dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown |
1887 |
- fi |
1888 |
-} |
1889 |
- |
1890 |
-migrate_locale() { |
1891 |
- local envd_locale_def="${EROOT}/etc/env.d/02locale" |
1892 |
- local envd_locale=( "${EROOT}"/etc/env.d/??locale ) |
1893 |
- local locale_conf="${EROOT}/etc/locale.conf" |
1894 |
- |
1895 |
- if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
1896 |
- # If locale.conf does not exist... |
1897 |
- if [[ -e ${envd_locale} ]]; then |
1898 |
- # ...either copy env.d/??locale if there's one |
1899 |
- ebegin "Moving ${envd_locale} to ${locale_conf}" |
1900 |
- mv "${envd_locale}" "${locale_conf}" |
1901 |
- eend ${?} || FAIL=1 |
1902 |
- else |
1903 |
- # ...or create a dummy default |
1904 |
- ebegin "Creating ${locale_conf}" |
1905 |
- cat > "${locale_conf}" <<-EOF |
1906 |
- # This file has been created by the sys-apps/systemd ebuild. |
1907 |
- # See locale.conf(5) and localectl(1). |
1908 |
- |
1909 |
- # LANG=${LANG} |
1910 |
- EOF |
1911 |
- eend ${?} || FAIL=1 |
1912 |
- fi |
1913 |
- fi |
1914 |
- |
1915 |
- if [[ ! -L ${envd_locale} ]]; then |
1916 |
- # now, if env.d/??locale is not a symlink (to locale.conf)... |
1917 |
- if [[ -e ${envd_locale} ]]; then |
1918 |
- # ...warn the user that he has duplicate locale settings |
1919 |
- ewarn |
1920 |
- ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
1921 |
- ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
1922 |
- ewarn "and create the symlink with the following command:" |
1923 |
- ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
1924 |
- ewarn |
1925 |
- else |
1926 |
- # ...or just create the symlink if there's nothing here |
1927 |
- ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
1928 |
- ln -n -s ../locale.conf "${envd_locale_def}" |
1929 |
- eend ${?} || FAIL=1 |
1930 |
- fi |
1931 |
- fi |
1932 |
-} |
1933 |
- |
1934 |
-save_enabled_units() { |
1935 |
- ENABLED_UNITS=() |
1936 |
- type systemctl &>/dev/null || return |
1937 |
- for x; do |
1938 |
- if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then |
1939 |
- ENABLED_UNITS+=( "${x}" ) |
1940 |
- fi |
1941 |
- done |
1942 |
-} |
1943 |
- |
1944 |
-pkg_preinst() { |
1945 |
- save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@××××.service |
1946 |
-} |
1947 |
- |
1948 |
-pkg_postinst() { |
1949 |
- systemd_update_catalog |
1950 |
- |
1951 |
- # Keep this here in case the database format changes so it gets updated |
1952 |
- # when required. Despite that this file is owned by sys-apps/hwids. |
1953 |
- if has_version "sys-apps/hwids[udev]"; then |
1954 |
- udevadm hwdb --update --root="${EROOT}" |
1955 |
- fi |
1956 |
- |
1957 |
- udev_reload || FAIL=1 |
1958 |
- |
1959 |
- # Bug 465468, make sure locales are respect, and ensure consistency |
1960 |
- # between OpenRC & systemd |
1961 |
- migrate_locale |
1962 |
- |
1963 |
- systemd_reenable systemd-networkd.service systemd-resolved.service |
1964 |
- |
1965 |
- if [[ ${ENABLED_UNITS[@]} ]]; then |
1966 |
- systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}" |
1967 |
- fi |
1968 |
- |
1969 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
1970 |
- if type systemctl &>/dev/null; then |
1971 |
- systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1 |
1972 |
- fi |
1973 |
- elog "To enable a useful set of services, run the following:" |
1974 |
- elog " systemctl preset-all --preset-mode=enable-only" |
1975 |
- fi |
1976 |
- |
1977 |
- if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then |
1978 |
- rm "${EROOT}/var/lib/systemd/timesync" |
1979 |
- fi |
1980 |
- |
1981 |
- if [[ -z ${ROOT} && -d /run/systemd/system ]]; then |
1982 |
- ebegin "Reexecuting system manager" |
1983 |
- systemctl daemon-reexec |
1984 |
- eend $? |
1985 |
- fi |
1986 |
- |
1987 |
- if [[ ${FAIL} ]]; then |
1988 |
- eerror "One of the postinst commands failed. Please check the postinst output" |
1989 |
- eerror "for errors. You may need to clean up your system and/or try installing" |
1990 |
- eerror "systemd again." |
1991 |
- eerror |
1992 |
- fi |
1993 |
-} |
1994 |
- |
1995 |
-pkg_prerm() { |
1996 |
- # If removing systemd completely, remove the catalog database. |
1997 |
- if [[ ! ${REPLACED_BY_VERSION} ]]; then |
1998 |
- rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
1999 |
- fi |
2000 |
-} |
2001 |
|
2002 |
diff --git a/sys-apps/systemd/systemd-243.ebuild b/sys-apps/systemd/systemd-243.ebuild |
2003 |
deleted file mode 100644 |
2004 |
index 5777fc95e76..00000000000 |
2005 |
--- a/sys-apps/systemd/systemd-243.ebuild |
2006 |
+++ /dev/null |
2007 |
@@ -1,492 +0,0 @@ |
2008 |
-# Copyright 2011-2020 Gentoo Authors |
2009 |
-# Distributed under the terms of the GNU General Public License v2 |
2010 |
- |
2011 |
-EAPI=7 |
2012 |
- |
2013 |
-if [[ ${PV} == 9999 ]]; then |
2014 |
- EGIT_REPO_URI="https://github.com/systemd/systemd.git" |
2015 |
- inherit git-r3 |
2016 |
-else |
2017 |
- MY_PV=${PV/_/-} |
2018 |
- MY_P=${PN}-${MY_PV} |
2019 |
- S=${WORKDIR}/${MY_P} |
2020 |
- SRC_URI="https://github.com/systemd/systemd/archive/v${MY_PV}/${MY_P}.tar.gz" |
2021 |
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
2022 |
-fi |
2023 |
- |
2024 |
-PYTHON_COMPAT=( python{3_6,3_7} ) |
2025 |
- |
2026 |
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev |
2027 |
- |
2028 |
-DESCRIPTION="System and service manager for Linux" |
2029 |
-HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" |
2030 |
- |
2031 |
-LICENSE="GPL-2 LGPL-2.1 MIT public-domain" |
2032 |
-SLOT="0/2" |
2033 |
-IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr +sysv-utils test vanilla xkb" |
2034 |
- |
2035 |
-REQUIRED_USE="importd? ( curl gcrypt lzma )" |
2036 |
-RESTRICT="!test? ( test )" |
2037 |
- |
2038 |
-MINKV="3.11" |
2039 |
- |
2040 |
-COMMON_DEPEND=">=sys-apps/util-linux-2.30:0=[${MULTILIB_USEDEP}] |
2041 |
- sys-libs/libcap:0=[${MULTILIB_USEDEP}] |
2042 |
- !<sys-libs/glibc-2.16 |
2043 |
- acl? ( sys-apps/acl:0= ) |
2044 |
- apparmor? ( sys-libs/libapparmor:0= ) |
2045 |
- audit? ( >=sys-process/audit-2:0= ) |
2046 |
- cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) |
2047 |
- curl? ( net-misc/curl:0= ) |
2048 |
- dns-over-tls? ( >=net-libs/gnutls-3.5.3:0= ) |
2049 |
- elfutils? ( >=dev-libs/elfutils-0.158:0= ) |
2050 |
- gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) |
2051 |
- http? ( |
2052 |
- >=net-libs/libmicrohttpd-0.9.33:0=[epoll(+)] |
2053 |
- >=net-libs/gnutls-3.1.4:0= |
2054 |
- ) |
2055 |
- idn? ( net-dns/libidn2:= ) |
2056 |
- importd? ( |
2057 |
- app-arch/bzip2:0= |
2058 |
- sys-libs/zlib:0= |
2059 |
- ) |
2060 |
- kmod? ( >=sys-apps/kmod-15:0= ) |
2061 |
- lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
2062 |
- lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) |
2063 |
- nat? ( net-firewall/iptables:0= ) |
2064 |
- pam? ( sys-libs/pam:=[${MULTILIB_USEDEP}] ) |
2065 |
- pcre? ( dev-libs/libpcre2 ) |
2066 |
- qrcode? ( media-gfx/qrencode:0= ) |
2067 |
- seccomp? ( >=sys-libs/libseccomp-2.3.3:0= ) |
2068 |
- selinux? ( sys-libs/libselinux:0= ) |
2069 |
- xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )" |
2070 |
- |
2071 |
-# Newer linux-headers needed by ia64, bug #480218 |
2072 |
-DEPEND="${COMMON_DEPEND} |
2073 |
- >=sys-kernel/linux-headers-${MINKV} |
2074 |
- gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) |
2075 |
-" |
2076 |
- |
2077 |
-# baselayout-2.2 has /run |
2078 |
-RDEPEND="${COMMON_DEPEND} |
2079 |
- acct-group/adm |
2080 |
- acct-group/wheel |
2081 |
- acct-group/kmem |
2082 |
- acct-group/tty |
2083 |
- acct-group/utmp |
2084 |
- acct-group/audio |
2085 |
- acct-group/cdrom |
2086 |
- acct-group/dialout |
2087 |
- acct-group/disk |
2088 |
- acct-group/input |
2089 |
- acct-group/kvm |
2090 |
- acct-group/render |
2091 |
- acct-group/tape |
2092 |
- acct-group/video |
2093 |
- acct-group/systemd-journal |
2094 |
- acct-user/systemd-journal-remote |
2095 |
- acct-user/systemd-coredump |
2096 |
- acct-user/systemd-network |
2097 |
- acct-user/systemd-resolve |
2098 |
- acct-user/systemd-timesync |
2099 |
- >=sys-apps/baselayout-2.2 |
2100 |
- selinux? ( sec-policy/selinux-base-policy[systemd] ) |
2101 |
- sysv-utils? ( !sys-apps/sysvinit ) |
2102 |
- !sysv-utils? ( sys-apps/sysvinit ) |
2103 |
- resolvconf? ( !net-dns/openresolv ) |
2104 |
- !build? ( || ( |
2105 |
- sys-apps/util-linux[kill(-)] |
2106 |
- sys-process/procps[kill(+)] |
2107 |
- sys-apps/coreutils[kill(-)] |
2108 |
- ) ) |
2109 |
- !sys-auth/nss-myhostname |
2110 |
- !<sys-kernel/dracut-044 |
2111 |
- !sys-fs/eudev |
2112 |
- !sys-fs/udev |
2113 |
-" |
2114 |
- |
2115 |
-# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) |
2116 |
-PDEPEND=">=sys-apps/dbus-1.9.8[systemd] |
2117 |
- >=sys-apps/hwids-20150417[udev] |
2118 |
- >=sys-fs/udev-init-scripts-25 |
2119 |
- policykit? ( sys-auth/polkit ) |
2120 |
- !vanilla? ( sys-apps/gentoo-systemd-integration )" |
2121 |
- |
2122 |
-BDEPEND=" |
2123 |
- app-arch/xz-utils:0 |
2124 |
- dev-util/gperf |
2125 |
- >=dev-util/meson-0.46 |
2126 |
- >=dev-util/intltool-0.50 |
2127 |
- >=sys-apps/coreutils-8.16 |
2128 |
- sys-devel/m4 |
2129 |
- virtual/pkgconfig[${MULTILIB_USEDEP}] |
2130 |
- test? ( sys-apps/dbus ) |
2131 |
- app-text/docbook-xml-dtd:4.2 |
2132 |
- app-text/docbook-xml-dtd:4.5 |
2133 |
- app-text/docbook-xsl-stylesheets |
2134 |
- dev-libs/libxslt:0 |
2135 |
- $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') |
2136 |
-" |
2137 |
- |
2138 |
-pkg_pretend() { |
2139 |
- if [[ ${MERGE_TYPE} != buildonly ]]; then |
2140 |
- if use test && has pid-sandbox ${FEATURES}; then |
2141 |
- ewarn "Tests are known to fail with PID sandboxing enabled." |
2142 |
- ewarn "See https://bugs.gentoo.org/674458." |
2143 |
- fi |
2144 |
- |
2145 |
- local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS |
2146 |
- ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE |
2147 |
- ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS |
2148 |
- ~TIMERFD ~TMPFS_XATTR ~UNIX |
2149 |
- ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH |
2150 |
- ~!FW_LOADER_USER_HELPER_FALLBACK ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED |
2151 |
- ~!SYSFS_DEPRECATED_V2" |
2152 |
- |
2153 |
- use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" |
2154 |
- use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" |
2155 |
- kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" |
2156 |
- kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" |
2157 |
- kernel_is -ge 4 10 && CONFIG_CHECK+=" ~CGROUP_BPF" |
2158 |
- |
2159 |
- if linux_config_exists; then |
2160 |
- local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) |
2161 |
- if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then |
2162 |
- ewarn "It's recommended to set an empty value to the following kernel config option:" |
2163 |
- ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" |
2164 |
- fi |
2165 |
- if linux_chkconfig_present X86; then |
2166 |
- CONFIG_CHECK+=" ~DMIID" |
2167 |
- fi |
2168 |
- fi |
2169 |
- |
2170 |
- if kernel_is -lt ${MINKV//./ }; then |
2171 |
- ewarn "Kernel version at least ${MINKV} required" |
2172 |
- fi |
2173 |
- |
2174 |
- check_extra_config |
2175 |
- fi |
2176 |
-} |
2177 |
- |
2178 |
-pkg_setup() { |
2179 |
- : |
2180 |
-} |
2181 |
- |
2182 |
-src_unpack() { |
2183 |
- default |
2184 |
- [[ ${PV} != 9999 ]] || git-r3_src_unpack |
2185 |
-} |
2186 |
- |
2187 |
-src_prepare() { |
2188 |
- # Do NOT add patches here |
2189 |
- local PATCHES=() |
2190 |
- |
2191 |
- [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) |
2192 |
- |
2193 |
- # Add local patches here |
2194 |
- PATCHES+=( |
2195 |
- ) |
2196 |
- |
2197 |
- if ! use vanilla; then |
2198 |
- PATCHES+=( |
2199 |
- "${FILESDIR}/gentoo-Dont-enable-audit-by-default.patch" |
2200 |
- "${FILESDIR}/gentoo-systemd-user-pam.patch" |
2201 |
- "${FILESDIR}/gentoo-generator-path-r1.patch" |
2202 |
- ) |
2203 |
- fi |
2204 |
- |
2205 |
- default |
2206 |
-} |
2207 |
- |
2208 |
-src_configure() { |
2209 |
- # Prevent conflicts with i686 cross toolchain, bug 559726 |
2210 |
- tc-export AR CC NM OBJCOPY RANLIB |
2211 |
- |
2212 |
- python_setup |
2213 |
- |
2214 |
- multilib-minimal_src_configure |
2215 |
-} |
2216 |
- |
2217 |
-meson_use() { |
2218 |
- usex "$1" true false |
2219 |
-} |
2220 |
- |
2221 |
-meson_multilib() { |
2222 |
- if multilib_is_native_abi; then |
2223 |
- echo true |
2224 |
- else |
2225 |
- echo false |
2226 |
- fi |
2227 |
-} |
2228 |
- |
2229 |
-meson_multilib_native_use() { |
2230 |
- if multilib_is_native_abi && use "$1"; then |
2231 |
- echo true |
2232 |
- else |
2233 |
- echo false |
2234 |
- fi |
2235 |
-} |
2236 |
- |
2237 |
-multilib_src_configure() { |
2238 |
- local myconf=( |
2239 |
- --localstatedir="${EPREFIX}/var" |
2240 |
- -Dsupport-url="https://gentoo.org/support/" |
2241 |
- -Dpamlibdir="$(getpam_mod_dir)" |
2242 |
- # avoid bash-completion dep |
2243 |
- -Dbashcompletiondir="$(get_bashcompdir)" |
2244 |
- # make sure we get /bin:/sbin in PATH |
2245 |
- -Dsplit-usr=$(usex split-usr true false) |
2246 |
- -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" |
2247 |
- -Dsysvinit-path= |
2248 |
- -Dsysvrcnd-path= |
2249 |
- # Avoid infinite exec recursion, bug 642724 |
2250 |
- -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" |
2251 |
- # no deps |
2252 |
- -Defi=$(meson_multilib) |
2253 |
- -Dima=true |
2254 |
- -Ddefault-hierarchy=$(usex cgroup-hybrid hybrid unified) |
2255 |
- # Optional components/dependencies |
2256 |
- -Dacl=$(meson_multilib_native_use acl) |
2257 |
- -Dapparmor=$(meson_multilib_native_use apparmor) |
2258 |
- -Daudit=$(meson_multilib_native_use audit) |
2259 |
- -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup) |
2260 |
- -Dlibcurl=$(meson_multilib_native_use curl) |
2261 |
- -Ddns-over-tls=$(meson_multilib_native_use dns-over-tls) |
2262 |
- -Delfutils=$(meson_multilib_native_use elfutils) |
2263 |
- -Dgcrypt=$(meson_use gcrypt) |
2264 |
- -Dgnu-efi=$(meson_multilib_native_use gnuefi) |
2265 |
- -Defi-libdir="${ESYSROOT}/usr/$(get_libdir)" |
2266 |
- -Dmicrohttpd=$(meson_multilib_native_use http) |
2267 |
- -Didn=$(meson_multilib_native_use idn) |
2268 |
- -Dimportd=$(meson_multilib_native_use importd) |
2269 |
- -Dbzip2=$(meson_multilib_native_use importd) |
2270 |
- -Dzlib=$(meson_multilib_native_use importd) |
2271 |
- -Dkmod=$(meson_multilib_native_use kmod) |
2272 |
- -Dlz4=$(meson_use lz4) |
2273 |
- -Dxz=$(meson_use lzma) |
2274 |
- -Dlibiptc=$(meson_multilib_native_use nat) |
2275 |
- -Dpam=$(meson_use pam) |
2276 |
- -Dpcre2=$(meson_multilib_native_use pcre) |
2277 |
- -Dpolkit=$(meson_multilib_native_use policykit) |
2278 |
- -Dqrencode=$(meson_multilib_native_use qrcode) |
2279 |
- -Dseccomp=$(meson_multilib_native_use seccomp) |
2280 |
- -Dselinux=$(meson_multilib_native_use selinux) |
2281 |
- -Ddbus=$(meson_multilib_native_use test) |
2282 |
- -Dxkbcommon=$(meson_multilib_native_use xkb) |
2283 |
- -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" |
2284 |
- # Breaks screen, tmux, etc. |
2285 |
- -Ddefault-kill-user-processes=false |
2286 |
- -Dcreate-log-dirs=false |
2287 |
- |
2288 |
- # multilib options |
2289 |
- -Dbacklight=$(meson_multilib) |
2290 |
- -Dbinfmt=$(meson_multilib) |
2291 |
- -Dcoredump=$(meson_multilib) |
2292 |
- -Denvironment-d=$(meson_multilib) |
2293 |
- -Dfirstboot=$(meson_multilib) |
2294 |
- -Dhibernate=$(meson_multilib) |
2295 |
- -Dhostnamed=$(meson_multilib) |
2296 |
- -Dhwdb=$(meson_multilib) |
2297 |
- -Dldconfig=$(meson_multilib) |
2298 |
- -Dlocaled=$(meson_multilib) |
2299 |
- -Dman=$(meson_multilib) |
2300 |
- -Dnetworkd=$(meson_multilib) |
2301 |
- -Dquotacheck=$(meson_multilib) |
2302 |
- -Drandomseed=$(meson_multilib) |
2303 |
- -Drfkill=$(meson_multilib) |
2304 |
- -Dsysusers=$(meson_multilib) |
2305 |
- -Dtimedated=$(meson_multilib) |
2306 |
- -Dtimesyncd=$(meson_multilib) |
2307 |
- -Dtmpfiles=$(meson_multilib) |
2308 |
- -Dvconsole=$(meson_multilib) |
2309 |
- ) |
2310 |
- |
2311 |
- meson_src_configure "${myconf[@]}" |
2312 |
-} |
2313 |
- |
2314 |
-multilib_src_compile() { |
2315 |
- eninja |
2316 |
-} |
2317 |
- |
2318 |
-multilib_src_test() { |
2319 |
- unset DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR |
2320 |
- meson_src_test |
2321 |
-} |
2322 |
- |
2323 |
-multilib_src_install() { |
2324 |
- DESTDIR="${D}" eninja install |
2325 |
-} |
2326 |
- |
2327 |
-multilib_src_install_all() { |
2328 |
- local rootprefix=$(usex split-usr '' /usr) |
2329 |
- |
2330 |
- # meson doesn't know about docdir |
2331 |
- mv "${ED}"/usr/share/doc/{systemd,${PF}} || die |
2332 |
- |
2333 |
- einstalldocs |
2334 |
- dodoc "${FILESDIR}"/nsswitch.conf |
2335 |
- |
2336 |
- if ! use resolvconf; then |
2337 |
- rm -f "${ED}${rootprefix}"/sbin/resolvconf || die |
2338 |
- fi |
2339 |
- |
2340 |
- if ! use sysv-utils; then |
2341 |
- rm "${ED}${rootprefix}"/sbin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit} || die |
2342 |
- rm "${ED}"/usr/share/man/man1/init.1 || die |
2343 |
- rm "${ED}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 || die |
2344 |
- fi |
2345 |
- |
2346 |
- if ! use resolvconf && ! use sysv-utils; then |
2347 |
- rmdir "${ED}${rootprefix}"/sbin || die |
2348 |
- fi |
2349 |
- |
2350 |
- # Preserve empty dirs in /etc & /var, bug #437008 |
2351 |
- keepdir /etc/{binfmt.d,modules-load.d,tmpfiles.d} |
2352 |
- keepdir /etc/kernel/install.d |
2353 |
- keepdir /etc/systemd/{network,system,user} |
2354 |
- keepdir /etc/udev/{hwdb.d,rules.d} |
2355 |
- keepdir "${rootprefix}"/lib/systemd/{system-sleep,system-shutdown} |
2356 |
- keepdir /usr/lib/{binfmt.d,modules-load.d} |
2357 |
- keepdir /usr/lib/systemd/user-generators |
2358 |
- keepdir /var/lib/systemd |
2359 |
- keepdir /var/log/journal |
2360 |
- |
2361 |
- # Symlink /etc/sysctl.conf for easy migration. |
2362 |
- dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf |
2363 |
- |
2364 |
- rm -r "${ED}${rootprefix}"/lib/udev/hwdb.d || die |
2365 |
- |
2366 |
- if use split-usr; then |
2367 |
- # Avoid breaking boot/reboot |
2368 |
- dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd |
2369 |
- dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown |
2370 |
- fi |
2371 |
-} |
2372 |
- |
2373 |
-migrate_locale() { |
2374 |
- local envd_locale_def="${EROOT}/etc/env.d/02locale" |
2375 |
- local envd_locale=( "${EROOT}"/etc/env.d/??locale ) |
2376 |
- local locale_conf="${EROOT}/etc/locale.conf" |
2377 |
- |
2378 |
- if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then |
2379 |
- # If locale.conf does not exist... |
2380 |
- if [[ -e ${envd_locale} ]]; then |
2381 |
- # ...either copy env.d/??locale if there's one |
2382 |
- ebegin "Moving ${envd_locale} to ${locale_conf}" |
2383 |
- mv "${envd_locale}" "${locale_conf}" |
2384 |
- eend ${?} || FAIL=1 |
2385 |
- else |
2386 |
- # ...or create a dummy default |
2387 |
- ebegin "Creating ${locale_conf}" |
2388 |
- cat > "${locale_conf}" <<-EOF |
2389 |
- # This file has been created by the sys-apps/systemd ebuild. |
2390 |
- # See locale.conf(5) and localectl(1). |
2391 |
- |
2392 |
- # LANG=${LANG} |
2393 |
- EOF |
2394 |
- eend ${?} || FAIL=1 |
2395 |
- fi |
2396 |
- fi |
2397 |
- |
2398 |
- if [[ ! -L ${envd_locale} ]]; then |
2399 |
- # now, if env.d/??locale is not a symlink (to locale.conf)... |
2400 |
- if [[ -e ${envd_locale} ]]; then |
2401 |
- # ...warn the user that he has duplicate locale settings |
2402 |
- ewarn |
2403 |
- ewarn "To ensure consistent behavior, you should replace ${envd_locale}" |
2404 |
- ewarn "with a symlink to ${locale_conf}. Please migrate your settings" |
2405 |
- ewarn "and create the symlink with the following command:" |
2406 |
- ewarn "ln -s -n -f ../locale.conf ${envd_locale}" |
2407 |
- ewarn |
2408 |
- else |
2409 |
- # ...or just create the symlink if there's nothing here |
2410 |
- ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" |
2411 |
- ln -n -s ../locale.conf "${envd_locale_def}" |
2412 |
- eend ${?} || FAIL=1 |
2413 |
- fi |
2414 |
- fi |
2415 |
-} |
2416 |
- |
2417 |
-save_enabled_units() { |
2418 |
- ENABLED_UNITS=() |
2419 |
- type systemctl &>/dev/null || return |
2420 |
- for x; do |
2421 |
- if systemctl --quiet --root="${ROOT:-/}" is-enabled "${x}"; then |
2422 |
- ENABLED_UNITS+=( "${x}" ) |
2423 |
- fi |
2424 |
- done |
2425 |
-} |
2426 |
- |
2427 |
-pkg_preinst() { |
2428 |
- save_enabled_units {machines,remote-{cryptsetup,fs}}.target getty@××××.service |
2429 |
- |
2430 |
- if ! use split-usr; then |
2431 |
- local dir |
2432 |
- for dir in bin sbin lib; do |
2433 |
- if [[ ! ${EROOT}/${dir} -ef ${EROOT}/usr/${dir} ]]; then |
2434 |
- eerror "\"${EROOT}/${dir}\" and \"${EROOT}/usr/${dir}\" are not merged." |
2435 |
- eerror "One of them should be a symbolic link to the other one." |
2436 |
- FAIL=1 |
2437 |
- fi |
2438 |
- done |
2439 |
- if [[ ${FAIL} ]]; then |
2440 |
- eerror "Migration to system layout with merged directories must be performed before" |
2441 |
- eerror "rebuilding ${CATEGORY}/${PN} with USE=\"-split-usr\" to avoid run-time breakage." |
2442 |
- die "System layout with split directories still used" |
2443 |
- fi |
2444 |
- fi |
2445 |
-} |
2446 |
- |
2447 |
-pkg_postinst() { |
2448 |
- systemd_update_catalog |
2449 |
- |
2450 |
- # Keep this here in case the database format changes so it gets updated |
2451 |
- # when required. Despite that this file is owned by sys-apps/hwids. |
2452 |
- if has_version "sys-apps/hwids[udev]"; then |
2453 |
- udevadm hwdb --update --root="${EROOT}" |
2454 |
- fi |
2455 |
- |
2456 |
- udev_reload || FAIL=1 |
2457 |
- |
2458 |
- # Bug 465468, make sure locales are respect, and ensure consistency |
2459 |
- # between OpenRC & systemd |
2460 |
- migrate_locale |
2461 |
- |
2462 |
- systemd_reenable systemd-networkd.service systemd-resolved.service |
2463 |
- |
2464 |
- if [[ ${ENABLED_UNITS[@]} ]]; then |
2465 |
- systemctl --root="${ROOT:-/}" enable "${ENABLED_UNITS[@]}" |
2466 |
- fi |
2467 |
- |
2468 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
2469 |
- if type systemctl &>/dev/null; then |
2470 |
- systemctl --root="${ROOT:-/}" enable getty@.service remote-fs.target || FAIL=1 |
2471 |
- fi |
2472 |
- elog "To enable a useful set of services, run the following:" |
2473 |
- elog " systemctl preset-all --preset-mode=enable-only" |
2474 |
- fi |
2475 |
- |
2476 |
- if [[ -L ${EROOT}/var/lib/systemd/timesync ]]; then |
2477 |
- rm "${EROOT}/var/lib/systemd/timesync" |
2478 |
- fi |
2479 |
- |
2480 |
- if [[ -z ${ROOT} && -d /run/systemd/system ]]; then |
2481 |
- ebegin "Reexecuting system manager" |
2482 |
- systemctl daemon-reexec |
2483 |
- eend $? |
2484 |
- fi |
2485 |
- |
2486 |
- if [[ ${FAIL} ]]; then |
2487 |
- eerror "One of the postinst commands failed. Please check the postinst output" |
2488 |
- eerror "for errors. You may need to clean up your system and/or try installing" |
2489 |
- eerror "systemd again." |
2490 |
- eerror |
2491 |
- fi |
2492 |
-} |
2493 |
- |
2494 |
-pkg_prerm() { |
2495 |
- # If removing systemd completely, remove the catalog database. |
2496 |
- if [[ ! ${REPLACED_BY_VERSION} ]]; then |
2497 |
- rm -f -v "${EROOT}"/var/lib/systemd/catalog/database |
2498 |
- fi |
2499 |
-} |