import dracut-049-135.git20210121.el8

This commit is contained in:
CentOS Sources 2021-03-30 09:58:18 -04:00 committed by Stepan Oksanichenko
parent 0b1b54b0d5
commit d8122cb38a
48 changed files with 2664 additions and 2 deletions

View File

@ -31,3 +31,4 @@ index 902df8d8..77c18452 100755
+else +else
+ exec ifup "$DEVICE" + exec ifup "$DEVICE"
+fi +fi

25
SOURCES/0089.patch Normal file
View File

@ -0,0 +1,25 @@
From 6c0071bc72dbbdd2a958277618a9b2c64c6ee460 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 2 Jul 2020 14:33:20 +0200
Subject: [PATCH] spec: don't use NM on existing installations
Resolves: #1839706
---
dracut.spec | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut.spec b/dracut.spec
index c82c24f6..a8076c18 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -481,4 +481,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
+%triggerin network -- dracut-network < 049-83.git20200525
+echo '# Since rhel-8.3 dracut moved to use NetworkManager
+# On existing installations we want to preserve the old scripts
+add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf
+
%changelog

79
SOURCES/0090.patch Normal file
View File

@ -0,0 +1,79 @@
From 73242b75af92bc86c26cfbe2954b7ecb9aaaf765 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
(cherry picked from commit c38f9e980c1ee03151dd1c6602907c6228b78d30)
Resolves: #1846343
---
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 88bca1d4..253ae194 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)
@@ -1234,28 +1239,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;

50
SOURCES/0091.patch Normal file
View File

@ -0,0 +1,50 @@
From e4e1ab4e129fa17c5e90a2144e15096b0267c22a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 2 Jul 2020 09:08:03 +0200
Subject: [PATCH] install: also install post weak dependencies of kernel
modules
(cherry picked from commit 6dafdda4a6bdb8721133e4267553c5d86564f9e8)
Resolves: #1846343
---
install/dracut-install.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index 253ae194..51f79422 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -1272,9 +1272,13 @@ static int install_dependent_modules(struct kmod_list *modlist)
ret = install_dependent_modules(modlist);
if (ret == 0) {
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
- if (ret == 0)
- ret = install_dependent_modules(modpre);
- }
+ if (ret == 0) {
+ int r;
+ ret = install_dependent_modules(modpre);
+ r = install_dependent_modules(modpost);
+ ret = ret ? : r;
+ }
+ }
} else {
log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
}
@@ -1335,8 +1339,12 @@ static int install_module(struct kmod_module *mod)
if (ret == 0) {
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
- if (ret == 0)
- ret = install_dependent_modules(modpre);
+ if (ret == 0) {
+ int r;
+ ret = install_dependent_modules(modpre);
+ r = install_dependent_modules(modpost);
+ ret = ret ? : r;
+ }
}
return ret;

55
SOURCES/0092.patch Normal file
View File

