backport patchs from upstream

(cherry picked from commit 74c55dc789a3aacb444c42ab40cd308bd213f5e3)
This commit is contained in:
hongjinghao 2024-02-21 17:22:23 +08:00 committed by openeuler-sync-bot
parent 6427f1d256
commit 9d9fb131b3
52 changed files with 2179 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From 90032a463190ab68f20f493894f667320466082d Mon Sep 17 00:00:00 2001
From: James Morris <morisja@gmail.com>
Date: Thu, 7 Apr 2022 17:57:48 +0100
Subject: [PATCH] feat(url-lib.sh): add --retry-connrefused to default curl
arguments
Trigger the existing retry condition on connection refused
to mitigate transient connectivity issues.
Reference:https://github.com/dracutdevs/dracut/commit/90032a463190ab68f20f493894f667320466082d
Conflict:NA
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index b68f72b0..e88fbc14 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -56,7 +56,7 @@ add_url_handler() {
export CURL_HOME="/run/initramfs/url-lib"
mkdir -p $CURL_HOME
-curl_args="--globoff --location --retry 3 --fail --show-error"
+curl_args="--globoff --location --retry 3 --retry-connrefused --fail --show-error"
getargbool 0 rd.noverifyssl && curl_args="$curl_args --insecure"
proxy=$(getarg proxy=)
--
2.23.0

View File

@ -0,0 +1,31 @@
From 3f2c76bb1456941a28d3333569d2bf18f8624617 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 19 Jan 2022 10:37:19 +0100
Subject: [PATCH] fix(40network): consistent use of "$gw" for gateway
Replace wrong use of $gateway with $gw.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Reference:https://github.com/dracutdevs/dracut/commit/3f2c76bb1456941a28d3333569d2bf18f8624617
Conflict:NA
---
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 54bb6775..a294a390 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -295,7 +295,7 @@ ibft_to_cmdline() {
# skip not assigned ip adresses
[ "$ip" = "0.0.0.0" ] && continue
[ -e "${iface}"/gateway ] && read -r gw < "${iface}"/gateway
- [ "$gateway" = "0.0.0.0" ] && unset gateway
+ [ "$gw" = "0.0.0.0" ] && unset gw
[ -e "${iface}"/subnet-mask ] && read -r mask < "${iface}"/subnet-mask
[ -e "${iface}"/prefix-len ] && read -r prefix < "${iface}"/prefix-len
[ -e "${iface}"/primary-dns ] && read -r dns1 < "${iface}"/primary-dns
--
2.23.0

View File

@ -0,0 +1,37 @@
From 1354d6339a2e603fe0787bc028f9e7e1d49cbf82 Mon Sep 17 00:00:00 2001
From: Conrad Hoffmann <ch@bitfehler.net>
Date: Thu, 2 Jun 2022 10:31:50 +0200
Subject: [PATCH] fix(Makefile): use of potentially unset variable
`CWD` is not a Make variable. This may have worked accidentally for some
people if their shell happend to provide `CWD` and Make picked it up.
As is, this tends to pick up git versions of unrelated parent
directories, e.g. when packaging for distributions.
Reference:https://github.com/dracutdevs/dracut/commit/1354d6339a2e603fe0787bc028f9e7e1d49cbf82
Conflict:NA
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index ab47fed8..97e189b4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
-include dracut-version.sh
-DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
+DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_MAIN_VERSION),)
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
endif
-DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
+DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_FULL_VERSION),)
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
endif
--
2.23.0

View File

