public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2016-11-04 18:39 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2016-11-04 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     9c93a9970c02f14ba821fae6850868f83e75579a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  4 18:37:27 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Nov  4 18:39:54 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c93a997

sys-kernel/dracut: apply a few patches

Bug: https://bugs.gentoo.org/544438#c5
Bug: https://bugs.gentoo.org/586254
Bug: https://github.com/dracutdevs/dracut/pull/169
Package-Manager: portage-2.3.2_p4

 sys-kernel/dracut/dracut-044-r1.ebuild             | 263 +++++++++++++++++++++
 ...-lib.sh-dev_unit_name-guard-against-dev-b.patch |  32 +++
 ...temd-initrd-add-initrd-root-device.target.patch |  24 ++
 ...03-50-dracut.install-use-bin-bash-shebang.patch |  23 ++
 4 files changed, 342 insertions(+)

diff --git a/sys-kernel/dracut/dracut-044-r1.ebuild b/sys-kernel/dracut/dracut-044-r1.ebuild
new file mode 100644
index 00000000..c873fd6
--- /dev/null
+++ b/sys-kernel/dracut/dracut-044-r1.ebuild
@@ -0,0 +1,263 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils linux-info multilib systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux systemd"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	systemd? ( >=sys-apps/systemd-199 )
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0
+	>sys-apps/kmod-5[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+		sys-apps/systemd-sysv-utils
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	virtual/pkgconfig
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+MY_LIBDIR=/usr/lib
+QA_MULTILIB_PATHS="
+	usr/lib/dracut/dracut-install
+	usr/lib/dracut/skipcpio
+	"
+
+PATCHES=(
+	"${FILESDIR}"/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
+	"${FILESDIR}"/044-0002-systemd-initrd-add-initrd-root-device.target.patch
+	"${FILESDIR}"/044-0003-50-dracut.install-use-bin-bash-shebang.patch
+)
+
+#
+# Helper functions
+#
+
+# Removes module from modules.d.
+# $1 = module name
+# Module name can be specified without number prefix.
+rm_module() {
+	local force m
+	[[ $1 = -f ]] && force=-f
+
+	for m in $@; do
+		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
+			rm ${force} --interactive=never -r "${modules_dir}"/$m
+		else
+			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
+		fi
+	done
+}
+
+src_prepare() {
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	sed -e "3alibdirs=\"${libdirs}\"" \
+		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
+	einfo "Setting udevdir to ${udevdir}..."
+	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	if use systemd; then
+		local systemdutildir="$(systemd_get_utildir)"
+		local systemdsystemunitdir="$(systemd_get_unitdir)"
+		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
+			--variable=systemdsystemconfdir)"
+		[[ ${systemdsystemconfdir} ]] \
+			|| systemdsystemconfdir=/etc/systemd/system
+		einfo "Setting systemdutildir to ${systemdutildir} and ..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
+		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
+		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	else
+		local systemdutildir="/lib/systemd"
+		einfo "Setting systemdutildir for standalone udev to" \
+			"${systemdutildir}..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	fi
+
+	epatch "${PATCHES[@]}"
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf=(
+		--libdir="${MY_LIBDIR}"
+		--bashcompletiondir="$(get_bashcompdir)"
+	)
+
+	if use systemd; then
+		myconf+=( --systemdsystemunitdir="$(systemd_get_unitdir)" )
+	fi
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	tc-export CC
+	emake doc install/dracut-install skipcpio/skipcpio
+}
+
+src_install() {
+	default
+
+	local my_libdir="${MY_LIBDIR}"
+	local dracutlibdir="${my_libdir#/}/dracut"
+
+	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
+
+	insinto "${dracutlibdir}/dracut.conf.d/"
+	newins dracut.conf.d/gentoo.conf.example gentoo.conf
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dohtml dracut.html
+
+	if ! use systemd; then
+		# Scripts in kernel/install.d are systemd-specific
+		rm -r "${D%/}/${my_libdir}/kernel" || die
+	fi
+
+	#
+	# Modules
+	#
+	local module
+	modules_dir="${D%/}/${dracutlibdir}/modules.d"
+
+	use debug || rm_module 95debug
+	use selinux || rm_module 98selinux
+
+	if use systemd; then
+		# With systemd following modules do not make sense
+		rm_module 96securityfs 97masterkey 98integrity
+	else
+		rm_module 00systemd 98dracut-systemd
+		# Without systemd following modules do not make sense
+		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
+	fi
+
+	# Remove modules which won't work for sure
+	rm_module 95fcoe # no tools
+	# fips module depends on masked app-crypt/hmaccalc
+	rm_module 01fips 02fips-aesni
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Framebuffer splash (media-gfx/splashutils)" \
+		media-gfx/splashutils
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch b/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
new file mode 100644
index 00000000..fd6f118
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
@@ -0,0 +1,32 @@
+From c41df7e1db1adc51399ab2c22f251b15eb2065b1 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Tue, 5 Jan 2016 22:11:57 +0300
+Subject: [PATCH] base/dracut-lib.sh:dev_unit_name() guard against $dev
+ beginning with "-"
+
+crypt/parse-crypt.sh generate initqueue job which always call
+dev_unit_name() with an argument beginning with "-". This results
+in the following error:
+
+dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
+dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
+---
+ modules.d/99base/dracut-lib.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
+index ad03394..0a0b1b9 100755
+--- a/modules.d/99base/dracut-lib.sh
++++ b/modules.d/99base/dracut-lib.sh
+@@ -874,7 +874,7 @@ dev_unit_name()
+     local dev="$1"
+ 
+     if command -v systemd-escape >/dev/null; then
+-        systemd-escape -p  "$dev"
++        systemd-escape -p -- "$dev"
+         return
+     fi
+ 
+-- 
+2.10.2
+

diff --git a/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch b/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch
new file mode 100644
index 00000000..21cb679
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0002-systemd-initrd-add-initrd-root-device.target.patch
@@ -0,0 +1,24 @@
+From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald@redhat.com>
+Date: Wed, 25 May 2016 15:06:29 +0200
+Subject: [PATCH] systemd-initrd: add initrd-root-device.target
+
+---
+ modules.d/01systemd-initrd/module-setup.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh
+index fb6a9ea..c1ccd2a 100755
+--- a/modules.d/01systemd-initrd/module-setup.sh
++++ b/modules.d/01systemd-initrd/module-setup.sh
+@@ -28,6 +28,7 @@ install() {
+     inst_multiple -o \
+         $systemdsystemunitdir/initrd.target \
+         $systemdsystemunitdir/initrd-fs.target \
++        $systemdsystemunitdir/initrd-root-device.target \
+         $systemdsystemunitdir/initrd-root-fs.target \
+         $systemdsystemunitdir/initrd-switch-root.target \
+         $systemdsystemunitdir/initrd-switch-root.service \
+-- 
+2.10.2
+

diff --git a/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch b/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch
new file mode 100644
index 00000000..85ebc7e
--- /dev/null
+++ b/sys-kernel/dracut/files/044-0003-50-dracut.install-use-bin-bash-shebang.patch
@@ -0,0 +1,23 @@
+From 69395a528aed99ec04b16c14ebacf4c2e10afd26 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 4 Nov 2016 13:09:28 -0400
+Subject: [PATCH] 50-dracut.install: use /bin/bash shebang
+
+This script utilizes several bash-specific constructs.
+---
+ 50-dracut.install | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/50-dracut.install b/50-dracut.install
+index 7d081d5..54c71d4 100755
+--- a/50-dracut.install
++++ b/50-dracut.install
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ 
+ COMMAND="$1"
+ KERNEL_VERSION="$2"
+-- 
+2.10.2
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2024-09-30  9:09 Andrew Ammerlaan
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew Ammerlaan @ 2024-09-30  9:09 UTC (permalink / raw
  To: gentoo-commits

commit:     a194e7ae1a9a4949f3e64d20c8cc7865e4c9f06c
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 30 09:08:48 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Sep 30 09:08:48 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a194e7ae

sys-kernel/dracut: backport fix for including libsystemd-core always

Issue was reported on Discord

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 .../{dracut-103-r3.ebuild => dracut-103-r4.ebuild}  |  2 ++
 .../dracut-103-always-install-libsystemd.patch      | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/sys-kernel/dracut/dracut-103-r3.ebuild b/sys-kernel/dracut/dracut-103-r4.ebuild
similarity index 98%
rename from sys-kernel/dracut/dracut-103-r3.ebuild
rename to sys-kernel/dracut/dracut-103-r4.ebuild
index b64be3a7f82f..2e6c11185065 100644
--- a/sys-kernel/dracut/dracut-103-r3.ebuild
+++ b/sys-kernel/dracut/dracut-103-r4.ebuild
@@ -68,6 +68,8 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-103-acct-user-group-gentoo.patch
 	# https://github.com/dracut-ng/dracut-ng/pull/507
 	"${FILESDIR}"/${PN}-103-systemd-udev-256-kmod.patch
+	# libsystemd-core is sometimes missing
+	"${FILESDIR}"/${PN}-103-always-install-libsystemd.patch
 )
 
 src_configure() {

diff --git a/sys-kernel/dracut/files/dracut-103-always-install-libsystemd.patch b/sys-kernel/dracut/files/dracut-103-always-install-libsystemd.patch
new file mode 100644
index 000000000000..f2533e14d8cd
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-103-always-install-libsystemd.patch
@@ -0,0 +1,21 @@
+From 921792f201e954de461d3b551e01b5369d666db8 Mon Sep 17 00:00:00 2001
+From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
+Date: Tue, 10 Sep 2024 15:51:46 +0200
+Subject: [PATCH] feat(systemd): always install libsystemd libraries
+
+---
+ modules.d/00systemd/module-setup.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
+index 498cd7edd..fb8a8200b 100755
+--- a/modules.d/00systemd/module-setup.sh
++++ b/modules.d/00systemd/module-setup.sh
+@@ -156,5 +156,6 @@ EOF
+     _arch=${DRACUT_ARCH:-$(uname -m)}
+     inst_libdir_file \
+         {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \
+-        {"tls/$_arch/",tls/,"$_arch/",}"libnss_*"
++        {"tls/$_arch/",tls/,"$_arch/",}"libnss_*" \
++        {"tls/$_arch/",tls/,"$_arch/",}"systemd/libsystemd*.so"
+ }


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2023-12-13  9:19 Andrew Ammerlaan
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew Ammerlaan @ 2023-12-13  9:19 UTC (permalink / raw
  To: gentoo-commits

commit:     32774e9d9e056831857e7aaf6aeed10498e9de39
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 13 09:17:35 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Wed Dec 13 09:17:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32774e9d

sys-kernel/dracut: backport fix for systemd-255 pcrphase

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 ...030.ebuild => dracut-060_pre20231030-r1.ebuild} |  1 +
 .../dracut/files/dracut-060-systemd-255.patch      | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/sys-kernel/dracut/dracut-060_pre20231030.ebuild b/sys-kernel/dracut/dracut-060_pre20231030-r1.ebuild
similarity index 98%
rename from sys-kernel/dracut/dracut-060_pre20231030.ebuild
rename to sys-kernel/dracut/dracut-060_pre20231030-r1.ebuild
index 639d28605329..cdb6f8ce433f 100644
--- a/sys-kernel/dracut/dracut-060_pre20231030.ebuild
+++ b/sys-kernel/dracut/dracut-060_pre20231030-r1.ebuild
@@ -69,6 +69,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 PATCHES=(
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 	"${FILESDIR}"/dracut-060-fix-resume-hostonly.patch
+	"${FILESDIR}"/dracut-060-systemd-255.patch
 )
 
 src_configure() {

diff --git a/sys-kernel/dracut/files/dracut-060-systemd-255.patch b/sys-kernel/dracut/files/dracut-060-systemd-255.patch
new file mode 100644
index 000000000000..9d577e9504da
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-060-systemd-255.patch
@@ -0,0 +1,26 @@
+https://github.com/dracutdevs/dracut/pull/2586/files
+diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh
+index fa960a42c1..87efd0c1a6 100755
+--- a/modules.d/01systemd-pcrphase/module-setup.sh
++++ b/modules.d/01systemd-pcrphase/module-setup.sh
+@@ -6,7 +6,11 @@
+ check() {
+ 
+     # If the binary(s) requirements are not fulfilled the module can't be installed.
+-    require_binaries "$systemdutildir"/systemd-pcrphase || return 1
++    # systemd-255 renamed the binary, check for old and new location.
++    if ! require_binaries "$systemdutildir"/systemd-pcrphase && \
++       ! require_binaries "$systemdutildir"/systemd-pcrextend; then
++       return 1
++    fi
+ 
+     # Return 255 to only include the module, if another module requires it.
+     return 255
+@@ -28,6 +32,7 @@ install() {
+ 
+     inst_multiple -o \
+         "$systemdutildir"/systemd-pcrphase \
++        "$systemdutildir"/systemd-pcrextend \
+         "$systemdsystemunitdir"/systemd-pcrphase-initrd.service \
+         "$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \
+         "$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2023-09-22  6:10 Andrew Ammerlaan
  0 siblings, 0 replies; 20+ messages in thread
From: Andrew Ammerlaan @ 2023-09-22  6:10 UTC (permalink / raw
  To: gentoo-commits

commit:     a0ff41c3e81b6adb74bea3c15ce7e894753eef6b
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 21 08:54:47 2023 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Fri Sep 22 06:10:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0ff41c3

sys-kernel/dracut: backport uki kernel-install fixes

Fixes installing manually configured kernel in uki layout and
allows dropping workaround from dist-kernel-utils.eclass

Provides compatibility with systemd-254's ukify plugin

Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/32961
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sys-kernel/dracut/dracut-059-r4.ebuild             | 185 +++++++++++++++++++++
 .../dracut/files/059-kernel-install-uki.patch      | 150 +++++++++++++++++
 2 files changed, 335 insertions(+)

diff --git a/sys-kernel/dracut/dracut-059-r4.ebuild b/sys-kernel/dracut/dracut-059-r4.ebuild
new file mode 100644
index 000000000000..90c42349d4a5
--- /dev/null
+++ b/sys-kernel/dracut/dracut-059-r4.ebuild
@@ -0,0 +1,185 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	if [[ "${PV}" != *_rc* ]]; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+	fi
+	SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/openrc[sysv-utils(-),selinux?]
+		sys-apps/systemd[sysv-utils]
+		sys-apps/s6-linux-init[sysv-utils(-)]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	elibc_musl? ( sys-libs/fts-standalone )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+"
+DEPEND="
+	>=sys-apps/kmod-23
+	elibc_musl? ( sys-libs/fts-standalone )
+"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+"
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
+	"${FILESDIR}"/gentoo-network-r1.patch
+	"${FILESDIR}"/059-kernel-install-uki.patch
+	"${FILESDIR}"/059-uefi-split-usr.patch
+	"${FILESDIR}"/059-uki-systemd-254.patch
+	"${FILESDIR}"/059-gawk.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
+		# Source tarball from github doesn't include this file
+		echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+	fi
+}
+
+src_test() {
+	if [[ ${EUID} != 0 ]]; then
+		# Tests need root privileges, bug #298014
+		ewarn "Skipping tests: Not running as root."
+	elif [[ ! -w /dev/kvm ]]; then
+		ewarn "Skipping tests: Unable to access /dev/kvm."
+	else
+		emake -C test check
+	fi
+}
+
+src_install() {
+	local DOCS=(
+		AUTHORS
+		NEWS.md
+		README.md
+		docs/README.cross
+		docs/README.generic
+		docs/README.kernel
+		docs/SECURITY.md
+	)
+
+	default
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature \
+		"Allows use of busybox instead of default bash (on your own risk)" \
+		sys-apps/busybox
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm sys-fs/dmraid
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		virtual/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+	optfeature "Support Squashfs" sys-fs/squashfs-tools
+	optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
+	optfeature "Support Bluetooth (experimental)" net-wireless/bluez
+	optfeature "Support BIOS-given device names" sys-apps/biosdevname
+	optfeature "Support network NVMe" sys-apps/nvme-cli
+	optfeature \
+		"Enable rngd service to help generating entropy early during boot" \
+		sys-apps/rng-tools
+}

diff --git a/sys-kernel/dracut/files/059-kernel-install-uki.patch b/sys-kernel/dracut/files/059-kernel-install-uki.patch
new file mode 100644
index 000000000000..9bbf3574b7a2
--- /dev/null
+++ b/sys-kernel/dracut/files/059-kernel-install-uki.patch
@@ -0,0 +1,150 @@
+Combination of:
+- https://github.com/dracutdevs/dracut/pull/2405
+- https://github.com/dracutdevs/dracut/pull/2495
+- https://github.com/dracutdevs/dracut/pull/2521
+
+Fixes installing manually configured kernel in uki layout and
+allows dropping workaround from dist-kernel-utils.eclass
+
+Provides compatibility with systemd-254's ukify plugin
+
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -2594,6 +2594,9 @@ freeze_ok_for_fstype() {
+         zfs)
+             return 1
+             ;;
++        tmpfs)
++            return 1
++            ;;
+         btrfs)
+             freeze_ok_for_btrfs "$outfile"
+             ;;
+--- a/install.d/50-dracut.install	2023-09-21 10:19:00.843827541 +0200
++++ b/install.d/50-dracut.install	2023-07-20 16:53:51.000000000 +0200
+@@ -11,27 +11,69 @@
+     exit 0
+ fi
+
+-if [[ -d "$BOOT_DIR_ABS" ]]; then
+-    INITRD="initrd"
++# Do not attempt to create initramfs if the supplied image is already a UKI
++if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
++    exit 0
++fi
++
++# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
++if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
++    BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
++    if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then
++        # No uki generator preference set or we have been chosen
++        IMAGE="uki.efi"
++        UEFI_OPTS="--uefi"
++    elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
++        # We aren't the uki generator, but we have been requested to make the initrd
++        IMAGE="initrd"
++        UEFI_OPTS="--no-uefi"
++    else
++        exit 0
++    fi
++elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
++    BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
++    if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then
++        IMAGE="initrd"
++        UEFI_OPTS="--no-uefi"
++    else
++        exit 0
++    fi
+ else
+-    BOOT_DIR_ABS="/boot"
+-    INITRD="initramfs-${KERNEL_VERSION}.img"
++    # No layout information, use users --uefi/--no-uefi preference
++    UEFI_OPTS=""
++    if [[ -d $BOOT_DIR_ABS ]]; then
++        IMAGE="initrd"
++    else
++        BOOT_DIR_ABS="/boot"
++        IMAGE="initramfs-${KERNEL_VERSION}.img"
++    fi
+ fi
+
+ ret=0
++
+ case "$COMMAND" in
+     add)
+-        INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
+-        if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
+-            # we found an initrd at the same place as the kernel
++        if [[ $IMAGE == "uki.efi" ]]; then
++            IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi
++        else
++            IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
++        fi
++        if [[ -f ${IMAGE_PREGENERATED} ]]; then
++            # we found an initrd or uki.efi at the same place as the kernel
+             # use this and don't generate a new one
+-            cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
+-                && chown root:root "$BOOT_DIR_ABS/$INITRD" \
+-                && chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
++            [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \
++                "There is an ${IMAGE} image at the same place as the kernel, skipping generating a new one"
++            cp --reflink=auto "$IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$IMAGE" \
++                && chown root:root "$BOOT_DIR_ABS/$IMAGE" \
++                && chmod 0600 "$BOOT_DIR_ABS/$IMAGE" \
+                 && exit 0
+         fi
+
+-        if [[ -f /etc/kernel/cmdline ]]; then
++        if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
++            if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
++                read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
++            fi
++        elif [[ -f /etc/kernel/cmdline ]]; then
+             read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
+         elif [[ -f /usr/lib/kernel/cmdline ]]; then
+             read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
+@@ -40,14 +82,14 @@
+
+             read -r -d '' -a line < /proc/cmdline
+             for i in "${line[@]}"; do
+-                [[ "${i#initrd=*}" != "$i" ]] && continue
++                [[ ${i#initrd=*} != "$i" ]] && continue
+                 BOOT_OPTIONS+=("$i")
+             done
+         fi
+
+         unset noimageifnotneeded
+
+-        for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
++        for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
+             # shellcheck disable=SC1001
+             if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
+                 noimageifnotneeded="yes"
+@@ -55,16 +97,21 @@
+             fi
+         done
+
++        # shellcheck disable=SC2046
+         dracut -f \
+             ${noimageifnotneeded:+--noimageifnotneeded} \
+-            $([[ "$KERNEL_INSTALL_VERBOSE" == 1 ]] && echo --verbose) \
+-            "$BOOT_DIR_ABS/$INITRD" \
+-            "$KERNEL_VERSION"
++            $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
++            $([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \
++            "$UEFI_OPTS" \
++            --kver "$KERNEL_VERSION" \
++            "$BOOT_DIR_ABS/$IMAGE"
+         ret=$?
+-	;;
++        ;;
++
+     remove)
+-        rm -f -- "$BOOT_DIR_ABS/$INITRD"
++        rm -f -- "$BOOT_DIR_ABS/$IMAGE"
+         ret=$?
+-	;;
++        ;;
+ esac
++
+ exit $ret


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2023-07-20  3:39 Sam James
  0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2023-07-20  3:39 UTC (permalink / raw
  To: gentoo-commits

commit:     2711de74b3c4967cd16a7b2760aff3de1acdd69e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 20 03:39:11 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 20 03:39:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2711de74

sys-kernel/dracut: backport UKI fix w/ systemd-254

Fails to boot otherwise.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-kernel/dracut/dracut-059-r3.ebuild            | 184 ++++++++++++++++++++++
 sys-kernel/dracut/files/059-gawk.patch            |  35 ++++
 sys-kernel/dracut/files/059-uki-systemd-254.patch | 134 ++++++++++++++++
 3 files changed, 353 insertions(+)

diff --git a/sys-kernel/dracut/dracut-059-r3.ebuild b/sys-kernel/dracut/dracut-059-r3.ebuild
new file mode 100644
index 000000000000..6d27123ec55b
--- /dev/null
+++ b/sys-kernel/dracut/dracut-059-r3.ebuild
@@ -0,0 +1,184 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 linux-info optfeature systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	if [[ "${PV}" != *_rc* ]]; then
+		KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+	fi
+	SRC_URI="https://github.com/dracutdevs/dracut/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://github.com/dracutdevs/dracut/wiki"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux test"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/openrc[sysv-utils(-),selinux?]
+		sys-apps/systemd[sysv-utils]
+		sys-apps/s6-linux-init[sysv-utils(-)]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	elibc_musl? ( sys-libs/fts-standalone )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+"
+DEPEND="
+	>=sys-apps/kmod-23
+	elibc_musl? ( sys-libs/fts-standalone )
+"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+"
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
+	"${FILESDIR}"/gentoo-network-r1.patch
+	"${FILESDIR}"/059-uefi-split-usr.patch
+	"${FILESDIR}"/059-uki-systemd-254.patch
+	"${FILESDIR}"/059-gawk.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
+		# Source tarball from github doesn't include this file
+		echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+	fi
+}
+
+src_test() {
+	if [[ ${EUID} != 0 ]]; then
+		# Tests need root privileges, bug #298014
+		ewarn "Skipping tests: Not running as root."
+	elif [[ ! -w /dev/kvm ]]; then
+		ewarn "Skipping tests: Unable to access /dev/kvm."
+	else
+		emake -C test check
+	fi
+}
+
+src_install() {
+	local DOCS=(
+		AUTHORS
+		NEWS.md
+		README.md
+		docs/README.cross
+		docs/README.generic
+		docs/README.kernel
+		docs/SECURITY.md
+	)
+
+	default
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature \
+		"Allows use of busybox instead of default bash (on your own risk)" \
+		sys-apps/busybox
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2[lvm]
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm sys-fs/dmraid
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		virtual/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+	optfeature "Support Squashfs" sys-fs/squashfs-tools
+	optfeature "Support TPM 2.0 TSS" app-crypt/tpm2-tools
+	optfeature "Support Bluetooth (experimental)" net-wireless/bluez
+	optfeature "Support BIOS-given device names" sys-apps/biosdevname
+	optfeature "Support network NVMe" sys-apps/nvme-cli
+	optfeature \
+		"Enable rngd service to help generating entropy early during boot" \
+		sys-apps/rng-tools
+}

diff --git a/sys-kernel/dracut/files/059-gawk.patch b/sys-kernel/dracut/files/059-gawk.patch
new file mode 100644
index 000000000000..5f1da79bb24a
--- /dev/null
+++ b/sys-kernel/dracut/files/059-gawk.patch
@@ -0,0 +1,35 @@
+https://github.com/dracutdevs/dracut/pull/2436
+
+From 77214c229dadd1441f0d6243221ceed0708cbfcf Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 20 Jul 2023 04:36:01 +0100
+Subject: [PATCH] fix(dracut.sh): use gawk for strtonum
+
+strtonum is a gawkism and is not available in all awks, e.g. mawk. Use gawk
+to avoid failure.
+
+Fixes: f32e95bcadbc5158843530407adc1e7b700561b1
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -1047,7 +1047,7 @@ pe_file_format() {
+     if [[ $# -eq 1 ]]; then
+         local magic
+         magic=$(objdump -p "$1" \
+-            | awk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
++            | gawk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
+         magic=$(printf "0x%x" "$magic")
+         # 0x10b (PE32), 0x20b (PE32+)
+         [[ $magic == 0x20b || $magic == 0x10b ]] && return 0
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -2467,7 +2467,7 @@ if [[ $uefi == yes ]]; then
+         fi
+     fi
+ 
+-    offs=$(objdump -h "$uefi_stub" 2> /dev/null | awk 'NF==7 {size=strtonum("0x"$3);\
++    offs=$(objdump -h "$uefi_stub" 2> /dev/null | gawk 'NF==7 {size=strtonum("0x"$3);\
+                 offset=strtonum("0x"$4)} END {print size + offset}')
+     if [[ $offs -eq 0 ]]; then
+         dfatal "Failed to get the size of $uefi_stub to create UEFI image file"
+

diff --git a/sys-kernel/dracut/files/059-uki-systemd-254.patch b/sys-kernel/dracut/files/059-uki-systemd-254.patch
new file mode 100644
index 000000000000..e8b52480d030
--- /dev/null
+++ b/sys-kernel/dracut/files/059-uki-systemd-254.patch
@@ -0,0 +1,134 @@
+https://github.com/dracutdevs/dracut/issues/2431
+https://github.com/dracutdevs/dracut/commit/f32e95bcadbc5158843530407adc1e7b700561b1
+
+From f32e95bcadbc5158843530407adc1e7b700561b1 Mon Sep 17 00:00:00 2001
+From: Valentin Lefebvre <valentin.lefebvre@suse.com>
+Date: Mon, 13 Mar 2023 12:06:13 +0100
+Subject: [PATCH] fix(dracut.sh): use dynamically uefi's sections offset
+
+* Uefi section are creating by `objcopy` with hardcoded sections
+offset. This commit allow to have the correct offset between
+each part of the efi file, needed to create an UKI. Offsets
+are simply calculated so no sections overlap, as recommended
+in  https://wiki.archlinux.org/title/Unified_kernel_image#Manually
+Moreover, efi stub file's header is parsed to apply the correct
+offsets according the section alignment factor.
+* Remove EFI_SECTION_VMA_INITRD, no need anymore as initrd
+section offset dynamically calculated
+
+Fixes dracutdevs#2275
+
+Signed-off-by: Valentin Lefebvre <valentin.lefebvre@suse.com>
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -1023,3 +1023,26 @@ get_dev_module() {
+     fi
+     echo "$dev_drivers"
+ }
++
++# Check if file is in PE format
++pe_file_format() {
++    if [[ $# -eq 1 ]]; then
++        local magic
++        magic=$(objdump -p "$1" \
++            | awk '{if ($1 == "Magic"){print strtonum("0x"$2)}}')
++        magic=$(printf "0x%x" "$magic")
++        # 0x10b (PE32), 0x20b (PE32+)
++        [[ $magic == 0x20b || $magic == 0x10b ]] && return 0
++    fi
++    return 1
++}
++
++# Get the sectionAlignment data from the PE header
++pe_get_section_align() {
++    local align_hex
++    [[ $# -ne "1" ]] && return 1
++    [[ $(pe_file_format "$1") -eq 1 ]] && return 1
++    align_hex=$(objdump -p "$1" \
++        | awk '{if ($1 == "SectionAlignment"){print $2}}')
++    echo "$((16#$align_hex))"
++}
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -1506,7 +1506,6 @@ if [[ ! $print_cmdline ]]; then
+             exit 1
+         fi
+         unset EFI_MACHINE_TYPE_NAME
+-        EFI_SECTION_VMA_INITRD=0x3000000
+         case "${DRACUT_ARCH:-$(uname -m)}" in
+             x86_64)
+                 EFI_MACHINE_TYPE_NAME=x64
+@@ -1516,8 +1515,6 @@ if [[ ! $print_cmdline ]]; then
+                 ;;
+             aarch64)
+                 EFI_MACHINE_TYPE_NAME=aa64
+-                # aarch64 kernels are uncompressed and thus larger, so we need a bigger gap between vma sections
+-                EFI_SECTION_VMA_INITRD=0x4000000
+                 ;;
+             *)
+                 dfatal "Architecture '${DRACUT_ARCH:-$(uname -m)}' not supported to create a UEFI executable"
+@@ -2467,29 +2464,57 @@ if [[ $uefi == yes ]]; then
+         fi
+     fi
+ 
++    offs=$(objdump -h "$uefi_stub" 2> /dev/null | awk 'NF==7 {size=strtonum("0x"$3);\
++                offset=strtonum("0x"$4)} END {print size + offset}')
++    if [[ $offs -eq 0 ]]; then
++        dfatal "Failed to get the size of $uefi_stub to create UEFI image file"
++        exit 1
++    fi
++    align=$(pe_get_section_align "$uefi_stub")
++    if [[ $? -eq 1 ]]; then
++        dfatal "Failed to get the sectionAlignment of the stub PE header to create the UEFI image file"
++        exit 1
++    fi
++    offs=$((offs + "$align" - offs % "$align"))
++    [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
++    [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
++    [[ -s $uefi_osrelease ]] \
++        && uefi_osrelease_offs=${offs} \
++        && offs=$((offs + $(stat -Lc%s "$uefi_osrelease"))) \
++        && offs=$((offs + "$align" - offs % "$align"))
++
+     if [[ $kernel_cmdline ]] || [[ $hostonly_cmdline == yes && -e "${uefi_outdir}/cmdline.txt" ]]; then
+         echo -ne "\x00" >> "$uefi_outdir/cmdline.txt"
+         dinfo "Using UEFI kernel cmdline:"
+         dinfo "$(tr -d '\000' < "$uefi_outdir/cmdline.txt")"
+         uefi_cmdline="${uefi_outdir}/cmdline.txt"
++        uefi_cmdline_offs=${offs}
++        offs=$((offs + $(stat -Lc%s "$uefi_cmdline")))
++        offs=$((offs + "$align" - offs % "$align"))
+     else
+         unset uefi_cmdline
+     fi
+ 
+-    [[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
+-    [[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
+     if [[ -s ${dracutsysrootdir}${uefi_splash_image} ]]; then
+         uefi_splash_image="${dracutsysrootdir}${uefi_splash_image}"
++        uefi_splash_offs=${offs}
++        offs=$((offs + $(stat -Lc%s "$uefi_splash_image")))
++        offs=$((offs + "$align" - offs % "$align"))
+     else
+         unset uefi_splash_image
+     fi
+ 
++    uefi_linux_offs="${offs}"
++    offs=$((offs + $(stat -Lc%s "$kernel_image")))
++    offs=$((offs + "$align" - offs % "$align"))
++    uefi_initrd_offs="${offs}"
++
+     if objcopy \
+-        ${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=0x20000} \
+-        ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=0x30000} \
+-        ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=0x40000} \
+-        --add-section .linux="$kernel_image" --change-section-vma .linux=0x2000000 \
+-        --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="${EFI_SECTION_VMA_INITRD}" \
++        ${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=$(printf 0x%x "$uefi_osrelease_offs")} \
++        ${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=$(printf 0x%x "$uefi_cmdline_offs")} \
++        ${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=$(printf 0x%x "$uefi_splash_offs")} \
++        --add-section .linux="$kernel_image" --change-section-vma .linux="$(printf 0x%x "$uefi_linux_offs")" \
++        --add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="$(printf 0x%x "$uefi_initrd_offs")" \
+         "$uefi_stub" "${uefi_outdir}/linux.efi"; then
+         if [[ -n ${uefi_secureboot_key} && -n ${uefi_secureboot_cert} ]]; then
+             if sbsign \


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2023-05-26 20:03 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2023-05-26 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e8f8be11a5cb38c954d54615d0a31c0378bf88f5
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri May 26 20:02:07 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri May 26 20:02:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8f8be11

sys-kernel/dracut: fix uefi stub path for split-usr

Closes: https://bugs.gentoo.org/765208
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../{dracut-059.ebuild => dracut-059-r1.ebuild}    |  1 +
 sys-kernel/dracut/files/059-uefi-split-usr.patch   | 46 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/sys-kernel/dracut/dracut-059.ebuild b/sys-kernel/dracut/dracut-059-r1.ebuild
similarity index 99%
rename from sys-kernel/dracut/dracut-059.ebuild
rename to sys-kernel/dracut/dracut-059-r1.ebuild
index 20f297121ad8..5aa6cfb4a241 100644
--- a/sys-kernel/dracut/dracut-059.ebuild
+++ b/sys-kernel/dracut/dracut-059-r1.ebuild
@@ -64,6 +64,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 PATCHES=(
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 	"${FILESDIR}"/gentoo-network-r1.patch
+	"${FILESDIR}"/059-uefi-split-usr.patch
 )
 
 src_configure() {

diff --git a/sys-kernel/dracut/files/059-uefi-split-usr.patch b/sys-kernel/dracut/files/059-uefi-split-usr.patch
new file mode 100644
index 000000000000..1b1f1348a223
--- /dev/null
+++ b/sys-kernel/dracut/files/059-uefi-split-usr.patch
@@ -0,0 +1,46 @@
+https://github.com/dracutdevs/dracut/pull/2365
+
+From afb2019ddc6ffe6e59df3d3dc9929a840bd09bc8 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 26 May 2023 15:56:45 -0400
+Subject: [PATCH] Fix path to UEFI stub on split-usr systems
+
+systemd always installs the UEFI stub in ${prefix}/lib/systemd/boot/efi.
+
+On split-usr systems, systemdutildir is ${rootprefix}/lib/systemd, which
+makes dracut look in the wrong place.
+
+Instead, grab 'prefix' from systemd.pc and store it in 'systemd_prefix'.
+
+Bug: https://bugs.gentoo.org/765208
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ dracut.sh | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index bbb34697..9da59561 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -1389,6 +1389,9 @@ esac
+ 
+ abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
+ 
++[[ -n $systemd_prefix ]] \
++    || systemd_prefix=$(pkg-config systemd --variable=prefix 2> /dev/null)
++
+ [[ -d $dracutsysrootdir$systemdutildir ]] \
+     || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2> /dev/null)
+ 
+@@ -1467,7 +1470,7 @@ if [[ ! $print_cmdline ]]; then
+         esac
+ 
+         if ! [[ -s $uefi_stub ]]; then
+-            uefi_stub="$dracutsysrootdir${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
++            uefi_stub="$dracutsysrootdir${systemd_prefix}/lib/systemd/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
+         fi
+ 
+         if ! [[ -s $uefi_stub ]]; then
+-- 
+2.40.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2022-12-25  2:53 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2022-12-25  2:53 UTC (permalink / raw
  To: gentoo-commits

commit:     d16cdc9c9eb5826a704dc71fd6838a24d83a1172
Author:     Laszlo Gombos <laszlo.gombos <AT> gmail <DOT> com>
AuthorDate: Sat Dec 24 02:02:14 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 02:53:02 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d16cdc9c

sys-kernel/dracut: when no systemd then only network-legacy is supported

Bug: https://github.com/dracutdevs/dracut/issues/1756
Signed-off-by: Laszlo Gombos <laszlo.gombos <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/28777
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-kernel/dracut/dracut-057-r2.ebuild          |  1 +
 sys-kernel/dracut/dracut-9999.ebuild            |  1 +
 sys-kernel/dracut/files/gentoo-network-r1.patch | 29 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+)

diff --git a/sys-kernel/dracut/dracut-057-r2.ebuild b/sys-kernel/dracut/dracut-057-r2.ebuild
index 5a6ec27fcb43..ddb9e967acd8 100644
--- a/sys-kernel/dracut/dracut-057-r2.ebuild
+++ b/sys-kernel/dracut/dracut-057-r2.ebuild
@@ -63,6 +63,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
+	"${FILESDIR}"/gentoo-network-r1.patch
 	"${FILESDIR}"/057-virtiofs-split-usr.patch
 	"${FILESDIR}"/057-i18n-keymaps.patch
 )

diff --git a/sys-kernel/dracut/dracut-9999.ebuild b/sys-kernel/dracut/dracut-9999.ebuild
index 7f2f0151787d..40d636fee825 100644
--- a/sys-kernel/dracut/dracut-9999.ebuild
+++ b/sys-kernel/dracut/dracut-9999.ebuild
@@ -63,6 +63,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
+	"${FILESDIR}"/gentoo-network-r1.patch
 )
 
 src_configure() {

diff --git a/sys-kernel/dracut/files/gentoo-network-r1.patch b/sys-kernel/dracut/files/gentoo-network-r1.patch
new file mode 100644
index 000000000000..3d5db25cb0ae
--- /dev/null
+++ b/sys-kernel/dracut/files/gentoo-network-r1.patch
@@ -0,0 +1,29 @@
+From 5443396f3cb591f2589888b25e07f21f03989057 Mon Sep 17 00:00:00 2001
+From: Laszlo Gombos <laszlo.gombos@gmail.com>
+Date: Sat, 24 Dec 2022 01:48:04 +0000
+Subject: [PATCH] When no systemd then only network-legacy is supported
+
+Bug: https://github.com/dracutdevs/dracut/issues/1756
+---
+ modules.d/40network/module-setup.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
+index 1ab13ef..da49947 100755
+--- a/modules.d/40network/module-setup.sh
++++ b/modules.d/40network/module-setup.sh
+@@ -16,6 +16,11 @@ depends() {
+         fi
+     done
+ 
++    # When systemd is not available only network-legacy is supported
++    if [ -z "$network_handler" ] && ! find_binary systemctl > /dev/null; then
++        network_handler="network-legacy"
++    fi
++
+     if [ -z "$network_handler" ]; then
+         if [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then
+             network_handler="network-wicked"
+-- 
+2.34.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2021-12-27 16:51 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2021-12-27 16:51 UTC (permalink / raw
  To: gentoo-commits

commit:     a50ce1b8021417323405d8526e104248b07d86b8
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 27 16:51:09 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Dec 27 16:51:42 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a50ce1b8

sys-kernel/dracut: backport a patch

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../{dracut-055-r3.ebuild => dracut-055-r4.ebuild} |  1 +
 sys-kernel/dracut/files/055-add-blockfuncs.patch   | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/sys-kernel/dracut/dracut-055-r3.ebuild b/sys-kernel/dracut/dracut-055-r4.ebuild
similarity index 99%
rename from sys-kernel/dracut/dracut-055-r3.ebuild
rename to sys-kernel/dracut/dracut-055-r4.ebuild
index b6ae9af423ff..607fff23c894 100644
--- a/sys-kernel/dracut/dracut-055-r3.ebuild
+++ b/sys-kernel/dracut/dracut-055-r4.ebuild
@@ -64,6 +64,7 @@ PATCHES=(
 	"${FILESDIR}"/055-fix-base-do-not-quote-initargs-for-switch_root.patch
 	"${FILESDIR}"/055-fix-usrmount-do-not-empty-_dev-variable.patch
 	"${FILESDIR}"/055-tpm2-tss-typo.patch
+	"${FILESDIR}"/055-add-blockfuncs.patch
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 

diff --git a/sys-kernel/dracut/files/055-add-blockfuncs.patch b/sys-kernel/dracut/files/055-add-blockfuncs.patch
new file mode 100644
index 000000000000..56724e0c73aa
--- /dev/null
+++ b/sys-kernel/dracut/files/055-add-blockfuncs.patch
@@ -0,0 +1,25 @@
+From a91dcfeb54b8c6c810020f77124f6eaf6ef5baa9 Mon Sep 17 00:00:00 2001
+From: Lukas Nykryn <lnykryn@redhat.com>
+Date: Thu, 12 Aug 2021 11:46:35 +0200
+Subject: [PATCH] fix(kernel-modules): add blk_mq_alloc_disk and
+ blk_cleanup_disk to blockfuncs
+
+Since kernel 5-14 those are used by many drivers for example:
+xen-blkfront, loop, nbd, pd
+---
+ modules.d/90kernel-modules/module-setup.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
+index 8b06893ae..69dc18b59 100755
+--- a/modules.d/90kernel-modules/module-setup.sh
++++ b/modules.d/90kernel-modules/module-setup.sh
+@@ -2,7 +2,7 @@
+ 
+ # called by dracut
+ installkernel() {
+-    local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
++    local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_cleanup_disk'
+     local -A _hostonly_drvs
+ 
+     find_kernel_modules_external() {


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2021-09-06  0:14 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2021-09-06  0:14 UTC (permalink / raw
  To: gentoo-commits

commit:     087f6ff3f00a4e0a84bec0278fcb8228d7d9aa12
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  6 00:13:58 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Sep  6 00:13:58 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=087f6ff3

sys-kernel/dracut: fix typo in tpm2-tss module

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../{dracut-055-r2.ebuild => dracut-055-r3.ebuild} |  1 +
 sys-kernel/dracut/files/055-tpm2-tss-typo.patch    | 23 ++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/sys-kernel/dracut/dracut-055-r2.ebuild b/sys-kernel/dracut/dracut-055-r3.ebuild
similarity index 99%
rename from sys-kernel/dracut/dracut-055-r2.ebuild
rename to sys-kernel/dracut/dracut-055-r3.ebuild
index 5d3767efdfc..cdc58e186f3 100644
--- a/sys-kernel/dracut/dracut-055-r2.ebuild
+++ b/sys-kernel/dracut/dracut-055-r3.ebuild
@@ -63,6 +63,7 @@ PATCHES=(
 	"${FILESDIR}"/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch
 	"${FILESDIR}"/055-fix-base-do-not-quote-initargs-for-switch_root.patch
 	"${FILESDIR}"/055-fix-usrmount-do-not-empty-_dev-variable.patch
+	"${FILESDIR}"/055-tpm2-tss-typo.patch
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 

diff --git a/sys-kernel/dracut/files/055-tpm2-tss-typo.patch b/sys-kernel/dracut/files/055-tpm2-tss-typo.patch
new file mode 100644
index 00000000000..a04496a29ca
--- /dev/null
+++ b/sys-kernel/dracut/files/055-tpm2-tss-typo.patch
@@ -0,0 +1,23 @@
+From 8b17105bed69ed90582a13d97d95ee19e6581365 Mon Sep 17 00:00:00 2001
+From: Matthias Berndt <matthias_berndt@gmx.de>
+Date: Tue, 1 Jun 2021 19:32:48 +0200
+Subject: [PATCH] fix(tpm2-tss): typo in depends()
+
+There is no systemd-udev module, only systemd-udevd
+---
+ modules.d/91tpm2-tss/module-setup.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/91tpm2-tss/module-setup.sh b/modules.d/91tpm2-tss/module-setup.sh
+index 28af22a31..361131d66 100755
+--- a/modules.d/91tpm2-tss/module-setup.sh
++++ b/modules.d/91tpm2-tss/module-setup.sh
+@@ -17,7 +17,7 @@ check() {
+ depends() {
+ 
+     # This module has external dependency on other module(s).
+-    echo systemd-sysusers systemd-udev
++    echo systemd-sysusers systemd-udevd
+     # Return 0 to include the dependent module(s) in the initramfs.
+     return 0
+ 


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2021-08-17 17:24 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2021-08-17 17:24 UTC (permalink / raw
  To: gentoo-commits

commit:     85685d7b73395bddcf58a7550a0220ee9175e3f2
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Tue Aug 17 10:51:21 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Aug 17 17:23:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85685d7b

sys-kernel/dracut: fix usr mount regression

Closes: https://bugs.gentoo.org/807971
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/22009

 .../{dracut-055-r1.ebuild => dracut-055-r2.ebuild} |  1 +
 ...5-fix-usrmount-do-not-empty-_dev-variable.patch | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/sys-kernel/dracut/dracut-055-r1.ebuild b/sys-kernel/dracut/dracut-055-r2.ebuild
similarity index 98%
rename from sys-kernel/dracut/dracut-055-r1.ebuild
rename to sys-kernel/dracut/dracut-055-r2.ebuild
index e45745cf50f..5d3767efdfc 100644
--- a/sys-kernel/dracut/dracut-055-r1.ebuild
+++ b/sys-kernel/dracut/dracut-055-r2.ebuild
@@ -62,6 +62,7 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 PATCHES=(
 	"${FILESDIR}"/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch
 	"${FILESDIR}"/055-fix-base-do-not-quote-initargs-for-switch_root.patch
+	"${FILESDIR}"/055-fix-usrmount-do-not-empty-_dev-variable.patch
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 

diff --git a/sys-kernel/dracut/files/055-fix-usrmount-do-not-empty-_dev-variable.patch b/sys-kernel/dracut/files/055-fix-usrmount-do-not-empty-_dev-variable.patch
new file mode 100644
index 00000000000..e46f8bb25db
--- /dev/null
+++ b/sys-kernel/dracut/files/055-fix-usrmount-do-not-empty-_dev-variable.patch
@@ -0,0 +1,36 @@
+From 4afdcba212793f136aea012b30dd7bdb5b641a5a Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Mon, 16 Aug 2021 18:54:34 +0300
+Subject: [PATCH] fix(usrmount): do not empty _dev variable
+
+Currently $_dev is always overridden with the value returned by
+label_uuid_to_dev(). This results in an empty value if $_dev is a
+device path. Fix this by calling label_uuid_to_dev() conditionally.
+
+Bug: https://bugs.gentoo.org/807971
+Fixes: d3532978de04c78f53664dad7b37705a49a7ee54
+---
+ modules.d/98usrmount/mount-usr.sh | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh
+index 23ed06aa..c8e1893b 100755
+--- a/modules.d/98usrmount/mount-usr.sh
++++ b/modules.d/98usrmount/mount-usr.sh
+@@ -55,7 +55,12 @@ mount_usr() {
+     while read -r _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do
+         [ "${_dev%%#*}" != "$_dev" ] && continue
+         if [ "$_mp" = "/usr" ]; then
+-            _dev="$(label_uuid_to_dev "$_dev")"
++            case "$_dev" in
++                LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
++                    _dev="$(label_uuid_to_dev "$_dev")"
++                    ;;
++                *) ;;
++            esac
+ 
+             if strstr "$_opts" "subvol=" \
+                 && [ "${root#block:}" -ef "$_dev" ] \
+-- 
+2.31.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2021-07-23 19:16 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2021-07-23 19:16 UTC (permalink / raw
  To: gentoo-commits

commit:     b11a0316d954d186df8c61aee62402ff6026c7dc
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 23 19:13:04 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Jul 23 19:13:04 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b11a0316

sys-kernel/dracut: fix quoting issues

Closes: https://bugs.gentoo.org/803548
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../{dracut-055.ebuild => dracut-055-r1.ebuild}    |  2 ++
 ...ase-do-not-quote-initargs-for-switch_root.patch | 32 ++++++++++++++++++
 ...x-crypt-remove-quotes-from-cryptsetupopts.patch | 39 ++++++++++++++++++++++
 3 files changed, 73 insertions(+)

diff --git a/sys-kernel/dracut/dracut-055.ebuild b/sys-kernel/dracut/dracut-055-r1.ebuild
similarity index 97%
rename from sys-kernel/dracut/dracut-055.ebuild
rename to sys-kernel/dracut/dracut-055-r1.ebuild
index 3b042f3de74..e45745cf50f 100644
--- a/sys-kernel/dracut/dracut-055.ebuild
+++ b/sys-kernel/dracut/dracut-055-r1.ebuild
@@ -60,6 +60,8 @@ BDEPEND="
 QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
+	"${FILESDIR}"/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch
+	"${FILESDIR}"/055-fix-base-do-not-quote-initargs-for-switch_root.patch
 	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 

diff --git a/sys-kernel/dracut/files/055-fix-base-do-not-quote-initargs-for-switch_root.patch b/sys-kernel/dracut/files/055-fix-base-do-not-quote-initargs-for-switch_root.patch
new file mode 100644
index 00000000000..5568c22aede
--- /dev/null
+++ b/sys-kernel/dracut/files/055-fix-base-do-not-quote-initargs-for-switch_root.patch
@@ -0,0 +1,32 @@
+From 285e2ad01035743ff51005a74e486e09fcbb0a0d Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 23 Jul 2021 14:35:07 -0400
+Subject: [PATCH] fix(base): do not quote $initargs for switch_root
+
+We want word splitting to occur so that the arguments are passed
+separately, and we don't end up passing an empty string if no arguments
+are specified.
+
+Bug: https://bugs.gentoo.org/803548
+Fixes: 2fabaaa62dcfd31e593ca45e1374e55adae29d6b
+---
+ modules.d/99base/init.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
+index 978adb6f..ab62bb44 100755
+--- a/modules.d/99base/init.sh
++++ b/modules.d/99base/init.sh
+@@ -387,7 +387,8 @@ if [ -f /etc/capsdrop ]; then
+         }
+ else
+     unset RD_DEBUG
+-    exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" "$initargs" || {
++    # shellcheck disable=SC2086
++    exec "$SWITCH_ROOT" "$NEWROOT" "$INIT" $initargs || {
+         warn "Something went very badly wrong in the initramfs.  Please "
+         warn "file a bug against dracut."
+         emergency_shell
+-- 
+2.32.0
+

diff --git a/sys-kernel/dracut/files/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch b/sys-kernel/dracut/files/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch
new file mode 100644
index 00000000000..355cdc461ab
--- /dev/null
+++ b/sys-kernel/dracut/files/055-fix-crypt-remove-quotes-from-cryptsetupopts.patch
@@ -0,0 +1,39 @@
+From e0abf88a15d23fbf793cf872397016ad86aeaaa8 Mon Sep 17 00:00:00 2001
+From: lapseofreason <lapseofreason0@gmail.com>
+Date: Tue, 8 Jun 2021 16:01:58 +0200
+Subject: [PATCH] fix(crypt): remove quotes from cryptsetupopts
+
+Fixes #1528.
+---
+ modules.d/90crypt/cryptroot-ask.sh | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
+index 37a4deea..b1f8df81 100755
+--- a/modules.d/90crypt/cryptroot-ask.sh
++++ b/modules.d/90crypt/cryptroot-ask.sh
+@@ -138,8 +138,9 @@ unset allowdiscards
+ ask_passphrase=1
+ 
+ if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
++    # shellcheck disable=SC2086
+     if readkey "$luksfile" / "$device" \
+-        | cryptsetup -d - "$cryptsetupopts" luksOpen "$device" "$luksname"; then
++        | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname"; then
+         ask_passphrase=0
+     fi
+ elif [ "$is_keysource" -ne 0 ]; then
+@@ -164,8 +165,9 @@ else
+         unset tmp
+ 
+         info "Using '$keypath' on '$keydev'"
++        # shellcheck disable=SC2086
+         readkey "$keypath" "$keydev" "$device" \
+-            | cryptsetup -d - "$cryptsetupopts" luksOpen "$device" "$luksname" \
++            | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname" \
+             && ask_passphrase=0
+         unset keypath keydev
+         break
+-- 
+2.32.0
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2021-06-14 18:42 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2021-06-14 18:42 UTC (permalink / raw
  To: gentoo-commits

commit:     e673f765070d823bd11c6099de4a4798fed9592b
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 14 18:27:32 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jun 14 18:42:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e673f765

sys-kernel/dracut: bump to 055

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-kernel/dracut/Manifest                         |  1 +
 .../{dracut-9999.ebuild => dracut-055.ebuild}      | 34 +++++++++++++------
 sys-kernel/dracut/dracut-9999.ebuild               | 34 +++++++++++++------
 .../dracut/files/gentoo-ldconfig-paths-r1.patch    | 39 ++++++++++++++++++++++
 4 files changed, 88 insertions(+), 20 deletions(-)

diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest
index 1f7643564be..6aa82815479 100644
--- a/sys-kernel/dracut/Manifest
+++ b/sys-kernel/dracut/Manifest
@@ -1,3 +1,4 @@
 DIST dracut-050.tar.xz 333592 BLAKE2B cb0bfa5a8e7547260b8a80a3606eb284182c062926269c85b09e07d26ad177df0eeaa64b17005bff9290611f1c83fc8cd8e2216cfe14b5e66ec7f659d4c2fa7b SHA512 eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850
 DIST dracut-051.tar.xz 346500 BLAKE2B 38129b6b713b3338bbb2554fffd611f80216969eebac9fca7fb72df2db2036d4fbe66ebd54e646e562e24801e61064e54b62f066bab9e77ca88814100ebdd8ff SHA512 f3533430e479bc91c538e0a198ca97450ec449a7d661d876ecd0ad3e417e22f7e4abf0a384fc676a63a4d3479f25d717c8acdcd1bdec7d0a5714298c5c4ea6b8
 DIST dracut-053.tar.xz 354668 BLAKE2B d20d0f1675e18cf44615a98255c8b1a73f23e9c665a771a1fe99716d3bf0b6082961ab20fe058bf31c106c4f521d9e8708e2ae98cff00f613197bbf9dd3abda3 SHA512 4736f84442bda208a38d3285ffeb8b845f06e52e3bf60d2aaea121240cf695e1369208c2d2cee1137a6c1d3f8f7794385675006beaf5cd86ade259d5f42d039a
+DIST dracut-055.tar.xz 361752 BLAKE2B 9fcb0bce9ead2e079c70a377ea53701e4634d3dc64ae163e0e157d7d85822a274813e05f6079768640e1807818fad7a8158626413d773686a8d52fcd95fb5680 SHA512 2d2ea2889d9013bc94245bd7d1a2154f24d02bd9c2f7dbb28e5968e17d918e6598c68d85b0f551f968218980a80b19361ca0c9e8e94997ba54f4c09afcd6d866

diff --git a/sys-kernel/dracut/dracut-9999.ebuild b/sys-kernel/dracut/dracut-055.ebuild
similarity index 90%
copy from sys-kernel/dracut/dracut-9999.ebuild
copy to sys-kernel/dracut/dracut-055.ebuild
index e6d09f406d0..3b042f3de74 100644
--- a/sys-kernel/dracut/dracut-9999.ebuild
+++ b/sys-kernel/dracut/dracut-055.ebuild
@@ -19,10 +19,9 @@ HOMEPAGE="https://dracut.wiki.kernel.org"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="selinux"
+IUSE="selinux test"
 
-# Tests need root privileges, bug #298014
-RESTRICT="test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
 	app-arch/cpio
@@ -58,13 +57,10 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
-DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
-	README.testsuite TODO )
-
 QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
-	"${FILESDIR}"/gentoo-ldconfig-paths.patch
+	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 
 src_configure() {
@@ -86,11 +82,29 @@ src_configure() {
 	fi
 }
 
+src_test() {
+	if [[ ${EUID} != 0 ]]; then
+		# Tests need root privileges, bug #298014
+		ewarn "Skipping tests: Not running as root."
+	elif [[ ! -w /dev/kvm ]]; then
+		ewarn "Skipping tests: Unable to access /dev/kvm."
+	else
+		emake -C test check
+	fi
+}
+
 src_install() {
-	default
+	local DOCS=(
+		AUTHORS
+		NEWS.md
+		README.md
+		docs/README.cross
+		docs/README.generic
+		docs/README.kernel
+		docs/SECURITY.md
+	)
 
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
+	default
 
 	docinto html
 	dodoc dracut.html

diff --git a/sys-kernel/dracut/dracut-9999.ebuild b/sys-kernel/dracut/dracut-9999.ebuild
index e6d09f406d0..3b042f3de74 100644
--- a/sys-kernel/dracut/dracut-9999.ebuild
+++ b/sys-kernel/dracut/dracut-9999.ebuild
@@ -19,10 +19,9 @@ HOMEPAGE="https://dracut.wiki.kernel.org"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="selinux"
+IUSE="selinux test"
 
-# Tests need root privileges, bug #298014
-RESTRICT="test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
 	app-arch/cpio
@@ -58,13 +57,10 @@ BDEPEND="
 	virtual/pkgconfig
 "
 
-DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
-	README.testsuite TODO )
-
 QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
-	"${FILESDIR}"/gentoo-ldconfig-paths.patch
+	"${FILESDIR}"/gentoo-ldconfig-paths-r1.patch
 )
 
 src_configure() {
@@ -86,11 +82,29 @@ src_configure() {
 	fi
 }
 
+src_test() {
+	if [[ ${EUID} != 0 ]]; then
+		# Tests need root privileges, bug #298014
+		ewarn "Skipping tests: Not running as root."
+	elif [[ ! -w /dev/kvm ]]; then
+		ewarn "Skipping tests: Unable to access /dev/kvm."
+	else
+		emake -C test check
+	fi
+}
+
 src_install() {
-	default
+	local DOCS=(
+		AUTHORS
+		NEWS.md
+		README.md
+		docs/README.cross
+		docs/README.generic
+		docs/README.kernel
+		docs/SECURITY.md
+	)
 
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
+	default
 
 	docinto html
 	dodoc dracut.html

diff --git a/sys-kernel/dracut/files/gentoo-ldconfig-paths-r1.patch b/sys-kernel/dracut/files/gentoo-ldconfig-paths-r1.patch
new file mode 100644
index 00000000000..53349a1f31f
--- /dev/null
+++ b/sys-kernel/dracut/files/gentoo-ldconfig-paths-r1.patch
@@ -0,0 +1,39 @@
+From e6a5f02038954ede223cc75901386acf43ec4264 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Mon, 9 Mar 2020 02:47:07 +0300
+Subject: [PATCH] Remove redundant gcc paths in ldconfig_paths()
+
+Bug: https://bugs.gentoo.org/705728
+---
+ dracut-functions.sh | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/dracut-functions.sh b/dracut-functions.sh
+index 5206bd21..a119fb15 100755
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -81,7 +81,20 @@ find_binary() {
+ }
+ 
+ ldconfig_paths() {
+-    $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
++    local gccpath
++
++    if type -P gcc-config &>/dev/null; then
++        gccpath=$(gcc-config -c)
++        gccpath=/usr/lib/gcc/${gccpath%-*}/${gccpath##*-}
++    fi
++
++    while read -r line; do
++        if [[ ${line} != /usr/lib/gcc/* || -z ${gccpath} ]]; then
++            echo ${line}
++        elif [[ ${line} == ${gccpath} ]]; then
++            echo ${line}
++        fi
++    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)
+ }
+ 
+ # Version comparision function.  Assumes Linux style version scheme.
+-- 
+2.32.0
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2020-07-03 11:18 Thomas Deutschmann
  0 siblings, 0 replies; 20+ messages in thread
From: Thomas Deutschmann @ 2020-07-03 11:18 UTC (permalink / raw
  To: gentoo-commits

commit:     88969ec3eacbd206d0f694bd865554f945dc6986
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Wed Jun 24 14:46:47 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Jul  3 11:17:37 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88969ec3

sys-kernel/dracut: Apply fix for busybox module to 050

Closes: https://bugs.gentoo.org/714838
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Closes: https://github.com/gentoo/gentoo/pull/16394
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 sys-kernel/dracut/dracut-050-r1.ebuild             | 166 +++++++++++++++++++++
 .../dracut/files/050-busybox-module-fix.patch      | 102 +++++++++++++
 2 files changed, 268 insertions(+)

diff --git a/sys-kernel/dracut/dracut-050-r1.ebuild b/sys-kernel/dracut/dracut-050-r1.ebuild
new file mode 100644
index 00000000000..3b43c5fefe6
--- /dev/null
+++ b/sys-kernel/dracut/dracut-050-r1.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	[[ "${PV}" = *_rc* ]] || \
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+	SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/openrc[sysv-utils(-),selinux?]
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	elibc_musl? ( sys-libs/fts-standalone )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+"
+DEPEND="
+	>=sys-apps/kmod-23
+	elibc_musl? ( sys-libs/fts-standalone )
+"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+"
+
+DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/050-Makefile-merge-main-version-and-git-version-earlier.patch
+	"${FILESDIR}"/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
+	"${FILESDIR}"/050-Makefile-fix-VERSION-again.patch
+	"${FILESDIR}"/050-busybox-module-fix.patch
+	"${FILESDIR}"/050-gentoo-ldconfig-paths.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
+		# Source tarball from github doesn't include this file
+		echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+	fi
+}
+
+src_install() {
+	default
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+	optfeature \
+		"Enable rngd service to help generating entropy early during boot" \
+		sys-apps/rng-tools
+}

diff --git a/sys-kernel/dracut/files/050-busybox-module-fix.patch b/sys-kernel/dracut/files/050-busybox-module-fix.patch
new file mode 100644
index 00000000000..faaf026e536
--- /dev/null
+++ b/sys-kernel/dracut/files/050-busybox-module-fix.patch
@@ -0,0 +1,102 @@
+From f769154bccf22d2b5caf5e4888f88bf7edde2662 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Mon, 25 May 2020 19:02:05 +0300
+Subject: [PATCH 1/2] dracut-functions: fix find_binary() to return full path
+
+Fixes: a01204202b30 (Allow running on a cross-compiled rootfs)
+---
+ dracut-functions.sh | 21 +++++++++++++--------
+ 1 file changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/dracut-functions.sh b/dracut-functions.sh
+index 3cb9c7af..b5c28248 100755
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -41,31 +41,36 @@ str_ends() { [ "${1%*"$2"}" != "$1" ]; }
+ # search in the usual places to find the binary.
+ find_binary() {
+     local _delim
++    local _path
+     local l
+     local p
+     [[ -z ${1##/*} ]] || _delim="/"
+ 
+     if [[ "$1" == *.so* ]]; then
+         for l in libdirs ; do
+-            if { $DRACUT_LDD "$dracutsysrootdir$l$_delim$1" &>/dev/null; };  then
+-                printf "%s\n" "$1"
++            _path="${l}${_delim}${1}"
++            if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; };  then
++                printf "%s\n" "${_path}"
+                 return 0
+             fi
+         done
+-        if { $DRACUT_LDD "$dracutsysrootdir$_delim$1" &>/dev/null; }; then
+-            printf "%s\n" "$1"
++        _path="${_delim}${1}"
++        if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
++            printf "%s\n" "${_path}"
+             return 0
+         fi
+     fi
+     if [[ "$1" == */* ]]; then
+-        if [[ -L $dracutsysrootdir$_delim$1 ]] || [[ -x $dracutsysrootdir$_delim$1 ]]; then
+-            printf "%s\n" "$1"
++        _path="${_delim}${1}"
++        if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
++            printf "%s\n" "${_path}"
+             return 0
+         fi
+     fi
+     for p in $DRACUT_PATH ; do
+-        if [[ -L $dracutsysrootdir$p$_delim$1 ]] || [[ -x $dracutsysrootdir$p$_delim$1 ]];  then
+-            printf "%s\n" "$1"
++        _path="${p}${_delim}${1}"
++        if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]];  then
++            printf "%s\n" "${_path}"
+             return 0
+         fi
+     done
+-- 
+2.26.2
+
+From 50cc23ba32b0fda63eff7623b529dbeb4e6a38c6 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Mon, 25 May 2020 17:49:20 +0300
+Subject: [PATCH 2/2] busybox: simplify listing of supported utilities
+
+'--list' option is supported since busybox-1.20.0, which was released
+in 2010.
+---
+ modules.d/05busybox/module-setup.sh | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh
+index ecbd6a13..5d88c5d1 100755
+--- a/modules.d/05busybox/module-setup.sh
++++ b/modules.d/05busybox/module-setup.sh
+@@ -14,15 +14,16 @@ depends() {
+ 
+ # called by dracut
+ install() {
+-    local _i _progs _path _busybox
++    local _i _path _busybox
++    local _progs=()
+     _busybox=$(type -P busybox)
+     inst $_busybox /usr/bin/busybox
+-    for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
+-    do
+-        _progs="$_progs $_i"
++    for _i in $($_busybox --list); do
++        [[ ${_i} == busybox ]] && continue
++        _progs+=("${_i}")
+     done
+ 
+-    for _i in $_progs; do
++    for _i in "${_progs[@]}"; do
+         _path=$(find_binary "$_i")
+         [ -z "$_path" ] && continue
+         ln_r /usr/bin/busybox $_path
+-- 
+2.26.2
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2020-03-10 19:50 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2020-03-10 19:50 UTC (permalink / raw
  To: gentoo-commits

commit:     4963c4ebb04f862691cbb8a769709d34e86eb953
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Mon Mar  9 23:21:19 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Mar 10 19:49:53 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4963c4eb

sys-kernel/dracut: Version bump to 050

* Switch back to tarballs from kernel.org
* Remove redundant gcc paths in ldconfig_paths()

Closes: https://bugs.gentoo.org/705728
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-kernel/dracut/Manifest                         |   1 +
 sys-kernel/dracut/dracut-050.ebuild                | 165 +++++++++++++++++++++
 .../files/050-Makefile-fix-VERSION-again.patch     |  34 +++++
 ...erge-main-version-and-git-version-earlier.patch |  78 ++++++++++
 ...on-t-call-fsfreeze-on-subvol-of-root-file.patch |  75 ++++++++++
 .../dracut/files/050-gentoo-ldconfig-paths.patch   |  39 +++++
 6 files changed, 392 insertions(+)

diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest
index 7b97320d25d..a2441ad9a7f 100644
--- a/sys-kernel/dracut/Manifest
+++ b/sys-kernel/dracut/Manifest
@@ -4,3 +4,4 @@ DIST dracut-046.tar.xz 299520 BLAKE2B 1e2d848aa0db0e90734d8c60610a60b1f0ff67f8c4
 DIST dracut-047.tar.xz 305836 BLAKE2B 18333ae1e24cfbbb6a152bf9ba2c48884821f6a506344259ba56c581a9f3efac7b4c88e8ca149ef1f83347a5e4d59acba61e42b8e0ab3a9e9beb8684d5db28b0 SHA512 03369726b6c2b682d0c9dead7b7dbd1c3989aaf2b4a561015634d33a94e5230d03cb634c3890191b19dd8c1c83389533ae1a46d45d2024ba885e0d2d46c5d035
 DIST dracut-048.tar.xz 308484 BLAKE2B b19c8122034a8b40cbc9d09245730900b59691c336f1d231e768786ad64068e0a8daf57ae9a4182ab50d9e1c683c9b7dcac354eb26d8a60f061db78121bc11c7 SHA512 97fcfd5d314ef40687c245d95d2f1d0f3f9ff0472e66b6e6324bf9bd6b98186104f9d71fd9af344126d6ea9fa47b744d52831a374225633225f6f17fb15c04e0
 DIST dracut-049.tar.gz 376857 BLAKE2B e50084164e26aae6de812345cc76782435ec84951b44eea454355d0c65fe84fdd0858733de534bdf018bdfd92922f0be30b74d74be329a918e55d96c5e4d4fb6 SHA512 51489570856538588868a66c7bcc8a3728574592529905484526c523398dc1b8f1416e6b264780303acd08d818417a9668b76f1d64d3194432b5af79dc15c9f7
+DIST dracut-050.tar.xz 333592 BLAKE2B cb0bfa5a8e7547260b8a80a3606eb284182c062926269c85b09e07d26ad177df0eeaa64b17005bff9290611f1c83fc8cd8e2216cfe14b5e66ec7f659d4c2fa7b SHA512 eba046cf1c8013369a398e585e0bff233daa8595d469ce9acc8bbc6a32d55c6a5429d4219db19abbf6001104be05b357f0961f9e66b7f926039a5d3ee7c2b850

diff --git a/sys-kernel/dracut/dracut-050.ebuild b/sys-kernel/dracut/dracut-050.ebuild
new file mode 100644
index 00000000000..5b09940bf76
--- /dev/null
+++ b/sys-kernel/dracut/dracut-050.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	[[ "${PV}" = *_rc* ]] || \
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+	SRC_URI="https://www.kernel.org/pub/linux/utils/boot/${PN}/${P}.tar.xz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/openrc[sysv-utils(-),selinux?]
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	elibc_musl? ( sys-libs/fts-standalone )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+"
+DEPEND="
+	>=sys-apps/kmod-23
+	elibc_musl? ( sys-libs/fts-standalone )
+"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+"
+
+DOCS=( AUTHORS HACKING NEWS README.md README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/050-Makefile-merge-main-version-and-git-version-earlier.patch
+	"${FILESDIR}"/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
+	"${FILESDIR}"/050-Makefile-fix-VERSION-again.patch
+	"${FILESDIR}"/050-gentoo-ldconfig-paths.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	if [[ ${PV} != 9999 && ! -f dracut-version.sh ]] ; then
+		# Source tarball from github doesn't include this file
+		echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+	fi
+}
+
+src_install() {
+	default
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+	optfeature \
+		"Enable rngd service to help generating entropy early during boot" \
+		sys-apps/rng-tools
+}

diff --git a/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch
new file mode 100644
index 00000000000..a091e4c9fac
--- /dev/null
+++ b/sys-kernel/dracut/files/050-Makefile-fix-VERSION-again.patch
@@ -0,0 +1,34 @@
+From a76aa8e39016a8564adb0f18f93bbf2e15d3243f Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Sun, 8 Mar 2020 05:47:50 +0300
+Subject: [PATCH] Makefile: fix VERSION again
+
+The variable is not undefined anymore after the first assignment, so
+we should check if variable is empty instead.
+---
+ Makefile | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c69e2dfc..02e2c4b5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,13 @@
+ -include dracut-version.sh
+ 
+ DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
+-DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
++ifeq ($(DRACUT_MAIN_VERSION),)
++DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
++endif
+ DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
+-DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
++ifeq ($(DRACUT_FULL_VERSION),)
++DRACUT_FULL_VERSION = $(DRACUT_VERSION)
++endif
+ 
+ -include Makefile.inc
+ 
+-- 
+2.24.1
+

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
new file mode 100644
index 00000000000..49c532b9299
--- /dev/null
+++ b/sys-kernel/dracut/files/050-Makefile-merge-main-version-and-git-version-earlier.patch
@@ -0,0 +1,78 @@
+From eb8a7a96351b6e1cfd9dc34f1e854333a8f4a4e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
+ <congdanhqx@gmail.com>
+Date: Fri, 6 Mar 2020 08:46:36 +0700
+Subject: [PATCH] Makefile: merge main-version and git-version earlier
+
+With GNU Make 4.3 on both ArchLinux, and VoidLinux,
+GITVERION is always empty because of bad substitution.
+Change '\#' to simply '#' can fix it,
+but we don't need that complation.
+
+We can merge DRACUT_MAIN_VERSION and GITVERSION into DRACUT_FULL_VERSION.
+Because, GITVERSION will be attached back to DRACUT_MAIN_VERSION in all
+situation.
+
+While we're at it, detect if we're in git worktree by:
+limiting GIT_CEILING_DIRECTORIES to parent directory of
+dracut's top level directory; instead of checking for .git directory,
+in order to support git-worktree, in such case, .git will be a file, see
+gitrepository-layout(5)
+---
+ Makefile | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 22b584f1..c69e2dfc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,8 +1,9 @@
+ -include dracut-version.sh
+ 
+-DRACUT_MAIN_VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || :)
++DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
+ DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
+-GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
++DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
++DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
+ 
+ -include Makefile.inc
+ 
+@@ -92,14 +93,14 @@ endif
+ 
+ %.xml: %.asc
+ 	@rm -f -- "$@"
+-	asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $<
++	asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
+ 
+ dracut.8: dracut.usage.asc dracut.8.asc
+ 
+ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
+ 	@rm -f -- dracut.xml
+ 	asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
+-		-a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \
++		-a "version=$(DRACUT_FULL_VERSION)" \
+ 		-a numbered \
+ 		-d book -b docbook -o dracut.xml dracut.asc
+ 	@rm -f -- dracut.html
+@@ -112,7 +113,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
+ dracut.pc: Makefile.inc Makefile
+ 	@echo "Name: dracut" > dracut.pc
+ 	@echo "Description: dracut" >> dracut.pc
+-	@echo "Version: $(DRACUT_MAIN_VERSION)$(GITVERSION)" >> dracut.pc
++	@echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
+ 	@echo "dracutdir=$(pkglibdir)" >> dracut.pc
+ 	@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
+ 	@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
+@@ -182,7 +183,7 @@ endif
+ 
+ dracut-version.sh:
+ 	@rm -f dracut-version.sh
+-	@echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)$(GITVERSION)" > dracut-version.sh
++	@echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
+ 
+ clean:
+ 	$(RM) *~
+-- 
+2.24.1
+

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
new file mode 100644
index 00000000000..cf54cabb5eb
--- /dev/null
+++ b/sys-kernel/dracut/files/050-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
@@ -0,0 +1,75 @@
+From 0386e4627779cb51f4292b3c642d90586d5e71b4 Mon Sep 17 00:00:00 2001
+From: Martin Wilck <mwilck@suse.com>
+Date: Wed, 29 Jan 2020 23:53:29 +0100
+Subject: [PATCH] dracut.sh: don't call fsfreeze on subvol of root file system
+
+dracut.sh already doesn't call fsfreeze if the output file is on
+the root file system. For btrfs, however, this is not sufficient.
+Because fsfreeze is a superblock operation, and all btrfs subvolumes
+share the same superblock, fsfreeze may freeze the entire system
+if the subvolume on which the output file is written and / are
+subvolumes of the same file system. Avoid this by comparing file
+system UUIDs for btrfs.
+
+Fixes: de576db3c225 ("call fsfreeze(8) on /boot to flush initramfs data & metadata to media")
+---
+ dracut.sh | 36 +++++++++++++++++++++++++++++++++++-
+ 1 file changed, 35 insertions(+), 1 deletion(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index af346f3a..c14f6c0b 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -2075,6 +2075,40 @@ fi
+ 
+ command -v restorecon &>/dev/null && restorecon -- "$outfile"
+ 
++btrfs_uuid() {
++    btrfs filesystem show "$1" | sed -n '1s/^.*uuid: //p'
++}
++
++freeze_ok_for_btrfs() {
++    local mnt uuid1 uuid2
++    # If the output file is on btrfs, we need to make sure that it's
++    # not on a subvolume of the same file system as the root FS.
++    # Otherwise, fsfreeze() might freeze the entire system.
++    # This is most conveniently checked by comparing the FS uuid.
++
++    [[ "$(stat -f -c %T -- "/")" == "btrfs" ]] || return 0
++    mnt=$(stat -c %m -- "$1")
++    uuid1=$(btrfs_uuid "$mnt")
++    uuid2=$(btrfs_uuid "/")
++    [[ "$uuid1" && "$uuid2" && "$uuid1" != "$uuid2" ]]
++}
++
++freeze_ok_for_fstype() {
++    local outfile=$1
++    local fstype
++
++    [[ "$(stat -c %m -- "$outfile")" == "/" ]] && return 1
++    fstype=$(stat -f -c %T -- "$outfile")
++    case $fstype in
++        msdos)
++            return 1;;
++        btrfs)
++            freeze_ok_for_btrfs "$outfile";;
++        *)
++            return 0;;
++    esac
++}
++
+ # We sync/fsfreeze only if we're operating on a live booted system.
+ # It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
+ # and there's no reason to sync, and *definitely* no reason to fsfreeze.
+@@ -2087,7 +2121,7 @@ if test -d $dracutsysrootdir/run/systemd/system; then
+     fi
+ 
+     # use fsfreeze only if we're not writing to /
+-    if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then
++    if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then
+         if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
+             dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
+         fi
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch
new file mode 100644
index 00000000000..15522ef4fc1
--- /dev/null
+++ b/sys-kernel/dracut/files/050-gentoo-ldconfig-paths.patch
@@ -0,0 +1,39 @@
+From 0674b9136831b1beb6a7ec91147fd5c280c693a3 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Mon, 9 Mar 2020 02:47:07 +0300
+Subject: [PATCH] Remove redundant gcc paths in ldconfig_paths()
+
+Bug: https://bugs.gentoo.org/705728
+---
+ dracut-functions.sh | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/dracut-functions.sh b/dracut-functions.sh
+index 3cb9c7af..5337ff6c 100755
+--- a/dracut-functions.sh
++++ b/dracut-functions.sh
+@@ -76,7 +76,20 @@ find_binary() {
+ 
+ ldconfig_paths()
+ {
+-    $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
++    local gccpath
++
++    if type -P gcc-config &>/dev/null; then
++        gccpath=$(gcc-config -c)
++        gccpath=/usr/lib/gcc/${gccpath%-*}/${gccpath##*-}
++    fi
++
++    while read -r line; do
++        if [[ ${line} != /usr/lib/gcc/* || -z ${gccpath} ]]; then
++            echo ${line}
++        elif [[ ${line} == ${gccpath} ]]; then
++            echo ${line}
++        fi
++    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)
+ }
+ 
+ # Version comparision function.  Assumes Linux style version scheme.
+-- 
+2.24.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2019-12-29 19:39 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2019-12-29 19:39 UTC (permalink / raw
  To: gentoo-commits

commit:     980830b7e4a2953550338f13dd8525bcad28d8fc
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Thu Dec 26 14:26:15 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 19:36:23 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=980830b7

sys-kernel/dracut: Add a bunch of upstream patches

* fix dracut-install crashes
* install kernel module dependencies of dependencies
* add support for compressed firmware files
* add support for rngd service
* bash-5 compatibility
* add fts-standalone dependency and configure check for musl
* fix udevdir detection

Closes: https://bugs.gentoo.org/676268
Closes: https://bugs.gentoo.org/677788
Closes: https://bugs.gentoo.org/687602
Bug: https://bugs.gentoo.org/703438
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-kernel/dracut/dracut-049-r3.ebuild             | 176 +++++++++++++++++++++
 ...gure-find-cflags-and-libs-for-fts-on-musl.patch |  97 ++++++++++++
 ...t-create-locking-directory-run-cryptsetup.patch |  32 ++++
 ...all-Support-the-compressed-firmware-files.patch |  63 ++++++++
 .../049-dracut.sh-Fix-udevdir-detection.patch      |  38 +++++
 .../dracut/files/049-fs-lib-drop-a-bashism.patch   |  99 ++++++++++++
 ...cut-install.c-install-module-dependencies.patch |  79 +++++++++
 ...ing_hash_func-should-not-be-fed-with-NULL.patch |  38 +++++
 ...g-the-systemdutildir-variable-before-it-s.patch |  55 +++++++
 ...ager-call-the-online-hook-for-connected-d.patch |  32 ++++
 ...ager-fix-getting-of-ifname-from-the-sysfs.patch |  37 +++++
 ...rk-manager-remove-useless-use-of-basename.patch |  26 +++
 ...dule-running-early-during-boot-to-help-ge.patch |  88 +++++++++++
 13 files changed, 860 insertions(+)

diff --git a/sys-kernel/dracut/dracut-049-r3.ebuild b/sys-kernel/dracut/dracut-049-r3.ebuild
new file mode 100644
index 00000000000..326820abb62
--- /dev/null
+++ b/sys-kernel/dracut/dracut-049-r3.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
+else
+	[[ "${PV}" = *_rc* ]] || \
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+	SRC_URI="https://github.com/dracutdevs/dracut/archive/${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/openrc[sysv-utils,selinux?]
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	elibc_musl? ( sys-libs/fts-standalone )
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+"
+DEPEND="
+	>=sys-apps/kmod-23
+	elibc_musl? ( sys-libs/fts-standalone )
+"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/048-dracut-install-simplify-ldd-parsing-logic.patch
+	"${FILESDIR}"/049-40network-Don-t-include-40network-by-default.patch
+	"${FILESDIR}"/049-remove-bashism-in-various-boot-scripts.patch
+	"${FILESDIR}"/049-network-manager-call-the-online-hook-for-connected-d.patch
+	"${FILESDIR}"/049-install-dracut-install.c-install-module-dependencies.patch
+	"${FILESDIR}"/049-install-string_hash_func-should-not-be-fed-with-NULL.patch
+	"${FILESDIR}"/049-dracut.sh-Fix-udevdir-detection.patch
+	"${FILESDIR}"/049-rngd-new-module-running-early-during-boot-to-help-ge.patch
+	"${FILESDIR}"/049-fs-lib-drop-a-bashism.patch
+	"${FILESDIR}"/049-network-manager-remove-useless-use-of-basename.patch
+	"${FILESDIR}"/049-move-setting-the-systemdutildir-variable-before-it-s.patch
+	"${FILESDIR}"/049-dracut-install-Support-the-compressed-firmware-files.patch
+	"${FILESDIR}"/049-crypt-create-locking-directory-run-cryptsetup.patch
+	"${FILESDIR}"/049-network-manager-fix-getting-of-ifname-from-the-sysfs.patch
+	"${FILESDIR}"/049-configure-find-cflags-and-libs-for-fts-on-musl.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	if [[ ${PV} != 9999 ]] ; then
+		# Source tarball from github doesn't include this file
+		echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+	fi
+}
+
+src_install() {
+	default
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+	optfeature \
+		"Enable rngd service to help generating entropy early during boot" \
+		sys-apps/rng-tools
+}

diff --git a/sys-kernel/dracut/files/049-configure-find-cflags-and-libs-for-fts-on-musl.patch b/sys-kernel/dracut/files/049-configure-find-cflags-and-libs-for-fts-on-musl.patch
new file mode 100644
index 00000000000..cd74564adb5
--- /dev/null
+++ b/sys-kernel/dracut/files/049-configure-find-cflags-and-libs-for-fts-on-musl.patch
@@ -0,0 +1,97 @@
+From 62f27ee6f145b5f8ca571887602cd9b0715b9e9d Mon Sep 17 00:00:00 2001
+From: Doan Tran Cong Danh <congdanhqx@gmail.com>
+Date: Wed, 6 Nov 2019 18:35:12 +0700
+Subject: [PATCH] configure: find cflags and libs for fts on musl
+To: <initramfs@vger.kernel.org>
+
+Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
+---
+ Makefile  |  2 +-
+ configure | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 31545899..f9b42b96 100644
+--- a/Makefile
++++ b/Makefile
+@@ -62,7 +62,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
+ install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
+ 
+ install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
+-	$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
++	$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
+ 
+ logtee: logtee.c
+ 	$(CC) $(LDFLAGS) -o $@ $<
+diff --git a/configure b/configure
+index b55fb609..3f724ef2 100755
+--- a/configure
++++ b/configure
+@@ -7,6 +7,7 @@ prefix=/usr
+ 
+ enable_documentation=yes
+ 
++CC="${CC:-cc}"
+ PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
+ 
+ # Little helper function for reading args from the commandline.
+@@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
+     exit 1
+ fi
+ 
++cat <<EOF >conftest.c
++#include <fts.h>
++int main() {
++	return 0;
++}
++EOF
++
++${CC} $CFLAGS $LDFLAGS conftest.c >/dev/null 2>&1
++ret=$?
++rm -f conftest.c a.out
++
++# musl doesn't have fts.h included
++if test $ret -ne 0; then
++	echo "dracut needs fts development files." >&2
++	exit 1
++fi
++
++cat <<EOF >conftest.c
++#include <fts.h>
++int main(void) {
++	fts_open(0, 0, 0);
++	return 0;
++}
++EOF
++
++found=no
++for lib in "-lc" "-lfts"; do
++	${CC} $CFLAGS -Wl,$lib $LDFLAGS conftest.c >/dev/null 2>&1
++	ret=$?
++	if test $ret -eq 0; then
++		FTS_LIBS="$lib"
++		found=yes
++		break;
++	fi
++done
++rm -f conftest.c a.out
++
++if test $found = no; then
++	echo "dracut couldn't find usable fts library" >&2
++	exit 1
++fi
++
+ cat > Makefile.inc.$$ <<EOF
+ prefix ?= ${prefix}
+ libdir ?= ${libdir:-${prefix}/lib}
+@@ -68,6 +111,7 @@ enable_documentation ?= ${enable_documentation:-yes}
+ bindir ?= ${bindir:-${prefix}/bin}
+ KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
+ KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
++FTS_LIBS ?= ${FTS_LIBS}
+ EOF
+ 
+ {
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-crypt-create-locking-directory-run-cryptsetup.patch b/sys-kernel/dracut/files/049-crypt-create-locking-directory-run-cryptsetup.patch
new file mode 100644
index 00000000000..be964c03746
--- /dev/null
+++ b/sys-kernel/dracut/files/049-crypt-create-locking-directory-run-cryptsetup.patch
@@ -0,0 +1,32 @@
+From f39aa529c59c533ce5e75e31be1b0cce4513b3d7 Mon Sep 17 00:00:00 2001
+From: Jonas Witschel <diabonas@gmx.de>
+Date: Sat, 31 Aug 2019 17:45:11 +0200
+Subject: [PATCH] crypt: create locking directory /run/cryptsetup
+To: <initramfs@vger.kernel.org>
+
+For LUKS2 partitions cryptsetup needs a locking directory. If it does
+not exist, cryptsetup will create it, but produce a warning
+
+WARNING: Locking directory /run/cryptsetup is missing!
+
+in the process that we do not want to see in the dracut output.
+---
+ modules.d/90crypt/cryptroot-ask.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
+index 33a823c7..e1f17975 100755
+--- a/modules.d/90crypt/cryptroot-ask.sh
++++ b/modules.d/90crypt/cryptroot-ask.sh
+@@ -8,6 +8,8 @@ NEWROOT=${NEWROOT:-"/sysroot"}
+ 
+ . /lib/dracut-lib.sh
+ 
++mkdir -m 0700 /run/cryptsetup
++
+ # if device name is /dev/dm-X, convert to /dev/mapper/name
+ if [ "${1##/dev/dm-}" != "$1" ]; then
+     device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-dracut-install-Support-the-compressed-firmware-files.patch b/sys-kernel/dracut/files/049-dracut-install-Support-the-compressed-firmware-files.patch
new file mode 100644
index 00000000000..85c0ea09972
--- /dev/null
+++ b/sys-kernel/dracut/files/049-dracut-install-Support-the-compressed-firmware-files.patch
@@ -0,0 +1,63 @@
+From 999cfa84582ab4ce4cc602242cb71d0af0b7d4ac Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Thu, 22 Aug 2019 12:37:56 +0200
+Subject: [PATCH] dracut-install: Support the compressed firmware files
+ correctly
+To: <initramfs@vger.kernel.org>
+
+The compressed firmware support was supposed to be already
+implemented, but it didn't work as expected in the end, because dracut
+moved to use dracut-install binary.  This patch adds the support of
+XZ-compressed firmware installation to dracut-install for fixing the
+missing piece.
+
+At best the firmware files should be uncompressed in initrd, but this
+patch simply copies the compressed file as-is, as a quick workaround.
+
+BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+---
+ install/dracut-install.c | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index 9e415b5e..7cda499d 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -1151,6 +1151,8 @@ static int install_firmware(struct kmod_module *mod)
+                 ret = -1;
+                 STRV_FOREACH(q, firmwaredirs) {
+                         _cleanup_free_ char *fwpath = NULL;
++                        _cleanup_free_ char *fwpath_xz = NULL;
++                        const char *fw;
+                         struct stat sb;
+                         int r;
+ 
+@@ -1160,12 +1162,21 @@ static int install_firmware(struct kmod_module *mod)
+                                 exit(EXIT_FAILURE);
+                         }
+ 
++                        fw = fwpath;
+                         if (stat(fwpath, &sb) != 0) {
+-                                log_debug("stat(%s) != 0", fwpath);
+-                                continue;
++                                r = asprintf(&fwpath_xz, "%s.xz", fwpath);
++                                if (r < 0) {
++                                        log_error("Out of memory!");
++                                        exit(EXIT_FAILURE);
++                                }
++                                if (stat(fwpath_xz, &sb) != 0) {
++                                        log_debug("stat(%s) != 0", fwpath);
++                                        continue;
++                                }
++                                fw = fwpath_xz;
+                         }
+ 
+-                        ret = dracut_install(fwpath, fwpath, false, false, true);
++                        ret = dracut_install(fw, fw, false, false, true);
+                         if (ret == 0)
+                                 log_debug("dracut_install '%s' OK", fwpath);
+                 }
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-dracut.sh-Fix-udevdir-detection.patch b/sys-kernel/dracut/files/049-dracut.sh-Fix-udevdir-detection.patch
new file mode 100644
index 00000000000..ec7d4802370
--- /dev/null
+++ b/sys-kernel/dracut/files/049-dracut.sh-Fix-udevdir-detection.patch
@@ -0,0 +1,38 @@
+From dddcb809459b7a75906d4b90cf7a5ac291dc74c1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 3 Apr 2019 15:24:47 +0800
+Subject: [PATCH] dracut.sh: Fix udevdir detection
+To: <initramfs@vger.kernel.org>
+
+In commit [9d1b81c dracut.sh: improve udevdir and systemdutildir
+fallback logic] , it checked a common binary `collect' to location
+udevdir.
+
+But upstream systemd drop binary `collect' since systemd v240
+[https://github.com/systemd/systemd/commit/a168792c2d95695fd30c0371d4b3890a9df1eafb]
+
+So check binary `ata_id' to instead.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ dracut.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index 9098571d..fd9903b6 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -1311,8 +1311,8 @@ done
+ [[ -d $udevdir ]] \
+     || udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
+ if ! [[ -d "$udevdir" ]]; then
+-    [[ -e /lib/udev/collect ]] && udevdir=/lib/udev
+-    [[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev
++    [[ -e /lib/udev/ata_id ]] && udevdir=/lib/udev
++    [[ -e /usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev
+ fi
+ 
+ [[ -d $systemdutildir ]] \
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-fs-lib-drop-a-bashism.patch b/sys-kernel/dracut/files/049-fs-lib-drop-a-bashism.patch
new file mode 100644
index 00000000000..a44b8f31651
--- /dev/null
+++ b/sys-kernel/dracut/files/049-fs-lib-drop-a-bashism.patch
@@ -0,0 +1,99 @@
+From 43c8c4ce0471abbb8c0fc4b8be2515cebc636030 Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Fri, 21 Jun 2019 18:39:48 +0200
+Subject: [PATCH] fs-lib: drop a bashism
+To: <initramfs@vger.kernel.org>
+
+Bash 5 apparently longer propagates variable assignments to local variables
+in front of function calls when in POSIX mode:
+
+  [lkundrak@demiurge ~]$ cat feh.sh
+  print_VAR () {
+          echo "$VAR";
+  }
+
+  testfunc () {
+          local VAR="OLD"
+          VAR=NEW print_VAR
+  }
+
+  testfunc
+  [lkundrak@demiurge ~]$ bash4 --posix feh.sh
+  NEW
+  [lkundrak@demiurge ~]$ bash5 --posix feh.sh
+  OLD
+  [lkundrak@demiurge ~]$ bash5 feh.sh
+  NEW
+  [lkundrak@demiurge ~]$
+
+It works the way it did in Bash 4 in non-POSIX mode, for external programs,
+or for non-local variables. Don't ask me why -- it's probably some
+compatibility thing for some sad old people.
+
+However, this precisely happens when fsck_single() is calling into the
+fsck_drv_com(), assigned to _drv by fsck_able(). That ruins the
+TEST-70-BONDBRIDGETEAMVLAN test's server and probably more.
+
+Let's pass the fsck driver binary via the function argument instead. It's
+less messy anyway.
+---
+ modules.d/99fs-lib/fs-lib.sh | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh
+index d39ca1b7..11e795d9 100755
+--- a/modules.d/99fs-lib/fs-lib.sh
++++ b/modules.d/99fs-lib/fs-lib.sh
+@@ -44,22 +44,22 @@ fsck_able() {
+             ;;
+         ext?)
+             type e2fsck >/dev/null 2>&1 &&
+-            _drv="_drv=e2fsck fsck_drv_com" &&
++            _drv="fsck_drv_com e2fsck" &&
+             return 0
+             ;;
+         f2fs)
+ 	    type fsck.f2fs >/dev/null 2>&1 &&
+-	    _drv="_drv=fsck.f2fs fsck_drv_com" &&
++	    _drv="fsck_drv_com fsck.f2fs" &&
+ 	    return 0
+ 	    ;;
+         jfs)
+             type jfs_fsck >/dev/null 2>&1 &&
+-            _drv="_drv=jfs_fsck fsck_drv_com" &&
++            _drv="fsck_drv_com jfs_fsck" &&
+             return 0
+             ;;
+         reiserfs)
+             type reiserfsck >/dev/null 2>&1 &&
+-            _drv="_drv=reiserfsck fsck_drv_com" &&
++            _drv="fsck_drv_com reiserfsck" &&
+             return 0
+             ;;
+         btrfs)
+@@ -70,12 +70,12 @@ fsck_able() {
+             ;;
+         nfs*)
+             # nfs can be a nop, returning success
+-            _drv="_drv=none :" &&
++            _drv=":" &&
+             return 0
+             ;;
+         *)
+             type fsck >/dev/null 2>&1 &&
+-            _drv="_drv=fsck fsck_drv_std" &&
++            _drv="fsck_drv_std fsck" &&
+             return 0
+             ;;
+     esac
+@@ -97,6 +97,7 @@ fsck_drv_btrfs() {
+ 
+ # common code for checkers that follow usual subset of options and return codes
+ fsck_drv_com() {
++    local _drv="$1"
+     local _ret
+     local _out
+ 
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-install-dracut-install.c-install-module-dependencies.patch b/sys-kernel/dracut/files/049-install-dracut-install.c-install-module-dependencies.patch
new file mode 100644
index 00000000000..ec3e903765a
--- /dev/null
+++ b/sys-kernel/dracut/files/049-install-dracut-install.c-install-module-dependencies.patch
@@ -0,0 +1,79 @@
+From c38f9e980c1ee03151dd1c6602907c6228b78d30 Mon Sep 17 00:00:00 2001
+From: Harald Hoyer <harald@redhat.com>
+Date: Tue, 4 Dec 2018 10:02:45 +0100
+Subject: [PATCH] install/dracut-install.c: install module dependencies of
+ dependencies
+To: <initramfs@vger.kernel.org>
+
+---
+ install/dracut-install.c | 28 +++++++++++++++++++++++++---
+ 1 file changed, 25 insertions(+), 3 deletions(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index 5f352b36..d64de545 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -84,6 +84,11 @@ static bool arg_mod_filter_noname = false;
+ static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
+ 
+ 
++static inline void kmod_module_unrefp(struct kmod_module **p) {
++        if (*p)
++                kmod_module_unref(*p);
++}
++#define _cleanup_kmod_module_unref_ _cleanup_(kmod_module_unrefp)
+ 
+ static inline void kmod_module_unref_listp(struct kmod_list **p) {
+         if (*p)
+@@ -1230,28 +1235,45 @@ static bool check_module_path(const char *path)
+ static int install_dependent_modules(struct kmod_list *modlist)
+ {
+         struct kmod_list *itr;
+-        struct kmod_module *mod;
+         const char *path = NULL;
+         const char *name = NULL;
+         int ret = 0;
+ 
+         kmod_list_foreach(itr, modlist) {
++		_cleanup_kmod_module_unref_ struct kmod_module *mod = NULL;
+                 mod = kmod_module_get_module(itr);
+                 path = kmod_module_get_path(mod);
+ 
++		if (check_hashmap(items_failed, path))
++			return -1;
++
++		if (check_hashmap(items, path)) {
++			continue;
++		}
++
+                 name = kmod_module_get_name(mod);
++
+                 if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
+-                        kmod_module_unref(mod);
+                         continue;
+                 }
++
+                 ret = dracut_install(path, &path[kerneldirlen], false, false, true);
+                 if (ret == 0) {
++			_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
++			_cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL;
++			_cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL;
+                         log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]);
+                         install_firmware(mod);
++			modlist = kmod_module_get_dependencies(mod);
++			ret = install_dependent_modules(modlist);
++			if (ret == 0) {
++				ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
++				if (ret == 0)
++					ret = install_dependent_modules(modpre);
++			}
+                 } else {
+                         log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
+                 }
+-                kmod_module_unref(mod);
+         }
+ 
+         return ret;
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-install-string_hash_func-should-not-be-fed-with-NULL.patch b/sys-kernel/dracut/files/049-install-string_hash_func-should-not-be-fed-with-NULL.patch
new file mode 100644
index 00000000000..80f0c2b0186
--- /dev/null
+++ b/sys-kernel/dracut/files/049-install-string_hash_func-should-not-be-fed-with-NULL.patch
@@ -0,0 +1,38 @@
+From fc141f22869bad2e5409d1cc555c1a42ea738343 Mon Sep 17 00:00:00 2001
+From: Lukas Nykryn <lnykryn@redhat.com>
+Date: Thu, 14 Feb 2019 20:18:04 +0100
+Subject: [PATCH] install: string_hash_func should not be fed with NULL
+To: <initramfs@vger.kernel.org>
+
+If kmod_module_get_path returns NULL, we should skip that entry,
+the hash function does not like NULL pointers.
+---
+ install/dracut-install.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index d64de545..9e415b5e 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -1244,6 +1244,9 @@ static int install_dependent_modules(struct kmod_list *modlist)
+                 mod = kmod_module_get_module(itr);
+                 path = kmod_module_get_path(mod);
+ 
++                if (path == NULL)
++                        continue;
++
+ 		if (check_hashmap(items_failed, path))
+ 			return -1;
+ 
+@@ -1253,7 +1256,7 @@ static int install_dependent_modules(struct kmod_list *modlist)
+ 
+                 name = kmod_module_get_name(mod);
+ 
+-                if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
++                if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
+                         continue;
+                 }
+ 
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-move-setting-the-systemdutildir-variable-before-it-s.patch b/sys-kernel/dracut/files/049-move-setting-the-systemdutildir-variable-before-it-s.patch
new file mode 100644
index 00000000000..585f47add02
--- /dev/null
+++ b/sys-kernel/dracut/files/049-move-setting-the-systemdutildir-variable-before-it-s.patch
@@ -0,0 +1,55 @@
+From c8b35bf96af1859c0c254db34a16b9cc5a2aa46b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?=
+ =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?=
+ <gdamjan@gmail.com>
+Date: Mon, 27 May 2019 18:22:14 +0200
+Subject: [PATCH] move setting the "systemdutildir" variable before it's used
+To: <initramfs@vger.kernel.org>
+
+on line 1086 it's used to check for the uefi_stub:
+"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"
+
+so it needs to be defined before that
+---
+ dracut.sh | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index 183b892f..a3618f89 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -1009,6 +1009,16 @@ esac
+ 
+ abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
+ 
++
++[[ -d $systemdutildir ]] \
++    || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
++
++if ! [[ -d "$systemdutildir" ]]; then
++    [[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
++    [[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
++fi
++
++
+ if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
+     if ! [[ -f $srcmods/modules.dep ]]; then
+         if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then
+@@ -1325,14 +1335,6 @@ if ! [[ -d "$udevdir" ]]; then
+     [[ -e /usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev
+ fi
+ 
+-[[ -d $systemdutildir ]] \
+-    || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
+-
+-if ! [[ -d "$systemdutildir" ]]; then
+-    [[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
+-    [[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
+-fi
+-
+ [[ -d $systemdsystemunitdir ]] \
+     || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null)
+ 
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-network-manager-call-the-online-hook-for-connected-d.patch b/sys-kernel/dracut/files/049-network-manager-call-the-online-hook-for-connected-d.patch
new file mode 100644
index 00000000000..7f5fc6a0385
--- /dev/null
+++ b/sys-kernel/dracut/files/049-network-manager-call-the-online-hook-for-connected-d.patch
@@ -0,0 +1,32 @@
+From 79a17b0112995eb60c85c64d15070c52f213b28d Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Tue, 27 Nov 2018 15:30:48 +0100
+Subject: [PATCH] network-manager: call the online hook for connected devices
+To: <initramfs@vger.kernel.org>
+
+Look for "connection-uuid" instead of "managed" to determine the devices
+that are actually activated with a connection and call the online hook.
+
+This fixes the anaconda-net root mount, which utilizes the online hook.
+---
+ modules.d/35network-manager/nm-run.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
+index f6defa99..0f943631 100755
+--- a/modules.d/35network-manager/nm-run.sh
++++ b/modules.d/35network-manager/nm-run.sh
+@@ -9,8 +9,9 @@ fi
+ for _i in /sys/class/net/*/
+ do
+     state=/run/NetworkManager/devices/$(cat $_i/ifindex)
+-    grep -q managed=true $state 2>/dev/null || continue
++    grep -q connection-uuid= $state 2>/dev/null || continue
+     ifname=$(basename $_i)
+     sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
++    source_hook initqueue/online $ifname
+     /sbin/netroot $ifname
+ done
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-network-manager-fix-getting-of-ifname-from-the-sysfs.patch b/sys-kernel/dracut/files/049-network-manager-fix-getting-of-ifname-from-the-sysfs.patch
new file mode 100644
index 00000000000..430b93f93de
--- /dev/null
+++ b/sys-kernel/dracut/files/049-network-manager-fix-getting-of-ifname-from-the-sysfs.patch
@@ -0,0 +1,37 @@
+From 687e17aa7f2f40d21717be9a04302c749e139d4a Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Wed, 30 Oct 2019 19:25:51 +0100
+Subject: [PATCH] network-manager: fix getting of ifname from the sysfs path
+To: <initramfs@vger.kernel.org>
+
+commit 5e0f8c8a4ced ('network-manager: remove useless use of basename')
+somewhat carelessly didn't take into account that $_i has a slash at
+the end which made the result of the ## substitution be just an empty
+string.
+
+The slash was put to the end of /sys/class/net/*/ to make sure we're only
+iterating directories, but it's not strictly necessary. In an unlikely case
+something else than a directory appears in /sys/class/net/, we'll already deal
+with it gracefully. Remove it.
+
+This fixes the TEST-30-ISCSI test.
+---
+ modules.d/35network-manager/nm-run.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
+index a539d5b2..b33e0992 100755
+--- a/modules.d/35network-manager/nm-run.sh
++++ b/modules.d/35network-manager/nm-run.sh
+@@ -6,7 +6,7 @@ else
+     /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
+ fi
+ 
+-for _i in /sys/class/net/*/
++for _i in /sys/class/net/*
+ do
+     state=/run/NetworkManager/devices/$(cat $_i/ifindex)
+     grep -q connection-uuid= $state 2>/dev/null || continue
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-network-manager-remove-useless-use-of-basename.patch b/sys-kernel/dracut/files/049-network-manager-remove-useless-use-of-basename.patch
new file mode 100644
index 00000000000..1650c9a767e
--- /dev/null
+++ b/sys-kernel/dracut/files/049-network-manager-remove-useless-use-of-basename.patch
@@ -0,0 +1,26 @@
+From 5e0f8c8a4ced36268d0077acafa1db2402776fa6 Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Mon, 17 Jun 2019 10:07:38 +0200
+Subject: [PATCH] network-manager: remove useless use of basename
+To: <initramfs@vger.kernel.org>
+
+---
+ modules.d/35network-manager/nm-run.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
+index 0f943631..5f4b38ca 100755
+--- a/modules.d/35network-manager/nm-run.sh
++++ b/modules.d/35network-manager/nm-run.sh
+@@ -10,7 +10,7 @@ for _i in /sys/class/net/*/
+ do
+     state=/run/NetworkManager/devices/$(cat $_i/ifindex)
+     grep -q connection-uuid= $state 2>/dev/null || continue
+-    ifname=$(basename $_i)
++    ifname=${_i##*/}
+     sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
+     source_hook initqueue/online $ifname
+     /sbin/netroot $ifname
+-- 
+2.24.1
+

diff --git a/sys-kernel/dracut/files/049-rngd-new-module-running-early-during-boot-to-help-ge.patch b/sys-kernel/dracut/files/049-rngd-new-module-running-early-during-boot-to-help-ge.patch
new file mode 100644
index 00000000000..5ea342df78a
--- /dev/null
+++ b/sys-kernel/dracut/files/049-rngd-new-module-running-early-during-boot-to-help-ge.patch
@@ -0,0 +1,88 @@
+From adee5b97bc5418b6e357342bb3be20568668aa55 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
+Date: Thu, 11 Jul 2019 10:50:40 +0200
+Subject: [PATCH] rngd: new module running early during boot to help generating
+ entropy when system's default entropy sources are poor (e.g. use of SSD disks
+ or UEFI RNG not available)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: <initramfs@vger.kernel.org>
+
+On systems with low entropy at boot, the boot can take up to several
+hours, specially when NBDE is used (e.g. clevis) which makes use of
+the random number generator.
+
+Enabling rngd service at boot early, because dracut-initqueue runs,
+enables to initialize the random number generator in a couple of seconds
+instead of minutes or hours.
+
+Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
+---
+ modules.d/06rngd/module-setup.sh | 39 ++++++++++++++++++++++++++++++++
+ modules.d/06rngd/rngd.service    |  7 ++++++
+ 2 files changed, 46 insertions(+)
+ create mode 100644 modules.d/06rngd/module-setup.sh
+ create mode 100644 modules.d/06rngd/rngd.service
+
+diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh
+new file mode 100644
+index 00000000..43d5c2d3
+--- /dev/null
++++ b/modules.d/06rngd/module-setup.sh
+@@ -0,0 +1,39 @@
++#!/bin/bash
++# vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80:
++#
++# Copyright (c) 2019 Red Hat, Inc.
++# Author: Renaud Métrich <rmetrich@redhat.com>
++#
++# This program is free software: you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation, either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++#
++
++depends() {
++    echo systemd
++    return 0
++}
++
++check() {
++    # if there's no rngd binary, no go.
++    require_binaries rngd || return 1
++
++    return 0
++}
++
++install() {
++    inst rngd
++    inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
++    mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
++    ln -rfs "${initdir}${systemdsystemunitdir}/rngd.service" \
++        "${initdir}${systemdsystemunitdir}/sysinit.target.wants/rngd.service"
++}
+diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service
+new file mode 100644
+index 00000000..570fbedb
+--- /dev/null
++++ b/modules.d/06rngd/rngd.service
+@@ -0,0 +1,7 @@
++[Unit]
++Description=Hardware RNG Entropy Gatherer Daemon
++DefaultDependencies=no
++Before=systemd-udevd.service
++
++[Service]
++ExecStart=/usr/sbin/rngd -f
+-- 
+2.24.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2019-01-21 14:23 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2019-01-21 14:23 UTC (permalink / raw
  To: gentoo-commits

commit:     3a5005c33678f26a1477a49e791f89a8480c523a
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Fri Jan 11 18:40:03 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Jan 21 14:23:15 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a5005c3

sys-kernel/dracut: version bump to 049

Bug: https://bugs.gentoo.org/602122
Bug: https://bugs.gentoo.org/670450
Closes: https://github.com/gentoo/gentoo/pull/10808
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-kernel/dracut/Manifest                         |   1 +
 sys-kernel/dracut/dracut-049.ebuild                | 158 +++++++++++++++++++++
 ...etwork-Don-t-include-40network-by-default.patch |  34 +++++
 ...49-remove-bashism-in-various-boot-scripts.patch |  89 ++++++++++++
 4 files changed, 282 insertions(+)

diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest
index cac868159ce..7b97320d25d 100644
--- a/sys-kernel/dracut/Manifest
+++ b/sys-kernel/dracut/Manifest
@@ -3,3 +3,4 @@ DIST dracut-045.tar.xz 292652 BLAKE2B 0e7c57ddca6757d59823afdc4ff23dcb06cc9cec31
 DIST dracut-046.tar.xz 299520 BLAKE2B 1e2d848aa0db0e90734d8c60610a60b1f0ff67f8c4d4f9933bec0bc1290071b1b1ee3cdb6c3da5b82d8f6d4cc7561ee17d38685659a4a6ee48a9085e388dfced SHA512 75cefc184960024ef32f7bb5a0fe060e9c7d82dbfd0fe247d54b585e2ebbf0f8af5d5dc1be7e5e8cf2c3bc27b3293842c6361ae62d047289d0c59d7d40b09122
 DIST dracut-047.tar.xz 305836 BLAKE2B 18333ae1e24cfbbb6a152bf9ba2c48884821f6a506344259ba56c581a9f3efac7b4c88e8ca149ef1f83347a5e4d59acba61e42b8e0ab3a9e9beb8684d5db28b0 SHA512 03369726b6c2b682d0c9dead7b7dbd1c3989aaf2b4a561015634d33a94e5230d03cb634c3890191b19dd8c1c83389533ae1a46d45d2024ba885e0d2d46c5d035
 DIST dracut-048.tar.xz 308484 BLAKE2B b19c8122034a8b40cbc9d09245730900b59691c336f1d231e768786ad64068e0a8daf57ae9a4182ab50d9e1c683c9b7dcac354eb26d8a60f061db78121bc11c7 SHA512 97fcfd5d314ef40687c245d95d2f1d0f3f9ff0472e66b6e6324bf9bd6b98186104f9d71fd9af344126d6ea9fa47b744d52831a374225633225f6f17fb15c04e0
+DIST dracut-049.tar.gz 376857 BLAKE2B e50084164e26aae6de812345cc76782435ec84951b44eea454355d0c65fe84fdd0858733de534bdf018bdfd92922f0be30b74d74be329a918e55d96c5e4d4fb6 SHA512 51489570856538588868a66c7bcc8a3728574592529905484526c523398dc1b8f1416e6b264780303acd08d818417a9668b76f1d64d3194432b5af79dc15c9f7

diff --git a/sys-kernel/dracut/dracut-049.ebuild b/sys-kernel/dracut/dracut-049.ebuild
new file mode 100644
index 00000000000..dda60561bf7
--- /dev/null
+++ b/sys-kernel/dracut/dracut-049.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="https://github.com/dracutdevs/dracut/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="selinux"
+
+# Tests need root privileges, bug #298014
+RESTRICT="test"
+
+RDEPEND="
+	app-arch/cpio
+	>=app-shells/bash-4.0:0
+	sys-apps/coreutils[xattr(-)]
+	>=sys-apps/kmod-23[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+	)
+	>=sys-apps/util-linux-2.21
+	virtual/pkgconfig
+	virtual/udev
+
+	selinux? (
+		sec-policy/selinux-dracut
+		sys-libs/libselinux
+		sys-libs/libsepol
+	)
+	"
+DEPEND=">=sys-apps/kmod-23"
+
+BDEPEND="
+	app-text/asciidoc
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	>=dev-libs/libxslt-1.1.26
+	virtual/pkgconfig
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+
+QA_MULTILIB_PATHS="usr/lib/dracut/.*"
+
+PATCHES=(
+	"${FILESDIR}"/048-dracut-install-simplify-ldd-parsing-logic.patch
+	"${FILESDIR}"/049-40network-Don-t-include-40network-by-default.patch
+	"${FILESDIR}"/049-remove-bashism-in-various-boot-scripts.patch
+)
+
+src_configure() {
+	local myconf=(
+		--prefix="${EPREFIX}/usr"
+		--sysconfdir="${EPREFIX}/etc"
+		--bashcompletiondir="$(get_bashcompdir)"
+		--systemdsystemunitdir="$(systemd_get_systemunitdir)"
+	)
+
+	tc-export CC PKG_CONFIG
+
+	echo ./configure "${myconf[@]}"
+	./configure "${myconf[@]}" || die
+
+	# Source tarball from github doesn't include this file
+	echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
+}
+
+src_install() {
+	default
+
+	local libdirs=( /$(get_libdir) /usr/$(get_libdir) )
+	if [[ ${SYMLINK_LIB} = yes && $(get_libdir) != lib ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		libdirs+=( /lib /usr/lib )
+	fi
+
+	einfo "Setting libdirs to \"${libdirs[*]}\" ..."
+	echo "libdirs=\"${libdirs[*]}\"" > "${T}/gentoo.conf" || die
+	insinto "/usr/lib/dracut/dracut.conf.d"
+	doins "${T}/gentoo.conf"
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	docinto html
+	dodoc dracut.html
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
+		ERROR_DEVTMPFS+='is missing and REQUIRED'
+		local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
+		ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked."
+		ewarn "Please check manually if following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support" net-misc/networkmanager
+	optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2 "net-misc/iputils[arping]"
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with rsyslog" app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/files/049-40network-Don-t-include-40network-by-default.patch b/sys-kernel/dracut/files/049-40network-Don-t-include-40network-by-default.patch
new file mode 100644
index 00000000000..0d537941f1d
--- /dev/null
+++ b/sys-kernel/dracut/files/049-40network-Don-t-include-40network-by-default.patch
@@ -0,0 +1,34 @@
+From 83cbc06ab91288e2d931b4f36935bfdb79a99b0e Mon Sep 17 00:00:00 2001
+From: Kairui Song <kasong@redhat.com>
+Date: Fri, 12 Oct 2018 13:07:13 +0800
+Subject: [PATCH] 40network: Don't include 40network by default
+To: <initramfs@vger.kernel.org>
+
+commit 7347391 ('network-legacy: split off from network module')
+splitted network function to network-legacy and removed check() function
+of 40network. This caused 40network to be included even if network is
+not needed.
+
+Signed-off-by: Kairui Song <kasong@redhat.com>
+---
+ modules.d/40network/module-setup.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
+index 57c0a45e..e8541636 100755
+--- a/modules.d/40network/module-setup.sh
++++ b/modules.d/40network/module-setup.sh
+@@ -1,5 +1,10 @@
+ #!/bin/bash
+ 
++# called by dracut
++check() {
++    return 255
++}
++
+ # called by dracut
+ depends() {
+     echo -n "kernel-network-modules "
+-- 
+2.19.2
+

diff --git a/sys-kernel/dracut/files/049-remove-bashism-in-various-boot-scripts.patch b/sys-kernel/dracut/files/049-remove-bashism-in-various-boot-scripts.patch
new file mode 100644
index 00000000000..93e3ed5bed8
--- /dev/null
+++ b/sys-kernel/dracut/files/049-remove-bashism-in-various-boot-scripts.patch
@@ -0,0 +1,89 @@
+From 09d2a1605b1b2663e3c25f1d9950b23a2bf4ad89 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
+ <congdanhqx@gmail.com>
+Date: Sun, 6 Jan 2019 11:48:02 +0700
+Subject: [PATCH] remove bashism in various boot scripts
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+To: <initramfs@vger.kernel.org>
+
+When using dash as initramfs shell, the boot process is broken.
+
+Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
+---
+ modules.d/90crypt/crypt-lib.sh         | 2 +-
+ modules.d/90crypt/parse-keydev.sh      | 2 +-
+ modules.d/91crypt-gpg/crypt-gpg-lib.sh | 2 +-
+ modules.d/95dcssblk/parse-dcssblk.sh   | 2 +-
+ modules.d/98syslog/rsyslogd-start.sh   | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
+index bbf485e0..688ea251 100755
+--- a/modules.d/90crypt/crypt-lib.sh
++++ b/modules.d/90crypt/crypt-lib.sh
+@@ -191,7 +191,7 @@ readkey() {
+     local device="$3"
+ 
+     # No mounting needed if the keyfile resides inside the initrd
+-    if [ "/" == "$keydev" ]; then
++    if [ "/" = "$keydev" ]; then
+         local mntp=/
+     else
+         # This creates a unique single mountpoint for *, or several for explicitly
+diff --git a/modules.d/90crypt/parse-keydev.sh b/modules.d/90crypt/parse-keydev.sh
+index a45b2fb5..04813414 100755
+--- a/modules.d/90crypt/parse-keydev.sh
++++ b/modules.d/90crypt/parse-keydev.sh
+@@ -18,7 +18,7 @@ if getargbool 1 rd.luks -n rd_NO_LUKS && \
+         fi
+ 
+         # A keydev of '/' is treated as the initrd itself
+-        if [ "/" == "$keydev" ]; then
++        if [ "/" = "$keydev" ]; then
+             [ -z "$luksdev" ] && luksdev='*'
+             echo "$luksdev:$keydev:$keypath" >> /tmp/luks.keys
+             continue
+diff --git a/modules.d/91crypt-gpg/crypt-gpg-lib.sh b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
+index b85ed2b8..c051b430 100755
+--- a/modules.d/91crypt-gpg/crypt-gpg-lib.sh
++++ b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
+@@ -53,7 +53,7 @@ gpg_decrypt() {
+         --tries 3 --tty-echo-off
+ 
+     # Clean up the smartcard gpg-agent
+-    if [ "${useSmartcard}" == "1" ]; then
++    if [ "${useSmartcard}" = "1" ]; then
+         GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null killagent /bye
+     fi
+ 
+diff --git a/modules.d/95dcssblk/parse-dcssblk.sh b/modules.d/95dcssblk/parse-dcssblk.sh
+index 8f174408..27ac1d8d 100644
+--- a/modules.d/95dcssblk/parse-dcssblk.sh
++++ b/modules.d/95dcssblk/parse-dcssblk.sh
+@@ -2,7 +2,7 @@
+ # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+ # ex: ts=8 sw=4 sts=4 et filetype=sh
+ dcssblk_arg=$(getarg rd.dcssblk=)
+-if [ $? == 0 ];then
++if [ $? = 0 ];then
+ 	info "Loading dcssblk segments=$dcssblk_arg"
+ 	modprobe dcssblk segments=$dcssblk_arg
+ fi
+diff --git a/modules.d/98syslog/rsyslogd-start.sh b/modules.d/98syslog/rsyslogd-start.sh
+index c64f2121..86ad50ea 100755
+--- a/modules.d/98syslog/rsyslogd-start.sh
++++ b/modules.d/98syslog/rsyslogd-start.sh
+@@ -38,7 +38,7 @@ rsyslog_config() {
+ [ -f /tmp/syslog.conf ] && read conf < /tmp/syslog.conf
+ [ -z "$conf" ] && conf="/etc/rsyslog.conf" && echo "$conf" > /tmp/syslog.conf
+ 
+-if [ $type == "rsyslogd" ]; then
++if [ $type = "rsyslogd" ]; then
+     template=/etc/templates/rsyslog.conf
+     if [ -n "$server" ]; then
+         rsyslog_config "$server" "$template" "$filters" > $conf
+-- 
+2.19.2
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2018-03-24 18:03 Mike Gilbert
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Gilbert @ 2018-03-24 18:03 UTC (permalink / raw
  To: gentoo-commits

commit:     c9943a36849687a41b3feec6d6a7de5dddd715da
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Fri Mar 23 14:45:25 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Mar 24 18:02:33 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9943a36

sys-kernel/dracut: add upstream patches

Fixes the following issues:
- issues found by shellcheck
- broken plymouth directory detection

Closes: https://bugs.gentoo.org/651132

 .../{dracut-047.ebuild => dracut-047-r1.ebuild}    |  2 +
 .../047-all-fix-issues-found-by-shellcheck.patch   | 77 ++++++++++++++++++++++
 ...mouth-fix-detection-of-plymouth-directory.patch | 31 +++++++++
 3 files changed, 110 insertions(+)

diff --git a/sys-kernel/dracut/dracut-047.ebuild b/sys-kernel/dracut/dracut-047-r1.ebuild
similarity index 97%
rename from sys-kernel/dracut/dracut-047.ebuild
rename to sys-kernel/dracut/dracut-047-r1.ebuild
index b37520c7e9f..0ced6bdb8d9 100644
--- a/sys-kernel/dracut/dracut-047.ebuild
+++ b/sys-kernel/dracut/dracut-047-r1.ebuild
@@ -52,6 +52,8 @@ QA_MULTILIB_PATHS="usr/lib/dracut/.*"
 
 PATCHES=(
 	"${FILESDIR}/045-systemdutildir.patch"
+	"${FILESDIR}/047-all-fix-issues-found-by-shellcheck.patch"
+	"${FILESDIR}/047-plymouth-fix-detection-of-plymouth-directory.patch"
 )
 
 src_configure() {

diff --git a/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
new file mode 100644
index 00000000000..d5cbe042b63
--- /dev/null
+++ b/sys-kernel/dracut/files/047-all-fix-issues-found-by-shellcheck.patch
@@ -0,0 +1,77 @@
+From 3aa37cafde734719f2377600a17459fad30edfbc Mon Sep 17 00:00:00 2001
+From: Lukas Nykryn <lnykryn@redhat.com>
+Date: Fri, 2 Mar 2018 12:29:46 +0100
+Subject: [PATCH 06/14] all: fix issues found by shellcheck
+To: <initramfs@vger.kernel.org>
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/dracut-init.sh:939:20: error: Argument to implicit -n is always true due to literal strings. [SC2157]
+  937|   dracut_kernel_post() {
+  938|       for _f in modules.builtin.bin modules.builtin modules.order; do
+  939|->         [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+  940|       done
+  941|
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/modules.d/98syslog/parse-syslog-opts.sh:18:12: error: This expression is constant. Did you forget a $ somewhere? [SC2078]
+   16|       elif [ -e /sbin/syslogd ]; then
+   17|           syslogtype="syslogd"
+   18|->     elif [ /sbin/syslog-ng ]; then
+   19|           syslogtype="syslog-ng"
+   20|       else
+
+Error: SHELLCHECK_WARNING:
+/usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:15:29: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
+   13|               strstr "$d" "${luks##luks-}" && return 0
+   14|               if [ -n "$dev" ]; then
+   15|->                 for _dev in "$(devnames $d)"; do
+   16|                       [ "$dev" -ef "$_dev" ] && return 0
+   17|                   done
+---
+ dracut-init.sh                          | 2 +-
+ modules.d/90crypt/crypt-lib.sh          | 2 +-
+ modules.d/98syslog/parse-syslog-opts.sh | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dracut-init.sh b/dracut-init.sh
+index 53e6f13a..1278c638 100644
+--- a/dracut-init.sh
++++ b/dracut-init.sh
+@@ -942,7 +942,7 @@ for_each_kmod_dep() {
+ 
+ dracut_kernel_post() {
+     for _f in modules.builtin.bin modules.builtin modules.order; do
+-        [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
++        [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+     done
+ 
+     # generate module dependencies for the initrd
+diff --git a/modules.d/90crypt/crypt-lib.sh b/modules.d/90crypt/crypt-lib.sh
+index 532b9a71..bbf485e0 100755
+--- a/modules.d/90crypt/crypt-lib.sh
++++ b/modules.d/90crypt/crypt-lib.sh
+@@ -12,7 +12,7 @@ crypttab_contains() {
+             strstr "${l##luks-}" "${luks##luks-}" && return 0
+             strstr "$d" "${luks##luks-}" && return 0
+             if [ -n "$dev" ]; then
+-                for _dev in "$(devnames $d)"; do
++                for _dev in $(devnames $d); do
+                     [ "$dev" -ef "$_dev" ] && return 0
+                 done
+             fi
+diff --git a/modules.d/98syslog/parse-syslog-opts.sh b/modules.d/98syslog/parse-syslog-opts.sh
+index 50ec2759..9ec6ad47 100755
+--- a/modules.d/98syslog/parse-syslog-opts.sh
++++ b/modules.d/98syslog/parse-syslog-opts.sh
+@@ -15,7 +15,7 @@ detect_syslog() {
+         syslogtype="rsyslogd"
+     elif [ -e /sbin/syslogd ]; then
+         syslogtype="syslogd"
+-    elif [ /sbin/syslog-ng ]; then
++    elif [ -e /sbin/syslog-ng ]; then
+         syslogtype="syslog-ng"
+     else
+         warn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check."
+-- 
+2.16.1
+

diff --git a/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
new file mode 100644
index 00000000000..42f877292a7
--- /dev/null
+++ b/sys-kernel/dracut/files/047-plymouth-fix-detection-of-plymouth-directory.patch
@@ -0,0 +1,31 @@
+From fe6c7e0f06cde65effb3503a47c31ac39aceefb6 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <alexander@tsoy.me>
+Date: Fri, 23 Mar 2018 11:52:27 +0300
+Subject: [PATCH 14/14] plymouth: fix detection of plymouth directory
+To: <initramfs@vger.kernel.org>
+
+Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth
+directorirs, so we should check the existance of plymouth-populate-initrd
+script.
+
+Fixes: 421b46f8ae89cfe2b62e880a8a5079ee8c1b3aae
+---
+ modules.d/50plymouth/module-setup.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
+index 5fbca8b0..b51913e8 100755
+--- a/modules.d/50plymouth/module-setup.sh
++++ b/modules.d/50plymouth/module-setup.sh
+@@ -6,7 +6,7 @@ pkglib_dir() {
+         _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
+     fi
+     for _dir in $_dirs; do
+-        if [ -d $_dir ]; then
++        if [ -x $_dir/plymouth-populate-initrd ]; then
+             echo $_dir
+             return
+         fi
+-- 
+2.16.1
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2017-02-09 18:47 Patrick McLean
  0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2017-02-09 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     8a7aca3ac5f9df6d2782e53a7ead3620ab56f9b0
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 18:41:50 2017 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 18:47:26 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a7aca3a

sys-kernel/dracut: Revision bump, add patches for bash-4.4

Gentoo-Bug: 594834

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sys-kernel/dracut/dracut-044-r2.ebuild             | 263 +++++++++++++++++++++
 sys-kernel/dracut/files/dracut-044-bash-4.4.patch  |  80 +++++++
 .../dracut-044-preserve-xattrs-when-copying.patch  |  51 ++++
 3 files changed, 394 insertions(+)

diff --git a/sys-kernel/dracut/dracut-044-r2.ebuild b/sys-kernel/dracut/dracut-044-r2.ebuild
new file mode 100644
index 0000000000..394da6ea72
--- /dev/null
+++ b/sys-kernel/dracut/dracut-044-r2.ebuild
@@ -0,0 +1,263 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit bash-completion-r1 linux-info toolchain-funcs systemd
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="https://dracut.wiki.kernel.org"
+SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug selinux systemd"
+
+RESTRICT="test"
+
+CDEPEND="virtual/udev
+	systemd? ( >=sys-apps/systemd-199 )
+	"
+RDEPEND="${CDEPEND}
+	app-arch/cpio
+	>=app-shells/bash-4.0
+	>sys-apps/kmod-5[tools]
+	|| (
+		>=sys-apps/sysvinit-2.87-r3
+		sys-apps/systemd[sysv-utils]
+		sys-apps/systemd-sysv-utils
+	)
+	>=sys-apps/util-linux-2.21
+
+	debug? ( dev-util/strace )
+	selinux? (
+		sys-libs/libselinux
+		sys-libs/libsepol
+		sec-policy/selinux-dracut
+	)
+	"
+DEPEND="${CDEPEND}
+	app-text/asciidoc
+	>=dev-libs/libxslt-1.1.26
+	app-text/docbook-xml-dtd:4.5
+	>=app-text/docbook-xsl-stylesheets-1.75.2
+	virtual/pkgconfig
+	"
+
+DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
+	README.testsuite TODO )
+MY_LIBDIR=/usr/lib
+QA_MULTILIB_PATHS="
+	usr/lib/dracut/dracut-install
+	usr/lib/dracut/skipcpio
+	"
+
+PATCHES=(
+	"${FILESDIR}"/044-0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch
+	"${FILESDIR}"/044-0002-systemd-initrd-add-initrd-root-device.target.patch
+	"${FILESDIR}"/044-0003-50-dracut.install-use-bin-bash-shebang.patch
+	"${FILESDIR}"/dracut-044-bash-4.4.patch
+	"${FILESDIR}"/dracut-044-preserve-xattrs-when-copying.patch
+)
+
+#
+# Helper functions
+#
+
+# Removes module from modules.d.
+# $1 = module name
+# Module name can be specified without number prefix.
+rm_module() {
+	local force m
+	[[ $1 = -f ]] && force=-f
+
+	for m in $@; do
+		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
+			rm ${force} --interactive=never -r "${modules_dir}"/$m
+		else
+			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
+		fi
+	done
+}
+
+src_prepare() {
+	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
+	if [[ ${SYMLINK_LIB} = yes ]]; then
+		# Preserve lib -> lib64 symlinks in initramfs
+		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
+	fi
+	einfo "Setting libdirs to \"${libdirs}\" ..."
+	sed -e "3alibdirs=\"${libdirs}\"" \
+		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
+	einfo "Setting udevdir to ${udevdir}..."
+	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+
+	if use systemd; then
+		local systemdutildir="$(systemd_get_utildir)"
+		local systemdsystemunitdir="$(systemd_get_unitdir)"
+		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
+			--variable=systemdsystemconfdir)"
+		[[ ${systemdsystemconfdir} ]] \
+			|| systemdsystemconfdir=/etc/systemd/system
+		einfo "Setting systemdutildir to ${systemdutildir} and ..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
+		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
+		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	else
+		local systemdutildir="/lib/systemd"
+		einfo "Setting systemdutildir for standalone udev to" \
+			"${systemdutildir}..."
+		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
+			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
+	fi
+
+	default
+}
+
+src_configure() {
+	local myconf=(
+		--libdir="${MY_LIBDIR}"
+		--bashcompletiondir="$(get_bashcompdir)"
+	)
+
+	if use systemd; then
+		myconf+=( --systemdsystemunitdir="$(systemd_get_unitdir)" )
+	fi
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	tc-export CC
+	emake doc install/dracut-install skipcpio/skipcpio
+}
+
+src_install() {
+	default
+
+	local my_libdir="${MY_LIBDIR}"
+	local dracutlibdir="${my_libdir#/}/dracut"
+
+	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
+
+	insinto "${dracutlibdir}/dracut.conf.d/"
+	newins dracut.conf.d/gentoo.conf.example gentoo.conf
+
+	insinto /etc/logrotate.d
+	newins dracut.logrotate dracut
+
+	dodir /var/lib/dracut/overlay
+
+	dodoc dracut.html
+
+	if ! use systemd; then
+		# Scripts in kernel/install.d are systemd-specific
+		rm -r "${D%/}/${my_libdir}/kernel" || die
+	fi
+
+	#
+	# Modules
+	#
+	local module
+	modules_dir="${D%/}/${dracutlibdir}/modules.d"
+
+	use debug || rm_module 95debug
+	use selinux || rm_module 98selinux
+
+	if use systemd; then
+		# With systemd following modules do not make sense
+		rm_module 96securityfs 97masterkey 98integrity
+	else
+		rm_module 00systemd 98dracut-systemd
+		# Without systemd following modules do not make sense
+		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
+	fi
+
+	# Remove modules which won't work for sure
+	rm_module 95fcoe # no tools
+	# fips module depends on masked app-crypt/hmaccalc
+	rm_module 01fips 02fips-aesni
+}
+
+pkg_postinst() {
+	if linux-info_get_any_version && linux_config_exists; then
+		ewarn ""
+		ewarn "If the following test report contains a missing kernel"
+		ewarn "configuration option, you should reconfigure and rebuild your"
+		ewarn "kernel before booting image generated with this Dracut version."
+		ewarn ""
+
+		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
+
+		# Kernel configuration options descriptions:
+		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
+		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
+"(initramfs/initrd) support"
+
+		local opt desc
+
+		# Generate ERROR_* variables for check_extra_config.
+		for opt in ${CONFIG_CHECK}; do
+			opt=${opt#\~}
+			desc=desc_${opt}
+			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
+				"is missing and REQUIRED'"
+		done
+
+		check_extra_config
+		echo
+	else
+		ewarn ""
+		ewarn "Your kernel configuration couldn't be checked.  Do you have"
+		ewarn "/usr/src/linux/.config file there?  Please check manually if"
+		ewarn "following options are enabled:"
+		ewarn ""
+		ewarn "  CONFIG_BLK_DEV_INITRD"
+		ewarn "  CONFIG_DEVTMPFS"
+		ewarn ""
+	fi
+
+	elog "To get additional features, a number of optional runtime"
+	elog "dependencies may be installed:"
+	elog ""
+	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
+		sys-apps/iproute2
+	optfeature \
+		"Measure performance of the boot process for later visualisation" \
+		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
+	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
+	optfeature "Load kernel modules and drop this privilege for real init" \
+		sys-libs/libcap
+	optfeature "Support CIFS" net-fs/cifs-utils
+	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
+		"sys-fs/cryptsetup[-static-libs]"
+	optfeature "Support for GPG-encrypted keys for crypt module" \
+		app-crypt/gnupg
+	optfeature \
+		"Allows use of dash instead of default bash (on your own risk)" \
+		app-shells/dash
+	optfeature "Framebuffer splash (media-gfx/splashutils)" \
+		media-gfx/splashutils
+	optfeature "Support iSCSI" sys-block/open-iscsi
+	optfeature "Support Logical Volume Manager" sys-fs/lvm2
+	optfeature "Support MD devices, also known as software RAID devices" \
+		sys-fs/mdadm
+	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
+	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
+	optfeature "Support network block devices" sys-block/nbd
+	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
+	optfeature \
+		"Install ssh and scp along with config files and specified keys" \
+		net-misc/openssh
+	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
+		app-admin/rsyslog
+}

diff --git a/sys-kernel/dracut/files/dracut-044-bash-4.4.patch b/sys-kernel/dracut/files/dracut-044-bash-4.4.patch
new file mode 100644
index 0000000000..3144c8e6b7
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-044-bash-4.4.patch
@@ -0,0 +1,80 @@
+diff -urN dracut-044.orig/modules.d/50drm/module-setup.sh dracut-044/modules.d/50drm/module-setup.sh
+--- dracut-044.orig/modules.d/50drm/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/50drm/module-setup.sh	2016-09-28 02:50:08.914967926 +0300
+@@ -24,9 +24,9 @@
+             local _fname _fcont
+             while read _fname || [ -n "$_fname" ]; do
+                 case "$_fname" in
+-                    *.ko)    _fcont="$(<        $_fname)" ;;
+-                    *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+-                    *.ko.xz) _fcont="$(xz -dc   $_fname)" ;;
++                    *.ko)    _fcont="$(<        $_fname tr -d \\0)" ;;
++                    *.ko.gz) _fcont="$(gzip -dc $_fname | tr -d \\0)" ;;
++                    *.ko.xz) _fcont="$(xz -dc   $_fname | tr -d \\0)" ;;
+                 esac
+                 [[   $_fcont =~ $_drm_drivers
+                 && ! $_fcont =~ iw_handler_get_spy ]] \
+diff -urN dracut-044.orig/modules.d/90kernel-modules/module-setup.sh dracut-044/modules.d/90kernel-modules/module-setup.sh
+--- dracut-044.orig/modules.d/90kernel-modules/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90kernel-modules/module-setup.sh	2016-09-28 02:49:11.725390294 +0300
+@@ -10,9 +10,9 @@
+             function bmf1() {
+                 local _f
+                 while read _f || [ -n "$_f" ]; do case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_blockfuncs ]] && echo "$_f" ;;
+                     esac
+                 done
+                 return 0
+diff -urN dracut-044.orig/modules.d/90kernel-network-modules/module-setup.sh dracut-044/modules.d/90kernel-network-modules/module-setup.sh
+--- dracut-044.orig/modules.d/90kernel-network-modules/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90kernel-network-modules/module-setup.sh	2016-09-28 02:51:08.202422231 +0300
+@@ -26,9 +26,9 @@
+             while read _fname; do
+                 [[ $_fname =~ $_unwanted_drivers ]] && continue
+                 case "$_fname" in
+-                    *.ko)    _fcont="$(<        $_fname)" ;;
+-                    *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+-                    *.ko.xz) _fcont="$(xz -dc   $_fname)" ;;
++                    *.ko)    _fcont="$(<        $_fname tr -d \\0)" ;;
++                    *.ko.gz) _fcont="$(gzip -dc $_fname | tr -d \\0)" ;;
++                    *.ko.xz) _fcont="$(xz -dc   $_fname | tr -d \\0)" ;;
+                 esac
+                 [[   $_fcont =~ $_net_drivers
+                 && ! $_fcont =~ iw_handler_get_spy ]] \
+diff -urN dracut-044.orig/modules.d/90multipath/module-setup.sh dracut-044/modules.d/90multipath/module-setup.sh
+--- dracut-044.orig/modules.d/90multipath/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/90multipath/module-setup.sh	2016-09-28 02:49:11.726390235 +0300
+@@ -58,9 +58,9 @@
+             local _f
+             while read _f || [ -n "$_f" ]; do
+                 case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
+                 esac
+             done
+             return 0
+diff -urN dracut-044.orig/modules.d/95iscsi/module-setup.sh dracut-044/modules.d/95iscsi/module-setup.sh
+--- dracut-044.orig/modules.d/95iscsi/module-setup.sh	2015-11-25 16:22:28.000000000 +0300
++++ dracut-044/modules.d/95iscsi/module-setup.sh	2016-09-28 02:49:11.726390235 +0300
+@@ -168,9 +168,9 @@
+             local _f
+             while read _f || [ -n "$_f" ]; do
+                 case "$_f" in
+-                    *.ko)    [[ $(<         $_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+-                    *.ko.xz) [[ $(xz -dc   <$_f) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko)    [[ $(<         $_f tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.gz) [[ $(gzip -dc <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
++                    *.ko.xz) [[ $(xz -dc   <$_f | tr -d \\0) =~ $_funcs ]] && echo "$_f" ;;
+                 esac
+             done
+             return 0

diff --git a/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch b/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch
new file mode 100644
index 0000000000..3146d8485a
--- /dev/null
+++ b/sys-kernel/dracut/files/dracut-044-preserve-xattrs-when-copying.patch
@@ -0,0 +1,51 @@
+From 61c761bc2c35fb244d46fbbde97161f5927071dc Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb@us.ibm.com>
+Date: Tue, 25 Oct 2016 15:09:49 -0400
+Subject: [PATCH] dracut-install: preserve extended attributes when copying
+ files
+
+Preserve extended attributes when copying files using dracut-install.
+
+The copying of extended attributes avoids file execution denials when
+the Linux Integrity Measurement's Appraisal mode is active. In that mode
+executables need their file signatures copied. In particular, this patch
+solves the problem that dependent libaries are not included in the
+initramfs since the copied programs could not be executed due to missing
+signatures. The following audit record shows the type of failure that
+is now prevented:
+
+type=INTEGRITY_DATA msg=audit(1477409025.492:30065): pid=922 uid=0
+ auid=4294967295 ses=4294967295
+ subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
+ op="appraise_data" cause="IMA-signature-required"
+ comm="ld-linux-x86-64"
+ name="/var/tmp/dracut.R6ySa4/initramfs/usr/bin/journalctl"
+ dev="dm-0" ino=37136 res=0
+
+Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
+---
+ install/dracut-install.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/install/dracut-install.c b/install/dracut-install.c
+index fe30bba..c0f1c17 100644
+--- a/install/dracut-install.c
++++ b/install/dracut-install.c
+@@ -294,7 +294,7 @@ static int cp(const char *src, const char *dst)
+  normal_copy:
+         pid = fork();
+         if (pid == 0) {
+-                execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst,
++                execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps,xattr", "-fL", src, dst,
+                        NULL);
+                 _exit(EXIT_FAILURE);
+         }
+@@ -302,7 +302,7 @@ static int cp(const char *src, const char *dst)
+         while (waitpid(pid, &ret, 0) < 0) {
+                 if (errno != EINTR) {
+                         ret = -1;
+-                        log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s", src,
++                        log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr -fL %s %s", src,
+                                   dst);
+                         break;
+                 }


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2017-02-09 18:47 Patrick McLean
  0 siblings, 0 replies; 20+ messages in thread
From: Patrick McLean @ 2017-02-09 18:47 UTC (permalink / raw
  To: gentoo-commits

commit:     991b1645a9b9f46b55a3eaee3ef7abcbbca2533a
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  9 18:45:28 2017 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu Feb  9 18:47:28 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=991b1645

sys-kernel/dracut: Remove old versions

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sys-kernel/dracut/Manifest                         |   3 -
 sys-kernel/dracut/dracut-040-r3.ebuild             | 254 -------------------
 sys-kernel/dracut/dracut-041-r3.ebuild             | 262 --------------------
 sys-kernel/dracut/dracut-043-r2.ebuild             | 261 -------------------
 sys-kernel/dracut/dracut-044.ebuild                | 253 -------------------
 ...01-dracut.sh-do-not-bail-out-if-kernel-mo.patch |  42 ----
 ...02-dracut-functions.sh-support-for-altern.patch |  41 ---
 ...03-gentoo.conf-let-udevdir-be-handled-by-.patch |  30 ---
 ...04-Use-the-same-paths-in-dracut.sh-as-tho.patch |  74 ------
 ...05-Install-dracut-install-into-libexec-di.patch |  81 ------
 ...006-resume-fix-swap-detection-in-hostonly.patch |  31 ---
 ...07-dracut.sh-also-mkdir-run-lock-which-is.patch |  25 --
 ...08-dracut.sh-no-need-to-make-subdirs-in-r.patch |  25 --
 ...09-lvm-install-thin-utils-for-non-hostonl.patch |  41 ---
 .../files/034-0011-lvm-fix-thin-recognition.patch  |  40 ---
 ...012-lvm-always-install-thin-utils-for-lvm.patch |  79 ------
 .../files/034-0013-usrmount-always-install.patch   |  31 ---
 .../034-0014-udev-rules-add-eudev-rules.patch      |  29 ---
 ...01-dracut-functions.sh-support-for-altern.patch |  41 ---
 ...02-gentoo.conf-let-udevdir-be-handled-by-.patch |  30 ---
 ...03-Use-the-same-paths-in-dracut.sh-as-tho.patch |  74 ------
 ...04-Install-dracut-install-into-libexec-di.patch |  81 ------
 .../dracut/files/040-0005-NEWS-add-040-entry.patch |  25 --
 ...06-Don-t-pass-rsyncable-option-to-gzip-Ge.patch |  26 --
 ...07-Take-into-account-lib64-dirs-when-dete.patch |  44 ----
 ...01-Use-the-same-paths-in-dracut.sh-as-tho.patch |  74 ------
 ...02-Install-dracut-install-and-skipcpio-in.patch | 125 ----------
 ...03-Take-into-account-lib64-dirs-when-dete.patch |  60 -----
 .../dracut/files/041-0004-Portability-fixes.patch  |  63 -----
 ...41-0005-base-dracut-lib.sh-remove-bashism.patch |  27 --
 ...01-Revert-lvm-Don-t-activate-LVs-with-act.patch |  33 ---
 ...02-Replace-echo-n-with-printf-in-code-wit.patch | 275 ---------------------
 ...03-syncheck-Look-for-echo-n-usage-in-modu.patch |  26 --
 ...04-dracut-initramfs-restore-make-mount-er.patch |  28 ---
 34 files changed, 2634 deletions(-)

diff --git a/sys-kernel/dracut/Manifest b/sys-kernel/dracut/Manifest
index 8d50caa9a0..6525882cc1 100644
--- a/sys-kernel/dracut/Manifest
+++ b/sys-kernel/dracut/Manifest
@@ -1,4 +1 @@
-DIST dracut-040.tar.xz 263944 SHA256 b6e743353804b46e350177b9ecb9a8511df7e8c4ff9e0b4f3b4f72bc509c98a3 SHA512 6bc6a714572cc18c4cf9f9c1af4bc787287554ead1e39fbec8a1b8986585cf8c7c7ef476f87fc361f565eb344fe2594d63185ffe02cc5fa7cc3eaa03bcb4b72b WHIRLPOOL d8dbdbf6cb7705a0b7793f82a0323c49b4ac0dc3d61cf0073e3061f34af0b5c92dd21a7dc080f2a8d24d3eef3abc99df91f113675721267352f934f1319c66ba
-DIST dracut-041.tar.xz 268288 SHA256 8ece6c2240bf0e9283e5f717b65dfcd6830b3ef7f8d1c01b60014052f1063251 SHA512 358444588febfc482627eb5423b8a87b588ed3842ae814b9f88d8c5dfec28419f2aea92cd54c11c4949b9968d60d7e05ba9cfea78d26d2dc6f2a943a38b28dac WHIRLPOOL ab538fe1ffeb3d43185c6222a6e65af8c684b292be571e0571fdd69011f654c3093f3a2256f3003d5dbaf07d0a26f83d82055885bae1868738ad15dc74982e72
-DIST dracut-043.tar.xz 272744 SHA256 1484b558ed20330125aa04dcccab84da15c5689e19068285aa011f7177889cd1 SHA512 a36271e1ed4c1205a01bece7652095a8bfd722bcf7239a93baeb21e7e0a60fa86dd6657aa69b594241981056c87c6fe9d372f18ac045785122a9cafe8b0c31eb WHIRLPOOL d1efd59e2c41478e489d4707114b141e8bb0501c54209e364edc2060d3ffac7f2e1afd640b0812a452e7fbe7f9134e5e96436f0f1f2a54613d9468f9dca61a0c
 DIST dracut-044.tar.xz 280004 SHA256 84b97c9b0120e9fde06c3b9cf2ede1c4632cccd8e085e980b9ec9c788655af05 SHA512 bc788076e425b223d98cf0e0b15ff57d75d423991d7a67fb564a2857c38d5c3a21d846d2ca4523f9d4b0128bb981d09b5c26031435c5fc5e30f53080bca19b3d WHIRLPOOL 684591df596fa902447e671adfaeeb8cdc469c257f756616e42747835b71be7caaac9c72bd4b1a5ba5728ec4332baaba1d265cddb1c30cbfa65cf4dce0690bc0

diff --git a/sys-kernel/dracut/dracut-040-r3.ebuild b/sys-kernel/dracut/dracut-040-r3.ebuild
deleted file mode 100644
index cc3554d189..0000000000
--- a/sys-kernel/dracut/dracut-040-r3.ebuild
+++ /dev/null
@@ -1,254 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-
-inherit bash-completion-r1 eutils linux-info multilib systemd
-
-DESCRIPTION="Generic initramfs generation tool"
-HOMEPAGE="https://dracut.wiki.kernel.org"
-SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="debug selinux systemd"
-
-RESTRICT="test"
-
-CDEPEND="virtual/udev
-	systemd? ( >=sys-apps/systemd-199 )
-	"
-RDEPEND="${CDEPEND}
-	app-arch/cpio
-	>=app-shells/bash-4.0
-	>sys-apps/kmod-5[tools]
-	|| ( >=sys-apps/sysvinit-2.87-r3 sys-apps/systemd[sysv-utils] sys-apps/systemd-sysv-utils )
-	>=sys-apps/util-linux-2.21
-
-	debug? ( dev-util/strace )
-	selinux? (
-		sys-libs/libselinux
-		sys-libs/libsepol
-		sec-policy/selinux-dracut
-	)
-	"
-DEPEND="${CDEPEND}
-	app-text/asciidoc
-	>=dev-libs/libxslt-1.1.26
-	app-text/docbook-xml-dtd:4.5
-	>=app-text/docbook-xsl-stylesheets-1.75.2
-	virtual/pkgconfig
-	"
-
-DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
-	README.testsuite TODO )
-MY_LIBDIR=/usr/lib
-PATCHES=(
-	"${FILESDIR}/${PV}-0001-dracut-functions.sh-support-for-altern.patch"
-	"${FILESDIR}/${PV}-0002-gentoo.conf-let-udevdir-be-handled-by-.patch"
-	"${FILESDIR}/${PV}-0003-Use-the-same-paths-in-dracut.sh-as-tho.patch"
-	"${FILESDIR}/${PV}-0005-NEWS-add-040-entry.patch"
-	"${FILESDIR}/${PV}-0006-Don-t-pass-rsyncable-option-to-gzip-Ge.patch"
-	"${FILESDIR}/${PV}-0007-Take-into-account-lib64-dirs-when-dete.patch"
-	)
-QA_MULTILIB_PATHS="
-	usr/lib/dracut/dracut-install
-	usr/lib/dracut/skipcpio
-	"
-
-#
-# Helper functions
-#
-
-# Removes module from modules.d.
-# $1 = module name
-# Module name can be specified without number prefix.
-rm_module() {
-	local force m
-	[[ $1 = -f ]] && force=-f
-
-	for m in $@; do
-		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
-			rm ${force} --interactive=never -r "${modules_dir}"/$m
-		else
-			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
-		fi
-	done
-}
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-
-	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
-	if [[ ${SYMLINK_LIB} = yes ]]; then
-		# Preserve lib -> lib64 symlinks in initramfs
-		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
-	fi
-	einfo "Setting libdirs to \"${libdirs}\" ..."
-	sed -e "3alibdirs=\"${libdirs}\"" \
-		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
-	einfo "Setting udevdir to ${udevdir}..."
-	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	if use systemd; then
-		local systemdutildir="$(systemd_get_utildir)"
-		local systemdsystemunitdir="$(systemd_get_unitdir)"
-		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
-			--variable=systemdsystemconfdir)"
-		[[ ${systemdsystemconfdir} ]] \
-			|| systemdsystemconfdir=/etc/systemd/system
-		einfo "Setting systemdutildir to ${systemdutildir} and ..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
-		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
-		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	else
-		local systemdutildir="/lib/systemd"
-		einfo "Setting systemdutildir for standalone udev to" \
-			"${systemdutildir}..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	fi
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--libdir=${MY_LIBDIR}"
-	myconf+=" --bashcompletiondir=$(get_bashcompdir)"
-
-	if use systemd; then
-		myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'"
-	fi
-
-	econf ${myconf}
-}
-
-src_compile() {
-	tc-export CC
-	emake doc install/dracut-install skipcpio/skipcpio
-}
-
-src_install() {
-	default
-
-	local my_libdir="${MY_LIBDIR}"
-	local dracutlibdir="${my_libdir#/}/dracut"
-
-	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
-
-	insinto "${dracutlibdir}/dracut.conf.d/"
-	newins dracut.conf.d/gentoo.conf.example gentoo.conf
-
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
-
-	dodir /var/lib/dracut/overlay
-
-	dohtml dracut.html
-
-	#
-	# Modules
-	#
-	local module
-	modules_dir="${D%/}/${dracutlibdir}/modules.d"
-
-	use debug || rm_module 95debug
-	use selinux || rm_module 98selinux
-
-	if use systemd; then
-		# With systemd following modules do not make sense
-		rm_module 96securityfs 97masterkey 98integrity
-	else
-		rm_module 98systemd
-		# Without systemd following modules do not make sense
-		rm_module 00systemd-bootchart
-	fi
-
-	# Remove modules which won't work for sure
-	rm_module 95fcoe # no tools
-	# fips module depends on masked app-crypt/hmaccalc
-	rm_module 01fips 02fips-aesni
-}
-
-pkg_postinst() {
-	if linux-info_get_any_version && linux_config_exists; then
-		ewarn ""
-		ewarn "If the following test report contains a missing kernel"
-		ewarn "configuration option, you should reconfigure and rebuild your"
-		ewarn "kernel before booting image generated with this Dracut version."
-		ewarn ""
-
-		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
-
-		# Kernel configuration options descriptions:
-		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
-		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
-"(initramfs/initrd) support"
-
-		local opt desc
-
-		# Generate ERROR_* variables for check_extra_config.
-		for opt in ${CONFIG_CHECK}; do
-			opt=${opt#\~}
-			desc=desc_${opt}
-			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
-				"is missing and REQUIRED'"
-		done
-
-		check_extra_config
-		echo
-	else
-		ewarn ""
-		ewarn "Your kernel configuration couldn't be checked.  Do you have"
-		ewarn "/usr/src/linux/.config file there?  Please check manually if"
-		ewarn "following options are enabled:"
-		ewarn ""
-		ewarn "  CONFIG_BLK_DEV_INITRD"
-		ewarn "  CONFIG_DEVTMPFS"
-		ewarn ""
-	fi
-
-	elog "To get additional features, a number of optional runtime"
-	elog "dependencies may be installed:"
-	elog ""
-	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
-		sys-apps/iproute2
-	optfeature \
-		"Measure performance of the boot process for later visualisation" \
-		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
-	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
-	optfeature "Load kernel modules and drop this privilege for real init" \
-		sys-libs/libcap
-	optfeature "Support CIFS" net-fs/cifs-utils
-	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
-		"sys-fs/cryptsetup[-static-libs]"
-	optfeature "Support for GPG-encrypted keys for crypt module" \
-		app-crypt/gnupg
-	optfeature \
-		"Allows use of dash instead of default bash (on your own risk)" \
-		app-shells/dash
-	optfeature "Framebuffer splash (media-gfx/splashutils)" \
-		media-gfx/splashutils
-	optfeature "Support iSCSI" sys-block/open-iscsi
-	optfeature "Support Logical Volume Manager" sys-fs/lvm2
-	optfeature "Support MD devices, also known as software RAID devices" \
-		sys-fs/mdadm
-	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
-	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
-	optfeature "Support network block devices" sys-block/nbd
-	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
-	optfeature \
-		"Install ssh and scp along with config files and specified keys" \
-		net-misc/openssh
-	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
-		app-admin/rsyslog
-}

diff --git a/sys-kernel/dracut/dracut-041-r3.ebuild b/sys-kernel/dracut/dracut-041-r3.ebuild
deleted file mode 100644
index 9c8e7d6f94..0000000000
--- a/sys-kernel/dracut/dracut-041-r3.ebuild
+++ /dev/null
@@ -1,262 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-
-inherit bash-completion-r1 eutils linux-info multilib systemd
-
-DESCRIPTION="Generic initramfs generation tool"
-HOMEPAGE="https://dracut.wiki.kernel.org"
-SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="debug selinux systemd"
-
-RESTRICT="test"
-
-CDEPEND="virtual/udev
-	systemd? ( >=sys-apps/systemd-199 )
-	"
-RDEPEND="${CDEPEND}
-	app-arch/cpio
-	>=app-shells/bash-4.0
-	>sys-apps/kmod-5[tools]
-	|| (
-		>=sys-apps/sysvinit-2.87-r3
-		sys-apps/systemd[sysv-utils]
-		sys-apps/systemd-sysv-utils
-	)
-	>=sys-apps/util-linux-2.21
-
-	debug? ( dev-util/strace )
-	selinux? (
-		sys-libs/libselinux
-		sys-libs/libsepol
-		sec-policy/selinux-dracut
-	)
-	"
-DEPEND="${CDEPEND}
-	app-text/asciidoc
-	>=dev-libs/libxslt-1.1.26
-	app-text/docbook-xml-dtd:4.5
-	>=app-text/docbook-xsl-stylesheets-1.75.2
-	virtual/pkgconfig
-	"
-
-DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
-	README.testsuite TODO )
-MY_LIBDIR=/usr/lib
-PATCHES=(
-	"${FILESDIR}/${PV}-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch"
-	"${FILESDIR}/${PV}-0002-Install-dracut-install-and-skipcpio-in.patch"
-	"${FILESDIR}/${PV}-0003-Take-into-account-lib64-dirs-when-dete.patch"
-	"${FILESDIR}/${PV}-0004-Portability-fixes.patch"
-	"${FILESDIR}/${PV}-0005-base-dracut-lib.sh-remove-bashism.patch"
-	)
-QA_MULTILIB_PATHS="
-	usr/lib/dracut/dracut-install
-	usr/lib/dracut/skipcpio
-	"
-
-#
-# Helper functions
-#
-
-# Removes module from modules.d.
-# $1 = module name
-# Module name can be specified without number prefix.
-rm_module() {
-	local force m
-	[[ $1 = -f ]] && force=-f
-
-	for m in $@; do
-		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
-			rm ${force} --interactive=never -r "${modules_dir}"/$m
-		else
-			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
-		fi
-	done
-}
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-
-	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
-	if [[ ${SYMLINK_LIB} = yes ]]; then
-		# Preserve lib -> lib64 symlinks in initramfs
-		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
-	fi
-	einfo "Setting libdirs to \"${libdirs}\" ..."
-	sed -e "3alibdirs=\"${libdirs}\"" \
-		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
-	einfo "Setting udevdir to ${udevdir}..."
-	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	if use systemd; then
-		local systemdutildir="$(systemd_get_utildir)"
-		local systemdsystemunitdir="$(systemd_get_unitdir)"
-		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
-			--variable=systemdsystemconfdir)"
-		[[ ${systemdsystemconfdir} ]] \
-			|| systemdsystemconfdir=/etc/systemd/system
-		einfo "Setting systemdutildir to ${systemdutildir} and ..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
-		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
-		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	else
-		local systemdutildir="/lib/systemd"
-		einfo "Setting systemdutildir for standalone udev to" \
-			"${systemdutildir}..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	fi
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--libdir=${MY_LIBDIR}"
-	myconf+=" --bashcompletiondir=$(get_bashcompdir)"
-
-	if use systemd; then
-		myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'"
-	fi
-
-	econf ${myconf}
-}
-
-src_compile() {
-	tc-export CC
-	emake doc install/dracut-install skipcpio/skipcpio
-}
-
-src_install() {
-	default
-
-	local my_libdir="${MY_LIBDIR}"
-	local dracutlibdir="${my_libdir#/}/dracut"
-
-	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
-
-	insinto "${dracutlibdir}/dracut.conf.d/"
-	newins dracut.conf.d/gentoo.conf.example gentoo.conf
-
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
-
-	dodir /var/lib/dracut/overlay
-
-	dohtml dracut.html
-
-	if ! use systemd; then
-		# Scripts in kernel/install.d are systemd-specific
-		rm -r "${D%/}/${my_libdir}/kernel" || die
-	fi
-
-	#
-	# Modules
-	#
-	local module
-	modules_dir="${D%/}/${dracutlibdir}/modules.d"
-
-	use debug || rm_module 95debug
-	use selinux || rm_module 98selinux
-
-	if use systemd; then
-		# With systemd following modules do not make sense
-		rm_module 96securityfs 97masterkey 98integrity
-	else
-		rm_module 98systemd
-		# Without systemd following modules do not make sense
-		rm_module 00systemd-bootchart
-	fi
-
-	# Remove modules which won't work for sure
-	rm_module 95fcoe # no tools
-	# fips module depends on masked app-crypt/hmaccalc
-	rm_module 01fips 02fips-aesni
-}
-
-pkg_postinst() {
-	if linux-info_get_any_version && linux_config_exists; then
-		ewarn ""
-		ewarn "If the following test report contains a missing kernel"
-		ewarn "configuration option, you should reconfigure and rebuild your"
-		ewarn "kernel before booting image generated with this Dracut version."
-		ewarn ""
-
-		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
-
-		# Kernel configuration options descriptions:
-		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
-		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
-"(initramfs/initrd) support"
-
-		local opt desc
-
-		# Generate ERROR_* variables for check_extra_config.
-		for opt in ${CONFIG_CHECK}; do
-			opt=${opt#\~}
-			desc=desc_${opt}
-			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
-				"is missing and REQUIRED'"
-		done
-
-		check_extra_config
-		echo
-	else
-		ewarn ""
-		ewarn "Your kernel configuration couldn't be checked.  Do you have"
-		ewarn "/usr/src/linux/.config file there?  Please check manually if"
-		ewarn "following options are enabled:"
-		ewarn ""
-		ewarn "  CONFIG_BLK_DEV_INITRD"
-		ewarn "  CONFIG_DEVTMPFS"
-		ewarn ""
-	fi
-
-	elog "To get additional features, a number of optional runtime"
-	elog "dependencies may be installed:"
-	elog ""
-	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
-		sys-apps/iproute2
-	optfeature \
-		"Measure performance of the boot process for later visualisation" \
-		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
-	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
-	optfeature "Load kernel modules and drop this privilege for real init" \
-		sys-libs/libcap
-	optfeature "Support CIFS" net-fs/cifs-utils
-	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
-		"sys-fs/cryptsetup[-static-libs]"
-	optfeature "Support for GPG-encrypted keys for crypt module" \
-		app-crypt/gnupg
-	optfeature \
-		"Allows use of dash instead of default bash (on your own risk)" \
-		app-shells/dash
-	optfeature "Framebuffer splash (media-gfx/splashutils)" \
-		media-gfx/splashutils
-	optfeature "Support iSCSI" sys-block/open-iscsi
-	optfeature "Support Logical Volume Manager" sys-fs/lvm2
-	optfeature "Support MD devices, also known as software RAID devices" \
-		sys-fs/mdadm
-	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
-	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
-	optfeature "Support network block devices" sys-block/nbd
-	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
-	optfeature \
-		"Install ssh and scp along with config files and specified keys" \
-		net-misc/openssh
-	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
-		app-admin/rsyslog
-}

diff --git a/sys-kernel/dracut/dracut-043-r2.ebuild b/sys-kernel/dracut/dracut-043-r2.ebuild
deleted file mode 100644
index 2a65cf6abd..0000000000
--- a/sys-kernel/dracut/dracut-043-r2.ebuild
+++ /dev/null
@@ -1,261 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-
-inherit bash-completion-r1 eutils linux-info multilib systemd
-
-DESCRIPTION="Generic initramfs generation tool"
-HOMEPAGE="https://dracut.wiki.kernel.org"
-SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="debug selinux systemd"
-
-RESTRICT="test"
-
-CDEPEND="virtual/udev
-	systemd? ( >=sys-apps/systemd-199 )
-	"
-RDEPEND="${CDEPEND}
-	app-arch/cpio
-	>=app-shells/bash-4.0
-	>sys-apps/kmod-5[tools]
-	|| (
-		>=sys-apps/sysvinit-2.87-r3
-		sys-apps/systemd[sysv-utils]
-		sys-apps/systemd-sysv-utils
-	)
-	>=sys-apps/util-linux-2.21
-
-	debug? ( dev-util/strace )
-	selinux? (
-		sys-libs/libselinux
-		sys-libs/libsepol
-		sec-policy/selinux-dracut
-	)
-	"
-DEPEND="${CDEPEND}
-	app-text/asciidoc
-	>=dev-libs/libxslt-1.1.26
-	app-text/docbook-xml-dtd:4.5
-	>=app-text/docbook-xsl-stylesheets-1.75.2
-	virtual/pkgconfig
-	"
-
-DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
-	README.testsuite TODO )
-MY_LIBDIR=/usr/lib
-PATCHES=(
-	"${FILESDIR}/${PV}-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch"
-	"${FILESDIR}/${PV}-0002-Replace-echo-n-with-printf-in-code-wit.patch"
-	"${FILESDIR}/${PV}-0003-syncheck-Look-for-echo-n-usage-in-modu.patch"
-	"${FILESDIR}/${PV}-0004-dracut-initramfs-restore-make-mount-er.patch"
-	)
-QA_MULTILIB_PATHS="
-	usr/lib/dracut/dracut-install
-	usr/lib/dracut/skipcpio
-	"
-
-#
-# Helper functions
-#
-
-# Removes module from modules.d.
-# $1 = module name
-# Module name can be specified without number prefix.
-rm_module() {
-	local force m
-	[[ $1 = -f ]] && force=-f
-
-	for m in $@; do
-		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
-			rm ${force} --interactive=never -r "${modules_dir}"/$m
-		else
-			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
-		fi
-	done
-}
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-
-	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
-	if [[ ${SYMLINK_LIB} = yes ]]; then
-		# Preserve lib -> lib64 symlinks in initramfs
-		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
-	fi
-	einfo "Setting libdirs to \"${libdirs}\" ..."
-	sed -e "3alibdirs=\"${libdirs}\"" \
-		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
-	einfo "Setting udevdir to ${udevdir}..."
-	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	if use systemd; then
-		local systemdutildir="$(systemd_get_utildir)"
-		local systemdsystemunitdir="$(systemd_get_unitdir)"
-		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
-			--variable=systemdsystemconfdir)"
-		[[ ${systemdsystemconfdir} ]] \
-			|| systemdsystemconfdir=/etc/systemd/system
-		einfo "Setting systemdutildir to ${systemdutildir} and ..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
-		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
-		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	else
-		local systemdutildir="/lib/systemd"
-		einfo "Setting systemdutildir for standalone udev to" \
-			"${systemdutildir}..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	fi
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--libdir=${MY_LIBDIR}"
-	myconf+=" --bashcompletiondir=$(get_bashcompdir)"
-
-	if use systemd; then
-		myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'"
-	fi
-
-	econf ${myconf}
-}
-
-src_compile() {
-	tc-export CC
-	emake doc install/dracut-install skipcpio/skipcpio
-}
-
-src_install() {
-	default
-
-	local my_libdir="${MY_LIBDIR}"
-	local dracutlibdir="${my_libdir#/}/dracut"
-
-	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
-
-	insinto "${dracutlibdir}/dracut.conf.d/"
-	newins dracut.conf.d/gentoo.conf.example gentoo.conf
-
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
-
-	dodir /var/lib/dracut/overlay
-
-	dohtml dracut.html
-
-	if ! use systemd; then
-		# Scripts in kernel/install.d are systemd-specific
-		rm -r "${D%/}/${my_libdir}/kernel" || die
-	fi
-
-	#
-	# Modules
-	#
-	local module
-	modules_dir="${D%/}/${dracutlibdir}/modules.d"
-
-	use debug || rm_module 95debug
-	use selinux || rm_module 98selinux
-
-	if use systemd; then
-		# With systemd following modules do not make sense
-		rm_module 96securityfs 97masterkey 98integrity
-	else
-		rm_module 00systemd 98dracut-systemd
-		# Without systemd following modules do not make sense
-		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
-	fi
-
-	# Remove modules which won't work for sure
-	rm_module 95fcoe # no tools
-	# fips module depends on masked app-crypt/hmaccalc
-	rm_module 01fips 02fips-aesni
-}
-
-pkg_postinst() {
-	if linux-info_get_any_version && linux_config_exists; then
-		ewarn ""
-		ewarn "If the following test report contains a missing kernel"
-		ewarn "configuration option, you should reconfigure and rebuild your"
-		ewarn "kernel before booting image generated with this Dracut version."
-		ewarn ""
-
-		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
-
-		# Kernel configuration options descriptions:
-		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
-		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
-"(initramfs/initrd) support"
-
-		local opt desc
-
-		# Generate ERROR_* variables for check_extra_config.
-		for opt in ${CONFIG_CHECK}; do
-			opt=${opt#\~}
-			desc=desc_${opt}
-			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
-				"is missing and REQUIRED'"
-		done
-
-		check_extra_config
-		echo
-	else
-		ewarn ""
-		ewarn "Your kernel configuration couldn't be checked.  Do you have"
-		ewarn "/usr/src/linux/.config file there?  Please check manually if"
-		ewarn "following options are enabled:"
-		ewarn ""
-		ewarn "  CONFIG_BLK_DEV_INITRD"
-		ewarn "  CONFIG_DEVTMPFS"
-		ewarn ""
-	fi
-
-	elog "To get additional features, a number of optional runtime"
-	elog "dependencies may be installed:"
-	elog ""
-	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
-		sys-apps/iproute2
-	optfeature \
-		"Measure performance of the boot process for later visualisation" \
-		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
-	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
-	optfeature "Load kernel modules and drop this privilege for real init" \
-		sys-libs/libcap
-	optfeature "Support CIFS" net-fs/cifs-utils
-	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
-		"sys-fs/cryptsetup[-static-libs]"
-	optfeature "Support for GPG-encrypted keys for crypt module" \
-		app-crypt/gnupg
-	optfeature \
-		"Allows use of dash instead of default bash (on your own risk)" \
-		app-shells/dash
-	optfeature "Framebuffer splash (media-gfx/splashutils)" \
-		media-gfx/splashutils
-	optfeature "Support iSCSI" sys-block/open-iscsi
-	optfeature "Support Logical Volume Manager" sys-fs/lvm2
-	optfeature "Support MD devices, also known as software RAID devices" \
-		sys-fs/mdadm
-	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
-	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
-	optfeature "Support network block devices" sys-block/nbd
-	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
-	optfeature \
-		"Install ssh and scp along with config files and specified keys" \
-		net-misc/openssh
-	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
-		app-admin/rsyslog
-}

diff --git a/sys-kernel/dracut/dracut-044.ebuild b/sys-kernel/dracut/dracut-044.ebuild
deleted file mode 100644
index 8d1e45c63a..0000000000
--- a/sys-kernel/dracut/dracut-044.ebuild
+++ /dev/null
@@ -1,253 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit bash-completion-r1 eutils linux-info multilib systemd
-
-DESCRIPTION="Generic initramfs generation tool"
-HOMEPAGE="https://dracut.wiki.kernel.org"
-SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.xz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="debug selinux systemd"
-
-RESTRICT="test"
-
-CDEPEND="virtual/udev
-	systemd? ( >=sys-apps/systemd-199 )
-	"
-RDEPEND="${CDEPEND}
-	app-arch/cpio
-	>=app-shells/bash-4.0
-	>sys-apps/kmod-5[tools]
-	|| (
-		>=sys-apps/sysvinit-2.87-r3
-		sys-apps/systemd[sysv-utils]
-		sys-apps/systemd-sysv-utils
-	)
-	>=sys-apps/util-linux-2.21
-
-	debug? ( dev-util/strace )
-	selinux? (
-		sys-libs/libselinux
-		sys-libs/libsepol
-		sec-policy/selinux-dracut
-	)
-	"
-DEPEND="${CDEPEND}
-	app-text/asciidoc
-	>=dev-libs/libxslt-1.1.26
-	app-text/docbook-xml-dtd:4.5
-	>=app-text/docbook-xsl-stylesheets-1.75.2
-	virtual/pkgconfig
-	"
-
-DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
-	README.testsuite TODO )
-MY_LIBDIR=/usr/lib
-QA_MULTILIB_PATHS="
-	usr/lib/dracut/dracut-install
-	usr/lib/dracut/skipcpio
-	"
-
-#
-# Helper functions
-#
-
-# Removes module from modules.d.
-# $1 = module name
-# Module name can be specified without number prefix.
-rm_module() {
-	local force m
-	[[ $1 = -f ]] && force=-f
-
-	for m in $@; do
-		if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then
-			rm ${force} --interactive=never -r "${modules_dir}"/$m
-		else
-			rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m
-		fi
-	done
-}
-
-src_prepare() {
-	local libdirs="/$(get_libdir) /usr/$(get_libdir)"
-	if [[ ${SYMLINK_LIB} = yes ]]; then
-		# Preserve lib -> lib64 symlinks in initramfs
-		[[ $libdirs =~ /lib\  ]] || libdirs+=" /lib /usr/lib"
-	fi
-	einfo "Setting libdirs to \"${libdirs}\" ..."
-	sed -e "3alibdirs=\"${libdirs}\"" \
-		-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	local udevdir="$("$(tc-getPKG_CONFIG)" udev --variable=udevdir)"
-	einfo "Setting udevdir to ${udevdir}..."
-	sed -r -e "s|^(udevdir=).*$|\1${udevdir}|" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-
-	if use systemd; then
-		local systemdutildir="$(systemd_get_utildir)"
-		local systemdsystemunitdir="$(systemd_get_unitdir)"
-		local systemdsystemconfdir="$("$(tc-getPKG_CONFIG)" systemd \
-			--variable=systemdsystemconfdir)"
-		[[ ${systemdsystemconfdir} ]] \
-			|| systemdsystemconfdir=/etc/systemd/system
-		einfo "Setting systemdutildir to ${systemdutildir} and ..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir} and..."
-		sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-		einfo "Setting systemdsystemconfdir to ${systemdsystemconfdir}..."
-		sed -e "7asystemdsystemconfdir=\"${systemdsystemconfdir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	else
-		local systemdutildir="/lib/systemd"
-		einfo "Setting systemdutildir for standalone udev to" \
-			"${systemdutildir}..."
-		sed -e "5asystemdutildir=\"${systemdutildir}\"" \
-			-i "${S}/dracut.conf.d/gentoo.conf.example" || die
-	fi
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--libdir=${MY_LIBDIR}"
-	myconf+=" --bashcompletiondir=$(get_bashcompdir)"
-
-	if use systemd; then
-		myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'"
-	fi
-
-	econf ${myconf}
-}
-
-src_compile() {
-	tc-export CC
-	emake doc install/dracut-install skipcpio/skipcpio
-}
-
-src_install() {
-	default
-
-	local my_libdir="${MY_LIBDIR}"
-	local dracutlibdir="${my_libdir#/}/dracut"
-
-	echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
-
-	insinto "${dracutlibdir}/dracut.conf.d/"
-	newins dracut.conf.d/gentoo.conf.example gentoo.conf
-
-	insinto /etc/logrotate.d
-	newins dracut.logrotate dracut
-
-	dodir /var/lib/dracut/overlay
-
-	dohtml dracut.html
-
-	if ! use systemd; then
-		# Scripts in kernel/install.d are systemd-specific
-		rm -r "${D%/}/${my_libdir}/kernel" || die
-	fi
-
-	#
-	# Modules
-	#
-	local module
-	modules_dir="${D%/}/${dracutlibdir}/modules.d"
-
-	use debug || rm_module 95debug
-	use selinux || rm_module 98selinux
-
-	if use systemd; then
-		# With systemd following modules do not make sense
-		rm_module 96securityfs 97masterkey 98integrity
-	else
-		rm_module 00systemd 98dracut-systemd
-		# Without systemd following modules do not make sense
-		rm_module 00systemd-bootchart 01systemd-initrd 02systemd-networkd
-	fi
-
-	# Remove modules which won't work for sure
-	rm_module 95fcoe # no tools
-	# fips module depends on masked app-crypt/hmaccalc
-	rm_module 01fips 02fips-aesni
-}
-
-pkg_postinst() {
-	if linux-info_get_any_version && linux_config_exists; then
-		ewarn ""
-		ewarn "If the following test report contains a missing kernel"
-		ewarn "configuration option, you should reconfigure and rebuild your"
-		ewarn "kernel before booting image generated with this Dracut version."
-		ewarn ""
-
-		local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
-
-		# Kernel configuration options descriptions:
-		local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
-		local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
-"(initramfs/initrd) support"
-
-		local opt desc
-
-		# Generate ERROR_* variables for check_extra_config.
-		for opt in ${CONFIG_CHECK}; do
-			opt=${opt#\~}
-			desc=desc_${opt}
-			eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \
-				"is missing and REQUIRED'"
-		done
-
-		check_extra_config
-		echo
-	else
-		ewarn ""
-		ewarn "Your kernel configuration couldn't be checked.  Do you have"
-		ewarn "/usr/src/linux/.config file there?  Please check manually if"
-		ewarn "following options are enabled:"
-		ewarn ""
-		ewarn "  CONFIG_BLK_DEV_INITRD"
-		ewarn "  CONFIG_DEVTMPFS"
-		ewarn ""
-	fi
-
-	elog "To get additional features, a number of optional runtime"
-	elog "dependencies may be installed:"
-	elog ""
-	optfeature "Networking support"  net-misc/curl "net-misc/dhcp[client]" \
-		sys-apps/iproute2
-	optfeature \
-		"Measure performance of the boot process for later visualisation" \
-		app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
-	optfeature "Scan for Btrfs on block devices"  sys-fs/btrfs-progs
-	optfeature "Load kernel modules and drop this privilege for real init" \
-		sys-libs/libcap
-	optfeature "Support CIFS" net-fs/cifs-utils
-	optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
-		"sys-fs/cryptsetup[-static-libs]"
-	optfeature "Support for GPG-encrypted keys for crypt module" \
-		app-crypt/gnupg
-	optfeature \
-		"Allows use of dash instead of default bash (on your own risk)" \
-		app-shells/dash
-	optfeature "Framebuffer splash (media-gfx/splashutils)" \
-		media-gfx/splashutils
-	optfeature "Support iSCSI" sys-block/open-iscsi
-	optfeature "Support Logical Volume Manager" sys-fs/lvm2
-	optfeature "Support MD devices, also known as software RAID devices" \
-		sys-fs/mdadm
-	optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
-	optfeature "Plymouth boot splash"  '>=sys-boot/plymouth-0.8.5-r5'
-	optfeature "Support network block devices" sys-block/nbd
-	optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
-	optfeature \
-		"Install ssh and scp along with config files and specified keys" \
-		net-misc/openssh
-	optfeature "Enable logging with syslog-ng or rsyslog" app-admin/syslog-ng \
-		app-admin/rsyslog
-}

diff --git a/sys-kernel/dracut/files/034-0001-dracut.sh-do-not-bail-out-if-kernel-mo.patch b/sys-kernel/dracut/files/034-0001-dracut.sh-do-not-bail-out-if-kernel-mo.patch
deleted file mode 100644
index 7500ecfdb7..0000000000
--- a/sys-kernel/dracut/files/034-0001-dracut.sh-do-not-bail-out-if-kernel-mo.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 45e5079d4be0ac1a977bc41dcda423fcfa3280fc Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Tue, 8 Oct 2013 15:03:40 +0200
-Subject: [PATCH 1/5] dracut.sh: do not bail out, if kernel modules dir is
- missing
-
-and only print a warning message
----
- dracut.sh | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/dracut.sh b/dracut.sh
-index e135dfc..d9533dd 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -496,17 +496,18 @@ if [[ $regenerate_all == "yes" ]]; then
-         ((ret+=$?))
-     done
-     exit $ret
--elif [[ $kernel ]]; then
--    if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then
--        printf -- "Kernel version $kernel has no modules in /lib/modules/$kernel\n" >&2
--        exit 1
--    fi
- fi
- 
- if ! [[ $kernel ]]; then
-     kernel=$(uname -r)
- fi
- 
-+if [[ $kernel ]]; then
-+    if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then
-+        printf -- "Kernel version $kernel has no module directory /lib/modules/$kernel\n" >&2
-+    fi
-+fi
-+
- if ! [[ $outfile ]]; then
-     [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
- 
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0002-dracut-functions.sh-support-for-altern.patch b/sys-kernel/dracut/files/034-0002-dracut-functions.sh-support-for-altern.patch
deleted file mode 100644
index acb2db7677..0000000000
--- a/sys-kernel/dracut/files/034-0002-dracut-functions.sh-support-for-altern.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From c5a2f35eb2a90d8787d127b44cb6b5e0536d16ce Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 6 Jan 2013 13:35:01 +0100
-Subject: [PATCH 2/5] dracut-functions.sh: support for alternative udev dirs -
- udevaltdirs
-
-It is required for Gentoo which moves udev from / to /usr and supports
-both /lib/udev and /usr/lib/udev for compatibility with other packages.
-
-Credits go to Alexander Tsoy <alexander@tsoy.me>.
-
-Conflicts:
-	dracut-functions.sh
----
- dracut-functions.sh | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/dracut-functions.sh b/dracut-functions.sh
-index 45e0911..c1cbdeb 100755
---- a/dracut-functions.sh
-+++ b/dracut-functions.sh
-@@ -872,6 +872,16 @@ inst_rules() {
-     inst_dir "$_target"
-     for _rule in "$@"; do
-         if [ "${_rule#/}" = "$_rule" ]; then
-+            for r in ${udevaltdirs}; do
-+                [[ "$r" = "${udevdir}" ]] && continue
-+                if [[ -e $r/rules.d/$_rule ]]; then
-+                    _found="$r/rules.d/$_rule"
-+                    inst_rule_programs "$_found"
-+                    inst_rule_group_owner "$_found"
-+                    inst_rule_initqueue "$_found"
-+                    inst_simple "$_found" "${udevdir}/rules.d/${_found##*/}"
-+                fi
-+            done
-             for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do
-                 if [[ -e $r/$_rule ]]; then
-                     _found="$r/$_rule"
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0003-gentoo.conf-let-udevdir-be-handled-by-.patch b/sys-kernel/dracut/files/034-0003-gentoo.conf-let-udevdir-be-handled-by-.patch
deleted file mode 100644
index e5bee434ef..0000000000
--- a/sys-kernel/dracut/files/034-0003-gentoo.conf-let-udevdir-be-handled-by-.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 29ade4d78b7609877659aa5938b3fba2954ce415 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 16 Dec 2012 20:02:48 +0100
-Subject: [PATCH 3/5] gentoo.conf: let udevdir= be handled by pkg-config and
- use udevaltdirs
-
-To avoid need of rebuild after udev update/downgrade let udevdir= be set
-dynamically with pkg-config.  Use udevaltdirs to search for rules both
-in old and new locations.
----
- dracut.conf.d/gentoo.conf.example | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
-index 26e7314..f9617f0 100644
---- a/dracut.conf.d/gentoo.conf.example
-+++ b/dracut.conf.d/gentoo.conf.example
-@@ -1,7 +1,8 @@
- # /etc/dracut.conf.d/gentoo.conf
- # dracut config file customized for Gentoo Base System release 2
- 
--udevdir=/lib/udev
-+udevdir=
-+udevaltdirs="/lib/udev /usr/lib/udev"
- ro_mnt=yes
- 
- #
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0004-Use-the-same-paths-in-dracut.sh-as-tho.patch b/sys-kernel/dracut/files/034-0004-Use-the-same-paths-in-dracut.sh-as-tho.patch
deleted file mode 100644
index dec964e5a8..0000000000
--- a/sys-kernel/dracut/files/034-0004-Use-the-same-paths-in-dracut.sh-as-tho.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 6660721bd34b7a25026ffc6a6df4cdfdc8742ed3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:37:09 +0200
-Subject: [PATCH 4/5] Use the same paths in dracut.sh as those set with
- configure script
-
-Makefile alters destination main dracut script and sets dracutbasedir to
-the value of pkglibdir set in configure.
----
- Makefile  | 3 +++
- dracut.sh | 9 ++++-----
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 124a41b..ea504f5 100644
---- a/Makefile
-+++ b/Makefile
-@@ -91,6 +91,9 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
-+	sed -r \
-+		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
-+		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
- 	install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
- 	install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
-diff --git a/dracut.sh b/dracut.sh
-index d9533dd..cf18c81 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -26,10 +26,13 @@
- # store for logging
- dracut_args=( "$@" )
- 
-+# base dirs
-+pkglibdir=/usr/lib/dracut
-+dracutbasedir="$pkglibdir"
-+
- set -o pipefail
- 
- usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -54,7 +57,6 @@ EOF
- }
- 
- long_usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -549,8 +551,6 @@ export DRACUT_LOG_LEVEL=warning
-     debug=yes
- }
- 
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
--
- # if we were not passed a config file, try the default one
- if [[ ! -f $conffile ]]; then
-     if [[ $allowlocal ]]; then
-@@ -669,7 +669,6 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
- [[ $use_fstab_l ]] && use_fstab=$use_fstab_l
- [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
- [[ $lvmconf_l ]] && lvmconf=$lvmconf_l
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
- [[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
- [[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
- [[ $tmpdir ]] || tmpdir=/var/tmp
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0005-Install-dracut-install-into-libexec-di.patch b/sys-kernel/dracut/files/034-0005-Install-dracut-install-into-libexec-di.patch
deleted file mode 100644
index 6af99197ed..0000000000
--- a/sys-kernel/dracut/files/034-0005-Install-dracut-install-into-libexec-di.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From 80dbe6dfbdb2cd3475006e210fe057dceb81ddf2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:40:43 +0200
-Subject: [PATCH 5/5] Install dracut-install into libexec dir instead of lib
- dir
-
-dracut-install script is the only thing ABI specific atm.
-
-See https://bugs.gentoo.org/show_bug.cgi?id=485218 for details on the
-problem.
----
- Makefile            | 4 +++-
- configure           | 1 +
- dracut-functions.sh | 4 ++++
- dracut.sh           | 1 +
- 4 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index ea504f5..e004a79 100644
---- a/Makefile
-+++ b/Makefile
-@@ -92,6 +92,7 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
- 	sed -r \
-+		-e "s|^(libexecdir)=.*|\1=$(libexecdir)|" \
- 		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
- 		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
-@@ -135,7 +136,8 @@ endif
- 		done \
- 	fi
- 	if [ -f install/dracut-install ]; then \
--		install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
-+		mkdir -p $(DESTDIR)$(libexecdir); \
-+		install -m 0755 install/dracut-install $(DESTDIR)$(libexecdir)/dracut-install; \
- 	fi
- 	mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
- 	install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
-diff --git a/configure b/configure
-index 19b5e1f..d2ffc2c 100755
---- a/configure
-+++ b/configure
-@@ -61,6 +61,7 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
- mandir ?= ${mandir:-${prefix}/share/man}
- enable_documentation ?= ${enable_documentation:-yes}
- bindir ?= ${bindir:-${prefix}/bin}
-+libexecdir ?= ${libexecdir:-${prefix}/libexec}
- EOF
- 
- {
-diff --git a/dracut-functions.sh b/dracut-functions.sh
-index c1cbdeb..72b7f1b 100755
---- a/dracut-functions.sh
-+++ b/dracut-functions.sh
-@@ -694,6 +694,10 @@ if ! [[ $DRACUT_INSTALL ]]; then
-     DRACUT_INSTALL=$(find_binary dracut-install)
- fi
- 
-+if ! [[ $DRACUT_INSTALL ]] && [[ -x $libexecdir/dracut-install ]]; then
-+    DRACUT_INSTALL=$libexecdir/dracut-install
-+fi
-+
- if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
-     DRACUT_INSTALL=$dracutbasedir/dracut-install
- fi
-diff --git a/dracut.sh b/dracut.sh
-index cf18c81..e28b929 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -27,6 +27,7 @@
- dracut_args=( "$@" )
- 
- # base dirs
-+libexecdir=/usr/libexec
- pkglibdir=/usr/lib/dracut
- dracutbasedir="$pkglibdir"
- 
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0006-resume-fix-swap-detection-in-hostonly.patch b/sys-kernel/dracut/files/034-0006-resume-fix-swap-detection-in-hostonly.patch
deleted file mode 100644
index e97780c259..0000000000
--- a/sys-kernel/dracut/files/034-0006-resume-fix-swap-detection-in-hostonly.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 0c89bcc27516803d68444488ede3d513ba982039 Mon Sep 17 00:00:00 2001
-From: Alexander Tsoy <alexander@tsoy.me>
-Date: Wed, 9 Oct 2013 06:39:46 +0400
-Subject: [PATCH 6/6] resume: fix swap detection in hostonly
-
-Check for other possible fs types. This fixes swap detection when using
-TuxOnIce kernel.
-
-Note that parse-resume.sh generate udev rules with support for
-ID_FS_TYPE=suspend, but we do not include it here, because it is
-libvolume_id thing and host_fs_types is populated using blkid.
----
- modules.d/95resume/module-setup.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
-index 518ebf0..a1ddb46 100755
---- a/modules.d/95resume/module-setup.sh
-+++ b/modules.d/95resume/module-setup.sh
-@@ -6,7 +6,7 @@ check() {
-     # No point trying to support resume, if no swap partition exist
-     [[ $hostonly ]] || [[ $mount_needs ]] && {
-         for fs in "${host_fs_types[@]}"; do
--            [[ $fs = swap ]] && return 0
-+            [[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0
-         done
-         return 255
-     }
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/034-0007-dracut.sh-also-mkdir-run-lock-which-is.patch b/sys-kernel/dracut/files/034-0007-dracut.sh-also-mkdir-run-lock-which-is.patch
deleted file mode 100644
index 0cf2586ed4..0000000000
--- a/sys-kernel/dracut/files/034-0007-dracut.sh-also-mkdir-run-lock-which-is.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From be723725cd6ea1c41b52c1bff5a569eb8cd0c76d Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Wed, 16 Oct 2013 11:31:54 +0200
-Subject: [PATCH 07/12] dracut.sh: also mkdir /run/lock, which is copied to
-
----
- dracut.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dracut.sh b/dracut.sh
-index e28b929..309aa7d 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -1081,7 +1081,7 @@ if [[ $kernel_only != yes ]]; then
-         fi
-     done
- 
--    for d in dev proc sys sysroot root run run/lock run/initramfs; do
-+    for d in dev proc sys sysroot root run run/log run/lock run/initramfs; do
-         if [ -L "/$d" ]; then
-             inst_symlink "/$d"
-         else
--- 
-1.8.4.3
-

diff --git a/sys-kernel/dracut/files/034-0008-dracut.sh-no-need-to-make-subdirs-in-r.patch b/sys-kernel/dracut/files/034-0008-dracut.sh-no-need-to-make-subdirs-in-r.patch
deleted file mode 100644
index 380411cc5f..0000000000
--- a/sys-kernel/dracut/files/034-0008-dracut.sh-no-need-to-make-subdirs-in-r.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 34712f015f13221b653a1ed2ee75804f06a22357 Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Wed, 16 Oct 2013 11:39:17 +0200
-Subject: [PATCH 08/12] dracut.sh: no need to make subdirs in run
-
----
- dracut.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dracut.sh b/dracut.sh
-index 309aa7d..4f58eed 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -1081,7 +1081,7 @@ if [[ $kernel_only != yes ]]; then
-         fi
-     done
- 
--    for d in dev proc sys sysroot root run run/log run/lock run/initramfs; do
-+    for d in dev proc sys sysroot root run; do
-         if [ -L "/$d" ]; then
-             inst_symlink "/$d"
-         else
--- 
-1.8.4.3
-

diff --git a/sys-kernel/dracut/files/034-0009-lvm-install-thin-utils-for-non-hostonl.patch b/sys-kernel/dracut/files/034-0009-lvm-install-thin-utils-for-non-hostonl.patch
deleted file mode 100644
index 8bf0f7c398..0000000000
--- a/sys-kernel/dracut/files/034-0009-lvm-install-thin-utils-for-non-hostonl.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From bd3303000b32cb500b2d769c6852784a807cee47 Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Tue, 8 Oct 2013 10:30:00 +0200
-Subject: [PATCH 09/12] lvm: install thin utils for non-hostonly
-
----
- modules.d/90lvm/module-setup.sh | 18 +++++++++++-------
- 1 file changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
-index f98ffff..514addc 100755
---- a/modules.d/90lvm/module-setup.sh
-+++ b/modules.d/90lvm/module-setup.sh
-@@ -52,13 +52,17 @@ install() {
- 
-     inst lvm
- 
--    get_host_lvs | while read line; do
--        printf "%s" " rd.lvm.lv=$line"
--        if ! [[ $_needthin ]]; then
--            [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1
--        fi
--    done >> "${initdir}/etc/cmdline.d/90lvm.conf"
--    echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
-+    if [[ $hostonly ]]; then
-+        get_host_lvs | while read line; do
-+            printf "%s" " rd.lvm.lv=$line"
-+            if ! [[ $_needthin ]]; then
-+                [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1
-+            fi
-+        done >> "${initdir}/etc/cmdline.d/90lvm.conf"
-+        echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
-+    else
-+        _needthin=1
-+    fi
- 
-     inst_rules "$moddir/64-lvm.rules"
- 
--- 
-1.8.4.3
-

diff --git a/sys-kernel/dracut/files/034-0011-lvm-fix-thin-recognition.patch b/sys-kernel/dracut/files/034-0011-lvm-fix-thin-recognition.patch
deleted file mode 100644
index b2dfc77781..0000000000
--- a/sys-kernel/dracut/files/034-0011-lvm-fix-thin-recognition.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From a70dff7f103b27d5b7016e13a64c7710c61dc96e Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Wed, 16 Oct 2013 11:30:08 +0200
-Subject: [PATCH 11/12] lvm: fix thin recognition
-
-The global var setting was happening in a pipe and did not have an
-effect.
-
-Use <<<$() instead.
-
-< <() cannot be used, because dracut is called in chroot's environments,
-where /dev/fd does not point to /proc/self/fd, but bash wants
-/dev/fd/<num> for this construct.
----
- modules.d/90lvm/module-setup.sh | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
-index f8b598d..cbdf4a2 100755
---- a/modules.d/90lvm/module-setup.sh
-+++ b/modules.d/90lvm/module-setup.sh
-@@ -57,12 +57,13 @@ install() {
-     inst lvm
- 
-     if [[ $hostonly ]]; then
--        get_host_lvs | while read line; do
-+        while read line; do
-+            [[ -n "$line" ]] || continue
-             printf "%s" " rd.lvm.lv=$line"
-             if ! [[ $_needthin ]]; then
-                 [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1
-             fi
--        done >> "${initdir}/etc/cmdline.d/90lvm.conf"
-+        done <<<$(get_host_lvs) >> "${initdir}/etc/cmdline.d/90lvm.conf"
-         echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
-     else
-         _needthin=1
--- 
-1.8.4.3
-

diff --git a/sys-kernel/dracut/files/034-0012-lvm-always-install-thin-utils-for-lvm.patch b/sys-kernel/dracut/files/034-0012-lvm-always-install-thin-utils-for-lvm.patch
deleted file mode 100644
index 074566b69a..0000000000
--- a/sys-kernel/dracut/files/034-0012-lvm-always-install-thin-utils-for-lvm.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From 615071016ecfa223b2744fc17e137de780167115 Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Mon, 21 Oct 2013 09:09:26 +0200
-Subject: [PATCH 12/12] lvm: always install thin utils for lvm
-
----
- modules.d/90lvm/module-setup.sh | 33 +++++++--------------------------
- 1 file changed, 7 insertions(+), 26 deletions(-)
-
-diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
-index cbdf4a2..87374da 100755
---- a/modules.d/90lvm/module-setup.sh
-+++ b/modules.d/90lvm/module-setup.sh
-@@ -24,7 +24,8 @@ depends() {
-     return 0
- }
- 
--get_host_lvs() {
-+# called by dracut
-+cmdline() {
-     local _activated
-     declare -A _activated
- 
-@@ -37,37 +38,20 @@ get_host_lvs() {
-         eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
-         [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
-         if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then
--            printf "%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
-+            printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
-             _activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1
-         fi
-     done
- }
- 
- # called by dracut
--cmdline() {
--    get_host_lvs | while read line; do
--        printf " rd.lvm.lv=$line"
--    done
--}
--
--# called by dracut
- install() {
--    local _i _needthin
-+    local _i
- 
-     inst lvm
- 
--    if [[ $hostonly ]]; then
--        while read line; do
--            [[ -n "$line" ]] || continue
--            printf "%s" " rd.lvm.lv=$line"
--            if ! [[ $_needthin ]]; then
--                [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1
--            fi
--        done <<<$(get_host_lvs) >> "${initdir}/etc/cmdline.d/90lvm.conf"
--        echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
--    else
--        _needthin=1
--    fi
-+    cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
-+    echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
- 
-     inst_rules "$moddir/64-lvm.rules"
- 
-@@ -103,9 +87,6 @@ install() {
- 
-     inst_libdir_file "libdevmapper-event-lvm*.so"
- 
--    if [[ $_needthin ]]; then
--        inst_multiple -o thin_dump thin_restore thin_check thin_repair
--    fi
--
-+    inst_multiple -o thin_dump thin_restore thin_check thin_repair
- }
- 
--- 
-1.8.4.3
-

diff --git a/sys-kernel/dracut/files/034-0013-usrmount-always-install.patch b/sys-kernel/dracut/files/034-0013-usrmount-always-install.patch
deleted file mode 100644
index 55fd87c1b0..0000000000
--- a/sys-kernel/dracut/files/034-0013-usrmount-always-install.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From ffbe30d1e1e9fb09136bfc2d29a3cc65292b5690 Mon Sep 17 00:00:00 2001
-From: Alexander Tsoy <alexander@tsoy.me>
-Date: Thu, 21 Nov 2013 20:33:38 +0400
-Subject: [PATCH 13/13] usrmount: always install
-
-/usr should be mounted by initramfs even if /sbin/init lives in /
-
-Conflicts:
-	modules.d/98usrmount/module-setup.sh
----
- modules.d/98usrmount/module-setup.sh | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/modules.d/98usrmount/module-setup.sh b/modules.d/98usrmount/module-setup.sh
-index 1af789f..31a6229 100755
---- a/modules.d/98usrmount/module-setup.sh
-+++ b/modules.d/98usrmount/module-setup.sh
-@@ -4,10 +4,7 @@
- 
- # called by dracut
- check() {
--    local _init
-     [[ $mount_needs ]] && return 1
--    _init=$(readlink -f /sbin/init)
--    [[ "$init" == "${init##/usr}" ]] && return 255
-     return 0
- }
- 
--- 
-1.8.4.4
-

diff --git a/sys-kernel/dracut/files/034-0014-udev-rules-add-eudev-rules.patch b/sys-kernel/dracut/files/034-0014-udev-rules-add-eudev-rules.patch
deleted file mode 100644
index 0b3fc39d2f..0000000000
--- a/sys-kernel/dracut/files/034-0014-udev-rules-add-eudev-rules.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 29f735ac0e54421d1518b8d0f730523ebb7e6d5a Mon Sep 17 00:00:00 2001
-From: Alexander Tsoy <alexander@tsoy.me>
-Date: Wed, 25 Dec 2013 14:00:26 +0400
-Subject: [PATCH] udev-rules: add eudev rules
-
-eudev configured with "--enable-modules --disable-libkmod" installs
-80-drivers-modprobe.rules instead of 80-drivers.rules
-
-https://bugs.gentoo.org/show_bug.cgi?id=494188
----
- modules.d/95udev-rules/module-setup.sh | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
-index 88c3da2..ebc4447 100755
---- a/modules.d/95udev-rules/module-setup.sh
-+++ b/modules.d/95udev-rules/module-setup.sh
-@@ -39,6 +39,8 @@ install() {
-     prepare_udev_rules 59-persistent-storage.rules 61-persistent-storage.rules
-     # debian udev rules
-     inst_rules 91-permissions.rules
-+    # eudev rules
-+    inst_rules 80-drivers-modprobe.rules
- 
-     {
-         for i in cdrom tape dialout floppy; do
--- 
-1.8.3.2
-

diff --git a/sys-kernel/dracut/files/040-0001-dracut-functions.sh-support-for-altern.patch b/sys-kernel/dracut/files/040-0001-dracut-functions.sh-support-for-altern.patch
deleted file mode 100644
index 55b3699818..0000000000
--- a/sys-kernel/dracut/files/040-0001-dracut-functions.sh-support-for-altern.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From ed2f8d6145ef12084af882575091a7d44a3e47c1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 6 Jan 2013 13:35:01 +0100
-Subject: [PATCH 1/4] dracut-functions.sh: support for alternative udev dirs -
- udevaltdirs
-
-It is required for Gentoo which moves udev from / to /usr and supports
-both /lib/udev and /usr/lib/udev for compatibility with other packages.
-
-Credits go to Alexander Tsoy <alexander@tsoy.me>.
-
-Conflicts:
-	dracut-functions.sh
----
- dracut-functions.sh | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/dracut-functions.sh b/dracut-functions.sh
-index 1bcc3b4..72afce2 100755
---- a/dracut-functions.sh
-+++ b/dracut-functions.sh
-@@ -943,6 +943,16 @@ inst_rules() {
-     inst_dir "$_target"
-     for _rule in "$@"; do
-         if [ "${_rule#/}" = "$_rule" ]; then
-+            for r in ${udevaltdirs}; do
-+                [[ "$r" = "${udevdir}" ]] && continue
-+                if [[ -e $r/rules.d/$_rule ]]; then
-+                    _found="$r/rules.d/$_rule"
-+                    inst_rule_programs "$_found"
-+                    inst_rule_group_owner "$_found"
-+                    inst_rule_initqueue "$_found"
-+                    inst_simple "$_found" "${udevdir}/rules.d/${_found##*/}"
-+                fi
-+            done
-             for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do
-                 if [[ -e $r/$_rule ]]; then
-                     _found="$r/$_rule"
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0002-gentoo.conf-let-udevdir-be-handled-by-.patch b/sys-kernel/dracut/files/040-0002-gentoo.conf-let-udevdir-be-handled-by-.patch
deleted file mode 100644
index 52b97692f9..0000000000
--- a/sys-kernel/dracut/files/040-0002-gentoo.conf-let-udevdir-be-handled-by-.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From a562cb9ad84784cb4ba7679a2fc3a269d31a4ca3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 16 Dec 2012 20:02:48 +0100
-Subject: [PATCH 2/4] gentoo.conf: let udevdir= be handled by pkg-config and
- use udevaltdirs
-
-To avoid need of rebuild after udev update/downgrade let udevdir= be set
-dynamically with pkg-config.  Use udevaltdirs to search for rules both
-in old and new locations.
----
- dracut.conf.d/gentoo.conf.example | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
-index 26e7314..f9617f0 100644
---- a/dracut.conf.d/gentoo.conf.example
-+++ b/dracut.conf.d/gentoo.conf.example
-@@ -1,7 +1,8 @@
- # /etc/dracut.conf.d/gentoo.conf
- # dracut config file customized for Gentoo Base System release 2
- 
--udevdir=/lib/udev
-+udevdir=
-+udevaltdirs="/lib/udev /usr/lib/udev"
- ro_mnt=yes
- 
- #
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0003-Use-the-same-paths-in-dracut.sh-as-tho.patch b/sys-kernel/dracut/files/040-0003-Use-the-same-paths-in-dracut.sh-as-tho.patch
deleted file mode 100644
index fbfd9ee419..0000000000
--- a/sys-kernel/dracut/files/040-0003-Use-the-same-paths-in-dracut.sh-as-tho.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 5a1de9053d27feeb283253554033e7ad25c9aa31 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:37:09 +0200
-Subject: [PATCH 3/4] Use the same paths in dracut.sh as those set with
- configure script
-
-Makefile alters destination main dracut script and sets dracutbasedir to
-the value of pkglibdir set in configure.
----
- Makefile  | 3 +++
- dracut.sh | 9 ++++-----
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 7127368..a4c35e5 100644
---- a/Makefile
-+++ b/Makefile
-@@ -103,6 +103,9 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
-+	sed -r \
-+		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
-+		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
- 	install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
- 	install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
-diff --git a/dracut.sh b/dracut.sh
-index 1c7e208..ea30a7b 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -24,10 +24,13 @@
- # store for logging
- dracut_args=( "$@" )
- 
-+# base dirs
-+pkglibdir=/usr/lib/dracut
-+dracutbasedir="$pkglibdir"
-+
- set -o pipefail
- 
- usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -52,7 +55,6 @@ EOF
- }
- 
- long_usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -656,8 +658,6 @@ export DRACUT_LOG_LEVEL=warning
-     debug=yes
- }
- 
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
--
- # if we were not passed a config file, try the default one
- if [[ ! -f $conffile ]]; then
-     if [[ $allowlocal ]]; then
-@@ -798,7 +798,6 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
- [[ $use_fstab_l ]] && use_fstab=$use_fstab_l
- [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
- [[ $lvmconf_l ]] && lvmconf=$lvmconf_l
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
- [[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
- [[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
- [[ $tmpdir ]] || tmpdir=/var/tmp
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0004-Install-dracut-install-into-libexec-di.patch b/sys-kernel/dracut/files/040-0004-Install-dracut-install-into-libexec-di.patch
deleted file mode 100644
index 2cf27f339c..0000000000
--- a/sys-kernel/dracut/files/040-0004-Install-dracut-install-into-libexec-di.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From ed9375739c3f7e48f6e1c3037c5a589c49d78613 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:40:43 +0200
-Subject: [PATCH 4/4] Install dracut-install into libexec dir instead of lib
- dir
-
-dracut-install script is the only thing ABI specific atm.
-
-See https://bugs.gentoo.org/show_bug.cgi?id=485218 for details on the
-problem.
----
- Makefile            | 4 +++-
- configure           | 1 +
- dracut-functions.sh | 4 ++++
- dracut.sh           | 1 +
- 4 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index a4c35e5..af61faf 100644
---- a/Makefile
-+++ b/Makefile
-@@ -104,6 +104,7 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
- 	sed -r \
-+		-e "s|^(libexecdir)=.*|\1=$(libexecdir)|" \
- 		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
- 		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
-@@ -147,7 +148,8 @@ endif
- 		done \
- 	fi
- 	if [ -f install/dracut-install ]; then \
--		install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
-+		mkdir -p $(DESTDIR)$(libexecdir); \
-+		install -m 0755 install/dracut-install $(DESTDIR)$(libexecdir)/dracut-install; \
- 	fi
- 	if [ -f skipcpio/skipcpio ]; then \
- 		install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
-diff --git a/configure b/configure
-index 0bd3d2d..17370de 100755
---- a/configure
-+++ b/configure
-@@ -59,6 +59,7 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
- mandir ?= ${mandir:-${prefix}/share/man}
- enable_documentation ?= ${enable_documentation:-yes}
- bindir ?= ${bindir:-${prefix}/bin}
-+libexecdir ?= ${libexecdir:-${prefix}/libexec}
- EOF
- 
- {
-diff --git a/dracut-functions.sh b/dracut-functions.sh
-index 72afce2..1d85315 100755
---- a/dracut-functions.sh
-+++ b/dracut-functions.sh
-@@ -741,6 +741,10 @@ if ! [[ $DRACUT_INSTALL ]]; then
-     DRACUT_INSTALL=$(find_binary dracut-install)
- fi
- 
-+if ! [[ $DRACUT_INSTALL ]] && [[ -x $libexecdir/dracut-install ]]; then
-+    DRACUT_INSTALL=$libexecdir/dracut-install
-+fi
-+
- if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
-     DRACUT_INSTALL=$dracutbasedir/dracut-install
- fi
-diff --git a/dracut.sh b/dracut.sh
-index ea30a7b..08f27eb 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -25,6 +25,7 @@
- dracut_args=( "$@" )
- 
- # base dirs
-+libexecdir=/usr/libexec
- pkglibdir=/usr/lib/dracut
- dracutbasedir="$pkglibdir"
- 
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0005-NEWS-add-040-entry.patch b/sys-kernel/dracut/files/040-0005-NEWS-add-040-entry.patch
deleted file mode 100644
index eeb4610e41..0000000000
--- a/sys-kernel/dracut/files/040-0005-NEWS-add-040-entry.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 36c91220234af69a96cd95e575b47f0a3ec4c645 Mon Sep 17 00:00:00 2001
-From: Harald Hoyer <harald@redhat.com>
-Date: Fri, 24 Oct 2014 14:41:29 +0200
-Subject: [PATCH 5/5] NEWS: add 040 entry
-
----
- NEWS | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/NEWS b/NEWS
-index 1b79da1..da44068 100644
---- a/NEWS
-+++ b/NEWS
-@@ -1,3 +1,8 @@
-+dracut-040
-+==========
-+- fixed dracut module dependency checks
-+- fixed test suite
-+
- dracut-039
- ==========
- - DRACUT_PATH can now be used to specify the PATH used by dracut
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0006-Don-t-pass-rsyncable-option-to-gzip-Ge.patch b/sys-kernel/dracut/files/040-0006-Don-t-pass-rsyncable-option-to-gzip-Ge.patch
deleted file mode 100644
index 1ade9bd1e9..0000000000
--- a/sys-kernel/dracut/files/040-0006-Don-t-pass-rsyncable-option-to-gzip-Ge.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From ff57ba111c03957d4a68459efd91322c24223861 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sat, 1 Nov 2014 22:25:07 +0100
-Subject: [PATCH 6/6] Don't pass --rsyncable option to gzip - Gentoo gzip
- doesn't support it
-
----
- dracut.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dracut.sh b/dracut.sh
-index 08f27eb..17be895 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -822,7 +822,7 @@ case $compress in
-     bzip2) compress="bzip2 -9";;
-     lzma)  compress="lzma -9 -T0";;
-     xz)    compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
--    gzip)  compress="gzip -n -9 --rsyncable"; command -v pigz > /dev/null 2>&1 && compress="pigz -9 -n -T -R";;
-+    gzip)  compress="gzip -n -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9 -n -T -R";;
-     lzo)   compress="lzop -9";;
-     lz4)   compress="lz4 -l -9";;
- esac
--- 
-2.1.3
-

diff --git a/sys-kernel/dracut/files/040-0007-Take-into-account-lib64-dirs-when-dete.patch b/sys-kernel/dracut/files/040-0007-Take-into-account-lib64-dirs-when-dete.patch
deleted file mode 100644
index 5d10312846..0000000000
--- a/sys-kernel/dracut/files/040-0007-Take-into-account-lib64-dirs-when-dete.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 25efd305dace3275c661e0a7dfbaef42b4cbc6d7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 11 Jan 2015 15:10:39 +0100
-Subject: [PATCH 7/7] Take into account lib64 dirs when detecting version,
- modules and params
-
----
- lsinitrd.sh | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/lsinitrd.sh b/lsinitrd.sh
-index 4f12c2c..dc1f88f 100755
---- a/lsinitrd.sh
-+++ b/lsinitrd.sh
-@@ -124,7 +124,7 @@ extract_files()
- list_modules()
- {
-     echo "dracut modules:"
--    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
-+    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/modules.txt' 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
-     ((ret+=$?))
- }
- 
-@@ -217,7 +217,7 @@ ret=0
- if (( ${#filenames[@]} > 0 )); then
-     extract_files
- else
--    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
-+    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/dracut-*' 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
-     ((ret+=$?))
-     echo "Version: $version"
-     echo
-@@ -226,7 +226,7 @@ else
-         echo "========================================================================"
-     else
-         echo -n "Arguments: "
--        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
-+        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib64/dracut/build-parameter.txt' 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
-         echo
-         list_modules
-         list_files
--- 
-2.2.1
-

diff --git a/sys-kernel/dracut/files/041-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch b/sys-kernel/dracut/files/041-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch
deleted file mode 100644
index d16119ccae..0000000000
--- a/sys-kernel/dracut/files/041-0001-Use-the-same-paths-in-dracut.sh-as-tho.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 89334439113c0ea8196ac5e9e188e6a1bbebe267 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:37:09 +0200
-Subject: [PATCH 1/4] Use the same paths in dracut.sh as those set with
- configure script
-
-Makefile alters destination main dracut script and sets dracutbasedir to
-the value of pkglibdir set in configure.
----
- Makefile  | 3 +++
- dracut.sh | 9 ++++-----
- 2 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 41ae274..41968b0 100644
---- a/Makefile
-+++ b/Makefile
-@@ -103,6 +103,9 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
-+	sed -r \
-+		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
-+		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
- 	install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
- 	install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
-diff --git a/dracut.sh b/dracut.sh
-index 5e2feba..89a711e 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -24,10 +24,13 @@
- # store for logging
- dracut_args=( "$@" )
- 
-+# base dirs
-+pkglibdir=/usr/lib/dracut
-+dracutbasedir="$pkglibdir"
-+
- set -o pipefail
- 
- usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -52,7 +55,6 @@ EOF
- }
- 
- long_usage() {
--    [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-     if [[ -f $dracutbasedir/dracut-version.sh ]]; then
-         . $dracutbasedir/dracut-version.sh
-     fi
-@@ -666,8 +668,6 @@ export DRACUT_LOG_LEVEL=warning
-     debug=yes
- }
- 
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
--
- # if we were not passed a config file, try the default one
- if [[ ! -f $conffile ]]; then
-     if [[ $allowlocal ]]; then
-@@ -808,7 +808,6 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
- [[ $use_fstab_l ]] && use_fstab=$use_fstab_l
- [[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
- [[ $lvmconf_l ]] && lvmconf=$lvmconf_l
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
- [[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
- [[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
- [[ $tmpdir ]] || tmpdir=/var/tmp
--- 
-2.3.3
-

diff --git a/sys-kernel/dracut/files/041-0002-Install-dracut-install-and-skipcpio-in.patch b/sys-kernel/dracut/files/041-0002-Install-dracut-install-and-skipcpio-in.patch
deleted file mode 100644
index 5202ac3740..0000000000
--- a/sys-kernel/dracut/files/041-0002-Install-dracut-install-and-skipcpio-in.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From 7d8dadfdb2d59ac60c6a579f602e13ac7c743e39 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Wed, 2 Oct 2013 22:40:43 +0200
-Subject: [PATCH 2/4] Install dracut-install and skipcpio into libexec dir
- instead of lib dir
-
-dracut-install and skipcpio are the only ABI specific things atm.
-
-See https://bugs.gentoo.org/show_bug.cgi?id=485218 for details on the
-problem.
----
- Makefile                    | 7 +++++--
- configure                   | 1 +
- dracut-functions.sh         | 4 ++++
- dracut-initramfs-restore.sh | 4 ++--
- dracut.sh                   | 1 +
- lsinitrd.sh                 | 4 ++--
- 6 files changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 41968b0..bb007d1 100644
---- a/Makefile
-+++ b/Makefile
-@@ -104,6 +104,7 @@ install: dracut-version.sh
- 	mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
- 	install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
- 	sed -r \
-+		-e "s|^(libexecdir)=.*|\1=$(libexecdir)|" \
- 		-e "s|^(pkglibdir)=.*|\1=$(pkglibdir)|" \
- 		-i $(DESTDIR)$(bindir)/dracut
- 	install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
-@@ -147,10 +148,12 @@ endif
- 		done \
- 	fi
- 	if [ -f install/dracut-install ]; then \
--		install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
-+		mkdir -p $(DESTDIR)$(libexecdir)/dracut; \
-+		install -m 0755 install/dracut-install $(DESTDIR)$(libexecdir)/dracut/dracut-install; \
- 	fi
- 	if [ -f skipcpio/skipcpio ]; then \
--		install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
-+		mkdir -p $(DESTDIR)$(libexecdir)/dracut; \
-+		install -m 0755 skipcpio/skipcpio $(DESTDIR)$(libexecdir)/dracut/skipcpio; \
- 	fi
- 	mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
- 	install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
-diff --git a/configure b/configure
-index 0bd3d2d..17370de 100755
---- a/configure
-+++ b/configure
-@@ -59,6 +59,7 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
- mandir ?= ${mandir:-${prefix}/share/man}
- enable_documentation ?= ${enable_documentation:-yes}
- bindir ?= ${bindir:-${prefix}/bin}
-+libexecdir ?= ${libexecdir:-${prefix}/libexec}
- EOF
- 
- {
-diff --git a/dracut-functions.sh b/dracut-functions.sh
-index 37ddca2..953acd1 100755
---- a/dracut-functions.sh
-+++ b/dracut-functions.sh
-@@ -733,6 +733,10 @@ if ! [[ $DRACUT_INSTALL ]]; then
-     DRACUT_INSTALL=$(find_binary dracut-install)
- fi
- 
-+if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutlibexecdir/dracut-install ]]; then
-+    DRACUT_INSTALL=$dracutlibexecdir/dracut-install
-+fi
-+
- if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
-     DRACUT_INSTALL=$dracutbasedir/dracut-install
- elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
-diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
-index 8b9b80f..8dd358e 100644
---- a/dracut-initramfs-restore.sh
-+++ b/dracut-initramfs-restore.sh
-@@ -8,8 +8,8 @@ set -e
- 
- KERNEL_VERSION="$(uname -r)"
- 
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
--SKIP="$dracutbasedir/skipcpio"
-+[[ $dracutlibexecdir ]] || dracutlibexecdir=/usr/libexec/dracut
-+SKIP="$dracutlibexecdir/skipcpio"
- [[ -x $SKIP ]] || SKIP=cat
- 
- [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
-diff --git a/dracut.sh b/dracut.sh
-index 89a711e..9cfeef1 100755
---- a/dracut.sh
-+++ b/dracut.sh
-@@ -25,6 +25,7 @@
- dracut_args=( "$@" )
- 
- # base dirs
-+dracutlibexecdir=/usr/libexec/dracut
- pkglibdir=/usr/lib/dracut
- dracutbasedir="$pkglibdir"
- 
-diff --git a/lsinitrd.sh b/lsinitrd.sh
-index 4f12c2c..2ed6e56 100755
---- a/lsinitrd.sh
-+++ b/lsinitrd.sh
-@@ -33,7 +33,7 @@ usage()
- }
- 
- 
--[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
-+[[ $dracutlibexecdir ]] || dracutlibexecdir=/usr/libexec/dracut
- 
- sorted=0
- modules=0
-@@ -158,7 +158,7 @@ case $bin in
-                 echo "Early CPIO image"
-                 list_files
-             fi
--            SKIP="$dracutbasedir/skipcpio"
-+            SKIP="$dracutlibexecdir/skipcpio"
-             if ! [[ -x $SKIP ]]; then
-                 echo
-                 echo "'$SKIP' not found, cannot display remaining contents!" >&2
--- 
-2.3.3
-

diff --git a/sys-kernel/dracut/files/041-0003-Take-into-account-lib64-dirs-when-dete.patch b/sys-kernel/dracut/files/041-0003-Take-into-account-lib64-dirs-when-dete.patch
deleted file mode 100644
index b355f8445c..0000000000
--- a/sys-kernel/dracut/files/041-0003-Take-into-account-lib64-dirs-when-dete.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From acfd4d98e821dbaa9ae68dde82fb8843fbf5de59 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 11 Jan 2015 15:10:39 +0100
-Subject: [PATCH 3/4] Take into account lib64 dirs when detecting version,
- modules and params
-
----
- lsinitrd.sh | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/lsinitrd.sh b/lsinitrd.sh
-index 2ed6e56..0355c87 100755
---- a/lsinitrd.sh
-+++ b/lsinitrd.sh
-@@ -108,6 +108,12 @@ if ! [[ -f "$image" ]]; then
-     exit 1
- fi
- 
-+dracutlibdirs() {
-+    for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
-+        echo "$d/$1"
-+    done
-+}
-+
- extract_files()
- {
-     (( ${#filenames[@]} == 1 )) && nofileinfo=1
-@@ -124,7 +130,8 @@ extract_files()
- list_modules()
- {
-     echo "dracut modules:"
--    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
-+    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
-+        $(dracutlibdirs modules.txt) 2>/dev/null
-     ((ret+=$?))
- }
- 
-@@ -217,7 +224,8 @@ ret=0
- if (( ${#filenames[@]} > 0 )); then
-     extract_files
- else
--    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
-+    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
-+        $(dracutlibdirs 'dracut-*') 2>/dev/null)
-     ((ret+=$?))
-     echo "Version: $version"
-     echo
-@@ -226,7 +234,8 @@ else
-         echo "========================================================================"
-     else
-         echo -n "Arguments: "
--        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
-+        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
-+            $(dracutlibdirs build-parameter.txt) 2>/dev/null
-         echo
-         list_modules
-         list_files
--- 
-2.3.3
-

diff --git a/sys-kernel/dracut/files/041-0004-Portability-fixes.patch b/sys-kernel/dracut/files/041-0004-Portability-fixes.patch
deleted file mode 100644
index f92cba390e..0000000000
--- a/sys-kernel/dracut/files/041-0004-Portability-fixes.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 82f7e46c8fdb2bb41b7b26916e463add7af70a94 Mon Sep 17 00:00:00 2001
-From: xtraeme <xtraeme@voidlinux.eu>
-Date: Tue, 2 Jun 2015 11:11:21 +0200
-Subject: [PATCH 5/5] Portability fixes:
-
-- Use uid_t not __uid_t.
-- Define _GNU_SOURCE for cpu_set_t and others.
-- Include string.h for strncmp().
-- Detect musl's ldd error message.
----
- install/dracut-install.c | 7 ++++++-
- install/util.h           | 3 +++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/install/dracut-install.c b/install/dracut-install.c
-index 201f181..0ff5c49 100644
---- a/install/dracut-install.c
-+++ b/install/dracut-install.c
-@@ -222,7 +222,7 @@ static int cp(const char *src, const char *dst)
-                 if (ret == 0) {
-                         struct timeval tv[2];
-                         if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
--                                if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0)
-+                                if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0)
-                                     log_error("Failed to chown %s: %m", dst);
-                         tv[0].tv_sec = sb.st_atime;
-                         tv[0].tv_usec = 0;
-@@ -388,6 +388,11 @@ static int resolve_deps(const char *src)
-                         break;
-                 }
- 
-+		/* musl ldd */
-+		if (strstr(buf, "Not a valid dynamic program"))
-+			break;
-+
-+		/* glibc */
-                 if (strstr(buf, "not a dynamic executable"))
-                         break;
- 
-diff --git a/install/util.h b/install/util.h
-index cc7b988..2ad3254 100644
---- a/install/util.h
-+++ b/install/util.h
-@@ -20,6 +20,8 @@
-   along with systemd; If not, see <http://www.gnu.org/licenses/>.
- ***/
- 
-+#define _GNU_SOURCE
-+
- #include <inttypes.h>
- #include <time.h>
- #include <sys/time.h>
-@@ -27,6 +29,7 @@
- #include <stdbool.h>
- #include <stdlib.h>
- #include <stdio.h>
-+#include <string.h>
- #include <signal.h>
- #include <sched.h>
- #include <limits.h>
--- 
-2.4.1
-

diff --git a/sys-kernel/dracut/files/041-0005-base-dracut-lib.sh-remove-bashism.patch b/sys-kernel/dracut/files/041-0005-base-dracut-lib.sh-remove-bashism.patch
deleted file mode 100644
index 47bfdc5e09..0000000000
--- a/sys-kernel/dracut/files/041-0005-base-dracut-lib.sh-remove-bashism.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 7ab0852f24a803ea2c9b0d8e1ce45d13cdd25320 Mon Sep 17 00:00:00 2001
-From: Alexander Tsoy <alexander@tsoy.me>
-Date: Tue, 24 Feb 2015 22:28:24 +0300
-Subject: [PATCH 5/5] base/dracut-lib.sh: remove bashism
-
----
- modules.d/99base/dracut-lib.sh | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
-index 5c1504f..c1a22b6 100755
---- a/modules.d/99base/dracut-lib.sh
-+++ b/modules.d/99base/dracut-lib.sh
-@@ -886,7 +886,9 @@ dev_unit_name()
-     dev="${dev##/}"
-     dev="$(str_replace "$dev" '\' '\x5c')"
-     dev="$(str_replace "$dev" '-' '\x2d')"
--    dev=${dev/#\./\\x2e}
-+    if [ "${dev##.}" != "$dev" ]; then
-+        dev="\x2e${dev##.}"
-+    fi
-     dev="$(str_replace "$dev" '/' '-')"
- 
-     printf -- "%s" "$dev"
--- 
-2.4.1
-

diff --git a/sys-kernel/dracut/files/043-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch b/sys-kernel/dracut/files/043-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch
deleted file mode 100644
index 54d1ef83ab..0000000000
--- a/sys-kernel/dracut/files/043-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7c782700a82e6f8b1cb665075e14eaf9d4f70867 Mon Sep 17 00:00:00 2001
-From: Fabian Deutsch <fabiand@fedoraproject.org>
-Date: Thu, 25 Jun 2015 11:17:59 +0200
-Subject: [PATCH] Revert "lvm: Don't activate LVs with activationskip set"
-
-This reverts commit cfa365a32d47388c8476064b23d7d4684f1e591b.
-
-The logic in commit cfa365a was added to prevent (odl) lvms from
-activating snapshots which should not be activated.
-Newer lvms however do this automatically (not enabling an LV if the
-the 'k' attribute set), thus we can revert the previous commit.
----
- modules.d/90lvm/lvm_scan.sh | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
-index ce46e14..7495644 100755
---- a/modules.d/90lvm/lvm_scan.sh
-+++ b/modules.d/90lvm/lvm_scan.sh
-@@ -106,10 +106,6 @@ if [ -n "$LVS" ] ; then
-     info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
-     lvm lvscan --ignorelockingfailure 2>&1 | vinfo
-     for LV in $LVS; do
--        if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" = "x0" ]; then
--            info "Skipping activation of '$LV' because activationskip is set."
--            continue
--        fi
-         if [ -z "$sysinit" ]; then
-             lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
-         else
--- 
-2.4.5
-

diff --git a/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch b/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch
deleted file mode 100644
index 7f0e62732a..0000000000
--- a/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch
+++ /dev/null
@@ -1,275 +0,0 @@
-From 15f330fe1afe9ac8870461faad55b7d63e791aca Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Tue, 14 Jul 2015 22:22:14 -0400
-Subject: [PATCH 2/3] Replace echo -n with printf in code with a /bin/sh
- shebang
-
-POSIX does not mandate that echo support the -n parameter.
-printf has more well-defined behavior.
----
- modules.d/04watchdog/watchdog-stop.sh      | 2 +-
- modules.d/40network/net-lib.sh             | 2 +-
- modules.d/45ifcfg/write-ifcfg.sh           | 2 +-
- modules.d/90lvm/lvm_scan.sh                | 4 ++--
- modules.d/95fcoe/fcoe-up.sh                | 2 +-
- modules.d/98usrmount/mount-usr.sh          | 2 +-
- modules.d/99base/dracut-lib.sh             | 6 +++---
- modules.d/99base/init.sh                   | 2 +-
- test/TEST-10-RAID/create-root.sh           | 2 +-
- test/TEST-10-RAID/cryptroot-ask.sh         | 2 +-
- test/TEST-12-RAID-DEG/create-root.sh       | 2 +-
- test/TEST-12-RAID-DEG/cryptroot-ask.sh     | 2 +-
- test/TEST-13-ENC-RAID-LVM/create-root.sh   | 2 +-
- test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh | 2 +-
- test/TEST-14-IMSM/cryptroot-ask.sh         | 2 +-
- test/TEST-20-NFS/client-init.sh            | 2 +-
- test/TEST-40-NBD/create-root.sh            | 2 +-
- test/TEST-40-NBD/cryptroot-ask.sh          | 2 +-
- 18 files changed, 21 insertions(+), 21 deletions(-)
-
-diff --git a/modules.d/04watchdog/watchdog-stop.sh b/modules.d/04watchdog/watchdog-stop.sh
-index 91d45d6..921f969 100755
---- a/modules.d/04watchdog/watchdog-stop.sh
-+++ b/modules.d/04watchdog/watchdog-stop.sh
-@@ -1,2 +1,2 @@
- #!/bin/sh
--[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
-+[ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
-diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
-index a09cdaf..6c739e8 100755
---- a/modules.d/40network/net-lib.sh
-+++ b/modules.d/40network/net-lib.sh
-@@ -189,7 +189,7 @@ set_ifname() {
- fix_bootif() {
-     local macaddr=${1}
-     local IFS='-'
--    macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
-+    macaddr=$(printf '%s:' ${macaddr})
-     macaddr=${macaddr%:}
-     # strip hardware type field from pxelinux
-     [ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
-diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
-index fa7db27..251d684 100755
---- a/modules.d/45ifcfg/write-ifcfg.sh
-+++ b/modules.d/45ifcfg/write-ifcfg.sh
-@@ -48,7 +48,7 @@ print_s390() {
-         for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
-             [ -e $i ] || continue
-             channel=$(readlink -f $i)
--            echo -n "${channel##*/},"
-+            printf '%s' "${channel##*/},"
-         done
-     })
-     [ -n "$SUBCHANNELS" ] || return 1
-diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
-index 7495644..ead28aa 100755
---- a/modules.d/90lvm/lvm_scan.sh
-+++ b/modules.d/90lvm/lvm_scan.sh
-@@ -15,14 +15,14 @@ SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
- lvmdevs=$(
-     for f in /tmp/.lvm_scan-*; do
-         [ -e "$f" ] || continue
--        echo -n "${f##/tmp/.lvm_scan-} "
-+        printf '%s' "${f##/tmp/.lvm_scan-} "
-     done
- )
- 
- if [ ! -e /etc/lvm/lvm.conf ]; then
-     {
-         echo 'devices {';
--        echo -n '    filter = [ '
-+        printf '    filter = [ '
-         for dev in $lvmdevs; do
-             printf '"a|^/dev/%s$|", ' $dev;
-         done;
-diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
-index 43a0ad5..950e4b6 100755
---- a/modules.d/95fcoe/fcoe-up.sh
-+++ b/modules.d/95fcoe/fcoe-up.sh
-@@ -64,7 +64,7 @@ elif [ "$netdriver" = "bnx2x" ]; then
-     sleep 3
-     fipvlan "$netif" -c -s
- else
--    echo -n "$netif" > /sys/module/fcoe/parameters/create
-+    printf '%s' "$netif" > /sys/module/fcoe/parameters/create
- fi
- 
- need_shutdown
-diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh
-index c29610f..d1a629c 100755
---- a/modules.d/98usrmount/mount-usr.sh
-+++ b/modules.d/98usrmount/mount-usr.sh
-@@ -12,7 +12,7 @@ filtersubvol() {
-     while [ $# -gt 0 ]; do
-         case $1 in
-             subvol\=*) :;;
--            *) echo -n "${1}," ;;
-+            *) printf '%s' "${1}," ;;
-         esac
-         shift
-     done
-diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
-index 08110cc..7a3c58c 100755
---- a/modules.d/99base/dracut-lib.sh
-+++ b/modules.d/99base/dracut-lib.sh
-@@ -298,7 +298,7 @@ _dogetargs() {
-         fi
-     done
-     if [ -n "$_found" ]; then
--        [ $# -gt 0 ] && echo -n "$@"
-+        [ $# -gt 0 ] && printf '%s' "$*"
-         return 0
-     fi
-     return 1;
-@@ -329,9 +329,9 @@ getargs() {
-     done
-     if [ -n "$_gfound" ]; then
-         if [ $# -gt 0 ]; then
--            echo -n "$@"
-+            printf '%s' "$*"
-         else
--            echo -n 1
-+            printf 1
-         fi
-         debug_on
-         return 0
-diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
-index f96dbb5..a59e8ea 100755
---- a/modules.d/99base/init.sh
-+++ b/modules.d/99base/init.sh
-@@ -253,7 +253,7 @@ while :; do
- done
- 
- {
--    echo -n "Mounted root filesystem "
-+    printf "Mounted root filesystem "
-     while read dev mp rest || [ -n "$dev" ]; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts
- } | vinfo
- 
-diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh
-index a7e56a5..7b5f2a7 100755
---- a/test/TEST-10-RAID/create-root.sh
-+++ b/test/TEST-10-RAID/create-root.sh
-@@ -18,7 +18,7 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /d
- # randomly.
- mdadm -W /dev/md0
- set -e
--echo -n test >keyfile
-+printf test >keyfile
- cryptsetup -q luksFormat /dev/md0 /keyfile
- echo "The passphrase is test"
- cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile
-diff --git a/test/TEST-10-RAID/cryptroot-ask.sh b/test/TEST-10-RAID/cryptroot-ask.sh
-index 407d067..c39eff6 100755
---- a/test/TEST-10-RAID/cryptroot-ask.sh
-+++ b/test/TEST-10-RAID/cryptroot-ask.sh
-@@ -1,5 +1,5 @@
- #!/bin/sh
- 
- [ -b "/dev/mapper/$2" ] && exit 0
--echo -n test >/keyfile
-+printf test >/keyfile
- /sbin/cryptsetup luksOpen "$1" "$2" </keyfile
-diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh
-index 7b9a171..3299aa6 100755
---- a/test/TEST-12-RAID-DEG/create-root.sh
-+++ b/test/TEST-12-RAID-DEG/create-root.sh
-@@ -20,7 +20,7 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sdb /de
- # wait for the array to finish initailizing, otherwise this sometimes fails
- # randomly.
- mdadm -W /dev/md0
--echo -n test >keyfile
-+printf test >keyfile
- cryptsetup -q luksFormat /dev/md0 /keyfile
- echo "The passphrase is test"
- set -e
-diff --git a/test/TEST-12-RAID-DEG/cryptroot-ask.sh b/test/TEST-12-RAID-DEG/cryptroot-ask.sh
-index db27c5b..78ed7f5 100755
---- a/test/TEST-12-RAID-DEG/cryptroot-ask.sh
-+++ b/test/TEST-12-RAID-DEG/cryptroot-ask.sh
-@@ -1,6 +1,6 @@
- #!/bin/sh
- 
- [ -b /dev/mapper/$2 ] && exit 0
--echo -n test >/keyfile
-+printf test >/keyfile
- /sbin/cryptsetup luksOpen $1 $2 </keyfile
- 
-diff --git a/test/TEST-13-ENC-RAID-LVM/create-root.sh b/test/TEST-13-ENC-RAID-LVM/create-root.sh
-index e74fe7f..72bc765 100755
---- a/test/TEST-13-ENC-RAID-LVM/create-root.sh
-+++ b/test/TEST-13-ENC-RAID-LVM/create-root.sh
-@@ -14,7 +14,7 @@ sfdisk /dev/sda <<EOF
- ,25M
- EOF
- udevadm settle
--echo -n test >keyfile
-+printf test >keyfile
- cryptsetup -q luksFormat /dev/sda2 /keyfile
- cryptsetup -q luksFormat /dev/sda3 /keyfile
- cryptsetup -q luksFormat /dev/sda4 /keyfile
-diff --git a/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh b/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
-index db27c5b..78ed7f5 100755
---- a/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
-+++ b/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
-@@ -1,6 +1,6 @@
- #!/bin/sh
- 
- [ -b /dev/mapper/$2 ] && exit 0
--echo -n test >/keyfile
-+printf test >/keyfile
- /sbin/cryptsetup luksOpen $1 $2 </keyfile
- 
-diff --git a/test/TEST-14-IMSM/cryptroot-ask.sh b/test/TEST-14-IMSM/cryptroot-ask.sh
-index db27c5b..78ed7f5 100755
---- a/test/TEST-14-IMSM/cryptroot-ask.sh
-+++ b/test/TEST-14-IMSM/cryptroot-ask.sh
-@@ -1,6 +1,6 @@
- #!/bin/sh
- 
- [ -b /dev/mapper/$2 ] && exit 0
--echo -n test >/keyfile
-+printf test >/keyfile
- /sbin/cryptsetup luksOpen $1 $2 </keyfile
- 
-diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh
-index 2311981..a443289 100755
---- a/test/TEST-20-NFS/client-init.sh
-+++ b/test/TEST-20-NFS/client-init.sh
-@@ -8,7 +8,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; }
- 
- stty sane
- if strstr "$CMDLINE" "rd.shell"; then
--    [ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
-+    [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
- 	strstr "$(setsid --help)" "control" && CTTY="-c"
- 	setsid $CTTY sh -i
- fi
-diff --git a/test/TEST-40-NBD/create-root.sh b/test/TEST-40-NBD/create-root.sh
-index 391279e..20d0eff 100755
---- a/test/TEST-40-NBD/create-root.sh
-+++ b/test/TEST-40-NBD/create-root.sh
-@@ -5,7 +5,7 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
- done
- rm -f -- /etc/lvm/lvm.conf
- udevadm control --reload
--echo -n test >keyfile
-+printf test >keyfile
- cryptsetup -q luksFormat /dev/sdb /keyfile
- echo "The passphrase is test"
- cryptsetup luksOpen /dev/sdb dracut_crypt_test </keyfile && \
-diff --git a/test/TEST-40-NBD/cryptroot-ask.sh b/test/TEST-40-NBD/cryptroot-ask.sh
-index db27c5b..78ed7f5 100755
---- a/test/TEST-40-NBD/cryptroot-ask.sh
-+++ b/test/TEST-40-NBD/cryptroot-ask.sh
-@@ -1,6 +1,6 @@
- #!/bin/sh
- 
- [ -b /dev/mapper/$2 ] && exit 0
--echo -n test >/keyfile
-+printf test >/keyfile
- /sbin/cryptsetup luksOpen $1 $2 </keyfile
- 
--- 
-2.5.0
-

diff --git a/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch b/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch
deleted file mode 100644
index 8be88334cc..0000000000
--- a/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 4e17745f9786bfe21d5419c2e0eeff8c5667e747 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Tue, 14 Jul 2015 11:12:16 -0400
-Subject: [PATCH 3/3] syncheck: Look for 'echo -n' usage in modules
-
----
- Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 0af5d0f..16c6d2a 100644
---- a/Makefile
-+++ b/Makefile
-@@ -211,7 +211,8 @@ syncheck:
-                 [ "$${i##*/}" = "module-setup.sh" ] && continue; \
-                 read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
- 		[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
--		[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
-+		[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
-+		[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
- 	done;exit $$ret
- 	@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
- 	                modules.d/*/module-setup.sh; do \
--- 
-2.5.0
-

diff --git a/sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch b/sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch
deleted file mode 100644
index 23e30e1f70..0000000000
--- a/sys-kernel/dracut/files/043-0004-dracut-initramfs-restore-make-mount-er.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From a18c8fdc9cb3eb917e9a7a30466839c33131cc8a Mon Sep 17 00:00:00 2001
-From: Alexander Tsoy <alexander@tsoy.me>
-Date: Tue, 28 Jul 2015 14:55:59 +0300
-Subject: [PATCH 4/4] dracut-initramfs-restore: make mount error nonfatal
-
-Script enables errexit option (set -e). So if /boot is not a mount point
-or is already mounted, then script dies after unsuccessful mount
-command. Fix this by always returning successful result.
----
- dracut-initramfs-restore.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
-index 0e6a1a8..0c41a59 100644
---- a/dracut-initramfs-restore.sh
-+++ b/dracut-initramfs-restore.sh
-@@ -14,7 +14,7 @@ SKIP="$dracutbasedir/skipcpio"
- 
- [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
- 
--mount -o ro /boot &>/dev/null
-+mount -o ro /boot &>/dev/null || true
- 
- if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
-     IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
--- 
-2.5.0
-


^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/
@ 2015-08-16 10:04 Amadeusz Żołnowski
  0 siblings, 0 replies; 20+ messages in thread
From: Amadeusz Żołnowski @ 2015-08-16 10:04 UTC (permalink / raw
  To: gentoo-commits

commit:     8c578d67d48c971ba1cc438e610b5158eb247d76
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 16 09:58:26 2015 +0000
Commit:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Sun Aug 16 09:58:51 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c578d67

sys-kernel/dracut: Add patches removing non-portable use of `echo -n`

Gentoo-Bug: 554750

Package-Manager: portage-2.2.20.1

 sys-kernel/dracut/dracut-043-r1.ebuild             |   2 +
 ...02-Replace-echo-n-with-printf-in-code-wit.patch | 275 +++++++++++++++++++++
 ...03-syncheck-Look-for-echo-n-usage-in-modu.patch |  26 ++
 3 files changed, 303 insertions(+)

diff --git a/sys-kernel/dracut/dracut-043-r1.ebuild b/sys-kernel/dracut/dracut-043-r1.ebuild
index 6c16464..b713bea 100644
--- a/sys-kernel/dracut/dracut-043-r1.ebuild
+++ b/sys-kernel/dracut/dracut-043-r1.ebuild
@@ -50,6 +50,8 @@ DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
 MY_LIBDIR=/usr/lib
 PATCHES=(
 	"${FILESDIR}/${PV}-0001-Revert-lvm-Don-t-activate-LVs-with-act.patch"
+	"${FILESDIR}/${PV}-0002-Replace-echo-n-with-printf-in-code-wit.patch"
+	"${FILESDIR}/${PV}-0003-syncheck-Look-for-echo-n-usage-in-modu.patch"
 	)
 QA_MULTILIB_PATHS="
 	usr/lib/dracut/dracut-install

diff --git a/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch b/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch
new file mode 100644
index 0000000..7f0e627
--- /dev/null
+++ b/sys-kernel/dracut/files/043-0002-Replace-echo-n-with-printf-in-code-wit.patch
@@ -0,0 +1,275 @@
+From 15f330fe1afe9ac8870461faad55b7d63e791aca Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 14 Jul 2015 22:22:14 -0400
+Subject: [PATCH 2/3] Replace echo -n with printf in code with a /bin/sh
+ shebang
+
+POSIX does not mandate that echo support the -n parameter.
+printf has more well-defined behavior.
+---
+ modules.d/04watchdog/watchdog-stop.sh      | 2 +-
+ modules.d/40network/net-lib.sh             | 2 +-
+ modules.d/45ifcfg/write-ifcfg.sh           | 2 +-
+ modules.d/90lvm/lvm_scan.sh                | 4 ++--
+ modules.d/95fcoe/fcoe-up.sh                | 2 +-
+ modules.d/98usrmount/mount-usr.sh          | 2 +-
+ modules.d/99base/dracut-lib.sh             | 6 +++---
+ modules.d/99base/init.sh                   | 2 +-
+ test/TEST-10-RAID/create-root.sh           | 2 +-
+ test/TEST-10-RAID/cryptroot-ask.sh         | 2 +-
+ test/TEST-12-RAID-DEG/create-root.sh       | 2 +-
+ test/TEST-12-RAID-DEG/cryptroot-ask.sh     | 2 +-
+ test/TEST-13-ENC-RAID-LVM/create-root.sh   | 2 +-
+ test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh | 2 +-
+ test/TEST-14-IMSM/cryptroot-ask.sh         | 2 +-
+ test/TEST-20-NFS/client-init.sh            | 2 +-
+ test/TEST-40-NBD/create-root.sh            | 2 +-
+ test/TEST-40-NBD/cryptroot-ask.sh          | 2 +-
+ 18 files changed, 21 insertions(+), 21 deletions(-)
+
+diff --git a/modules.d/04watchdog/watchdog-stop.sh b/modules.d/04watchdog/watchdog-stop.sh
+index 91d45d6..921f969 100755
+--- a/modules.d/04watchdog/watchdog-stop.sh
++++ b/modules.d/04watchdog/watchdog-stop.sh
+@@ -1,2 +1,2 @@
+ #!/bin/sh
+-[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
++[ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
+diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
+index a09cdaf..6c739e8 100755
+--- a/modules.d/40network/net-lib.sh
++++ b/modules.d/40network/net-lib.sh
+@@ -189,7 +189,7 @@ set_ifname() {
+ fix_bootif() {
+     local macaddr=${1}
+     local IFS='-'
+-    macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
++    macaddr=$(printf '%s:' ${macaddr})
+     macaddr=${macaddr%:}
+     # strip hardware type field from pxelinux
+     [ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
+diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
+index fa7db27..251d684 100755
+--- a/modules.d/45ifcfg/write-ifcfg.sh
++++ b/modules.d/45ifcfg/write-ifcfg.sh
+@@ -48,7 +48,7 @@ print_s390() {
+         for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
+             [ -e $i ] || continue
+             channel=$(readlink -f $i)
+-            echo -n "${channel##*/},"
++            printf '%s' "${channel##*/},"
+         done
+     })
+     [ -n "$SUBCHANNELS" ] || return 1
+diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
+index 7495644..ead28aa 100755
+--- a/modules.d/90lvm/lvm_scan.sh
++++ b/modules.d/90lvm/lvm_scan.sh
+@@ -15,14 +15,14 @@ SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
+ lvmdevs=$(
+     for f in /tmp/.lvm_scan-*; do
+         [ -e "$f" ] || continue
+-        echo -n "${f##/tmp/.lvm_scan-} "
++        printf '%s' "${f##/tmp/.lvm_scan-} "
+     done
+ )
+ 
+ if [ ! -e /etc/lvm/lvm.conf ]; then
+     {
+         echo 'devices {';
+-        echo -n '    filter = [ '
++        printf '    filter = [ '
+         for dev in $lvmdevs; do
+             printf '"a|^/dev/%s$|", ' $dev;
+         done;
+diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
+index 43a0ad5..950e4b6 100755
+--- a/modules.d/95fcoe/fcoe-up.sh
++++ b/modules.d/95fcoe/fcoe-up.sh
+@@ -64,7 +64,7 @@ elif [ "$netdriver" = "bnx2x" ]; then
+     sleep 3
+     fipvlan "$netif" -c -s
+ else
+-    echo -n "$netif" > /sys/module/fcoe/parameters/create
++    printf '%s' "$netif" > /sys/module/fcoe/parameters/create
+ fi
+ 
+ need_shutdown
+diff --git a/modules.d/98usrmount/mount-usr.sh b/modules.d/98usrmount/mount-usr.sh
+index c29610f..d1a629c 100755
+--- a/modules.d/98usrmount/mount-usr.sh
++++ b/modules.d/98usrmount/mount-usr.sh
+@@ -12,7 +12,7 @@ filtersubvol() {
+     while [ $# -gt 0 ]; do
+         case $1 in
+             subvol\=*) :;;
+-            *) echo -n "${1}," ;;
++            *) printf '%s' "${1}," ;;
+         esac
+         shift
+     done
+diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
+index 08110cc..7a3c58c 100755
+--- a/modules.d/99base/dracut-lib.sh
++++ b/modules.d/99base/dracut-lib.sh
+@@ -298,7 +298,7 @@ _dogetargs() {
+         fi
+     done
+     if [ -n "$_found" ]; then
+-        [ $# -gt 0 ] && echo -n "$@"
++        [ $# -gt 0 ] && printf '%s' "$*"
+         return 0
+     fi
+     return 1;
+@@ -329,9 +329,9 @@ getargs() {
+     done
+     if [ -n "$_gfound" ]; then
+         if [ $# -gt 0 ]; then
+-            echo -n "$@"
++            printf '%s' "$*"
+         else
+-            echo -n 1
++            printf 1
+         fi
+         debug_on
+         return 0
+diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
+index f96dbb5..a59e8ea 100755
+--- a/modules.d/99base/init.sh
++++ b/modules.d/99base/init.sh
+@@ -253,7 +253,7 @@ while :; do
+ done
+ 
+ {
+-    echo -n "Mounted root filesystem "
++    printf "Mounted root filesystem "
+     while read dev mp rest || [ -n "$dev" ]; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts
+ } | vinfo
+ 
+diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh
+index a7e56a5..7b5f2a7 100755
+--- a/test/TEST-10-RAID/create-root.sh
++++ b/test/TEST-10-RAID/create-root.sh
+@@ -18,7 +18,7 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /d
+ # randomly.
+ mdadm -W /dev/md0
+ set -e
+-echo -n test >keyfile
++printf test >keyfile
+ cryptsetup -q luksFormat /dev/md0 /keyfile
+ echo "The passphrase is test"
+ cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile
+diff --git a/test/TEST-10-RAID/cryptroot-ask.sh b/test/TEST-10-RAID/cryptroot-ask.sh
+index 407d067..c39eff6 100755
+--- a/test/TEST-10-RAID/cryptroot-ask.sh
++++ b/test/TEST-10-RAID/cryptroot-ask.sh
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+ [ -b "/dev/mapper/$2" ] && exit 0
+-echo -n test >/keyfile
++printf test >/keyfile
+ /sbin/cryptsetup luksOpen "$1" "$2" </keyfile
+diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh
+index 7b9a171..3299aa6 100755
+--- a/test/TEST-12-RAID-DEG/create-root.sh
++++ b/test/TEST-12-RAID-DEG/create-root.sh
+@@ -20,7 +20,7 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sdb /de
+ # wait for the array to finish initailizing, otherwise this sometimes fails
+ # randomly.
+ mdadm -W /dev/md0
+-echo -n test >keyfile
++printf test >keyfile
+ cryptsetup -q luksFormat /dev/md0 /keyfile
+ echo "The passphrase is test"
+ set -e
+diff --git a/test/TEST-12-RAID-DEG/cryptroot-ask.sh b/test/TEST-12-RAID-DEG/cryptroot-ask.sh
+index db27c5b..78ed7f5 100755
+--- a/test/TEST-12-RAID-DEG/cryptroot-ask.sh
++++ b/test/TEST-12-RAID-DEG/cryptroot-ask.sh
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+ [ -b /dev/mapper/$2 ] && exit 0
+-echo -n test >/keyfile
++printf test >/keyfile
+ /sbin/cryptsetup luksOpen $1 $2 </keyfile
+ 
+diff --git a/test/TEST-13-ENC-RAID-LVM/create-root.sh b/test/TEST-13-ENC-RAID-LVM/create-root.sh
+index e74fe7f..72bc765 100755
+--- a/test/TEST-13-ENC-RAID-LVM/create-root.sh
++++ b/test/TEST-13-ENC-RAID-LVM/create-root.sh
+@@ -14,7 +14,7 @@ sfdisk /dev/sda <<EOF
+ ,25M
+ EOF
+ udevadm settle
+-echo -n test >keyfile
++printf test >keyfile
+ cryptsetup -q luksFormat /dev/sda2 /keyfile
+ cryptsetup -q luksFormat /dev/sda3 /keyfile
+ cryptsetup -q luksFormat /dev/sda4 /keyfile
+diff --git a/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh b/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
+index db27c5b..78ed7f5 100755
+--- a/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
++++ b/test/TEST-13-ENC-RAID-LVM/cryptroot-ask.sh
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+ [ -b /dev/mapper/$2 ] && exit 0
+-echo -n test >/keyfile
++printf test >/keyfile
+ /sbin/cryptsetup luksOpen $1 $2 </keyfile
+ 
+diff --git a/test/TEST-14-IMSM/cryptroot-ask.sh b/test/TEST-14-IMSM/cryptroot-ask.sh
+index db27c5b..78ed7f5 100755
+--- a/test/TEST-14-IMSM/cryptroot-ask.sh
++++ b/test/TEST-14-IMSM/cryptroot-ask.sh
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+ [ -b /dev/mapper/$2 ] && exit 0
+-echo -n test >/keyfile
++printf test >/keyfile
+ /sbin/cryptsetup luksOpen $1 $2 </keyfile
+ 
+diff --git a/test/TEST-20-NFS/client-init.sh b/test/TEST-20-NFS/client-init.sh
+index 2311981..a443289 100755
+--- a/test/TEST-20-NFS/client-init.sh
++++ b/test/TEST-20-NFS/client-init.sh
+@@ -8,7 +8,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; }
+ 
+ stty sane
+ if strstr "$CMDLINE" "rd.shell"; then
+-    [ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
++    [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
+ 	strstr "$(setsid --help)" "control" && CTTY="-c"
+ 	setsid $CTTY sh -i
+ fi
+diff --git a/test/TEST-40-NBD/create-root.sh b/test/TEST-40-NBD/create-root.sh
+index 391279e..20d0eff 100755
+--- a/test/TEST-40-NBD/create-root.sh
++++ b/test/TEST-40-NBD/create-root.sh
+@@ -5,7 +5,7 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
+ done
+ rm -f -- /etc/lvm/lvm.conf
+ udevadm control --reload
+-echo -n test >keyfile
++printf test >keyfile
+ cryptsetup -q luksFormat /dev/sdb /keyfile
+ echo "The passphrase is test"
+ cryptsetup luksOpen /dev/sdb dracut_crypt_test </keyfile && \
+diff --git a/test/TEST-40-NBD/cryptroot-ask.sh b/test/TEST-40-NBD/cryptroot-ask.sh
+index db27c5b..78ed7f5 100755
+--- a/test/TEST-40-NBD/cryptroot-ask.sh
++++ b/test/TEST-40-NBD/cryptroot-ask.sh
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+ [ -b /dev/mapper/$2 ] && exit 0
+-echo -n test >/keyfile
++printf test >/keyfile
+ /sbin/cryptsetup luksOpen $1 $2 </keyfile
+ 
+-- 
+2.5.0
+

diff --git a/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch b/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch
new file mode 100644
index 0000000..8be8833
--- /dev/null
+++ b/sys-kernel/dracut/files/043-0003-syncheck-Look-for-echo-n-usage-in-modu.patch
@@ -0,0 +1,26 @@
+From 4e17745f9786bfe21d5419c2e0eeff8c5667e747 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Tue, 14 Jul 2015 11:12:16 -0400
+Subject: [PATCH 3/3] syncheck: Look for 'echo -n' usage in modules
+
+---
+ Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0af5d0f..16c6d2a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -211,7 +211,8 @@ syncheck:
+                 [ "$${i##*/}" = "module-setup.sh" ] && continue; \
+                 read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
+ 		[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
+-		[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
++		[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
++		[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
+ 	done;exit $$ret
+ 	@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
+ 	                modules.d/*/module-setup.sh; do \
+-- 
+2.5.0
+


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-09-30  9:09 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 18:39 [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/files/, sys-kernel/dracut/ Mike Gilbert
  -- strict thread matches above, loose matches on Subject: below --
2024-09-30  9:09 Andrew Ammerlaan
2023-12-13  9:19 Andrew Ammerlaan
2023-09-22  6:10 Andrew Ammerlaan
2023-07-20  3:39 Sam James
2023-05-26 20:03 Mike Gilbert
2022-12-25  2:53 Mike Gilbert
2021-12-27 16:51 Mike Gilbert
2021-09-06  0:14 Mike Gilbert
2021-08-17 17:24 Mike Gilbert
2021-07-23 19:16 Mike Gilbert
2021-06-14 18:42 Mike Gilbert
2020-07-03 11:18 Thomas Deutschmann
2020-03-10 19:50 Mike Gilbert
2019-12-29 19:39 Mike Gilbert
2019-01-21 14:23 Mike Gilbert
2018-03-24 18:03 Mike Gilbert
2017-02-09 18:47 Patrick McLean
2017-02-09 18:47 Patrick McLean
2015-08-16 10:04 Amadeusz Żołnowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox