!14 openEuler-dracut

Merge pull request !14 from Liquor/liquor
This commit is contained in:
openeuler-ci-bot 2020-07-24 11:49:38 +08:00 committed by Gitee
commit d86b41bdd8
21 changed files with 470 additions and 349 deletions

View File

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

View File

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

View File

@ -1,44 +0,0 @@
From 6d886bb74d1608e4565d926aa259ea5afc9df7b9 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Thu, 4 Oct 2018 16:45:47 -0400
Subject: [PATCH 103/145] dracut-install: simplify ldd parsing logic
The previous logic would not handle absolute paths on the left side of
the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:
/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1
At runtime, the kernel tries to load the file from /lib, and fails if we
only provide it in /lib64.
Instead of looking for the first slash after the "=>", just look for the
first slash, period. This would fail if we somehow had a relative path
on the left side (foo/libbar.so), but I'm not aware of any binaries that
would contain such an entry in DT_NEEDED.
Bug: https://bugs.gentoo.org/667752
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
install/dracut-install.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index 88bca1d4..5f352b36 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -479,11 +479,7 @@ static int resolve_deps(const char *src)
if (strstr(buf, destrootdir))
break;
- p = strstr(buf, "=>");
- if (!p)
- p = buf;
-
- p = strchr(p, '/');
+ p = strchr(buf, '/');
if (p) {
char *q;
--
2.19.1

View File

@ -1,45 +0,0 @@
From 48c283a29638e2c1e24cf282e673ddf8525b4199 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 25 Oct 2018 15:30:36 +0200
Subject: [PATCH 113/145] dracut.install: call dracut with --force
The kernel-install is called even if you run make install.
Since we don't call dracut with -f a second make install will fail
because initrd with same version is already there.
This makes kernel developers feel miserable.
https://bugzilla.redhat.com/show_bug.cgi?id=1642402
---
50-dracut.install | 2 +-
51-dracut-rescue.install | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/50-dracut.install b/50-dracut.install
index 64e3549f..bbb73442 100755
--- a/50-dracut.install
+++ b/50-dracut.install
@@ -49,7 +49,7 @@ case "$COMMAND" in
break
fi
done
- dracut ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
+ dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
ret=$?
;;
remove)
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
index 6ddafdb6..ef8afac1 100755
--- a/51-dracut-rescue.install
+++ b/51-dracut-rescue.install
@@ -98,7 +98,7 @@ case "$COMMAND" in
fi
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
- dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
+ dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
((ret+=$?))
fi
--
2.19.1

View File

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

View File

@ -1,44 +0,0 @@
From 58e0d2d5b5b3a5e7d6dbf74baa2f08f041de5a81 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Sun, 20 Jan 2019 21:56:05 +0100
Subject: [PATCH 136/145] Fix a missing space in example configs
It has
omit_drivers+=" i2o_scsi"
which would break the next omit_drivers+="foo " if it's
missing a space at the beginning.
Reference: boo#1121251
---
dracut.conf.d/gentoo.conf.example | 2 +-
dracut.conf.d/suse.conf.example | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.conf.d/gentoo.conf.example b/dracut.conf.d/gentoo.conf.example
index 26e73147..df102e00 100644
--- a/dracut.conf.d/gentoo.conf.example
+++ b/dracut.conf.d/gentoo.conf.example
@@ -12,4 +12,4 @@ ro_mnt=yes
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
i18n_default_font="LatArCyrHeb-16"
-omit_drivers+=" i2o_scsi"
+omit_drivers+=" i2o_scsi "
diff --git a/dracut.conf.d/suse.conf.example b/dracut.conf.d/suse.conf.example
index b5d962db..06573d59 100644
--- a/dracut.conf.d/suse.conf.example
+++ b/dracut.conf.d/suse.conf.example
@@ -10,7 +10,7 @@ hostonly_cmdline="yes"
compress="xz -0 --check=crc32 --memlimit-compress=50%"
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
-omit_drivers+=" i2o_scsi"
+omit_drivers+=" i2o_scsi "
# Below adds additional tools to the initrd which are not urgently necessary to
# bring up the system, but help to debug problems.
--
2.19.1

View File

