import dracut-049-89.git20200625.el8

This commit is contained in:
CentOS Sources 2020-07-28 08:50:12 -04:00 committed by Stepan Oksanichenko
parent 0dc2f27864
commit 0b1b54b0d5
31 changed files with 2102 additions and 2 deletions

View File

@ -55,3 +55,4 @@ index f8d5db46..84441f60 100644
StandardError=syslog+console
-ExecStop=/squash/clear-squash.sh
+ExecStart=/squash/clear-squash.sh

31
SOURCES/0060.patch Normal file
View File

@ -0,0 +1,31 @@
From ab679e91396a21489999c0acc9243415cb3235db Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Tue, 7 Jan 2020 20:53:53 +0000
Subject: [PATCH] modules/network-manager: Install `ip`
We don't need `ip` but having it is *really* useful for people debugging
in an emergency shell.
(cherry picked from commit 7fea85ce5f313445a260b5eb7bd7466217479d99)
Resolves: #1784358
---
modules.d/35network-manager/module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh
index 62aba3c6..d6d0f9ce 100755
--- a/modules.d/35network-manager/module-setup.sh
+++ b/modules.d/35network-manager/module-setup.sh
@@ -26,7 +26,9 @@ install() {
_nm_version=$(NetworkManager --version)
- inst_multiple sed grep
+ # We don't need `ip` but having it is *really* useful for people debugging
+ # in an emergency shell.
+ inst_multiple ip sed grep
inst NetworkManager
inst /usr/libexec/nm-initrd-generator

31
SOURCES/0061.patch Normal file
View File

@ -0,0 +1,31 @@
From 7164155795f3f257cd119846de0b2a802a6a52c5 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Thu, 9 Jan 2020 10:49:52 +0100
Subject: [PATCH] network-legacy/ifup: dhclient should be started in oneshot
mode
since we handle the retries explicitly via rd.net.dhcp.retry
Without -1 if user sets ip=dhcp6 and there is no dhcp on the network,
dhclient seems to wait indefinitely, ignoring rd.net.timeout.dhcp
(cherry picked from commit 2181c80c91f05bfae5e50de2f502e363b0219bae)
Resolves: #1787620
---
modules.d/35network-legacy/ifup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index b4f5bf10..bfb57ad5 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -52,6 +52,7 @@ do_dhcp() {
dhclient "$@" \
${_timeout:+-timeout $_timeout} \
-q \
+ -1 \
-cf /etc/dhclient.conf \
-pf /tmp/dhclient.$netif.pid \
-lf /tmp/dhclient.$netif.lease \

26
SOURCES/0062.patch Normal file
View File

@ -0,0 +1,26 @@
From d20eb7b7b2a50f29ac02bd6b6d80113d495849ed Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Wed, 8 Jan 2020 16:20:29 +0100
Subject: [PATCH] network-legacy/ifup: fix typo when calling dhclient --timeout
(cherry picked from commit 212043f94dde1693d777e933945138747537f12f)
Resolves: #1787620
---
modules.d/35network-legacy/ifup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index bfb57ad5..16b950be 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -50,7 +50,7 @@ do_dhcp() {
while [ $_COUNT -lt $_DHCPRETRY ]; do
info "Starting dhcp for interface $netif"
dhclient "$@" \
- ${_timeout:+-timeout $_timeout} \
+ ${_timeout:+--timeout $_timeout} \
-q \
-1 \
-cf /etc/dhclient.conf \

31
SOURCES/0063.patch Normal file
View File

@ -0,0 +1,31 @@
From 46a8b8e9e7f150c2a17d4adeacb25ccf003ec425 Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Tue, 21 Jan 2020 17:57:31 -0500
Subject: [PATCH] network-legacy/ifup: nuke pid and lease files if dhclient
failed
Otherwise we won't retry dhclient again on that interface. In
FCOS/RHCOS, we want to bake in `ip=dhcp,dhcp6` so we automatically try
getting a DHCPv6 lease if DHCPv4 failed.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1793591
(cherry picked from commit d0de58f23252a9da4a8badd71777e7c8418fa4b7)
---
modules.d/35network-legacy/ifup.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index 16b950be..dd18d70b 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -62,6 +62,9 @@ do_dhcp() {
[ $_COUNT -lt $_DHCPRETRY ] && sleep 1
done
warn "dhcp for interface $netif failed"
+ # nuke those files since we failed; we might retry dhcp again if it's e.g.
+ # `ip=dhcp,dhcp6` and we check for the PID file at the top
+ rm -f /tmp/dhclient.$netif.{pid,lease}
return 1
}

39
SOURCES/0064.patch Normal file
View File

@ -0,0 +1,39 @@
From 86d48f5c45d2d2c19cb575fa377763c069e57b8a Mon Sep 17 00:00:00 2001
From: Ondrej Dubaj <odubaj@redhat.com>
Date: Thu, 29 Aug 2019 14:31:06 +0200
Subject: [PATCH] added debug-shell to initrd in systemd version >= 240
---
dracut.spec | 2 +-
modules.d/00systemd/module-setup.sh | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dracut.spec b/dracut.spec
index 92c7f7bf..0f7eb4bf 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -88,7 +88,7 @@ Recommends: hardlink
Recommends: pigz
Recommends: kpartx
Requires: util-linux >= 2.21
-Requires: systemd >= 219
+Requires: systemd >= 239-23
Requires: systemd-udev >= 219
Requires: procps-ng
%else
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh
index ed177826..e4a3f323 100755
--- a/modules.d/00systemd/module-setup.sh
+++ b/modules.d/00systemd/module-setup.sh
@@ -31,6 +31,10 @@ install() {
exit 1
fi
+ inst_multiple -o \
+ $systemdutildir/system-generators/systemd-debug-generator \
+ $systemdsystemunitdir/debug-shell.service
+
inst_multiple -o \
$systemdutildir/systemd \
$systemdutildir/systemd-coredump \

32
SOURCES/0065.patch Normal file
View File

@ -0,0 +1,32 @@
From 543b1cff3c84af062da4d27ba81a9d394f44e4b6 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 11 Feb 2020 14:14:20 +0100
Subject: [PATCH] dhclient-script: ipv6 uses different variables for
nameservers
new_domain_name_servers and new_domain_search is only provided vit IPv4
see: https://src.fedoraproject.org/rpms/dhcp/blob/HEAD/f/dhclient-script#_148
(cherry picked from commit 962310483f473dbc8d71d70ba464d273b9808d31)
Resolves: #1795276
---
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 fc6ed0a3..f1a60005 100755
--- a/modules.d/35network-legacy/dhclient-script.sh
+++ b/modules.d/35network-legacy/dhclient-script.sh
@@ -75,8 +75,8 @@ setup_interface() {
setup_interface6() {
domain=$new_domain_name
- search=$(printf -- "$new_domain_search")
- namesrv=$new_domain_name_servers
+ search=$(printf -- "$new_dhcp6_domain_search")
+ namesrv=$new_dhcp6_name_servers
hostname=$new_host_name
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
[ -n "$new_max_life" ] && lease_time=$new_max_life

36
SOURCES/0066.patch Normal file
View File

@ -0,0 +1,36 @@
From 3468310486d0da8d2a6c6bdcddc598b7b8ce5587 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 4 Feb 2020 14:18:01 +0100
Subject: [PATCH] Revert "wait for IPv6 RA if using none/static IPv6
assignment"
This reverts commit c603419030136570b5944dc4620f62d07b9e82bb.
wait_for_ipv6_dad_link is only called from dhclient script,
so the original intent "wait for IPv6 RA if using none/static IPv6 assignment"
does not seem to be correct.
Anyway, this brings an issue on isolated networks, where you don't
have any routes outside. dhclient-script hangs on this check
and after it times out, dhclient is able to set the address normally.
(cherry picked from commit 76f6566fd777e0ee20416061ecb795e8daef33e1)
Resolves: #1795276
---
modules.d/40network/net-lib.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index dcb53804..0f3ca6a8 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -655,7 +655,6 @@ wait_for_ipv6_dad_link() {
while [ $cnt -lt $timeout ]; do
[ -n "$(ip -6 addr show dev "$1" scope link)" ] \
&& [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
- && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
&& return 0
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
&& return 1

45
SOURCES/0067.patch Normal file
View File

@ -0,0 +1,45 @@
From 7b14ab060e50d0035e4c0b1979d49234aa8896b0 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 10 Feb 2020 14:03:30 +0100
Subject: [PATCH] 40network: bump rd.net.timeout.carrier to 10 seconds
On some devices kernel currently takes 5.2 seconds to detect carrier,
so let's make the default in dracut bit more sensible.
See also https://bugzilla.redhat.com/show_bug.cgi?id=1772010
(cherry picked from commit 579fbb9fc4205dc216b9642238739d898d2ed02d)
Resolves: #1798761
---
dracut.cmdline.7.asc | 2 +-
modules.d/40network/net-lib.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 3cee5a00..ab9a24ad 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -645,7 +645,7 @@ NFS
Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.
**rd.net.timeout.carrier=**__<seconds>__::
- Wait <seconds> until carrier is recognized. Default is 5 seconds.
+ Wait <seconds> until carrier is recognized. Default is 10 seconds.
CIFS
~~~
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 0f3ca6a8..6babcccf 100755
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -717,7 +717,7 @@ iface_has_carrier() {
interface="/sys/class/net/$interface"
[ -d "$interface" ] || return 2
local timeout="$(getargs rd.net.timeout.carrier=)"
- timeout=${timeout:-5}
+ timeout=${timeout:-10}
timeout=$(($timeout*10))
linkup "$1"

37
SOURCES/0068.patch Normal file
View File

@ -0,0 +1,37 @@
From fa15223b70c04de0fdbd209a4bb1cb74876f7cfb Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Wed, 19 Feb 2020 11:11:32 -0500
Subject: [PATCH] network-legacy/ifup: drop redundant if-statement
No need to check that `$ret` is 0, we're already running inside an
if-statement block which checks this.
(cherry picked from commit 7795fde44c54bfe753cc07999a4c2f9dd7e2820d)
Resolves: #1807395
---
modules.d/35network-legacy/ifup.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index dd18d70b..eb7d2eb4 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -457,12 +457,10 @@ for p in $(getargs ip=); do
dhcp|on|any|dhcp6)
;;
*)
- if [ $ret -eq 0 ]; then
- setup_net $netif
- source_hook initqueue/online $netif
- if [ -z "$manualup" ]; then
- /sbin/netroot $netif
- fi
+ setup_net $netif
+ source_hook initqueue/online $netif
+ if [ -z "$manualup" ]; then
+ /sbin/netroot $netif
fi
;;
esac

59
SOURCES/0069.patch Normal file
View File

@ -0,0 +1,59 @@
From d6d50a239eebf9da13a0d7892df00a0e725ef9d6 Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Wed, 19 Feb 2020 10:44:24 -0500
Subject: [PATCH] network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic
Previously, we were doing `setup_net` from `ifup` for any setup that
wasn't DHCP, since those are already taken care of by `dhclient-script`.
The issue is that the case-statement we use to detect this doesn't catch
options like `ip=dhcp,dhcp6`.
Fix this by reworking the logic here to just check if a
`setup_net_$netif.sh` hook exists. If so, then we know that `setup_net`
will be called for this interface later.
This was causing issues in RHCOS which now ships with `ip=dhcp,dhcp6` to
support IPv6 environments[1]. The code here would make us do `setup_net`
pre-emptively which IIUC would then cause the initqueue to finish
earlier even if we had more udev netif events to process.
[1] https://github.com/coreos/coreos-assembler/pull/1067
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803926
(cherry picked from commit 4985aa8c6e89451996e659a39fec7646e9e25f76)
Cherry-picked from: 4985aa8c6e89451996e659a39fec7646e9e25f76
Resolves: #1807395
---
modules.d/35network-legacy/ifup.sh | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
index eb7d2eb4..61838741 100755
--- a/modules.d/35network-legacy/ifup.sh
+++ b/modules.d/35network-legacy/ifup.sh
@@ -453,17 +453,16 @@ for p in $(getargs ip=); do
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
fi
- case $autoconf in
- dhcp|on|any|dhcp6)
- ;;
- *)
+ # and finally, finish interface set up if there isn't already a script
+ # to do so (which is the case in the dhcp path)
+ if [ ! -e $hookdir/initqueue/setup_net_$netif.sh ]; then
setup_net $netif
source_hook initqueue/online $netif
if [ -z "$manualup" ]; then
/sbin/netroot $netif
fi
- ;;
- esac
+ fi
+
exit $ret
fi
done

38
SOURCES/0070.patch Normal file
View File

@ -0,0 +1,38 @@
From 07e7e84ebea1d76aeaa77d097b34503ec3c8f2e1 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 30 Oct 2019 19:25:51 +0100
Subject: [PATCH] network-manager: fix getting of ifname from the sysfs path
commit 5e0f8c8a4ced ('network-manager: remove useless use of basename')
somewhat carelessly didn't take into account that $_i has a slash at
the end which made the result of the ## substitution be just an empty
string.
The slash was put to the end of /sys/class/net/*/ to make sure we're only
iterating directories, but it's not strictly necessary. In an unlikely case
something else than a directory appears in /sys/class/net/, we'll already deal
with it gracefully. Remove it.
This fixes the TEST-30-ISCSI test.
(cherry picked from commit 687e17aa7f2f40d21717be9a04302c749e139d4a)
Resolves: #1826061
---
modules.d/35network-manager/nm-run.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index a539d5b2..b33e0992 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -6,7 +6,7 @@ else
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
fi
-for _i in /sys/class/net/*/
+for _i in /sys/class/net/*
do
state=/run/NetworkManager/devices/$(cat $_i/ifindex)
grep -q connection-uuid= $state 2>/dev/null || continue

47
SOURCES/0071.patch Normal file
View File

@ -0,0 +1,47 @@
From 02c096d138cc8c788daf5fae75408059cbc7e283 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Mon, 2 Dec 2019 02:19:51 +0100
Subject: [PATCH] network-manager: don't run NetworkManager when there are no
connections
NetworkManager would unnecessarily bring up the devices, colliding with
further attempts to rename the devices.
This is arguably a NetworkManager bug and should eventually be fixed there.
Running NetworkManager without the connection is unnecessary regardless.
(cherry picked from commit 5965710e018989b02a56e8d190b71740ca3b5463)
Resolves: #1826061
---
modules.d/35network-manager/nm-run.sh | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh
index b33e0992..4079b735 100755
--- a/modules.d/35network-manager/nm-run.sh
+++ b/modules.d/35network-manager/nm-run.sh
@@ -1,10 +1,17 @@
#!/bin/sh
-if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
- /usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
-else
- /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
-fi
+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
+ if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
+ /usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
+ else
+ /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
+ fi
+ break
+done
for _i in /sys/class/net/*
do

49
SOURCES/0072.patch Normal file
View File

@ -0,0 +1,49 @@
From b692dbc7f2c6a3fb4fa587d9d63b80e4626dafae 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
(cherry picked from commit 3dcaa97ca4dcfa8092252a22df62c60941e59ce3)
Resolves: #1826061
---
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

32
SOURCES/0073.patch Normal file
View File

@ -0,0 +1,32 @@
From 1ade0d247fda747ed33632a7746f9278b74feaa8 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
Cherry-picked from: 87bffc36e72c121024df033e1a78799456c73523
Resolves: #1826061
---
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.*"
}

33
SOURCES/0074.patch Normal file
View File

@ -0,0 +1,33 @@
From 0945c8070e436eef908a1f88c946df6c27d3bc41 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.
(cherry picked from commit faea4e4ddb10f697590b80f8f17181341c537262)
Resolves: #1826061
---
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)}

426
SOURCES/0075.patch Normal file
View File

@ -0,0 +1,426 @@
From cf74193cc37f2ace1197b1e6ebacc6fe542767c8 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.
(cherry picked from commit 49c4172f4eef6e2015615e132b199a7ec0699ffc)
Resolves: #1829528
---
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 ab9a24ad..0dc58d1a 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -187,9 +187,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 f71e757c..502c7568 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1220,50 +1220,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
@@ -1296,7 +1271,7 @@ make_trace()
echo "$prefix $msg"
msg_printed=1
fi
- $func $trace
+ show_memstats $trace
fi
shift
done
@@ -1318,9 +1293,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 e4f7cff1..2c0ccd66 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 c9ead01d..3578643c 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -35,7 +35,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

320
SOURCES/0076.patch Normal file
View File

@ -0,0 +1,320 @@
From adacd8101e7558930e4499c21006eaa14629c234 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.
(cherry picked from commit 7dd8a2f4d351ce8975c0af122732a2a12697c8cc)
Resolves: #1829528
---
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 0dc58d1a..7f31fbae 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -187,8 +187,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:
+
@@ -197,10 +197,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 0f7eb4bf..c82c24f6 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -84,6 +84,7 @@ Requires: xz
Requires: gzip
%if 0%{?fedora} || 0%{?rhel}
+Recommends: memstrack
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
@@ -399,6 +400,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 502c7568..56dd63ef 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1220,7 +1220,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
+}

35
SOURCES/0077.patch Normal file
View File

@ -0,0 +1,35 @@
From 8b3033c92a073f9e63074ffcdb1af6e69d99105c Mon Sep 17 00:00:00 2001
From: Attila Bruncsak <bruncsak@users.noreply.github.com>
Date: Fri, 14 Dec 2018 15:57:33 +0100
Subject: [PATCH] the strip command should avoid changing the file modification
time
(cherry picked from commit 7e944c77c0e05f2cc28e11227b465525c5131772)
Resolves: #1776659
---
dracut.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index f270af76..223261d6 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1663,14 +1663,14 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
dinfo "*** Stripping files ***"
find "$initdir" -type f \
-executable -not -path '*/lib/modules/*.ko' -print0 \
- | xargs -r -0 $strip_cmd -g 2>/dev/null
+ | xargs -r -0 $strip_cmd -g -p 2>/dev/null
# strip kernel modules, but do not touch signed modules
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
| while read -r -d $'\0' f || [ -n "$f" ]; do
SIG=$(tail -c 28 "$f" | tr -d '\000')
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
- done | xargs -r -0 $strip_cmd -g
+ done | xargs -r -0 $strip_cmd -g -p
dinfo "*** Stripping files done ***"
fi

108
SOURCES/0078.patch Normal file
View File

@ -0,0 +1,108 @@
From cbebaacfd05c55fddd11b3090983a2be1d2b48d3 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 17 Jul 2019 17:10:36 +0800
Subject: [PATCH] dracut.sh: Adjust squash and strip order
Previously with squash module, some binaries will be reinstalled, but
stripping happens before that so new installed binaries is not stripped.
So adjust the squash and strip order, ensure new installed binaries are
stripped just the same way with the old binaries.
Also split squash into two stage to make the split easier, move the
squash temp dir into initdir so stripping will cover that too,
and print more usefule message.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 6a74c03b4a8472fb090015b32e652edfeadb5a10)
Resolves: #1776659
---
dracut.sh | 43 +++++++++++++++++++++++++------------------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 223261d6..310646e3 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1659,21 +1659,6 @@ for d in $(ldconfig_paths); do
rmdir -p --ignore-fail-on-non-empty "$initdir/$d" >/dev/null 2>&1
done
-if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
- dinfo "*** Stripping files ***"
- find "$initdir" -type f \
- -executable -not -path '*/lib/modules/*.ko' -print0 \
- | xargs -r -0 $strip_cmd -g -p 2>/dev/null
-
- # strip kernel modules, but do not touch signed modules
- find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
- | while read -r -d $'\0' f || [ -n "$f" ]; do
- SIG=$(tail -c 28 "$f" | tr -d '\000')
- [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
- done | xargs -r -0 $strip_cmd -g -p
-
- dinfo "*** Stripping files done ***"
-fi
if [[ $early_microcode = yes ]]; then
dinfo "*** Generating early-microcode cpio image ***"
ucode_dir=(amd-ucode intel-ucode)
@@ -1745,9 +1730,8 @@ if [[ $hostonly_cmdline == "yes" ]] ; then
fi
fi
-dinfo "*** Creating image file '$outfile' ***"
-
if dracut_module_included "squash"; then
+ dinfo "*** Install squash loader ***"
if ! check_kernel_config CONFIG_SQUASHFS; then
dfatal "CONFIG_SQUASHFS have to be enabled for dracut squash module to work"
exit 1
@@ -1761,7 +1745,7 @@ if dracut_module_included "squash"; then
exit 1
fi
- readonly squash_dir="${DRACUT_TMPDIR}/squashfs"
+ readonly squash_dir="$initdir/squash/root"
readonly squash_img=$initdir/squash/root.img
# Currently only move "usr" "etc" to squashdir
@@ -1854,15 +1838,38 @@ if dracut_module_included "squash"; then
fi
done
done
+fi
+if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
+ dinfo "*** Stripping files ***"
+ find "$initdir" -type f \
+ -executable -not -path '*/lib/modules/*.ko' -print0 \
+ | xargs -r -0 $strip_cmd -g -p 2>/dev/null
+
+ # strip kernel modules, but do not touch signed modules
+ find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
+ | while read -r -d $'\0' f || [ -n "$f" ]; do
+ SIG=$(tail -c 28 "$f" | tr -d '\000')
+ [[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
+ done | xargs -r -0 $strip_cmd -g -p
+ dinfo "*** Stripping files done ***"
+fi
+
+if dracut_module_included "squash"; then
+ dinfo "*** Squashing the files inside the initramfs ***"
mksquashfs $squash_dir $squash_img -comp xz -b 64K -Xdict-size 100% &> /dev/null
if [[ $? != 0 ]]; then
dfatal "dracut: Failed making squash image"
exit 1
fi
+
+ rm -rf $squash_dir
+ dinfo "*** Squashing the files inside the initramfs done ***"
fi
+dinfo "*** Creating image file '$outfile' ***"
+
if [[ $uefi = yes ]]; then
readonly uefi_outdir="$DRACUT_TMPDIR/uefi"
mkdir "$uefi_outdir"

30
SOURCES/0079.patch Normal file
View File

@ -0,0 +1,30 @@
From b36c1ff083499c2cf1d1dbb7fe1663a2dd0683cc Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Wed, 25 Sep 2019 13:47:40 +0800
Subject: [PATCH] Fine tune mksquashfs options for squash module
Drop some unneeded metadata in the squash image, and print the error
message if something went wrong.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 89bc1aa324bcdda3723247218a697171c5a3de6f)
Resolves: #1776659
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 310646e3..487add57 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1857,7 +1857,7 @@ fi
if dracut_module_included "squash"; then
dinfo "*** Squashing the files inside the initramfs ***"
- mksquashfs $squash_dir $squash_img -comp xz -b 64K -Xdict-size 100% &> /dev/null
+ mksquashfs $squash_dir $squash_img -no-xattrs -no-exports -noappend -always-use-fragments -comp xz -Xdict-size 100% -no-progress 1> /dev/null
if [[ $? != 0 ]]; then
dfatal "dracut: Failed making squash image"

93
SOURCES/0080.patch Normal file
View File

@ -0,0 +1,93 @@
From 90d96c4f6a44d895f8999da8c4721a04612e6379 Mon Sep 17 00:00:00 2001
From: Kairui Song <kasong@redhat.com>
Date: Tue, 29 Oct 2019 16:29:14 +0800
Subject: [PATCH] 90kernel-modules: don't install any block driver if not
needed
If hostonly mode is in use, and there isn't any block device included
as hostonly device, then the initramfs won't need any block driver.
Eg. for kdump built image, there could be only one nfs mount point,
or the initramfs may only execute some network operation then reboot.
In such case, skip block driver installation to save space and time.
Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit f4ad2e5c8964b6c7b50420299a0096bade6a40bd)
Resolves: #1776659
---
modules.d/90kernel-modules/module-setup.sh | 32 +++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 3dfceff0..c91ba10c 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -2,6 +2,8 @@
# called by dracut
installkernel() {
+ local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
+
find_kernel_modules_external () {
local _OLDIFS
local external_pattern="^/"
@@ -16,11 +18,25 @@ installkernel() {
done < "$srcmods/modules.dep"
IFS=$_OLDIFS
}
- local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
+
+ is_block_dev() {
+ [ -e /sys/dev/block/$1 ] && return 0
+ return 1
+ }
+
+ install_block_modules () {
+ hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix
+ instmods \
+ scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
+ =ide nvme vmd nfit \
+ virtio_blk
+
+ dracut_instmods -o -s "${_blockfuncs}" "=drivers"
+ }
if [[ -z $drivers ]]; then
hostonly='' instmods \
- sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
+ hid_generic unix \
ehci-hcd ehci-pci ehci-platform \
ohci-hcd ohci-pci \
uhci-hcd \
@@ -38,10 +54,10 @@ installkernel() {
${NULL}
instmods \
- yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
+ yenta_socket \
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
- virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
- "=drivers/pcmcia" =ide nvme vmd nfit
+ virtio virtio_ring virtio_pci virtio_scsi \
+ "=drivers/pcmcia"
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
# arm/aarch64 specific modules
@@ -72,10 +88,12 @@ installkernel() {
${NULL}
fi
- dracut_instmods -o -s "${_blockfuncs}" "=drivers"
-
find_kernel_modules_external | instmods
+ if ! [[ $hostonly ]] || for_each_host_dev_and_slaves is_block_dev; then
+ install_block_modules
+ fi
+
# if not on hostonly mode, install all known filesystems,
# if the required list is not set via the filesystems variable
if ! [[ $hostonly ]]; then

63
SOURCES/0081.patch Normal file
View File

@ -0,0 +1,63 @@
From 9eb855e073c077966a011146484b9b9596857361 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>
(cherry picked from commit 872eb69936bd849eec6d1974dd6569f23a7ad3db)
Resolves: #1811977
---
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 7f31fbae..4a7c2517 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -829,6 +829,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

33
SOURCES/0082.patch Normal file
View File

@ -0,0 +1,33 @@
From 4f43dd89a1f9c21f66d6b460c0ad1b271ee40492 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Mon, 25 May 2020 11:59:31 +0200
Subject: [PATCH] Revert "[RHEL] network: default to network-legacy even in
presence of nm-initrd-generator"
This reverts commit 7843bc52777683f6a4ef953d8dde7171ff3b911c.
This will cause that NM will be used in initrd on systems where it is installed.
Resolves: #1839706
---
modules.d/40network/module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index bf252eb7..8e2a74a3 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -8,9 +8,9 @@ check() {
# called by dracut
depends() {
echo -n "kernel-network-modules "
- # RHEL 8.1: Default to network-legacy unless the user chose
- # network-manager manually
- if ! dracut_module_included "network-manager" ; then
+ if ! dracut_module_included "network-legacy" && [ -x "/usr/libexec/nm-initrd-generator" ] ; then
+ echo "network-manager"
+ else
echo "network-legacy"
fi
return 0

37
SOURCES/0083.patch Normal file
View File

@ -0,0 +1,37 @@
From 34ef33adfbb0b44ba6143f4ced206f948d814f86 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>
(cherry picked from commit 424f01e2a0ac0b329e68eb63048cf0d6d9c74d37)
Resolves: #1829528
---
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

42
SOURCES/0084.patch Normal file
View File

@ -0,0 +1,42 @@
From f47136bada397328d0a6f36a81138699c793fe92 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>
(cherry picked from commit 2a611328652388b809a379403ceec126cb55819f)
Resolves: #1829528
---
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 2c0ccd66..a5633936 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

72
SOURCES/0085.patch Normal file
View File

@ -0,0 +1,72 @@
From 689454c727c2730b6aa89ee4c4b7676900e07f78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Fri, 12 Apr 2019 16:26:59 +0200
Subject: [PATCH] Do not require non-empty kernel cmdline
When booting with Fedora-Server-dvd-x86_64-30-20190411.n.0.iso,
/proc/cmdline is empty (libvirt, qemu host with bios, not sure if that
matters), after installation to disk, anaconda would "crash" in kernel-core
%posttrans, after calling kernel-install, because dracut would fail
with
> Could not determine the kernel command line parameters.
> Please specify the kernel command line in /etc/kernel/cmdline!
I guess it's legitimate, even if unusual, to have no cmdline parameters.
Two changes are done in this patch:
1. do not fail if the cmdline is empty.
2. if /usr/lib/kernel/cmdline or /etc/kernel/cmdline are present, but
empty, ignore /proc/cmdline. If there's explicit configuration to
have empty cmdline, don't ignore it.
(cherry picked from commit 38b4f4b21c3c6107d7a562fcb432237464440b91)
Resolves: #1746069
---
50-dracut.install | 4 +---
51-dracut-rescue.install | 10 +---------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/50-dracut.install b/50-dracut.install
index 139ff82e..b897db84 100755
--- a/50-dracut.install
+++ b/50-dracut.install
@@ -35,9 +35,7 @@ case "$COMMAND" in
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
- fi
-
- if ! [[ ${BOOT_OPTIONS[*]} ]]; then
+ else
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
fi
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
index 0580062f..5ac34ef3 100755
--- a/51-dracut-rescue.install
+++ b/51-dracut-rescue.install
@@ -47,9 +47,7 @@ if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
-fi
-
-if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
+else
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
@@ -57,12 +55,6 @@ if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
done
fi
-if ! [[ ${BOOT_OPTIONS[*]} ]]; then
- echo "Could not determine the kernel command line parameters." >&2
- echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
- exit 1
-fi
-
if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}

79
SOURCES/0086.patch Normal file
View File

@ -0,0 +1,79 @@
From fc05c818dd862de2b6771dabe242bc9d26aa2160 Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Thu, 11 Jun 2020 11:29:41 +0200
Subject: [PATCH] Adapt to the new udevadm version output
See https://bugzilla.redhat.com/show_bug.cgi?id=1804252.
RHEL-only
Resolves: #1846034
---
dracut-init.sh | 2 +-
modules.d/01fips/fips.sh | 2 +-
modules.d/99base/dracut-lib.sh | 4 ++--
modules.d/99base/init.sh | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index ab07cabf..032c38c2 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -444,7 +444,7 @@ inst_rules_wildcard() {
}
prepare_udev_rules() {
- [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
+ [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
for f in "$@"; do
f="${initdir}/etc/udev/rules.d/$f"
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
index 559952ca..03da6861 100755
--- a/modules.d/01fips/fips.sh
+++ b/modules.d/01fips/fips.sh
@@ -27,7 +27,7 @@ mount_boot()
if ! [ -e "$boot" ]; then
udevadm trigger --action=add >/dev/null 2>&1
- [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
+ [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
i=0
while ! [ -e $boot ]; do
if [ $UDEVVERSION -ge 143 ]; then
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 56dd63ef..96dd55ad 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -531,7 +531,7 @@ incol2() {
}
udevsettle() {
- [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
+ [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$hookdir/initqueue/work $settle_exit_if_exists
@@ -541,7 +541,7 @@ udevsettle() {
}
udevproperty() {
- [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
+ [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
if [ $UDEVVERSION -ge 143 ]; then
for i in "$@"; do udevadm control --property=$i; done
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index a5633936..732a7f46 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -92,7 +92,7 @@ fi
trap "emergency_shell Signal caught!" 0
-export UDEVVERSION=$(udevadm --version)
+export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
if [ $UDEVVERSION -gt 166 ]; then
# newer versions of udev use /run/udev/rules.d
export UDEVRULESD=/run/udev/rules.d

82
SOURCES/0087.patch Normal file
View File

@ -0,0 +1,82 @@
From 3067edf07449e1dbc2dae0776da9426274b34cba 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.
(cherry picked from commit 6e1e87cd2567801b10b2b4f716436c48688408bf)
Resolves: #1847518
---
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
+}

33
SOURCES/0088.patch Normal file
View File

@ -0,0 +1,33 @@
From 7143750cf2e37f9c14ec47a8170b9186136874d7 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.
(cherry picked from commit 5c3d0a96473ac339fa2d1b25213b8f301c1cfd0d)
Resolves: #1847518
---
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

@ -5,7 +5,7 @@
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release 60.git20191129
%define dist_free_release 89.git20200625
Name: dracut
Version: 049
@ -87,6 +87,35 @@ Patch56: 0056.patch
Patch57: 0057.patch
Patch58: 0058.patch
Patch59: 0059.patch
Patch60: 0060.patch
Patch61: 0061.patch
Patch62: 0062.patch
Patch63: 0063.patch
Patch64: 0064.patch
Patch65: 0065.patch
Patch66: 0066.patch
Patch67: 0067.patch
Patch68: 0068.patch
Patch69: 0069.patch
Patch70: 0070.patch
Patch71: 0071.patch
Patch72: 0072.patch
Patch73: 0073.patch
Patch74: 0074.patch
Patch75: 0075.patch
Patch76: 0076.patch
Patch77: 0077.patch
Patch78: 0078.patch
Patch79: 0079.patch
Patch80: 0080.patch
Patch81: 0081.patch
Patch82: 0082.patch
Patch83: 0083.patch
Patch84: 0084.patch
Patch85: 0085.patch
Patch86: 0086.patch
Patch87: 0087.patch
Patch88: 0088.patch
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
@ -144,11 +173,12 @@ Requires: xz
Requires: gzip
%if 0%{?fedora} || 0%{?rhel}
Recommends: memstrack
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd >= 239-23
Requires: systemd-udev >= 219
Requires: procps-ng
%else
@ -459,6 +489,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
@ -540,6 +571,55 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
%endif
%changelog
* Thu Jun 25 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-89.git20200625
- Adapt to the new udevadm version output
- network-manager: move connection generation to a lib file
- cms: regenerate NetworkManager connections
* Tue Jun 02 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-86.git20200602
- Do not require non-empty kernel cmdline
* Wed May 27 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-85.git20200527
- 99memstrack: hook script should not call exit
- Remove cleanup_trace_mem calls
* Mon May 25 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-83.git20200525
- Remove memtrace-ko and rd.memdebug=4 support in dracut
- Add 99memstrack module
- the strip command should avoid changing the file modification
- dracut.sh: Adjust squash and strip order
- Fine tune mksquashfs options for squash module
- 90kernel-modules: don't install any block driver if not
- 95znet: Add a rd.znet_ifname= option
- Revert "[RHEL] network: default to network-legacy even in
* Wed Apr 22 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-75.git20200422
- network-manager: fix getting of ifname from the sysfs path
- network-manager: don't run NetworkManager when there are no
- network-manager: ensure that nm-run.sh is executed when
- network-manager: install libnss DNS and mDNS plugins
- Always pull in machinery to read ifcfg files
* Fri Feb 28 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-70.git20200228
- network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic
* Tue Feb 11 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-68.git20200211
- Revert "wait for IPv6 RA if using none/static IPv6 assignment"
- dhclient-script: ipv6 uses different variables for nameservers
- 40network: bump rd.net.timeout.carrier to 10 seconds
* Wed Feb 05 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-65.git20200205
- added debug-shell to initrd
* Thu Jan 23 2020 Harald Hoyer <harald@redhat.com> - 049-64.git20200123
- network-legacy/ifup: nuke pid and lease files if dhclient failed
Resolves: rhbz#1787620
* Tue Jan 14 2020 Lukas Nykryn <lnykryn@redhat.com> - 049-63.git20200114
- network-legacy/ifup: fix typo when calling dhclient --timeout
- network-legacy/ifup: dhclient should be started in oneshot mode
- modules/network-manager: Install `ip`
* Fri Nov 29 2019 Lukas Nykryn <lnykryn@redhat.com> - 049-60.git20191129
- 99squash: Only start the cleaner on switch-root
- net-lib: check if addr exists before checking for dad state