Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
f054c5542e
!111 fix(dracut-initramfs-restore.sh): check if SELINUXTYPE is set
From: @markeryang 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2024-06-13 07:37:44 +00:00
markeryang
33b3fa63ba fix(dracut-initramfs-restore.sh): check if SELINUXTYPE is set 2024-06-13 07:13:14 +00:00
openeuler-ci-bot
01657b5c3c
!106 在initramfs中添加chmod命令
From: @yue-yuankun 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-05-08 07:42:22 +00:00
yueyuankun
ce1d08273a fix(base): install chmod binaries 2024-04-26 15:21:56 +08:00
openeuler-ci-bot
5d911bf846
!96 [sync] PR-95: 同步上游社区补丁
From: @openeuler-sync-bot 
Reviewed-by: @jiayi0118 
Signed-off-by: @jiayi0118
2024-02-22 11:14:47 +00:00
hongjinghao
2663ebded8 backport patchs from upstream
(cherry picked from commit e37aecb42764d47b923dd3280385bd5438f466b6)
2024-02-22 14:56:32 +08:00
openeuler-ci-bot
28c5f861ed
!87 [sync] PR-85: backport patchs from upstream
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2023-12-20 08:30:42 +00:00
zhangruifang2020
731a2bcd17 backport patchs from upstream
(cherry picked from commit 2e01aee7d2264d9f95b58cf86ca965c343e44027)
2023-12-20 11:12:15 +08:00
openeuler-ci-bot
066bf3fda7
!82 backport patches from upstream
From: @wangyuhang27 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
2023-12-07 12:35:39 +00:00
wangyuhang
6a92ba92da backport patches from upstream 2023-12-07 19:32:00 +08:00
73 changed files with 3463 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 01b7163a591c3debec794b5f46b52156a16ee934 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Wed, 5 Aug 2020 19:32:35 +0200
Subject: [PATCH] 90lvm: do not add newline to cmdline
Fixes #862
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/01b7163a591c3debec794b5f46b52156a16ee934
---
modules.d/90lvm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 52c803f7..1eeba79d 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -36,7 +36,7 @@ cmdline() {
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then
- printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
+ printf " rd.lvm.lv=%s " "${DM_VG_NAME}/${DM_LV_NAME} "
_activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1
fi
done
--
2.23.0

View File

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

View File

@ -0,0 +1,30 @@
From 46f3156426e1b770e4876a654738e1c3e01851af Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 26 Jun 2020 18:50:47 +0200
Subject: [PATCH] 91zipl: parse-zipl.sh: honor SYSTEMD_READY
The zipl partition should not be mounted if SYSTEMD_READY=0 is set.
Otherwise booting issues with multipath will result.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/46f3156426e1b770e4876a654738e1c3e01851af
---
modules.d/91zipl/parse-zipl.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/91zipl/parse-zipl.sh b/modules.d/91zipl/parse-zipl.sh
index 308f228b..ddab0ea9 100755
--- a/modules.d/91zipl/parse-zipl.sh
+++ b/modules.d/91zipl/parse-zipl.sh
@@ -31,7 +31,7 @@ if [ -n "$zipl_arg" ] ; then
esac
if [ "$zipl_env" ] ; then
{
- printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", RUN+="/sbin/initqueue --settled --onetime --unique --name install_zipl_cmdline /sbin/install_zipl_cmdline.sh %s"\n' \
+ printf 'ACTION=="add|change", SUBSYSTEM=="block", %s=="%s", ENV{SYSTEMD_READY}!="0", RUN+="/sbin/initqueue --settled --onetime --unique --name install_zipl_cmdline /sbin/install_zipl_cmdline.sh %s"\n' \
${zipl_env} ${zipl_val} ${zipl_arg}
echo "[ -f /tmp/install.zipl.cmdline-done ]" >$hookdir/initqueue/finished/wait-zipl-conf.sh
} >> /etc/udev/rules.d/99zipl-conf.rules
--
2.23.0

View File

@ -0,0 +1,31 @@
From 3b869230a08088a4f51d5bde8d5cfc8497779815 Mon Sep 17 00:00:00 2001
From: Thomas Blume <Thomas.Blume@suse.com>
Date: Mon, 6 Jul 2020 15:16:35 +0200
Subject: [PATCH] 95iscsi: fix ipv6 target discovery
ipv6 addresses need square brackets, otherwise the iscsi discovery and log-in,
which adds the iscsi port after another colon will get confused and fail.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/3b869230a08088a4f51d5bde8d5cfc8497779815
---
modules.d/95iscsi/iscsiroot.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index cc2ed2cc..ac43b487 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -213,6 +213,9 @@ handle_netroot()
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
fi
+ if strglobin $iscsi_target_ip '*:*:*' && ! strglobin $iscsi_target_ip '['; then
+ iscsi_target_ip="[$iscsi_target_ip]"
+ fi
targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/')
[ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1
--
2.23.0

View File

@ -0,0 +1,29 @@
From 55b0d2edafdd18c2e85f47063f0ac81652f86956 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Wed, 10 Jun 2020 22:36:56 +0200
Subject: [PATCH] 95iscsi: fix missing space when compiling cmdline args
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/55b0d2edafdd18c2e85f47063f0ac81652f86956
Reference: bsc#1172816
---
modules.d/95iscsi/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 19a8bdbd..8b6300d5 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -65,7 +65,7 @@ install_ibft() {
if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then
echo -n "rd.iscsi.ibft=1 "
fi
- echo -n "rd.iscsi.firmware=1"
+ echo -n "rd.iscsi.firmware=1 "
fi
done
}
--
2.23.0

View File

@ -0,0 +1,49 @@
From 6dbae7e77238dd44bedb0ca2478f985f451c05bf Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Fri, 10 Jul 2020 18:09:05 +0200
Subject: [PATCH] 95iscsi: use ip_params_for_remote_addr()
Use the new helper function.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/6dbae7e77238dd44bedb0ca2478f985f451c05bf
---
modules.d/95iscsi/module-setup.sh | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 8b6300d5..dfacd797 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -120,27 +120,7 @@ install_iscsiroot() {
done
[ -z "$iscsi_address" ] && return
- local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
- ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
-
- # follow ifcfg settings for boot protocol
- for _path in \
- "/etc/sysconfig/network-scripts/ifcfg-$ifname" \
- "/etc/sysconfig/network/ifcfg-$ifname" \
- ; do
- [ -f "$_path" ] && bootproto=$(sed -n "s/BOOTPROTO='\?\([[:alpha:]]*6\?\)4\?/\1/p" "$_path")
- done
-
- if [ $bootproto ]; then
- printf 'ip=%s:%s ' ${ifname} ${bootproto}
- else
- printf 'ip=%s:static ' ${ifname}
- fi
-
- if [ -e /sys/class/net/$ifname/address ] ; then
- ifmac=$(cat /sys/class/net/$ifname/address)
- printf 'ifname=%s:%s ' ${ifname} ${ifmac}
- fi
+ ip_params_for_remote_addr "$iscsi_address"
if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
--
2.23.0

View File

@ -0,0 +1,52 @@
From 880d155967bb54f61e5960347aa8bbab6da8f86d Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Sat, 11 Jul 2020 00:19:09 +0200
Subject: [PATCH] 95nfs: use ip_params_for_remote_addr()
Use the new helper function.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/880d155967bb54f61e5960347aa8bbab6da8f86d
---
modules.d/95nfs/module-setup.sh | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index d9a91fdf..4a8e140b 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -47,7 +47,6 @@ cmdline() {
local nfs_root
local nfs_address
local lookup
- local ifname
### nfsroot= ###
nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
@@ -69,21 +68,9 @@ cmdline() {
lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1)
nfs_address=${lookup##* }
fi
- ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
- if [ -d /sys/class/net/$ifname/bonding ]; then
- dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
- return
- elif [ -e /sys/class/net/$ifname/address ] ; then
- ifmac=$(cat /sys/class/net/$ifname/address)
- printf 'ifname=%s:%s ' ${ifname} ${ifmac}
- fi
- bootproto=$(sed -n "/BOOTPROTO/s/BOOTPROTO='\([[:alpha:]]*6\?\)4\?'/\1/p" /etc/sysconfig/network/ifcfg-$ifname)
- if [ $bootproto ]; then
- printf 'ip=%s:%s ' ${ifname} ${bootproto}
- else
- printf 'ip=%s:static ' ${ifname}
- fi
+ [[ $nfs_address ]] || return
+ ip_params_for_remote_addr "$nfs_address"
}
# called by dracut
--
2.23.0

View File

@ -0,0 +1,152 @@
From 480aa9695f8c2e2b30c8f41ae8483140020d23db Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Tue, 4 Aug 2020 10:20:51 +0200
Subject: [PATCH] 95resume: Do not resume on iSCSI, FCoE or NBD
The iSCSI configuration is started after dracut checks for resume,
so we run into a timeout here. Additionally it's questionable if
resume on iSCSI makes sense (or is even supported on the platform).
Same holds true for Network Block Devices and FcOE, cover those as well
References: bsc#999663
Original-patch-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
---
dracut-functions.sh | 44 ++++++++++++++++++++++++++++++
modules.d/95iscsi/module-setup.sh | 14 ++--------
modules.d/95nbd/module-setup.sh | 4 +--
modules.d/95resume/module-setup.sh | 11 +++++++-
4 files changed, 57 insertions(+), 16 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 07ae88c0..e0ca7574 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -842,3 +842,47 @@ ip_params_for_remote_addr() {
fi
}
+
+# block_is_nbd <maj:min>
+# Check whether $1 is an nbd device
+block_is_nbd() {
+ [[ -b /dev/block/$1 && $1 == 43:* ]]
+}
+
+# block_is_iscsi <maj:min>
+# Check whether $1 is an nbd device
+block_is_iscsi() {
+ local _dir
+ local _dev=$1
+ [[ -L "/sys/dev/block/$_dev" ]] || return
+ _dir="$(readlink -f "/sys/dev/block/$_dev")" || return
+ until [[ -d "$_dir/sys" || -d "$_dir/iscsi_session" ]]; do
+ _dir="$_dir/.."
+ done
+ [[ -d "$_dir/iscsi_session" ]]
+}
+
+# block_is_fcoe <maj:min>
+# Check whether $1 is an FCoE device
+# Will not work for HBAs that hide the ethernet aspect
+# completely and present a pure FC device
+block_is_fcoe() {
+ local _dir
+ local _dev=$1
+ [[ -L "/sys/dev/block/$_dev" ]] || return
+ _dir="$(readlink -f "/sys/dev/block/$_dev")"
+ until [[ -d "$_dir/sys" ]]; do
+ _dir="$_dir/.."
+ if [[ -d "$_dir/subsystem" ]]; then
+ subsystem=$(basename $(readlink $_dir/subsystem))
+ [[ $subsystem == "fcoe" ]] && return 0
+ fi
+ done
+ return 1
+}
+
+# block_is_netdevice <maj:min>
+# Check whether $1 is a net device
+block_is_netdevice() {
+ block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1"
+}
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index dfacd797..20922442 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -9,20 +9,9 @@ check() {
# If hostonly was requested, fail the check if we are not actually
# booting from root.
- is_iscsi() {
- local _dev=$1
-
- [[ -L "/sys/dev/block/$_dev" ]] || return
- cd "$(readlink -f "/sys/dev/block/$_dev")"
- until [[ -d sys || -d iscsi_session ]]; do
- cd ..
- done
- [[ -d iscsi_session ]]
- }
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
pushd . >/dev/null
- for_each_host_dev_and_slaves is_iscsi
+ for_each_host_dev_and_slaves block_is_iscsi
local _is_iscsi=$?
popd >/dev/null
[[ $_is_iscsi == 0 ]] || return 255
@@ -223,6 +212,7 @@ install() {
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
+
if ! dracut_module_included "systemd"; then
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
else
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh
index 22f6a3bf..9254b49a 100755
--- a/modules.d/95nbd/module-setup.sh
+++ b/modules.d/95nbd/module-setup.sh
@@ -7,11 +7,9 @@ check() {
# if an nbd device is not somewhere in the chain of devices root is
# mounted on, fail the hostonly check.
[[ $hostonly ]] || [[ $mount_needs ]] && {
- is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
-
_rootdev=$(find_root_block_device)
[[ -b /dev/block/$_rootdev ]] || return 1
- check_block_and_slaves is_nbd "$_rootdev" || return 255
+ check_block_and_slaves block_is_nbd "$_rootdev" || return 255
}
require_binaries nbd-client || return 1
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index cb06b567..96c2573e 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -2,9 +2,18 @@
# called by dracut
check() {
+ swap_on_netdevice() {
+ local _dev
+ for _dev in "${swap_devs[@]}"; do
+ block_is_netdevice $_dev && return 0
+ done
+ return 1
+ }
+
# Only support resume if hibernation is currently on
+ # and no swap is mounted on a net device
[[ $hostonly ]] || [[ $mount_needs ]] && {
- [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
+ swap_on_netdevice || [[ "$(cat /sys/power/resume)" == "0:0" ]] && return 255
}
return 0
--
2.33.0

View File

@ -0,0 +1,61 @@
From f84ad9e062519c43264f1a512227621b3bf1853b Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Fri, 27 Mar 2020 16:16:07 +0300
Subject: [PATCH] Allow $DRACUT_INSTALL to be not an absolute path
/usr/sbin/dracut-install is a symlink:
$ file /usr/sbin/dracut-install
/usr/sbin/dracut-install: symbolic link to ../lib/dracut/dracut-install
It resulted to "dracut-install not found" error:
+++ for p in $DRACUT_PATH
+++ [[ -L /sbin/dracut-install ]]
+++ [[ -x /sbin/dracut-install ]]
+++ for p in $DRACUT_PATH
+++ [[ -L /bin/dracut-install ]]
+++ [[ -x /bin/dracut-install ]]
+++ for p in $DRACUT_PATH
+++ [[ -L /usr/sbin/dracut-install ]]
+++ printf '%s\n' dracut-install
+++ return 0
++ DRACUT_INSTALL=dracut-install
++ [[ -n dracut-install ]]
++ [[ -n dracut-install ]]
++ DRINSTALLPARTS=0
++ for i in $DRACUT_INSTALL
++ DRINSTALLPARTS=1
++ [[ 1 = 1 ]]
++ [[ -x dracut-install ]]
++ dfatal 'dracut-install not found!'
++ set +x
dracut: dracut-install not found!
[ -x <not a path to file> ] is not correct and will always be false.
But actually it is available. Let's just allow it to be not an absolute path.
Maybe some other places can be improved to avoid DRACUT_INSTALL being not an absolute path.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/f84ad9e062519c43264f1a512227621b3bf1853b
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
---
dracut-init.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index a8348b79..837267aa 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -183,7 +183,7 @@ for i in $DRACUT_INSTALL ; do
DRINSTALLPARTS=$(($DRINSTALLPARTS+1))
done
-if [[ $DRINSTALLPARTS = 1 ]] && ! [[ -x $DRACUT_INSTALL ]]; then
+if [[ $DRINSTALLPARTS = 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1 ; then
dfatal "dracut-install not found!"
exit 10
fi
--
2.23.0

View File

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

View File

@ -0,0 +1,29 @@
From b7a7735c1d83ade0e748d336c8ab1a569f431107 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
Date: Wed, 26 Aug 2020 11:19:24 +0200
Subject: [PATCH] Do not start inside container
Host should take care of good entropy pool
#791
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/b7a7735c1d83ade0e748d336c8ab1a569f431107
---
modules.d/06rngd/rngd.service | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service
index 570fbedb..dd5374d7 100644
--- a/modules.d/06rngd/rngd.service
+++ b/modules.d/06rngd/rngd.service
@@ -2,6 +2,7 @@
Description=Hardware RNG Entropy Gatherer Daemon
DefaultDependencies=no
Before=systemd-udevd.service
+ConditionVirtualization=!container
[Service]
ExecStart=/usr/sbin/rngd -f
--
2.23.0

View File

@ -0,0 +1,33 @@
From c409108b0489e7d70f5f6a830d874a9384d4f8d2 Mon Sep 17 00:00:00 2001
From: foopub <45460217+foopub@users.noreply.github.com>
Date: Wed, 3 Feb 2021 17:41:08 +0000
Subject: [PATCH] Fix bad ls parsing
This used to cause some echo write/invalid argument errors. Simplest fix is to use readlink with -f for absolute path and -n to remove trailing newline.
See previous discussion here:
https://github.com/void-linux/void-packages/issues/13024
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/c409108b0489e7d70f5f6a830d874a9384d4f8d2
---
modules.d/95resume/resume.sh | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/modules.d/95resume/resume.sh b/modules.d/95resume/resume.sh
index 8d366755..e7becd0a 100755
--- a/modules.d/95resume/resume.sh
+++ b/modules.d/95resume/resume.sh
@@ -14,9 +14,5 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
esac
[ -x "$(command -v resume)" ] && command resume $a_splash "$resume"
- # parsing the output of ls is Bad, but until there is a better way...
- ls -lH "$resume" | (
- read x x x x maj min x;
- echo "${maj%,}:$min"> /sys/power/resume)
- >/.resume
+ (readlink -fn $resume > /sys/power/resume)>/.resume
}
--
2.19.1

View File

@ -0,0 +1,36 @@
From fea53784adf3748a9f31964272a69b31c152d8cf Mon Sep 17 00:00:00 2001
From: mwberry <mwberry@users.noreply.github.com>
Date: Sat, 30 May 2020 17:55:35 -0700
Subject: [PATCH] UEFI Mode: only write kernel cmdline to UEFI binary
The kernel command line was being written both into
/etc/cmdline.d/01-default.conf and the UEFI executable.
During boot, getcmdline would concatenate these two
resulting in all arguments being duplicated. Some
args, such as ip=, are sensitive to the number of
times they are specified.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/fea53784adf3748a9f31964272a69b31c152d8cf
---
dracut.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 12f75670..c439fa02 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1620,7 +1620,9 @@ if [[ $kernel_only != yes ]]; then
(( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
(( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
- [[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
+ if [[ $kernel_cmdline ]] && [[ $uefi != yes ]]; then
+ printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
+ fi
for line in "${fstab_lines[@]}"; do
line=($line)
--
2.23.0

View File

@ -0,0 +1,34 @@
From 17d62d12065c264d899609cf69e8d913fc84460d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Sat, 14 Mar 2020 11:44:47 +0700
Subject: [PATCH] cryptroot-ask: no warn if /run/cryptsetup exist
In either case:
- encrypted device is decrypted, udev will trigger device changes again,
- multiple encrypted device,
cryptroot-ask will run multiple time, then report:
> mkdir: cannot create directory '/run/cryptsetup': File exists
Pass `-p` into mkdir to ignore that warning.
---
modules.d/90crypt/cryptroot-ask.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh
index e1f17975..97047ae9 100755
--- a/modules.d/90crypt/cryptroot-ask.sh
+++ b/modules.d/90crypt/cryptroot-ask.sh
@@ -8,7 +8,7 @@ NEWROOT=${NEWROOT:-"/sysroot"}
. /lib/dracut-lib.sh
-mkdir -m 0700 /run/cryptsetup
+mkdir -p -m 0700 /run/cryptsetup
# if device name is /dev/dm-X, convert to /dev/mapper/name
if [ "${1##/dev/dm-}" != "$1" ]; then
--
2.33.0

View File

@ -0,0 +1,40 @@
From 67bcc4930430a1845c4f53d2afacf701fc6467a1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 11 Feb 2021 09:01:54 +0100
Subject: [PATCH] docs: fix dracut.cmdline.7
```
asciidoc: WARNING: dracut.cmdline.7.asc: line 1115: nested inline passthrough
```
Conflict:Delete the second paragraph
Reference:https://github.com/dracutdevs/dracut/commit/67bcc4930430a1845c4f53d2afacf701fc6467a1
---
dracut.cmdline.7.asc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 4e598b6b..b4cbbbcd 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -176,7 +176,7 @@ Misc
[[dracutkerneldebug]]
Debug
~~~~~
-If you are dropped to an emergency shell, the file
+If you are dropped to an emergency shell, the file
_/run/initramfs/rdsosreport.txt_ is created, which can be saved to a (to be
mounted by hand) partition (usually /boot) or a USB stick. Additional debugging
info can be produced by adding **rd.debug** to the kernel command line.
@@ -1109,7 +1109,7 @@ used to persist the changes made to the device specified by the
**root=live:__<url>__** option.
+
The default _pathspec_, when _auto_ or no _:<pathspec>_ is given, is
-`/<+++<b>rd.live.dir</b>+++>/overlay-<label>-<uuid>`, where _<label>_ is the
+`/<rd.live.dir>/overlay-<label>-<uuid>`, where _<label>_ is the
device LABEL, and _<uuid>_ is the device UUID.
* _none_ (the word itself) specifies that no overlay will be used, such as when
an uncompressed, writable live root filesystem is available.
--
2.19.1

View File

@ -0,0 +1,142 @@
From ceca74ccc397795db68ca6ffbe49d65af2178a50 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Sat, 11 Jul 2020 00:15:34 +0200
Subject: [PATCH] dracut-functions: add ip_params_for_remote_addr() helper
This helper function takes a remote IP address, and tries to
determine the dracut command line arguments ip= and ifname= that
will make this remote address reachable during boot.
Functionality was taken from the module-setup.sh scripts of 95iscsi and 95nfs,
cleaned up and fixed some issues in particular with statically configured
networks, where the old code would print the unsupported string
"$ifname:static".
---
dracut-functions.sh | 114 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 114 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index b5c28248..07ae88c0 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -728,3 +728,117 @@ btrfs_devs() {
printf -- "%s\n" "$_dev"
done
}
+
+iface_for_remote_addr() {
+ set -- $(ip -o route get to "$1")
+ echo $3
+}
+
+local_addr_for_remote_addr() {
+ set -- $(ip -o route get to "$1")
+ echo $5
+}
+
+peer_for_addr() {
+ local addr=$1
+ local qtd
+
+ # quote periods in IPv4 address
+ qtd=${addr//./\\.}
+ ip -o addr show | \
+ sed -n 's%^.* '"$qtd"' peer \([0-9a-f.:]\{1,\}\(/[0-9]*\)\?\).*$%\1%p'
+}
+
+netmask_for_addr() {
+ local addr=$1
+ local qtd
+
+ # quote periods in IPv4 address
+ qtd=${addr//./\\.}
+ ip -o addr show | sed -n 's,^.* '"$qtd"'/\([0-9]*\) .*$,\1,p'
+}
+
+gateway_for_iface() {
+ local ifname=$1 addr=$2
+
+ case $addr in
+ *.*) proto=4;;
+ *:*) proto=6;;
+ *) return;;
+ esac
+ ip -o -$proto route show | \
+ sed -n "s/^default via \([0-9a-z.:]\{1,\}\) dev $ifname .*\$/\1/p"
+}
+
+# This works only for ifcfg-style network configuration!
+bootproto_for_iface() {
+ local ifname=$1
+ local dir
+
+ # follow ifcfg settings for boot protocol
+ for dir in network-scripts network; do
+ [ -f "/etc/sysconfig/$dir/ifcfg-$ifname" ] && {
+ sed -n "s/BOOTPROTO=[\"']\?\([[:alnum:]]\{1,\}\)[\"']\?.*\$/\1/p" \
+ "/etc/sysconfig/$dir/ifcfg-$ifname"
+ return
+ }
+ done
+}
+
+is_unbracketed_ipv6_address() {
+ strglob "$1" '*:*' && ! strglob "$1" '\[*:*\]'
+}
+
+# Create an ip= string to set up networking such that the given
+# remote address can be reached
+ip_params_for_remote_addr() {
+ local remote_addr=$1
+ local ifname local_addr peer netmask= gateway ifmac
+
+ [[ $remote_addr ]] || return 1
+ ifname=$(iface_for_remote_addr "$remote_addr")
+ [[ $ifname ]] || {
+ berror "failed to determine interface to connect to $remote_addr"
+ return 1
+ }
+
+ # ifname clause to bind the interface name to a MAC address
+ if [ -d "/sys/class/net/$ifname/bonding" ]; then
+ dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
+ elif [ -e "/sys/class/net/$ifname/address" ] ; then
+ ifmac=$(cat "/sys/class/net/$ifname/address")
+ [[ $ifmac ]] && printf 'ifname=%s:%s ' "${ifname}" "${ifmac}"
+ fi
+
+ bootproto=$(bootproto_for_iface "$ifname")
+ case $bootproto in
+ dhcp|dhcp6|auto6) ;;
+ dhcp4)
+ bootproto=dhcp;;
+ static*|"")
+ bootproto=;;
+ *)
+ derror "bootproto \"$bootproto\" is unsupported by dracut, trying static configuration"
+ bootproto=;;
+ esac
+ if [[ $bootproto ]]; then
+ printf 'ip=%s:%s ' "${ifname}" "${bootproto}"
+ else
+ local_addr=$(local_addr_for_remote_addr "$remote_addr")
+ [[ $local_addr ]] || {
+ berror "failed to determine local address to connect to $remote_addr"
+ return 1
+ }
+ peer=$(peer_for_addr "$local_addr")
+ # Set peer or netmask, but not both
+ [[ $peer ]] || netmask=$(netmask_for_addr "$local_addr")
+ gateway=$(gateway_for_iface "$ifname" "$local_addr")
+ # Quote IPv6 addresses with brackets
+ is_unbracketed_ipv6_address "$local_addr" && local_addr="[$local_addr]"
+ is_unbracketed_ipv6_address "$peer" && peer="[$peer]"
+ is_unbracketed_ipv6_address "$gateway" && gateway="[$gateway]"
+ printf 'ip=%s:%s:%s:%s::%s:none ' \
+ "${local_addr}" "${peer}" "${gateway}" "${netmask}" "${ifname}"
+ fi
+
+}
--
2.33.0

View File

@ -0,0 +1,62 @@
From f769154bccf22d2b5caf5e4888f88bf7edde2662 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Mon, 25 May 2020 19:02:05 +0300
Subject: [PATCH] dracut-functions: fix find_binary() to return full path
Fixes: a01204202b30 (Allow running on a cross-compiled rootfs)
---
dracut-functions.sh | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 3cb9c7af..b5c28248 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -41,31 +41,36 @@ str_ends() { [ "${1%*"$2"}" != "$1" ]; }
# search in the usual places to find the binary.
find_binary() {
local _delim
+ local _path
local l
local p
[[ -z ${1##/*} ]] || _delim="/"
if [[ "$1" == *.so* ]]; then
for l in libdirs ; do
- if { $DRACUT_LDD "$dracutsysrootdir$l$_delim$1" &>/dev/null; }; then
- printf "%s\n" "$1"
+ _path="${l}${_delim}${1}"
+ if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
+ printf "%s\n" "${_path}"
return 0
fi
done
- if { $DRACUT_LDD "$dracutsysrootdir$_delim$1" &>/dev/null; }; then
- printf "%s\n" "$1"
+ _path="${_delim}${1}"
+ if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
+ printf "%s\n" "${_path}"
return 0
fi
fi
if [[ "$1" == */* ]]; then
- if [[ -L $dracutsysrootdir$_delim$1 ]] || [[ -x $dracutsysrootdir$_delim$1 ]]; then
- printf "%s\n" "$1"
+ _path="${_delim}${1}"
+ if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
+ printf "%s\n" "${_path}"
return 0
fi
fi
for p in $DRACUT_PATH ; do
- if [[ -L $dracutsysrootdir$p$_delim$1 ]] || [[ -x $dracutsysrootdir$p$_delim$1 ]]; then
- printf "%s\n" "$1"
+ _path="${p}${_delim}${1}"
+ if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
+ printf "%s\n" "${_path}"
return 0
fi
done
--
2.33.0

View File

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

View File

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

View File

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

View File

@ -0,0 +1,52 @@
From dfe2247a43d6a216d9af533825c9a103e3b056cd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 23 Oct 2019 14:16:56 +0200
Subject: [PATCH] dracut.sh: add check for invalid configuration files
Emit a warning about possible misconfigured configuration files, where
the spaces around values are missing for +=""
Better report a possible source of problems. We can fix annoying false
positives later.
---
dracut.sh | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 39fa3692..81c6d654 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -279,6 +279,14 @@ read_arg() {
fi
}
+check_conf_file()
+{
+ if grep -H -e '^[^#]*[+]=\("[^ ]\|.*[^ ]"\)' "$@"; then
+ printf '\ndracut: WARNING: <key>+=" <values> ": <values> should have surrounding white spaces!\n' >&2
+ printf 'dracut: WARNING: This will lead to unwanted side effects! Please fix the configuration file.\n\n' >&2
+ fi
+}
+
dropindirs_sort()
{
local suffix=$1; shift
@@ -703,10 +711,14 @@ if [[ ! -d $confdir ]]; then
fi
# source our config file
-[[ -f $conffile ]] && . "$conffile"
+if [[ -f $conffile ]]; then
+ check_conf_file "$conffile"
+ . "$conffile"
+fi
# source our config dir
for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); do
+ check_conf_file "$f"
[[ -e $f ]] && . "$f"
done
--
2.33.0

View File

@ -0,0 +1,60 @@
From d8d5cb839cbddff7d73a12450055f14dce4ce1e2 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 25 Jul 2020 17:28:16 +0200
Subject: [PATCH] dracut.sh: fix early microcode detection logic
This fixes two issues:
1) on non-x86 systems in non-hostonly config this would cause
an annoying warning on every initramfs generation
2) on non-x86 systems in hostonly config this would result in
early microcode not getting disabled
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/d8d5cb839cbddff7d73a12450055f14dce4ce1e2
---
dracut.sh | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index e3195499..d5dfa77d 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1194,19 +1194,26 @@ fi
if [[ $early_microcode = yes ]]; then
if [[ $hostonly ]]; then
- [[ $(get_cpu_vendor) == "AMD" ]] \
- && ! check_kernel_config CONFIG_MICROCODE_AMD \
- && unset early_microcode
- [[ $(get_cpu_vendor) == "Intel" ]] \
- && ! check_kernel_config CONFIG_MICROCODE_INTEL \
- && unset early_microcode
+ 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
+ else
+ unset early_microcode
+ fi
else
! check_kernel_config CONFIG_MICROCODE_AMD \
&& ! check_kernel_config CONFIG_MICROCODE_INTEL \
&& unset early_microcode
fi
- [[ $early_microcode != yes ]] \
- && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y"
+ # 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"
+ ;;
+ *) ;;
+ esac
fi
# Need to be able to have non-root users read stuff (rpcbind etc)
--
2.23.0

View File

@ -0,0 +1,90 @@
From 3b92d8bf84d8dac57ffc1293f6f5c6d621ddd267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 23 Aug 2020 18:15:32 -0300
Subject: [PATCH] dracut.sh: fix errors pointed out by shellcheck.
- use [ ] instead of calling test manually, as most of the script is
doing.
- use quotes in hostonly_cmdline blocks, specially when dealing with the
conf files, whose names are set by users/system administrators
- uefi_splash_image was being assigned set to `${dracutsysroot}...`, which
is a variable that doesn't exist.
- we don't want the conditional to run the output of fsfreeze as
commands. Instead, we just need to know if any of the fsfreeze commands
failed.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/3b92d8bf84d8dac57ffc1293f6f5c6d621ddd267
---
dracut.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index c439fa02..fa2388fe 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1731,7 +1731,7 @@ fi
if [[ $do_strip = yes ]] ; then
# Prefer strip from elfutils for package size
declare strip_cmd=$(command -v eu-strip)
- test -z "$strip_cmd" && strip_cmd="strip"
+ [ -z "$strip_cmd" ] && strip_cmd="strip"
for p in $strip_cmd xargs find; do
if ! type -P $p >/dev/null; then
@@ -1824,7 +1824,7 @@ if [[ $hostonly_cmdline == "yes" ]] ; then
dinfo "Stored kernel commandline:"
for conf in $initdir/etc/cmdline.d/*.conf ; do
[ -e "$conf" ] || continue
- dinfo "$(< $conf)"
+ dinfo "$(< "$conf")"
_stored_cmdline=1
done
fi
@@ -2004,10 +2004,10 @@ umask 077
if [[ $uefi = yes ]]; then
if [[ $kernel_cmdline ]]; then
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
- elif [[ $hostonly_cmdline = yes ]] && [ -d $initdir/etc/cmdline.d ];then
- for conf in $initdir/etc/cmdline.d/*.conf ; do
+ elif [[ $hostonly_cmdline = yes ]] && [ -d "$initdir/etc/cmdline.d" ];then
+ for conf in "$initdir"/etc/cmdline.d/*.conf ; do
[ -e "$conf" ] || continue
- printf "%s " "$(< $conf)" >> "$uefi_outdir/cmdline.txt"
+ printf "%s " "$(< "$conf")" >> "$uefi_outdir/cmdline.txt"
done
else
do_print_cmdline > "$uefi_outdir/cmdline.txt"
@@ -2020,7 +2020,7 @@ if [[ $uefi = yes ]]; then
[[ -s $dracutsysrootdir/usr/lib/os-release ]] && uefi_osrelease="$dracutsysrootdir/usr/lib/os-release"
[[ -s $dracutsysrootdir/etc/os-release ]] && uefi_osrelease="$dracutsysrootdir/etc/os-release"
[[ -s "${dracutsysrootdir}${uefi_splash_image}" ]] && \
- uefi_splash_image="${dracutsysroot}${uefi_splash_image}" || unset uefi_splash_image
+ uefi_splash_image="${dracutsysrootdir}${uefi_splash_image}" || unset uefi_splash_image
if objcopy \
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
@@ -2100,7 +2100,7 @@ freeze_ok_for_fstype() {
# and there's no reason to sync, and *definitely* no reason to fsfreeze.
# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze
# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0
-if test -d $dracutsysrootdir/run/systemd/system; then
+if [ -d "$dracutsysrootdir/run/systemd/system" ]; then
if ! sync "$outfile" 2> /dev/null; then
dinfo "dracut: sync operation on newly created initramfs $outfile failed"
exit 1
@@ -2108,7 +2108,7 @@ if test -d $dracutsysrootdir/run/systemd/system; then
# use fsfreeze only if we're not writing to /
if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then
- if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
+ if ! (fsfreeze -f "$(dirname "$outfile")" 2>/dev/null && fsfreeze -u "$(dirname "$outfile")" 2>/dev/null); then
dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
fi
fi
--
2.23.0

View File

@ -0,0 +1,27 @@
From 63b05a8e6787301dce435bd414a37a8f3ae9cdde Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 25 Jul 2020 17:20:40 +0200
Subject: [PATCH] dracut.sh: fix ia32 detection for uefi executables
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/63b05a8e6787301dce435bd414a37a8f3ae9cdde
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index d5dfa77d..8f78da06 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1153,7 +1153,7 @@ if [[ ! $print_cmdline ]]; then
case $(uname -m) in
x86_64)
EFI_MACHINE_TYPE_NAME=x64;;
- ia32)
+ i?86)
EFI_MACHINE_TYPE_NAME=ia32;;
*)
dfatal "Architecture '$(uname -m)' not supported to create a UEFI executable"
--
2.23.0

View File

@ -0,0 +1,32 @@
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:Modify context for adaption
---
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 ] && gw=$(read a < ${iface}/gateway; echo $a)
- [ "$gateway" = "0.0.0.0" ] && unset $gateway
+ [ "$gw" = "0.0.0.0" ] && unset gw
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
[ -e ${iface}/prefix-len ] && prefix=$(read a < ${iface}/prefix-len; echo $a)
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
--
2.33.0

View File

@ -0,0 +1,25 @@
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
---
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 @@ install() {
inst_multiple mount mknod mkdir sleep chroot chown \
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid \
- modprobe
+ modprobe tr
inst_multiple -o findmnt less kmod
--
2.33.0

View File

@ -0,0 +1,29 @@
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.
---
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.33.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,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:Modify context for adaption
---
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
@@ -731,12 +731,28 @@ btrfs_devs() {
iface_for_remote_addr() {
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() {
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.33.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>
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/e9ed44c8864445d85018e31064cd888c358f1daf
---
dracut-functions.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 9220c34..b0e9fa8 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -357,6 +357,7 @@ find_block_device() {
done; return 1; } && 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 _majmin _dev || [ -n "$_dev" ]; do
@@ -403,6 +404,8 @@ find_mp_fstype() {
done; return 1; } && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
@@ -439,6 +442,8 @@ find_dev_fstype() {
done; return 1; } && return 0
fi
+ [[ ! -f "$dracutsysrootdir"/etc/fstab ]] && return 1
+
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
@@ -463,6 +468,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"
}
@@ -484,6 +491,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,45 @@
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.
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/e2fdb30b56305aed9d3be32f394352c7c3fdbcef
---
dracut-init.sh | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index 3443c63..9bfcefe 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -238,11 +238,18 @@ inst_symlink() {
}
inst_multiple() {
- local _ret
- $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
- _ret=$?
- (($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
- return $_ret
+ 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=$?
+ derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
+ return $_ret
+ fi
}
dracut_install() {
--
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.
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/b12ee558f5660073ad26415794570188e8a427b0
---
dracut-init.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index 837267a..3443c63 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -995,7 +995,7 @@ instmods() {
-m "$@"
fi
- [[ "$optional" ]] && return 0
+ [[ "$_optional" ]] && return 0
return $_ret
}
--
2.23.0

View File

@ -0,0 +1,30 @@
From 72bd474b54b489afc4d06d26f5bf8e1097518946 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 11 Mar 2022 14:04:16 +0100
Subject: [PATCH] fix(dracut-initramfs-restore.sh): check if SELINUXTYPE is set
It can happen that SELINUXTYPE is not set, e.g., in Fedora/RHEL
installation images /etc/selinux/config is an empty file. That means
that setfiles fails, which makes dracut-initramfs-restore fail too
because it uses "set -x", which means that dracut-shutdown.service
fails. But, after commit 7ab1d00227cad6f1b86ba01fdc766769faebb031, a
failure of dracut-shutdown.service means that the final switch back into
initrd is skipped. Let's just add an additional sanity check to
workaround that.
---
dracut-initramfs-restore.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index 3c70b42c3c..b19be7de3c 100644
--- a/dracut-initramfs-restore.sh
+++ b/dracut-initramfs-restore.sh
@@ -56,7 +56,7 @@ fi
if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ] ; then
. /etc/selinux/config
- /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts /run/initramfs > /dev/null
+ [ -n "${SELINUXTYPE}" ] && /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
fi
exit 0

View File

@ -0,0 +1,49 @@
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:Modify context for adaption
---
install/dracut-install.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index d7a1cd9b..7c6d91c1 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -312,10 +312,10 @@ static int cp(const char *src, const char *dst)
pid = fork();
if (pid == 0) {
if (geteuid() == 0 && no_xattr == false)
- execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL", src, dst,
+ 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, dst,
+ execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps,ownership", "-fL", src, dst,
NULL);
_exit(EXIT_FAILURE);
}
@@ -324,10 +324,10 @@ static int cp(const char *src, const char *dst)
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", src,
+ 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", src,
+ log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps,ownership -fL %s %s", src,
dst);
break;
}
--
2.33.0

View File

@ -0,0 +1,81 @@
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 00a4f586..6feb7782 100644
--- a/install/dracut-install.c
+++ b/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) {
@@ -455,30 +455,39 @@ static char *get_real_file(const char *src, bool fullyresolve)
log_debug("get_real_file: readlink('%s') returns '%s'", fullsrcpath, linktarget);
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,80 @@
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/dracutdevs/dracut/commit/2f791b401b287f67f2421452b5f82cdb5285a637
Conflict:Modify context for adaption
---
install/dracut-install.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index 8c0c1f7..ee8c326 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -1488,7 +1488,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.33.0

View File

@ -0,0 +1,43 @@
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
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/b2d7561b98d08c7e4018aa22dc36dc1242e50f09
---
dracut.conf.5.asc | 2 +-
dracut.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
index 937f542..36878e4 100644
--- a/dracut.conf.5.asc
+++ b/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=*"__{bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
+*compress=*"__{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
diff --git a/dracut.sh b/dracut.sh
index e1ba53e..03c5985 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -596,7 +596,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";;
--
2.23.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:context adaptation
---
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,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: Context adaptation
---
dracut.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index fecd8a3..7276550 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -692,20 +692,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,83 @@
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>
---
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" || -h "$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.33.0

View File

@ -0,0 +1,31 @@
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>
---
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" || -h "$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.33.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:context adaptation
---
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,42 @@
From 9e1c7f3deadd387adaa97b189593b4ba3d7c6d5a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 16 Feb 2021 14:17:50 +0100
Subject: [PATCH] fix(i18n): create the keyboard symlinks again
Invalid space broke the creation of the keyboard subdirectories,
leading to a symbolic link
usr/share/consolefonts,consoletrans,keymaps,unimaps ->
/usr/lib/kbd/consolefonts,consoletrans,keymaps,unimaps
in the created initramfs.
With this fix the correct symlinks are created again:
usr/share/consolefonts -> /usr/lib/kbd/consolefonts
usr/share/consoletrans -> /usr/lib/kbd/consoletrans
usr/share/keymaps -> /usr/lib/kbd/keymaps
usr/share/unimaps -> /usr/lib/kbd/unimaps
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/9e1c7f3deadd387adaa97b189593b4ba3d7c6d5a
---
modules.d/10i18n/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 04a402f1..b55804ea 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -110,7 +110,7 @@ install() {
if [[ ${kbddir} != "/usr/share" ]]; then
inst_dir /usr/share
- for _src in $(eval echo "{ ${KBDSUBDIRS} }"); do
+ for _src in $(eval echo "{${KBDSUBDIRS}}"); do
[ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
done
fi
--
2.19.1

View File

@ -0,0 +1,75 @@
From 5387ed24c8b33da1214232d57ab1831e117aaba0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 16 Feb 2021 15:16:41 +0100
Subject: [PATCH] fix(i18n): get rid of `eval` calls
By changing KBDSUBDIRS to a bash array, all kinds of `eval` quirks are
avoided.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/5387ed24c8b33da1214232d57ab1831e117aaba0
---
modules.d/10i18n/module-setup.sh | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index b55804ea..d6688b47 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -22,7 +22,7 @@ install() {
[[ -f "$dracutsysrootdir"/etc/vconsole.conf ]] && . "$dracutsysrootdir"/etc/vconsole.conf
fi
- KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
+ KBDSUBDIRS=(consolefonts consoletrans keymaps unimaps)
DEFAULT_FONT="${i18n_default_font:-eurlatgr}"
I18N_CONF="/etc/locale.conf"
VCONFIG_CONF="/etc/vconsole.conf"
@@ -110,7 +110,7 @@ install() {
if [[ ${kbddir} != "/usr/share" ]]; then
inst_dir /usr/share
- for _src in $(eval echo "{${KBDSUBDIRS}}"); do
+ for _src in "${KBDSUBDIRS[@]}"; do
[ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
done
fi
@@ -119,10 +119,9 @@ install() {
install_all_kbd() {
local rel f
- for __src in $(eval echo $dracutsysrootdir${kbddir}/{${KBDSUBDIRS}}); do
- _src=${__src#$dracutsysrootdir}
- inst_dir "$_src"
- $DRACUT_CP -L -t "${initdir}/${_src}" "$__src"/*
+ for _src in "${KBDSUBDIRS[@]}"; do
+ inst_dir "${kbddir}/$_src"
+ $DRACUT_CP -L -t "${initdir}/${kbddir}/$_src" "${dracutsysrootdir}${kbddir}/$_src"/*
done
# remove unnecessary files
@@ -242,14 +241,13 @@ install() {
}
checks() {
- for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
- do
- [[ -d "$dracutsysrootdir${kbddir}" ]] && \
- for dir in ${KBDSUBDIRS//,/ }
- do
- [[ -d "$dracutsysrootdir${kbddir}/${dir}" ]] && continue
- false
- done && break
+ for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd; do
+ if [[ -d "$dracutsysrootdir${kbddir}" ]]; then
+ for dir in "${KBDSUBDIRS[@]}"; do
+ [[ -d "$dracutsysrootdir${kbddir}/${dir}" ]] && continue
+ false
+ done && break
+ fi
kbddir=''
done
--
2.19.1

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,57 @@
From d1a36d3d80b0ed71ee814659e18a020c53cee05e Mon Sep 17 00:00:00 2001
From: Jaroslav Jindrak <dzejrou@gmail.com>
Date: Fri, 7 May 2021 15:11:55 +0200
Subject: [PATCH] fix(install): handle $LIB in ldd output parsing
The ldd output can contain the variable $LIB, which is a documented feature of
ldd. In a previous commit [0], dracut-install received support for this
variable, but that was later reverted [1] due to issues [2][3] on Gentoo ARM64.
The part before '=>' does not necessarily refer to an existing file (e.g. due
to the usage of $LIB) and thus [1] could be seen as a regression to anyone
that uses this ldd feature. This PR combines both cases together and whenever
it find a '$' character (i.e. a variable) on the left side of the '=>' symbol,
it uses the right hand path (and thus uses evaluation done by ldd), otherwise
falls back to the behavior set by [1].
Reproducer that was presented to me:
$ grep "ibz.so" /etc/ld.so.preload || cat << EOF >> /etc/ld.so.preload
/\$LIB/libz.so.1.2.11
EOF
$ mkdir -p /var/tmp/dracut.xitk6p/initramfs
$ strace /usr/lib/dracut/dracut-install -D /var/tmp/dracut.xitk6p/initramfs -l /bin/bash 2>&1|grep ibz
$ rm -rf /var/tmp/dracut.xitk6p/
[0] 45404a2
[1] 6d886bb
[2] #471
[3] https://bugs.gentoo.org/667752
---
src/install/dracut-install.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index b4eec363..9f044ae0 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -589,7 +589,15 @@ static int resolve_deps(const char *src)
if (strstr(buf, destrootdir))
break;
- p = strchr(buf, '/');
+ p = buf;
+ if (strchr(p, '$')) {
+ /* take ldd variable expansion into account */
+ p = strstr(p, "=>");
+ if (!p)
+ p = buf;
+ }
+ p = strchr(p, '/');
+
if (p) {
char *q;
--
2.33.0

View File

@ -0,0 +1,31 @@
From c1ab36139d416e580e768c29f2addf7ccbc2c612 Mon Sep 17 00:00:00 2001
From: Marcos Mello <marcosfrm@gmail.com>
Date: Thu, 20 May 2021 15:41:26 -0300
Subject: [PATCH] fix(install): sane default --kerneldir
If --kerneldir is not specified, use /lib/modules/$(uname -r).
Fixes #1505
---
src/install/dracut-install.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c
index 9f044ae0..3fd70fc8 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -1167,7 +1167,10 @@ static int parse_argv(int argc, char *argv[])
if (!kerneldir) {
struct utsname buf;
uname(&buf);
- kerneldir = strdup(buf.version);
+ if (asprintf(&kerneldir, "%s%s", "/lib/modules/", buf.release) < 0) {
+ log_error("Out of memory!");
+ exit(EXIT_FAILURE);
+ }
}
if (arg_modalias) {
--
2.33.0

View File

@ -0,0 +1,27 @@
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
---
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/install/dracut-install.c
+++ b/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.33.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:context conflict
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 ac43b48..05ba183 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -217,7 +217,7 @@ handle_netroot()
iscsi_target_ip="[$iscsi_target_ip]"
fi
targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/')
- [ -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,28 @@
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.
---
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/dracut.cmdline.7.asc
+++ b/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.33.0

View File

@ -0,0 +1,33 @@
From d364ce8334fef96f48492bd0fb3b7deac37bbb66 Mon Sep 17 00:00:00 2001
From: Alexander Wenzel <alexander.wenzel@qbeyond.de>
Date: Tue, 2 Nov 2021 09:25:56 +0100
Subject: [PATCH] fix(mdraid): allow UUID comparison for more than one UUID
If the system provides more than one UUID, the _MD_UUID var
contains a line break after each UUID. Therefore the strstr
function could not find any UUID, caused by the additional
spaces provided to the function.
Furthermore this could lead to a boot interruption, because
the start of a degraded raid1 won't be executed. So, manual
interaction is necessary.
---
modules.d/90mdraid/mdraid_start.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh
index 9ac171d3..7b3d0de7 100755
--- a/modules.d/90mdraid/mdraid_start.sh
+++ b/modules.d/90mdraid/mdraid_start.sh
@@ -54,7 +54,7 @@ _md_force_run() {
_UUID=$(str_replace "$_UUID" ":" "")
# check if we should handle this device
- strstr " $_MD_UUID " " $_UUID " || continue
+ strstr "$_MD_UUID" "$_UUID" || continue
_md_start "${_md}" "${_offroot}"
done
--
2.33.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,76 @@
From 7b8c78ff43a1f8e3690969e980d3d9d1dcb00c87 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 31 Mar 2021 10:18:27 +0200
Subject: [PATCH] fix(multipath): revise multipathd-stop
A shellcheck regression quoted `HARD` in
```shell
kill "$HARD" "$pid" > /dev/null 2>&1
```
which would error on an empty "HARD".
Instead of fixing this, use `pkill` instead and also add it to the
non-optional list of binaries to install, which was revised also.
Fixes: https://github.com/dracutdevs/dracut/issues/1275
---
modules.d/90multipath/module-setup.sh | 15 ++++++++++-----
modules.d/90multipath/multipathd-stop.sh | 16 +++++++++-------
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 48a9d09..31b1b86 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -79,12 +79,16 @@ install() {
}
}
- inst_multiple -o \
- dmsetup \
- kpartx \
+ inst_multiple \
+ pkill \
+ pidof \
+ kpartx \
+ dmsetup \
+ multipath \
+ multipathd
+
+ inst_multiple -o \
mpath_wait \
- multipath \
- multipathd \
mpathpersist \
xdrgetuid \
xdrgetprio \
diff --git a/modules.d/90multipath/multipathd-stop.sh b/modules.d/90multipath/multipathd-stop.sh
index 57a0728..b11c987 100755
--- a/modules.d/90multipath/multipathd-stop.sh
+++ b/modules.d/90multipath/multipathd-stop.sh
@@ -1,12 +1,14 @@
#!/bin/sh
if [ -e /etc/multipath.conf ]; then
- HARD=""
- while pidof multipathd >/dev/null 2>&1; do
- for pid in $(pidof multipathd); do
- kill $HARD $pid >/dev/null 2>&1
- done
- HARD="-9"
- done
+ pkill multipathd > /dev/null 2>&1
+
+ if pidof multipathd > /dev/null 2>&1; then
+ sleep 0.2
+ fi
+
+ if pidofmultipathd>/dev/null 2>&1;then
+ pkill -9 multipathd>/dev/null 2>&1
+ fi
fi
--
2.33.0

View File

@ -0,0 +1,37 @@
From 3c244c7ca3555b526883dc20104c469b39085cbe Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 23 Apr 2021 11:11:27 +0200
Subject: [PATCH] fix(multipath): stop multipath before udev db cleanup
All device-mapper based devices, including device-mapper-multipath,
do reuse the udev db from the initramfs after switching to the root fs.
Therefore device-mapper devices have to be correctly initialized before
the udev daemon is stopped, to have the correct entries in the udev db.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1949076
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/3c244c7ca
---
modules.d/90multipath/multipathd.service | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service
index 646c7c14..b544de21 100644
--- a/modules.d/90multipath/multipathd.service
+++ b/modules.d/90multipath/multipathd.service
@@ -4,8 +4,10 @@ Before=iscsi.service iscsid.service lvm2-activation-early.service
Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target
After=systemd-udev-trigger.service systemd-udev-settle.service
Before=local-fs-pre.target
+Before=initrd-cleanup.service
DefaultDependencies=no
Conflicts=shutdown.target
+Conflicts=initrd-cleanup.service
ConditionKernelCommandLine=!nompath
ConditionKernelCommandLine=!rd.multipath=0
ConditionKernelCommandLine=!rd_NO_MULTIPATH
--
2.32.0

View File

@ -0,0 +1,70 @@
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
---
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 a05c4698..0dc9541c 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 35917bbf..19af8789 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 5f71515a..345863f9 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
--
2.33.0

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.
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/2c26b703223bb65822954264bcd6ca7934c98b4a
---
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 96df17f..2c4a0e8 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -289,7 +289,6 @@ ibft_to_cmdline() {
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
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,42 @@
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.
Conflict:require adaption
Reference:https://github.com/dracutdevs/dracut/commit/f4e9ea879f38bea92069e9397028caa5d81e5aee
---
modules.d/40network/net-lib.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 2c4a0e8..fa4aac0 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -207,9 +207,10 @@ 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));
+ num=$((num+1));
[ -e /sys/class/net/$name$num ] && continue
for n in $(getargs ifname=); do
[ "$name$num" = "${n%%:*}" ] && continue 2
@@ -217,6 +218,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,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 8d6942c9a..7d8d61fa7 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -15,6 +15,7 @@ done
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.27.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,36 @@
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.
---
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 195ad48..fe37686 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.33.0

View File

@ -0,0 +1,55 @@
From d15441cef47e7d741923b779fef88be79e44b389 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 26 Mar 2021 10:29:28 +0100
Subject: [PATCH] fix(qeth_rules): shellcheck for modules.d/95qeth_rules
---
modules.d/95qeth_rules/module-setup.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
index 543dd23..195ad48 100755
--- a/modules.d/95qeth_rules/module-setup.sh
+++ b/modules.d/95qeth_rules/module-setup.sh
@@ -10,8 +10,8 @@ check() {
[[ $hostonly ]] && {
for i in /sys/devices/qeth/*/online; do
- read _online < $i
- [ $_online -eq 1 ] && return 0
+ read -r _online < "$i"
+ [ "$_online" -eq 1 ] && return 0
done
}
return 255
@@ -25,7 +25,7 @@ installkernel() {
# called by dracut
install() {
ccwid() {
- qeth_path=$(readlink -e -q $1/device)
+ qeth_path=$(readlink -e -q "$1"/device)
basename "$qeth_path"
}
@@ -44,15 +44,15 @@ install() {
# not readable in qeth interfaces
# that have just been assembled, ignore
# read error and assume no carrier
- read carrier 2>/dev/null < "$1/carrier"
+ read -r carrier 2> /dev/null < "$1/carrier"
[ "$carrier" -eq 1 ] && return 0
return 1;
}
for dev in /sys/class/net/*; do
- has_carrier $dev || continue
- id=$(ccwid $dev)
- [ -n "$id" ] && inst_rules_qeth $id
+ has_carrier "$dev" || continue
+ id=$(ccwid "$dev")
+ [ -n "$id" ] && inst_rules_qeth "$id"
done
inst_simple /usr/lib/udev/collect
--
2.33.0

View File

@ -0,0 +1,34 @@
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>
---
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 f0507b13..b47acbec 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
--
2.33.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:Modify context for adaption
---
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,64 @@
From aa05b741e3c0ca708a0e76445a9aa94b52bc1974 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 12 Feb 2021 13:26:10 +0100
Subject: [PATCH] fix: shellcheck for modules.d/10i18n/module-setup.sh
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/aa05b741e3c0ca708a0e76445a9aa94b52bc1974
---
modules.d/10i18n/module-setup.sh | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index dd45b666..04a402f1 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -19,7 +19,7 @@ install() {
if dracut_module_included "systemd"; then
unset FONT
unset KEYMAP
- [[ -f $dracutsysrootdir/etc/vconsole.conf ]] && . $dracutsysrootdir/etc/vconsole.conf
+ [[ -f "$dracutsysrootdir"/etc/vconsole.conf ]] && . "$dracutsysrootdir"/etc/vconsole.conf
fi
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
@@ -38,13 +38,14 @@ install() {
for map in $MAPS; do
KEYMAPS="$KEYMAPS $map "
case $map in
- *.gz) cmd=zgrep;;
- *.bz2) cmd=bzgrep;;
- *) cmd=grep ;;
+ *.gz) cmd="zgrep";;
+ *.bz2) cmd="bzgrep";;
+ *) cmd="grep";;
esac
- for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
+ for INCL in $($cmd "^include " $map | while read _ a _ || [ -n "$a" ]; do echo ${a//\"/}; done); do
for FN in $(find $dracutsysrootdir${kbddir}/keymaps -type f -name $INCL\*); do
+ [[ -f $FN ]] || continue
strstr "$KEYMAPS" " $FN " || findkeymap $FN
done
done
@@ -81,6 +82,8 @@ install() {
gather_vars() {
local item map value
+ # FIXME: double check
+ # shellcheck disable=SC2068
for item in $@
do
item=(${item/:/ })
@@ -107,7 +110,7 @@ install() {
if [[ ${kbddir} != "/usr/share" ]]; then
inst_dir /usr/share
- for _src in $(eval echo {${KBDSUBDIRS}}); do
+ for _src in $(eval echo "{ ${KBDSUBDIRS} }"); do
[ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
done
fi
--
2.19.1

View File

@ -0,0 +1,149 @@
From 38ef31939056dea30017d782988ba1a46df4784a Mon Sep 17 00:00:00 2001
From: Petr Pavlu <petr.pavlu@suse.com>
Date: Tue, 9 Feb 2021 13:13:25 +0100
Subject: [PATCH] fix(shutdown): add timeout to umount calls
When terminating a system, the shutdown module attempts to unmount all
file systems from under /oldroot. This reaps remaining file systems that
systemd cannot unmount and detaches /oldroot itself.
In case that running umount for some file system repeatedly fails, the
module reports this error and continues the processing in order to
shutdown the system. This handles a condition when the umount command
actually terminates but it can happen in some cases that it waits
indefinitely.
An example with NFS mounts:
# mount -t nfs 192.168.0.1:/srv/nfs/dir /mnt/nfs
# mkdir /mnt/nfs/dir2
# mount -t nfs 192.168.0.1:/srv/nfs/dir2 /mnt/nfs/dir2
# touch /mnt/nfs/dir2/file
# systemd-run -pKillMode=none -pSendSIGKILL=no tail -f /mnt/nfs/dir2/file
Running as unit: run-r367825c967ca4d88a793ae4793c02f8b.service
# systemctl poweroff
The invoked tail command escapes normal termination by systemd and
prevents stopping mnt-nfs.mount and mnt-nfs-dir2.mount as it makes the
mounts busy. Systemd then again attempts to unmount these file systems
in systemd-shutdown but this fails as well. The utility tries to unmount
/mnt/nfs/dir2 but the kernel waits indefinitely doing a path lookup for
/mnt/nfs because network is no longer available at that point. The
systemd-shutdown gives up after 90 seconds. Finally, the control is
transferred to dracut which tries to unmount the file systems in the
same way and ends up indefinitely waiting on umount to finish.
This situation causes that the system hangs during shutdown. The patch
improves the shutdown module to add a timeout of 90 seconds for the
umount operation and continue with the shutdown if it gets reached,
similarly to what systemd-shutdown does.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/38ef31939056dea30017d782988ba1a46df4784a
---
dracut.cmdline.7.asc | 6 ++++
modules.d/99shutdown/module-setup.sh | 2 +-
modules.d/99shutdown/shutdown.sh | 44 +++++++++++++++++++++++-----
3 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 0951c0e0..4e598b6b 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -167,6 +167,12 @@ Misc
specify the controlling terminal for the console.
This is useful, if you have multiple "console=" arguments.
+**rd.shutdown.timeout.umount=**__<seconds>__::
+ specify how long dracut should wait for an individual umount to finish
+ during shutdown. This avoids the system from blocking when unmounting a file
+ system cannot complete and waits indefinitely. Value '0' means to wait
+ 'forever'. The default is 90 seconds.
+
[[dracutkerneldebug]]
Debug
~~~~~
diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh
index dfd6caa2..ff9b7734 100755
--- a/modules.d/99shutdown/module-setup.sh
+++ b/modules.d/99shutdown/module-setup.sh
@@ -14,7 +14,7 @@ depends() {
# called by dracut
install() {
local _d
- inst_multiple umount poweroff reboot halt losetup stat sleep
+ inst_multiple umount poweroff reboot halt losetup stat sleep timeout
inst_multiple -o kexec
inst "$moddir/shutdown.sh" "$prefix/shutdown"
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh
index a30a126f..90a0b9e1 100755
--- a/modules.d/99shutdown/shutdown.sh
+++ b/modules.d/99shutdown/shutdown.sh
@@ -46,28 +46,56 @@ warn "Killing all remaining processes"
killall_proc_mountpoint /oldroot || sleep 0.2
+# Timeout for umount calls. The value can be set to 0 to wait forever.
+_umount_timeout=$(getarg rd.shutdown.timeout.umount)
+_umount_timeout=${_umount_timeout:-90s}
+_timed_out_umounts=""
+
umount_a() {
+ local _verbose="n"
+ if [ "$1" = "-v" ]; then
+ _verbose="y"; shift
+ exec 7>&2
+ else
+ exec 7>/dev/null
+ fi
+
local _did_umount="n"
while read a mp a || [ -n "$mp" ]; do
- if strstr "$mp" oldroot; then
- if umount "$mp"; then
- _did_umount="y"
- warn "Unmounted $mp."
- fi
+ strstr "$mp" oldroot || continue
+ strstr "$_timed_out_umounts" " $mp " && continue
+
+ # Unmount the file system. The operation uses a timeout to avoid waiting
+ # indefinitely if this is e.g. a stuck NFS mount. The command is
+ # invoked in a subshell to silence also the "Killed" message that might
+ # be produced by the shell.
+ (set +m; timeout --signal=KILL "$_umount_timeout" umount "$mp") 2>&7
+ local ret=$?
+ if [ $ret -eq 0 ]; then
+ _did_umount="y"
+ warn "Unmounted $mp."
+ elif [ $ret -eq 137 ]; then
+ _timed_out_umounts="$_timed_out_umounts $mp "
+ warn "Unmounting $mp timed out."
+ elif [ "$_verbose" = "y" ]; then
+ warn "Unmounting $mp failed with status $ret."
fi
done </proc/mounts
- losetup -D
+
+ losetup -D 2>&7
+
+ exec 7>&-
[ "$_did_umount" = "y" ] && return 0
return 1
}
_cnt=0
while [ $_cnt -le 40 ]; do
- umount_a 2>/dev/null || break
+ umount_a || break
_cnt=$(($_cnt+1))
done
-[ $_cnt -ge 40 ] && umount_a
+[ $_cnt -ge 40 ] && umount_a -v
if strstr "$(cat /proc/mounts)" "/oldroot"; then
warn "Cannot umount /oldroot"
--
2.19.1

View File

@ -0,0 +1,40 @@
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
---
dracut-initramfs-restore.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index abe6b1e2..d97030a3 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
--
2.33.0

View File

@ -0,0 +1,29 @@
From 68dd8af21d34c5c2cb8631f7c02c6a6cf1aa6122 Mon Sep 17 00:00:00 2001
From: realtime-neil <neil@rtr.ai>
Date: Mon, 25 Jan 2021 22:44:07 +0000
Subject: [PATCH] fix(skipcpio): edit skipcpio.c: strstr -> memmem
because CPIO_END might follow a NULL byte in buf
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/68dd8af21d34c5c2cb8631f7c02c6a6cf1aa6122
---
skipcpio/skipcpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/skipcpio/skipcpio.c b/skipcpio/skipcpio.c
index 30699816..dea216c5 100644
--- a/skipcpio/skipcpio.c
+++ b/skipcpio/skipcpio.c
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
if (s <= 0)
break;
- h = strstr(buf, CPIO_END);
+ h = memmem(buf, sizeof(buf), CPIO_END, sizeof(CPIO_END));
if (h) {
pos = (h - buf) + pos + CPIO_ENDLEN;
fseek(f, pos, SEEK_SET);
--
2.19.1

View File

@ -0,0 +1,25 @@
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
---
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() {
local 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.33.0

View File

@ -0,0 +1,29 @@
From 07417b7fc5cb261187519c916e4735189f20f4c6 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Sat, 23 May 2020 18:03:47 +0300
Subject: [PATCH] lvm: fix removal of pvscan from udev rules
udev rules provided by lvm 2.02.128 and newer uses '+=' instead of '='.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/07417b7fc5cb261187519c916e4735189f20f4c6
---
modules.d/90lvm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index d6d2c185..52c803f7 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -101,7 +101,7 @@ install() {
sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
- sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
+ sed -i -e 's/^ENV{SYSTEMD_WANTS}+\?=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
else
sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \
${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules
--
2.23.0

View File

@ -0,0 +1,30 @@
From fe02bc78accf4aaa39ab33adcdb5aaa71df90b30 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Sat, 23 May 2020 21:42:18 +0300
Subject: [PATCH] lvm: remove unnecessary ${initdir} from lvm_scan.sh
lvm_scan.sh runs in the initramfs, so paths should not be prefixed with
${initdir}.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/fe02bc78accf4aaa39ab33adcdb5aaa71df90b30
---
modules.d/90lvm/lvm_scan.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index 61a18b24..ff8e66e2 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -91,7 +91,7 @@ export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
if [ -n "$SNAPSHOT" ] ; then
# HACK - this should probably be done elsewhere or turned into a function
# Enable read-write LVM locking
- sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' ${initdir}/etc/lvm/lvm.conf
+ sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' /etc/lvm/lvm.conf
# Expected SNAPSHOT format "<orig lv name>:<snap lv name>"
ORIG_LV=${SNAPSHOT%%:*}
--
2.23.0

View File

@ -0,0 +1,40 @@
From acc782bad5c77a8e105c9c5a8fc8873bc2ff06ec Mon Sep 17 00:00:00 2001
From: Norbert Lange <norbert.lange@andritz.com>
Date: Mon, 6 Jul 2020 18:16:13 +0200
Subject: [PATCH] mount-root.sh: fix writing fstab file with missing fsck flag
if the kernel argument rootflags is set, then dracut will
not parse the rootfs fstab and rootfsck wil not be set.
if the filesystem can be fsck'ed then its unmounted,
and an entry to the local fstab is written, omitting the last
field.
mounting /sysroot using fstab will then fail.
This change makes sure that the filed is always written.
Conflict:NA
Reference:https://github.com/dracutdevs/dracut/commit/acc782bad5c77a8e105c9c5a8fc8873bc2ff06ec
Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
---
modules.d/95rootfs-block/mount-root.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh
index 0eddbcd5..6503b517 100755
--- a/modules.d/95rootfs-block/mount-root.sh
+++ b/modules.d/95rootfs-block/mount-root.sh
@@ -116,7 +116,7 @@ mount_root() {
ran_fsck=1
fi
- echo "${root#block:} $NEWROOT $rootfs ${rflags:-defaults} 0 $rootfsck" >> /etc/fstab
+ echo "${root#block:} $NEWROOT $rootfs ${rflags:-defaults} 0 ${rootfsck:-0}" >> /etc/fstab
if ! ismounted "$NEWROOT"; then
info "Mounting ${root#block:} with -o ${rflags}"
--
2.23.0

View File

@ -0,0 +1,25 @@
From 93baf525a669c8626b1391f9660c08f452f65159 Mon Sep 17 00:00:00 2001
From: yueyuankun <yueyuankun@kylinos.cn>
Date: Fri, 26 Apr 2024 15:17:56 +0800
Subject: [PATCH] fix(base): install chmod binaries
---
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 a31f940..db8902c 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -17,7 +17,7 @@ install() {
inst_multiple mount mknod mkdir sleep chroot chown \
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid \
- modprobe tr
+ modprobe tr chmod
inst_multiple -o findmnt less kmod
--
2.33.0

View File

@ -9,7 +9,7 @@
Name: dracut
Version: 050
Release: 5
Release: 10
Summary: Initramfs generator using udev
@ -40,6 +40,79 @@ Patch0012: Fix-test-in-lsinitrd.patch
Patch0013: add-option-to-include-file-metadata-in-initramfs.patch
Patch0014: backport-fix-always-use-mkdir-p.patch
Patch0015: backport-fix-dracut.sh-omission-is-an-addition-to-other-omiss.patch
Patch0016: backport-dracut-install-ignore-bogus-preload-libs.patch
Patch0017: backport-fix-multipath-revise-multipathd-stop.patch
Patch0018: backport-fix-install-handle-LIB-in-ldd-output-parsing.patch
Patch0019: backport-fix-install-sane-default-kerneldir.patch
Patch0020: backport-cryptroot-ask-no-warn-if-run-cryptsetup-exist.patch
Patch0021: backport-dracut-functions-fix-find_binary-to-return-full-path.patch
Patch0022: backport-fix-dracut.sh-handle-i-option-to-include-files-begin.patch
Patch0023: backport-fix-dracut.sh-handle-symlinks-appropriately-while-us.patch
Patch0024: backport-fix-crypt-gpg-execute-card-status-on-each-try.patch
Patch0025: backport-fix-url-lib-make-pre-pivot-hook-separetely-per-nfs-m.patch
Patch0026: backport-fix-qeth_rules-shellcheck-for-modules.d-95qeth_rules.patch
Patch0027: backport-fix-qeth_rules-check-the-existence-of-sys-devices-qe.patch
Patch0028: backport-fix-dracut-install-tweaks-to-get_real_file.patch
Patch0029: backport-fix-base-tr-needs-to-be-installed.patch
Patch0030: backport-fix-install-segfault-on-popen-error.patch
Patch0031: backport-fix-shutdown-be-robust-against-forced-shutdown.patch
Patch0032: backport-fix-man-default-value-of-rd.retry-was-increased-to-1.patch
Patch0033: backport-fix-network-add-errors-and-warnings-when-network-int.patch
Patch0034: backport-dracut-functions-add-ip_params_for_remote_addr-helpe.patch
Patch0035: backport-95resume-Do-not-resume-on-iSCSI-FCoE-or-NBD.patch
Patch0036: backport-fix-mdraid-allow-UUID-comparison-for-more-than-one-U.patch
Patch0037: backport-fix-resume-check-for-presence-of-sys-power-resume.patch
Patch0038: backport-dracut.sh-add-check-for-invalid-configuration-files.patch
Patch0039: backport-95iscsi-fix-missing-space-when-compiling-cmdline-arg.patch
Patch0040: backport-dracut.sh-Move-the-library-workaround-after-squash.patch
Patch0041: backport-dracut.sh-FIPS-workaround-for-openssl-libs-on-Fedora.patch
Patch0042: backport-91zipl-parse-zipl.sh-honor-SYSTEMD_READY.patch
Patch0043: backport-95iscsi-fix-ipv6-target-discovery.patch
Patch0044: backport-dracut.sh-fix-early-microcode-detection-logic.patch
Patch0045: backport-dracut.sh-fix-ia32-detection-for-uefi-executables.patch
Patch0046: backport-95iscsi-use-ip_params_for_remote_addr.patch
Patch0047: backport-95nfs-use-ip_params_for_remote_addr.patch
Patch0048: backport-lvm-remove-unnecessary-initdir-from-lvm_scan.sh.patch
Patch0049: backport-lvm-fix-removal-of-pvscan-from-udev-rules.patch
Patch0050: backport-mount-root.sh-fix-writing-fstab-file-with-missing-fs.patch
Patch0051: backport-Change-the-order-of-NFS-servers-during-the-boot.patch
Patch0052: backport-Allow-DRACUT_INSTALL-to-be-not-an-absolute-path.patch
Patch0053: backport-UEFI-Mode-only-write-kernel-cmdline-to-UEFI-binary.patch
Patch0054: backport-90lvm-do-not-add-newline-to-cmdline.patch
Patch0055: backport-dracut.sh-fix-errors-pointed-out-by-shellcheck.patch
Patch0056: backport-Do-not-start-inside-container.patch
Patch0057: backport-fix-skipcpio-edit-skipcpio.c-strstr-memmem.patch
Patch0058: backport-fix-shellcheck-for-modules.d-10i18n-module-setup.sh.patch
Patch0059: backport-fix-i18n-create-the-keyboard-symlinks-again.patch
Patch0060: backport-fix-i18n-get-rid-of-eval-calls.patch
Patch0061: backport-Fix-bad-ls-parsing.patch
Patch0062: backport-fix-shutdown-add-timeout-to-umount-calls.patch
Patch0063: backport-docs-fix-dracut.cmdline.7.patch
Patch0064: backport-fix-dracut.sh-remove-wrong-in-loop-sequence.patch
Patch0065: backport-fix-dracut.sh-change-misspelled-variable-name.patch
Patch0066: backport-fix-dmsquash-live-iso-scan-requires-rmdir.patch
Patch0067: backport-fix-network-manager-skip-non-directories-in-sys-class-net.patch
Patch0068: backport-fix-dracut.sh-do-not-ignore-invalid-config-file-or-dir-path.patch
Patch0069: backport-fix-iscsi-do-not-exit-in-handle_netroot-if-discovery.patch
Patch0070: backport-fix-multipath-drop-ExecStop-setting-from-service-uni.patch
Patch0071: backport-90multipath-install-kpartx-s-11-dm-parts.rules.patch
Patch0072: backport-fix-multipath-stop-multipath-before-udev-db-cleanup.patch
Patch0073: backport-fix-40network-consistent-use-of-gw-for-gateway.patch
Patch0074: backport-fix-dracut-functions.sh-ip-route-parsing.patch
Patch0075: backport-fix-dracut-install-copy-files-preserving-ownership-a.patch
Patch0076: backport-fix-ifcfg-avoid-calling-unavailable-dracut-logger-functions.patch
Patch0077: backport-fix-resume-correct-call-to-block_is_netdevice-function.patch
Patch0078: backport-fix-nfs-give-run-rpcbind-ownership-to-rpc-user.patch
Patch0079: backport-fix-dracut-install-use-stripped-kernel-module-path-as-hash-key.patch
Patch0080: backport-fix-dracut-init.sh-instmods-wrong-variable-name.patch
Patch0081: backport-fix-dracut-functions.sh-suppress-findmnt-error-msg-if-etc-fstab-not-exist.patch
Patch0082: backport-fix-dracut-replace-invalid-lzo-command-with-lzop-for-LZO-compression.patch
Patch0083: backport-fix-network-avoid-double-brackets-around-IPv6-address.patch
Patch0084: backport-fix-network-don-t-use-same-ifname-multiple-times.patch
Patch0085: backport-fix-dracut-init.sh-add-missing-hostonly-code-in-the-inst_multiple-function.patch
Patch0086: dracut-050-fix-base-install-chmod-binaries.patch
Patch0087: backport-fix-dracut-initramfs-restore-check-if-SELINUXTYPE-is-set.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example
@ -490,6 +563,22 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%endif
%changelog
* Fri Jun 07 2024 yanglongkang <yanglongkang@h-partners.com> - 050-10
- fix(dracut-initramfs-restore.sh): check if SELINUXTYPE is set
* Fri Apr 26 2024 yueyuankun <yueyuankun@kylinos.cn> - 050-9
- fix(base): install chmod binaries
* Thu Feb 22 2024 hongjinghao <hongjinghao@huawei.com> - 050-8
- backport patchs from upstream
* Tue Dec 19 2023 zhangruifang <zhangruifang@h-partners.com> - 050-7
- backport patchs from upstream
* Thu Dec 7 2023 wangyuhang <wangyuhang27@huawei.com> - 050-6
- [add] backport patches from upstream
backport-dracut-install-ignore-bogus-preload-libs.patch
* Wed May 26 2021 panxiaohe <panxiaohe@huawei.com> - 050-5
- [add] backport patches from upstream
backport-fix-always-use-mkdir-p.patch
@ -530,3 +619,4 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
* Thu Aug 29 2019 openEuler Buildteam <buildteam@openeuler.org> - 049-1
- Package init