@ -1,35 +0,0 @@
From 44f2fe5170b3f5f161cfee04e62b713f2e47237d Mon Sep 17 00:00:00 2001
From: Jens Heise <46450477+heisej@users.noreply.github.com>
Date: Mon, 7 Jan 2019 16:47:23 +0100
Subject: [PATCH 137/145] 10i18n: Fix keymaps not getting included sometimes
Eliminate erroneous substring matches when looking up already processed keymaps to prevent necessary keymaps not getting added to the initramfs sometimes e.g. if there are the files 'compose.latin1' and 'compose.latin1.add' the unfixed version would skip processing 'compose.latin1' if find returned 'compose.latin1.add' first due to the directory listing not being in sorted order.
---
modules.d/10i18n/module-setup.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index 08971814..6db5a9ca 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -36,7 +36,7 @@ install() {
MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
for map in $MAPS; do
- KEYMAPS="$KEYMAPS $map"
+ KEYMAPS="$KEYMAPS $map "
case $map in
*.gz) cmd=zgrep;;
*.bz2) cmd=bzgrep;;
@@ -45,7 +45,7 @@ install() {
for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
- strstr "$KEYMAPS" "$FN" || findkeymap $FN
+ strstr "$KEYMAPS" " $FN " || findkeymap $FN
done
done
done
--
2.19.1

View File

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

View File

@ -0,0 +1,27 @@
From 32dfd41688a0a2aee59a62dd661c808a935d91a4 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Mon, 4 May 2020 10:09:07 +0200
Subject: [PATCH] Fix test in lsinitrd
If $uefi is empty, this evaluated to true previously,
resulting in "initrd in UEFI: : 13M".
---
lsinitrd.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index b5c73f6..ea0c7f6 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -206,7 +206,7 @@ if [ "$bin" = "MZ" ]; then
fi
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
- if [ -n $uefi ]; then
+ if [ -n "$uefi" ]; then
echo -n "initrd in UEFI: $uefi: "
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
if [ -f "$TMPDIR/osrel.txt" ]; then
--
1.8.3.1

View File

@ -9,29 +9,29 @@ Signed-off-by: Anakin Zhang <benjamin93@163.com>
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index e683a9b..6ec0839 100644
index c14f6c0..572a60e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -235,6 +235,9 @@ Creates initial ramdisk images for preloading modules
kernel combined
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
@@ -242,6 +242,9 @@ Creates initial ramdisk images for preloading modules
--kernel-image [FILE] location of the kernel image
--regenerate-all Regenerate all initramfs images at the default location
for the kernel versions found on the system
+ -e, --file-metadata [TYPE]
+ Include file metadata in the initramfs. Specify "xattr"
+ to include file extended attributes.
If [LIST] has multiple arguments, then you have to put these in quotes.
@@ -312,7 +315,7 @@ rearrange_params()
@@ -319,7 +322,7 @@ rearrange_params()
set -- "${newat[@]}" # Set new $@
TEMP=$(unset POSIXLY_CORRECT; getopt \
- -o "a:m:o:d:I:k:c:L:fvqlHhMN" \
+ -o "a:m:o:d:I:k:c:L:fvqlHhMNe:" \
- -o "a:m:o:d:I:k:c:r:L:fvqlHhMN" \
+ -o "a:m:o:d:I:k:c:r:L:fvqlHhMNe:" \
--long kver: \
--long add: \
--long force-add: \
@@ -399,6 +402,7 @@ rearrange_params()
@@ -408,6 +411,7 @@ rearrange_params()
--long no-hostonly-i18n \
--long hostonly-i18n \
--long no-machineid \
@ -39,7 +39,7 @@ index e683a9b..6ec0839 100644
-- "$@")
if (( $? != 0 )); then
@@ -596,6 +600,8 @@ while :; do
@@ -608,6 +612,8 @@ while :; do
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--no-machineid)
machine_id_l="no";;
@ -48,15 +48,15 @@ index e683a9b..6ec0839 100644
--) shift; break;;
*) # should not even reach this point
@@ -765,6 +771,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l"
@@ -783,6 +789,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l"
[[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
[[ $machine_id_l ]] && machine_id="$machine_id_l"
+[[ $file_metadata_l ]] && file_metadata_opt="-e $file_metadata_l"
if ! [[ $outfile ]]; then
if [[ $machine_id != "no" ]]; then
@@ -1891,7 +1898,7 @@ if [[ $create_early_cpio = yes ]]; then
@@ -1988,7 +1995,7 @@ if [[ $create_early_cpio = yes ]]; then
if ! (
umask 077; cd "$early_cpio_dir/d"
find . -print0 | sort -z \
@ -65,7 +65,7 @@ index e683a9b..6ec0839 100644
); then
dfatal "dracut: creation of $outfile failed"
exit 1
@@ -1901,7 +1908,7 @@ fi
@@ -1998,7 +2005,7 @@ fi
if ! (
umask 077; cd "$initdir"
find . -print0 | sort -z \

View File

@ -1,32 +0,0 @@
From fc613d0d2ca74a39bd76d4defc5bdf479e921272 Mon Sep 17 00:00:00 2001
From: gaoyi <gaoyi15@huawei.com>
Date: Wed, 14 Aug 2019 07:22:22 -0400
Subject: [PATCH] check_vol_slaves_all must return 1 when lvm vgs failed
reason: when filter/global_filter is set in lvm.conf, lvm vgs may be
failed
Signed-off-by: gaoyi <gaoyi15@huawei.com>
---
dracut-functions.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 7c408f8..c50d328 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -595,6 +595,12 @@ check_vol_slaves_all() {
# strip space
_vg="${_vg//[[:space:]]/}"
if [[ $_vg ]]; then
+ # when filter/global_filter is set, lvm may be failed
+ lvm lvs --noheadings -o vg_name $_vg 2>/dev/null 1>/dev/null
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
do
check_block_and_slaves_all $1 $(get_maj_min $_pv)
--
2.19.1

Binary file not shown.

BIN
dracut-050.tar.xz Normal file

Binary file not shown.

View File

@ -0,0 +1,28 @@
From cb9e6881dde7ec34e11f6f38727602d6d841a04f Mon Sep 17 00:00:00 2001
From: Derek Hageman <hageman@inthat.cloud>
Date: Thu, 30 Apr 2020 18:40:13 -0600
Subject: [PATCH] 90crypt/module-setup.sh: fix force on multiple lines
The first line in crypttab with a "force" option causes all subsequent
lines to be included as if they also had it set because the variable
used to track it is not reset between loop iterations. So fix that by
just setting it to empty before the check for the force option.
---
modules.d/90crypt/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 3bce241..e3d6338 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -113,6 +113,7 @@ install() {
set -- ${luksoptions}
IFS="${OLD_IFS}"
+ forceentry=""
while [ $# -gt 0 ]; do
case $1 in
force)
--
1.8.3.1

View File

@ -0,0 +1,28 @@
From 7a04712ad0efa9afa3759656ea1b26db40a8a29e Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Mon, 21 Jan 2019 14:40:06 +0100
Subject: [PATCH] 95zfcp_rules/parse-zfcp.sh: remove rule existence check
Reference: bsc#1008352
Original-Patch-By: Michal Suchanek <msuchanek@suse.com>
---
modules.d/95zfcp_rules/parse-zfcp.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh
index 7defb04..2b62012 100755
--- a/modules.d/95zfcp_rules/parse-zfcp.sh
+++ b/modules.d/95zfcp_rules/parse-zfcp.sh
@@ -22,8 +22,6 @@ create_udev_rule() {
return 0;
fi
- [ -e ${_rule} ] && return 0
-
if [ ! -f "$_rule" ] ; then
cat > $_rule <<EOF
ACTION=="add", SUBSYSTEM=="ccw", KERNEL=="$ccw", IMPORT{program}="collect $ccw %k ${ccw} zfcp"
--
1.8.3.1

View File

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

View File

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

View File

@ -0,0 +1,111 @@
From 8e1a4dc5f8a777fc718db490414ffdc9dc755f66 Mon Sep 17 00:00:00 2001
From: Jonas Witschel <diabonas@archlinux.org>
Date: Sat, 18 Apr 2020 14:55:41 +0200
Subject: [PATCH] dracut-lib.sh: quote variables in parameter expansion
patterns
According to POSIX.1-2017, 2.6.2 Parameter Expansion:
${parameter%[word]} [...] The word shall be expanded to produce a
pattern.
This means if word contains variables that itself contain special
characters like asterisks or backslashes, these are treated as pattern
characters unless the variable is quoted. Try e.g. the following example
in bash, dash or (busybox) ash:
i='a\c'; j='\'; echo "${i%$j*}"
This prints "a\c" because "$j*" is expanded to "\*", escaping the
asterisk. In contrast,
i='a\c'; j='\'; echo "${i%"$j"*}"
produces the expected result "a" because the backslash is not specially
treated any more after quoting.
The quotes that this commit adds have been previously removed in commit
f9c96cf56fed390841eac05c43826e62014c9188, citing issues with busybox
hush without further specifying the actual error. I tested a recent
busybox build (upstream commit 9aa751b08ab03d6396f86c3df77937a19687981b)
and couldn't find any problems. Note that the above example always
produces "a\c" in hush regardless of quoting $j, making hush unsuitable
for use with dracut, but using quotes in parameter expansions generally
works.
The unquoted variables break the "rd.luks.uuid/name" kernel command line
options in dracut 050 because
str_replace "$luksname" '\' '\\'
in modules.d/90crypt/parse-crypt.sh is not able to escape the
backslashes any more, see GH-723, GH-727: backslashes in the
systemd-cryptsetup@.service unit name stay unescaped for use in udev
(cf. commit 0f6d93eb9d63695a64002ec8b0421fbc9fc8a7a3), leading to
failures in starting the unit.
This partially reverts commit f9c96cf56fed390841eac05c43826e62014c9188.
---
modules.d/99base/dracut-lib.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index c53cd13..c57523d 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -24,7 +24,7 @@ debug_on() {
# returns OK if $1 contains literal string $2 (and isn't empty)
strstr() {
- [ "${1##*$2*}" != "$1" ]
+ [ "${1##*"$2"*}" != "$1" ]
}
# returns OK if $1 matches (completely) glob pattern $2
@@ -43,18 +43,18 @@ strglobin() {
# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
str_starts() {
- [ "${1#$2*}" != "$1" ]
+ [ "${1#"$2"*}" != "$1" ]
}
# returns OK if $1 contains literal string $2 at the end, and isn't empty
str_ends() {
- [ "${1%*$2}" != "$1" ]
+ [ "${1%*"$2"}" != "$1" ]
}
trim() {
local var="$*"
- var="${var#${var%%[![:space:]]*}}" # remove leading whitespace characters
- var="${var%${var##*[![:space:]]}}" # remove trailing whitespace characters
+ var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters
+ var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters
printf "%s" "$var"
}
@@ -108,9 +108,9 @@ str_replace() {
local out=''
while strstr "${in}" "$s"; do
- chop="${in%%$s*}"
+ chop="${in%%"$s"*}"
out="${out}${chop}$r"
- in="${in#*$s}"
+ in="${in#*"$s"}"
done
echo "${out}${in}"
}
@@ -396,7 +396,7 @@ splitsep() {
while [ -n "$str" -a "$#" -gt 1 ]; do
tmp="${str%%$sep*}"
eval "$1='${tmp}'"
- str="${str#$tmp}"
+ str="${str#"$tmp"}"
str="${str#$sep}"
shift
done
--
1.8.3.1

View File

@ -0,0 +1,32 @@
From 7069132ec7e94a3274aa1b3b3b6e339066118a4d Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 10 Mar 2020 15:18:37 +0100
Subject: [PATCH] network: fix glob matching ipv6 addresses
In this case we want to cover three cases
1) ip_address:ip_address
2) number:macaddress
3) :macaddress
We consider something an IPv6 address if it starts with number and
contains ":", but IPv6 addresses are in hexa.
---
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 16730e5..7f185fd 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -510,7 +510,7 @@ ip_to_var() {
[ -n "$6" ] && dev=$6
[ -n "$7" ] && autoconf=$7
case "$8" in
- [0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
+ [0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
dns1="$8"
[ -n "$9" ] && dns2="$9"
;;
--
1.8.3.1

View File

@ -8,8 +8,8 @@
%global __requires_exclude pkg-config
Name: dracut
Version: 049
Release: 9
Version: 050
Release: 3
Summary: Initramfs generator using udev
@ -21,20 +21,23 @@ URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
#Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
Source0: https://git.kernel.org/pub/scm/boot/dracut/dracut.git/snapshot/dracut-%{version}.tar.gz
Patch6000: 0103-dracut-install-simplify-ldd-parsing-logic.patch
Patch6001: 0113-dracut.install-call-dracut-with-force.patch
Patch6002: 0129-remove-bashism-in-various-boot-scripts.patch
Patch6003: 0136-Fix-a-missing-space-in-example-configs.patch
Patch6004: 0137-10i18n-Fix-keymaps-not-getting-included-sometimes.patch
Patch6005: 0141-95iscsi-sys-devices-platform-flashnode_sess-is_boot_.patch
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
#Source0: https://git.kernel.org/pub/scm/boot/dracut/dracut.git/snapshot/dracut-%{version}.tar.gz
Patch9000: check_vol_slaves_all-must-return-1-when-lvm-vgs-fail.patch
Patch9001: dracut-network-fixed-net-rules-issue-hence-systemd-r.patch
Patch9002: skip-the-broken-sd-in-initqueue.patch
Patch9003: use-sleep-replace-check-sys-block.patch
Patch9004: add-option-to-include-file-metadata-in-initramfs.patch
Patch0: systemd-skip-dependency-add-for-non-existent-units.patch
Patch1: dracut-network-fixed-net-rules-issue-hence-systemd-r.patch
Patch2: skip-the-broken-sd-in-initqueue.patch
Patch3: use-sleep-replace-check-sys-block.patch
Patch4: 0001-Fix-pre-trigger-stage-by-replacing-exit-with-return.patch
Patch5: 0002-95fcoe-default-rd.nofcoe-to-false.patch
Patch6: dracut-95zfcp_rules-parse-zfcp.sh-remove-rule-existence-che.patch
Patch7: dracut-dracut.sh-don-t-call-fsfreeze-on-subvol-of-root-file.patch
Patch8: dracut-network-fix-glob-matching-ipv6-addresses.patch
Patch9: dracut-dasd-only-install-etc-dasd.conf-if-present.patch
Patch10: dracut-lib.sh-quote-variables-in-parameter-expansion.patch
Patch11: dracut-90crypt-module-setup.sh-fix-force-on-multiple-lines.patch
Patch12: Fix-test-in-lsinitrd.patch
Patch13: add-option-to-include-file-metadata-in-initramfs.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example
@ -289,7 +292,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%files
%if %{with doc}
%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
%doc README.md HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
%endif
%{!?_licensedir:%global license %%doc}
%license COPYING lgpl-2.1.txt
@ -345,11 +348,13 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%if 0%{?openEuler} || 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
%{dracutlibdir}/modules.d/01fips
%endif
%{dracutlibdir}/modules.d/00mksh
%{dracutlibdir}/modules.d/01systemd-initrd
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
@ -367,6 +372,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90stratis
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/90ppcmac
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95debug
@ -482,15 +488,16 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%endif
%changelog
* Thu Jul 23 2020 Liquor <lirui130@huawei.com> - 050-1
- Update to 050
* Thu Jul 2 2020 Anakin Zhang <benjamin93@163.com> - 049-9
- add -e option to include file metadata in initramfs
* Sat Mar 21 2020 openEuler Buildteam <buildteam@openeuler.or
g> - 049-8
* Sat Mar 21 2020 openEuler Buildteam <buildteam@openeuler.org> - 049-8
- Add buildrequires of gdb
* Fri Mar 20 2020 openEuler Buildteam <buildteam@openeuler.or
g> - 049-7
* Fri Mar 20 2020 openEuler Buildteam <buildteam@openeuler.org> - 049-7
- Add judgement of openEuler
* Mon Feb 24 2020 openEuler Buildteam <buildteam@openeuler.org> - 049-6

View File

@ -0,0 +1,25 @@
From 3a4a212649bd89f5a07ccf87a53b3103094748a3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 20 Apr 2020 15:07:02 +0200
Subject: [PATCH] systemd: skip dependency add for non-existent units
Fixes: https://github.com/dracutdevs/dracut/issues/795
---
modules.d/00systemd/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index 5ebdfc3..17be74f 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -241,6 +241,7 @@ install() {
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service \
; do
+ [[ -f $systemdsystemunitdir/$i ]] || continue
systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
done
--
1.8.3.1