import CS dracut-057-53.git20240104.el9

This commit is contained in:
eabdullin 2024-03-28 10:03:17 +00:00
parent a252fe222a
commit d53fbe937e
10 changed files with 723 additions and 2 deletions

180
SOURCES/0044.patch Normal file
View File

@ -0,0 +1,180 @@
From 410d8fc37f1ce5fc5a6f66eda3d3280a6fa0023c 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.
fix(network-legacy): correct wrong local network configuration path
fix(network-manager): correct wrong local network configuration path
refactor(systemd-networkd): use more precise global variables
refactor(systemd-timesyncd): use more precise global variables
refactor(network-legacy): use more precise global variables
refactor(network-manager): use more precise global variables
(Cherry-picked commits:
ae4c8744dc3dbceb142c6eb88fd69bc6aaf29e20
a60543bf9746022e4430d310892ee03bb837b6a2
cb39aec479bdabfa7b1af5168c14ca5683905a7d
5781b6e7ab8c2f176331c960c677de1fe8a39592
3866ebc601bff71996c7e0892392332577e2a9c7
7fa66e106af021dd24fca8e76893c422775a6b61
c8adc9f72fef906b5706fa6d0e788564a508f4ee)
Resolves: RHEL-9479
---
dracut.sh | 14 ++++++++------
modules.d/01systemd-networkd/module-setup.sh | 14 +++++++-------
modules.d/01systemd-timesyncd/module-setup.sh | 4 ++--
modules.d/35network-legacy/module-setup.sh | 4 ++--
modules.d/35network-manager/module-setup.sh | 4 ++--
5 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 30dfb229..8c757b14 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1830,7 +1830,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)
@@ -1840,7 +1840,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)
@@ -1850,7 +1850,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)
@@ -1865,7 +1865,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)
@@ -1919,8 +1919,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
diff --git a/modules.d/01systemd-networkd/module-setup.sh b/modules.d/01systemd-networkd/module-setup.sh
index c3f3c051..e6d113d8 100755
--- a/modules.d/01systemd-networkd/module-setup.sh
+++ b/modules.d/01systemd-networkd/module-setup.sh
@@ -39,12 +39,12 @@ install() {
"$systemdutildir"/systemd-networkd \
"$systemdutildir"/systemd-network-generator \
"$systemdutildir"/systemd-networkd-wait-online \
- "$systemdutildir"/network/80-container-host0.network \
- "$systemdutildir"/network/80-container-ve.network \
- "$systemdutildir"/network/80-container-vz.network \
- "$systemdutildir"/network/80-vm-vt.network \
- "$systemdutildir"/network/80-wifi-adhoc.network \
- "$systemdutildir"/network/99-default.link \
+ "$systemdnetwork"/80-container-host0.network \
+ "$systemdnetwork"/80-container-ve.network \
+ "$systemdnetwork"/80-container-vz.network \
+ "$systemdnetwork"/80-vm-vt.network \
+ "$systemdnetwork"/80-wifi-adhoc.network \
+ "$systemdnetwork"/99-default.link \
"$systemdsystemunitdir"/systemd-networkd.service \
"$systemdsystemunitdir"/systemd-networkd.socket \
"$systemdsystemunitdir"/systemd-network-generator.service \
@@ -67,7 +67,7 @@ install() {
inst_multiple -H -o \
"$systemdutilconfdir"/networkd.conf \
"$systemdutilconfdir/networkd.conf.d/*.conf" \
- "$systemdutilconfdir/network/*" \
+ "$systemdnetworkconfdir/*" \
"$systemdsystemconfdir"/systemd-networkd.service \
"$systemdsystemconfdir/systemd-networkd.service/*.conf" \
"$systemdsystemunitdir"/systemd-networkd.socket \
diff --git a/modules.d/01systemd-timesyncd/module-setup.sh b/modules.d/01systemd-timesyncd/module-setup.sh
index 015caecf..f6f35fee 100755
--- a/modules.d/01systemd-timesyncd/module-setup.sh
+++ b/modules.d/01systemd-timesyncd/module-setup.sh
@@ -35,7 +35,7 @@ install() {
inst_multiple -o \
"$dbussystem"/org.freedesktop.timesync1.conf \
"$dbussystemservices"/org.freedesktop.timesync1.service \
- "$systemdutildir/ntp-units.d/*.list" \
+ "$systemdntpunits/*.list" \
"$systemdutildir"/systemd-timesyncd \
"$systemdutildir"/systemd-time-wait-sync \
"$systemdutildir/timesyncd.conf.d/*.conf" \
@@ -55,7 +55,7 @@ install() {
# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
- "$systemdutilconfdir/ntp-units.d/*.list" \
+ "$systemdntpunitsconfdir/*.list" \
"$systemdutilconfdir"/timesyncd.conf \
"$systemdutilconfdir/timesyncd.conf.d/*.conf" \
"$systemdsystemconfdir"/systemd-timesyncd.service \
diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh
index 84dcf7f5..e57fc6fa 100755
--- a/modules.d/35network-legacy/module-setup.sh
+++ b/modules.d/35network-legacy/module-setup.sh
@@ -24,8 +24,8 @@ 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"
+ inst_multiple -o "${systemdnetwork}/99-default.link"
+ [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
fi
inst_multiple ip dhclient sed awk grep pgrep tr expr
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index 04898a39..c93c6a3c 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -52,8 +52,8 @@ install() {
inst_simple "$moddir"/nm-wait-online-initrd.service "$systemdsystemunitdir"/nm-wait-online-initrd.service
# Adding default link
- inst_multiple -o "${systemdutildir}/network/99-default.link"
- [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link"
+ inst_multiple -o "${systemdnetwork}/99-default.link"
+ [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link"
$SYSTEMCTL -q --root "$initdir" enable nm-initrd.service
fi

31
SOURCES/0045.patch Normal file
View File

@ -0,0 +1,31 @@
From 7bdb3fbdce70bea19dca3fec792b5266d7b9e48b Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Tue, 14 Nov 2023 14:55:44 +0100
Subject: [PATCH] fix(hwdb): follow shfmt-recommended format
Related: RHEL-9479
---
modules.d/95hwdb/module-setup.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules.d/95hwdb/module-setup.sh b/modules.d/95hwdb/module-setup.sh
index 16365377..7e4b1af6 100755
--- a/modules.d/95hwdb/module-setup.sh
+++ b/modules.d/95hwdb/module-setup.sh
@@ -11,11 +11,12 @@ install() {
local hwdb_bin
# systemd-hwdb ships the file in /etc, with /usr/lib as an alternative.
- # Therefore consider this location as preferred for configuration.
+ # The alternative location is preferred, as we can consider it being user
+ # configuration.
hwdb_bin="${udevdir}"/hwdb.bin
- if [[ ! -r "${hwdb_bin}" ]]; then
- hwdb_bin="${udevconfdir}"/hwdb.bin
+ if [[ ! -r ${hwdb_bin} ]]; then
+ hwdb_bin="${udevconfdir}"/hwdb.bin
fi
if [[ $hostonly ]]; then

55
SOURCES/0046.patch Normal file
View File

@ -0,0 +1,55 @@
From edd1efe46a6c211034f06ad1e20c027a5e1102db Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Thu, 21 Sep 2023 14:31:07 +0200
Subject: [PATCH] fix(nvmf): move /etc/nvme/host{nqn,id} requirement to
hostonly
When creating initramfs for universal boot image such as an installer,
we can't include any machine-specific IDs. Let's move the check
for /etc/nvme/hostnqn and /etc/nvme/hostid files presence to
the hostonly section to avoid unsatisfied requirements.
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
(Cherry-picked commit: 1cf10397b5f002790a096e5bdce733436fffbd2d
PR: https://github.com/dracutdevs/dracut/pull/2523)
Resolves: RHEL-3630
---
modules.d/95nvmf/module-setup.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh
index 1dd2ca53..0b90d8be 100755
--- a/modules.d/95nvmf/module-setup.sh
+++ b/modules.d/95nvmf/module-setup.sh
@@ -3,8 +3,6 @@
# called by dracut
check() {
require_binaries nvme jq || return 1
- [ -f /etc/nvme/hostnqn ] || return 255
- [ -f /etc/nvme/hostid ] || return 255
is_nvmf() {
local _dev=$1
@@ -36,6 +34,8 @@ check() {
}
[[ $hostonly ]] || [[ $mount_needs ]] && {
+ [ -f /etc/nvme/hostnqn ] || return 255
+ [ -f /etc/nvme/hostid ] || return 255
pushd . > /dev/null
for_each_host_dev_and_slaves is_nvmf
local _is_nvmf=$?
@@ -130,8 +130,8 @@ install() {
_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_simple -H "/etc/nvme/hostnqn"
+ inst_simple -H "/etc/nvme/hostid"
inst_multiple ip sed

177
SOURCES/0047.patch Normal file
View File

@ -0,0 +1,177 @@
From 28cadd4829118d2831908dd267766613fd74f0b1 Mon Sep 17 00:00:00 2001
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Date: Wed, 12 Jul 2023 03:50:47 -0400
Subject: [PATCH] feat(dracut): add --sbat option to add sbat policy to UKI
Take existing .sbat section from the uefi stub and merge it
with vmlinux .sbat (if it exists) and user-provided .sbat parameters
using the new --sbat option.
For some reasons, --update-section in objcopy does not resize the
.sbat section, so remove the section from the stub and add it
to the UKI as new one, to avoid having incomplete SBAT strings.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
(Cherry-picked commit: 550a0084fd95870f35218dc2cf8ea91fde1c728a)
Resolves: RHEL-5732
---
dracut.sh | 46 +++++++++++++++++++++++++++++++++++++++++++-
man/dracut.8.asc | 5 +++++
man/dracut.conf.5.asc | 5 +++++
shell-completion/bash/dracut | 2 +-
4 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 8c757b14..0bac6a33 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -271,6 +271,10 @@ Creates initial ramdisk images for preloading modules
Use [FILE] as a splash image when creating an UEFI
executable. Requires bitmap (.bmp) image format.
--kernel-image [FILE] Location of the kernel image.
+ --sbat [PARAMETERS] The SBAT parameters to be added to .sbat.
+ The string "sbat,1,SBAT Version,sbat,1,
+ https://github.com/rhboot/shim/blob/main/SBAT.md" is
+ already added by default.
--regenerate-all Regenerate all initramfs images at the default location
for the kernel versions found on the system.
-p, --parallel Use parallel processing if possible (currently only
@@ -462,6 +466,7 @@ rearrange_params() {
--long uefi-stub: \
--long uefi-splash-image: \
--long kernel-image: \
+ --long sbat: \
--long no-hostonly-i18n \
--long hostonly-i18n \
--long hostonly-nics: \
@@ -839,6 +844,11 @@ while :; do
PARMS_TO_STORE+=" '$2'"
shift
;;
+ --sbat)
+ sbat_l="$2"
+ PARMS_TO_STORE+=" '$2'"
+ shift
+ ;;
--no-machineid)
machine_id_l="no"
;;
@@ -1076,6 +1086,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l"
[[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l"
[[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
+[[ $sbat_l ]] && sbat="$sbat_l"
[[ $machine_id_l ]] && machine_id="$machine_id_l"
if ! [[ $outfile ]]; then
@@ -2585,6 +2596,24 @@ fi
umask 077
+SBAT_DEFAULT="sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md"
+sbat_out=$uefi_outdir/uki.sbat
+
+clean_sbat_string() {
+ local inp=$1
+ local temp=$uefi_outdir/temp.sbat
+ sed "/${SBAT_DEFAULT//\//\\/}/d" "$inp" > "$temp"
+ [[ -s $temp ]] && cat "$temp" >> "$sbat_out"
+ rm "$temp"
+}
+
+get_sbat_string() {
+ local inp=$1
+ local out=$uefi_outdir/$2
+ objcopy -O binary --only-section=.sbat "$inp" "$out"
+ clean_sbat_string "$out"
+}
+
if [[ $uefi == yes ]]; then
if [[ $kernel_cmdline ]]; then
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
@@ -2635,6 +2664,16 @@ if [[ $uefi == yes ]]; then
unset uefi_splash_image
fi
+ echo "$SBAT_DEFAULT" > "$sbat_out"
+ if [[ -n $sbat ]]; then
+ echo "$sbat" | sed "/${SBAT_DEFAULT//\//\\/}/d" >> "$sbat_out"
+ fi
+ get_sbat_string "$kernel_image" kernel.sbat
+ get_sbat_string "$uefi_stub" stub.sbat
+
+ uefi_sbat_offs="${offs}"
+ offs=$((offs + $(stat -Lc%s "$sbat_out")))
+ offs=$((offs + "$align" - offs % "$align"))
uefi_linux_offs="${offs}"
offs=$((offs + $(stat -Lc%s "$kernel_image")))
offs=$((offs + "$align" - offs % "$align"))
@@ -2646,14 +2685,19 @@ if [[ $uefi == yes ]]; then
exit 1
fi
+ tmp_uefi_stub=$uefi_outdir/elf.stub
+ cp "$uefi_stub" "$tmp_uefi_stub"
+ objcopy --remove-section .sbat "$tmp_uefi_stub" &> /dev/null
+
if objcopy \
${uefi_osrelease:+--add-section .osrel="$uefi_osrelease" --change-section-vma .osrel=$(printf 0x%x "$uefi_osrelease_offs")} \
${uefi_cmdline:+--add-section .cmdline="$uefi_cmdline" --change-section-vma .cmdline=$(printf 0x%x "$uefi_cmdline_offs")} \
${uefi_splash_image:+--add-section .splash="$uefi_splash_image" --change-section-vma .splash=$(printf 0x%x "$uefi_splash_offs")} \
+ --add-section .sbat="$sbat_out" --change-section-vma .sbat="$(printf 0x%x "$uefi_sbat_offs")" \
--add-section .linux="$kernel_image" --change-section-vma .linux="$(printf 0x%x "$uefi_linux_offs")" \
--add-section .initrd="${DRACUT_TMPDIR}/initramfs.img" --change-section-vma .initrd="$(printf 0x%x "$uefi_initrd_offs")" \
--image-base="$(printf 0x%x "$base_image")" \
- "$uefi_stub" "${uefi_outdir}/linux.efi"; then
+ "$tmp_uefi_stub" "${uefi_outdir}/linux.efi"; then
if [[ -n ${uefi_secureboot_key} && -n ${uefi_secureboot_cert} ]]; then
if sbsign \
--key "${uefi_secureboot_key}" \
diff --git a/man/dracut.8.asc b/man/dracut.8.asc
index bfb86f5d..8339e8a9 100644
--- a/man/dracut.8.asc
+++ b/man/dracut.8.asc
@@ -600,6 +600,11 @@ and no /etc/cmdline/*.conf will be generated into the initramfs.
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
+**--sbat <parameters>**::
+ Specifies the SBAT parameters, which to include in the UEFI executable. By default
+ the default SBAT string added is "sbat,1,SBAT Version,sbat,1,
+ https://github.com/rhboot/shim/blob/main/SBAT.md".
+
**--enhanced-cpio**::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
diff --git a/man/dracut.conf.5.asc b/man/dracut.conf.5.asc
index 96c80129..132ca8e3 100644
--- a/man/dracut.conf.5.asc
+++ b/man/dracut.conf.5.asc
@@ -299,6 +299,11 @@ Logging levels:
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
+*sbat=*"__parameters__"::
+ Specifies the SBAT parameters, which to include in the UEFI executable. By default
+ the default SBAT string added is "sbat,1,SBAT Version,sbat,1,
+ https://github.com/rhboot/shim/blob/main/SBAT.md".
+
*enhanced_cpio=*"__{yes|no}__"::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems (default=no).
diff --git a/shell-completion/bash/dracut b/shell-completion/bash/dracut
index 86de2071..9b51db01 100644
--- a/shell-completion/bash/dracut
+++ b/shell-completion/bash/dracut
@@ -46,7 +46,7 @@ _dracut() {
--kernel-cmdline --sshkey --persistent-policy --install-optional
--loginstall --uefi-stub --kernel-image --squash-compressor
--sysroot --hostonly-mode --hostonly-nics --include --logfile
- --uefi-splash-image
+ --uefi-splash-image --sbat
'
)

28
SOURCES/0048.patch Normal file
View File

@ -0,0 +1,28 @@
From 50df5d09d5f27889ebed61011b35ce3eef687288 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Thu, 1 Sep 2022 11:47:09 +0200
Subject: [PATCH] feat(systemd): install systemd-sysroot-fstab-check
systemd-sysroot-fstab-check is a symlink to systemd-fstab-generator added in
systemd commit https://github.com/systemd/systemd/commit/cd7ad0cb
(cherry picked from commit 23684e4a2bb024595ad63d9f49d83b4693537110)
Resolves: RHEL-12409
---
modules.d/00systemd/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index 433e4758..2a4fe4ba 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -43,6 +43,7 @@ install() {
"$systemdutildir"/systemd-modules-load \
"$systemdutildir"/systemd-vconsole-setup \
"$systemdutildir"/systemd-volatile-root \
+ "$systemdutildir"/systemd-sysroot-fstab-check \
"$systemdutildir"/system-generators/systemd-debug-generator \
"$systemdutildir"/system-generators/systemd-fstab-generator \
"$systemdutildir"/system-generators/systemd-gpt-auto-generator \

41
SOURCES/0049.patch Normal file
View File

@ -0,0 +1,41 @@
From 4c75e51c585eebd9bc175920aa8c8b4afe808144 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Wed, 20 Sep 2023 14:56:41 +0200
Subject: [PATCH] fix(dracut.spec): add jq dependency to network subpackage
and also move nvmf module to network subpackage.
Resolves: RHEL-15012
---
pkgbuild/dracut.spec | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkgbuild/dracut.spec b/pkgbuild/dracut.spec
index 1996f44d..bd850986 100644
--- a/pkgbuild/dracut.spec
+++ b/pkgbuild/dracut.spec
@@ -111,6 +111,7 @@ Requires: %{name} = %{version}-%{release}
%endif
Requires: iputils
Requires: iproute
+Requires: jq
Requires: (NetworkManager >= 1.20 or dhclient)
Suggests: NetworkManager
Obsoletes: dracut-generic < 008
@@ -369,7 +370,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95hwdb
%{dracutlibdir}/modules.d/95lunmask
-%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
@@ -441,6 +441,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
+%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95ssh-client
%ifarch s390 s390x
%{dracutlibdir}/modules.d/95znet

56
SOURCES/0050.patch Normal file
View File

@ -0,0 +1,56 @@
From 8e933e8c8208ce16a79661379420e450b7f4a778 Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Wed, 7 Jun 2023 22:12:45 +0200
Subject: [PATCH] fix(fcoe-uefi): exit early on empty vlan
Exit early in case get_fcoe_boot_vlan exits with error or just an empty string,
instead of producing invalid config entry.
(Cherry-picked commit: 45fc8df1cf3fdf9726efda4d26c7cccb9e6aedd2
PR: https://github.com/dracutdevs/dracut/pull/2379)
Resolves: RHEL-14251
---
modules.d/95fcoe-uefi/parse-uefifcoe.sh | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/modules.d/95fcoe-uefi/parse-uefifcoe.sh b/modules.d/95fcoe-uefi/parse-uefifcoe.sh
index e120dec3..b341c963 100755
--- a/modules.d/95fcoe-uefi/parse-uefifcoe.sh
+++ b/modules.d/95fcoe-uefi/parse-uefifcoe.sh
@@ -9,19 +9,22 @@ print_fcoe_uefi_conf() {
mac=$(get_fcoe_boot_mac "$1")
[ -z "$mac" ] && return 1
dev=$(set_ifname fcoe "$mac")
- vlan=$(get_fcoe_boot_vlan "$1")
- if [ "$vlan" -ne "0" ]; then
- case "$vlan" in
- [0-9]*)
- printf "%s\n" "vlan=$dev.$vlan:$dev"
- dev="$dev.$vlan"
- ;;
- *)
- printf "%s\n" "vlan=$vlan:$dev"
- dev="$vlan"
- ;;
- esac
- fi
+ vlan=$(get_fcoe_boot_vlan "$1") || return 1
+ case "$vlan" in
+ "0") ;;
+
+ '')
+ return 1
+ ;;
+ [0-9]*)
+ printf "%s\n" "vlan=$dev.$vlan:$dev"
+ dev="$dev.$vlan"
+ ;;
+ *)
+ printf "%s\n" "vlan=$vlan:$dev"
+ dev="$vlan"
+ ;;
+ esac
# fcoe=eth0:nodcb
printf "fcoe=%s\n" "$dev:nodcb"
return 0

49
SOURCES/0051.patch Normal file
View File

@ -0,0 +1,49 @@
From 4a93a6e1dab779b05f3f68c6d803a6f24dc44a02 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 14 Aug 2023 12:28:11 +0200
Subject: [PATCH] fix(dracut.sh): remove microcode check based on
CONFIG_MICROCODE_[AMD|INTEL]
`CONFIG_MICROCODE_AMD` and `CONFIG_MICROCODE_INTEL` are hidden since
https://lore.kernel.org/all/20230810160805.081212701@linutronix.de/, therefore
this check is wrong and early microcode is always disabled.
(Cherry-picked commit: 61b9cd16e049434597e398be61a47e0112382c5b)
Resolves: RHEL-17902
---
dracut.sh | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 0bac6a33..778eefd7 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1489,23 +1489,20 @@ fi
if [[ $early_microcode == yes ]]; then
if [[ $hostonly ]]; then
- if [[ $(get_cpu_vendor) == "AMD" ]]; then
- check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode
- elif [[ $(get_cpu_vendor) == "Intel" ]]; then
- check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode
+ if [[ $(get_cpu_vendor) == "AMD" || $(get_cpu_vendor) == "Intel" ]]; then
+ check_kernel_config CONFIG_MICROCODE || unset early_microcode
else
unset early_microcode
fi
else
- ! check_kernel_config CONFIG_MICROCODE_AMD \
- && ! check_kernel_config CONFIG_MICROCODE_INTEL \
+ ! check_kernel_config CONFIG_MICROCODE \
&& unset early_microcode
fi
# Do not complain on non-x86 architectures as it makes no sense
case $(uname -m) in
x86_64 | i?86)
[[ $early_microcode != yes ]] \
- && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y"
+ && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE!=y"
;;
*) ;;
esac

77
SOURCES/0052.patch Normal file
View File

@ -0,0 +1,77 @@
From 4c46806a793d66a188c4e9b40e74f6c371ac5b8a 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>
(Cherry-picked commit: 7bb1f64b972586d86d82fcb23de4b979eab0ddfe)
Resolves: RHEL-15821
---
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 6025bd67..997d62d3 100644
--- a/src/install/dracut-install.c
+++ b/src/install/dracut-install.c
@@ -1522,7 +1522,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;
}

View File

@ -5,7 +5,7 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release 44.git20230822
%define dist_free_release 53.git20240104
Name: dracut
Version: 057
@ -72,6 +72,15 @@ Patch40: 0040.patch
Patch41: 0041.patch
Patch42: 0042.patch
Patch43: 0043.patch
Patch44: 0044.patch
Patch45: 0045.patch
Patch46: 0046.patch
Patch47: 0047.patch
Patch48: 0048.patch
Patch49: 0049.patch
Patch50: 0050.patch
Patch51: 0051.patch
Patch52: 0052.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -155,6 +164,7 @@ Requires: %{name} = %{version}-%{release}
%endif
Requires: iputils
Requires: iproute
Requires: jq
Requires: (NetworkManager >= 1.20 or dhclient)
Suggests: NetworkManager
Obsoletes: dracut-generic < 008
@ -413,7 +423,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95hwdb
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
@ -485,6 +494,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95nvmf
%{dracutlibdir}/modules.d/95ssh-client
%ifarch s390 s390x
%{dracutlibdir}/modules.d/95znet
@ -522,6 +532,23 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%changelog
* Thu Jan 04 2024 Pavel Valena <pvalena@redhat.com> - 057-53.git20240104
- fix(dracut-install): use stripped kernel module path as hash
* Thu Dec 07 2023 Pavel Valena <pvalena@redhat.com> - 057-52.git20231207
- fix(dracut.sh): remove microcode check based on
* Wed Nov 15 2023 Pavel Valena <pvalena@redhat.com> - 057-51.git20231115
- fix(nvmf): move /etc/nvme/host{nqn,id} requirement to
* Tue Nov 14 2023 Pavel Valena <pvalena@redhat.com> - 057-51.git20231114
- fix(dracut.sh): correct wrong systemd variable paths
- fix(hwdb): follow shfmt-recommended format
- feat(dracut): add --sbat option to add sbat policy to UKI
- feat(systemd): install systemd-sysroot-fstab-check
- fix(dracut.spec): add jq dependency to network subpackage
- fix(fcoe-uefi): exit early on empty vlan
* Tue Aug 22 2023 Pavel Valena <pvalena@redhat.com> - 057-44.git20230822
- feat(hwdb): install hwdb on demand when module is needed