Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/dracut.git#ce2d834370429a2c8d4812476394e9ea1f86b705
This commit is contained in:
DistroBaker 2020-12-16 21:13:50 +00:00
parent 77c9114cb0
commit 436ebf4fe0
169 changed files with 9 additions and 11813 deletions

1
.gitignore vendored
View File

@ -35,3 +35,4 @@
/dracut-048.tar.xz
/dracut-049.tar.xz
/dracut-050.tar.xz
/dracut-051.tar.xz

View File

@ -1,27 +0,0 @@
From 3ba12b22491de49853685bec5bb345e624c119ab Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 4 Mar 2020 14:39:22 +0100
Subject: [PATCH] test/TEST-35-ISCSI-MULTI: bump disk space
---
test/TEST-35-ISCSI-MULTI/test.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh
index e96c9c56..740ab918 100755
--- a/test/TEST-35-ISCSI-MULTI/test.sh
+++ b/test/TEST-35-ISCSI-MULTI/test.sh
@@ -144,9 +144,9 @@ test_setup() {
fi
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=45
- dd if=/dev/null of=$TESTDIR/iscsidisk2.img bs=1M seek=45
- dd if=/dev/null of=$TESTDIR/iscsidisk3.img bs=1M seek=45
+ dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=90
+ dd if=/dev/null of=$TESTDIR/iscsidisk2.img bs=1M seek=90
+ dd if=/dev/null of=$TESTDIR/iscsidisk3.img bs=1M seek=90
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay

View File

@ -1,33 +0,0 @@
From 9e68789d66a6a383e5c46f687350897705c7994f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 4 Mar 2020 14:39:39 +0100
Subject: [PATCH] dracut.spec: add version check for deprecated files
---
dracut.spec | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dracut.spec b/dracut.spec
index e336a25c..03b41471 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -278,8 +278,7 @@ rm -f -- $RPM_BUILD_ROOT%{_mandir}/man1/lsinitrd.1*
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
-%if 0%{?fedora} || 0%{?rhel}
-# FIXME: remove after F30
+%if 0%{?fedora} <= 30 || 0%{?rhel} <= 8
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
@@ -475,7 +474,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%files config-rescue
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
-%if 0%{?fedora} || 0%{?rhel}
+%if 0%{?fedora} <= 30 || 0%{?rhel} <= 8
# FIXME: remove after F30
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif

View File

@ -1,76 +0,0 @@
From eb8a7a96351b6e1cfd9dc34f1e854333a8f4a4e0 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: Fri, 6 Mar 2020 08:46:36 +0700
Subject: [PATCH] Makefile: merge main-version and git-version earlier
With GNU Make 4.3 on both ArchLinux, and VoidLinux,
GITVERION is always empty because of bad substitution.
Change '\#' to simply '#' can fix it,
but we don't need that complation.
We can merge DRACUT_MAIN_VERSION and GITVERSION into DRACUT_FULL_VERSION.
Because, GITVERSION will be attached back to DRACUT_MAIN_VERSION in all
situation.
While we're at it, detect if we're in git worktree by:
limiting GIT_CEILING_DIRECTORIES to parent directory of
dracut's top level directory; instead of checking for .git directory,
in order to support git-worktree, in such case, .git will be a file, see
gitrepository-layout(5)
---
Makefile | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 22b584f1..c69e2dfc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
-include dracut-version.sh
-DRACUT_MAIN_VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || :)
+DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
-GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
+DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
+DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
-include Makefile.inc
@@ -92,14 +93,14 @@ endif
%.xml: %.asc
@rm -f -- "$@"
- asciidoc -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" -d manpage -b docbook -o "$@" $<
+ asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
dracut.8: dracut.usage.asc dracut.8.asc
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
- -a "version=$(DRACUT_MAIN_VERSION)$(GITVERSION)" \
+ -a "version=$(DRACUT_FULL_VERSION)" \
-a numbered \
-d book -b docbook -o dracut.xml dracut.asc
@rm -f -- dracut.html
@@ -112,7 +113,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
dracut.pc: Makefile.inc Makefile
@echo "Name: dracut" > dracut.pc
@echo "Description: dracut" >> dracut.pc
- @echo "Version: $(DRACUT_MAIN_VERSION)$(GITVERSION)" >> dracut.pc
+ @echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
@@ -182,7 +183,7 @@ endif
dracut-version.sh:
@rm -f dracut-version.sh
- @echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)$(GITVERSION)" > dracut-version.sh
+ @echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
clean:
$(RM) *~

View File

@ -1,54 +0,0 @@
From 7ef5ead6f4cf4834b84ea6d9546b77ddc0da394b Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Thu, 30 Jan 2020 13:48:11 +0100
Subject: [PATCH] Add module "90nvdimm" for NVDIMM support
Detection of persistent memory devices works mostly out of the box
already. Only the "provider" modules for ndbus devices, which are responsible
to extract information of available NVDIMM devices and their configuration
from system firmware, are only indirectly linked into the module stack.
Examples for such modules are nfit.ko, nd_e820.ko, and virtio-pmem.ko.
Add a module that resolves these dependencies.
---
modules.d/90nvdimm/module-setup.sh | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/modules.d/90nvdimm/module-setup.sh b/modules.d/90nvdimm/module-setup.sh
new file mode 100755
index 00000000..6d58efd7
--- /dev/null
+++ b/modules.d/90nvdimm/module-setup.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ if [[ ! $hostonly ]]; then
+ return 0
+ fi
+ [[ $DRACUT_KERNEL_MODALIASES && -f "$DRACUT_KERNEL_MODALIASES" ]] && \
+ grep -q libnvdimm "$DRACUT_KERNEL_MODALIASES" && return 0
+ return 255
+}
+
+# called by dracut
+depends() {
+ return 0
+}
+
+# called by dracut
+installkernel() {
+ # Directories to search for NVDIMM "providers" (firmware drivers)
+ # These modules call "nvdimm_bus_register()".
+ local _provider_dirs='=drivers/nvdimm =drivers/acpi =arch/powerpc'
+
+ #instmods() will take care of hostonly
+ dracut_instmods -o -s nvdimm_bus_register $_provider_dirs
+}
+
+# called by dracut
+install() {
+ inst_multiple -o ndctl
+}

View File

@ -1,25 +0,0 @@
From 18420d9ce5bb738473d127affb96a5c6a44ba2ac Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Thu, 30 Jan 2020 15:44:28 +0100
Subject: [PATCH] 90kernel-modules: remove nfit from static module list
The 90nvdimm module now resolves the nfit dependency when it's
necessary, so it's not necessary any more to pack it always.
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 2ca4b719..bc3810cc 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -28,7 +28,7 @@ installkernel() {
hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix
instmods \
scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
- =ide nvme vmd nfit \
+ =ide nvme vmd \
virtio_blk
dracut_instmods -o -s "${_blockfuncs}" "=drivers"

View File

@ -1,22 +0,0 @@
From 5a720ebf6711a119649645de673bcb247e09a1ba Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Fri, 6 Mar 2020 10:26:43 +0100
Subject: [PATCH] dracut.spec: add 90nvdimm
---
dracut.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.spec b/dracut.spec
index 03b41471..0369dde6 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -364,6 +364,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
+%{dracutlibdir}/modules.d/90nvdimm
%{dracutlibdir}/modules.d/90stratis
%{dracutlibdir}/modules.d/90ppcmac
%{dracutlibdir}/modules.d/90qemu

View File

@ -1,70 +0,0 @@
From db9b5851f3bca0844890d529c7560c89ef81b92a Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@suse.com>
Date: Wed, 30 Oct 2019 09:30:32 +0100
Subject: [PATCH] 99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
It already lives in nfs-lib.sh, which is the more correct library scope.
Fixes #17
---
modules.d/95nfs/parse-nfsroot.sh | 1 +
modules.d/99base/dracut-lib.sh | 33 ---------------------------------
2 files changed, 1 insertion(+), 33 deletions(-)
diff --git a/modules.d/95nfs/parse-nfsroot.sh b/modules.d/95nfs/parse-nfsroot.sh
index f715767b..44a69d48 100755
--- a/modules.d/95nfs/parse-nfsroot.sh
+++ b/modules.d/95nfs/parse-nfsroot.sh
@@ -24,6 +24,7 @@
#
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+ . /lib/nfs-lib.sh
# This script is sourced, so root should be set. But let's be paranoid
[ -z "$root" ] && root=$(getarg root=)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 207a2b5c..c53cd13b 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -579,39 +579,6 @@ else
}
fi
-# root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
-# root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
-nfsroot_to_var() {
- # strip nfs[4]:
- local arg="$@:"
- nfs="${arg%%:*}"
- arg="${arg##$nfs:}"
-
- # check if we have a server
- if strstr "$arg" ':/' ; then
- server="${arg%%:/*}"
- arg="/${arg##*:/}"
- fi
-
- path="${arg%%:*}"
-
- # rest are options
- options="${arg##$path}"
- # strip leading ":"
- options="${options##:}"
- # strip ":"
- options="${options%%:}"
-
- # Does it really start with '/'?
- [ -n "${path%%/*}" ] && path="error";
-
- #Fix kernel legacy style separating path and options with ','
- if [ "$path" != "${path#*,}" ] ; then
- options=${path#*,}
- path=${path%%,*}
- fi
-}
-
# Create udev rule match for a device with its device name, or the udev property
# ID_FS_UUID or ID_FS_LABEL
#

View File

@ -1,26 +0,0 @@
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 7defb04f..2b62012b 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"

View File

@ -1,73 +0,0 @@
From 0386e4627779cb51f4292b3c642d90586d5e71b4 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
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 af346f3a..c14f6c0b 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

View File

@ -1,38 +0,0 @@
From bc1e69b691e6d25722b64e1df58a35e3be977801 Mon Sep 17 00:00:00 2001
From: Topi Miettinen <toiwoton@gmail.com>
Date: Sun, 1 Mar 2020 10:45:16 +0200
Subject: [PATCH] Use TMPDIR if available
Use environment variable TMPDIR (typically /run/user/$UID) as default
temporary directory, if available. This should be more private
location than /var/tmp. Path specified with --tmpdir is takes
precedence over TMPDIR and /var/tmp is still used as last resort if
neither TMPDIR is set nor --tmpdir is used.
Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
---
dracut.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index c14f6c0b..ab82cbc9 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -140,7 +140,7 @@ Creates initial ramdisk images for preloading modules
--confdir [DIR] Specify configuration directory to use *.conf files
from. Default: /etc/dracut.conf.d
--tmpdir [DIR] Temporary directory to be used instead of default
- /var/tmp.
+ ${TMPDIR:-/var/tmp}.
-r, --sysroot [DIR] Specify sysroot directory to collect files from.
-l, --local Local mode. Use modules from the current working
directory instead of the system-wide installed in
@@ -765,6 +765,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel"
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
+[[ $tmpdir ]] && tmpdir="$TMPDIR"
[[ $tmpdir ]] || tmpdir=$dracutsysrootdir/var/tmp
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
[[ $compress_l ]] && compress=$compress_l

View File

@ -1,17 +0,0 @@
From 2293609dcba01f5bf256b4245896927d4719a273 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Tue, 24 Jul 2018 19:38:30 +0200
Subject: [PATCH] 95dcssblk: fix script permissions
---
modules.d/95dcssblk/module-setup.sh | 0
modules.d/95dcssblk/parse-dcssblk.sh | 0
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/modules.d/95dcssblk/module-setup.sh b/modules.d/95dcssblk/module-setup.sh
old mode 100644
new mode 100755
diff --git a/modules.d/95dcssblk/parse-dcssblk.sh b/modules.d/95dcssblk/parse-dcssblk.sh
old mode 100644
new mode 100755

View File

@ -1,32 +0,0 @@
From a76aa8e39016a8564adb0f18f93bbf2e15d3243f Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Sun, 8 Mar 2020 05:47:50 +0300
Subject: [PATCH] Makefile: fix VERSION again
The variable is not undefined anymore after the first assignment, so
we should check if variable is empty instead.
---
Makefile | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index c69e2dfc..02e2c4b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,13 @@
-include dracut-version.sh
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
-DRACUT_MAIN_VERSION ?= $(DRACUT_VERSION)
+ifeq ($(DRACUT_MAIN_VERSION),)
+DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
+endif
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
-DRACUT_FULL_VERSION ?= $(DRACUT_VERSION)
+ifeq ($(DRACUT_FULL_VERSION),)
+DRACUT_FULL_VERSION = $(DRACUT_VERSION)
+endif
-include Makefile.inc

View File

@ -1,26 +0,0 @@
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] 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 c32feeed..444c943e 100755
--- a/modules.d/95fcoe/lldpad.sh
+++ b/modules.d/95fcoe/lldpad.sh
@@ -2,7 +2,7 @@
if ! getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping lldpad activation"
- exit 0
+ return 0
fi
# Note lldpad will stay running after switchroot, the system initscripts

View File

@ -1,39 +0,0 @@
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 444c943e..7faa2e19 100755
--- a/modules.d/95fcoe/lldpad.sh
+++ b/modules.d/95fcoe/lldpad.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-if ! getargbool 0 rd.nofcoe ; then
+if getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping lldpad activation"
return 0
fi
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
index 8bb55c6e..86f4331e 100755
--- a/modules.d/95fcoe/parse-fcoe.sh
+++ b/modules.d/95fcoe/parse-fcoe.sh
@@ -13,7 +13,7 @@
# fcoe=eth0:nodcb:vn2vn
# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
-if ! getargbool 0 rd.nofcoe ; then
+if getargbool 0 rd.nofcoe ; then
info "rd.nofcoe=0: skipping fcoe"
return 0
fi

View File

