1 |
commit: 4963c4ebb04f862691cbb8a769709d34e86eb953 |
2 |
Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me> |
3 |
AuthorDate: Mon Mar 9 23:21:19 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 10 19:49:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4963c4eb |
7 |
|
8 |
sys-kernel/dracut: Version bump to 050 |
9 |
|
10 |
* Switch back to tarballs from kernel.org |
11 |
* Remove redundant gcc paths in ldconfig_paths() |
12 |
|
13 |
Closes: https://bugs.gentoo.org/705728 |
14 |
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me> |
15 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
16 |
|
17 |
sys-kernel/dracut/Manifest | 1 + |
18 |
sys-kernel/dracut/dracut-050.ebuild | 165 +++++++++++++++++++++ |
19 |
.../files/050-Makefile-fix-VERSION-again.patch | 34 +++++ |
20 |
...erge-main-version-and-git-version-earlier.patch | 78 ++++++++++ |
21 |
...on-t-call-fsfreeze-on-subvol-of-root-file.patch | 75 ++++++++++ |
22 |
.../dracut/files/050-gentoo-ldconfig-paths.patch | 39 +++++ |
23 |
6 files changed, 392 insertions(+) |
24 |
|
25 |
diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest |
26 |
index 7b97320d25d..a2441ad9a7f 100644 |
27 |
--- a/sys-kernel/dracut/Manifest |
28 |
+++ b/sys-kernel/dracut/Manifest |
29 |
@@ -4,3 +4,4 @@ DIST dracut-046.tar.xz 299520 BLAKE2B 1e2d848aa0db0e90734d8c60610a60b1f0ff67f8c4 |
30 |
DIST dracut-047.tar.xz 305836 BLAKE2B 18333ae1e24cfbbb6a152bf9ba2c48884821f6a506344259ba56c581a9f3efac7b4c88e8ca149ef1f83347a5e4d59acba61e42b8e0ab3a9e9beb8684d5db28b0 SHA512 03369726b6c2b682d0c9dead7b7dbd1c3989aaf2b4a561015634d33a94e5230d03cb634c3890191b19dd8c1c83389533ae1a46d45d2024ba885e0d2d46c5d035 |
31 |
DIST dracut-048.tar.xz 308484 BLAKE2B b19c8122034a8b40cbc9d09245730900b59691c336f1d231e768786ad64068e0a8daf57ae9a4182ab50d9e1c683c9b7dcac354eb26d8a60f061db78121bc11c7 SHA512 97fcfd5d314ef40687c245d95d2f1d0f3f9ff0472e66b6e6324bf9bd6b98186104f9d71fd9af344126d6ea9fa47b744d52831a374225633225f6f17fb15c04e0 |
32 |
DIST dracut-049.tar.gz 376857 BLAKE2B e50084164e26aae6de812345cc76782435ec84951b44eea454355d0c65fe84fdd0858733de534bdf018bdfd92922f0be30b74d74be329a918e55d96c5e4d4fb6 SHA512 51489570856538588868a66c7bcc8a3728574592529905484526c523398dc1b8f1416e6b264780303acd08d818417a9668b76f1d64d3194432b5af79dc15c9f7 |
33 |
+DIST dracut-050.tar.xz 333592 BLAKE2B cb0bfa5a8e7547260b8a80a3606eb284182c062926269c85b09e07d26ad177df0eeaa64b17005bff9290611f1c83fc8cd8e2216cfe14b5e66ec7f659d4c2fa7b SHA512 eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850 |
34 |
|
35 |
diff --git a/sys-kernel/dracut/dracut-050.ebuild b/sys-kernel/dracut/dracut-050.ebuild |
36 |
new file mode 100644 |
37 |
index 00000000000..5b09940bf76 |
38 |
--- /dev/null |
39 |
+++ b/sys-kernel/dracut/dracut-050.ebuild |
40 |
@@ -0,0 +1,165 @@ |
41 |
+# Copyright 1999-2020 Gentoo Authors |
42 |
+# Distributed under the terms of the GNU General Public License v2 |
43 |
+ |
44 |
+EAPI=7 |
45 |
+ |
46 |
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs |
47 |
+ |
48 |
+if [[ ${PV} == 9999 ]] ; then |
49 |
+ inherit git-r3 |
50 |
+ EGIT_REPO_URI="https://github.com/dracutdevs/dracut" |
51 |
+else |
52 |
+ [[ "${PV}" = *_rc* ]] || \ |
53 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
54 |
+ SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz" |
55 |
+fi |
56 |
+ |
57 |
+DESCRIPTION="Generic initramfs generation tool" |
58 |
+HOMEPAGE="https://dracut.wiki.kernel.org" |
59 |
+ |
60 |
+LICENSE="GPL-2" |
61 |
+SLOT="0" |
62 |
+IUSE="selinux" |
63 |
+ |
64 |
+# Tests need root privileges, bug #298014 |
65 |
+RESTRICT="test" |
66 |
+ |
67 |
+RDEPEND=" |
68 |
+ app-arch/cpio |
69 |
+ >=app-shells/bash-4.0:0 |
70 |
+ sys-apps/coreutils[xattr(-)] |
71 |
+ >=sys-apps/kmod-23[tools] |
72 |
+ || ( |
73 |
+ >=sys-apps/sysvinit-2.87-r3 |
74 |
+ sys-apps/openrc[sysv-utils(-),selinux?] |
75 |
+ sys-apps/systemd[sysv-utils] |
76 |
+ ) |
77 |
+ >=sys-apps/util-linux-2.21 |
78 |
+ virtual/pkgconfig |
79 |
+ virtual/udev |
80 |
+ |
81 |
+ elibc_musl? ( sys-libs/fts-standalone ) |
82 |
+ selinux? ( |
83 |
+ sec-policy/selinux-dracut |
84 |
+ sys-libs/libselinux |
85 |
+ sys-libs/libsepol |
86 |
+ ) |
87 |
+" |
88 |
+DEPEND=" |
89 |
+ >=sys-apps/kmod-23 |
90 |
+ elibc_musl? ( sys-libs/fts-standalone ) |
91 |
+" |
92 |
+ |
93 |
+BDEPEND=" |
94 |
+ app-text/asciidoc |
95 |
+ app-text/docbook-xml-dtd:4.5 |
96 |
+ >=app-text/docbook-xsl-stylesheets-1.75.2 |
97 |
+ >=dev-libs/libxslt-1.1.26 |
98 |
+ virtual/pkgconfig |
99 |
+" |
100 |
+ |
101 |
+DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules |
102 |
+ README.testsuite TODO ) |
103 |
+ |
104 |
+QA_MULTILIB_PATHS="usr/lib/dracut/.*" |
105 |
+ |
106 |
+PATCHES=( |
107 |
+ "${FILESDIR}"/050-Makefile-merge-main-version-and-git-version-earlier.patch |
108 |
+ "${FILESDIR}"/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch |
109 |
+ "${FILESDIR}"/050-Makefile-fix-VERSION-again.patch |
110 |
+ "${FILESDIR}"/050-gentoo-ldconfig-paths.patch |
111 |
+) |
112 |
+ |
113 |
+src_configure() { |
114 |
+ local myconf=( |
115 |
+ --prefix="${EPREFIX}/usr" |
116 |
+ --sysconfdir="${EPREFIX}/etc" |
117 |
+ --bashcompletiondir="$(get_bashcompdir)" |
118 |
+ --systemdsystemunitdir="$(systemd_get_systemunitdir)" |
119 |
+ ) |
120 |
+ |
121 |
+ tc-export CC PKG_CONFIG |
122 |
+ |
123 |
+ echo ./configure "${myconf[@]}" |
124 |
+ ./configure "${myconf[@]}" || die |
125 |
+ |
126 |
+ if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then |
127 |
+ # Source tarball from github doesn't include this file |
128 |
+ echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die |
129 |
+ fi |
130 |
+} |
131 |
+ |
132 |
+src_install() { |
133 |
+ default |
134 |
+ |
135 |
+ insinto /etc/logrotate.d |
136 |
+ newins dracut.logrotate dracut |
137 |
+ |
138 |
+ docinto html |
139 |
+ dodoc dracut.html |
140 |
+} |
141 |
+ |
142 |
+pkg_postinst() { |
143 |
+ if linux-info_get_any_version && linux_config_exists; then |
144 |
+ ewarn "" |
145 |
+ ewarn "If the following test report contains a missing kernel" |
146 |
+ ewarn "configuration option, you should reconfigure and rebuild your" |
147 |
+ ewarn "kernel before booting image generated with this Dracut version." |
148 |
+ ewarn "" |
149 |
+ |
150 |
+ local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS" |
151 |
+ |
152 |
+ # Kernel configuration options descriptions: |
153 |
+ local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" ' |
154 |
+ ERROR_DEVTMPFS+='is missing and REQUIRED' |
155 |
+ local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk ' |
156 |
+ ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED' |
157 |
+ |
158 |
+ check_extra_config |
159 |
+ echo |
160 |
+ else |
161 |
+ ewarn "" |
162 |
+ ewarn "Your kernel configuration couldn't be checked." |
163 |
+ ewarn "Please check manually if following options are enabled:" |
164 |
+ ewarn "" |
165 |
+ ewarn " CONFIG_BLK_DEV_INITRD" |
166 |
+ ewarn " CONFIG_DEVTMPFS" |
167 |
+ ewarn "" |
168 |
+ fi |
169 |
+ |
170 |
+ elog "To get additional features, a number of optional runtime" |
171 |
+ elog "dependencies may be installed:" |
172 |
+ elog "" |
173 |
+ optfeature "Networking support" net-misc/networkmanager |
174 |
+ optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \ |
175 |
+ sys-apps/iproute2 "net-misc/iputils[arping]" |
176 |
+ optfeature \ |
177 |
+ "Measure performance of the boot process for later visualisation" \ |
178 |
+ app-benchmarks/bootchart2 app-admin/killproc sys-process/acct |
179 |
+ optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs |
180 |
+ optfeature "Load kernel modules and drop this privilege for real init" \ |
181 |
+ sys-libs/libcap |
182 |
+ optfeature "Support CIFS" net-fs/cifs-utils |
183 |
+ optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \ |
184 |
+ "sys-fs/cryptsetup[-static-libs]" |
185 |
+ optfeature "Support for GPG-encrypted keys for crypt module" \ |
186 |
+ app-crypt/gnupg |
187 |
+ optfeature \ |
188 |
+ "Allows use of dash instead of default bash (on your own risk)" \ |
189 |
+ app-shells/dash |
190 |
+ optfeature "Support iSCSI" sys-block/open-iscsi |
191 |
+ optfeature "Support Logical Volume Manager" sys-fs/lvm2 |
192 |
+ optfeature "Support MD devices, also known as software RAID devices" \ |
193 |
+ sys-fs/mdadm |
194 |
+ optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools |
195 |
+ optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5' |
196 |
+ optfeature "Support network block devices" sys-block/nbd |
197 |
+ optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind |
198 |
+ optfeature \ |
199 |
+ "Install ssh and scp along with config files and specified keys" \ |
200 |
+ net-misc/openssh |
201 |
+ optfeature "Enable logging with rsyslog" app-admin/rsyslog |
202 |
+ optfeature \ |
203 |
+ "Enable rngd service to help generating entropy early during boot" \ |
204 |
+ sys-apps/rng-tools |
205 |
+} |
206 |
|
207 |
diff --git a/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch |
208 |
new file mode 100644 |
209 |
index 00000000000..a091e4c9fac |
210 |
--- /dev/null |
211 |
+++ b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch |
212 |
@@ -0,0 +1,34 @@ |
213 |
+From a76aa8e39016a8564adb0f18f93bbf2e15d3243f Mon Sep 17 00:00:00 2001 |
214 |
+From: Alexander Tsoy <alexander@××××.me> |
215 |
+Date: Sun, 8 Mar 2020 05:47:50 +0300 |
216 |
+Subject: [PATCH] Makefile: fix VERSION again |
217 |
+ |
218 |
+The variable is not undefined anymore after the first assignment, so |
219 |
+we should check if variable is empty instead. |
220 |
+--- |
221 |
+ Makefile | 8 ++++++-- |
222 |
+ 1 file changed, 6 insertions(+), 2 deletions(-) |
223 |
+ |
224 |
+diff --git a/Makefile b/Makefile |
225 |
+index c69e2dfc..02e2c4b5 100644 |
226 |
+--- a/Makefile |
227 |
++++ b/Makefile |
228 |
+@@ -1,9 +1,13 @@ |
229 |
+ -include dracut-version.sh |
230 |
+ |
231 |
+ DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :) |
232 |
+-DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION) |
233 |
++ifeq ($(DRACUT_MAIN_VERSION),) |
234 |
++DRACUT_MAIN_VERSION = $(DRACUT_VERSION) |
235 |
++endif |
236 |
+ DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :) |
237 |
+-DRACUT_FULL_VERSION ?= $(DRACUT_VERSION) |
238 |
++ifeq ($(DRACUT_FULL_VERSION),) |
239 |
++DRACUT_FULL_VERSION = $(DRACUT_VERSION) |
240 |
++endif |
241 |
+ |
242 |
+ -include Makefile.inc |
243 |
+ |
244 |
+-- |
245 |
+2.24.1 |
246 |
+ |
247 |
|
248 |
diff --git a/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch b/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch |
249 |
new file mode 100644 |
250 |
index 00000000000..49c532b9299 |
251 |
--- /dev/null |
252 |
+++ b/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch |
253 |
@@ -0,0 +1,78 @@ |
254 |
+From eb8a7a96351b6e1cfd9dc34f1e854333a8f4a4e0 Mon Sep 17 00:00:00 2001 |
255 |
+From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= |
256 |
+ <congdanhqx@×××××.com> |
257 |
+Date: Fri, 6 Mar 2020 08:46:36 +0700 |
258 |
+Subject: [PATCH] Makefile: merge main-version and git-version earlier |
259 |
+ |
260 |
+With GNU Make 4.3 on both ArchLinux, and VoidLinux, |
261 |
+GITVERION is always empty because of bad substitution. |
262 |
+Change '\#' to simply '#' can fix it, |
263 |
+but we don't need that complation. |
264 |
+ |
265 |
+We can merge DRACUT_MAIN_VERSION and GITVERSION into DRACUT_FULL_VERSION. |
266 |
+Because, GITVERSION will be attached back to DRACUT_MAIN_VERSION in all |
267 |
+situation. |
268 |
+ |
269 |
+While we're at it, detect if we're in git worktree by: |
270 |
+limiting GIT_CEILING_DIRECTORIES to parent directory of |
271 |
+dracut's top level directory; instead of checking for .git directory, |
272 |
+in order to support git-worktree, in such case, .git will be a file, see |
273 |
+gitrepository-layout(5) |
274 |
+--- |
275 |
+ Makefile | 13 +++++++------ |
276 |
+ 1 file changed, 7 insertions(+), 6 deletions(-) |
277 |
+ |
278 |
+diff --git a/Makefile b/Makefile |
279 |
+index 22b584f1..c69e2dfc 100644 |
280 |
+--- a/Makefile |
281 |
++++ b/Makefile |
282 |
+@@ -1,8 +1,9 @@ |
283 |
+ -include dracut-version.sh |
284 |
+ |
285 |
+-DRACUT_MAIN_VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || :) |
286 |
++DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :) |
287 |
+ DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION) |
288 |
+-GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } ) |
289 |
++DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :) |
290 |
++DRACUT_FULL_VERSION ?= $(DRACUT_VERSION) |
291 |
+ |
292 |
+ -include Makefile.inc |
293 |
+ |
294 |
+@@ -92,14 +93,14 @@ endif |
295 |
+ |
296 |
+ %.xml: %.asc |
297 |
+ @rm -f -- "$@" |
298 |
+- asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $< |
299 |
++ asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $< |
300 |
+ |
301 |
+ dracut.8: dracut.usage.asc dracut.8.asc |
302 |
+ |
303 |
+ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc |
304 |
+ @rm -f -- dracut.xml |
305 |
+ asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \ |
306 |
+- -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \ |
307 |
++ -a "version=$(DRACUT_FULL_VERSION)" \ |
308 |
+ -a numbered \ |
309 |
+ -d book -b docbook -o dracut.xml dracut.asc |
310 |
+ @rm -f -- dracut.html |
311 |
+@@ -112,7 +113,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc |
312 |
+ dracut.pc: Makefile.inc Makefile |
313 |
+ @echo "Name: dracut" > dracut.pc |
314 |
+ @echo "Description: dracut" >> dracut.pc |
315 |
+- @echo "Version: $(DRACUT_MAIN_VERSION)$(GITVERSION)" >> dracut.pc |
316 |
++ @echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc |
317 |
+ @echo "dracutdir=$(pkglibdir)" >> dracut.pc |
318 |
+ @echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc |
319 |
+ @echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc |
320 |
+@@ -182,7 +183,7 @@ endif |
321 |
+ |
322 |
+ dracut-version.sh: |
323 |
+ @rm -f dracut-version.sh |
324 |
+- @echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)$(GITVERSION)" > dracut-version.sh |
325 |
++ @echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh |
326 |
+ |
327 |
+ clean: |
328 |
+ $(RM) *~ |
329 |
+-- |
330 |
+2.24.1 |
331 |
+ |
332 |
|
333 |
diff --git a/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch b/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch |
334 |
new file mode 100644 |
335 |
index 00000000000..cf54cabb5eb |
336 |
--- /dev/null |
337 |
+++ b/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch |
338 |
@@ -0,0 +1,75 @@ |
339 |
+From 0386e4627779cb51f4292b3c642d90586d5e71b4 Mon Sep 17 00:00:00 2001 |
340 |
+From: Martin Wilck <mwilck@××××.com> |
341 |
+Date: Wed, 29 Jan 2020 23:53:29 +0100 |
342 |
+Subject: [PATCH] dracut.sh: don't call fsfreeze on subvol of root file system |
343 |
+ |
344 |
+dracut.sh already doesn't call fsfreeze if the output file is on |
345 |
+the root file system. For btrfs, however, this is not sufficient. |
346 |
+Because fsfreeze is a superblock operation, and all btrfs subvolumes |
347 |
+share the same superblock, fsfreeze may freeze the entire system |
348 |
+if the subvolume on which the output file is written and / are |
349 |
+subvolumes of the same file system. Avoid this by comparing file |
350 |
+system UUIDs for btrfs. |
351 |
+ |
352 |
+Fixes: de576db3c225 ("call fsfreeze(8) on /boot to flush initramfs data & metadata to media") |
353 |
+--- |
354 |
+ dracut.sh | 36 +++++++++++++++++++++++++++++++++++- |
355 |
+ 1 file changed, 35 insertions(+), 1 deletion(-) |
356 |
+ |
357 |
+diff --git a/dracut.sh b/dracut.sh |
358 |
+index af346f3a..c14f6c0b 100755 |
359 |
+--- a/dracut.sh |
360 |
++++ b/dracut.sh |
361 |
+@@ -2075,6 +2075,40 @@ fi |
362 |
+ |
363 |
+ command -v restorecon &>/dev/null && restorecon -- "$outfile" |
364 |
+ |
365 |
++btrfs_uuid() { |
366 |
++ btrfs filesystem show "$1" | sed -n '1s/^.*uuid: //p' |
367 |
++} |
368 |
++ |
369 |
++freeze_ok_for_btrfs() { |
370 |
++ local mnt uuid1 uuid2 |
371 |
++ # If the output file is on btrfs, we need to make sure that it's |
372 |
++ # not on a subvolume of the same file system as the root FS. |
373 |
++ # Otherwise, fsfreeze() might freeze the entire system. |
374 |
++ # This is most conveniently checked by comparing the FS uuid. |
375 |
++ |
376 |
++ [[ "$(stat -f -c %T -- "/")" == "btrfs" ]] || return 0 |
377 |
++ mnt=$(stat -c %m -- "$1") |
378 |
++ uuid1=$(btrfs_uuid "$mnt") |
379 |
++ uuid2=$(btrfs_uuid "/") |
380 |
++ [[ "$uuid1" && "$uuid2" && "$uuid1" != "$uuid2" ]] |
381 |
++} |
382 |
++ |
383 |
++freeze_ok_for_fstype() { |
384 |
++ local outfile=$1 |
385 |
++ local fstype |
386 |
++ |
387 |
++ [[ "$(stat -c %m -- "$outfile")" == "/" ]] && return 1 |
388 |
++ fstype=$(stat -f -c %T -- "$outfile") |
389 |
++ case $fstype in |
390 |
++ msdos) |
391 |
++ return 1;; |
392 |
++ btrfs) |
393 |
++ freeze_ok_for_btrfs "$outfile";; |
394 |
++ *) |
395 |
++ return 0;; |
396 |
++ esac |
397 |
++} |
398 |
++ |
399 |
+ # We sync/fsfreeze only if we're operating on a live booted system. |
400 |
+ # It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, |
401 |
+ # and there's no reason to sync, and *definitely* no reason to fsfreeze. |
402 |
+@@ -2087,7 +2121,7 @@ if test -d $dracutsysrootdir/run/systemd/system; then |
403 |
+ fi |
404 |
+ |
405 |
+ # use fsfreeze only if we're not writing to / |
406 |
+- if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then |
407 |
++ if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then |
408 |
+ if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then |
409 |
+ dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" |
410 |
+ fi |
411 |
+-- |
412 |
+2.24.1 |
413 |
+ |
414 |
|
415 |
diff --git a/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch |
416 |
new file mode 100644 |
417 |
index 00000000000..15522ef4fc1 |
418 |
--- /dev/null |
419 |
+++ b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch |
420 |
@@ -0,0 +1,39 @@ |
421 |
+From 0674b9136831b1beb6a7ec91147fd5c280c693a3 Mon Sep 17 00:00:00 2001 |
422 |
+From: Alexander Tsoy <alexander@××××.me> |
423 |
+Date: Mon, 9 Mar 2020 02:47:07 +0300 |
424 |
+Subject: [PATCH] Remove redundant gcc paths in ldconfig_paths() |
425 |
+ |
426 |
+Bug: https://bugs.gentoo.org/705728 |
427 |
+--- |
428 |
+ dracut-functions.sh | 15 ++++++++++++++- |
429 |
+ 1 file changed, 14 insertions(+), 1 deletion(-) |
430 |
+ |
431 |
+diff --git a/dracut-functions.sh b/dracut-functions.sh |
432 |
+index 3cb9c7af..5337ff6c 100755 |
433 |
+--- a/dracut-functions.sh |
434 |
++++ b/dracut-functions.sh |
435 |
+@@ -76,7 +76,20 @@ find_binary() { |
436 |
+ |
437 |
+ ldconfig_paths() |
438 |
+ { |
439 |
+- $DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq |
440 |
++ local gccpath |
441 |
++ |
442 |
++ if type -P gcc-config &>/dev/null; then |
443 |
++ gccpath=$(gcc-config -c) |
444 |
++ gccpath=/usr/lib/gcc/${gccpath%-*}/${gccpath##*-} |
445 |
++ fi |
446 |
++ |
447 |
++ while read -r line; do |
448 |
++ if [[ ${line} != /usr/lib/gcc/* || -z ${gccpath} ]]; then |
449 |
++ echo ${line} |
450 |
++ elif [[ ${line} == ${gccpath} ]]; then |
451 |
++ echo ${line} |
452 |
++ fi |
453 |
++ done < <($DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq) |
454 |
+ } |
455 |
+ |
456 |
+ # Version comparision function. Assumes Linux style version scheme. |
457 |
+-- |
458 |
+2.24.1 |
459 |
+ |