@ -0,0 +1,27 @@
From ec50cec3bd9169410df409e077d0487c63c2a627 Mon Sep 17 00:00:00 2001
From: Masahiro Matsuya <mmatsuya@redhat.com>
Date: Tue, 29 Jun 2021 18:09:57 +0900
Subject: [PATCH] fix: SC2046: Quote this to prevent word splitting
Reference:https://github.com/dracutdevs/dracut/commit/ec50cec3bd9169410df409e077d0487c63c2a627
Conflict:NA
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index c952aec6..b68f72b0 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -159,7 +159,7 @@ nfs_fetch_url() {
mntdir="$(mkuniqdir /run nfs_mnt)"
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir"
# lazy unmount during pre-pivot hook
- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-$(basename "$mntdir") umount -l -- "$mntdir"
+ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-"$(basename "$mntdir")" umount -l -- "$mntdir"
fi
if [ -z "$outloc" ]; then
--
2.27.0

View File

@ -0,0 +1,28 @@
From acb18869e98687a3f8c172d7e7befaa5326cf67a Mon Sep 17 00:00:00 2001
From: Masahiro Matsuya <mmatsuya@redhat.com>
Date: Mon, 14 Jun 2021 09:04:03 +0900
Subject: [PATCH] fix: SC2086: Double quote to prevent globbing and word
splitting
Reference:https://github.com/dracutdevs/dracut/commit/acb18869e98687a3f8c172d7e7befaa5326cf67a
Conflict:NA
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index 972596a1..c952aec6 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -159,7 +159,7 @@ nfs_fetch_url() {
mntdir="$(mkuniqdir /run nfs_mnt)"
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir"
# lazy unmount during pre-pivot hook
- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-$(basename $mntdir) umount -l -- "$mntdir"
+ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-$(basename "$mntdir") umount -l -- "$mntdir"
fi
if [ -z "$outloc" ]; then
--
2.27.0

View File

@ -0,0 +1,27 @@
From dfbfd33b24524c0c10ad3594be143192f5b7da84 Mon Sep 17 00:00:00 2001
From: Andre Russ <andre.russ@sap.com>
Date: Tue, 24 Aug 2021 21:38:41 +0000
Subject: [PATCH] fix(base): tr needs to be installed
Reference:https://github.com/dracutdevs/dracut/commit/dfbfd33b24524c0c10ad3594be143192f5b7da84
Conflict:NA
---
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 cb445c34..10a44d91 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -15,7 +15,7 @@ depends() {
install() {
inst_multiple mount mknod mkdir sleep chroot chown \
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid \
- modprobe chmod
+ modprobe chmod tr
inst_multiple -o findmnt less kmod
--
2.27.0

View File

@ -0,0 +1,32 @@
From 6610093698db25fda1d584b9771da1e2c2330095 Mon Sep 17 00:00:00 2001
From: LinkTed <link.ted@mailbox.org>
Date: Mon, 21 Jun 2021 19:15:01 +0200
Subject: [PATCH] fix(crypt-gpg): execute --card-status on each try
If the gpg card is not inserted before the --card-status command is
executed then the public key is not linked with the card. Therefore,
the LUKS partition cannot be decrypted. To solve this, the
--card--status command is executed on each try.
Reference:https://github.com/dracutdevs/dracut/commit/6610093698db25fda1d584b9771da1e2c2330095
Conflict:NA
---
modules.d/91crypt-gpg/crypt-gpg-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/91crypt-gpg/crypt-gpg-lib.sh b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
index 0613803a..88ce16e2 100755
--- a/modules.d/91crypt-gpg/crypt-gpg-lib.sh
+++ b/modules.d/91crypt-gpg/crypt-gpg-lib.sh
@@ -51,7 +51,7 @@ gpg_decrypt() {
fi
ask_for_password \
- --cmd "gpg $opts --decrypt $mntp/$keypath" \
+ --cmd "GNUPGHOME=$gpghome gpg --card-status --no-tty > /dev/null 2>&1; gpg $opts --decrypt $mntp/$keypath" \
--prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \
--tries 3 --tty-echo-off
--
2.27.0

View File

@ -0,0 +1,27 @@
From e19e38904c054664473207d2d6ef3c53bd938867 Mon Sep 17 00:00:00 2001
From: Laszlo Gombos <laszlo.gombos@gmail.com>
Date: Sun, 3 Oct 2021 20:53:48 -0400
Subject: [PATCH] fix(dmsquash-live): iso-scan requires rmdir
Reference: https://github.com/dracutdevs/dracut/commit/e19e38904c054664473207d2d6ef3c53bd938867
Conflict: NA
---
modules.d/90dmsquash-live/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90dmsquash-live/module-setup.sh b/modules.d/90dmsquash-live/module-setup.sh
index 70be1852..bae9afd7 100755
--- a/modules.d/90dmsquash-live/module-setup.sh
+++ b/modules.d/90dmsquash-live/module-setup.sh
@@ -22,7 +22,7 @@ installkernel() {
# called by dracut
install() {
- inst_multiple umount dmsetup blkid dd losetup blockdev find
+ inst_multiple umount dmsetup blkid dd losetup blockdev find rmdir
inst_multiple -o checkisomd5
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
--
2.27.0

View File

@ -0,0 +1,29 @@
From 08ed7b2d0035eaa699c139bc9719f90190f6ffc1 Mon Sep 17 00:00:00 2001
From: Laszlo Gombos <laszlo.gombos@gmail.com>
Date: Sat, 12 Mar 2022 18:01:49 +0000
Subject: [PATCH] fix(dmsquash-live): mount live device with the correct type
fstype is not the correct type for the live device.
Reference:https://github.com/dracutdevs/dracut/commit/08ed7b2d0035eaa699c139bc9719f90190f6ffc1
Conflict:NA
---
modules.d/90dmsquash-live/dmsquash-live-root.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh
index 950be2d3..abc68407 100755
--- a/modules.d/90dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh
@@ -88,7 +88,7 @@ else
# no mount needed - we've already got the LiveOS image in $livedev
SQUASHED=$livedev
elif [ "$livedev_fstype" != "ntfs" ]; then
- if ! mount -n -t "$fstype" -o "${liverw:-ro}" "$livedev" /run/initramfs/live; then
+ if ! mount -n -t "$livedev_fstype" -o "${liverw:-ro}" "$livedev" /run/initramfs/live; then
die "Failed to mount block device of live image"
exit 1
fi
--
2.23.0

View File

@ -0,0 +1,69 @@
From 22a80629b4bbcef02eb8fe3611ea44e253ef4c61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Thu, 6 Jan 2022 19:50:28 +0100
Subject: [PATCH] fix(dracut): be more robust when using 'set -u'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From bash manpage, FUNCNAME exists only inside functions. When in debug
mode, make sure to use an empty default value as FUNCNAME[0] when
outside of functions.
With bash4 this wasn't an issue, but is with bash5 with hardening option
'set -u' used, as shown in the example below:
Incorrect:
$ bash -u -c 'echo -n ${FUNCNAME[0]}'
bash: line 1: FUNCNAME[0]: unbound variable
$
Correct:
$ bash -u -c 'echo -n ${FUNCNAME[0]-}'
$
This hardening enables sourcing dracut-lib.sh from external utilities
executing in the initramfs such as clevis-luks-askpass, which uses
hardening option 'set -u' internally.
(see Clevis PR https://github.com/latchset/clevis/pull/340)
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
Reference:https://github.com/dracutdevs/dracut/commit/22a80629b4bbcef02eb8fe3611ea44e253ef4c61
Conflict:NA
---
dracut.sh | 2 +-
modules.d/99base/dracut-lib.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 58d51d71..0d67c9d4 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -882,7 +882,7 @@ unset GREP_OPTIONS
export DRACUT_LOG_LEVEL=warning
[[ $debug ]] && {
export DRACUT_LOG_LEVEL=debug
- export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '
+ export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]-}): '
set -x
}
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 591b97c6..43b023e1 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -392,7 +392,7 @@ setdebug() {
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
RD_DEBUG=yes
[ -n "$BASH" ] \
- && export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '
+ && export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]-}): '
fi
fi
export RD_DEBUG
--
2.23.0

View File

@ -0,0 +1,122 @@
From 95aeed8975dd5a2af782ec986f2af6176b585c59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Tue, 26 Apr 2022 16:42:55 +0200
Subject: [PATCH] fix(dracut): default to correct firmware search paths
1. /sys/module/firmware_class/parameters/path (fw_path_para), if any
2. /lib/firmware/updates/$(uname -r)
3. /lib/firmware/updates
4. /lib/firmware/$(uname -r)
5. /lib/firmware
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/firmware_loader/main.c?h=v5.17#n406
Reference:https://github.com/dracutdevs/dracut/commit/95aeed8975dd5a2af782ec986f2af6176b585c59
Conflict:context adaptation
---
dracut-init.sh | 2 --
dracut.sh | 5 ++++-
src/install/dracut-install.c | 36 ++++++++++++++++++++++++++++--------
3 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index b6e3714..1d29181 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -72,8 +72,6 @@ srcmods="$dracutsysrootdir/lib/modules/$kernel/"
}
export srcmods
-[[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel"
-
# export standard hookdirs
[[ $hookdirs ]] || {
hookdirs="cmdline pre-udev pre-trigger netroot "
diff --git a/dracut.sh b/dracut.sh
index 0df6508..02632c5 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -988,7 +988,10 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
[[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/lib/dracut
-[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel"
+[[ $fw_dir ]] || {
+ fw_path_para=$(< /sys/module/firmware_class/parameters/path)
+ fw_dir="${fw_path_para:+$dracutsysrootdir$fw_path_para:}$dracutsysrootdir/lib/firmware/updates/$kernel:$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware/$kernel:$dracutsysrootdir/lib/firmware"
+}
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
[[ $tmpdir ]] || tmpdir="$TMPDIR"
[[ $tmpdir ]] || tmpdir="$dracutsysrootdir"/var/tmp
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 9122f39..b41bfc7 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -1017,9 +1017,12 @@ static void usage(int status)
"\n"
" --module,-m Install kernel modules, instead of files\n"
" --kerneldir Specify the kernel module directory\n"
- " (default: /lib/modules/`uname -r`)\n"
+ " (default: /lib/modules/$(uname -r))\n"
" --firmwaredirs Specify the firmware directory search path with : separation\n"
- " (default: DRACUT_FIRMWARE_PATH env var, /lib/firmware if not set)\n"
+ " (default: $DRACUT_FIRMWARE_PATH, otherwise kernel-compatible\n"
+ " $(</sys/module/firmware_class/parameters/path),\n"
+ " /lib/firmware/updates/$(uname -r), /lib/firmware/updates\n"
+ " /lib/firmware/$(uname -r), /lib/firmware)\n"
" --silent Don't display error messages for kernel module install\n"
" --modalias Only generate module list from /sys/devices modalias list\n"
" -o --optional If kernel module does not exist, do not fail\n"
@@ -1183,10 +1186,10 @@ static int parse_argv(int argc, char *argv[])
log_set_max_level(arg_loglevel);
}
+ struct utsname buf = {0};
if (!kerneldir) {
- struct utsname buf;
uname(&buf);
- if (asprintf(&kerneldir, "%s%s", "/lib/modules/", buf.release) < 0) {
+ if (asprintf(&kerneldir, "/lib/modules/%s", buf.release) < 0) {
log_error("Out of memory!");
exit(EXIT_FAILURE);
}
@@ -1198,15 +1201,32 @@ static int parse_argv(int argc, char *argv[])
if (arg_module) {
if (!firmwaredirs) {
- char *path = NULL;
-
- path = getenv("DRACUT_FIRMWARE_PATH");
+ char *path = getenv("DRACUT_FIRMWARE_PATH");
if (path) {
log_debug("DRACUT_FIRMWARE_PATH=%s", path);
firmwaredirs = strv_split(path, ":");
} else {
- firmwaredirs = strv_new("/lib/firmware", NULL);
+ if (!*buf.release)
+ uname(&buf);
+
+ char fw_path_para[PATH_MAX + 1] = "";
+ int path = open("/sys/module/firmware_class/parameters/path", O_RDONLY | O_CLOEXEC);
+ if (path != -1) {
+ ssize_t rd = read(path, fw_path_para, PATH_MAX);
+ if (rd != -1)
+ fw_path_para[rd - 1] = '\0';
+ close(path);
+ }
+ char uk[22 + sizeof(buf.release)], fk[14 + sizeof(buf.release)];
+ sprintf(uk, "/lib/firmware/updates/%s", buf.release);
+ sprintf(fk, "/lib/firmware/%s", buf.release);
+ firmwaredirs = strv_new(STRV_IFNOTNULL(*fw_path_para ? fw_path_para : NULL),
+ uk,
+ "/lib/firmware/updates",
+ fk,
+ "/lib/firmware",
+ NULL);
}
}
}
--
2.23.0

View File

@ -0,0 +1,63 @@
From d754e1c6f081a6501cb7fdcb5caaa6c4977235af Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 21 Jan 2022 21:25:54 +0100
Subject: [PATCH] fix(dracut-functions.sh): ip route parsing
The code for determining local interface and address works
only for peers that are reachable in a single hop.
This is parsed correctly:
192.168.110.1 dev br0 src 192.168.110.160 uid 0 \ cache
But this isn't:
192.168.1.4 via 192.168.110.1 dev br0 src 192.168.110.160 uid 0 \ cache
Fix it.
Fixes: ceca74cc ("dracut-functions: add ip_params_for_remote_addr() helper")
Reference:https://github.com/dracutdevs/dracut/commit/d754e1c6f081a6501cb7fdcb5caaa6c4977235af
Conflict:NA
---
dracut-functions.sh | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 63b6c892..8503c22f 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -783,13 +783,29 @@ btrfs_devs() {
iface_for_remote_addr() {
# shellcheck disable=SC2046
set -- $(ip -o route get to "$1")
- echo "$3"
+ while [ $# -gt 0 ]; do
+ case $1 in
+ dev)
+ echo "$2"
+ return
+ ;;
+ esac
+ shift
+ done
}
local_addr_for_remote_addr() {
# shellcheck disable=SC2046
set -- $(ip -o route get to "$1")
- echo "$5"
+ while [ $# -gt 0 ]; do
+ case $1 in
+ src)
+ echo "$2"
+ return
+ ;;
+ esac
+ shift
+ done
}
peer_for_addr() {
--
2.23.0

View File

@ -0,0 +1,83 @@
From e9ed44c8864445d85018e31064cd888c358f1daf Mon Sep 17 00:00:00 2001
From: Tao Liu <ltao@redhat.com>
Date: Thu, 3 Nov 2022 17:21:25 +0800
Subject: [PATCH] fix(dracut-functions.sh): suppress findmnt error msg if
/etc/fstab not exist
When the rootfs of a virtual machine is virtiofs shared folder,
the /etc/fstab file may not exist. As a result, the "findmnt --fstab"
will complain "findmnt: can't read (null): No such file or directory"
when trying to rebuild kdump initramfs within the vm.
This patch checks if /etc/fstab exist before calling "findmnt --fstab"
to suppress the error message.
Before:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory
After:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img
Signed-off-by: Tao Liu <ltao@redhat.com>
Reference:https://github.com/dracutdevs/dracut/commit/e9ed44c8864445d85018e31064cd888c358f1daf
Conflict:NA
---
dracut-functions.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index ff6749a1..adef37f7 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -383,6 +383,7 @@ find_block_device() {
} && return 0
fi
# fall back to /etc/fstab
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | {
while read -r _majmin _dev || [ -n "$_dev" ]; do
@@ -433,6 +434,8 @@ find_mp_fstype() {
} && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | {
while read -r _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
@@ -473,6 +476,8 @@ find_dev_fstype() {
} && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | {
while read -r _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
@@ -499,6 +504,8 @@ find_mp_fsopts() {
findmnt -e -v -n -o 'OPTIONS' --target "$1" 2> /dev/null && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'OPTIONS' --target "$1"
}
@@ -522,6 +529,8 @@ find_dev_fsopts() {
findmnt -e -v -n -o 'OPTIONS' --source "$_find_dev" 2> /dev/null && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'OPTIONS' --source "$_find_dev"
}
--
2.23.0

View File

@ -0,0 +1,36 @@
From e2fdb30b56305aed9d3be32f394352c7c3fdbcef Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Tue, 16 Aug 2022 08:23:19 +0200
Subject: [PATCH] fix(dracut-init.sh): add missing hostonly code in the
inst_multiple function
It seems that commit https://github.com/dracutdevs/dracut/commit/4ef45f13 forgot
to add the code to handle the hostonly parameter in the inst_multiple function.
Reference:https://github.com/dracutdevs/dracut/commit/e2fdb30b56305aed9d3be32f394352c7c3fdbcef
Conflict:NA
---
dracut-init.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index 4ec600fb..6ef3fc8b 100755
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -271,8 +271,12 @@ inst_symlink() {
}
inst_multiple() {
- local _ret
- if "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
+ local _ret _hostonly_install
+ if [[ $1 == "-H" ]]; then
+ _hostonly_install="-H"
+ shift
+ fi
+ if "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
return 0
else
_ret=$?
--
2.23.0

View File

@ -0,0 +1,29 @@
From 72b700e3cb8a0d74033e6e20b2435d9254b36efe Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 1 Aug 2022 09:47:51 +0200
Subject: [PATCH] fix(dracut-init.sh): correct dracut-install source path
Reference:https://github.com/dracutdevs/dracut/commit/72b700e3cb8a0d74033e6e20b2435d9254b36efe
Conflict:NA
---
dracut-init.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index 9dfa0990..41830e1a 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -180,8 +180,8 @@ fi
if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
DRACUT_INSTALL=$dracutbasedir/dracut-install
-elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
- DRACUT_INSTALL=$dracutbasedir/install/dracut-install
+elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/src/install/dracut-install ]]; then
+ DRACUT_INSTALL=$dracutbasedir/src/install/dracut-install
fi
# Test if dracut-install is a standalone executable with no options.
--
2.23.0

View File

@ -0,0 +1,28 @@
From b12ee558f5660073ad26415794570188e8a427b0 Mon Sep 17 00:00:00 2001
From: Marcos Mello <marcosfrm@gmail.com>
Date: Sun, 6 Nov 2022 12:43:47 -0300
Subject: [PATCH] fix(dracut-init.sh): instmods: wrong variable name
It worked most of the time because `dracut-install -o` returns 0 in normal circumstances.
Reference:https://github.com/dracutdevs/dracut/commit/b12ee558f5660073ad26415794570188e8a427b0
Conflict:NA
---
dracut-init.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index aba42bb3..30de6f6c 100755
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -1138,7 +1138,7 @@ instmods() {
-m "$@"
fi
- [[ "$optional" ]] && return 0
+ [[ "$_optional" ]] && return 0
return $_ret
}
--
2.23.0

View File

@ -0,0 +1,48 @@
From 9ef73b6ad08c19c3906564e5a15c7908ed9a81c8 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 4 Apr 2022 11:55:59 +0200
Subject: [PATCH] fix(dracut-install): copy files preserving ownership
attributes
While the "clone copy" operation changes the ownership of the cloned
files, the "normal copy" using cp does not preserve it.
Reference:https://github.com/dracutdevs/dracut/commit/9ef73b6ad08c19c3906564e5a15c7908ed9a81c8
Conflict:NA
---
src/install/dracut-install.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index d7a1cd9b..7c6d91c1 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -327,10 +327,10 @@ normal_copy:
pid = fork();
if (pid == 0) {
if (geteuid() == 0 && no_xattr == false)
- execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL",
+ execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps,ownership", "-fL",
src, dst, NULL);
else
- execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src,
+ execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps,ownership", "-fL", src,
dst, NULL);
_exit(EXIT_FAILURE);
}
@@ -339,10 +339,10 @@ normal_copy:
if (errno != EINTR) {
ret = -1;
if (geteuid() == 0 && no_xattr == false)
- log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %s",
+ log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps,ownership -fL %s %s",
src, dst);
else
- log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s",
+ log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps,ownership -fL %s %s",
src, dst);
break;
}
--
2.23.0

View File

@ -0,0 +1,82 @@
From 1beeaf3b71aed763d5fc7a9ee044d675f8906e8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<zboszor@gmail.com>
Date: Sun, 18 Jul 2021 10:28:37 +0200
Subject: [PATCH] fix(dracut-install): tweaks to get_real_file()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix potential memory leaks in two locations and use
_exit(EXIT_FAILURE) if asprintf(&abspath, ...) fails.
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
src/install/dracut-install.c | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 1086780..f0fc3dc 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -419,7 +419,7 @@ static char *get_real_file(const char *src, bool fullyresolve)
char linktarget[PATH_MAX + 1];
ssize_t linksz;
_cleanup_free_ char *fullsrcpath;
- char *abspath = NULL;
+ char *abspath = NULL; /* this is returned from the function, don't _cleanup_free_ */
struct stat sb;
if (sysrootdirlen) {
@@ -460,30 +460,39 @@ static char *get_real_file(const char *src, bool fullyresolve)
}
if (linktarget[0] == '/') {
- if (asprintf(&abspath, "%s%s", (sysrootdirlen ? sysrootdir : ""), linktarget) < 0)
- return NULL;
+ if (asprintf(&abspath, "%s%s", (sysrootdirlen ? sysrootdir : ""), linktarget) < 0) {
+ log_error("Out of memory!");
+ _exit(EXIT_FAILURE);
+ }
} else {
_cleanup_free_ char *fullsrcdir = strdup(fullsrcpath);
if (!fullsrcdir) {
log_error("Out of memory!");
- return NULL;
+ _exit(EXIT_FAILURE);
}
fullsrcdir[dir_len(fullsrcdir)] = '\0';
- if (asprintf(&abspath, "%s/%s", fullsrcdir, linktarget) < 0)
- return NULL;
+ if (asprintf(&abspath, "%s/%s", fullsrcdir, linktarget) < 0) {
+ log_error("Out of memory!");
+ _exit(EXIT_FAILURE);
+ }
}
if (fullyresolve) {
struct stat st;
if (lstat(abspath, &st) < 0) {
- if (errno != ENOENT)
+ if (errno != ENOENT) {
+ free(abspath);
return NULL;
+ }
+ }
+ if (S_ISLNK(st.st_mode)) {
+ char *tmp = get_real_file(abspath, fullyresolve);
+ free(abspath);
+ abspath = tmp;
}
- if (S_ISLNK(st.st_mode))
- return get_real_file(abspath, fullyresolve);
}
log_debug("get_real_file('%s') => '%s'", src, abspath);
--
2.33.0

View File

@ -0,0 +1,78 @@
From 2f791b401b287f67f2421452b5f82cdb5285a637 Mon Sep 17 00:00:00 2001
From: runsisi <runsisi@hust.edu.cn>
Date: Sat, 6 Aug 2022 10:15:48 +0800
Subject: [PATCH] fix(dracut-install): use stripped kernel module path as hash
key
in install_dependent_modules we use &path[kerneldirlen] as the key for inserting,
let's do the same for checking.
otherwise installing kernel module has circular dependency from a custom kernel
module directory will cause infinite recursion and segfault.
$ grep ipmi kbuilt/lib/modules/5.10.121/modules.dep
kernel/drivers/char/ipmi/ipmi_msghandler.ko:
kernel/drivers/char/ipmi/ipmi_devintf.ko: kernel/drivers/char/ipmi/ipmi_msghandler.ko
$ grep ipmi kbuilt/lib/modules/5.10.121/modules.softdep
softdep ipmi_msghandler post: ipmi_devintf
$ ./dracut-install -D /tmp --kerneldir ~/working/kernel/linux-5.10.121/kbuilt/lib/modules/5.10.121 -m ipmi-devintf
Segmentation fault (core dumped)
(gdb) b install_dependent_modules
Breakpoint 1 at 0x7db0: file src/install/dracut-install.c, line 1513.
(gdb) bt
#0 install_dependent_modules (modlist=0x0) at src/install/dracut-install.c:1513
#1 0x000055555555c027 in install_dependent_modules (modlist=modlist@entry=0x555555579e90) at src/install/dracut-install.c:1553
#2 0x000055555555bf1c in install_dependent_modules (modlist=0x5555555799d0) at src/install/dracut-install.c:1548
#3 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557a3f0) at src/install/dracut-install.c:1554
#4 0x000055555555bf1c in install_dependent_modules (modlist=0x555555579d60) at src/install/dracut-install.c:1548
#5 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557b170) at src/install/dracut-install.c:1554
#6 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557a0f0) at src/install/dracut-install.c:1548
#7 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555575320) at src/install/dracut-install.c:1554
#8 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557ab30) at src/install/dracut-install.c:1548
#9 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557dd60) at src/install/dracut-install.c:1554
#10 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557b640) at src/install/dracut-install.c:1548
#11 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557e0f0) at src/install/dracut-install.c:1554
#12 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557b9d0) at src/install/dracut-install.c:1548
#13 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555574340) at src/install/dracut-install.c:1554
#14 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557cf70) at src/install/dracut-install.c:1548
#15 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x5555555768d0) at src/install/dracut-install.c:1554
#16 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557d750) at src/install/dracut-install.c:1548
#17 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555557e700) at src/install/dracut-install.c:1554
#18 0x000055555555bf1c in install_dependent_modules (modlist=0x55555557de90) at src/install/dracut-install.c:1548
#19 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555581c90) at src/install/dracut-install.c:1554
#20 0x000055555555bf1c in install_dependent_modules (modlist=0x555555571e60) at src/install/dracut-install.c:1548
#21 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555556b620) at src/install/dracut-install.c:1554
#22 0x000055555555bf1c in install_dependent_modules (modlist=0x555555583000) at src/install/dracut-install.c:1548
#23 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x55555556b640) at src/install/dracut-install.c:1554
#24 0x000055555555bf1c in install_dependent_modules (modlist=0x555555571b40) at src/install/dracut-install.c:1548
#25 0x000055555555c034 in install_dependent_modules (modlist=modlist@entry=0x555555574100) at src/install/dracut-install.c:1554
#26 0x000055555555c4b0 in install_module (mod=mod@entry=0x555555573bc0) at src/install/dracut-install.c:1617
#27 0x000055555555c93d in install_modules (argc=argc@entry=1, argv=argv@entry=0x7fffffffd6e0) at src/install/dracut-install.c:1952
#28 0x000055555555862a in main (argc=<optimized out>, argv=0x7fffffffd6a8) at src/install/dracut-install.c:2090
Signed-off-by: runsisi <runsisi@hust.edu.cn>
Reference:https://github.com/jiayi0118/dracut/commit/2f791b401b287f67f2421452b5f82cdb5285a637
Conflict:NA
---
src/install/dracut-install.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index dbbeb6cd..63f4b950 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -1520,7 +1520,7 @@ static int install_dependent_modules(struct kmod_list *modlist)
if (check_hashmap(items_failed, path))
return -1;
- if (check_hashmap(items, path)) {
+ if (check_hashmap(items, &path[kerneldirlen])) {
continue;
}
--
2.23.0

View File

@ -0,0 +1,33 @@
From 6b592f581c1a5ec489acee95779867e0485770fd Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 1 Nov 2022 10:06:20 -0700
Subject: [PATCH] fix(dracut-logger.sh): this fixes the dlog_init check for
/dev/log
The /dev/log check was not correct, it would continue working if
/dev/log was a broken symlink. This changes the logic to be more clear
-- /dev/log needs to be a socket, and writable, and logger needs to be
available. If any of those conditions fail, turn off syslog and only use
console logging.
Reference:https://github.com/dracutdevs/dracut/commit/6b592f581c1a5ec489acee95779867e0485770fd
Conflict:NA
---
dracut-logger.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-logger.sh b/dracut-logger.sh
index 07389285..0dd17cc6 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -151,7 +151,7 @@ dlog_init() {
readonly _dlogfd=15
systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" &
exec 15> "$_systemdcatfile"
- elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then
+ elif ! ([[ -S /dev/log ]] && [[ -w /dev/log ]] && command -v logger > /dev/null); then
# We cannot log to syslog, so turn this facility off.
kmsgloglvl=$sysloglvl
sysloglvl=0
--
2.23.0

View File

@ -0,0 +1,44 @@
From b2d7561b98d08c7e4018aa22dc36dc1242e50f09 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 10 Oct 2022 10:25:33 +0200
Subject: [PATCH] fix(dracut): replace invalid lzo command with lzop for LZO
compression
Fixes issue #1999
Reference:https://github.com/dracutdevs/dracut/commit/b2d7561b98d08c7e4018aa22dc36dc1242e50f09
Conflict:Require adaption
---
dracut.sh | 2 +-
man/dracut.conf.5.asc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index d3e1df39..78801a42 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -769,7 +769,7 @@ while :; do
--bzip2) compress_l="bzip2" ;;
--lzma) compress_l="lzma" ;;
--xz) compress_l="xz" ;;
- --lzo) compress_l="lzo" ;;
+ --lzo) compress_l="lzop" ;;
--lz4) compress_l="lz4" ;;
--zstd) compress_l="zstd" ;;
--no-compress) _no_compress_l="cat" ;;
diff --git a/man/dracut.conf.5.asc b/man/dracut.conf.5.asc
index 39dfd34f..45192fa0 100644
--- a/man/dracut.conf.5.asc
+++ b/man/dracut.conf.5.asc
@@ -80,7 +80,7 @@ Configuration files must have the extension .conf; other extensions are ignored.
Specify additional files to include in the initramfs, separated by spaces,
if they exist.
-*compress=*"__{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
+*compress=*"__{cat|bzip2|lzma|xz|gzip|lzop|lz4|zstd|<compressor [args ...]>}__"::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass arguments, it will be called
--
2.33.0

View File

@ -0,0 +1,27 @@
From acfd97a94385c33cd6cef4e5a37f233ea4081288 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 9 Sep 2021 11:34:18 +0200
Subject: [PATCH] fix(dracut.sh): change misspelled variable name
Reference:https://github.com/dracutdevs/dracut/commit/acfd97a94385c33cd6cef4e5a37f233ea4081288
Conflict:NA
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 3826c73e..19d21ed9 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2336,7 +2336,7 @@ fi
if ! [[ $compress ]]; then
# check all known compressors, if none specified
- for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $OMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do
+ for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do
command -v "$i" &> /dev/null || continue
compress="$i"
break
--
2.27.0

View File

@ -0,0 +1,73 @@
From b9dc999f87a477af53e379d7fb1053d13d6dbe88 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 11 Jul 2022 12:52:58 +0200
Subject: [PATCH] fix(dracut.sh): correct wrong systemd variable paths
systemdsystemconfdir usually expands to /etc/systemd/system, but the local
configuration of systemd-networkd, systemd-timesyncd, portablectl and systemd
users is saved into directories whose parent is /etc/systemd
(systemdutilconfdir).
Also add missing exports.
Reference:https://github.com/dracutdevs/dracut/commit/b9dc999f87a477af53e379d7fb1053d13d6dbe88
Conflict:NA
---
dracut.sh | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 0ed86e1e..d3e1df39 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1833,7 +1833,7 @@ fi
[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] \
|| systemdnetworkconfdir=$(pkg-config systemd --variable=systemdnetworkconfdir 2> /dev/null)
-[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] || systemdnetworkconfdir=${systemdsystemconfdir}/network
+[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] || systemdnetworkconfdir=${systemdutilconfdir}/network
[[ -d $dracutsysrootdir$systemdntpunits ]] \
|| systemdntpunits=$(pkg-config systemd --variable=systemdntpunits 2> /dev/null)
@@ -1843,7 +1843,7 @@ fi
[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] \
|| systemdntpunitsconfdir=$(pkg-config systemd --variable=systemdntpunitsconfdir 2> /dev/null)
-[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] || systemdntpunitsconfdir=${systemdsystemconfdir}/ntp-units.d
+[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] || systemdntpunitsconfdir=${systemdutilconfdir}/ntp-units.d
[[ -d $dracutsysrootdir$systemdportable ]] \
|| systemdportable=$(pkg-config systemd --variable=systemdportable 2> /dev/null)
@@ -1853,7 +1853,7 @@ fi
[[ -d $dracutsysrootdir$systemdportableconfdir ]] \
|| systemdportableconfdir=$(pkg-config systemd --variable=systemdportableconfdir 2> /dev/null)
-[[ -d "$dracutsysrootdir$systemdportableconfdir" ]] || systemdportableconfdir=${systemdsystemconfdir}/portable
+[[ -d "$dracutsysrootdir$systemdportableconfdir" ]] || systemdportableconfdir=${systemdutilconfdir}/portable
[[ -d $dracutsysrootdir$systemdsystemunitdir ]] \
|| systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2> /dev/null)
@@ -1868,7 +1868,7 @@ fi
[[ -d $dracutsysrootdir$systemduserconfdir ]] \
|| systemduserconfdir=$(pkg-config systemd --variable=systemduserconfdir 2> /dev/null)
-[[ -d $dracutsysrootdir$systemduserconfdir ]] || systemduserconfdir=${systemdsystemconfdir}/user
+[[ -d $dracutsysrootdir$systemduserconfdir ]] || systemduserconfdir=${systemdutilconfdir}/user
[[ -d $dracutsysrootdir$systemdsystemconfdir ]] \
|| systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2> /dev/null)
@@ -1922,8 +1922,10 @@ export initdir dracutbasedir \
dbussessionconfdir dbussystem dbussystemconfdir dbussystemservices \
dbussystemservicesconfdir environment environmentconfdir modulesload \
modulesloadconfdir sysctld sysctlconfdir sysusers sysusersconfdir \
- systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \
- systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \
+ systemdutildir systemdutilconfdir systemdcatalog systemdnetwork \
+ systemdnetworkconfdir systemdntpunits systemdntpunitsconfdir \
+ systemdportable systemdportableconfdir systemdsystemunitdir \
+ systemdsystemconfdir systemduser systemduserconfdir \
hostonly_cmdline loginstall tmpfilesdir tmpfilesconfdir depmodd \
depmodconfdir
--
2.23.0

View File

@ -0,0 +1,49 @@
From 7de9ffc0574790ecbad74b5a000ecd022d7736d4 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 14 Oct 2021 17:10:27 +0200
Subject: [PATCH] fix(dracut.sh): do not ignore invalid config file or dir path
Fix issue #1136
Reference:https://github.com/dracutdevs/dracut/commit/7de9ffc0574790ecbad74b5a000ecd022d7736d4
Conflict:NA
---
dracut.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index ce54a851..20556762 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -891,20 +891,26 @@ export DRACUT_LOG_LEVEL=warning
[[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/lib/dracut
# if we were not passed a config file, try the default one
-if [[ ! -f $conffile ]]; then
+if [[ -z $conffile ]]; then
if [[ $allowlocal ]]; then
conffile="$dracutbasedir/dracut.conf"
else
conffile="$dracutsysrootdir/etc/dracut.conf"
fi
+elif [[ ! -f $conffile ]]; then
+ printf "%s\n" "dracut: Configuration file '$conffile' not found." >&2
+ exit 1
fi
-if [[ ! -d $confdir ]]; then
+if [[ -z $confdir ]]; then
if [[ $allowlocal ]]; then
confdir="$dracutbasedir/dracut.conf.d"
else
confdir="$dracutsysrootdir/etc/dracut.conf.d"
fi
+elif [[ ! -d $confdir ]]; then
+ printf "%s\n" "dracut: Configuration directory '$confdir' not found." >&2
+ exit 1
fi
# source our config file
--
2.27.0

View File

@ -0,0 +1,45 @@
From 4c355d05587b0432a6dc551b8693dbdc51a07962 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 24 Feb 2022 09:36:02 +0100
Subject: [PATCH 1/1] fix(dracut.sh): error exporting sysctl variables
- Typo assigning depmodd and depmodconfdir.
- Typo exporting a variable called sysctl instead of sysctld.
Reference:https://github.com/dracutdevs/dracut/commit/4c355d05587b0432a6dc551b8693dbdc51a07962
Conflict:NA
---
dracut.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 0a3f5974..afc6fd04 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1798,12 +1798,12 @@ fi
[[ -d $dracutsysrootdir$tmpfilesconfdir ]] || tmpfilesconfdir=/etc/tmpfiles.d
[[ -d $dracutsysrootdir$depmodd ]] \
- || sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null)
+ || depmodd=$(pkg-config libkmod --variable=depmodd 2> /dev/null)
[[ -d $dracutsysrootdir$depmodd ]] || depmodd=/usr/lib/depmod.d
[[ -d $dracutsysrootdir$depmodconfdir ]] \
- || sysctlconfdir=$(pkg-config libkmod --variable=depmodconfdir 2> /dev/null)
+ || depmodconfdir=$(pkg-config libkmod --variable=depmodconfdir 2> /dev/null)
[[ -d $dracutsysrootdir$depmodconfdir ]] || depmodconfdir=/etc/depmod.d
@@ -1820,7 +1820,7 @@ export initdir dracutbasedir \
dbusinterfacesconfdir dbusservices dbusservicesconfdir dbussession \
dbussessionconfdir dbussystem dbussystemconfdir dbussystemservices \
dbussystemservicesconfdir environment environmentconfdir modulesload \
- modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \
+ modulesloadconfdir sysctld sysctlconfdir sysusers sysusersconfdir \
systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \
systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \
hostonly_cmdline loginstall tmpfilesdir tmpfilesconfdir depmodd \
--
2.28.0.windows.1

View File

@ -0,0 +1,86 @@
From f1138012c9dc44e6614466c0a8e929fc55e4a5dd Mon Sep 17 00:00:00 2001
From: Hari Bathini <hbathini@linux.ibm.com>
Date: Fri, 11 Jun 2021 15:20:28 +0530
Subject: [PATCH] fix(dracut.sh): handle '-i' option to include files beginning
with '.'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
While including a directory using '--include' option, the file and
subdirectory names that begin with '.' are not included. Also, dracut
throws a warning message when a subdirectory is empty or only has
files or subdirectories that begin with '.'.
For example, while trying to include /tmpdata directory with the
below tree:
# tree -a /tmpdata
/tmpdata
├── .anothertestdir
├── testdir
│   └── .testsubdir
└── .testfile
dracut throws the below warning message:
# dracut --include /tmpdata /root
cp: cannot stat '/tmpdata/testdir/*': No such file or directory
#
and this is how the included /tmpdata directory tree looks:
# tree -a root
root
└── testdir
No file or directory beginning with '.' is included & also, copying
/tmpdata/testdir reported "No such file or directory" warning. Using
'.' instead of '*' in the below command will fix the warning whether
the directory being copied is empty or only has files or directories
that begin with dot:
$DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*
Also, enable 'dotglob' temporarily to include files and directories
beginning with a `.' in the results of pathname expansion of source
directory being included.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Reference:https://github.com/dracutdevs/dracut/commit/f1138012c9dc44e6614466c0a8e929fc55e4a5dd
Conflict:NA
---
dracut.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 60ac46f4..e7f47752 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2067,6 +2067,8 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
# check for preexisting symlinks, so we can cope with the
# symlinks to $prefix
# Objectname is a file or a directory
+ reset_dotglob="$(shopt -p dotglob)"
+ shopt -q -s dotglob
for objectname in "$src"/*; do
[[ -e $objectname || -L $objectname ]] || continue
if [[ -d $objectname ]]; then
@@ -2077,11 +2079,12 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
mkdir -m 0755 -p "$object_destdir"
chmod --reference="$objectname" "$object_destdir"
fi
- $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*
+ $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/.
else
$DRACUT_CP -t "$destdir" "$dracutsysrootdir$objectname"
fi
done
+ eval "$reset_dotglob"
elif [[ -e $src ]]; then
derror "$src is neither a directory nor a regular file"
else
--
2.27.0

View File

@ -0,0 +1,34 @@
From c7fbc0c8901917baf0d1f0822568e65c6ec00d18 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Sat, 12 Jun 2021 02:25:09 +0800
Subject: [PATCH] fix(dracut.sh): handle symlinks appropriately while using
'-i' option
[[ -d $symlink ]] will return true if the symlink points to a directory.
So the symlink will not be copied, instead a directory is created with
the symlink name and the content is copied.
Signed-off-by: Kairui Song <kasong@redhat.com>
Reference:https://github.com/dracutdevs/dracut/commit/c7fbc0c8901917baf0d1f0822568e65c6ec00d18
Conflict:NA
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index e7f47752..78917763 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2071,7 +2071,7 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
shopt -q -s dotglob
for objectname in "$src"/*; do
[[ -e $objectname || -L $objectname ]] || continue
- if [[ -d $objectname ]]; then
+ if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then
# objectname is a directory, let's compute the final directory name
object_destdir=${destdir}/${objectname#$src/}
if ! [[ -e $object_destdir ]]; then
--
2.27.0

View File

@ -0,0 +1,27 @@
From f1245b5bc13a98ef0dcc679dcef6148214e09503 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Wed, 8 Sep 2021 14:02:01 +0200
Subject: [PATCH] fix(dracut.sh): remove wrong $ in loop sequence
Reference:https://github.com/dracutdevs/dracut/commit/f1245b5bc13a98ef0dcc679dcef6148214e09503
Conflict:NA
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 78917763..3826c73e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -2336,7 +2336,7 @@ fi
if ! [[ $compress ]]; then
# check all known compressors, if none specified
- for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $ $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $OMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do
+ for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $OMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do
command -v "$i" &> /dev/null || continue
compress="$i"
break
--
2.27.0

View File

@ -0,0 +1,31 @@
From 7103c4bce9240d5896a0d207c216e0f6270ad2e8 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Wed, 6 Apr 2022 10:25:23 +0200
Subject: [PATCH] fix(ifcfg): avoid calling unavailable dracut-logger functions
The dracut-logger functions are only available during the initrd
generation. For internal initrd scripts that run at boot,
dracut-lib provides warn() and info().
Reference:https://github.com/dracutdevs/dracut/commit/7103c4bce9240d5896a0d207c216e0f6270ad2e8
Conflict:NA
---
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 345863f9..854d294d 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -104,7 +104,7 @@ interface_bind() {
local _macaddr="$2"
if [ ! -e "/sys/class/net/$_netif" ]; then
- derror "Cannot find network interface '$_netif'!"
+ warn "Cannot find network interface '$_netif'!"
return 1
fi
--
2.23.0

View File

@ -0,0 +1,29 @@
From 51ce8893d981e90640123a7dcc3e4f3621e7d819 Mon Sep 17 00:00:00 2001
From: Henrik Gombos <henrik99999@gmail.com>
Date: Thu, 25 Nov 2021 18:08:57 -0500
Subject: [PATCH] fix(img-lib): install rmdir
rmdir is used in img-lib module.
Reference:https://github.com/dracutdevs/dracut/commit/51ce8893d981e90640123a7dcc3e4f3621e7d819
Conflict:NA
---
modules.d/99img-lib/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99img-lib/module-setup.sh b/modules.d/99img-lib/module-setup.sh
index 558a9256..4f57b37f 100755
--- a/modules.d/99img-lib/module-setup.sh
+++ b/modules.d/99img-lib/module-setup.sh
@@ -14,7 +14,7 @@ depends() {
# called by dracut
install() {
- inst_multiple tar gzip dd echo tr
+ inst_multiple tar gzip dd echo tr rmdir
# TODO: make this conditional on a cmdline flag / config option
inst_multiple -o cpio xz bzip2 zstd
inst_simple "$moddir/img-lib.sh" "/lib/img-lib.sh"
--
2.23.0

View File

@ -0,0 +1,29 @@
From 5c2f72f152ec319a8001d1ff0bfd1f81a9130b04 Mon Sep 17 00:00:00 2001
From: Andrey Sokolov <keremet@altlinux.org>
Date: Thu, 21 Oct 2021 09:01:07 +0300
Subject: [PATCH] fix(install): segfault on popen error
Reference:https://github.com/dracutdevs/dracut/commit/5c2f72f152ec319a8001d1ff0bfd1f81a9130b04
Conflict:NA
---
src/install/dracut-install.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 4ec65a5a..9a53be15 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -550,6 +550,10 @@ static int resolve_deps(const char *src)
ret = 0;
fptr = popen(cmd, "r");
+ if (fptr == NULL) {
+ log_error("Error '%s' initiating pipe stream from '%s'", strerror(errno), cmd);
+ exit(EXIT_FAILURE);
+ }
while (!feof(fptr)) {
char *p;
--
2.27.0

View File

@ -0,0 +1,35 @@
From 846a845375b8a9ea48741079d523e6b464950ea7 Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Tue, 14 Jun 2022 10:44:01 -0400
Subject: [PATCH] fix(install.d): add --verbose if KERNEL_INSTALL_VERBOSE=1
If KERNEL_INSTALL_VERBOSE=1, let's make sure dracut also produces
extended output for debugging purposes.
Reference:https://github.com/dracutdevs/dracut/commit/846a845375b8a9ea48741079d523e6b464950ea7
Conflict:NA
---
install.d/50-dracut.install | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install
index 70632ec7..a81c41c9 100755
--- a/install.d/50-dracut.install
+++ b/install.d/50-dracut.install
@@ -54,7 +54,12 @@ case "$COMMAND" in
break
fi
done
- dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
+
+ dracut -f \
+ ${noimageifnotneeded:+--noimageifnotneeded} \
+ $([[ "$KERNEL_INSTALL_VERBOSE" == 1 ]] && echo --verbose) \
+ "$BOOT_DIR_ABS/$INITRD" \
+ "$KERNEL_VERSION"
ret=$?
;;
remove)
--
2.23.0

View File

@ -0,0 +1,32 @@
From f63f411d52df613936082d646ab072447b8b9d7f Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Tue, 24 May 2022 16:34:04 +0200
Subject: [PATCH] fix(integrity): do not display any error if there is no IMA
certificate
IMA appraisal can be used without digital signatures, just by storing hash
digests instead.
Reference:https://github.com/dracutdevs/dracut/commit/f63f411d52df613936082d646ab072447b8b9d7f
Conflict:NA
---
modules.d/98integrity/ima-keys-load.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98integrity/ima-keys-load.sh b/modules.d/98integrity/ima-keys-load.sh
index 2959331a..be234761 100755
--- a/modules.d/98integrity/ima-keys-load.sh
+++ b/modules.d/98integrity/ima-keys-load.sh
@@ -17,8 +17,7 @@ load_x509_keys() {
IMAKEYSDIR="/etc/keys/ima"
fi
- PUBKEY_LIST=$(ls "${NEWROOT}"${IMAKEYSDIR}/*)
- for PUBKEY in ${PUBKEY_LIST}; do
+ for PUBKEY in "${NEWROOT}${IMAKEYSDIR}"/*; do
# check for public key's existence
if [ ! -f "${PUBKEY}" ]; then
if [ "${RD_DEBUG}" = "yes" ]; then
--
2.23.0

View File

@ -0,0 +1,34 @@
From 319dc7fe10585a19d1a051f8ad1ba0190f86ff1f Mon Sep 17 00:00:00 2001
From: Wenchao Hao <haowenchao@huawei.com>
Date: Fri, 29 Apr 2022 14:09:02 +0800
Subject: [PATCH] fix(iscsi): do not exit in handle_netroot() if discovery
failed
User may specify multiple netroot in cmdline, failed to connect one netroot
do not mean all netroot are not accessible. So if one netroot failed, do
not exit the discovery and login flow.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/319dc7fe10585a19d1a051f8ad1ba0190f86ff1f
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
---
modules.d/95iscsi/iscsiroot.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index b326111f..63b4ce19 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -229,7 +229,7 @@ handle_netroot() {
echo "$target"
done
})
- [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
+ [ -z "$targets" ] && warn "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && return 1
found=
for target in $targets; do
--
2.32.0

View File

@ -0,0 +1,29 @@
From 5eb996a9936a87918a4320963a8681975ed86be4 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 28 Jul 2022 10:26:34 +0200
Subject: [PATCH] fix(lsinitrd.sh): correct skipcpio source path
Reference:https://github.com/dracutdevs/dracut/commit/5eb996a9936a87918a4320963a8681975ed86be4
Conflict:NA
---
lsinitrd.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index 39be169d..99fd13f5 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -288,8 +288,8 @@ case $bin in
echo "Early CPIO image"
list_files
fi
- if [[ -d "$dracutbasedir/skipcpio" ]]; then
- SKIP="$dracutbasedir/skipcpio/skipcpio"
+ if [[ -d "$dracutbasedir/src/skipcpio" ]]; then
+ SKIP="$dracutbasedir/src/skipcpio/skipcpio"
else
SKIP="$dracutbasedir/skipcpio"
fi
--
2.23.0

View File

@ -0,0 +1,31 @@
From 4855242ce5cb586afd2eebd91df57ce1d28ae6b5 Mon Sep 17 00:00:00 2001
From: Alexander Wenzel <alexander.wenzel@qbeyond.de>
Date: Fri, 12 Nov 2021 06:58:05 +0100
Subject: [PATCH] fix(man): default value of rd.retry was increased to 180
seconds
The man page still states the old value of 30 seconds,
which does not reflect the current situation of 180 seconds.
Reference:https://github.com/dracutdevs/dracut/commit/4855242ce5cb586afd2eebd91df57ce1d28ae6b5
Conflict:NA
---
man/dracut.cmdline.7.asc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc
index bb351f4e..23f8b8d8 100644
--- a/man/dracut.cmdline.7.asc
+++ b/man/dracut.cmdline.7.asc
@@ -151,7 +151,7 @@ Misc
**rd.retry=**__<seconds>__::
specify how long dracut should retry the initqueue to configure devices.
- The default is 30 seconds. After 2/3 of the time, degraded raids are force
+ The default is 180 seconds. After 2/3 of the time, degraded raids are force
started. If you have hardware, which takes a very long time to announce its
drives, you might want to extend this value.
--
2.27.0

View File

@ -0,0 +1,51 @@
From 9491e599282d0d6bb12063eddbd192c0d2ce8acf Mon Sep 17 00:00:00 2001
From: Luca BRUNO <luca.bruno@coreos.com>
Date: Thu, 23 Sep 2021 09:05:44 +0000
Subject: [PATCH] fix(multipath): drop ExecStop= setting from service unit
This removes the 'ExecStop=' field from `multipathd.service`.
Sometimes CI runs do encounter a failure related to this
service in initrd, which seems to be stemming from a socket
I/O race between the client and the server on shutdown.
It looks like the client (`multipathd shutdown`) can lose the race,
hit an I/O error, and cause the whole unit to fail (even if the server
managed to shutdown properly already).
Notably, the upstream unit does not have such stop command
as the daemon can already perform a graceful exit through
its signal handler.
As such, this commit partially re-aligns the two units,
trying to sidestep any of the existing races.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/9491e599282d0d6bb12063eddbd192c0d2ce8acf
Refs:
* https://github.com/coreos/fedora-coreos-tracker/issues/803
* https://github.com/opensvc/multipath-tools/blob/0.8.7/multipathd/multipathd.service
---
modules.d/90multipath/multipathd.service | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service
index b544de21..75c51305 100644
--- a/modules.d/90multipath/multipathd.service
+++ b/modules.d/90multipath/multipathd.service
@@ -14,11 +14,11 @@ ConditionKernelCommandLine=!rd_NO_MULTIPATH
ConditionKernelCommandLine=!multipath=off
[Service]
-Type=simple
+Type=notify
+NotifyAccess=main
ExecStartPre=-/sbin/modprobe dm-multipath
ExecStart=/sbin/multipathd -s -d
ExecReload=/sbin/multipathd reconfigure
-ExecStop=/sbin/multipathd shutdown
[Install]
WantedBy=sysinit.target
--
2.32.0

View File

@ -0,0 +1,69 @@
From 7938935267dd8824f074adf84c219340ad4c8db6 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Mon, 22 Nov 2021 16:40:39 +0100
Subject: [PATCH] fix(network): add errors and warnings when network interface
does not exist
End with error, or show a warning when nonexistent device is specified for network setup like
`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`.
I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written.
Resolves: #1712424
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/7938935267dd8824f074adf84c219340ad4c8db6
---
modules.d/35network-legacy/ifup.sh | 6 +++++-
modules.d/35network-legacy/parse-ip-opts.sh | 5 +++++
modules.d/45ifcfg/write-ifcfg.sh | 5 +++++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index a05c46980..0dc9541c8 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -446,7 +446,11 @@ for p in $(getargs ip=); do
# If this option isn't directed at our interface, skip it
if [ -n "$dev" ]; then
- [ "$dev" != "$netif" ] && continue
+ if [ "$dev" != "$netif" ]; then
+ [ ! -e "/sys/class/net/$dev" ] \
+ && warn "Network interface '$dev' does not exist!"
+ continue
+ fi
else
iface_is_enslaved "$netif" && continue
fi
diff --git a/modules.d/35network-legacy/parse-ip-opts.sh b/modules.d/35network-legacy/parse-ip-opts.sh
index 35917bbfb..19af87896 100755
--- a/modules.d/35network-legacy/parse-ip-opts.sh
+++ b/modules.d/35network-legacy/parse-ip-opts.sh
@@ -97,6 +97,11 @@ for p in $(getargs ip=); do
fi
# IFACES list for later use
IFACES="$IFACES $dev"
+
+ # Interface should exist
+ if [ ! -e "/sys/class/net/$dev" ]; then
+ warn "Network interface '$dev' does not exist"
+ fi
fi
# Do we need to check for specific options?
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 5f71515ac..345863f99 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -103,6 +103,11 @@ interface_bind() {
local _netif="$1"
local _macaddr="$2"
+ if [ ! -e "/sys/class/net/$_netif" ]; then
+ derror "Cannot find network interface '$_netif'!"
+ return 1
+ fi
+
# see, if we can bind it to some hw parms
if hw_bind "$_netif" "$_macaddr"; then
# only print out DEVICE, if it's user assigned

View File

@ -0,0 +1,27 @@
From 2c26b703223bb65822954264bcd6ca7934c98b4a Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Sat, 17 Sep 2022 23:56:08 +0200
Subject: [PATCH] fix(network): avoid double brackets around IPv6 address
This code would add brackets twice. Fix it.
Reference:https://github.com/dracutdevs/dracut/commit/2c26b703223bb65822954264bcd6ca7934c98b4a
Conflict:NA
---
modules.d/40network/net-lib.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 8b876926..4b972c78 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -307,7 +307,6 @@ ibft_to_cmdline() {
[ -e "${iface}"/hostname ] && read -r hostname < "${iface}"/hostname
if [ "$family" = "ipv6" ]; then
if [ -n "$ip" ]; then
- ip="[$ip]"
[ -n "$prefix" ] || prefix=64
ip="[${ip}/${prefix}]"
mask=
--
2.23.0

View File

@ -0,0 +1,38 @@
From f4e9ea879f38bea92069e9397028caa5d81e5aee Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Sat, 17 Sep 2022 23:05:39 +0200
Subject: [PATCH] fix(network): don't use same ifname multiple times
If multiple ibft interfaces exist, set_ifname() may reuse the same
name (usually "ibft0"), because it's usually called cmdline time,
when no interfaces exist in sysfs yet. Remember the number used
set and don't use it again.
Reference:https://github.com/dracutdevs/dracut/commit/f4e9ea879f38bea92069e9397028caa5d81e5aee
Conflict:NA
---
modules.d/40network/net-lib.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index a294a390..8b876926 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -222,6 +222,7 @@ set_ifname() {
for n in $(getargs ifname=); do
strstr "$n" "$mac" && echo "${n%%:*}" && return
done
+ [ ! -f "/tmp/set_ifname_$name" ] || read -r num < "/tmp/set_ifname_$name"
# otherwise, pick a new name and use that
while :; do
num=$((num + 1))
@@ -232,6 +233,7 @@ set_ifname() {
break
done
echo "ifname=$name$num:$mac" >> /etc/cmdline.d/45-ifname.conf
+ echo "$num" > "/tmp/set_ifname_$name"
echo "$name$num"
}
--
2.23.0

View File

@ -0,0 +1,28 @@
From 2eb733cc11c09358b79e2c73218953f5bb64da93 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 11 Jul 2022 13:08:40 +0200
Subject: [PATCH] fix(network-legacy): correct wrong local network
configuration path
Reference:https://github.com/dracutdevs/dracut/commit/2eb733cc11c09358b79e2c73218953f5bb64da93
Conflict:NA
---
modules.d/35network-legacy/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh
index 84dcf7f5..a3d6e677 100755
--- a/modules.d/35network-legacy/module-setup.sh
+++ b/modules.d/35network-legacy/module-setup.sh
@@ -25,7 +25,7 @@ install() {
#Adding default link
if dracut_module_included "systemd"; then
inst_multiple -o "${systemdutildir}/network/99-default.link"
- [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link"
+ [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
fi
inst_multiple ip dhclient sed awk grep pgrep tr expr
--
2.23.0

View File

@ -0,0 +1,27 @@
From 744c6de5cde38d012f93bc53f9076bf9c37b8b72 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 11 Jul 2022 13:08:57 +0200
Subject: [PATCH] fix(network-manager): correct wrong local network
configuration path
Reference:https://github.com/dracutdevs/dracut/commit/744c6de5cde38d012f93bc53f9076bf9c37b8b72
Conflict:NA
---
modules.d/35network-manager/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index 04898a39..8299a0fd 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -53,7 +53,7 @@ install() {
# Adding default link
inst_multiple -o "${systemdutildir}/network/99-default.link"
- [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link"
+ [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
$SYSTEMCTL -q --root "$initdir" enable nm-initrd.service
fi
--
2.23.0

View File

@ -0,0 +1,29 @@
From d9c3c77437d91d7d66369a3ef701ffc5e501346d Mon Sep 17 00:00:00 2001
From: Glenn Morris <rgm@stanford.edu>
Date: Wed, 8 Dec 2021 14:08:35 -0800
Subject: [PATCH] fix(network-manager): skip non-directories in /sys/class/net
There can be files in this directory, eg "bonding_masters" if a
network bond is in use.
Reference:https://github.com/dracutdevs/dracut/commit/d9c3c77437d91d7d66369a3ef701ffc5e501346d
Conflict:context adaptation
---
modules.d/35network-manager/nm-run.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index 359bc9e..1e71e9a 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -25,6 +25,7 @@ if [ -s /run/NetworkManager/initrd/hostname ]; then
fi
for _i in /sys/class/net/*; do
+ [ -d "$_i" ] || continue
state=/run/NetworkManager/devices/$(cat "$_i"/ifindex)
grep -q connection-uuid= "$state" 2> /dev/null || continue
ifname=${_i##*/}
--
2.33.0

View File

@ -0,0 +1,28 @@
From d615934311e25146bb37943bf1385a19dfdbd9e8 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Wed, 20 Apr 2022 15:33:51 +0200
Subject: [PATCH] fix(nfs): give /run/rpcbind ownership to rpc user
Avoid errors when rpcbind tries to write to the /run/rpcbind directory.
Reference:https://github.com/dracutdevs/dracut/commit/d615934311e25146bb37943bf1385a19dfdbd9e8
Conflict:NA
---
modules.d/95nfs/nfs-start-rpc.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95nfs/nfs-start-rpc.sh b/modules.d/95nfs/nfs-start-rpc.sh
index fd64ca27..69fcfd5a 100755
--- a/modules.d/95nfs/nfs-start-rpc.sh
+++ b/modules.d/95nfs/nfs-start-rpc.sh
@@ -9,6 +9,7 @@ if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then
command -v portmap > /dev/null && [ -z "$(pidof portmap)" ] && portmap
if command -v rpcbind > /dev/null && [ -z "$(pidof rpcbind)" ]; then
mkdir -p /run/rpcbind
+ chown rpc:rpc /run/rpcbind
rpcbind
fi
--
2.23.0

View File

@ -0,0 +1,38 @@
From 0e4df7a39dda388dc71ff6f749c8197cba4442b9 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Wed, 20 Apr 2022 15:32:54 +0200
Subject: [PATCH] fix(nfs): require and install needed binaries
parse-nfsroot.sh requires sed, chmod and chown.
Reference:https://github.com/dracutdevs/dracut/commit/0e4df7a39dda388dc71ff6f749c8197cba4442b9
Conflict:NA
---
modules.d/95nfs/module-setup.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 38da5957..16bafe30 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -21,7 +21,7 @@ get_nfs_type() {
check() {
# If our prerequisites are not met, fail anyways.
require_any_binary rpcbind portmap || return 1
- require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
+ require_binaries rpc.statd mount.nfs mount.nfs4 umount sed chmod chown || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
[[ "$(get_nfs_type)" ]] && return 0
@@ -76,7 +76,7 @@ cmdline() {
# called by dracut
install() {
local _nsslibs
- inst_multiple -o rpc.idmapd mount.nfs mount.nfs4 umount sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf"
+ inst_multiple -o rpc.idmapd mount.nfs mount.nfs4 umount sed /etc/netconfig chmod chown "$tmpfilesdir/rpcbind.conf"
inst_multiple -o /etc/idmapd.conf
inst_multiple -o /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols
inst_multiple -o /usr/etc/services /usr/etc/nsswitch.conf /usr/etc/rpc /usr/etc/protocols
--
2.23.0

View File

@ -0,0 +1,37 @@
From 6c71ba4121ae64ccd13fefba68ca327ac623810f Mon Sep 17 00:00:00 2001
From: Coiby Xu <coxu@redhat.com>
Date: Wed, 14 Jul 2021 15:26:10 +0800
Subject: [PATCH] fix(qeth_rules): check the existence of
/sys/devices/qeth/*/online beforehand
On s390x KVM machines, the follow errors occurred,
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
/usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.
Reference:https://github.com/dracutdevs/dracut/commit/6c71ba4121ae64ccd13fefba68ca327ac623810f
Conflict:NA
---
modules.d/95qeth_rules/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
index 914a28ce..884ae072 100755
--- a/modules.d/95qeth_rules/module-setup.sh
+++ b/modules.d/95qeth_rules/module-setup.sh
@@ -10,6 +10,7 @@ check() {
[[ $hostonly ]] && {
for i in /sys/devices/qeth/*/online; do
+ [ ! -f "$i" ] && continue
read -r _online < "$i"
[ "$_online" -eq 1 ] && return 0
done
--
2.27.0

View File

@ -0,0 +1,33 @@
From 0b97790626bff3579755b38f78a9c524a075cfcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Wed, 10 Nov 2021 12:14:15 +0100
Subject: [PATCH] fix(resume): check for presence of /sys/power/resume
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On platforms where the kernel is built without suspend/resume support we
see "cat: /sys/power/resume: No such file or directory" message when
creating an initrd image. Check for the presence of /sys/power/resume
first before reading it.
Signed-off-by: Dan Horák <dan@danny.cz>
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/0b97790626bff3579755b38f78a9c524a075cfcc
---
modules.d/95resume/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index f0507b136..b47acbece 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -13,7 +13,7 @@ check() {
# Only support resume if hibernation is currently on
# and no swap is mounted on a net device
[[ $hostonly ]] || [[ $mount_needs ]] && {
- swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+ swap_on_netdevice || [[ -f /sys/power/resume && "$(cat /sys/power/resume)" == "0:0" ]] && return 255
}
return 0

View File

@ -0,0 +1,34 @@
From a7a4b76c4ad5794f5f8a24ecd5b495f1512d05f7 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Fri, 1 Apr 2022 10:04:30 +0200
Subject: [PATCH] fix(resume): correct call to block_is_netdevice function
The block_is_netdevice function requires the device in <maj:min>
format, but the swap_devs array is populated with the content of
/proc/swaps, which prints the devices using their paths from /dev.
This causes the check method to never detect if swap is mounted on a
network device.
Reference:https://github.com/dracutdevs/dracut/commit/a7a4b76c4ad5794f5f8a24ecd5b495f1512d05f7
Conflict:NA
---
modules.d/95resume/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index 7e629435..5e891048 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -5,7 +5,7 @@ check() {
swap_on_netdevice() {
local _dev
for _dev in "${swap_devs[@]}"; do
- block_is_netdevice "$_dev" && return 0
+ block_is_netdevice "$(get_maj_min "$_dev")" && return 0
done
return 1
}
--
2.23.0

View File

@ -0,0 +1,39 @@
From b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
Date: Tue, 16 Nov 2021 11:15:52 +0100
Subject: [PATCH] fix(shutdown): be robust against forced shutdown
When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del
keys, systemd sends SIGTERM to all processes. This ends up killing
dracut-initramfs-restore as well, preventing the script from detecting
that the unpack of the initramfs is incomplete, which later causes a
crash to happen when "shutdown" tries to execute from the unpacked
initramfs.
This fix makes sure dracut-initramfs-restore remains alive to detect
the unpack failed (because cpio was killed by systemd too).
Refs:
* https://bugzilla.redhat.com/show_bug.cgi?id=2023665
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/b9ba3c8bb8f0f1328cd1ffaa8dbf64585b28c474
---
dracut-initramfs-restore.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index abe6b1e20..d97030a34 100644
--- a/dracut-initramfs-restore.sh
+++ b/dracut-initramfs-restore.sh
@@ -6,6 +6,11 @@ set -e
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0
+# SIGTERM signal is received upon forced shutdown: ignore the signal
+# We want to remain alive to be able to trap unpacking errors to avoid
+# switching root to an incompletely unpacked initramfs
+trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM
+
KERNEL_VERSION="$(uname -r)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut

View File

@ -0,0 +1,43 @@
From 5ab18dee996f0eeb2b0bfe354570e1b1af46d025 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 9 Aug 2021 18:23:43 +0800
Subject: [PATCH] fix(squash): apply FIPS and libpthread workaround
There are some workarounds in dracut.sh for FIPS/libpthread covering
some hidden lib dependency issues. These workarounds didn't take effect
for the squash loader since the squash loader is installed
independently. So apply these workarounds again.
Also skip the lib detection code, since these extra installed libs
are small, and squash loader contents are dropped after switch root,
won't be an issue to be always installed. And this makes the code
cleaner.
Signed-off-by: Kairui Song <kasong@redhat.com>
Conflict:code context adaptation
Reference:https://github.com/dracutdevs/dracut/commit/5ab18dee996f0eeb2b0bfe354570e1b1af46d025
---
modules.d/99squash/module-setup.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index e14c4fe2..c42eb679 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -52,6 +52,12 @@ installpost() {
done
else
DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep
+
+ # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
+ inst_libdir_file -o "libgcc_s.so*"
+
+ # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled
+ [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*"
fi
hostonly="" instmods "loop" "squashfs" "overlay"
--
2.33.0

View File

@ -0,0 +1,27 @@
From 2f091b17075f81ff490b05d3d566d736fc32f0be Mon Sep 17 00:00:00 2001
From: Masahiro Matsuya <mmatsuya@redhat.com>
Date: Fri, 11 Jun 2021 10:40:04 +0900
Subject: [PATCH] fix(url-lib): make pre-pivot hook separetely per nfs mount
Reference:https://github.com/dracutdevs/dracut/commit/2f091b17075f81ff490b05d3d566d736fc32f0be
Conflict:NA
---
modules.d/45url-lib/url-lib.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
index e1e7d5af..972596a1 100755
--- a/modules.d/45url-lib/url-lib.sh
+++ b/modules.d/45url-lib/url-lib.sh
@@ -159,7 +159,7 @@ nfs_fetch_url() {
mntdir="$(mkuniqdir /run nfs_mnt)"
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir"
# lazy unmount during pre-pivot hook
- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l -- "$mntdir"
+ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-$(basename $mntdir) umount -l -- "$mntdir"
fi
if [ -z "$outloc" ]; then
--
2.27.0

View File

@ -9,7 +9,7 @@
Name: dracut
Version: 055
Release: 10
Release: 11
Summary: Initramfs generator using udev
@ -46,6 +46,58 @@ Patch19: backport-fix-dracut.sh-exit-if-resolving-executable-dependenc.patch
Patch20: backport-fix-dracut-install-protect-against-broken-links-poin.patch
Patch21: backport-fix-mdraid-allow-UUID-comparison-for-more-than-one-U.patch
Patch6000: backport-fix-dracut.sh-handle-i-option-to-include-files-begin.patch
Patch6001: backport-fix-dracut.sh-handle-symlinks-appropriately-while-us.patch
Patch6002: backport-fix-crypt-gpg-execute-card-status-on-each-try.patch
Patch6003: backport-fix-url-lib-make-pre-pivot-hook-separetely-per-nfs-m.patch
Patch6004: backport-fix-SC2086-Double-quote-to-prevent-globbing-and-word.patch
Patch6005: backport-fix-SC2046-Quote-this-to-prevent-word-splitting.patch
Patch6006: backport-fix-qeth_rules-check-the-existence-of-sys-devices-qe.patch
Patch6007: backport-fix-dracut-install-tweaks-to-get_real_file.patch
Patch6008: backport-fix-base-tr-needs-to-be-installed.patch
Patch6009: backport-fix-dracut.sh-remove-wrong-in-loop-sequence.patch
Patch6010: backport-fix-dracut.sh-change-misspelled-variable-name.patch
Patch6011: backport-fix-dmsquash-live-iso-scan-requires-rmdir.patch
Patch6012: backport-fix-install-segfault-on-popen-error.patch
Patch6013: backport-fix-shutdown-be-robust-against-forced-shutdown.patch
Patch6014: backport-fix-man-default-value-of-rd.retry-was-increased-to-180-seconds.patch
Patch6015: backport-fix-network-add-errors-and-warnings-when-network-interface-does-not-exist.patch
Patch6016: backport-fix-resume-check-for-presence-of-sys-power-resume.patch
Patch6017: backport-fix-network-manager-skip-non-directories-in-sys-class-net.patch
Patch6018: backport-fix-dracut.sh-do-not-ignore-invalid-config-file-or-dir-path.patch
Patch6019: backport-fix-iscsi-do-not-exit-in-handle_netroot-if-discovery.patch
Patch6020: backport-fix-multipath-drop-ExecStop-setting-from-service-uni.patch
Patch6021: backport-fix-40network-consistent-use-of-gw-for-gateway.patch
Patch6022: backport-fix-dracut-be-more-robust-when-using-set-u.patch
Patch6023: backport-fix-dracut-functions.sh-ip-route-parsing.patch
Patch6024: backport-fix-img-lib-install-rmdir.patch
Patch6025: backport-fix-dracut-install-copy-files-preserving-ownership-a.patch
Patch6026: backport-feat-url-lib.sh-add-retry-connrefused-to-default-cur.patch
Patch6027: backport-fix-ifcfg-avoid-calling-unavailable-dracut-logger-fu.patch
Patch6028: backport-fix-resume-correct-call-to-block_is_netdevice-functi.patch
Patch6029: backport-fix-nfs-require-and-install-needed-binaries.patch
Patch6030: backport-fix-nfs-give-run-rpcbind-ownership-to-rpc-user.patch
Patch6031: backport-fix-dmsquash-live-mount-live-device-with-the-correct.patch
Patch6032: backport-fix-integrity-do-not-display-any-error-if-there-is-n.patch
Patch6033: backport-fix-Makefile-use-of-potentially-unset-variable.patch
Patch6034: backport-fix-dracut-default-to-correctsearch-paths.patch
Patch6035: backport-fix-install.d-add-verbose-if-KERNEL_INSTALL_VERBOSE-.patch
Patch6036: backport-fix-dracut-init.sh-correct-dracut-install-source-path.patch
Patch6037: backport-fix-lsinitrd.sh-correct-skipcpio-source-path.patch
Patch6038: backport-fix-dracut-install-use-stripped-kernel-module-path-as-hash-key.patch
Patch6039: backport-fix-network-don-t-use-same-ifname-multiple-times.patch
Patch6040: backport-fix-network-avoid-double-brackets-around-IPv6-address.patch
Patch6041: backport-fix-dracut.sh-error-exporting-sysctl-variables.patch
Patch6042: backport-fix-dracut.sh-correct-wrong-systemd-variable-paths.patch
Patch6043: backport-fix-network-legacy-correct-wrong-local-network-configuration-path.patch
Patch6044: backport-fix-network-manager-correct-wrong-local-network-configuration-path.patch
Patch6045: backport-fix-dracut-init.sh-add-missing-hostonly-code-in-the-inst_multiple-function.patch
Patch6046: backport-fix-dracut-init.sh-instmods-wrong-variable-name.patch
Patch6047: backport-fix-dracut-functions.sh-suppress-findmnt-error-msg-if-etc-fstab-not-exist.patch
Patch6048: backport-fix-dracut-logger.sh-this-fixes-the-dlog_init-check-for-dev-log.patch
Patch6049: backport-fix-dracut-replace-invalid-lzo-command-with-lzop-for-LZO-compression.patch
Patch6050: backport-fix-squash-apply-FIPS-and-libpthread-workaround.patch
Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -521,6 +573,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%endif
%changelog
* Wed Feb 21 2024 hongjinghao <hongjinghao@huawei.com> - 055-11
- backport patchs from upstream
* Mon Feb 5 2024 hongjinghao <hongjinghao@huawei.com> - 055-10
- fix(mdraid):allow UUID comparison for more than one UUID.