@ -1,25 +0,0 @@
From 058739bf6941f4e96cc734fe4582abbb55baac38 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 11 Mar 2020 12:38:01 +0100
Subject: [PATCH] README.md: fix github action badge links
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c0ee79e2..9948bf97 100644
--- a/README.md
+++ b/README.md
@@ -4,8 +4,8 @@ dracut
dracut is an event driven initramfs infrastructure.
[![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut)
-![Fedora-30](https://github.com/dracutdevs/dracut/workflows/Fedora-30/badge.svg?branch=master)
-![Fedora-31](https://github.com/dracutdevs/dracut/workflows/Fedora-31/badge.svg?branch=master)
+[![Fedora-30](https://github.com/dracutdevs/dracut/workflows/Fedora-30/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-30)
+[![Fedora-31](https://github.com/dracutdevs/dracut/workflows/Fedora-31/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-31)
dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the

View File

@ -1,28 +0,0 @@
From 0402b3777b1c64bd716f588ff7457b905e98489d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 11 Mar 2020 12:56:52 +0100
Subject: [PATCH] btrfs: force preload btrfs module
fixes https://github.com/dracutdevs/dracut/issues/658
raid6_pq and xor takes time doing benchmarking
[ 3.983009] request_module fs-btrfs succeeded, but still no fs?
---
modules.d/90btrfs/module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index b0d0058b..66a254e1 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -48,5 +48,7 @@ install() {
inst_multiple -o btrfsck btrfs-zero-log
inst $(command -v btrfs) /sbin/btrfs
+ # Hack for slow machines
+ # see https://github.com/dracutdevs/dracut/issues/658
+ echo "rd.driver.pre=btrfs" > ${initdir}/etc/cmdline.d/00-btrfs.conf
}
-

View File

@ -1,39 +0,0 @@
From fc6f458c3becd55277d1ab87d1608f0fe1fccf08 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 11 Mar 2020 13:14:26 +0100
Subject: [PATCH] TEST-12-RAID-DEG/create-root.sh: more udevadm settle
---
test/TEST-12-RAID-DEG/create-root.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh
index c210b582..f40d2500 100755
--- a/test/TEST-12-RAID-DEG/create-root.sh
+++ b/test/TEST-12-RAID-DEG/create-root.sh
@@ -20,7 +20,7 @@ echo "The passphrase is test"
set -e
cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile
lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test
-lvm vgcreate dracut /dev/mapper/dracut_crypt_test
+lvm vgcreate dracut /dev/mapper/dracut_crypt_test
lvm lvcreate -l 100%FREE -n root dracut
lvm vgchange -ay
mke2fs -L root /dev/dracut/root
@@ -29,12 +29,14 @@ mount /dev/dracut/root /sysroot
cp -a -t /sysroot /source/*
mkdir /sysroot/run
umount /sysroot
-lvm lvchange -a n /dev/dracut/root
+lvm lvchange -a n /dev/dracut/root
udevadm settle
cryptsetup luksClose /dev/mapper/dracut_crypt_test
udevadm settle
mdadm -W /dev/md0 || :
+udevadm settle
mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid
. /tmp/mduuid
+udevadm settle
eval $(udevadm info --query=env --name=/dev/md0|while read line || [ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;)
{ echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID; echo "ID_FS_UUID=$ID_FS_UUID";} | dd oflag=direct,dsync of=/dev/sda

View File

@ -1,46 +0,0 @@
From 3dcaa97ca4dcfa8092252a22df62c60941e59ce3 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 11 Mar 2020 09:40:50 +0100
Subject: [PATCH] network-manager: ensure that nm-run.sh is executed when
needed
The network-manager command line hook must install a
initqueue/finished hook to ensure that nm-run.sh is executed when
there are network connections to activate.
Fixes: #694
---
modules.d/35network-manager/nm-config.sh | 11 +++++++++++
modules.d/35network-manager/nm-run.sh | 2 ++
2 files changed, 13 insertions(+)
diff --git a/modules.d/35network-manager/nm-config.sh b/modules.d/35network-manager/nm-config.sh
index 1efa737c..39a1c8bd 100755
--- a/modules.d/35network-manager/nm-config.sh
+++ b/modules.d/35network-manager/nm-config.sh
@@ -5,3 +5,14 @@ if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
fi
/usr/libexec/nm-initrd-generator -- $(getcmdline)
+
+if getargbool 0 rd.neednet; then
+ for i in /usr/lib/NetworkManager/system-connections/* \
+ /run/NetworkManager/system-connections/* \
+ /etc/NetworkManager/system-connections/* \
+ /etc/sysconfig/network-scripts/ifcfg-*; do
+ [ -f "$i" ] || continue
+ echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
+ break
+ done
+fi
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index 4079b735..fc5280a1 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -22,3 +22,5 @@ do
source_hook initqueue/online $ifname
/sbin/netroot $ifname
done
+
+> /tmp/nm.done

View File

@ -1,344 +0,0 @@
From a22ab24d5371cbd73b18b27e98e980e45e39ff5f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Mar 2020 11:55:37 +0100
Subject: [PATCH] test: use dd from /dev/zero, instead of creating files with a
hole
---
test/TEST-01-BASIC/test.sh | 2 +-
test/TEST-02-SYSTEMD/test.sh | 2 +-
test/TEST-03-USR-MOUNT/test.sh | 4 ++--
test/TEST-04-FULL-SYSTEMD/test.sh | 4 ++--
test/TEST-10-RAID/test.sh | 2 +-
test/TEST-11-LVM/test.sh | 2 +-
test/TEST-12-RAID-DEG/test.sh | 10 +++++-----
test/TEST-13-ENC-RAID-LVM/test.sh | 2 +-
test/TEST-14-IMSM/test.sh | 8 ++++----
test/TEST-15-BTRFSRAID/test.sh | 2 +-
test/TEST-17-LVM-THIN/test.sh | 2 +-
test/TEST-20-NFS/test.sh | 2 +-
test/TEST-30-ISCSI/test.sh | 10 +++++-----
test/TEST-35-ISCSI-MULTI/test.sh | 10 +++++-----
test/TEST-40-NBD/test.sh | 8 ++++----
test/TEST-50-MULTINIC/test.sh | 2 +-
test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh | 2 +-
17 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index c47098ea..668a35d8 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -20,7 +20,7 @@ test_run() {
test_setup() {
rm -f -- $TESTDIR/root.ext3
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=80
+ dd if=/dev/zero of=$TESTDIR/root.ext3 bs=1M count=80
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh
index cf1fcaa5..5c0a54de 100755
--- a/test/TEST-02-SYSTEMD/test.sh
+++ b/test/TEST-02-SYSTEMD/test.sh
@@ -16,7 +16,7 @@ test_run() {
test_setup() {
rm -f -- $TESTDIR/root.ext3
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=80
+ dd if=/dev/zero of=$TESTDIR/root.ext3 bs=1M count=80
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
index 5de7f4a1..5190f220 100755
--- a/test/TEST-03-USR-MOUNT/test.sh
+++ b/test/TEST-03-USR-MOUNT/test.sh
@@ -41,8 +41,8 @@ test_setup() {
rm -f -- $TESTDIR/root.btrfs
rm -f -- $TESTDIR/usr.btrfs
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.btrfs bs=1M seek=160
- dd if=/dev/null of=$TESTDIR/usr.btrfs bs=1M seek=160
+ dd if=/dev/zero of=$TESTDIR/root.btrfs bs=1M count=160
+ dd if=/dev/zero of=$TESTDIR/usr.btrfs bs=1M count=160
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
index 3a544d7c..e3b23327 100755
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
@@ -42,8 +42,8 @@ test_setup() {
rm -f -- $TESTDIR/root.btrfs
rm -f -- $TESTDIR/usr.btrfs
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.btrfs bs=1M seek=320
- dd if=/dev/null of=$TESTDIR/usr.btrfs bs=1M seek=320
+ dd if=/dev/zero of=$TESTDIR/root.btrfs bs=1M count=320
+ dd if=/dev/zero of=$TESTDIR/usr.btrfs bs=1M count=320
export kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index 981c1b9d..4203cfdc 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -19,7 +19,7 @@ test_setup() {
DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
# Create the blank file to use as a root filesystem
rm -f -- $DISKIMAGE
- dd if=/dev/null of=$DISKIMAGE bs=1M seek=128
+ dd if=/dev/zero of=$DISKIMAGE bs=1M count=128
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh
index c718ad57..22643758 100755
--- a/test/TEST-11-LVM/test.sh
+++ b/test/TEST-11-LVM/test.sh
@@ -16,7 +16,7 @@ test_run() {
test_setup() {
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=80
+ dd if=/dev/zero of=$TESTDIR/root.ext2 bs=1M count=80
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
index f8dc08d9..09eb28bb 100755
--- a/test/TEST-12-RAID-DEG/test.sh
+++ b/test/TEST-12-RAID-DEG/test.sh
@@ -25,7 +25,7 @@ client_run() {
return 1;
fi
rm -f -- $TESTDIR/marker.img
- dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=40
+ dd if=/dev/zero of=$TESTDIR/marker.img bs=1M count=40
echo "CLIENT TEST END: $@ [OK]"
return 0
@@ -56,10 +56,10 @@ test_run() {
test_setup() {
# Create the blank file to use as a root filesystem
rm -f -- $TESTDIR/marker.img
- dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=40
- dd if=/dev/null of=$TESTDIR/disk1.img bs=1M seek=35
- dd if=/dev/null of=$TESTDIR/disk2.img bs=1M seek=35
- dd if=/dev/null of=$TESTDIR/disk3.img bs=1M seek=35
+ dd if=/dev/zero of=$TESTDIR/marker.img bs=1M count=40
+ dd if=/dev/zero of=$TESTDIR/disk1.img bs=1M count=35
+ dd if=/dev/zero of=$TESTDIR/disk2.img bs=1M count=35
+ dd if=/dev/zero of=$TESTDIR/disk3.img bs=1M count=35
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh
index 580ade85..16ee8e66 100755
--- a/test/TEST-13-ENC-RAID-LVM/test.sh
+++ b/test/TEST-13-ENC-RAID-LVM/test.sh
@@ -50,7 +50,7 @@ test_run() {
test_setup() {
# Create the blank file to use as a root filesystem
rm -f -- $TESTDIR/root.ext2
- dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=134
+ dd if=/dev/zero of=$TESTDIR/root.ext2 bs=1M count=134
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh
index 2f153ba3..1f822e4e 100755
--- a/test/TEST-14-IMSM/test.sh
+++ b/test/TEST-14-IMSM/test.sh
@@ -11,7 +11,7 @@ client_run() {
echo "CLIENT TEST START: $@"
rm -f -- $TESTDIR/marker.img
- dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=1
+ dd if=/dev/zero of=$TESTDIR/marker.img bs=1M count=1
$testdir/run-qemu \
-drive format=raw,index=0,media=disk,file=$TESTDIR/marker.img \
@@ -53,9 +53,9 @@ test_setup() {
rm -f -- $TESTDIR/marker.img
rm -f -- $TESTDIR/disk1
rm -f -- $TESTDIR/disk2
- dd if=/dev/null of=$TESTDIR/marker.img bs=1M seek=1
- dd if=/dev/null of=$TESTDIR/disk1 bs=1M seek=104
- dd if=/dev/null of=$TESTDIR/disk2 bs=1M seek=104
+ dd if=/dev/zero of=$TESTDIR/marker.img bs=1M count=1
+ dd if=/dev/zero of=$TESTDIR/disk1 bs=1M count=104
+ dd if=/dev/zero of=$TESTDIR/disk2 bs=1M count=104
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
index 435e52be..227daaba 100755
--- a/test/TEST-15-BTRFSRAID/test.sh
+++ b/test/TEST-15-BTRFSRAID/test.sh
@@ -21,7 +21,7 @@ test_setup() {
# Create the blank file to use as a root filesystem
DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-root.img
rm -f -- $DISKIMAGE
- dd if=/dev/null of=$DISKIMAGE bs=1M seek=1024
+ dd if=/dev/zero of=$DISKIMAGE bs=1M count=1024
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh
index e4755f78..8ab30a45 100755
--- a/test/TEST-17-LVM-THIN/test.sh
+++ b/test/TEST-17-LVM-THIN/test.sh
@@ -16,7 +16,7 @@ test_run() {
test_setup() {
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=92
+ dd if=/dev/zero of=$TESTDIR/root.ext2 bs=1M count=92
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index 9d5493c7..53d1d804 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -225,7 +225,7 @@ test_run() {
test_setup() {
# Make server root
- dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=120
+ dd if=/dev/zero of=$TESTDIR/server.ext3 bs=1M count=120
mke2fs -j -F $TESTDIR/server.ext3
mkdir $TESTDIR/mnt
mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index a8aee221..2f37f5c9 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -129,9 +129,9 @@ test_setup() {
fi
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=45
- dd if=/dev/null of=$TESTDIR/iscsidisk2.img bs=1M seek=45
- dd if=/dev/null of=$TESTDIR/iscsidisk3.img bs=1M seek=45
+ dd if=/dev/zero of=$TESTDIR/root.ext3 bs=1M count=45
+ dd if=/dev/zero of=$TESTDIR/iscsidisk2.img bs=1M count=45
+ dd if=/dev/zero of=$TESTDIR/iscsidisk3.img bs=1M count=45
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
@@ -182,7 +182,7 @@ test_setup() {
# Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
- if ! dd if=/dev/null of=$TESTDIR/client.img bs=1M seek=1; then
+ if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then
echo "Unable to make client sdb image" 1>&2
return 1
fi
@@ -198,7 +198,7 @@ test_setup() {
rm -- $TESTDIR/client.img
# Make server root
- dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60
+ dd if=/dev/zero of=$TESTDIR/server.ext3 bs=1M count=60
mkfs.ext3 -j -F $TESTDIR/server.ext3
mkdir $TESTDIR/mnt
mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh
index 740ab918..54700609 100755
--- a/test/TEST-35-ISCSI-MULTI/test.sh
+++ b/test/TEST-35-ISCSI-MULTI/test.sh
@@ -144,9 +144,9 @@ test_setup() {
fi
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=90
- dd if=/dev/null of=$TESTDIR/iscsidisk2.img bs=1M seek=90
- dd if=/dev/null of=$TESTDIR/iscsidisk3.img bs=1M seek=90
+ dd if=/dev/zero of=$TESTDIR/root.ext3 bs=1M count=90
+ dd if=/dev/zero of=$TESTDIR/iscsidisk2.img bs=1M count=90
+ dd if=/dev/zero of=$TESTDIR/iscsidisk3.img bs=1M count=90
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
@@ -197,7 +197,7 @@ test_setup() {
# Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
- if ! dd if=/dev/null of=$TESTDIR/client.img bs=1M seek=1; then
+ if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then
echo "Unable to make client sdb image" 1>&2
return 1
fi
@@ -213,7 +213,7 @@ test_setup() {
rm -- $TESTDIR/client.img
# Make server root
- dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60
+ dd if=/dev/zero of=$TESTDIR/server.ext3 bs=1M count=60
mkfs.ext3 -j -F $TESTDIR/server.ext3
mkdir $TESTDIR/mnt
mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index f06c36c3..b6c45f01 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -209,8 +209,8 @@ client_run() {
make_encrypted_root() {
# Create the blank file to use as a root filesystem
- dd if=/dev/null of=$TESTDIR/encrypted.ext2 bs=1M seek=80
- dd if=/dev/null of=$TESTDIR/flag.img bs=1M seek=1
+ dd if=/dev/zero of=$TESTDIR/encrypted.ext2 bs=1M count=80
+ dd if=/dev/zero of=$TESTDIR/flag.img bs=1M count=1
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
@@ -280,7 +280,7 @@ make_encrypted_root() {
}
make_client_root() {
- dd if=/dev/null of=$TESTDIR/nbd.ext2 bs=1M seek=120
+ dd if=/dev/zero of=$TESTDIR/nbd.ext2 bs=1M count=120
mke2fs -F -j $TESTDIR/nbd.ext2
mkdir $TESTDIR/mnt
if ! mount -o loop $TESTDIR/nbd.ext2 $TESTDIR/mnt; then
@@ -325,7 +325,7 @@ make_client_root() {
}
make_server_root() {
- dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=120
+ dd if=/dev/zero of=$TESTDIR/server.ext2 bs=1M count=120
mke2fs -F $TESTDIR/server.ext2
mkdir $TESTDIR/mnt
mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index b4326d5a..be87caab 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -173,7 +173,7 @@ test_client() {
test_setup() {
# Make server root
- dd if=/dev/null of="$TESTDIR"/server.ext3 bs=1M seek=120
+ dd if=/dev/zero of="$TESTDIR"/server.ext3 bs=1M count=120
mke2fs -j -F -- "$TESTDIR"/server.ext3
mkdir -- "$TESTDIR"/mnt
mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt
diff --git a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh
index 72826a5d..accfa006 100755
--- a/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh
+++ b/test/TEST-60-BONDBRIDGEVLANIFCFG/test.sh
@@ -199,7 +199,7 @@ root=nfs:192.168.50.1:/nfs/client bootdev=br0
test_setup() {
# Make server root
- dd if=/dev/null of="$TESTDIR"/server.ext3 bs=1M seek=120
+ dd if=/dev/zero of="$TESTDIR"/server.ext3 bs=1M count=120
mke2fs -j -F -- "$TESTDIR"/server.ext3
mkdir -- "$TESTDIR"/mnt
mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt

View File

@ -1,53 +0,0 @@
From d5bfaf58ab2098737bad92008916d39a0ec361db Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Mar 2020 12:50:08 +0100
Subject: [PATCH] github actions: use test container directly
---
.github/workflows/fedora-30.yml | 6 ++++--
.github/workflows/fedora-31.yml | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-30.yml
index 345ed0d4..1a3d3e8d 100644
--- a/.github/workflows/fedora-30.yml
+++ b/.github/workflows/fedora-30.yml
@@ -13,7 +13,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
- #container: quay.io/haraldh/dracut-fedora:30
+ container:
+ image: quay.io/haraldh/dracut-fedora:30
+ options: "--privileged"
timeout-minutes: 45
strategy:
matrix:
@@ -45,4 +47,4 @@ jobs:
fetch-depth: 0
- name: "TEST-${{ matrix.test }}"
- run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:30 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
+ run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
diff --git a/.github/workflows/fedora-31.yml b/.github/workflows/fedora-31.yml
index 20ad62c2..aa829df2 100644
--- a/.github/workflows/fedora-31.yml
+++ b/.github/workflows/fedora-31.yml
@@ -13,7 +13,9 @@ on:
jobs:
test:
runs-on: ubuntu-latest
- #container: quay.io/haraldh/dracut-fedora:30
+ container:
+ image: quay.io/haraldh/dracut-fedora:31
+ options: "--privileged"
timeout-minutes: 45
strategy:
matrix:
@@ -51,4 +53,4 @@ jobs:
fetch-depth: 0
- name: "TEST-${{ matrix.test }}"
- run: docker run --privileged -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:31 /dracut/fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
+ run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@ -1,23 +0,0 @@
From 3b396a7d5092cec4c7b185bda63906069b8ec320 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Mar 2020 13:22:10 +0100
Subject: [PATCH] TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not
TEST-20-NFS
---
test/TEST-41-NBD-NM/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/TEST-41-NBD-NM/Makefile b/test/TEST-41-NBD-NM/Makefile
index b19122a1..47c90c31 100644
--- a/test/TEST-41-NBD-NM/Makefile
+++ b/test/TEST-41-NBD-NM/Makefile
@@ -1,6 +1,6 @@
.PHONY: all setup clean run
-BASETEST=../TEST-20-NFS
+BASETEST=../TEST-40-NBD
all:
@$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all

View File

@ -1,30 +0,0 @@
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 16730e5b..7f185fdd 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"
;;

View File

@ -1,90 +0,0 @@
From ca8ca19091a1822ee813657764263f76ffaa4ebb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Mar 2020 13:01:46 +0100
Subject: [PATCH] .travis.yml: reformat
---
.travis.yml | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index e9f62a98..a82e1778 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,34 +2,34 @@ language: generic
dist: bionic
sudo: required
services:
-- docker
+ - docker
env:
matrix:
- - IMAGE=latest
- - IMAGE=latest TESTS=01
- - IMAGE=latest TESTS=12
- - IMAGE=latest TESTS=20
- - IMAGE=latest TESTS=21
- - IMAGE=latest TESTS=50
- - IMAGE=latest TESTS=51
- - IMAGE=latest TESTS=30
- - IMAGE=latest TESTS=31
- - IMAGE=latest TESTS=35
- - IMAGE=latest TESTS=36
- - IMAGE=latest TESTS=40
- - IMAGE=latest TESTS=41
- - IMAGE=latest TESTS=60
- - IMAGE=latest TESTS=61
- - IMAGE=latest TESTS=99
- - IMAGE=latest TESTS=02
- - IMAGE=latest TESTS=03
- - IMAGE=latest TESTS=04
- - IMAGE=latest TESTS=10
- - IMAGE=latest TESTS=11
- - IMAGE=latest TESTS=13
- - IMAGE=latest TESTS=14
- - IMAGE=latest TESTS=15
- - IMAGE=latest TESTS=17
+ - IMAGE=latest
+ - IMAGE=latest TESTS=01
+ - IMAGE=latest TESTS=12
+ - IMAGE=latest TESTS=20
+ - IMAGE=latest TESTS=21
+ - IMAGE=latest TESTS=50
+ - IMAGE=latest TESTS=51
+ - IMAGE=latest TESTS=30
+ - IMAGE=latest TESTS=31
+ - IMAGE=latest TESTS=35
+ - IMAGE=latest TESTS=36
+ - IMAGE=latest TESTS=40
+ - IMAGE=latest TESTS=41
+ - IMAGE=latest TESTS=60
+ - IMAGE=latest TESTS=61
+ - IMAGE=latest TESTS=99
+ - IMAGE=latest TESTS=02
+ - IMAGE=latest TESTS=03
+ - IMAGE=latest TESTS=04
+ - IMAGE=latest TESTS=10
+ - IMAGE=latest TESTS=11
+ - IMAGE=latest TESTS=13
+ - IMAGE=latest TESTS=14
+ - IMAGE=latest TESTS=15
+ - IMAGE=latest TESTS=17
before_script:
- docker pull quay.io/haraldh/dracut-fedora:$IMAGE
@@ -44,12 +44,12 @@ before_script:
script:
## The test container is created with https://github.com/dracutdevs/fedora-container
-- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
+ - docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
notifications:
webhooks:
urls:
- - https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
+ - https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

View File

@ -1,24 +0,0 @@
From 91418b13dc679947bb4d22ae6badcbf41b56c645 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 12 Mar 2020 13:44:08 +0100
Subject: [PATCH] TEST-03-USR-MOUNT/test.sh: increase loglevel
to debug the spurious fails
---
test/TEST-03-USR-MOUNT/test.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
index 5190f220..3bb479e4 100755
--- a/test/TEST-03-USR-MOUNT/test.sh
+++ b/test/TEST-03-USR-MOUNT/test.sh
@@ -19,7 +19,7 @@ client_run() {
-drive format=raw,index=1,media=disk,file=$TESTDIR/usr.btrfs \
-drive format=raw,index=2,media=disk,file=$TESTDIR/result \
-watchdog i6300esb -watchdog-action poweroff \
- -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
+ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts loglevel=7 rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing
if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/result; then

View File

@ -1,27 +0,0 @@
From 97a931c7d9f8190115893a932f2e10292704cae4 Mon Sep 17 00:00:00 2001
From: Dusty Mabe <dusty@dustymabe.com>
Date: Fri, 13 Mar 2020 15:40:11 -0400
Subject: [PATCH] don't prefer $TMPDIR over --tmpdir
Ability to use `$TMPDIR` was introduced in bc1e69b but
causes the `--tmpdir` option on the command line to be
ignored. Switch to only using `$TMPDIR` if `--tmpdir`
wasn't specified.
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index ab82cbc9..39fa3692 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -765,7 +765,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $dracutbasedir ]] || dracutbasedir=$dracutsysrootdir/usr/lib/dracut
[[ $fw_dir ]] || fw_dir="$dracutsysrootdir/lib/firmware/updates:$dracutsysrootdir/lib/firmware:$dracutsysrootdir/lib/firmware/$kernel"
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
-[[ $tmpdir ]] && tmpdir="$TMPDIR"
+[[ $tmpdir ]] || tmpdir="$TMPDIR"
[[ $tmpdir ]] || tmpdir=$dracutsysrootdir/var/tmp
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
[[ $compress_l ]] && compress=$compress_l

View File

@ -1,32 +0,0 @@
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

View File

@ -1,50 +0,0 @@
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

View File

@ -1,25 +0,0 @@
From c490ea8b2be52910c8ce70d08717cf1996c0d732 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Sat, 21 Apr 2018 00:11:17 +0200
Subject: [PATCH] Make externally defined CFLAGS work
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 02e2c4b5..0cc8b390 100644
--- a/Makefile
+++ b/Makefile
@@ -18,8 +18,8 @@ pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
-CFLAGS ?= -O2 -g -Wall
-CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
+CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
+CFLAGS += $(KMOD_CFLAGS)
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig

View File

@ -1,35 +0,0 @@
From db44331dc4513886e83e387604887033868c5214 Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Fri, 13 Mar 2020 11:39:46 +0100
Subject: [PATCH] Makefile: really make externally defined CFLAGS work
The fix in aed52a6cfb43ebea372328fd5837c1f341c3f0df does not
work (second line will be ignored on override), so expand the implicitly
defined rule and add them there.
---
Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 0cc8b390..7eb31847 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,6 @@ sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-CFLAGS += $(KMOD_CFLAGS)
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig
@@ -50,6 +49,9 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
+%.o : %.c
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
+
DRACUT_INSTALL_OBJECTS = \
install/dracut-install.o \
install/hashmap.o\

View File

@ -1,33 +0,0 @@
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 2c49cd26..c71c8a08 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

View File

@ -1,35 +0,0 @@
From b68930ed3dd29184f3e6c87582377e7501b3b276 Mon Sep 17 00:00:00 2001
From: Patrick Talbert <ptalbert@redhat.com>
Date: Wed, 18 Mar 2020 15:58:48 +0100
Subject: [PATCH] dhclient-script: Fix typo in output of BOUND & BOUND6 cases
No bonding going on here.
Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
---
modules.d/35network-legacy/dhclient-script.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh
index 84b65e89..fd92752b 100755
--- a/modules.d/35network-legacy/dhclient-script.sh
+++ b/modules.d/35network-legacy/dhclient-script.sh
@@ -164,7 +164,7 @@ case $reason in
;;
BOUND)
- echo "dhcp: BOND setting $netif"
+ echo "dhcp: BOUND setting up $netif"
unset layer2
if [ -f /sys/class/net/$netif/device/layer2 ]; then
read layer2 < /sys/class/net/$netif/device/layer2
@@ -223,7 +223,7 @@ case $reason in
;;
BOUND6)
- echo "dhcp: BOND6 setting $netif"
+ echo "dhcp: BOUND6 setting up $netif"
setup_interface6
set | while read line || [ -n "$line" ]; do

View File

@ -1,33 +0,0 @@
From 3a043feea1d1d1d1d01762d95b725b9adef61562 Mon Sep 17 00:00:00 2001
From: Alexander Sosedkin <asosedkin@redhat.com>
Date: Thu, 26 Mar 2020 15:11:15 +0100
Subject: [PATCH] url-lib: drop NSS if it's not in curl --version
---
modules.d/45url-lib/module-setup.sh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/modules.d/45url-lib/module-setup.sh b/modules.d/45url-lib/module-setup.sh
index a99e0c56..258a9e16 100755
--- a/modules.d/45url-lib/module-setup.sh
+++ b/modules.d/45url-lib/module-setup.sh
@@ -19,11 +19,13 @@ install() {
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
inst_multiple -o ctorrent
inst_multiple curl
- # also install libs for curl https
- inst_libdir_file "libnsspem.so*"
- inst_libdir_file "libnsssysinit.so*"
- inst_libdir_file "libsoftokn3.so*"
- inst_libdir_file "libsqlite3.so*"
+ if curl --version | grep -qi '\bNSS\b'; then
+ # also install libs for curl https
+ inst_libdir_file "libnsspem.so*"
+ inst_libdir_file "libnsssysinit.so*"
+ inst_libdir_file "libsoftokn3.so*"
+ inst_libdir_file "libsqlite3.so*"
+ fi
for _dir in $libdirs; do
[[ -d $dracutsysrootdir$_dir ]] || continue

View File

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

View File

@ -1,24 +0,0 @@
From 3b626094bd5f017dee26968ce1531a301bb6218a Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <dmolkentin@suse.com>
Date: Tue, 7 Apr 2020 12:27:30 +0200
Subject: [PATCH] mkinitrd-suse.sh: Fix i586 platform detection
Reference: boo#1168341
---
mkinitrd-suse.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh
index db2eb188..708c4e67 100755
--- a/mkinitrd-suse.sh
+++ b/mkinitrd-suse.sh
@@ -171,7 +171,7 @@ default_kernel_images() {
ppc|ppc64)
regex='vmlinux'
;;
- i386|x86_64)
+ i?86|x86_64)
regex='vmlinuz'
;;
arm*)

View File

@ -1,23 +0,0 @@
From 11474b808b6fbd373b2ca6ce3350a024e6a8ea15 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 9 Apr 2020 22:05:41 +0200
Subject: [PATCH] TEST-99: exclude /etc/dnf/* from check
file /etc/dnf/modules.d/eclipse.module.rpmmoved is not owned by any package
---
test/TEST-99-RPM/test.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/TEST-99-RPM/test.sh b/test/TEST-99-RPM/test.sh
index af64c24a..504fd77f 100755
--- a/test/TEST-99-RPM/test.sh
+++ b/test/TEST-99-RPM/test.sh
@@ -84,6 +84,7 @@ find / -xdev -type f -not -path '/var/*' \
-not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \
-not -path "/boot/\$(cat /etc/machine-id)/*" \
-not -path '/etc/openldap/certs/*' \
+ -not -path '/etc/dnf/*' \
-print0 | xargs -0 rpm -qf | \
grep -F 'not owned' &>> /test.output || :
exit 0

View File

@ -1,60 +0,0 @@
From 872eb69936bd849eec6d1974dd6569f23a7ad3db Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Thu, 5 Mar 2020 18:44:45 +0800
Subject: [PATCH] 95znet: Add a rd.znet_ifname= option
qeth device may have a different IP for each boot, so the rd.ifname=
option will no longer work. So for znet device, introduce a
rd.znet_ifname= options, to subchannel id instead of MAC address as the
identifier and rename the interface.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
dracut.cmdline.7.asc | 5 +++++
modules.d/95znet/parse-ccw.sh | 18 ++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 63074353..2b38aa33 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -863,6 +863,11 @@ ZNET
RHEL/Fedora with ccw_init, which is called from udev for certain
devices on z-series.
rd.znet can be specified multiple times on the kernel command line.
+
+**rd.znet_ifname=**__<ifname>__:__<subchannels>__::
+ Assign network device name <interface> (i.e. "bootnet") to the NIC
+ corresponds to the subchannels. This is useful when dracut's default
+ "ifname=" doesn't work due to device having a changing MAC address.
+
[listing]
.Example
diff --git a/modules.d/95znet/parse-ccw.sh b/modules.d/95znet/parse-ccw.sh
index 7d40a1aa..59b588f3 100755
--- a/modules.d/95znet/parse-ccw.sh
+++ b/modules.d/95znet/parse-ccw.sh
@@ -4,4 +4,22 @@ for ccw_arg in $(getargs rd.ccw -d 'rd_CCW=') $(getargs rd.znet -d 'rd_ZNET=');
echo $ccw_arg >> /etc/ccw.conf
done
+for ifname in $(getargs rd.znet_ifname); do
+ IFS=: read ifname_if ifname_subchannels _rest <<< "$ifname"
+ if [ -z "$ifname_if" ] || [ -z "$ifname_subchannels" ] || [ -n "$_rest" ]; then
+ warn "Invalid arguments for rd.znet_ifname="
+ else
+ {
+ ifname_subchannels=${ifname_subchannels//,/|}
+
+ echo 'ACTION!="add|change", GOTO="ccw_ifname_end"'
+ echo 'ATTR{type}!="1", GOTO="ccw_ifname_end"'
+ echo 'SUBSYSTEM!="net", GOTO="ccw_ifname_end"'
+ echo "SUBSYSTEMS==\"ccwgroup\", KERNELS==\"$ifname_subchannels\", DRIVERS==\"?*\" NAME=\"$ifname_if\""
+ echo 'LABEL="ccw_ifname_end"'
+
+ } > /etc/udev/rules.d/81-ccw-ifname.rules
+ fi
+done
+
znet_cio_free

View File

@ -1,22 +0,0 @@
From 25c7a13985473ff9714245eaa602225b1a0f9ecb Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Wed, 25 Mar 2020 12:23:11 +0100
Subject: [PATCH] 90nvdimm: include nvdimm keys in initrd
This is necessary to actually unlock NVDIMM keys during boot.
---
modules.d/90nvdimm/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90nvdimm/module-setup.sh b/modules.d/90nvdimm/module-setup.sh
index 6d58efd7..6d73d215 100755
--- a/modules.d/90nvdimm/module-setup.sh
+++ b/modules.d/90nvdimm/module-setup.sh
@@ -27,5 +27,5 @@ installkernel() {
# called by dracut
install() {
- inst_multiple -o ndctl
+ inst_multiple -o ndctl /etc/ndctl/keys/tpm.handle /etc/ndctl/keys/*.blob
}

View File

@ -1,109 +0,0 @@
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 c53cd13b..c57523d3 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

View File

@ -1,50 +0,0 @@
From de34ba76e579dd11202f632ecf8c625f841646e1 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Sun, 19 Apr 2020 16:32:41 +0300
Subject: [PATCH] i18n: Always install /etc/vconsole.conf
/etc/vconsole.conf must be installed always, even in generic initrds, not only host-only ones.
systemd-vconsole-setup is run at initrd stage and expects either /etc/vconsole.conf or kernel cmdline options to exist.
I have also proposed a change in systemd-vconsole-setup that makes it behave better if /etc/vconsole.conf does not exist:
https://github.com/systemd/systemd/pull/15479
But it is just a fallback. If /etc/vconsole.conf does not exist in initrd and if that patch is applied on systemd,
then the default consoel font is set despite the one being set in /etc/vconsole.conf and this setting is inherited
when new TTYs are opened. This leads to full ignorance of settings in /etc/vconsole.conf.
It is incorrect, and that is why this file must be copied to initrds always, but not only on host-only initrds.
Fixes: https://github.com/dracutdevs/dracut/issues/796
Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
---
modules.d/10i18n/module-setup.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index ba17e477..dd45b666 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -230,9 +230,7 @@ install() {
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
fi
- if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
- inst_simple ${VCONFIG_CONF}
- else
+ if ! dracut_module_included "systemd"; then
mksubdirs ${initdir}${VCONFIG_CONF}
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
fi
@@ -263,6 +261,11 @@ install() {
if checks; then
install_base
+ # https://github.com/dracutdevs/dracut/issues/796
+ if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
+ inst_simple ${VCONFIG_CONF}
+ fi
+
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
install_local_i18n || install_all_kbd
else

View File

@ -1,23 +0,0 @@
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 5ebdfc30..17be74fd 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

View File

@ -1,29 +0,0 @@
From 87bffc36e72c121024df033e1a78799456c73523 Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Mon, 23 Mar 2020 22:57:35 +0100
Subject: [PATCH] network-manager: install libnss DNS and mDNS plugins
Install libnss_dns.so and libnss_mdns4_minimal.so plugins for the Name
Service Switch (NSS) functionality of glibc so that name resolution
through /etc/resolv.conf and mDNS works in the initrd.
Fixes: #772
---
modules.d/35network-manager/module-setup.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index d6d0f9ce..8fc3114d 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -51,4 +51,9 @@ install() {
if ! [[ -d "$initdir/etc/sysconfig/network-scripts" ]]; then
inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
fi
+
+ _arch=${DRACUT_ARCH:-$(uname -m)}
+
+ inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
+ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
}

View File

@ -1,422 +0,0 @@
From 49c4172f4eef6e2015615e132b199a7ec0699ffc Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 8 Apr 2020 16:39:52 +0800
Subject: [PATCH] Remove memtrace-ko and rd.memdebug=4 support in dracut
This feature could be off loaded to memstrack, which have better
accurecy, better performance, and have more detailed tracing features.
Also simplify make_trace_mem a bit.
And currently rd.memdebug=4 is unstable, fails from time to time.
---
dracut.cmdline.7.asc | 4 +-
modules.d/98dracut-systemd/dracut-cmdline.sh | 2 +-
modules.d/98dracut-systemd/dracut-pre-mount.sh | 2 +-
modules.d/98dracut-systemd/dracut-pre-pivot.sh | 2 +-
modules.d/98dracut-systemd/dracut-pre-trigger.sh | 2 +-
modules.d/99base/dracut-lib.sh | 44 +-----
modules.d/99base/init.sh | 8 +-
modules.d/99base/memtrace-ko.sh | 191 -----------------------
modules.d/99base/module-setup.sh | 1 -
9 files changed, 18 insertions(+), 238 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 2b38aa33..c53601ea 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -188,9 +188,9 @@ It should be attached to any report about dracut problems.
_/run/initramfs/init.log_.
If "quiet" is set, it also logs to the console.
-**rd.memdebug=[0-4]**::
+**rd.memdebug=[0-3]**::
Print memory usage info at various points, set the verbose level from 0 to 4.
-+
++
Higher level means more debugging output:
+
----
diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh
index bff9435a..6c6ee026 100755
--- a/modules.d/98dracut-systemd/dracut-cmdline.sh
+++ b/modules.d/98dracut-systemd/dracut-cmdline.sh
@@ -42,7 +42,7 @@ export root
export rflags
export fstype
-make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab' '4+:komem'
+make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab'
# run scriptlets to parse the command line
getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
source_hook cmdline
diff --git a/modules.d/98dracut-systemd/dracut-pre-mount.sh b/modules.d/98dracut-systemd/dracut-pre-mount.sh
index a3b9d291..ae511286 100755
--- a/modules.d/98dracut-systemd/dracut-pre-mount.sh
+++ b/modules.d/98dracut-systemd/dracut-pre-mount.sh
@@ -8,7 +8,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab'
# pre pivot scripts are sourced just before we doing cleanup and switch over
# to the new root.
getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.sh b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
index dc9a2504..96e6f8ca 100755
--- a/modules.d/98dracut-systemd/dracut-pre-pivot.sh
+++ b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
@@ -8,7 +8,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab'
# pre pivot scripts are sourced just before we doing cleanup and switch over
# to the new root.
getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
diff --git a/modules.d/98dracut-systemd/dracut-pre-trigger.sh b/modules.d/98dracut-systemd/dracut-pre-trigger.sh
index 7cd821ed..a1a33960 100755
--- a/modules.d/98dracut-systemd/dracut-pre-trigger.sh
+++ b/modules.d/98dracut-systemd/dracut-pre-trigger.sh
@@ -8,7 +8,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab'
source_hook pre-trigger
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index c57523d3..b7020892 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1187,50 +1187,25 @@ are_lists_eq() {
setmemdebug() {
if [ -z "$DEBUG_MEM_LEVEL" ]; then
- export DEBUG_MEM_LEVEL=$(getargnum 0 0 4 rd.memdebug)
+ export DEBUG_MEM_LEVEL=$(getargnum 0 0 3 rd.memdebug)
fi
}
setmemdebug
-cleanup_trace_mem()
-{
- # tracekomem based on kernel trace needs cleanup after use.
- if [ "$DEBUG_MEM_LEVEL" -eq 4 ]; then
- tracekomem --cleanup
- fi
-}
-
-# parameters: msg [trace_level:trace]...
-make_trace_mem()
-{
- local msg
- msg="$1"
- shift
- if [ -n "$DEBUG_MEM_LEVEL" ] && [ "$DEBUG_MEM_LEVEL" -gt 0 ]; then
- make_trace show_memstats $DEBUG_MEM_LEVEL "[debug_mem]" "$msg" "$@" >&2
- fi
-}
-
# parameters: func log_level prefix msg [trace_level:trace]...
-make_trace()
+make_trace_mem()
{
- local func log_level prefix msg msg_printed
+ local log_level prefix msg msg_printed
local trace trace_level trace_in_higher_levels insert_trace
- func=$1
- shift
-
- log_level=$1
- shift
-
- prefix=$1
- shift
-
msg=$1
shift
- if [ -z "$log_level" ]; then
+ prefix='[debug_mem]'
+ log_level=$DEBUG_MEM_LEVEL
+
+ if [ -z "$log_level" ] || [ "$log_level" -le 0 ]; then
return
fi
@@ -1263,7 +1238,7 @@ make_trace()
echo "$prefix $msg"
msg_printed=1
fi
- $func $trace
+ show_memstats $trace
fi
shift
done
@@ -1285,9 +1260,6 @@ show_memstats()
iomem)
cat /proc/iomem
;;
- komem)
- tracekomem
- ;;
esac
}
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 1111d09b..148ce831 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -131,7 +131,7 @@ if ! getargbool 1 'rd.hostonly'; then
fi
# run scriptlets to parse the command line
-make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab' '4+:komem'
+make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab'
getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
source_hook cmdline
@@ -160,7 +160,7 @@ fi
udevproperty "hookdir=$hookdir"
-make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab'
getarg 'rd.break=pre-trigger' -d 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger"
source_hook pre-trigger
@@ -230,7 +230,7 @@ unset RDRETRY
# pre-mount happens before we try to mount the root filesystem,
# and happens once.
-make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab'
getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
source_hook pre-mount
@@ -266,7 +266,7 @@ done
# pre pivot scripts are sourced just before we doing cleanup and switch over
# to the new root.
-make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab' '4+:komem'
+make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab'
getarg 'rd.break=pre-pivot' -d 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
source_hook pre-pivot
diff --git a/modules.d/99base/memtrace-ko.sh b/modules.d/99base/memtrace-ko.sh
deleted file mode 100755
index ee035e15..00000000
--- a/modules.d/99base/memtrace-ko.sh
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/bin/sh
-
-# Try to find out kernel modules with large total memory allocation during loading.
-# For large slab allocation, it will fall into buddy, also not trace "mm_page_free"
-# considering large free is quite rare for module_init, thus saving tons of events
-# to avoid trace data overwritten.
-#
-# Therefore, tracing "mm_page_alloc"alone should be enough for the purpose.
-
-# "sys/kernel/tracing" has the priority if exists.
-get_trace_base() {
- # trace access through debugfs would be obsolete if "/sys/kernel/tracing" is available.
- if [ -d "/sys/kernel/tracing" ]; then
- echo "/sys/kernel"
- else
- echo "/sys/kernel/debug"
- fi
-}
-
-# We want to enable these trace events.
-get_want_events() {
- echo "module:module_put module:module_load kmem:mm_page_alloc"
-}
-
-get_event_filter() {
- echo "comm == systemd-udevd || comm == modprobe || comm == insmod"
-}
-
-is_trace_ready() {
- local trace_base want_events current_events
-
- trace_base=$(get_trace_base)
- ! [ -f "$trace_base/tracing/trace" ] && return 1
-
- [ "$(cat $trace_base/tracing/tracing_on)" -eq 0 ] && return 1
-
- # Also check if trace events were properly setup.
- want_events=$(get_want_events)
- current_events=$(echo $(cat $trace_base/tracing/set_event))
- [ "$current_events" != "$want_events" ] && return 1
-
- return 0
-}
-
-prepare_trace() {
- local trace_base
-
- trace_base=$(get_trace_base)
- # old debugfs interface case.
- if ! [ -d "$trace_base/tracing" ]; then
- mount none -t debugfs $trace_base
- # new tracefs interface case.
- elif ! [ -f "$trace_base/tracing/trace" ]; then
- mount none -t tracefs "$trace_base/tracing"
- fi
-
- if ! [ -f "$trace_base/tracing/trace" ]; then
- echo "WARN: Mount trace failed for kernel module memory analyzing."
- return 1
- fi
-
- # Active all the wanted trace events.
- echo "$(get_want_events)" > $trace_base/tracing/set_event
-
- # There are three kinds of known applications for module loading:
- # "systemd-udevd", "modprobe" and "insmod".
- # Set them as the global events filter.
- # NOTE: Some kernel may not support this format of filter, anyway
- # the operation will fail and it doesn't matter.
- echo "$(get_event_filter)" > $trace_base/tracing/events/kmem/filter 2>&1
- echo "$(get_event_filter)" > $trace_base/tracing/events/module/filter 2>&1
-
- # Set the number of comm-pid if supported.
- if [ -f "$trace_base/tracing/saved_cmdlines_size" ]; then
- # Thanks to filters, 4096 is big enough(also well supported).
- echo 4096 > $trace_base/tracing/saved_cmdlines_size
- fi
-
- # Enable and clear trace data for the first time.
- echo 1 > $trace_base/tracing/tracing_on
- echo > $trace_base/tracing/trace
- echo "Prepare trace success."
- return 0
-}
-
-order_to_pages()
-{
- local pages=1
- local order=$1
-
- while [ "$order" != 0 ]; do
- order=$((order-1))
- pages=$(($pages*2))
- done
-
- echo $pages
-}
-
-parse_trace_data() {
- local module_name tmp_eval pages
-
- cat "$(get_trace_base)/tracing/trace" | while read pid cpu flags ts function args
- do
- # Skip comment lines
- if [ "$pid" = "#" ]; then
- continue
- fi
-
- pid=${pid##*-}
- function=${function%:}
- if [ "$function" = "module_load" ]; then
- # One module is being loaded, save the task pid for tracking.
- # Remove the trailing after whitespace, there may be the module flags.
- module_name=${args%% *}
- # Mark current_module to track the task.
- eval current_module_$pid="$module_name"
- tmp_eval=$(eval echo '${module_loaded_'${module_name}'}')
- if [ -n "$tmp_eval" ]; then
- echo "WARN: \"$module_name\" was loaded multiple times!"
- fi
- eval unset module_loaded_$module_name
- eval nr_alloc_pages_$module_name=0
- continue
- fi
-
- module_name=$(eval echo '${current_module_'${pid}'}')
- if [ -z "$module_name" ]; then
- continue
- fi
-
- # Once we get here, the task is being tracked(is loading a module).
- if [ "$function" = "module_put" ]; then
- # Mark the module as loaded when the first module_put event happens after module_load.
- tmp_eval=$(eval echo '${nr_alloc_pages_'${module_name}'}')
- echo "$tmp_eval pages consumed by \"$module_name\""
- eval module_loaded_$module_name=1
- # Module loading finished, so untrack the task.
- eval unset current_module_$pid
- eval unset nr_alloc_pages_$module_name
- continue
- fi
-
- if [ "$function" = "mm_page_alloc" ]; then
- # Get order first, then convert to actual pages.
- pages=$(echo $args | sed -e 's/.*order=\([0-9]*\) .*/\1/')
- pages=$(order_to_pages "$pages")
- tmp_eval=$(eval echo '${nr_alloc_pages_'${module_name}'}')
- eval nr_alloc_pages_$module_name="$(($tmp_eval+$pages))"
- fi
- done
-}
-
-cleanup_trace() {
- local trace_base
-
- if is_trace_ready; then
- trace_base=$(get_trace_base)
- echo 0 > $trace_base/tracing/tracing_on
- echo > $trace_base/tracing/trace
- echo > $trace_base/tracing/set_event
- echo 0 > $trace_base/tracing/events/kmem/filter
- echo 0 > $trace_base/tracing/events/module/filter
- fi
-}
-
-show_usage() {
- echo "Find out kernel modules with large memory consumption during loading based on trace."
- echo "Usage:"
- echo "1) run it first to setup trace."
- echo "2) run again to parse the trace data if any."
- echo "3) run with \"--cleanup\" option to cleanup trace after use."
-}
-
-if [ "$1" = "--help" ]; then
- show_usage
- exit 0
-fi
-
-if [ "$1" = "--cleanup" ]; then
- cleanup_trace
- exit 0
-fi
-
-if is_trace_ready ; then
- echo "tracekomem - Rough memory consumption by loading kernel modules (larger value with better accuracy)"
- parse_trace_data
-else
- prepare_trace
-fi
-
-exit $?
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 3a2246b4..c9e3ebcb 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -39,7 +39,6 @@ install() {
inst_script "$moddir/initqueue.sh" "/sbin/initqueue"
inst_script "$moddir/loginit.sh" "/sbin/loginit"
inst_script "$moddir/rdsosreport.sh" "/sbin/rdsosreport"
- inst_script "$moddir/memtrace-ko.sh" "/sbin/tracekomem"
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib
mkdir -m 0755 -p ${initdir}/lib/dracut

View File

@ -1,316 +0,0 @@
From 7dd8a2f4d351ce8975c0af122732a2a12697c8cc Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 8 Apr 2020 20:09:38 +0800
Subject: [PATCH] Add 99memstrack module
memstrack is a new tool to track the overall memory usage and
allocation, which can help off load the improve the builtin module
memory tracing function in dracut.
With this change, the rd.memdebug=4 behavior is similiar with before,
but the report is defered to pre-pivot, so the memory usage info
during the whole initramfs run is traced. And the ourput format is
changed a bit:
dracut-pre-pivot[519]: ======== Report format module_summary: ========
dracut-pre-pivot[519]: Module squashfs using 10.4MB (2658 pages), peak allocation 10.4MB (2671 pages)
dracut-pre-pivot[519]: Module qxl using 3.4MB (865 pages), peak allocation 3.4MB (880 pages)
dracut-pre-pivot[519]: Module crc32c_intel using 2.0MB (519 pages), peak allocation 3.0MB (769 pages)
dracut-pre-pivot[519]: Module serio_raw using 2.0MB (505 pages), peak allocation 3.6MB (918 pages)
dracut-pre-pivot[519]: Module virtio_console using 1.6MB (416 pages), peak allocation 1.6MB (419 pages)
... snip ...
dracut-pre-pivot[519]: ======== Report format module_summary END ========
It now contains more detail and also includes the peak usage which could
be more helpful.
And now it have a rd.memdebug=5, which will print more detail about
the stack trace of the top memory user, also printed on pri-pivot:
dracut-pre-pivot[519]: ======== Report format module_top: ========
dracut-pre-pivot[519]: Top stack usage of module squashfs:
dracut-pre-pivot[519]: (null) Pages: 2658 (peak: 2671)
dracut-pre-pivot[519]: (null) Pages: 2658 (peak: 2671)
dracut-pre-pivot[519]: async_page_fault (0xffffffff81a01149) Pages: 1448 (peak: 1461)
dracut-pre-pivot[519]: do_async_page_fault (0xffffffff8105c509) Pages: 1448 (peak: 1461)
dracut-pre-pivot[519]: do_page_fault (0xffffffff8106296a) Pages: 1448 (peak: 1461)
dracut-pre-pivot[519]: do_user_addr_fault (0xffffffff810626bd) Pages: 1448 (peak: 1461)
dracut-pre-pivot[519]: handle_mm_fault (0xffffffff812940c4) Pages: 1448 (peak: 1461)
dracut-pre-pivot[519]: __handle_mm_fault (0xffffffff81293627) Pages: 1195 (peak: 1208)
dracut-pre-pivot[519]: __do_fault (0xffffffff8128b07e) Pages: 1195 (peak: 1208)
dracut-pre-pivot[519]: filemap_fault (0xffffffff8124c0b9) Pages: 1195 (peak: 1208)
dracut-pre-pivot[519]: __do_page_cache_readahead (0xffffffff812585da) Pages: 1063 (peak: 1076)
dracut-pre-pivot[519]: read_pages (0xffffffff812583c2) Pages: 1063 (peak: 1076)
dracut-pre-pivot[519]: squashfs_readpage squashfs (0xffffffffc0022073) Pages: 1039 (peak: 1052)
dracut-pre-pivot[519]: squashfs_readpage_block squashfs (0xffffffffc0024334) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: squashfs_copy_cache squashfs (0xffffffffc0021a3f) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: pagecache_get_page (0xffffffff8124abf7) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: __page_cache_alloc (0xffffffff81247df6) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: alloc_pages_current (0xffffffff812cdca7) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: __alloc_pages_nodemask (0xffffffff812b3107) Pages: 744 (peak: 744)
dracut-pre-pivot[519]: __alloc_pages_nodemask (0xffffffff812b3107) Pages: 1488 (peak: 1488)
dracut-pre-pivot[519]: Top stack usage of module qxl:
dracut-pre-pivot[519]: (null) Pages: 865 (peak: 880)
dracut-pre-pivot[519]: entry_SYSCALL_64_after_hwframe (0xffffffff81a0008c) Pages: 855 (peak: 858)
dracut-pre-pivot[519]: do_syscall_64 (0xffffffff81002a5a) Pages: 855 (peak: 858)
dracut-pre-pivot[519]: __x64_sys_finit_module (0xffffffff8117ccea) Pages: 811 (peak: 811)
dracut-pre-pivot[519]: __do_sys_finit_module (0xffffffff8117cc6e) Pages: 811 (peak: 811)
dracut-pre-pivot[519]: load_module (0xffffffff8117c6be) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: do_init_module (0xffffffff81179e72) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: do_one_initcall (0xffffffff81000d5a) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: serio_raw_poll serio_raw (0xffffffffc0200054) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: __pci_register_driver (0xffffffff81557804) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: driver_register (0xffffffff8167ed24) Pages: 802 (peak: 802)
dracut-pre-pivot[519]: bus_add_driver (0xffffffff8167cbb2) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: driver_attach (0xffffffff8167d28e) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: bus_for_each_dev (0xffffffff8167b62c) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: __driver_attach (0xffffffff8167e18f) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: device_driver_attach (0xffffffff8167e0ed) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: driver_probe_device (0xffffffff8167de6c) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: really_probe (0xffffffff8167d9c9) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: pci_device_probe (0xffffffff81559627) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: local_pci_probe (0xffffffff81557f98) Pages: 801 (peak: 801)
dracut-pre-pivot[519]: qxl_pci_probe qxl (0xffffffffc01f0387) Pages: 773 (peak: 773)
dracut-pre-pivot[519]: drm_fbdev_generic_setup drm_kms_helper (0xffffffffc01b30c5) Pages: 773 (peak: 773)
dracut-pre-pivot[519]: drm_fbdev_client_hotplug drm_kms_helper (0xffffffffc01b2656) Pages: 773 (peak: 773)
dracut-pre-pivot[519]: __drm_fb_helper_initial_config_and_unlock drm_kms_helper (0xffffffffc01b1a28) Pages: 770 (peak: 770)
dracut-pre-pivot[519]: drm_fb_helper_generic_probe drm_kms_helper (0xffffffffc01b2fa5) Pages: 770 (peak: 770)
dracut-pre-pivot[519]: vzalloc (0xffffffff812aa39c) Pages: 770 (peak: 770)
dracut-pre-pivot[519]: __vmalloc_node_range (0xffffffff812aa200) Pages: 768 (peak: 768)
... snip ...
======== Report format module_top END ========
This could be very helpful for debuging memory usage issues.
---
dracut.cmdline.7.asc | 16 +++++---
dracut.spec | 2 +
modules.d/99base/dracut-lib.sh | 2 +-
modules.d/99memstrack/memstrack-report.sh | 23 +++++++++++
modules.d/99memstrack/memstrack-start.sh | 68 +++++++++++++++++++++++++++++++
modules.d/99memstrack/memstrack.service | 13 ++++++
modules.d/99memstrack/module-setup.sh | 27 ++++++++++++
7 files changed, 144 insertions(+), 7 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index c53601ea..4d4970c8 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -188,8 +188,8 @@ It should be attached to any report about dracut problems.
_/run/initramfs/init.log_.
If "quiet" is set, it also logs to the console.
-**rd.memdebug=[0-3]**::
- Print memory usage info at various points, set the verbose level from 0 to 4.
+**rd.memdebug=[0-5]**::
+ Print memory usage info at various points, set the verbose level from 0 to 5.
+
Higher level means more debugging output:
+
@@ -198,10 +198,14 @@ It should be attached to any report about dracut problems.
1 - partial /proc/meminfo
2 - /proc/meminfo
3 - /proc/meminfo + /proc/slabinfo
- 4 - /proc/meminfo + /proc/slabinfo + tracekomem
- NOTE: tracekomem is a shell script utilizing kernel trace to track
- the rough total memory consumption of kernel modules during
- loading. It may override other trace configurations.
+ 4 - /proc/meminfo + /proc/slabinfo + memstrack summary
+ NOTE: memstrack is a memory tracing tool that tracks the total memory
+ consumption, and peak memory consumption of each kernel modules
+ and userspace progress during the whole initramfs runtime, report
+ is genereted and the end of initramsfs run.
+ 5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace)
+ NOTE: memstrack (with top memory stacktrace) will print top memory
+ allocation stack traces during the whole initramfs runtime.
----
**rd.break**::
diff --git a/dracut.spec b/dracut.spec
index 0369dde6..1eb47402 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -77,6 +77,7 @@ Requires: xz
Requires: gzip
%if 0%{?fedora} || 0%{?rhel}
+Recommends: memstrack
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
@@ -403,6 +404,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
+%{dracutlibdir}/modules.d/99memstrack
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99shutdown
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index b7020892..e602bacb 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1187,7 +1187,7 @@ are_lists_eq() {
setmemdebug() {
if [ -z "$DEBUG_MEM_LEVEL" ]; then
- export DEBUG_MEM_LEVEL=$(getargnum 0 0 3 rd.memdebug)
+ export DEBUG_MEM_LEVEL=$(getargnum 0 0 5 rd.memdebug)
fi
}
diff --git a/modules.d/99memstrack/memstrack-report.sh b/modules.d/99memstrack/memstrack-report.sh
new file mode 100755
index 00000000..241e8621
--- /dev/null
+++ b/modules.d/99memstrack/memstrack-report.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+. /lib/dracut-lib.sh
+
+if ! [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then
+ exit 0
+fi
+
+if type -P systemctl >/dev/null; then
+ systemctl stop memstrack.service
+else
+ get_pid_of_tracer () {
+ local _user _pid _rest
+ read _user _pid _rest <<< $(ps aux | grep [m]emstrack | head -1)
+ echo $_pid
+ }
+
+ kill -s INT $(get_pid_of_tracer)
+ while [[ -n $(get_pid_of_tracer) ]]; do
+ sleep 1
+ done
+fi
+
+cat /.memstrack
diff --git a/modules.d/99memstrack/memstrack-start.sh b/modules.d/99memstrack/memstrack-start.sh
new file mode 100755
index 00000000..5aa73efe
--- /dev/null
+++ b/modules.d/99memstrack/memstrack-start.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Mount kernel debug fs so debug tools can work.
+# memdebug=4 and memdebug=5 requires debug fs to be mounted.
+# And there is no need to umount it.
+
+type getargnum >/dev/null 2>&1 || . /lib/dracut-lib.sh
+
+# "sys/kernel/tracing" has the priority if exists.
+get_trace_base() {
+ # trace access through debugfs would be obsolete if "/sys/kernel/tracing" is available.
+ if [ -d "/sys/kernel/tracing" ]; then
+ echo "/sys/kernel"
+ else
+ echo "/sys/kernel/debug"
+ fi
+}
+
+is_debugfs_ready() {
+ [ -f "$(get_trace_base)/tracing/trace" ]
+}
+
+prepare_debugfs() {
+ local trace_base
+
+ trace_base=$(get_trace_base)
+ # old debugfs interface case.
+ if ! [ -d "$trace_base/tracing" ]; then
+ mount none -t debugfs $trace_base
+ # new tracefs interface case.
+ elif ! [ -f "$trace_base/tracing/trace" ]; then
+ mount none -t tracefs "$trace_base/tracing"
+ fi
+
+ if ! [ -f "$trace_base/tracing/trace" ]; then
+ echo "WARN: failed to mount debugfs"
+ return 1
+ fi
+}
+
+if ! is_debugfs_ready ; then
+ prepare_debugfs
+fi
+
+if [ -n "$DEBUG_MEM_LEVEL" ]; then
+ if [ "$DEBUG_MEM_LEVEL" -ge 5 ]; then
+ echo "memstrack - will report kernel module memory usage summary and top allocation stack"
+ memstrack --report module_summary,module_top --notui --throttle 80 -o /.memstrack &
+ elif [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then
+ echo "memstrack - will report memory usage summary"
+ memstrack --report module_summary --notui --throttle 80 -o /.memstrack &
+ else
+ exit 0;
+ fi
+fi
+
+PID=$!
+RET=$?
+
+if [ $RET -ne 0 ]; then
+ echo "Failed to start memstrack, exit status: $RET"
+ exit $RET
+fi
+
+# Wait a second for memstrack to setup everything, avoid missing any event
+sleep 1
+
+echo $PID > /run/memstrack.pid
+disown
diff --git a/modules.d/99memstrack/memstrack.service b/modules.d/99memstrack/memstrack.service
new file mode 100644
index 00000000..6b47adef
--- /dev/null
+++ b/modules.d/99memstrack/memstrack.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Memstrack Anylazing Service
+DefaultDependencies=no
+Before=dracut-cmdline.service systemd-udevd.service local-fs-pre.target
+IgnoreOnIsolate=true
+
+[Service]
+Type=simple
+ExecStart=/bin/memstrack-start
+PIDFile=/run/memstrack.pid
+StandardInput=null
+StandardOutput=syslog+console
+StandardError=syslog+console
diff --git a/modules.d/99memstrack/module-setup.sh b/modules.d/99memstrack/module-setup.sh
new file mode 100755
index 00000000..d5bacb4d
--- /dev/null
+++ b/modules.d/99memstrack/module-setup.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/bash
+
+check() {
+ if type -P memstrack >/dev/null; then
+ dinfo "memstrack is available"
+ return 0
+ fi
+
+ dinfo "memstrack is not available"
+ dinfo "If you need to use rd.memdebug>=4, please install memstrack"
+
+ return 1
+}
+
+depends() {
+ return 0
+}
+
+install() {
+ inst "/bin/memstrack" "/bin/memstrack"
+
+ inst "$moddir/memstrack-start.sh" "/bin/memstrack-start"
+ inst_hook cleanup 99 "$moddir/memstrack-report.sh"
+
+ inst "$moddir/memstrack.service" "$systemdsystemunitdir/memstrack.service"
+ systemctl -q --root "$initdir" add-wants initrd.target memstrack.service
+}

View File

@ -1,29 +0,0 @@
From faea4e4ddb10f697590b80f8f17181341c537262 Mon Sep 17 00:00:00 2001
From: Peter Georg <peter.georg@physik.uni-regensburg.de>
Date: Tue, 21 Apr 2020 21:34:38 +0200
Subject: [PATCH] Always pull in machinery to read ifcfg files
So far machinery is only pulled in if the user has not yet included any
ifcfg files.
---
modules.d/35network-manager/module-setup.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index 8fc3114d..ad2a1534 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -47,10 +47,8 @@ install() {
fi
# We don't install the ifcfg files from the host automatically.
- # But if the user chooses to include them, we pull in the machinery to read them.
- if ! [[ -d "$initdir/etc/sysconfig/network-scripts" ]]; then
- inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
- fi
+ # But the user might choose to include them, so we pull in the machinery to read them.
+ inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
_arch=${DRACUT_ARCH:-$(uname -m)}

View File

@ -1,66 +0,0 @@
From 586a56c2877ae8c0b365c3a6c69cd4ff8b27bf0c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 24 Apr 2020 11:05:49 +0200
Subject: [PATCH] Install crypto modules in 90kernel-modules
We don't want to play catch up with hash and encryption algorithms.
To be safe, just use the hammer and include all crypto.
Fixes https://github.com/dracutdevs/dracut/issues/802
---
modules.d/90btrfs/module-setup.sh | 2 --
modules.d/90crypt/module-setup.sh | 6 +-----
modules.d/90kernel-modules/module-setup.sh | 9 +++++++++
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index 66a254e1..79f89a50 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -26,8 +26,6 @@ depends() {
# called by dracut
installkernel() {
instmods btrfs
- # Make sure btfs can use fast crc32c implementations where available (bsc#1011554)
- instmods crc32c-intel
}
# called by dracut
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 3ee4c545..a9dda734 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -25,11 +25,7 @@ depends() {
# called by dracut
installkernel() {
hostonly="" instmods drbg
- arch=$(uname -m)
- [[ $arch == x86_64 ]] && arch=x86
- [[ $arch == s390x ]] && arch=s390
- [[ $arch == aarch64 ]] && arch=arm64
- instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto
+ instmods dm_crypt
}
# called by dracut
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index bc3810cc..28d291eb 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -104,6 +104,15 @@ installkernel() {
elif [[ "${host_fs_types[*]}" ]]; then
hostonly='' instmods "${host_fs_types[@]}"
fi
+
+ arch=${DRACUT_ARCH:-$(uname -m)}
+
+ # We don't want to play catch up with hash and encryption algorithms.
+ # To be safe, just use the hammer and include all crypto.
+ [[ $arch == x86_64 ]] && arch=x86
+ [[ $arch == s390x ]] && arch=s390
+ [[ $arch == aarch64 ]] && arch=arm64
+ instmods "=crypto" "=arch/$arch/crypto" "=drivers/crypto"
fi
:
}

View File

@ -1,53 +0,0 @@
From 5bfebf0f04c8e88a0447d5f75c7ec13951fa610d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 7 Apr 2020 22:26:25 +0200
Subject: [PATCH] 90crypt/module-setup.sh: try to catch kernel config changes
If a crypto kernel module changes from compiled in to module, the
encrypted disk might fail to open, because the kernel module was
not included in the initramfs.
This patch tries heuristically to catch such modules.
Fixes https://github.com/dracutdevs/dracut/issues/706
---
modules.d/90crypt/module-setup.sh | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index a9dda734..3bce2411 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -26,6 +26,31 @@ depends() {
installkernel() {
hostonly="" instmods drbg
instmods dm_crypt
+
+ # in case some of the crypto modules moved from compiled in
+ # to module based, try to install those modules
+ # best guess
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ # dmsetup returns s.th. like
+ # cryptvol: 0 2064384 crypt aes-xts-plain64 :64:logon:cryptsetup:....
+ dmsetup table | while read name _ _ is_crypt cipher _; do
+ [[ $is_crypt != "crypt" ]] && continue
+ # get the device name
+ name=/dev/$(dmsetup info -c --noheadings -o blkdevname ${name%:})
+ # check if the device exists as a key in our host_fs_types
+ if [[ ${host_fs_types[$name]+_} ]]; then
+ # split the cipher aes-xts-plain64 in pieces
+ _OLD_IFS=$IFS
+ IFS='-:'
+ set -- $cipher
+ IFS=$_OLD_IFS
+ # try to load the cipher part with "crypto-" prepended
+ # in non-hostonly mode
+ hostonly= instmods $(for k in "$@"; do echo "crypto-$k";done)
+ fi
+ done
+ }
+ return 0
}
# called by dracut

View File

@ -1,24 +0,0 @@
From c6a2ebffe5812bf45a17d90208d9bb1044b6dba0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 30 Apr 2020 20:42:27 +0200
Subject: [PATCH] 90kernel-modules/module-setup.sh: add sg kernel module
Fixes udevd messages about failure of `modprobe -bv sg`.
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 28d291eb..b3aa75f3 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -25,7 +25,7 @@ installkernel() {
}
install_block_modules () {
- hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix
+ hostonly='' instmods sg sr_mod sd_mod scsi_dh ata_piix
instmods \
scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
=ide nvme vmd \

View File

@ -1,26 +0,0 @@
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 3bce2411..e3d6338f 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)

View File

@ -1,25 +0,0 @@
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 b5c73f62..ea0c7f62 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

View File

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

View File

@ -1,25 +0,0 @@
From 1ec7b694b55c70d06f262a96c320709b70d20bcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20Pawe=C5=82=20Gajc?= <tpgxyz@gmail.com>
Date: Mon, 11 May 2020 14:49:06 +0200
Subject: [PATCH] install dependant libs too
By default rng-tools are compiled with pkcs11 support.
Make sure opensc-pkcs11.so library is installed inside initramfs to prevent error on boot
---
modules.d/06rngd/module-setup.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh
index 354bd0bb..f07a0cb9 100644
--- a/modules.d/06rngd/module-setup.sh
+++ b/modules.d/06rngd/module-setup.sh
@@ -33,6 +33,8 @@ check() {
install() {
inst rngd
inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
+ # make sure dependant libs are installed too
+ inst_libdir_file opensc-pkcs11.so
systemctl -q --root "$initdir" add-wants sysinit.target rngd.service
}

View File

@ -1,34 +0,0 @@
From 424f01e2a0ac0b329e68eb63048cf0d6d9c74d37 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 27 May 2020 22:07:37 +0800
Subject: [PATCH] 99memstrack: hook script should not call exit
With memstrack module, rd.break may not work because the hook scripts
are sourced, not executed, so the exit call will make pre-pivot queue
exit early. See 98dracut-systemd/dracut-pre-pivot.sh, everything after
"source_hook cleanup" will be ignored.
Replace with return instead.
Credits go to Lukas Nykryn <lnykryn@redhat.com> who helped discover and
debug this issue.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/99memstrack/memstrack-report.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99memstrack/memstrack-report.sh b/modules.d/99memstrack/memstrack-report.sh
index 241e8621..3de55bd1 100755
--- a/modules.d/99memstrack/memstrack-report.sh
+++ b/modules.d/99memstrack/memstrack-report.sh
@@ -2,7 +2,7 @@
. /lib/dracut-lib.sh
if ! [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then
- exit 0
+ return 0
fi
if type -P systemctl >/dev/null; then

View File

@ -1,39 +0,0 @@
From 2a611328652388b809a379403ceec126cb55819f Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 27 May 2020 21:59:55 +0800
Subject: [PATCH] Remove cleanup_trace_mem calls
In commit 49c4172 all shell based memory tracing functions are removed,
there are some left over. Remove them as well.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/98dracut-systemd/dracut-pre-pivot.sh | 1 -
modules.d/99base/init.sh | 1 -
2 files changed, 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.sh b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
index 96e6f8ca..cc70e3c3 100755
--- a/modules.d/98dracut-systemd/dracut-pre-pivot.sh
+++ b/modules.d/98dracut-systemd/dracut-pre-pivot.sh
@@ -14,7 +14,6 @@ make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab'
getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot"
source_hook pre-pivot
-cleanup_trace_mem
# pre pivot cleanup scripts are sourced just before we switch over to the new root.
getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
source_hook cleanup
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 148ce831..f70a811e 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -271,7 +271,6 @@ getarg 'rd.break=pre-pivot' -d 'rdbreak=pre-pivot' && emergency_shell -n pre-piv
source_hook pre-pivot
make_trace_mem "hook cleanup" '1:shortmem' '2+:mem' '3+:slab'
-cleanup_trace_mem
# pre pivot cleanup scripts are sourced just before we switch over to the new root.
getarg 'rd.break=cleanup' -d 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup"
source_hook cleanup

View File

@ -1,60 +0,0 @@
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

View File

@ -1,38 +0,0 @@
From 50cc23ba32b0fda63eff7623b529dbeb4e6a38c6 Mon Sep 17 00:00:00 2001
From: Alexander Tsoy <alexander@tsoy.me>
Date: Mon, 25 May 2020 17:49:20 +0300
Subject: [PATCH] busybox: simplify listing of supported utilities
'--list' option is supported since busybox-1.20.0, which was released
in 2010.
---
modules.d/05busybox/module-setup.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh
index ecbd6a13..5d88c5d1 100755
--- a/modules.d/05busybox/module-setup.sh
+++ b/modules.d/05busybox/module-setup.sh
@@ -14,15 +14,16 @@ depends() {
# called by dracut
install() {
- local _i _progs _path _busybox
+ local _i _path _busybox
+ local _progs=()
_busybox=$(type -P busybox)
inst $_busybox /usr/bin/busybox
- for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
- do
- _progs="$_progs $_i"
+ for _i in $($_busybox --list); do
+ [[ ${_i} == busybox ]] && continue
+ _progs+=("${_i}")
done
- for _i in $_progs; do
+ for _i in "${_progs[@]}"; do
_path=$(find_binary "$_i")
[ -z "$_path" ] && continue
ln_r /usr/bin/busybox $_path

View File

@ -1,52 +0,0 @@
From b448655ba7cf46d25cbc2845e30ec559a487fc1e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 May 2020 10:30:26 +0200
Subject: [PATCH] CI: remove Fedora 30, add Fedora 32
---
.github/workflows/{fedora-30.yml => fedora-32.yml} | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/fedora-30.yml b/.github/workflows/fedora-32.yml
similarity index 84%
rename from .github/workflows/fedora-30.yml
rename to .github/workflows/fedora-32.yml
index 1a3d3e8d..589bf176 100644
--- a/.github/workflows/fedora-30.yml
+++ b/.github/workflows/fedora-32.yml
@@ -1,6 +1,6 @@
## The test container is created with https://github.com/dracutdevs/fedora-container
-name: Fedora-30
+name: Fedora-32
on:
push:
@@ -14,7 +14,7 @@ jobs:
test:
runs-on: ubuntu-latest
container:
- image: quay.io/haraldh/dracut-fedora:30
+ image: quay.io/haraldh/dracut-fedora:32
options: "--privileged"
timeout-minutes: 45
strategy:
@@ -32,11 +32,17 @@ jobs:
"15",
"17",
"20",
+ "21",
"30",
+ "31",
"35",
+ "36",
"40",
+ "41",
"50",
+ "51",
"60",
+ "61",
"99",
]
fail-fast: false

View File

@ -1,34 +0,0 @@
From c800d1a7b943f8ca86b9756fbaa4cd2a5644ad44 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 May 2020 10:49:47 +0200
Subject: [PATCH] dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and
`rd.lvm.lv`
Fixes: https://github.com/dracutdevs/dracut/issues/816
---
dracut.cmdline.7.asc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 4d4970c8..751f5276 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -281,12 +281,12 @@ LVM
disable LVM detection
**rd.lvm.vg=**__<volume group name>__::
- only activate the volume groups with the given name. rd.lvm.vg can be
- specified multiple times on the kernel command line.
+ only activate all logical volumes in the the volume groups with the given name.
+ rd.lvm.vg can be specified multiple times on the kernel command line.
-**rd.lvm.lv=**__<logical volume name>__::
- only activate the logical volumes with the given name. rd.lvm.lv can be
- specified multiple times on the kernel command line.
+**rd.lvm.lv=**__<volume group name>/<logical volume name>__::
+ only activate the logical volumes with the given name.
+ rd.lvm.lv can be specified multiple times on the kernel command line.
**rd.lvm.conf=0**::
remove any _/etc/lvm/lvm.conf_, which may exist in the initramfs

View File

@ -1,31 +0,0 @@
From 7169e5f0e43cdc9a0bdc93de33f3404d8c461acd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 May 2020 11:03:19 +0200
Subject: [PATCH] dracut.conf.5.asc: document how to config --no-compress in
the config
Fixes: https://github.com/dracutdevs/dracut/issues/824
---
dracut.conf.5.asc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc
index 937f5423..f206f2f7 100644
--- a/dracut.conf.5.asc
+++ b/dracut.conf.5.asc
@@ -80,12 +80,13 @@ 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=*"__{cat|bzip2|lzma|xz|gzip|lzo|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
with exactly those arguments. Depending on what you pass, this may result in
an initramfs that the kernel cannot decompress.
+ To disable compression, use "cat".
*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes)

View File

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

View File

@ -1,60 +0,0 @@
From 871d63c3be529cee2c2bd868750eda121ece46dc Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 29 May 2020 14:43:57 +0200
Subject: [PATCH] Fix CI badges in README.md and fix dracut description
While fixing the CI badges, I removed some old crufty README text.
---
README.md | 11 ++++-------
dracut.spec | 2 +-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 9948bf97..0ab54ea6 100644
--- a/README.md
+++ b/README.md
@@ -4,15 +4,15 @@ dracut
dracut is an event driven initramfs infrastructure.
[![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut)
-[![Fedora-30](https://github.com/dracutdevs/dracut/workflows/Fedora-30/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-30)
[![Fedora-31](https://github.com/dracutdevs/dracut/workflows/Fedora-31/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-31)
+[![Fedora-32](https://github.com/dracutdevs/dracut/workflows/Fedora-32/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the
dracut framework, usually found in /usr/lib/dracut/modules.d.
-Unlike existing initramfs's, this is an attempt at having as little as
-possible hard-coded into the initramfs as possible. The initramfs has
+Unlike other implementations, dracut hard-codes as little
+as possible into the initramfs. The initramfs has
(basically) one purpose in life -- getting the rootfs mounted so that
we can transition to the real rootfs. This is all driven off of
device availability. Therefore, instead of scripts hard-coded to do
@@ -20,10 +20,7 @@ various things, we depend on udev to create device nodes for us and
then when we have the rootfs's device node, we mount and carry on.
This helps to keep the time required in the initramfs as little as
possible so that things like a 5 second boot aren't made impossible as
-a result of the very existence of an initramfs. It's likely that
-we'll grow some hooks for running arbitrary commands in the flow of
-the script, but it's worth trying to resist the urge as much as we can
-as hooks are guaranteed to be the path to slow-down.
+a result of the very existence of an initramfs.
Most of the initramfs generation functionality in dracut is provided by a bunch
of generator modules that are sourced by the main dracut script to install
diff --git a/dracut.spec b/dracut.spec
index 1eb47402..4d1cb7a4 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -99,7 +99,7 @@ Requires: libkcapi-hmaccalc
%description
dracut contains tools to create bootable initramfses for the Linux
-kernel. Unlike previous implementations, dracut hard-codes as little
+kernel. Unlike other implementations, dracut hard-codes as little
as possible into the initramfs. dracut contains various modules which
are driven by the event-based udev. Having root on MD, DM, LVM2, LUKS
is supported as well as NFS, iSCSI, NBD, FCoE with the dracut-network

View File

@ -1,109 +0,0 @@
From 5f8063c6f2944fc93af5d6d800197e8c966ba70f Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Fri, 10 Apr 2020 20:50:49 +0800
Subject: [PATCH] 95nfs: only install rpc services for NFS < 4 when hostonly is
strict
Most rpc services are not needed for NFSv4, so skip these components
to save space. rpc.idmapd is still needed in case of
nfs4_disable_idmapping is set to 0.
---
modules.d/95nfs/module-setup.sh | 33 ++++++++++++++++++++++++++-------
modules.d/95nfs/nfs-start-rpc.sh | 6 ++----
2 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index f9bcedd1..d9a91fdf 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -1,5 +1,22 @@
#!/bin/bash
+# return value:
+# 'nfs4': Only nfs4 founded
+# 'nfs': nfs with version < 4 founded
+# '': No nfs founded
+get_nfs_type() {
+ local _nfs _nfs4
+
+ for fs in "${host_fs_types[@]}"; do
+ [[ "$fs" == "nfs" ]] && _nfs=1
+ [[ "$fs" == "nfs3" ]] && _nfs=1
+ [[ "$fs" == "nfs4" ]] && _nfs4=1
+ done
+
+ [[ "$_nfs" ]] && echo "nfs" && return
+ [[ "$_nfs4" ]] && echo "nfs4" && return
+}
+
# called by dracut
check() {
# If our prerequisites are not met, fail anyways.
@@ -7,11 +24,7 @@ check() {
require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
- for fs in "${host_fs_types[@]}"; do
- [[ "$fs" == "nfs" ]] && return 0
- [[ "$fs" == "nfs3" ]] && return 0
- [[ "$fs" == "nfs4" ]] && return 0
- done
+ [[ "$(get_nfs_type)" ]] && return 0
return 255
}
return 0
@@ -77,8 +90,7 @@ cmdline() {
install() {
local _i
local _nsslibs
- inst_multiple -o portmap rpcbind rpc.statd mount.nfs \
- mount.nfs4 umount rpc.idmapd sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf"
+ inst_multiple -o rpc.idmapd mount.nfs mount.nfs4 umount sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf"
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
if [[ $hostonly_cmdline == "yes" ]]; then
@@ -106,6 +118,12 @@ install() {
inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh"
inst_hook cleanup 99 "$moddir/nfsroot-cleanup.sh"
inst "$moddir/nfsroot.sh" "/sbin/nfsroot"
+
+ # For strict hostonly, only install rpcbind for NFS < 4
+ if [[ $hostonly_mode != "strict" ]] || [[ "$(get_nfs_type)" != "nfs4" ]]; then
+ inst_multiple -o portmap rpcbind rpc.statd
+ fi
+
inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh"
mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
@@ -121,5 +139,6 @@ install() {
chmod 770 "$initdir/var/lib/rpcbind"
grep -q '^rpc:' $dracutsysrootdir/etc/passwd \
&& grep -q '^rpc:' $dracutsysrootdir/etc/group
+
dracut_need_initqueue
}
diff --git a/modules.d/95nfs/nfs-start-rpc.sh b/modules.d/95nfs/nfs-start-rpc.sh
index 694e05e2..dadfd90a 100755
--- a/modules.d/95nfs/nfs-start-rpc.sh
+++ b/modules.d/95nfs/nfs-start-rpc.sh
@@ -1,8 +1,6 @@
#!/bin/sh
-
if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then
-
[ ! -d /var/lib/nfs/rpc_pipefs/nfs ] && \
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
@@ -17,8 +15,8 @@ if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then
# Start rpc.statd as mount won't let us use locks on a NFSv4
# filesystem without talking to it. NFSv4 does locks internally,
# rpc.lockd isn't needed
- [ -z "$(pidof rpc.statd)" ] && rpc.statd
- [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
+ command -v rpc.statd >/dev/null && [ -z "$(pidof rpc.statd)" ] && rpc.statd
+ command -v rpc.idmapd >/dev/null && [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd
else
warn 'Kernel module "sunrpc" not in the initramfs, or support for filesystem "rpc_pipefs" missing!'
fi

View File

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

View File

@ -1,24 +0,0 @@
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
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
}

View File

@ -1,78 +0,0 @@
From 6e1e87cd2567801b10b2b4f716436c48688408bf Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 24 Jun 2020 13:06:05 +0200
Subject: [PATCH] network-manager: move connection generation to a lib file
Move the connection generation code to a library file so that it can
be reused from other places.
---
modules.d/35network-manager/module-setup.sh | 1 +
modules.d/35network-manager/nm-config.sh | 15 +++------------
modules.d/35network-manager/nm-lib.sh | 20 ++++++++++++++++++++
3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index ad2a1534..ed2f399e 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -37,6 +37,7 @@ install() {
inst_hook initqueue/settled 99 "$moddir/nm-run.sh"
inst_rules 85-nm-unmanaged.rules
inst_libdir_file "NetworkManager/$_nm_version/libnm-device-plugin-team.so"
+ inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh"
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
inst /usr/libexec/nm-dhcp-helper
diff --git a/modules.d/35network-manager/nm-config.sh b/modules.d/35network-manager/nm-config.sh
index 39a1c8bd..2b9df020 100755
--- a/modules.d/35network-manager/nm-config.sh
+++ b/modules.d/35network-manager/nm-config.sh
@@ -1,18 +1,9 @@
#!/bin/sh
+type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
+
if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
fi
-/usr/libexec/nm-initrd-generator -- $(getcmdline)
-
-if getargbool 0 rd.neednet; then
- for i in /usr/lib/NetworkManager/system-connections/* \
- /run/NetworkManager/system-connections/* \
- /etc/NetworkManager/system-connections/* \
- /etc/sysconfig/network-scripts/ifcfg-*; do
- [ -f "$i" ] || continue
- echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
- break
- done
-fi
+nm_generate_connections
diff --git a/modules.d/35network-manager/nm-lib.sh b/modules.d/35network-manager/nm-lib.sh
new file mode 100644
index 00000000..fe053cfa
--- /dev/null
+++ b/modules.d/35network-manager/nm-lib.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+type getcmdline >/dev/null 2>&1 || . /lib/dracut-lib.sh
+
+nm_generate_connections()
+{
+ rm -f /run/NetworkManager/system-connections/*
+ /usr/libexec/nm-initrd-generator -- $(getcmdline)
+
+ if getargbool 0 rd.neednet; then
+ for i in /usr/lib/NetworkManager/system-connections/* \
+ /run/NetworkManager/system-connections/* \
+ /etc/NetworkManager/system-connections/* \
+ /etc/sysconfig/network-scripts/ifcfg-*; do
+ [ -f "$i" ] || continue
+ echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
+ break
+ done
+ fi
+}

View File

@ -1,30 +0,0 @@
From 5c3d0a96473ac339fa2d1b25213b8f301c1cfd0d Mon Sep 17 00:00:00 2001
From: Beniamino Galvani <bgalvani@redhat.com>
Date: Wed, 24 Jun 2020 13:09:04 +0200
Subject: [PATCH] cms: regenerate NetworkManager connections
After changing the kernel command line, the cmsifup script calls ifup
to activate the interface. However, ifup is only available in the
network-legacy module; when using the network-manager module, we
should regenerate connections according to the command line; then
later NM will be run and will activate the device.
---
modules.d/80cms/cmsifup.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules.d/80cms/cmsifup.sh b/modules.d/80cms/cmsifup.sh
index 902df8d8..77c18452 100755
--- a/modules.d/80cms/cmsifup.sh
+++ b/modules.d/80cms/cmsifup.sh
@@ -35,4 +35,9 @@ fi
IFACES="$IFACES $DEVICE"
echo "$IFACES" >> /tmp/net.ifaces
-exec ifup "$DEVICE"
+if [ -x /usr/libexec/nm-initrd-generator ]; then
+ type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
+ nm_generate_connections
+else
+ exec ifup "$DEVICE"
+fi

View File

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

View File

@ -1,51 +0,0 @@
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
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 \

View File

@ -1,40 +0,0 @@
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.
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

View File

@ -1,25 +0,0 @@
From 46f3156426e1b770e4876a654738e1c3e01851af Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
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.
---
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

View File

@ -1,26 +0,0 @@
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.
---
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

View File

@ -1,55 +0,0 @@
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
---
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)

View File

@ -1,24 +0,0 @@
From 265f696b532f63f0ac1f9f341e0469a6eafe2fdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:26:00 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/90stratis/stratisd-init.service | 2 --
1 file changed, 2 deletions(-)
diff --git a/modules.d/90stratis/stratisd-init.service b/modules.d/90stratis/stratisd-init.service
index 318e8c27..1be2e33b 100644
--- a/modules.d/90stratis/stratisd-init.service
+++ b/modules.d/90stratis/stratisd-init.service
@@ -8,8 +8,6 @@ DefaultDependencies=no
Type=simple
ExecStart=/sbin/stratisd-init --debug
KillSignal=SIGINT
-StandardOutput=syslog
-StandardError=syslog
[Install]
WantedBy=sysinit.target

View File

@ -1,24 +0,0 @@
From 38ba90bf88b38228e128c65be40a2da287c0b1ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:29:34 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/99squash/squash-mnt-clear.service | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service
index 84441f60..9d94c524 100644
--- a/modules.d/99squash/squash-mnt-clear.service
+++ b/modules.d/99squash/squash-mnt-clear.service
@@ -12,6 +12,6 @@ ConditionPathExists=/squash/root
Type=oneshot
RemainAfterExit=no
StandardInput=null
-StandardOutput=syslog+console
-StandardError=syslog+console
+StandardOutput=journal+console
+StandardError=journal+console
ExecStart=/squash/clear-squash.sh

View File

@ -1,25 +0,0 @@
From 5cb2a4004d18e4b96ddc18f221fae922350a9000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:31:17 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-trigger.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-trigger.service b/modules.d/98dracut-systemd/dracut-pre-trigger.service
index 7bf16167..6f1ba521 100644
--- a/modules.d/98dracut-systemd/dracut-pre-trigger.service
+++ b/modules.d/98dracut-systemd/dracut-pre-trigger.service
@@ -20,8 +20,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-trigger
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From 317d841c788e841d3533515ceda5597a099eb64e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:31:59 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-initqueue.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.service b/modules.d/98dracut-systemd/dracut-initqueue.service
index 207d545d..3a8679a5 100644
--- a/modules.d/98dracut-systemd/dracut-initqueue.service
+++ b/modules.d/98dracut-systemd/dracut-initqueue.service
@@ -21,8 +21,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-initqueue
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From 0c1bd016ecfb9c6d194c4356199b509d90db4071 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:32:44 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-pivot.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-pivot.service b/modules.d/98dracut-systemd/dracut-pre-pivot.service
index 9a1f0854..e893d1dd 100644
--- a/modules.d/98dracut-systemd/dracut-pre-pivot.service
+++ b/modules.d/98dracut-systemd/dracut-pre-pivot.service
@@ -27,8 +27,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-pivot
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From e1130a83405648777210fdc99f7eee087eebaadc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:33:33 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-udev.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-udev.service b/modules.d/98dracut-systemd/dracut-pre-udev.service
index 570ec02d..e4092e35 100644
--- a/modules.d/98dracut-systemd/dracut-pre-udev.service
+++ b/modules.d/98dracut-systemd/dracut-pre-udev.service
@@ -24,8 +24,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-udev
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From c437933cb0490e800e776cb7695d2ea0e95056a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:34:17 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-pre-mount.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-pre-mount.service b/modules.d/98dracut-systemd/dracut-pre-mount.service
index d3909689..18c9730c 100644
--- a/modules.d/98dracut-systemd/dracut-pre-mount.service
+++ b/modules.d/98dracut-systemd/dracut-pre-mount.service
@@ -19,8 +19,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-pre-mount
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From d9149c6ca7c52c204c1b346e9b6a32bbadd0b2ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:35:02 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-cmdline.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-cmdline.service b/modules.d/98dracut-systemd/dracut-cmdline.service
index e577ec88..a8078bd2 100644
--- a/modules.d/98dracut-systemd/dracut-cmdline.service
+++ b/modules.d/98dracut-systemd/dracut-cmdline.service
@@ -23,8 +23,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-cmdline
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,25 +0,0 @@
From 8cb5ac1b30be458df9497911ba601d90e68f4d5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:35:38 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/98dracut-systemd/dracut-mount.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-mount.service b/modules.d/98dracut-systemd/dracut-mount.service
index 77d34f62..c88e6d84 100644
--- a/modules.d/98dracut-systemd/dracut-mount.service
+++ b/modules.d/98dracut-systemd/dracut-mount.service
@@ -19,8 +19,7 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=-/bin/dracut-mount
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes

View File

@ -1,23 +0,0 @@
From 0cf01f125a224efd35bfe6ab736d9e04de715264 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= <johannbg@gmail.com>
Date: Wed, 15 Jul 2020 14:36:20 +0000
Subject: [PATCH] As of v246 of systemd "syslog" and "syslog-console" switches
have been deprecated
---
modules.d/99memstrack/memstrack.service | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99memstrack/memstrack.service b/modules.d/99memstrack/memstrack.service
index 6b47adef..c9fcadef 100644
--- a/modules.d/99memstrack/memstrack.service
+++ b/modules.d/99memstrack/memstrack.service
@@ -9,5 +9,5 @@ Type=simple
ExecStart=/bin/memstrack-start
PIDFile=/run/memstrack.pid
StandardInput=null
-StandardOutput=syslog+console
-StandardError=syslog+console
+StandardOutput=journal+console
+StandardError=journal+console

View File

@ -1,24 +0,0 @@
From f7ad1479f277ddffcc501bd08919a4a4a6facc26 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 3 Aug 2020 16:51:54 +0800
Subject: [PATCH] 90kernel-modules: add pci_hyperv
Install pci_hyperv for SR-IOV devices on hyperv machines.
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index b3aa75f3..764675eb 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -57,7 +57,7 @@ installkernel() {
instmods \
yenta_socket \
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
- virtio virtio_ring virtio_pci virtio_scsi \
+ virtio virtio_ring virtio_pci virtio_scsi pci_hyperv \
"=drivers/pcmcia"
if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then

View File

@ -1,35 +0,0 @@
From 05ce5c41b61f97d41044f2f146de980e38f7991a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 25 Jul 2020 17:47:00 +0200
Subject: [PATCH] 90ppcmac: respect DRACUT_ARCH, don't exclude ppcle
---
modules.d/90ppcmac/module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/90ppcmac/module-setup.sh b/modules.d/90ppcmac/module-setup.sh
index 59221ec4..d457119f 100644
--- a/modules.d/90ppcmac/module-setup.sh
+++ b/modules.d/90ppcmac/module-setup.sh
@@ -17,9 +17,9 @@
# called by dracut
check() {
- local _arch="$(uname -m)"
+ local _arch=${DRACUT_ARCH:-$(uname -m)}
# only for PowerPC Macs
- [[ "$_arch" == ppc* && "$_arch" != ppc*le ]] || return 1
+ [[ "$_arch" == ppc* && "$_arch" != ppc64le ]] || return 1
return 0
}
@@ -36,7 +36,7 @@ installkernel() {
}
# only PowerMac3,6 has a module, special case
- if [[ "$(uname -m)" == ppc ]]; then
+ if [[ "${DRACUT_ARCH:-$(uname -m)}" != ppc64* ]]; then
if ! [[ $hostonly ]] || [[ "$(pmac_model)" == "PowerMac3,6" ]]; then
instmods therm_windtunnel
fi

View File

@ -1,30 +0,0 @@
From fa1b98e4eafbc4e4145328b094388328b83bb647 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 25 Jul 2020 17:29:23 +0200
Subject: [PATCH] mkinitrd-dracut.sh: use vmlinux regex for ppc*, vmlinuz for
i686
Previously this would not catch ppc64le, now it does; same with
i686.
---
mkinitrd-dracut.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkinitrd-dracut.sh b/mkinitrd-dracut.sh
index 82d90684..c2141d68 100755
--- a/mkinitrd-dracut.sh
+++ b/mkinitrd-dracut.sh
@@ -57,10 +57,10 @@ default_kernel_images() {
s390|s390x)
regex='image'
;;
- ppc|ppc64)
+ ppc*)
regex='vmlinux'
;;
- i386|x86_64)
+ i?86|x86_64)
regex='vmlinuz'
;;
arm*)

View File

@ -1,23 +0,0 @@
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
---
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"

View File

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

View File

@ -1,140 +0,0 @@
From ceca74ccc397795db68ca6ffbe49d65af2178a50 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
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
+
+}

View File

@ -1,44 +0,0 @@
From 6dbae7e77238dd44bedb0ca2478f985f451c05bf Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Fri, 10 Jul 2020 18:09:05 +0200
Subject: [PATCH] 95iscsi: use ip_params_for_remote_addr()
Use the new helper function.
---
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

View File

@ -1,47 +0,0 @@
From 880d155967bb54f61e5960347aa8bbab6da8f86d Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.de>
Date: Sat, 11 Jul 2020 00:19:09 +0200
Subject: [PATCH] 95nfs: use ip_params_for_remote_addr()
Use the new helper function.
---
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

View File

@ -1,25 +0,0 @@
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}.
---
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%%:*}

View File

@ -1,150 +0,0 @@
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

View File

@ -1,23 +0,0 @@
From e90220701445dc58c56c3df22276cbc9b1299dc2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= <gael.portay@collabora.com>
Date: Tue, 24 Sep 2019 22:39:43 -0400
Subject: [PATCH] dracut.modules.7.asc: fix another typo
---
dracut.modules.7.asc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.modules.7.asc b/dracut.modules.7.asc
index 67a56bd4..fb30409e 100644
--- a/dracut.modules.7.asc
+++ b/dracut.modules.7.asc
@@ -159,7 +159,7 @@ check():
return 0
----
-The we create the install() function, which installs a cmdline hook with
+Then we create the install() function, which installs a cmdline hook with
priority number 20 called _parse-insmodpost.sh_. It also installs the
_insmodpost.sh_ script in _/sbin_.

View File

@ -1,27 +0,0 @@
From 30ea52f88cddd99825b6bb9be79b738702cb1a6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= <gael.portay@collabora.com>
Date: Tue, 24 Sep 2019 23:00:35 -0400
Subject: [PATCH] dracut.modules.7.asc: fix reference to insmodpost module
The module 96insmodpost was renamed to 90kernel-modules since commit
5078c98a (move insmodpost and blacklisting to 90kernel-modules)
---
dracut.modules.7.asc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.modules.7.asc b/dracut.modules.7.asc
index fb30409e..81135cff 100644
--- a/dracut.modules.7.asc
+++ b/dracut.modules.7.asc
@@ -146,8 +146,8 @@ FIXME
== Writing a Module
-A simple example module is _96insmodpost_, which modprobes a kernel module after
-udev has settled and the basic device drivers have been loaded.
+A simple example module is _90kernel-modules_, which modprobes a kernel module
+after udev has settled and the basic device drivers have been loaded.
All module installation information is in the file module-setup.sh.

View File

@ -1,24 +0,0 @@
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 '='.
---
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

View File

@ -1,29 +0,0 @@
From 5c025a7d2a53cd63c7a94269aec2887e016ba2d6 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 10 Jun 2020 18:28:27 +0800
Subject: [PATCH] 99memstrack: Only start tracking service when rd.memdebug=4|5
Currently systemd will always start the tracking service, it will
exit early if rd.memdebug<=3 so there is no issue here, but it
leave a message of: "Started Memstrack Anylazing Service.".
Better to avoid such message if it's not used.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/99memstrack/memstrack.service | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules.d/99memstrack/memstrack.service b/modules.d/99memstrack/memstrack.service
index c9fcadef..fce373b5 100644
--- a/modules.d/99memstrack/memstrack.service
+++ b/modules.d/99memstrack/memstrack.service
@@ -3,6 +3,8 @@ Description=Memstrack Anylazing Service
DefaultDependencies=no
Before=dracut-cmdline.service systemd-udevd.service local-fs-pre.target
IgnoreOnIsolate=true
+ConditionKernelCommandLine=|rd.memdebug=4
+ConditionKernelCommandLine=|rd.memdebug=5
[Service]
Type=simple

View File

@ -1,35 +0,0 @@
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.
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}"

View File

@ -1,51 +0,0 @@
From dc9596155def879c99caa03acc5bd6d7090488ed Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Fri, 2 Aug 2019 17:11:19 +0800
Subject: [PATCH] dracut-initqueue: Print more useful info in case of timeout
Currently when initqueue timeout, it span the console with
"dracut-initqueue timeout - starting timeout scripts", which isn't very
helpful as we still don't know what actually happened. Try to improve
this by print what is actually being waited.
Besides, only print "starting timeout scripts" when there are
actual timeout scripts to use.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/98dracut-systemd/dracut-initqueue.sh | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.sh b/modules.d/98dracut-systemd/dracut-initqueue.sh
index 3ddc2362..89225995 100755
--- a/modules.d/98dracut-systemd/dracut-initqueue.sh
+++ b/modules.d/98dracut-systemd/dracut-initqueue.sh
@@ -55,14 +55,20 @@ while :; do
done
if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then
- warn "dracut-initqueue timeout - starting timeout scripts"
- for job in $hookdir/initqueue/timeout/*.sh; do
- [ -e "$job" ] || break
- job=$job . $job
- udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
- [ -f $hookdir/initqueue/work ] && main_loop=0
- [ $main_loop -eq 0 ] && break
+ warn "dracut-initqueue: timeout, still waiting for following initqueue hooks:"
+ for _f in $hookdir/initqueue/finished/*.sh; do
+ warn "$_f: \"$(cat "$_f")\""
done
+ if [ "$(ls -A $hookdir/initqueue/finished)" ]; then
+ warn "dracut-initqueue: starting timeout scripts"
+ for job in $hookdir/initqueue/timeout/*.sh; do
+ [ -e "$job" ] || break
+ job=$job . $job
+ udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
+ [ -f $hookdir/initqueue/work ] && main_loop=0
+ [ $main_loop -eq 0 ] && break
+ done
+ fi
fi
main_loop=$(($main_loop+1))

View File

@ -1,33 +0,0 @@
From 3a2beb037c822e1567f86b63ac24194bffeea991 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 8 Jun 2020 15:31:56 +0800
Subject: [PATCH] 99squash: Don't hardcode the squash sub directories
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/99squash/setup-squash.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/99squash/setup-squash.sh b/modules.d/99squash/setup-squash.sh
index d2740e7c..d0000b6f 100755
--- a/modules.d/99squash/setup-squash.sh
+++ b/modules.d/99squash/setup-squash.sh
@@ -4,7 +4,6 @@ PATH=/bin:/sbin
SQUASH_IMG=/squash/root.img
SQUASH_MNT=/squash/root
SQUASH_MNT_REC=/squash/mounts
-SQUASHED_MNT="usr etc"
echo $SQUASH_MNT > $SQUASH_MNT_REC
@@ -45,7 +44,8 @@ if [ $? != 0 ]; then
echo "Unable to mount squashed initramfs image"
fi
-for file in $SQUASHED_MNT; do
+for file in $SQUASH_MNT/*; do
+ file=${file#$SQUASH_MNT/}
lowerdir=$SQUASH_MNT/$file
workdir=/squash/overlay-work/$file
upperdir=/$file

View File

@ -1,53 +0,0 @@
From cfd872392c59c96665c558899880d6b2980065bb Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Mon, 8 Jun 2020 17:00:00 +0800
Subject: [PATCH] 99squash: improve pre-requirements check
Check for systemd-initrd and squashfs-tools in check() to fail early if
it won't work.
Signed-off-by: Kairui Song <kasong@redhat.com>
---
modules.d/99squash/module-setup.sh | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh
index 72fa81f0..6307377c 100644
--- a/modules.d/99squash/module-setup.sh
+++ b/modules.d/99squash/module-setup.sh
@@ -1,11 +1,21 @@
#!/bin/bash
check() {
+ if ! dracut_module_included "systemd-initrd"; then
+ derror "dracut-squash only supports systemd bases initramfs"
+ return 1
+ fi
+
+ if ! type -P mksquashfs >/dev/null || ! type -P unsquashfs >/dev/null ; then
+ derror "dracut-squash module requires squashfs-tools"
+ return 1
+ fi
+
return 255
}
depends() {
- echo "bash systemd systemd-initrd"
+ echo "bash systemd-initrd"
return 0
}
@@ -14,11 +24,6 @@ installkernel() {
}
install() {
- if ! type -P mksquashfs >/dev/null || ! type -P unsquashfs >/dev/null ; then
- derror "squash module requires squashfs-tools to be installed."
- return 1
- fi
-
inst_multiple kmod modprobe mount mkdir ln echo
inst $moddir/setup-squash.sh /squash/setup-squash.sh
inst $moddir/clear-squash.sh /squash/clear-squash.sh

Some files were not shown because too many files have changed in this diff Show More