@ -0,0 +1,55 @@
From 818746166fec7c1e572ef12618edadc0535d4663 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Tue, 9 Jun 2020 03:03:18 +0800
Subject: [PATCH] dracut.sh: Move the library workaround after squash
Ensure the workaround is also valid when dracut-squash module is used
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit de3cb0e3214c3fbab3a94e705445b4d1c2bf0dff)
Cherry-picked from: de3cb0e3214c3fbab3a94e705445b4d1c2bf0dff
Resolves: #1841077
---
dracut.sh | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 487add57..4c5176a1 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1578,15 +1578,6 @@ if [[ $kernel_only != yes ]]; then
# Now we are done with lazy resolving, always install dependencies
unset DRACUT_RESOLVE_LAZY
export DRACUT_RESOLVE_DEPS=1
-
- # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
- for _dir in $libdirs; do
- for _f in "$_dir/libpthread.so"*; do
- [[ -e "$_f" ]] || continue
- inst_libdir_file "libgcc_s.so*"
- break 2
- done
- done
fi
for ((i=0; i < ${#include_src[@]}; i++)); do
@@ -1840,6 +1831,17 @@ if dracut_module_included "squash"; then
done
fi
+if [[ $kernel_only != yes ]]; then
+ # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
+ for _dir in $libdirs; do
+ for _f in "$dracutsysrootdir$_dir/libpthread.so"*; do
+ [[ -e "$_f" ]] || continue
+ inst_libdir_file "libgcc_s.so*"
+ break 2
+ done
+ done
+fi
+
if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
dinfo "*** Stripping files ***"
find "$initdir" -type f \

43
SOURCES/0093.patch Normal file
View File

@ -0,0 +1,43 @@
From d8c0b10b15940d88a28acbcf93354e4da0babb8d Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 10 Jun 2020 15:57:20 +0800
Subject: [PATCH] dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
On Fedora/RHEL, libcryto will verify both itself and libssl on start, if
libssl is missing, FIPS self test will fail. However libssl is not a
dependency of libcryto so dracut will not install it, unless some other
binary or library pulls it in. Systemd requires libssl, so in most cases
it just worked, but could fail in some corner cases where systemd is not
used.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 5a4c3469338410b6aea9452994b4b0af1ba59be7)
Resolves: #1841077
---
dracut.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 4c5176a1..86e95449 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1840,6 +1840,17 @@ if [[ $kernel_only != yes ]]; then
break 2
done
done
+
+ # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled
+ if [[ $DRACUT_FIPS_MODE ]]; then
+ for _dir in $libdirs; do
+ for _f in "$dracutsysrootdir$_dir/libcrypto.so"*; do
+ [[ -e "$_f" ]] || continue
+ inst_libdir_file -o "libssl.so*"
+ break 2
+ done
+ done
+ fi
fi
if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then

28
SOURCES/0094.patch Normal file
View File

@ -0,0 +1,28 @@
From 41739f232f3f353d45206ceee89ef0bc1c544f31 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 3 Aug 2020 16:51:54 +0800
Subject: [PATCH] 90kernel-modules: add pci_hyperv
Install pci_hyperv for SR-IOV devices on hyperv machines.
(cherry picked from commit f7ad1479f277ddffcc501bd08919a4a4a6facc26)
Resolves: #1854001
---
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 c91ba10c..86852038 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -56,7 +56,7 @@ installkernel() {
instmods \
yenta_socket \
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
- virtio virtio_ring virtio_pci virtio_scsi \
+ virtio virtio_ring virtio_pci virtio_scsi pci_hyperv \
"=drivers/pcmcia"
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then

31
SOURCES/0095.patch Normal file
View File

@ -0,0 +1,31 @@
From 6616132de5ec2991e0b55eca6e9d12e50f7be293 Mon Sep 17 00:00:00 2001
From: Doan Tran Cong Danh <congdanhqx@gmail.com>
Date: Fri, 8 Nov 2019 10:53:41 +0700
Subject: [PATCH] multipath: require kpartx binary
multipath requires kpartx to activate device mapper.
But kpartx is only a recommend dependency.
Check for kpartx's existent first.
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
(cherry picked from commit cf31ed2ae687d9898cafc11ec6e4f478e806ad38)
Resolves: #1888779
---
modules.d/90multipath/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index f825c00c..2b9a3166 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -29,6 +29,7 @@ check() {
# if there's no multipath binary, no go.
require_binaries multipath || return 1
+ require_binaries kpartx || return 1
return 0
}

167
SOURCES/0096.patch Normal file
View File

@ -0,0 +1,167 @@
From 59d51f92475f1b4dc81b1e6f5537f63876952c39 Mon Sep 17 00:00:00 2001
From: Jan Macku <jamacku@redhat.com>
Date: Fri, 8 Nov 2019 16:24:13 +0100
Subject: [PATCH] Replace ln with systemctl
(cherry picked from commit 70b19acf941c0bf41b2c69c761124425910c0653)
Cherry-picked from: 70b19acf941c0bf41b2c69c761124425910c0653
Resolves: #1888779
---
modules.d/00systemd/module-setup.sh | 6 ++----
modules.d/02systemd-networkd/module-setup.sh | 8 ++++----
modules.d/06rngd/module-setup.sh | 5 ++---
modules.d/90multipath/module-setup.sh | 3 +--
modules.d/90stratis/module-setup.sh | 3 +--
modules.d/95iscsi/module-setup.sh | 8 +++-----
modules.d/98dracut-systemd/module-setup.sh | 3 +--
modules.d/99squash/module-setup.sh | 3 +--
8 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index e4a3f323..4ab2a896 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -225,9 +225,7 @@ install() {
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service \
; do
- mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
- ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
- "${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
+ systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
done
mkdir -p "$initdir/etc/systemd"
@@ -239,6 +237,6 @@ install() {
echo "RateLimitBurst=0"
} >> "$initdir/etc/systemd/journald.conf"
- ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
+ systemctl -q --root "$initdir" set-default multi-user.target
}
diff --git a/modules.d/02systemd-networkd/module-setup.sh b/modules.d/02systemd-networkd/module-setup.sh
index b86751ea..8b87923f 100755
--- a/modules.d/02systemd-networkd/module-setup.sh
+++ b/modules.d/02systemd-networkd/module-setup.sh
@@ -61,11 +61,11 @@ install() {
for i in \
systemd-networkd-wait-online.service \
- systemd-networkd.service \
- systemd-networkd.socket
-# systemd-timesyncd.service
+ systemd-networkd.service \
+ systemd-networkd.socket
+# systemd-timesyncd.service
do
- systemctl --root "$initdir" enable "$i"
+ systemctl -q --root "$initdir" enable "$i"
done
}
diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh
index 43d5c2d3..354bd0bb 100644
--- a/modules.d/06rngd/module-setup.sh
+++ b/modules.d/06rngd/module-setup.sh
@@ -33,7 +33,6 @@ check() {
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"
+
+ systemctl -q --root "$initdir" add-wants sysinit.target rngd.service
}
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 2b9a3166..8a032c86 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -110,8 +110,7 @@ install() {
if dracut_module_included "systemd"; then
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
- mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
- ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
+ systemctl -q --root "$initdir" enable multipathd.service
else
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
diff --git a/modules.d/90stratis/module-setup.sh b/modules.d/90stratis/module-setup.sh
index 29f0765b..943f572e 100755
--- a/modules.d/90stratis/module-setup.sh
+++ b/modules.d/90stratis/module-setup.sh
@@ -24,8 +24,7 @@ install() {
if dracut_module_included "systemd"; then
inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service"
- mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
- ln -rfs "${initdir}${systemdsystemunitdir}/stratisd-init.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/stratisd-init.service"
+ systemctl -q --root "$initdir" enable stratisd-init.service
else
inst_hook cmdline 25 "$moddir/stratisd-start.sh"
inst_hook cleanup 25 "$moddir/stratisd-stop.sh"
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index f6f3520d..47a92e94 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -242,20 +242,18 @@ install() {
$systemdsystemunitdir/iscsiuio.socket \
iscsiadm iscsid
- mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants"
for i in \
iscsid.socket \
iscsiuio.socket \
; do
- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}"
+ systemctl -q --root "$initdir" enable "$i"
done
-
- mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants"
+
for i in \
iscsid.service \
iscsiuio.service \
; do
- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}"
+ systemctl -q --root "$initdir" add-wants basic.target "$i"
done
# Make sure iscsid is started after dracut-cmdline and ready for the initqueue
diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh
index 900162c3..1387433a 100755
--- a/modules.d/98dracut-systemd/module-setup.sh
+++ b/modules.d/98dracut-systemd/module-setup.sh
@@ -43,7 +43,6 @@ install() {
inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator
- mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
for i in \
dracut-cmdline.service \
dracut-cmdline-ask.service \
@@ -55,7 +54,7 @@ install() {
dracut-pre-udev.service \
; do
inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
+ systemctl -q --root "$initdir" add-wants initrd.target "$i"
done
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index e7e9ed8e..7aa0b447 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -25,6 +25,5 @@ install() {
inst $moddir/init.sh /squash/init.sh
inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service"
- mkdir -p "$initdir$systemdsystemunitdir/initrd-switch-root.target.wants"
- ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd-switch-root.target.wants/squash-mnt-clear.service"
+ systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service
}

104
SOURCES/0097.patch Normal file
View File

@ -0,0 +1,104 @@
From 603f33e28cfad45c4bf9ade8e3ff3b9014b5bd4d Mon Sep 17 00:00:00 2001
From: Ben Howard <ben.howard@redhat.com>
Date: Fri, 3 Apr 2020 13:32:44 -0600
Subject: [PATCH] multipath: add automatic configuration for multipath
Add support for 'rd.multipath=default' for using the default
configuration on boot. The intended purpose for this is to help support
ostree-based image boots from multipathed devices (such as Fedora and
Red Hat CoreOS).
(cherry picked from commit b8a92b715677d52dbc2b27a710b9816fd8b9a63b)
Resolves: #1888779
---
dracut.cmdline.7.asc | 3 +++
modules.d/90multipath/module-setup.sh | 7 +++++--
modules.d/90multipath/multipathd-configure.service | 19 +++++++++++++++++++
modules.d/90multipath/multipathd.sh | 5 +++++
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 4a7c2517..19b5cc87 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -406,6 +406,9 @@ MULTIPATH
**rd.multipath=0**::
disable multipath detection
+**rd.multipath=default**::
+ use default multipath settings
+
FIPS
~~~~
**rd.fips**::
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 8a032c86..a7f250f3 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -83,11 +83,12 @@ install() {
dmsetup \
kpartx \
mpath_wait \
+ mpathconf \
+ mpathpersist \
multipath \
multipathd \
- mpathpersist \
- xdrgetuid \
xdrgetprio \
+ xdrgetuid \
/etc/xdrdevices.conf \
/etc/multipath.conf \
/etc/multipath/* \
@@ -109,7 +110,9 @@ install() {
fi
if dracut_module_included "systemd"; then
+ inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service"
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
+ systemctl -q --root "$initdir" enable multipathd-configure.service
systemctl -q --root "$initdir" enable multipathd.service
else
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
diff --git a/modules.d/90multipath/multipathd-configure.service b/modules.d/90multipath/multipathd-configure.service
new file mode 100644
index 00000000..de690615
--- /dev/null
+++ b/modules.d/90multipath/multipathd-configure.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Device-Mapper Multipath Default Configuration
+Before=iscsi.service iscsid.service lvm2-activation-early.service
+Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target
+After=systemd-udev-trigger.service systemd-udev-settle.service
+Before=local-fs-pre.target multipathd.service
+DefaultDependencies=no
+Conflicts=shutdown.target
+
+ConditionKernelCommandLine=rd.multipath=default
+ConditionPathExists=!/etc/multipath.conf
+
+[Service]
+Type=oneshot
+ExecStartPre=-/usr/bin/mkdir -p /etc/multipath/multipath.conf.d
+ExecStart=/usr/sbin/mpathconf --enable
+
+[Install]
+WantedBy=sysinit.target
diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh
index 2c2dcc85..936c5dc7 100755
--- a/modules.d/90multipath/multipathd.sh
+++ b/modules.d/90multipath/multipathd.sh
@@ -1,5 +1,10 @@
#!/bin/sh
+if [ "$(getarg rd.multipath)x" == "default" ] && [ ! -e /etc/multipath.conf ]; then
+ mkdir -p /etc/multipath/multipath.conf.d
+ mpathconf --enable
+fi
+
if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then
modprobe dm-multipath
multipathd -B || multipathd

66
SOURCES/0098.patch Normal file
View File

@ -0,0 +1,66 @@
From 1e7a27bd5f463409392d34816a10bf108ee896c6 Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Fri, 9 Oct 2020 19:44:35 -0400
Subject: [PATCH] 98dracut-systemd: don't wait for root device if remote
cryptsetup active
This is a plain and simple hack around dependency issues between dracut
and systemd.
When using Tang-pinned LUKS root devices, we want to rely on
`systemd-cryptsetup@.service` to unlock it. However, that service only
runs `After=remote-fs-pre.target`, while `dracut-initqueue.service` has
`Before=remote-fs-pre.target` (which makes sense because we don't want
to attempt networked root devices before networking is up).
However, the rootfs-generator here wants to make sure that the root
device exists *before* exiting the initqueue via an initqueue/finished
"devexists" hook. This will never work though because by design
`systemd-cryptsetup@.service`, which unlocks the root device, won't run
until after we exit.
So we have a dependency cycle:
initqueue -> devexists hook -> root device ->
systemd-cryptsetup@.service -> remote-fs-pre.target -> initqueue
There's no clean way to break this. The root issue is that there's no
way right now to split sequencing of systemd services across the
initqueue/online and initqueue/finished events because it's all bundled
in a single service. (The deeper root issue of course is that we have
two init systems. :) ).
Here we do a tactical fix: if there's a `systemd-cryptsetup@.service`
instance, let's assume it's for the root device and skip waiting for it
to show up if it depends on `remote-fs-pre.target`.
(cherry picked from commit 512c51d2677dd1637cc203e3676fefb50a3d73d0)
Resolves: #1897384
---
modules.d/98dracut-systemd/rootfs-generator.sh | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/rootfs-generator.sh b/modules.d/98dracut-systemd/rootfs-generator.sh
index 4ae693bb..bb376c0f 100755
--- a/modules.d/98dracut-systemd/rootfs-generator.sh
+++ b/modules.d/98dracut-systemd/rootfs-generator.sh
@@ -13,8 +13,15 @@ generator_wait_for_dev()
if ! [ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ]; then
- printf '[ -e "%s" ]\n' $1 \
- >> "$hookdir/initqueue/finished/devexists-${_name}.sh"
+ # If a LUKS device needs unlocking via systemd in the initrd, assume
+ # it's for the root device. In that case, don't block on it if it's
+ # after remote-fs-pre.target since the initqueue is ordered before it so
+ # it will never actually show up (think Tang-pinned rootfs).
+ cat > "$hookdir/initqueue/finished/devexists-${_name}.sh" << EOF
+if ! grep -q After=remote-fs-pre.target /run/systemd/generator/systemd-cryptsetup@*.service 2>/dev/null; then
+ [ -e "$1" ]
+fi
+EOF
{
printf '[ -e "%s" ] || ' $1
printf 'warn "\"%s\" does not exist"\n' $1

43
SOURCES/0099.patch Normal file
View File

@ -0,0 +1,43 @@
From aa4cf6df94dd3a858144040138d970a57c701a8d Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Thu, 12 Nov 2020 11:27:39 -0500
Subject: [PATCH] 90crypt: pull in remote-cryptsetup.target enablement
This should've been part of #964. As mentioned there, the
`initrd-cryptsetup.target` approach was reverted in the end, and we went
back to relying in `remote-cryptsetup.target`:
https://github.com/systemd/systemd/pull/17467
So we do need to ship the enablement symlink for it.
(cherry picked from commit a23a4680e7d04d1016e9d5e4b53b1e65f1ca98aa)
Resolves: #1897384
---
modules.d/90crypt/module-setup.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 1ec59096..a26b6dff 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -120,6 +120,8 @@ install() {
inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
if dracut_module_included "systemd"; then
+ # the cryptsetup targets are already pulled in by 00systemd, but not
+ # the enablement symlinks
inst_multiple -o \
$systemdutildir/system-generators/systemd-cryptsetup-generator \
$systemdutildir/systemd-cryptsetup \
@@ -127,6 +129,8 @@ install() {
$systemdsystemunitdir/systemd-ask-password-console.service \
$systemdsystemunitdir/cryptsetup.target \
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
+ $systemdsystemunitdir/remote-cryptsetup.target \
+ $systemdsystemunitdir/initrd-root-device.target.wants/remote-cryptsetup.target \
systemd-ask-password systemd-tty-ask-password-agent
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
fi

33
SOURCES/0100.patch Normal file
View File

@ -0,0 +1,33 @@
From 045aa82701ecdebf8482b25dc0abf1b3b7cc3ce5 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 30 Nov 2020 11:04:42 +0100
Subject: [PATCH] fix backport of 70b19acf
The patch was missing an important hunk of the original diff which
converted another `ln_r` to `systemctl set-default`. Without it, the
initrd would try to boot `multi-user.target` instead of `initrd.target`.
The reason is that `systemctl set-default` modifies `/etc` while `ln_r`
modifies `/usr`. And so the `set-default multi-user.target` in 00systemd
takes priority over the `ln_r initrd.target` in `01systemd-initrd`.
Thanks Jonathan Lebon for spotting this.
Resolves: #1888779
---
modules.d/01systemd-initrd/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh
index cb8a8fa6..a42e220a 100755
--- a/modules.d/01systemd-initrd/module-setup.sh
+++ b/modules.d/01systemd-initrd/module-setup.sh
@@ -36,7 +36,7 @@ install() {
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
$systemdsystemunitdir/initrd-parse-etc.service
- ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
+ systemctl -q --root "$initdir" set-default initrd.target
local VERSION=""
local PRETTY_NAME=""

29
SOURCES/0101.patch Normal file
View File

@ -0,0 +1,29 @@
From 08ef5f0da71b84f606c2a75bd0574b206b997fc3 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 27 Nov 2020 09:32:20 +0100
Subject: [PATCH] multipathd: fix the comparison
From shellcheck:
/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2039]: In POSIX sh, == in place of = is undefined.
/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2193]: The arguments to this comparison can never be equal.
(cherry picked from commit 7c2521091f30d7c14caaf96850208afa2fe1d811)
Resolves: #1888779
---
modules.d/90multipath/multipathd.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh
index 936c5dc7..b0183ffe 100755
--- a/modules.d/90multipath/multipathd.sh
+++ b/modules.d/90multipath/multipathd.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-if [ "$(getarg rd.multipath)x" == "default" ] && [ ! -e /etc/multipath.conf ]; then
+if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then
mkdir -p /etc/multipath/multipath.conf.d
mpathconf --enable
fi

25
SOURCES/0102.patch Normal file
View File

@ -0,0 +1,25 @@
From ab6377eebef8e811dd3fd6d43e2af14dbada75d9 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 15 Dec 2020 14:04:24 +0100
Subject: [PATCH] dracut-systemd: create the initrd.target.wants directory
kexec-tools depends on the existence of this directory in RHEL8
Resolves: #1888779
---
modules.d/98dracut-systemd/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh
index 1387433a..9a0f476c 100755
--- a/modules.d/98dracut-systemd/module-setup.sh
+++ b/modules.d/98dracut-systemd/module-setup.sh
@@ -43,6 +43,7 @@ install() {
inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator
+ mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
for i in \
dracut-cmdline.service \
dracut-cmdline-ask.service \

26
SOURCES/0103.patch Normal file
View File

@ -0,0 +1,26 @@
From b0e5702c64f83449d62e83d70d0bb806c6abdc9a Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 4 Aug 2020 14:16:19 +0200
Subject: [PATCH] match the whole string
(cherry picked from commit ae83919a7a07b5c90cae8ce8b1349efc212a7aee)
Resolves: #1552619
---
modules.d/95zfcp/parse-zfcp.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh
index 6e1514fd..fb4d9c9e 100755
--- a/modules.d/95zfcp/parse-zfcp.sh
+++ b/modules.d/95zfcp/parse-zfcp.sh
@@ -3,7 +3,7 @@
getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
- echo $zfcp_arg | grep '0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}' >/dev/null
+ echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}$' >/dev/null
test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format."
(
IFS=","

29
SOURCES/0104.patch Normal file
View File

@ -0,0 +1,29 @@
From b76aac712f822e75951b10f516c99c573b89e4fe Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 4 Aug 2020 14:18:54 +0200
Subject: [PATCH] match simplified rd.zfcp format too
The simplified format was introduced by commit
c8aa1d949aecaf146b0a0e1ce269f69e6048dc5a .
(cherry picked from commit d9e27b091717a1ce1c58cc911d9d7b5ec3ed901e)
Resolves: #1552619
---
modules.d/95zfcp/parse-zfcp.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh
index fb4d9c9e..5aa6add8 100755
--- a/modules.d/95zfcp/parse-zfcp.sh
+++ b/modules.d/95zfcp/parse-zfcp.sh
@@ -3,7 +3,7 @@
getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
- echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}$' >/dev/null
+ echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\}\(,0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}\)\?$' >/dev/null
test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format."
(
IFS=","

25
SOURCES/0105.patch Normal file
View File

@ -0,0 +1,25 @@
From 27921953a7508209deece59d74e5a957a247278d Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Fri, 20 Nov 2020 10:33:56 +0100
Subject: [PATCH] base: hardcode rhel red
RHEL-only
Resolves: #1650258
---
modules.d/99base/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 3578643c..d10aa6a2 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -74,7 +74,7 @@ install() {
VERSION+="dracut-$DRACUT_VERSION"
PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)"
VERSION_ID=$DRACUT_VERSION
- ANSI_COLOR="0;34"
+ ANSI_COLOR="0;31"
[ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib
{

30
SOURCES/0106.patch Normal file
View File

@ -0,0 +1,30 @@
From dc6438116746147e55c624a58116cc7f9f254c8a Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 7 Feb 2019 16:09:43 +0100
Subject: [PATCH] 95iscsi:
/sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not
exist
cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 90: [: -eq: unary operator expected
(cherry picked from commit 94eccd15c533f9e10cb0ccdec7e8a42c29bbc8d0)
Resolves: #1552619
---
modules.d/95iscsi/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 47a92e94..dc63ef46 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -86,6 +86,7 @@ install_iscsiroot() {
iscsi_host=${host##*/}
for flash in ${host}/flashnode_sess-* ; do
+ [ ! -e "$flash/is_boot_target" ] && continue
is_boot=$(cat $flash/is_boot_target)
if [ $is_boot -eq 1 ] ; then
# qla4xxx flashnode session; skip iBFT discovery

32
SOURCES/0107.patch Normal file
View File

@ -0,0 +1,32 @@
From ba1a065c528bd5774c61a3c286e9a7ed7cc467e8 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Thu, 21 Mar 2019 14:40:33 +0100
Subject: [PATCH] iscsi: fix error messages with iSCSI root
Fixes these error messages during intird build:
cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
(cherry picked from commit 78efd6988ec6b39ea80ba8e432d7df1abe1c081f)
Resolves: #1552619
---
modules.d/95iscsi/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index dc63ef46..618d1dc2 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -86,6 +86,7 @@ install_iscsiroot() {
iscsi_host=${host##*/}
for flash in ${host}/flashnode_sess-* ; do
+ [ -f "$flash" ] || continue
[ ! -e "$flash/is_boot_target" ] && continue
is_boot=$(cat $flash/is_boot_target)
if [ $is_boot -eq 1 ] ; then

225
SOURCES/0108.patch Normal file
View File

@ -0,0 +1,225 @@
From 0954a69e884e99af5082f93e2de30fa8dfdba83e Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.com>
Date: Mon, 25 Nov 2019 11:33:42 +0100
Subject: [PATCH] 95nvmf: add module for NVMe-oF
Add a module for booting from NVMe-oF devices.
Signed-off-by: Hannes Reinecke <hare@suse.de>
(cherry picked from commit 2f03d69f9dfdc0c905c4d9cb69ee93a5256123cb)
Resolves: #1731601
---
dracut.spec | 1 +
modules.d/95nvmf/module-setup.sh | 88 +++++++++++++++++++++++
modules.d/95nvmf/parse-nvmf-boot-connections.sh | 95 +++++++++++++++++++++++++
3 files changed, 184 insertions(+)
diff --git a/dracut.spec b/dracut.spec
index a8076c18..3db5c0cf 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -370,6 +370,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95lunmask
+%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh
new file mode 100755
index 00000000..db43ec01
--- /dev/null
+++ b/modules.d/95nvmf/module-setup.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ require_binaries nvme || return 1
+ [ -f /etc/nvme/hostnqn ] || return 255
+ [ -f /etc/nvme/hostid ] || return 255
+
+ is_nvme_fc() {
+ local _dev=$1
+ local traddr
+
+ [[ -L "/sys/dev/block/$_dev" ]] || return 0
+ cd -P "/sys/dev/block/$_dev" || return 0
+ if [ -f partition ] ; then
+ cd ..
+ fi
+ for d in device/nvme* ; do
+ [ -L "$d" ] || continue
+ if readlink "$d" | grep -q nvme-fabrics ; then
+ traddr=$(cat "$d"/address)
+ break
+ fi
+ done
+ [[ "${traddr#traddr=nn-}" != "$traddr" ]]
+ }
+
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ pushd . >/dev/null
+ for_each_host_dev_and_slaves is_nvme_fc
+ local _is_nvme_fc=$?
+ popd >/dev/null
+ [[ $_is_nvme_fc == 0 ]] || return 255
+ if [ ! -f /sys/class/fc/fc_udev_device/nvme_discovery ] ; then
+ if [ ! -f /etc/nvme/discovery.conf ] ; then
+ echo "No discovery arguments present"
+ return 255
+ fi
+ fi
+ }
+ return 0
+}
+
+# called by dracut
+depends() {
+ echo bash rootfs-block
+ return 0
+}
+
+# called by dracut
+installkernel() {
+ instmods nvme_fc lpfc qla2xxx
+}
+
+# called by dracut
+cmdline() {
+ local _hostnqn
+ local _hostid
+ if [ -f /etc/nvme/hostnqn ] ; then
+ _hostnqn=$(cat /etc/nvme/hostnqn)
+ echo -n " nvmf.hostnqn=${_hostnqn}"
+ fi
+ if [ -f /etc/nvme/hostid ] ; then
+ _hostid=$(cat /etc/nvme/hostid)
+ echo -n " nvmf.hostid=${_hostid}"
+ fi
+ echo ""
+}
+
+# called by dracut
+install() {
+ if [[ $hostonly_cmdline == "yes" ]]; then
+ local _nvmf_args=$(cmdline)
+ [[ "$_nvmf_args" ]] && printf "%s" "$_nvmf_args" >> "${initdir}/etc/cmdline.d/95nvmf-args.conf"
+ fi
+ inst_simple "/etc/nvme/hostnqn"
+ inst_simple "/etc/nvme/hostid"
+
+ inst_multiple nvme
+ inst_multiple -o \
+ "$systemdsystemunitdir/nvm*-connect@.service" \
+ "$systemdsystemunitdir/nvm*-connect.target"
+ inst_hook cmdline 99 "$moddir/parse-nvmf-boot-connections.sh"
+ inst_simple "/etc/nvme/discovery.conf"
+ inst_rules /usr/lib/udev/rules.d/70-nvm*-autoconnect.rules
+ inst_rules /usr/lib/udev/rules.d/71-nvmf-iopolicy-netapp.rules
+ dracut_need_initqueue
+}
diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
new file mode 100755
index 00000000..0d16b871
--- /dev/null
+++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+#
+# Supported formats:
+# nvmf.hostnqn=<hostnqn>
+# nvmf.hostid=<hostid>
+# nvmf.discover=<transport>:<traddr>:<host-traddr>:<trsvcid>
+#
+# Examples:
+# nvmf.hostnqn=nqn.2014-08.org.nvmexpress:uuid:37303738-3034-584d-5137-333230423843
+# nvmf.discover=rdma:192.168.1.3::4420
+# nvmf.discover=fc:auto
+#
+# Note: FC does autodiscovery, so typically there is no need to
+# specify any discover parameters for FC.
+#
+
+parse_nvmf_discover() {
+ OLDIFS="$IFS"
+ IFS=:
+ trtype="none"
+ traddr="none"
+ hosttraddr="none"
+ trsvcid=4420
+
+ set $1
+ IFS="$OLDIFS"
+
+ case $# in
+ 2)
+ trtype=$1
+ traddr=$2
+ ;;
+ 3)
+ trtype=$1
+ traddr=$2
+ hosttraddr=$3
+ ;;
+ 4)
+ trtype=$1
+ traddr=$2
+ hosttraddr=$3
+ trsvcid=$4
+ ;;
+ *)
+ warn "Invalid arguments for nvmf.discover=$1"
+ return 1
+ ;;
+ esac
+ if [ -z "$traddr" ] ; then
+ warn "traddr is mandatory for $trtype"
+ return 1;
+ fi
+ [ -z "$hosttraddr" ] && hosttraddr="none"
+ [ -z "$trsvcid" ] && trsvcid="none"
+ if [ "$trtype" = "fc" ] ; then
+ if [ -z "$hosttraddr" ] ; then
+ warn "host traddr is mandatory for fc"
+ return 1
+ fi
+ elif [ "$trtype" != "rdma" ] && [ "$trtype" != "tcp" ] ; then
+ warn "unsupported transport $trtype"
+ return 1
+ elif [ -z "$trsvcid" ] ; then
+ trsvcid=4420
+ fi
+ echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr --trsvcid=$trsvcid" >> /etc/nvme/discovery.conf
+}
+
+if ! getargbool 0 rd.nonvmf ; then
+ info "rd.nonvmf=0: skipping nvmf"
+ return 0
+fi
+
+nvmf_hostnqn=$(getarg nvmf.hostnqn=)
+if [ -n "$nvmf_hostnqn" ] ; then
+ echo "$nvmf_hostnqn" > /etc/nvme/hostnqn
+fi
+nvmf_hostid=$(getarg nvmf.hostid=)
+if [ -n "$nvmf_hostid" ] ; then
+ echo "$nvmf_hostid" > /etc/nvme/hostid
+fi
+
+for d in $(getargs nvmf.discover=); do
+ parse_nvmf_discover "$d"
+done
+
+# Host NQN and host id are mandatory for NVMe-oF
+[ -f "/etc/nvme/hostnqn" ] || exit 0
+[ -f "/etc/nvme/hostid" ] || exit 0
+
+if [ -f "/etc/nvme/discovery.conf" ] ; then
+ /sbin/initqueue --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
+else
+ /sbin/initqueue --finished --unique --name nvme-fc-autoconnect echo 1 > /sys/class/fc/fc_udev_device/nvme_discovery
+fi

26
SOURCES/0109.patch Normal file
View File

@ -0,0 +1,26 @@
From 605b45361ff9336bb9ac2526b5f7d50e7e33e99f Mon Sep 17 00:00:00 2001
From: Jan Macku <jamacku@redhat.com>
Date: Fri, 1 Nov 2019 14:58:56 +0100
Subject: [PATCH] Write dns values passed by ip argument to ifcfg-* files
(cherry picked from commit cb86c560b0da465e06c18df12308cb3f30fa4803)
Resolves: #1767100
---
modules.d/45ifcfg/write-ifcfg.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 3bf847a5..abd111fc 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -270,7 +270,7 @@ for netup in /tmp/net.*.did-setup ; do
done
fi
i=1
- for ns in $(getargs nameserver); do
+ for ns in $(getargs nameserver) $dns1 $dns2; do
echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
i=$((i+1))
done

39
SOURCES/0110.patch Normal file
View File

@ -0,0 +1,39 @@
From 96c6e40774a78f2509aab1260d0f6aaa3b413597 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Thu, 13 Feb 2020 11:37:13 +0100
Subject: [PATCH] dracut.sh: added help for --regenerate-all
(cherry picked from commit cdc9cd0e41615d5f5f5af7887991a311cf5c4c7a)
Resolves: #1802522
---
dracut.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 86e95449..e70dab16 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -182,8 +182,8 @@ Creates initial ramdisk images for preloading modules
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
Mount device [DEV] on mountpoint [MP] with filesystem
[FSTYPE] and options [FSOPTS] in the initramfs
- --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are
- determined by looking at the current mounts.
+ --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are
+ determined by looking at the current mounts.
--add-device "[DEV]" Bring up [DEV] in initramfs
-i, --include [SOURCE] [TARGET]
Include the files in the SOURCE directory into the
@@ -234,7 +234,9 @@ Creates initial ramdisk images for preloading modules
--uefi Create an UEFI executable with the kernel cmdline and
kernel combined
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
- --kernel-image [FILE] location of the kernel image
+ --kernel-image [FILE] Location of the kernel image
+ --regenerate-all Regenerate all initramfs images at the default location
+ for the kernel versions found on the system
If [LIST] has multiple arguments, then you have to put these in quotes.

39
SOURCES/0111.patch Normal file
View File

@ -0,0 +1,39 @@
From 8658cfd92b50197dd4f4d3b6d136950fe007ffc0 Mon Sep 17 00:00:00 2001
From: Frank Deng <frank.deng@oracle.com>
Date: Sat, 15 Jun 2019 13:35:42 -0700
Subject: [PATCH] 35network-legacy: fix classless static route parsing
(cherry picked from commit 11e1f680656177cfbba4e06f08b6707f4a812bc0)
Resolves: #1811042
---
modules.d/35network-legacy/dhclient-script.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh
index f1a60005..44633b30 100755
--- a/modules.d/35network-legacy/dhclient-script.sh
+++ b/modules.d/35network-legacy/dhclient-script.sh
@@ -126,9 +126,11 @@ parse_option_121() {
elif [ $mask -gt 8 ]; then
destination="$1.$2.0.0/$mask"
shift; shift
- else
+ elif [ $mask -gt 0 ]; then
destination="$1.0.0.0/$mask"
shift
+ else
+ destination="0.0.0.0/$mask"
fi
# Read the gateway
@@ -138,7 +140,7 @@ parse_option_121() {
# Multicast routing on Linux
# - If you set a next-hop address for a multicast group, this breaks with Cisco switches
# - If you simply leave it link-local and attach it to an interface, it works fine.
- if [ $multicast -eq 1 ]; then
+ if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then
temp_result="$destination dev $interface"
else
temp_result="$destination via $gateway dev $interface"

34
SOURCES/0112.patch Normal file
View File

@ -0,0 +1,34 @@
From 33f3c41793b8c22ae4c7158f7480b38d4eed3a73 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 10 Mar 2020 15:18:37 +0100
Subject: [PATCH] network: fix glob matching ipv6 addresses
In this case we want to cover three cases
1) ip_address:ip_address
2) number:macaddress
3) :macaddress
We consider something an IPv6 address if it starts with number and
contains ":", but IPv6 addresses are in hexa.
(cherry picked from commit 7069132ec7e94a3274aa1b3b3b6e339066118a4d)
Resolves: #1812046
---
modules.d/40network/net-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 6babcccf..fc914b30 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -508,7 +508,7 @@ ip_to_var() {
[ -n "$6" ] && dev=$6
[ -n "$7" ] && autoconf=$7
case "$8" in
- [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
+ [0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
dns1="$8"
[ -n "$9" ] && dns2="$9"
;;

37
SOURCES/0113.patch Normal file
View File

@ -0,0 +1,37 @@
From f9c068e999cc76eaa318cc0773ef9133ea986131 Mon Sep 17 00:00:00 2001
From: Sebastian Mitterle <smitterl@redhat.com>
Date: Thu, 19 Mar 2020 12:12:50 +0100
Subject: [PATCH] dasd: only install /etc/dasd.conf if present
`dasd.conf` needn't be present on system even if modules have been loaded.
Check if file exists to avoid error message during kernel update
```bash
dracut-install: ERROR: installing '/etc/dasd.conf'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.YvVRx5/initramfs -H /etc/dasd.conf
```
(cherry picked from commit defb1611c771d9f05780aebb101baefde2f66874)
Resolves: #1815043
---
modules.d/95dasd/module-setup.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules.d/95dasd/module-setup.sh b/modules.d/95dasd/module-setup.sh
index 0da61309..ec33a9e0 100755
--- a/modules.d/95dasd/module-setup.sh
+++ b/modules.d/95dasd/module-setup.sh
@@ -18,8 +18,9 @@ depends() {
install() {
inst_hook cmdline 30 "$moddir/parse-dasd.sh"
inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg
- if [[ $hostonly ]]; then
- inst -H /etc/dasd.conf
+ conf=/etc/dasd.conf
+ if [[ $hostonly && -f $conf ]] ; then
+ inst -H $conf
fi
inst_rules 56-dasd.rules
inst_rules 59-dasd.rules

27
SOURCES/0114.patch Normal file
View File

@ -0,0 +1,27 @@
From af492162772a6ed26fbc8223012348ae4ad000e5 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 13 Nov 2020 10:45:59 +0100
Subject: [PATCH] 90multipath: install kpartx's 11-dm-parts.rules
This makes /dev/disk/by-uuid links point to the right device.
(cherry picked from commit 0f89c0dff6b96c9ca09b48a2890399b145f38bdb)
Resolves: #1849021
---
modules.d/90multipath/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index a7f250f3..1844a035 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -125,6 +125,6 @@ install() {
inst_rules 40-multipath.rules 56-multipath.rules \
62-multipath.rules 65-multipath.rules \
66-kpartx.rules 67-kpartx-compat.rules \
- 11-dm-mpath.rules
+ 11-dm-mpath.rules 11-dm-parts.rules
}

47
SOURCES/0115.patch Normal file
View File

@ -0,0 +1,47 @@
From 8680b657da61ce533f1c91e79eadd3c46f9e98d0 Mon Sep 17 00:00:00 2001
From: "Eugene S. Sobolev" <sobolev@protei.ru>
Date: Fri, 14 Feb 2020 11:49:06 +0300
Subject: [PATCH] network/net-lib.sh: Configure all iBFT interfaces
Added boolean command line option rd.iscsi.mp
(cherry picked from commit c7ee6b3dbb8dfad61aa337b2ecf7e4eaeddc4b4b)
Resolves: #1851984
---
dracut.cmdline.7.asc | 3 +++
modules.d/40network/net-lib.sh | 6 ++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 19b5cc87..9003c430 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -764,6 +764,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
Turn on iBFT autoconfiguration for the interfaces
+**rd.iscsi.mp** **rd.iscsi.mp=1**:
+ Configure all iBFT interfaces, not only used for booting (multipath)
+
**rd.iscsi.waitnet=0**:
Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index fc914b30..f0c1c041 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -251,8 +251,10 @@ ibft_to_cmdline() {
[ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
# Skip invalid interfaces
(( $flags & 1 )) || continue
- # Skip interfaces not used for booting
- (( $flags & 2 )) || continue
+ # Skip interfaces not used for booting unless using multipath
+ if ! getargbool 0 rd.iscsi.mp ; then
+ (( $flags & 2 )) || continue
+ fi
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
[ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)

29
SOURCES/0116.patch Normal file
View File

@ -0,0 +1,29 @@
From b14ba27a3cdc7a71ded3c4b424129ffd61d7be85 Mon Sep 17 00:00:00 2001
From: Denis Volkov <denis@simpletexting.net>
Date: Tue, 4 Aug 2020 19:51:27 +0500
Subject: [PATCH] Change the order of NFS servers during the boot NFS server
provided by DHCP in next-server option has higher priority than DHCP-server
itself
(cherry picked from commit 09a691af3b63543fe58faa02661f785b907a78a6)
Resolves: #1859513
---
modules.d/95nfs/nfs-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh
index 1ba4f5ff..95844f58 100755
--- a/modules.d/95nfs/nfs-lib.sh
+++ b/modules.d/95nfs/nfs-lib.sh
@@ -112,8 +112,8 @@ nfsroot_from_dhcp() {
[ -n "$new_root_path" ] && nfsroot_to_var "$nfs:$new_root_path"
[ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path=/tftpboot/%s
[ -z "$server" ] && server=$srv
- [ -z "$server" ] && server=$new_dhcp_server_identifier
[ -z "$server" ] && server=$new_next_server
+ [ -z "$server" ] && server=$new_dhcp_server_identifier
[ -z "$server" ] && server=${new_root_path%%:*}
}

39
SOURCES/0117.patch Normal file
View File

@ -0,0 +1,39 @@
From cfa57e264efa138e99257fbfbe18449150a96c4d 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
If kmod_module_get_path returns NULL, we should skip that entry,
the hash function does not like NULL pointers.
(cherry picked from commit fc141f22869bad2e5409d1cc555c1a42ea738343)
Resolves: #1868525
---
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 51f79422..f8ec9a59 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -1248,6 +1248,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;
@@ -1257,7 +1260,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;
}

36
SOURCES/0118.patch Normal file
View File

@ -0,0 +1,36 @@
From 561339d4d04c5481a3239017d714f035fc5bc55a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Tue, 3 Mar 2020 21:20:34 +0100
Subject: [PATCH] Consider also drm_dev_register when looking for gpu driver
DRM drivers are filtered for drm_crtc_init symbol,
but not all drivers use it. Especially, cirrus driver
doesn't use it since Linux 5.2.
The practical result is text plymouth theme instead of graphical when in qemu.
Fix it by looking also for drm_dev_register symbol.
Suggested by @haraldh
Fixes #712
(cherry picked from commit ebeed55c073eeaf78b738fe2c91bb6327a2c3bfe)
Resolves: #1874506
---
modules.d/50drm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
index 23545e34..a1711c00 100755
--- a/modules.d/50drm/module-setup.sh
+++ b/modules.d/50drm/module-setup.sh
@@ -40,6 +40,6 @@ installkernel() {
fi
done
else
- dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging"
+ dracut_instmods -o -s "drm_crtc_init|drm_dev_register" "=drivers/gpu/drm" "=drivers/staging"
fi
}

27
SOURCES/0119.patch Normal file
View File

@ -0,0 +1,27 @@
From add76751a1bc290088ca650cbec0be3696beb8d6 Mon Sep 17 00:00:00 2001
From: GuoChuang <guo.chuang@zte.com.cn>
Date: Mon, 24 Aug 2020 14:03:48 +0800
Subject: [PATCH] fix graphics startup failure with the rhgb paramter in
CentOS8.2
(cherry picked from commit d76e9ad5d7b16edb3c544ed3888640bea0efbf72)
Resolves: #1874506
---
modules.d/50drm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh
index a1711c00..b4ead7f2 100755
--- a/modules.d/50drm/module-setup.sh
+++ b/modules.d/50drm/module-setup.sh
@@ -33,7 +33,7 @@ installkernel() {
if [[ $hostonly ]]; then
for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
[[ -e $i ]] || continue
- if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then
+ if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register" -S "iw_handler_get_spy" $(<$i); then
if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
hostonly='' instmods amdkfd
fi

87
SOURCES/0120.patch Normal file
View File

@ -0,0 +1,87 @@
From e7f4acb6f7f902715277048be7cdba49c61189dd Mon Sep 17 00:00:00 2001
From: Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
Date: Fri, 23 Oct 2020 12:38:04 +0200
Subject: [PATCH] Configure the runner for team interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1881463
(cherry picked from commit e4483e5917b59918260ff0f0345abbea4a537f12)
Resolves: #1881463
---
dracut.cmdline.7.asc | 6 +++++-
modules.d/35network-legacy/parse-team.sh | 18 +++++++++++++-----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 9003c430..e220defb 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -593,9 +593,13 @@ interface name. Better name it "bootnet" or "bluesocket".
Bond without parameters assumes
bond=bond0:eth0,eth1:mode=balance-rr
-**team=**__<teammaster>__:__<teamslaves>__::
+**team=**__<teammaster>__:__<teamslaves>__[:__<teamrunner>__]::
Setup team device <teammaster> on top of <teamslaves>.
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
+ <teamrunner> is the runner type to be used (see *teamd.conf*(5)); defaults to
+ activebackup.
+ Team without parameters assumes
+ team=team0:eth0,eth1:activebackup
**bridge=**__<bridgename>__:__<ethnames>__::
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
diff --git a/modules.d/35network-legacy/parse-team.sh b/modules.d/35network-legacy/parse-team.sh
index a6eef18e..03fbcf20 100755
--- a/modules.d/35network-legacy/parse-team.sh
+++ b/modules.d/35network-legacy/parse-team.sh
@@ -1,9 +1,12 @@
#!/bin/sh
#
# Format:
-# team=<teammaster>:<teamslaves>
+# team=<teammaster>:<teamslaves>[:<teamrunner>]
#
# teamslaves is a comma-separated list of physical (ethernet) interfaces
+# teamrunner is the runner type to be used (see teamd.conf(5)); defaults to activebackup
+#
+# team without parameters assumes team=team0:eth0,eth1:activebackup
#
parseteam() {
@@ -15,8 +18,11 @@ parseteam() {
done
case $# in
- 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
- *) die "team= requires two parameters" ;;
+ 0) teammaster=team0; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
+ 1) teammaster=$1; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
+ 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner="activebackup" ;;
+ 3) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner=$3 ;;
+ *) die "team= requires zero to three parameters" ;;
esac
return 0
}
@@ -26,16 +32,18 @@ for team in $(getargs team); do
unset teammaster
unset teamslaves
+ unset teamrunner
parseteam "$team" || continue
echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info
+ echo "teamrunner=\"$teamrunner\"" >> /tmp/team.${teammaster}.info
if ! [ -e /etc/teamd/${teammaster}.conf ]; then
- warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using activebackup."
+ warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using $teamrunner."
mkdir -p /etc/teamd
- printf -- "%s" '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}' > "/etc/teamd/${teammaster}.conf"
+ printf -- "%s" "{\"runner\": {\"name\": \"$teamrunner\"}, \"link_watch\": {\"name\": \"ethtool\"}}" > "/tmp/${teammaster}.conf"
fi
done

42
SOURCES/0121.patch Normal file
View File

@ -0,0 +1,42 @@
From b75ab376748ee698763610769601bd81296bd060 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Thu, 7 May 2020 07:48:12 +0200
Subject: [PATCH] network-manager: set kernel hostname from the command line
Since commit ff70adf873ef ("initrd: save hostname to a file in /run"),
the initrd generator of NetworkManager parses the hostname from 'ip='
options of the kernel command line and writes it to
/run/NetworkManager/initrd/hostname.
When that file exists, set the kernel hostname.
In presence of multiple hostnames in the command line, the last one
wins. Hostnames from command line always have precedence over ones
received through DHCP. This is a bit different from the legacy network
module that gives higher precedence to the hostname (from DHCP or
command line) of the last interface that is brought up, which depends
on the udev order.
(cherry picked from commit eb770a4a207b2e9e3080068c1df22b69ed44d4b5)
Resolves: #1881974
---
modules.d/35network-manager/nm-run.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index fc5280a1..61752384 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -10,6 +10,10 @@ for i in /usr/lib/NetworkManager/system-connections/* \
else
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
fi
+
+ if [ -s /run/NetworkManager/initrd/hostname ]; then
+ cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname
+ fi
break
done

252
SOURCES/0122.patch Normal file
View File

@ -0,0 +1,252 @@
From f9883b51b1fafd30a91e9efda3260067a8f87ea5 Mon Sep 17 00:00:00 2001
From: Enzo Matsumiya <ematsumiya@suse.de>
Date: Mon, 3 Aug 2020 11:21:36 -0300
Subject: [PATCH] 95nvmf: add NVMe over TCP support
Add support to boot from an NVMe over TCP device.
Example of supported command line formats:
nvme.discover=tcp:192.168.1.3::4420
nvme.discover=tcp:192.168.1.3 # will use 4420 as default svcid
- Create is_nvmf() function to handle all fabrics types
- Fix parse_nvmf_discover() to correctly use the default values
- Auxiliary function to validate an IP connection
- Fix inverted result for getargbool when reading "rd.nonvmf" command line parameter
Requires rd.neednet=1
Requires adding/replacing STARTMODE in /etc/sysconfig/network/ifcfg-ethX to "nfsroot"
to avoid shutdown hanging in initiator
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
(cherry picked from commit 019610af266bcaef711715266bc0ca4be1044150)
Resolves: #1885417
---
modules.d/95nvmf/module-setup.sh | 25 ++++---
modules.d/95nvmf/parse-nvmf-boot-connections.sh | 97 ++++++++++++++++++-------
2 files changed, 84 insertions(+), 38 deletions(-)
diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh
index db43ec01..418b5e0c 100755
--- a/modules.d/95nvmf/module-setup.sh
+++ b/modules.d/95nvmf/module-setup.sh
@@ -6,9 +6,9 @@ check() {
[ -f /etc/nvme/hostnqn ] || return 255
[ -f /etc/nvme/hostid ] || return 255
- is_nvme_fc() {
+ is_nvmf() {
local _dev=$1
- local traddr
+ local trtype
[[ -L "/sys/dev/block/$_dev" ]] || return 0
cd -P "/sys/dev/block/$_dev" || return 0
@@ -18,19 +18,19 @@ check() {
for d in device/nvme* ; do
[ -L "$d" ] || continue
if readlink "$d" | grep -q nvme-fabrics ; then
- traddr=$(cat "$d"/address)
- break
- fi
- done
- [[ "${traddr#traddr=nn-}" != "$traddr" ]]
+ trtype=$(cat "$d"/transport)
+ break
+ fi
+ done
+ [[ "$trtype" == "fc" ]] || [[ "$trtype" == "tcp" ]] || [[ "$trtype" == "rdma" ]]
}
[[ $hostonly ]] || [[ $mount_needs ]] && {
pushd . >/dev/null
- for_each_host_dev_and_slaves is_nvme_fc
- local _is_nvme_fc=$?
+ for_each_host_dev_and_slaves is_nvmf
+ local _is_nvmf=$?
popd >/dev/null
- [[ $_is_nvme_fc == 0 ]] || return 255
+ [[ $_is_nvmf == 0 ]] || return 255
if [ ! -f /sys/class/fc/fc_udev_device/nvme_discovery ] ; then
if [ ! -f /etc/nvme/discovery.conf ] ; then
echo "No discovery arguments present"
@@ -43,13 +43,14 @@ check() {
# called by dracut
depends() {
- echo bash rootfs-block
+ echo bash rootfs-block network
return 0
}
# called by dracut
installkernel() {
instmods nvme_fc lpfc qla2xxx
+ hostonly="" instmods nvme_tcp nvme_fabrics
}
# called by dracut
@@ -76,6 +77,8 @@ install() {
inst_simple "/etc/nvme/hostnqn"
inst_simple "/etc/nvme/hostid"
+ inst_multiple ip sed
+
inst_multiple nvme
inst_multiple -o \
"$systemdsystemunitdir/nvm*-connect@.service" \
diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
index 0d16b871..61c6dec1 100755
--- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh
+++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh
@@ -8,69 +8,102 @@
# Examples:
# nvmf.hostnqn=nqn.2014-08.org.nvmexpress:uuid:37303738-3034-584d-5137-333230423843
# nvmf.discover=rdma:192.168.1.3::4420
+# nvme.discover=tcp:192.168.1.3::4420
+# nvme.discover=tcp:192.168.1.3
# nvmf.discover=fc:auto
#
# Note: FC does autodiscovery, so typically there is no need to
# specify any discover parameters for FC.
#
+type is_ip >/dev/null 2>&1 || . /lib/net-lib.sh
+
+if getargbool 0 rd.nonvmf ; then
+ warn "rd.nonvmf=0: skipping nvmf"
+ return 0
+fi
+
+initqueue --onetime modprobe --all -b -q nvme nvme_tcp nvme_core nvme_fabrics
+
+traddr="none"
+trtype="none"
+hosttraddr="none"
+trsvcid=4420
+
+validate_ip_conn() {
+ if ! getargbool 0 rd.neednet ; then
+ warn "$trtype transport requires rd.neednet=1"
+ return 1
+ fi
+
+ local_address=$(ip -o route get to $traddr | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
+
+ # confirm we got a local IP address
+ if ! is_ip "$local_address" ; then
+ warn "$traddr is an invalid address";
+ return 1
+ fi
+
+ ifname=$(ip -o route get to $local_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
+
+ if ip l show "$ifname" >/dev/null 2>&1 ; then
+ warn "invalid network interface $ifname"
+ return 1
+ fi
+
+ # confirm there's a route to destination
+ if ip route get "$traddr" >/dev/null 2>&1 ; then
+ warn "no route to $traddr"
+ return 1
+ fi
+}
+
parse_nvmf_discover() {
OLDIFS="$IFS"
IFS=:
- trtype="none"
- traddr="none"
- hosttraddr="none"
- trsvcid=4420
-
set $1
IFS="$OLDIFS"
case $# in
2)
- trtype=$1
- traddr=$2
+ [ -n "$1" ] && trtype=$1
+ [ -n "$2" ] && traddr=$2
;;
3)
- trtype=$1
- traddr=$2
- hosttraddr=$3
+ [ -n "$1" ] && trtype=$1
+ [ -n "$2" ] && traddr=$2
+ [ -n "$3" ] && hosttraddr=$3
;;
4)
- trtype=$1
- traddr=$2
- hosttraddr=$3
- trsvcid=$4
+ [ -n "$1" ] && trtype=$1
+ [ -n "$2" ] && traddr=$2
+ [ -n "$3" ] && hosttraddr=$3
+ [ -n "$4" ] && trsvcid=$4
;;
*)
warn "Invalid arguments for nvmf.discover=$1"
return 1
;;
esac
- if [ -z "$traddr" ] ; then
+ if [ "$traddr" = "none" ] ; then
warn "traddr is mandatory for $trtype"
return 1;
fi
- [ -z "$hosttraddr" ] && hosttraddr="none"
- [ -z "$trsvcid" ] && trsvcid="none"
if [ "$trtype" = "fc" ] ; then
- if [ -z "$hosttraddr" ] ; then
+ if [ "$hosttraddr" = "none" ] ; then
warn "host traddr is mandatory for fc"
return 1
fi
elif [ "$trtype" != "rdma" ] && [ "$trtype" != "tcp" ] ; then
warn "unsupported transport $trtype"
return 1
- elif [ -z "$trsvcid" ] ; then
- trsvcid=4420
+ fi
+ if [ "$trtype" = "tcp" ]; then
+ validate_ip_conn
fi
echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr --trsvcid=$trsvcid" >> /etc/nvme/discovery.conf
}
-if ! getargbool 0 rd.nonvmf ; then
- info "rd.nonvmf=0: skipping nvmf"
- return 0
-fi
-
nvmf_hostnqn=$(getarg nvmf.hostnqn=)
if [ -n "$nvmf_hostnqn" ] ; then
echo "$nvmf_hostnqn" > /etc/nvme/hostnqn
@@ -89,7 +122,17 @@ done
[ -f "/etc/nvme/hostid" ] || exit 0
if [ -f "/etc/nvme/discovery.conf" ] ; then
- /sbin/initqueue --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
+ if [ "$trtype" = "tcp" ] ; then
+ /sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
+ > /tmp/net.$ifname.did-setup
+ else
+ /sbin/initqueue --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all
+ fi
else
- /sbin/initqueue --finished --unique --name nvme-fc-autoconnect echo 1 > /sys/class/fc/fc_udev_device/nvme_discovery
+ if [ "$trtype" = "tcp" ] ; then
+ /sbin/initqueue --settled --onetime --unique /usr/sbin/nvme connect-all -t tcp -a $traddr -s $trsvcid
+ > /tmp/net.$ifname.did-setup
+ else
+ /sbin/initqueue --finished --unique --name nvme-fc-autoconnect echo 1 > /sys/class/fc/fc_udev_device/nvme_discovery
+ fi
fi

71
SOURCES/0123.patch Normal file
View File

@ -0,0 +1,71 @@
From 231c6e831262246af33696132c1be7c009477a96 Mon Sep 17 00:00:00 2001
From: Patrick Talbert <ptalbert@redhat.com>
Date: Fri, 30 Nov 2018 09:28:09 +0100
Subject: [PATCH] 95fcoe: Add the rd.nofcoe option to disable the FCoE module
from the command line
Images built with the fcoe module will always run the lldpad
service as part of their pre-trigger scripts if the network
is active. This prevents network installations in
environments where, for security reasons, LLDPDU frames
cause a switchport shutdown.
Add a new rd.nofcoe option to cause dracut to skip the
lldpad.sh script and the entire 95-fcoe module.
Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
(cherry picked from commit 7c6d2ad916bd536dc2f082fd96ef837a5031e497)
Resolves: #1885621
---
dracut.cmdline.7.asc | 3 +++
modules.d/95fcoe/lldpad.sh | 5 +++++
modules.d/95fcoe/parse-fcoe.sh | 5 +++++
3 files changed, 13 insertions(+)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index e220defb..bf745575 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -779,6 +779,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
FCoE
~~~~
+**rd.nofcoe=0**::
+ disable FCoE and lldpad
+
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
_<MAC>_ or EDD settings. The second argument specifies if DCB
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
index d06a3bd8..c32feeed 100755
--- a/modules.d/95fcoe/lldpad.sh
+++ b/modules.d/95fcoe/lldpad.sh
@@ -1,5 +1,10 @@
#!/bin/bash
+if ! getargbool 0 rd.nofcoe ; then
+ info "rd.nofcoe=0: skipping lldpad activation"
+ exit 0
+fi
+
# Note lldpad will stay running after switchroot, the system initscripts
# are to kill it and start a new lldpad to take over. Data is transfered
# between the 2 using a shm segment
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
index 12701cdb..7a6ff755 100755
--- a/modules.d/95fcoe/parse-fcoe.sh
+++ b/modules.d/95fcoe/parse-fcoe.sh
@@ -13,6 +13,11 @@
# fcoe=eth0:nodcb:vn2vn
# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
+if ! getargbool 0 rd.nofcoe ; then
+ info "rd.nofcoe=0: skipping fcoe"
+ exit 0
+fi
+
[ -z "$fcoe" ] && fcoe=$(getarg fcoe=)
# If it's not set we don't continue

161
SOURCES/0124.patch Normal file
View File

@ -0,0 +1,161 @@
From 4e1d7a423253d4e3476b003fc2e17c2ac44bd8ca Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Thu, 10 Sep 2020 02:18:02 +0800
Subject: [PATCH] 04watchdog: split the watchdog module install
In some cases, user only want to include the watchdog module, not the
wdctl or any other userspace helper. For example, systemd have a
RebootWatchdogSec option that use watchdog to prevent reboot hangs. And
it can help prevent machines hangs when reboot directly within the
initramfs stage. So split the module installation to a standlone module.
Also when watchdog-module get included, install driver for all loaded
watchdog instaed of only install driver for active watchdog. Both
watchdog and watchdog-module return 255 in check(), so it's enabled only
when manually included, the watchdog may get configured/activated later.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 39d90012a652fa4d9d2534d0168ddad8cacec248)
Resolves: #1890039
---
modules.d/04watchdog-modules/module-setup.sh | 61 ++++++++++++++++++++++++++++
modules.d/04watchdog/module-setup.sh | 50 +----------------------
2 files changed, 63 insertions(+), 48 deletions(-)
diff --git a/modules.d/04watchdog-modules/module-setup.sh b/modules.d/04watchdog-modules/module-setup.sh
new file mode 100755
index 00000000..5fbd769b
--- /dev/null
+++ b/modules.d/04watchdog-modules/module-setup.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ return 255
+}
+
+# called by dracut
+depends() {
+ return 0
+}
+
+# called by dracut
+install() {
+ return 0
+}
+
+installkernel() {
+ local -A _drivers
+ local _alldrivers _wdtdrv _wdtppath _dir
+ [[ -d /sys/class/watchdog/ ]] || return
+ for _dir in /sys/class/watchdog/*; do
+ [[ -d "$_dir" ]] || continue
+ [[ -f "$_dir/state" ]] || continue
+ # device/modalias will return driver of this device
+ _wdtdrv=$(< "$_dir/device/modalias")
+ # There can be more than one module represented by same
+ # modalias. Currently load all of them.
+ # TODO: Need to find a way to avoid any unwanted module
+ # represented by modalias
+ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
+ if [[ $_wdtdrv ]]; then
+ instmods $_wdtdrv
+ for i in $_wdtdrv; do
+ _drivers[$i]=1
+ done
+ fi
+ # however in some cases, we also need to check that if there is
+ # a specific driver for the parent bus/device. In such cases
+ # we also need to enable driver for parent bus/device.
+ _wdtppath=$(readlink -f "$_dir/device")
+ while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
+ _wdtppath=$(readlink -f "$_wdtppath/..")
+ [[ -f "$_wdtppath/modalias" ]] || continue
+
+ _wdtdrv=$(< "$_wdtppath/modalias")
+ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
+ if [[ $_wdtdrv ]]; then
+ instmods $_wdtdrv
+ for i in $_wdtdrv; do
+ _drivers[$i]=1
+ done
+ fi
+ done
+ done
+ # ensure that watchdog module is loaded as early as possible
+ _alldrivers="${!_drivers[*]}"
+ [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
+
+ return 0
+}
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
index 7566d651..15bcd897 100755
--- a/modules.d/04watchdog/module-setup.sh
+++ b/modules.d/04watchdog/module-setup.sh
@@ -7,7 +7,7 @@ check() {
# called by dracut
depends() {
- return 0
+ return "watchdog-modules"
}
# called by dracut
@@ -27,53 +27,7 @@ install() {
inst_hook cleanup 00 "$moddir/watchdog.sh"
inst_hook cleanup 99 "$moddir/watchdog.sh"
fi
+
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
inst_multiple -o wdctl
}
-
-installkernel() {
- local -A _drivers
- local _alldrivers _active _wdtdrv _wdtppath _dir
- [[ -d /sys/class/watchdog/ ]] || return
- for _dir in /sys/class/watchdog/*; do
- [[ -d "$_dir" ]] || continue
- [[ -f "$_dir/state" ]] || continue
- _active=$(< "$_dir/state")
- ! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
- # device/modalias will return driver of this device
- _wdtdrv=$(< "$_dir/device/modalias")
- # There can be more than one module represented by same
- # modalias. Currently load all of them.
- # TODO: Need to find a way to avoid any unwanted module
- # represented by modalias
- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
- if [[ $_wdtdrv ]]; then
- instmods $_wdtdrv
- for i in $_wdtdrv; do
- _drivers[$i]=1
- done
- fi
- # however in some cases, we also need to check that if there is
- # a specific driver for the parent bus/device. In such cases
- # we also need to enable driver for parent bus/device.
- _wdtppath=$(readlink -f "$_dir/device")
- while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
- _wdtppath=$(readlink -f "$_wdtppath/..")
- [[ -f "$_wdtppath/modalias" ]] || continue
-
- _wdtdrv=$(< "$_wdtppath/modalias")
- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
- if [[ $_wdtdrv ]]; then
- instmods $_wdtdrv
- for i in $_wdtdrv; do
- _drivers[$i]=1
- done
- fi
- done
- done
- # ensure that watchdog module is loaded as early as possible
- _alldrivers="${!_drivers[*]}"
- [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
-
- return 0
-}

28
SOURCES/0125.patch Normal file
View File

@ -0,0 +1,28 @@
From d1861df7552e2679ab48e5573ac23f4f1553f0e2 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Sun, 20 Sep 2020 09:44:08 +0200
Subject: [PATCH] dracut.spec: include the 04watchdog-modules module
Include the 04watchdog-modules module that was added in 39d90012a652
("04watchdog: split the watchdog module install").
(cherry picked from commit f3e328a7fd30c7109a3af188e84e621770bb6b85)
Resolves: #1890039
---
dracut.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.spec b/dracut.spec
index 3db5c0cf..b371118e 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -346,6 +346,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
+%{dracutlibdir}/modules.d/04watchdog-modules
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/10i18n

30
SOURCES/0126.patch Normal file
View File

@ -0,0 +1,30 @@
From 8300849e5d8825c6b60dec682eec4767701e95ac Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 16 Nov 2020 15:24:14 +0800
Subject: [PATCH] 95fcoe: ensure needed modules are installed
If fcoe module is loaded, the initramfs will always try load libfcoe
and bnx2fc, so also ensure they are installed if needed.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 4339d47cf810d8a79f20cf2b86d15af7ec859052)
Resolves: #1898814
---
modules.d/95fcoe/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
index 63f45b52..c2224ec1 100755
--- a/modules.d/95fcoe/module-setup.sh
+++ b/modules.d/95fcoe/module-setup.sh
@@ -23,7 +23,7 @@ depends() {
# called by dracut
installkernel() {
- instmods fcoe 8021q edd
+ instmods fcoe libfcoe 8021q edd bnx2fc
}
get_vlan_parent() {

100
SOURCES/0127.patch Normal file
View File

@ -0,0 +1,100 @@
From 3085acbec79b3649ac906529778f86a14f330e62 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 21 Oct 2020 16:18:07 +0800
Subject: [PATCH] Add a --hostonly-nics option
Currently when network is enabled, dracut will install all network
drivers that are currently loaded, but some time only one NIC is needed
for the initramfs.
So for strict hostonly mode, add a --hostonly-nics option, user can
provide a list of NICs to be enabled, and only needed drivers for
specifed NICs will be installed so save space.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 1e92f7285d42fbd3bc01f534f9bd646f6fdd9504)
Cherry-picked from: 1e92f7285d42fbd3bc01f534f9bd646f6fdd9504
Resolves: #1890041
Cherry-picked from: c69961b403c1c83bb4717e1df1470e71cd0245d1
Resolves: #1890041
---
dracut.sh | 6 ++++++
modules.d/90kernel-network-modules/module-setup.sh | 18 +++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index e70dab16..01abe7a4 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -173,6 +173,8 @@ Creates initial ramdisk images for preloading modules
--hostonly-i18n Install only needed keyboard and font files according
to the host configuration (default).
--no-hostonly-i18n Install all keyboard and font files available.
+ --hostonly-nics [LIST]
+ Only enable listed NICs in the initramfs.
--persistent-policy [POLICY]
Use [POLICY] to address disks and partitions.
POLICY can be any directory name found in /dev/disk.
@@ -400,6 +402,7 @@ rearrange_params()
--long kernel-image: \
--long no-hostonly-i18n \
--long hostonly-i18n \
+ --long hostonly-nics: \
--long no-machineid \
-- "$@")
@@ -561,6 +564,8 @@ while :; do
hostonly_cmdline_l="yes" ;;
--hostonly-i18n)
i18n_install_all_l="no" ;;
+ --hostonly-nics)
+ hostonly_nics_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;;
--no-hostonly-i18n)
i18n_install_all_l="yes" ;;
--no-hostonly-cmdline)
@@ -720,6 +725,7 @@ unset NPATH
(( ${#fstab_lines_l[@]} )) && fstab_lines+=( "${fstab_lines_l[@]}" )
(( ${#install_items_l[@]} )) && install_items+=" ${install_items_l[@]} "
(( ${#install_optional_items_l[@]} )) && install_optional_items+=" ${install_optional_items_l[@]} "
+(( ${#hostonly_nics_l[@]} )) && hostonly_nics+=" ${hostonly_nics_l[@]} "
# these options override the stuff in the config file
(( ${#dracutmodules_l[@]} )) && dracutmodules="${dracutmodules_l[@]}"
diff --git a/modules.d/90kernel-network-modules/module-setup.sh b/modules.d/90kernel-network-modules/module-setup.sh
index 600ef112..f36d31f7 100755
--- a/modules.d/90kernel-network-modules/module-setup.sh
+++ b/modules.d/90kernel-network-modules/module-setup.sh
@@ -14,15 +14,27 @@ depends() {
installkernel() {
# Include wired net drivers, excluding wireless
local _arch=$(uname -m)
- local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
+ local _net_symbols='eth_type_trans|register_virtio_device|usbnet_open'
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
+ local _net_drivers
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
- _s390drivers="=drivers/s390/net"
+ dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/s390/net"
fi
- dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
+ if [[ $hostonly_mode == 'strict' ]] && [[ $hostonly_nics ]]; then
+ for _nic in $hostonly_nics; do
+ _net_drivers=$(get_dev_module /sys/class/net/$_nic)
+ if ! [[ $_net_drivers ]]; then
+ derror "--hostonly-nics contains invalid NIC '$_nic'"
+ continue
+ fi
+ hostonly="" instmods $_net_drivers
+ done
+ return 0
+ fi
+ dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/net"
#instmods() will take care of hostonly
instmods \
=drivers/net/phy \

35
SOURCES/0128.patch Normal file
View File

@ -0,0 +1,35 @@
From 2dbd11b81dae28a5c6291a56175c06665b615d66 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 1 Oct 2020 14:08:38 +0200
Subject: [PATCH] dracut-install: ignore bogus preload libs
If there are any nonexistent libraries listed in /etc/ld.so.preload, ldd
prints error messages like:
ERROR: ld.so: object '/usr/lib64/libfoo.so.1' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
This causes resolve_deps() to return error, which leads to symlinks
(like usr/bin/awk) not being copied into the initrd.
(cherry picked from commit 4916dfc2b94dca0e84eb7dc58a9266d02c416b4a)
Resolves: #1884149
---
install/dracut-install.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index f8ec9a59..baf6dcff 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -481,6 +481,9 @@ static int resolve_deps(const char *src)
if (strstr(buf, "cannot read header"))
break;
+ if (strstr(buf, "cannot be preloaded"))
+ break;
+
if (strstr(buf, destrootdir))
break;

26
SOURCES/0129.patch Normal file
View File

@ -0,0 +1,26 @@
From e03445a5e40bb8d6de3d401495e8645a6c1db04c Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 7 Jan 2021 11:57:56 +0100
Subject: [PATCH] 00systemd: when putting systemd-vconsole-setup.service as a
dependency ignore missing services
rhel-only
Resolves: #1906301
---
modules.d/00systemd/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index 4ab2a896..1f0b5dad 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -225,7 +225,7 @@ install() {
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service \
; do
- systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
+ systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service 2>/dev/null
done
mkdir -p "$initdir/etc/systemd"

46
SOURCES/0130.patch Normal file
View File

@ -0,0 +1,46 @@
From 0e43b934b98e40efeed0781e8bdf9f805d8d7217 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Tue, 5 May 2020 19:11:18 +0200
Subject: [PATCH] 51-dracut-rescue.install: Don't use BLS fragment shipped by
kernel package
For the GRUB and zipl bootloaders the BLS fragment that is shipped by the
kernel package is used, so the same fragment is used for the rescue entry.
But there are cases where this BLS fragment is not suitable. For example,
if the boot directory is on a btrfs subvolume the path in the linux and
initrd fiels need to be adjusted with the real path. Otherwise GRUB won't
be able to read them.
The GRUB and zipl kernel-install plugins already take care of this before
installing the BLS fragments, so just copy the installed fragment that has
the updated paths instead of using the BLS shipped by the kernel package.
Resolves: rhbz#1827882
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
(cherry picked from commit ff366790a6e30175f243d54c2922a8c781030ede)
Resolves: #1894026
---
51-dracut-rescue.install | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
index 5ac34ef3..47eb8e7d 100755
--- a/51-dracut-rescue.install
+++ b/51-dracut-rescue.install
@@ -104,7 +104,11 @@ case "$COMMAND" in
echo "initrd $BOOT_DIR/initrd"
} > $LOADER_ENTRY
else
- cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
+ if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
+ cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" $LOADER_ENTRY
+ else
+ cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
+ fi
sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
fi

31
SOURCES/0131.patch Normal file
View File

@ -0,0 +1,31 @@
From 1651c3074f596b80478473a126c02c27398429dd Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Thu, 18 Jul 2019 11:29:29 +0200
Subject: [PATCH] 95fcoe: Fix startup when fcoe module is included
The parse-fcoe.sh hook is sourced, and hence must not contain
exit 0 calls. Otherwise, the cmdline sequence will be interupted,
and no error will be reported to systemd. Use return instead.
Reference: boo#1136977
(cherry picked from commit 4f194276417237168f5bc929ba847a23b6a4c77f)
Resolves: #1914957
---
modules.d/95fcoe/parse-fcoe.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
index 7a6ff755..8bb55c6e 100755
--- a/modules.d/95fcoe/parse-fcoe.sh
+++ b/modules.d/95fcoe/parse-fcoe.sh
@@ -15,7 +15,7 @@
if ! getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping fcoe"
- exit 0
+ return 0
fi
[ -z "$fcoe" ] && fcoe=$(getarg fcoe=)

30
SOURCES/0132.patch Normal file
View File

@ -0,0 +1,30 @@
From e96bab3e688b7fc9b6f5e6b90c6d1ea4d517bc4a Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Tue, 10 Mar 2020 10:48:21 +0100
Subject: [PATCH] Fix pre-trigger stage by replacing exit with return in
lldpad.sh
Using exit makes the pre-trigger stage finish after running 03-lldpad.sh
pre-trigger hook.
(cherry picked from commit 7fb8f939a52a904b1860e303a6a7fe69ba0d2ceb)
Resolves: #1914957
---
modules.d/95fcoe/lldpad.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
index c32feeed..444c943e 100755
--- a/modules.d/95fcoe/lldpad.sh
+++ b/modules.d/95fcoe/lldpad.sh
@@ -2,7 +2,7 @@
if ! getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping lldpad activation"
- exit 0
+ return 0
fi
# Note lldpad will stay running after switchroot, the system initscripts

27
SOURCES/0133.patch Normal file
View File

@ -0,0 +1,27 @@
From 6297e8accadcddcdd390f4e0583f9bde29f3758e Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu, 7 Nov 2019 14:03:23 +0100
Subject: [PATCH] spec: dracut-network is happy with either NM or dhclient
(cherry picked from commit e8638076857621b28eb4dc36cdd49a94992835b7)
Resolves: #1916174
---
dracut.spec | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut.spec b/dracut.spec
index b371118e..fa3e4b99 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -125,7 +125,8 @@ Requires: %{name} = %{version}-%{release}
%endif
Requires: iputils
Requires: iproute
-Requires: dhclient
+Requires: (NetworkManager >= 1.20 or dhclient)
+Suggests: NetworkManager
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release}

42
SOURCES/0134.patch Normal file
View File

@ -0,0 +1,42 @@
From db5fda123c2960e99cb29399bdedbd56d672c72d Mon Sep 17 00:00:00 2001
From: Thomas Blume <Thomas.Blume@suse.com>
Date: Mon, 24 Feb 2020 12:11:25 +0100
Subject: [PATCH] 95fcoe: default rd.nofcoe to false
rd.nofcoe should default to false, e.g. fcoe should be enabled unless
overwritten from the command line.
The same applies for lldapd.sh.
(cherry picked from commit 8446c8f9deefcc6c47d96a128b1e9b23d8855a96)
Resolves: #1885621
---
modules.d/95fcoe/lldpad.sh | 2 +-
modules.d/95fcoe/parse-fcoe.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
index 444c943e..7faa2e19 100755
--- a/modules.d/95fcoe/lldpad.sh
+++ b/modules.d/95fcoe/lldpad.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-if ! getargbool 0 rd.nofcoe ; then
+if getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping lldpad activation"
return 0
fi
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
index 8bb55c6e..86f4331e 100755
--- a/modules.d/95fcoe/parse-fcoe.sh
+++ b/modules.d/95fcoe/parse-fcoe.sh
@@ -13,7 +13,7 @@
# fcoe=eth0:nodcb:vn2vn
# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
-if ! getargbool 0 rd.nofcoe ; then
+if getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping fcoe"
return 0
fi

View File

@ -5,7 +5,7 @@
# strip the automatically generated dep here and instead co-own the # strip the automatically generated dep here and instead co-own the
# directory. # directory.
%global __requires_exclude pkg-config %global __requires_exclude pkg-config
%define dist_free_release 89.git20200625 %define dist_free_release 135.git20210121
Name: dracut Name: dracut
Version: 049 Version: 049
@ -116,6 +116,52 @@ Patch85: 0085.patch
Patch86: 0086.patch Patch86: 0086.patch
Patch87: 0087.patch Patch87: 0087.patch
Patch88: 0088.patch Patch88: 0088.patch
Patch89: 0089.patch
Patch90: 0090.patch
Patch91: 0091.patch
Patch92: 0092.patch
Patch93: 0093.patch
Patch94: 0094.patch
Patch95: 0095.patch
Patch96: 0096.patch
Patch97: 0097.patch
Patch98: 0098.patch
Patch99: 0099.patch
Patch100: 0100.patch
Patch101: 0101.patch
Patch102: 0102.patch
Patch103: 0103.patch
Patch104: 0104.patch
Patch105: 0105.patch
Patch106: 0106.patch
Patch107: 0107.patch
Patch108: 0108.patch
Patch109: 0109.patch
Patch110: 0110.patch
Patch111: 0111.patch
Patch112: 0112.patch
Patch113: 0113.patch
Patch114: 0114.patch
Patch115: 0115.patch
Patch116: 0116.patch
Patch117: 0117.patch
Patch118: 0118.patch
Patch119: 0119.patch
Patch120: 0120.patch
Patch121: 0121.patch
Patch122: 0122.patch
Patch123: 0123.patch
Patch124: 0124.patch
Patch125: 0125.patch
Patch126: 0126.patch
Patch127: 0127.patch
Patch128: 0128.patch
Patch129: 0129.patch
Patch130: 0130.patch
Patch131: 0131.patch
Patch132: 0132.patch
Patch133: 0133.patch
Patch134: 0134.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -214,7 +260,8 @@ Requires: %{name} = %{version}-%{release}
%endif %endif
Requires: iputils Requires: iputils
Requires: iproute Requires: iproute
Requires: dhclient Requires: (NetworkManager >= 1.20 or dhclient)
Suggests: NetworkManager
Obsoletes: dracut-generic < 008 Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release} Provides: dracut-generic = %{version}-%{release}
@ -435,6 +482,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/03modsign %{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue %{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog %{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/04watchdog-modules
%{dracutlibdir}/modules.d/05busybox %{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06rngd %{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/10i18n %{dracutlibdir}/modules.d/10i18n
@ -459,6 +507,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/95debug %{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys %{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95lunmask %{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume %{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block %{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo %{dracutlibdir}/modules.d/95terminfo
@ -570,7 +619,86 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh %{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif %endif
%triggerin network -- dracut-network < 049-83.git20200525
echo '# Since rhel-8.3 dracut moved to use NetworkManager
# On existing installations we want to preserve the old scripts
add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf
%changelog %changelog
* Thu Jan 21 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-135.git20210121
- 95fcoe: default rd.nofcoe to false
* Thu Jan 14 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-134.git20210114
- spec: dracut-network is happy with either NM or dhclient
* Tue Jan 12 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-133.git20210112
- 95fcoe: Fix startup when fcoe module is included
- Fix pre-trigger stage by replacing exit with return in
* Thu Jan 07 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-131.git20210107
- 00systemd: when putting systemd-vconsole-setup.service as a
- 51-dracut-rescue.install: Don't use BLS fragment shipped by
* Thu Jan 07 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-129.git20210107
- Add a --hostonly-nics option
- dracut-install: ignore bogus preload libs
* Thu Jan 07 2021 Lukas Nykryn <lnykryn@redhat.com> - 049-127.git20210107
- match the whole string
- match simplified rd.zfcp format too
- base: hardcode rhel red
- 95iscsi:
- iscsi: fix error messages with iSCSI root
- 95nvmf: add module for NVMe-oF
- Write dns values passed by ip argument to ifcfg-* files
- dracut.sh: added help for --regenerate-all
- 35network-legacy: fix classless static route parsing
- network: fix glob matching ipv6 addresses
- dasd: only install /etc/dasd.conf if present
- 90multipath: install kpartx's 11-dm-parts.rules
- network/net-lib.sh: Configure all iBFT interfaces
- Change the order of NFS servers during the boot NFS server
- install: string_hash_func should not be fed with NULL
- Consider also drm_dev_register when looking for gpu driver
- fix graphics startup failure with the rhgb paramter in
- Configure the runner for team interfaces
- network-manager: set kernel hostname from the command line
- 95nvmf: add NVMe over TCP support
- 95fcoe: Add the rd.nofcoe option to disable the FCoE module
- 04watchdog: split the watchdog module install
- dracut.spec: include the 04watchdog-modules module
- 95fcoe: ensure needed modules are installed
* Tue Dec 15 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-103.git20201215
- dracut-systemd: create the initrd.target.wants directory
* Mon Nov 30 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-102.git20201130
- multipathd: fix the comparison
* Mon Nov 30 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-101.git20201130
- fix backport of 70b19acf
* Fri Nov 20 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-100.git20201120
- multipath: require kpartx binary
- Replace ln with systemctl
- multipath: add automatic configuration for multipath
- 98dracut-systemd: don't wait for root device if remote
- 90crypt: pull in remote-cryptsetup.target enablement
* Tue Aug 04 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-95.git20200804
- 90kernel-modules: add pci_hyperv
* Thu Jul 09 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-94.git20200709
- dracut.sh: Move the library workaround after squash
- dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
* Thu Jul 02 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-92.git20200702
- install/dracut-install.c: install module dependencies of
- install: also install post weak dependencies of kernel
* Thu Jul 02 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-90.git20200702
- spec: don't use NM on existing installations
* Thu Jun 25 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-89.git20200625 * Thu Jun 25 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-89.git20200625
- Adapt to the new udevadm version output - Adapt to the new udevadm version output
- network-manager: move connection generation to a lib file - network-manager: move connection generation to a lib file