From 21b5626ea20b791b7fc36b10decd7f2be2e21613 Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 26 May 2022 06:44:19 -0400 Subject: [PATCH] Auto sync2gitlab import of dracut-049-201.git20220131.el8.src.rpm --- .gitignore | 1 + 0001.patch | 53 ++ 0002.patch | 28 + 0003.patch | 44 + 0004.patch | 34 + 0005.patch | 34 + 0006.patch | 46 + 0007.patch | 41 + 0008.patch | 38 + 0009.patch | 30 + 0010.patch | 26 + 0011.patch | 40 + 0012.patch | 86 ++ 0013.patch | 51 ++ 0014.patch | 49 ++ 0015.patch | 24 + 0016.patch | 86 ++ 0017.patch | 22 + 0018.patch | 49 ++ 0019.patch | 71 ++ 0020.patch | 94 +++ 0021.patch | 94 +++ 0022.patch | 36 + 0023.patch | 34 + 0024.patch | 36 + 0025.patch | 26 + 0026.patch | 38 + 0027.patch | 25 + 0028.patch | 98 +++ 0029.patch | 79 ++ 0030.patch | 24 + 0031.patch | 43 + 0032.patch | 66 ++ 0033.patch | 346 ++++++++ 0034.patch | 229 +++++ 0035.patch | 27 + 0036.patch | 27 + 0037.patch | 53 ++ 0038.patch | 31 + 0039.patch | 24 + 0040.patch | 24 + 0041.patch | 30 + 0042.patch | 43 + 0043.patch | 620 ++++++++++++++ 0044.patch | 53 ++ 0045.patch | 83 ++ 0046.patch | 37 + 0047.patch | 115 +++ 0048.patch | 43 + 0049.patch | 23 + 0050.patch | 23 + 0051.patch | 19 + 0052.patch | 33 + 0053.patch | 32 + 0054.patch | 33 + 0055.patch | 26 + 0056.patch | 34 + 0057.patch | 25 + 0058.patch | 44 + 0059.patch | 58 ++ 0060.patch | 31 + 0061.patch | 31 + 0062.patch | 26 + 0063.patch | 31 + 0064.patch | 39 + 0065.patch | 32 + 0066.patch | 36 + 0067.patch | 45 + 0068.patch | 37 + 0069.patch | 59 ++ 0070.patch | 38 + 0071.patch | 47 ++ 0072.patch | 49 ++ 0073.patch | 32 + 0074.patch | 33 + 0075.patch | 426 ++++++++++ 0076.patch | 320 +++++++ 0077.patch | 35 + 0078.patch | 108 +++ 0079.patch | 30 + 0080.patch | 93 ++ 0081.patch | 63 ++ 0082.patch | 33 + 0083.patch | 37 + 0084.patch | 42 + 0085.patch | 72 ++ 0086.patch | 79 ++ 0087.patch | 82 ++ 0088.patch | 34 + 0089.patch | 25 + 0090.patch | 79 ++ 0091.patch | 50 ++ 0092.patch | 55 ++ 0093.patch | 43 + 0094.patch | 28 + 0095.patch | 31 + 0096.patch | 167 ++++ 0097.patch | 104 +++ 0098.patch | 66 ++ 0099.patch | 43 + 0100.patch | 33 + 0101.patch | 29 + 0102.patch | 25 + 0103.patch | 26 + 0104.patch | 29 + 0105.patch | 25 + 0106.patch | 30 + 0107.patch | 32 + 0108.patch | 225 +++++ 0109.patch | 26 + 0110.patch | 39 + 0111.patch | 39 + 0112.patch | 34 + 0113.patch | 37 + 0114.patch | 27 + 0115.patch | 47 ++ 0116.patch | 29 + 0117.patch | 39 + 0118.patch | 36 + 0119.patch | 27 + 0120.patch | 87 ++ 0121.patch | 42 + 0122.patch | 252 ++++++ 0123.patch | 71 ++ 0124.patch | 161 ++++ 0125.patch | 28 + 0126.patch | 30 + 0127.patch | 100 +++ 0128.patch | 35 + 0129.patch | 26 + 0130.patch | 46 + 0131.patch | 31 + 0132.patch | 30 + 0133.patch | 27 + 0134.patch | 43 + 0135.patch | 116 +++ 0136.patch | 60 ++ 0137.patch | 26 + 0138.patch | 33 + 0139.patch | 74 ++ 0140.patch | 36 + 0141.patch | 52 ++ 0142.patch | 36 + 0143.patch | 89 ++ 0144.patch | 48 ++ 0145.patch | 43 + 0146.patch | 63 ++ 0147.patch | 170 ++++ 0148.patch | 35 + 0149.patch | 32 + 0150.patch | 55 ++ 0151.patch | 24 + 0152.patch | 75 ++ 0153.patch | 33 + 0154.patch | 36 + 0155.patch | 56 ++ 0156.patch | 159 ++++ 0157.patch | 141 ++++ 0158.patch | 58 ++ 0159.patch | 35 + 0160.patch | 29 + 0161.patch | 42 + 0162.patch | 154 ++++ 0163.patch | 23 + 0164.patch | 30 + 0165.patch | 30 + 0166.patch | 28 + 0167.patch | 154 ++++ 0168.patch | 37 + 0169.patch | 52 ++ 0170.patch | 64 ++ 0171.patch | 78 ++ 0172.patch | 67 ++ 0173.patch | 53 ++ 0174.patch | 286 +++++++ 0175.patch | 80 ++ 0176.patch | 51 ++ 0177.patch | 31 + 0178.patch | 16 + 0179.patch | 64 ++ 0180.patch | 36 + 0181.patch | 32 + 0182.patch | 85 ++ 0183.patch | 35 + 0184.patch | 76 ++ 0185.patch | 67 ++ 0186.patch | 143 ++++ 0187.patch | 31 + 0188.patch | 32 + 0189.patch | 41 + 0190.patch | 59 ++ 0191.patch | 243 ++++++ 0192.patch | 78 ++ 0193.patch | 57 ++ 0194.patch | 24 + 0195.patch | 27 + 0196.patch | 68 ++ 0197.patch | 54 ++ 0198.patch | 34 + 0199.patch | 37 + 0200.patch | 84 ++ EMPTY | 1 - dracut.spec | 2287 ++++++++++++++++++++++++++++++++++++++++++++++++++ lgpl-2.1.txt | 502 +++++++++++ sources | 1 + 205 files changed, 15322 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 0001.patch create mode 100644 0002.patch create mode 100644 0003.patch create mode 100644 0004.patch create mode 100644 0005.patch create mode 100644 0006.patch create mode 100644 0007.patch create mode 100644 0008.patch create mode 100644 0009.patch create mode 100644 0010.patch create mode 100644 0011.patch create mode 100644 0012.patch create mode 100644 0013.patch create mode 100644 0014.patch create mode 100644 0015.patch create mode 100644 0016.patch create mode 100644 0017.patch create mode 100644 0018.patch create mode 100644 0019.patch create mode 100644 0020.patch create mode 100644 0021.patch create mode 100644 0022.patch create mode 100644 0023.patch create mode 100644 0024.patch create mode 100644 0025.patch create mode 100644 0026.patch create mode 100644 0027.patch create mode 100644 0028.patch create mode 100644 0029.patch create mode 100644 0030.patch create mode 100644 0031.patch create mode 100644 0032.patch create mode 100644 0033.patch create mode 100644 0034.patch create mode 100644 0035.patch create mode 100644 0036.patch create mode 100644 0037.patch create mode 100644 0038.patch create mode 100644 0039.patch create mode 100644 0040.patch create mode 100644 0041.patch create mode 100644 0042.patch create mode 100644 0043.patch create mode 100644 0044.patch create mode 100644 0045.patch create mode 100644 0046.patch create mode 100644 0047.patch create mode 100644 0048.patch create mode 100644 0049.patch create mode 100644 0050.patch create mode 100644 0051.patch create mode 100644 0052.patch create mode 100644 0053.patch create mode 100644 0054.patch create mode 100644 0055.patch create mode 100644 0056.patch create mode 100644 0057.patch create mode 100644 0058.patch create mode 100644 0059.patch create mode 100644 0060.patch create mode 100644 0061.patch create mode 100644 0062.patch create mode 100644 0063.patch create mode 100644 0064.patch create mode 100644 0065.patch create mode 100644 0066.patch create mode 100644 0067.patch create mode 100644 0068.patch create mode 100644 0069.patch create mode 100644 0070.patch create mode 100644 0071.patch create mode 100644 0072.patch create mode 100644 0073.patch create mode 100644 0074.patch create mode 100644 0075.patch create mode 100644 0076.patch create mode 100644 0077.patch create mode 100644 0078.patch create mode 100644 0079.patch create mode 100644 0080.patch create mode 100644 0081.patch create mode 100644 0082.patch create mode 100644 0083.patch create mode 100644 0084.patch create mode 100644 0085.patch create mode 100644 0086.patch create mode 100644 0087.patch create mode 100644 0088.patch create mode 100644 0089.patch create mode 100644 0090.patch create mode 100644 0091.patch create mode 100644 0092.patch create mode 100644 0093.patch create mode 100644 0094.patch create mode 100644 0095.patch create mode 100644 0096.patch create mode 100644 0097.patch create mode 100644 0098.patch create mode 100644 0099.patch create mode 100644 0100.patch create mode 100644 0101.patch create mode 100644 0102.patch create mode 100644 0103.patch create mode 100644 0104.patch create mode 100644 0105.patch create mode 100644 0106.patch create mode 100644 0107.patch create mode 100644 0108.patch create mode 100644 0109.patch create mode 100644 0110.patch create mode 100644 0111.patch create mode 100644 0112.patch create mode 100644 0113.patch create mode 100644 0114.patch create mode 100644 0115.patch create mode 100644 0116.patch create mode 100644 0117.patch create mode 100644 0118.patch create mode 100644 0119.patch create mode 100644 0120.patch create mode 100644 0121.patch create mode 100644 0122.patch create mode 100644 0123.patch create mode 100644 0124.patch create mode 100644 0125.patch create mode 100644 0126.patch create mode 100644 0127.patch create mode 100644 0128.patch create mode 100644 0129.patch create mode 100644 0130.patch create mode 100644 0131.patch create mode 100644 0132.patch create mode 100644 0133.patch create mode 100644 0134.patch create mode 100644 0135.patch create mode 100644 0136.patch create mode 100644 0137.patch create mode 100644 0138.patch create mode 100644 0139.patch create mode 100644 0140.patch create mode 100644 0141.patch create mode 100644 0142.patch create mode 100644 0143.patch create mode 100644 0144.patch create mode 100644 0145.patch create mode 100644 0146.patch create mode 100644 0147.patch create mode 100644 0148.patch create mode 100644 0149.patch create mode 100644 0150.patch create mode 100644 0151.patch create mode 100644 0152.patch create mode 100644 0153.patch create mode 100644 0154.patch create mode 100644 0155.patch create mode 100644 0156.patch create mode 100644 0157.patch create mode 100644 0158.patch create mode 100644 0159.patch create mode 100644 0160.patch create mode 100644 0161.patch create mode 100644 0162.patch create mode 100644 0163.patch create mode 100644 0164.patch create mode 100644 0165.patch create mode 100644 0166.patch create mode 100644 0167.patch create mode 100644 0168.patch create mode 100644 0169.patch create mode 100644 0170.patch create mode 100644 0171.patch create mode 100644 0172.patch create mode 100644 0173.patch create mode 100644 0174.patch create mode 100644 0175.patch create mode 100644 0176.patch create mode 100644 0177.patch create mode 100644 0178.patch create mode 100644 0179.patch create mode 100644 0180.patch create mode 100644 0181.patch create mode 100644 0182.patch create mode 100644 0183.patch create mode 100644 0184.patch create mode 100644 0185.patch create mode 100644 0186.patch create mode 100644 0187.patch create mode 100644 0188.patch create mode 100644 0189.patch create mode 100644 0190.patch create mode 100644 0191.patch create mode 100644 0192.patch create mode 100644 0193.patch create mode 100644 0194.patch create mode 100644 0195.patch create mode 100644 0196.patch create mode 100644 0197.patch create mode 100644 0198.patch create mode 100644 0199.patch create mode 100644 0200.patch delete mode 100644 EMPTY create mode 100644 dracut.spec create mode 100644 lgpl-2.1.txt create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..829ef7b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/dracut-049.tar.xz diff --git a/0001.patch b/0001.patch new file mode 100644 index 0000000..909aec1 --- /dev/null +++ b/0001.patch @@ -0,0 +1,53 @@ +From 3cb0f01a1e8a05dd4c6412907f5e9a398b2ace2c Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 31 Aug 2018 13:06:34 +0200 +Subject: [PATCH] Revert "use cp --reflink=auto" + +This reverts commit 8cd8820547257299a33b2d1e3ecf7c6241a569b2. +Resolves: #1623990 +--- + 50-dracut.install | 2 +- + 51-dracut-rescue-postinst.sh | 2 +- + 51-dracut-rescue.install | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/50-dracut.install b/50-dracut.install +index 64e3549f..ec59dcb3 100755 +--- a/50-dracut.install ++++ b/50-dracut.install +@@ -25,7 +25,7 @@ case "$COMMAND" in + if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then + # we found an initrd at the same place as the kernel + # use this and don't generate a new one +- cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \ ++ cp "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \ + && chown root:root "$BOOT_DIR_ABS/$INITRD" \ + && chmod 0600 "$BOOT_DIR_ABS/$INITRD" \ + && exit 0 +diff --git a/51-dracut-rescue-postinst.sh b/51-dracut-rescue-postinst.sh +index 67f5b717..23158552 100755 +--- a/51-dracut-rescue-postinst.sh ++++ b/51-dracut-rescue-postinst.sh +@@ -57,7 +57,7 @@ if [[ ! -f $INITRDFILE ]]; then + fi + + if [[ ! -f $NEW_KERNEL_IMAGE ]]; then +- cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE" ++ cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE" + ((ret+=$?)) + fi + +diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install +index 6ddafdb6..426ddee5 100755 +--- a/51-dracut-rescue.install ++++ b/51-dracut-rescue.install +@@ -93,7 +93,7 @@ case "$COMMAND" in + + [[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS" + +- if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then ++ if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then + echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2 + fi + + diff --git a/0002.patch b/0002.patch new file mode 100644 index 0000000..0d63bf8 --- /dev/null +++ b/0002.patch @@ -0,0 +1,28 @@ +From 2e5265c80e03112c75888a31c170963e913070ed Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 14 Aug 2018 14:04:02 +0200 +Subject: [PATCH] spec: return old provides + +--- + dracut.spec | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dracut.spec b/dracut.spec +index 155868ce..553280c3 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -65,6 +65,13 @@ Provides: dracut-fips = %{version}-%{release} + Obsoletes: dracut-fips-aesni <= 047 + Provides: dracut-fips-aesni = %{version}-%{release} + ++Obsoletes: dracut-kernel < 005 ++Provides: dracut-kernel = %{version}-%{release} ++ ++Obsoletes: dracut < 030 ++Obsoletes: dracut-norescue < 030 ++Provides: dracut-norescue = %{version}-%{release} ++ + Requires: bash >= 4 + Requires: coreutils + Requires: cpio + diff --git a/0003.patch b/0003.patch new file mode 100644 index 0000000..c385522 --- /dev/null +++ b/0003.patch @@ -0,0 +1,44 @@ +From 44c9d019d88df05f69f2112aeae34bdbff61cee6 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Sat, 29 Sep 2018 17:14:31 +0800 +Subject: [PATCH] dracut.spec: Fix error introduced by 70291ed + +70291e0 ('dracut.spec: Add dracut-squash package') introduced a new +dracut-squash package, but by accident it overrided some other package +spec and the dependency name is wrong. This patch will fix it. +--- + dracut.spec | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 553280c3..de57703c 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -188,7 +188,7 @@ This package contains tools to assemble the local initrd and host configuration. + %package squash + Summary: dracut module to build an initramfs with most files in a squashfs image + Requires: %{name} = %{version}-%{release} +-Requires: squash-tools ++Requires: squashfs-tools + + %description squash + This package provides a dracut module to build an initramfs, but store most files +@@ -459,14 +459,14 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne + %doc %{_mandir}/man8/dracut-catimages.8* + %endif + +-%files squash +-%{dracutlibdir}/modules.d/99squash +- + %{_bindir}/dracut-catimages + %dir /boot/dracut + %dir /var/lib/dracut + %dir /var/lib/dracut/overlay + ++%files squash ++%{dracutlibdir}/modules.d/99squash ++ + %files config-generic + %{dracutlibdir}/dracut.conf.d/02-generic-image.conf + + diff --git a/0004.patch b/0004.patch new file mode 100644 index 0000000..3aff94b --- /dev/null +++ b/0004.patch @@ -0,0 +1,34 @@ +From 3b9b20d237b3ec939b1bf9dd065c875fee54fe63 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Fri, 12 Oct 2018 13:07:13 +0800 +Subject: [PATCH] 40network: Don't include 40network by default + +commit 7347391 ('network-legacy: split off from network module') +splitted network function to network-legacy and removed check() function +of 40network. This caused 40network to be included even if network is +not needed. + +Signed-off-by: Kairui Song + +Cherry-picked from: 83cbc06ab91288e2d931b4f36935bfdb79a99b0e +Resolves: #1639088 +--- + modules.d/40network/module-setup.sh | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index 57c0a45e..e8541636 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -1,5 +1,10 @@ + #!/bin/bash + ++# called by dracut ++check() { ++ return 255 ++} ++ + # called by dracut + depends() { + echo -n "kernel-network-modules " + diff --git a/0005.patch b/0005.patch new file mode 100644 index 0000000..1ff4258 --- /dev/null +++ b/0005.patch @@ -0,0 +1,34 @@ +From b63e0c5040d9881f8c3c0bc09fc21c6588c8a26f Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 18 Oct 2018 17:05:22 +0800 +Subject: [PATCH] 99squash: Don't clean up squahfs on isolate + +The only time we need to cleanup squahfs manually is on switch root, to +release resource and memory. We've covered that by setting +"Conflicts=initrd-switch-root.target" for squash cleanup service. +On shutdown systemd will take care of squahfs mounts. But for other +isolate, files in initramfs are most likely still required, so don't +clean up squahfs. For example, kdump's emergency handler will isolate +into its own target, if squahfs is cleaned up it will fail. + +Signed-off-by: Kairui Song + +Cherry-picked from: b9af0fcd +Resolves: #1641423 +--- + modules.d/99squash/squash-mnt-clear.service | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service +index 8dd17812..f8d5db46 100644 +--- a/modules.d/99squash/squash-mnt-clear.service ++++ b/modules.d/99squash/squash-mnt-clear.service +@@ -9,6 +9,7 @@ After=dracut-initqueue.service dracut-pre-pivot.service + Before=initrd-cleanup.service + ConditionPathExists=/squash/root + Conflicts=initrd-switch-root.target ++IgnoreOnIsolate=true + + [Service] + Type=oneshot + diff --git a/0006.patch b/0006.patch new file mode 100644 index 0000000..e03762e --- /dev/null +++ b/0006.patch @@ -0,0 +1,46 @@ +From 5541b0c46f02f678c698aa523db7a86dde82a947 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 25 Oct 2018 15:30:36 +0200 +Subject: [PATCH] dracut.install: call dracut with --force + +The kernel-install is called even if you run make install. +Since we don't call dracut with -f a second make install will fail +because initrd with same version is already there. +This makes kernel developers feel miserable. + +https://bugzilla.redhat.com/show_bug.cgi?id=1642402 + +Cherry-picked from: 48c283a2 +Resolves: #1642402 +--- + 50-dracut.install | 2 +- + 51-dracut-rescue.install | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/50-dracut.install b/50-dracut.install +index ec59dcb3..139ff82e 100755 +--- a/50-dracut.install ++++ b/50-dracut.install +@@ -49,7 +49,7 @@ case "$COMMAND" in + break + fi + done +- dracut ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" ++ dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" + ret=$? + ;; + remove) +diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install +index 426ddee5..0580062f 100755 +--- a/51-dracut-rescue.install ++++ b/51-dracut-rescue.install +@@ -98,7 +98,7 @@ case "$COMMAND" in + fi + + if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then +- dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" ++ dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION" + ((ret+=$?)) + fi + + diff --git a/0007.patch b/0007.patch new file mode 100644 index 0000000..ac24ddf --- /dev/null +++ b/0007.patch @@ -0,0 +1,41 @@ +From d8386b5d8fae2e45a27635c48ecab63abba10e39 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 24 Oct 2018 15:14:03 +0200 +Subject: [PATCH] Makefile: add srpm target + +--- + Makefile | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 80623437..503d069f 100644 +--- a/Makefile ++++ b/Makefile +@@ -40,7 +40,7 @@ man8pages = dracut.8 \ + + manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages) + +-.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh ++.PHONY: install clean archive rpm srpm testimage test all check AUTHORS doc dracut-version.sh + + all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio + +@@ -216,6 +216,17 @@ rpm: dracut-$(VERSION).tar.xz syncheck + --define "_rpmdir $$PWD" -ba dracut.spec; ) && \ + ( mv "$$rpmbuild"/{,$$(arch)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm ) + ++srpm: dracut-$(VERSION).tar.xz syncheck ++ rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \ ++ cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \ ++ LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \ ++ (cd "$$rpmbuild"; \ ++ [ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \ ++ rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \ ++ --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \ ++ --define "_rpmdir $$PWD" -bs dracut.spec; ) && \ ++ ( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm ) ++ + syncheck: + @ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \ + [ "$${i##*/}" = "module-setup.sh" ] && continue; \ + diff --git a/0008.patch b/0008.patch new file mode 100644 index 0000000..003e514 --- /dev/null +++ b/0008.patch @@ -0,0 +1,38 @@ +From 90054e4f1f2f64cb9a2b06b44b5a82b293c387dd Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 10 Jan 2019 18:08:32 +0100 +Subject: [PATCH] 95iscsi: decouple iscsi from sysinit.target + +--- + modules.d/95iscsi/module-setup.sh | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index 5c2073bb..ae1924cc 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -265,6 +265,23 @@ install() { + echo "After=dracut-cmdline.service" + echo "Before=dracut-initqueue.service" + ) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" ++ ++ # The iscsi deamon does not need to wait for any storage inside initrd ++ mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.socket.d" ++ ( ++ echo "[Unit]" ++ echo "DefaultDependencies=no" ++ echo "Conflicts=shutdown.target" ++ echo "Before=shutdown.target sockets.target" ++ ) > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf" ++ mkdir -p "${initdir}/$systemdsystemunitdir/iscsuio.socket.d" ++ ( ++ echo "[Unit]" ++ echo "DefaultDependencies=no" ++ echo "Conflicts=shutdown.target" ++ echo "Before=shutdown.target sockets.target" ++ ) > "${initdir}/$systemdsystemunitdir/iscsuio.socket.d/dracut.conf" ++ + fi + inst_dir /var/lib/iscsi + dracut_need_initqueue + diff --git a/0009.patch b/0009.patch new file mode 100644 index 0000000..c93daeb --- /dev/null +++ b/0009.patch @@ -0,0 +1,30 @@ +From e44c26f0fc6b29fb42cbc6d5ab57e34b07aa2ce1 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 15 Jan 2019 16:42:38 +0100 +Subject: [PATCH] 95iscsi: fix a typo in a name of iscsiuio + +--- + modules.d/95iscsi/module-setup.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index ae1924cc..79af4a47 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -274,13 +274,13 @@ install() { + echo "Conflicts=shutdown.target" + echo "Before=shutdown.target sockets.target" + ) > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf" +- mkdir -p "${initdir}/$systemdsystemunitdir/iscsuio.socket.d" ++ mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d" + ( + echo "[Unit]" + echo "DefaultDependencies=no" + echo "Conflicts=shutdown.target" + echo "Before=shutdown.target sockets.target" +- ) > "${initdir}/$systemdsystemunitdir/iscsuio.socket.d/dracut.conf" ++ ) > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf" + + fi + inst_dir /var/lib/iscsi + diff --git a/0010.patch b/0010.patch new file mode 100644 index 0000000..59fca50 --- /dev/null +++ b/0010.patch @@ -0,0 +1,26 @@ +From c787ad30ab5467c9f3c740a1cd7ed8b3198b9719 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 21 May 2019 17:58:38 +0200 +Subject: [PATCH] net-lib: strstr is not for globs + +(cherry picked from commit 1a3dcc8b46c967445794e679280a3fb3b8e77ae0) + +Resolves: #1712469 +--- + 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 1e7f1b33..7b93f25e 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -463,7 +463,7 @@ ip_to_var() { + # ip= means anaconda-style static config argument cluster + autoconf="$1" + +- if strstr "$autoconf" "*.*.*.*"; then ++ if strglob "$autoconf" "*.*.*.*"; then + # ip= means anaconda-style static config argument cluster: + # ip= gateway= netmask= hostname= mtu= + # ksdevice={link|bootif|ibft||} + diff --git a/0011.patch b/0011.patch new file mode 100644 index 0000000..190a00d --- /dev/null +++ b/0011.patch @@ -0,0 +1,40 @@ +From 81b59fbbd6ebeee05b5d6869ae4f36bb9e486f72 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 8 Jan 2019 17:16:07 +0100 +Subject: [PATCH] 95iscsi: rd.iscsi.initiator should have priority over stored + configuration + +(cherry picked from commit 61afc704548cecc7f7d2fa3b5f1319e790cc5bee) + +Resolves: #1664062 +--- + modules.d/95iscsi/parse-iscsiroot.sh | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh +index 7a64d888..f00a83bb 100755 +--- a/modules.d/95iscsi/parse-iscsiroot.sh ++++ b/modules.d/95iscsi/parse-iscsiroot.sh +@@ -107,14 +107,13 @@ if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [ + iscsi_initiator=$arg + echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi + ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi +- if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then +- mkdir -p /etc/iscsi +- ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi +- if [ -n "$DRACUT_SYSTEMD" ]; then +- systemctl try-restart iscsid +- # FIXME: iscsid is not yet ready, when the service is :-/ +- sleep 1 +- fi ++ rm -f /etc/iscsi/initiatorname.iscsi ++ mkdir -p /etc/iscsi ++ ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi ++ if [ -n "$DRACUT_SYSTEMD" ]; then ++ systemctl try-restart iscsid ++ # FIXME: iscsid is not yet ready, when the service is :-/ ++ sleep 1 + fi + fi + + diff --git a/0012.patch b/0012.patch new file mode 100644 index 0000000..92e1758 --- /dev/null +++ b/0012.patch @@ -0,0 +1,86 @@ +From 9c54932f590fd7accadc780c6ee946a94286b7e6 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 14 May 2019 09:23:55 +0200 +Subject: [PATCH] fips: split loading the crypto modules and checking the + kernel + +In e54ab383 we moved the fips script to a later pahse of boot, since +the /boot might not be available early on. + +The problem is that systemd-cryptsetup* services could be run now +started before the do_fips is executed and need the crypto modules +to decrypted the devices. + +So let's split the do_fips and load the module before udev does the +trigger. +--- + modules.d/01fips/fips-load-crypto.sh | 8 ++++++++ + modules.d/01fips/fips.sh | 19 +++++++++++-------- + modules.d/01fips/module-setup.sh | 1 + + 3 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/modules.d/01fips/fips-load-crypto.sh b/modules.d/01fips/fips-load-crypto.sh +new file mode 100644 +index 00000000..82cbeee4 +--- /dev/null ++++ b/modules.d/01fips/fips-load-crypto.sh +@@ -0,0 +1,8 @@ ++#!/bin/sh ++ ++if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then ++ rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1 ++else ++ . /sbin/fips.sh ++ fips_load_crypto || die "FIPS integrity test failed" ++fi +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index 9bc089f2..beaa692b 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -69,15 +69,8 @@ do_rhevh_check() + return 0 + } + +-do_fips() ++fips_load_crypto() + { +- local _v +- local _s +- local _v +- local _module +- +- KERNEL=$(uname -r) +- + FIPSMODULES=$(cat /etc/fipsmodules) + + info "Loading and integrity checking all crypto modules" +@@ -102,6 +95,16 @@ do_fips() + info "Self testing crypto algorithms" + modprobe tcrypt || return 1 + rmmod tcrypt ++} ++ ++do_fips() ++{ ++ local _v ++ local _s ++ local _v ++ local _module ++ ++ KERNEL=$(uname -r) + + info "Checking integrity of kernel" + if [ -e "/run/initramfs/live/vmlinuz0" ]; then +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index f3af4d90..18186d62 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -54,6 +54,7 @@ install() { + local _dir + inst_hook pre-trigger 01 "$moddir/fips-boot.sh" + inst_hook pre-pivot 01 "$moddir/fips-noboot.sh" ++ inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh" + inst_script "$moddir/fips.sh" /sbin/fips.sh + + inst_multiple sha512hmac rmmod insmod mount uname umount + diff --git a/0013.patch b/0013.patch new file mode 100644 index 0000000..b15e070 --- /dev/null +++ b/0013.patch @@ -0,0 +1,51 @@ +From a1435c3d535707f1d21aaf85e62175ff2bb1ad2b Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 14 Mar 2019 18:54:10 +0800 +Subject: [PATCH] fips: ensure fs module for /boot is installed + +When using dracut with --hostonly and --no-hostonly-default-device, +/boot will be inaccessible as dracut will most fs modules unless +specified. But FIPS require /boot to be accessible, and it will try +to mount it on boot. It will fail if corresponding fs module is missing. + +For most case /boot will be a simple partition, include the fs module +will be enough for FIPS to mount it. For other cases users have to pass +extra parameters by themselves. + +Suggested-by: Kenneth Dsouza +Signed-off-by: Kairui Song +--- + modules.d/01fips/module-setup.sh | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 18186d62..89734a09 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -12,7 +12,7 @@ depends() { + + # called by dracut + installkernel() { +- local _fipsmodules _mod ++ local _fipsmodules _mod _bootfstype + if [[ -f "${srcmods}/modules.fips" ]]; then + _fipsmodules="$(cat "${srcmods}/modules.fips")" + else +@@ -47,6 +47,16 @@ installkernel() { + echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf" + fi + done ++ ++ # with hostonly_default_device fs module for /boot is not installed by default ++ if [[ $hostonly ]] && [[ "$hostonly_default_device" == "no" ]]; then ++ _bootfstype=$(find_mp_fstype /boot) ++ if [[ -n "$_bootfstype" ]]; then ++ hostonly='' instmods $_bootfstype ++ else ++ dwarning "Can't determine fs type for /boot, FIPS check may fail." ++ fi ++ fi + } + + # called by dracut + diff --git a/0014.patch b/0014.patch new file mode 100644 index 0000000..4247482 --- /dev/null +++ b/0014.patch @@ -0,0 +1,49 @@ +From 7c35556da4c803bbb08c96e96262e598d5c42274 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 21 Aug 2018 13:14:44 +0200 +Subject: [PATCH] network: skip already enslaved interfaces + +(cherry picked from commit f6e3b59e5ea6f52a25631557badc7f4dfabbd7ee) + +Resolves: #1625042 +--- + modules.d/35network-legacy/ifup.sh | 6 +++++- + modules.d/40network/net-lib.sh | 7 +++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh +index ea2a67ff..b4f5bf10 100755 +--- a/modules.d/35network-legacy/ifup.sh ++++ b/modules.d/35network-legacy/ifup.sh +@@ -408,7 +408,11 @@ for p in $(getargs ip=); do + esac + + # If this option isn't directed at our interface, skip it +- [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue ++ if [ -n "$dev" ]; then ++ [ "$dev" != "$netif" ] && continue ++ else ++ iface_is_enslaved "$netif" && continue ++ fi + + # Store config for later use + for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index 7b93f25e..f9569573 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -745,6 +745,13 @@ iface_has_link() { + iface_has_carrier "$@" + } + ++iface_is_enslaved() { ++ local _li ++ _li=$(ip -o link show dev $1) ++ strstr "$li" " master " || return 1 ++ return 0 ++} ++ + find_iface_with_link() { + local iface_path="" iface="" + for iface_path in /sys/class/net/*; do + diff --git a/0015.patch b/0015.patch new file mode 100644 index 0000000..f79f1e7 --- /dev/null +++ b/0015.patch @@ -0,0 +1,24 @@ +From 4971a2c4eb4526cb88a5c9aff30c57527a746036 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 16 Jul 2019 08:27:01 +0100 +Subject: [PATCH] 01fips: add cfb cipher + +Required by FIPS standard +--- + modules.d/01fips/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 89734a09..f011f15d 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -24,7 +24,7 @@ installkernel() { + _fipsmodules+="crc32c crct10dif ghash " + + # Ciphers: +- _fipsmodules+="cipher_null des3_ede aes " ++ _fipsmodules+="cipher_null des3_ede aes cfb " + + # Modes/templates: + _fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac " + diff --git a/0016.patch b/0016.patch new file mode 100644 index 0000000..57aed12 --- /dev/null +++ b/0016.patch @@ -0,0 +1,86 @@ +From 31116110ff0090324a568ce2aba6519a860d66b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Thu, 11 Jul 2019 10:50:40 +0200 +Subject: [PATCH] rngd: new module running early during boot to help generating + entropy when system's default entropy sources are poor (e.g. use of SSD disks + or UEFI RNG not available) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On systems with low entropy at boot, the boot can take up to several +hours, specially when NBDE is used (e.g. clevis) which makes use of +the random number generator. + +Enabling rngd service at boot early, because dracut-initqueue runs, +enables to initialize the random number generator in a couple of seconds +instead of minutes or hours. + +Signed-off-by: Renaud Métrich +(cherry picked from commit adee5b97bc5418b6e357342bb3be20568668aa55) + +Resolves: #1726617 +--- + modules.d/06rngd/module-setup.sh | 39 +++++++++++++++++++++++++++++++++++++++ + modules.d/06rngd/rngd.service | 7 +++++++ + 2 files changed, 46 insertions(+) + +diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh +new file mode 100644 +index 00000000..43d5c2d3 +--- /dev/null ++++ b/modules.d/06rngd/module-setup.sh +@@ -0,0 +1,39 @@ ++#!/bin/bash ++# vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80: ++# ++# Copyright (c) 2019 Red Hat, Inc. ++# Author: Renaud Métrich ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++depends() { ++ echo systemd ++ return 0 ++} ++ ++check() { ++ # if there's no rngd binary, no go. ++ require_binaries rngd || return 1 ++ ++ return 0 ++} ++ ++install() { ++ inst rngd ++ inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service" ++ mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants" ++ ln -rfs "${initdir}${systemdsystemunitdir}/rngd.service" \ ++ "${initdir}${systemdsystemunitdir}/sysinit.target.wants/rngd.service" ++} +diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service +new file mode 100644 +index 00000000..570fbedb +--- /dev/null ++++ b/modules.d/06rngd/rngd.service +@@ -0,0 +1,7 @@ ++[Unit] ++Description=Hardware RNG Entropy Gatherer Daemon ++DefaultDependencies=no ++Before=systemd-udevd.service ++ ++[Service] ++ExecStart=/usr/sbin/rngd -f + diff --git a/0017.patch b/0017.patch new file mode 100644 index 0000000..899efb3 --- /dev/null +++ b/0017.patch @@ -0,0 +1,22 @@ +From d86dfcd148e5d726f00b8a83eeadb11aa0017fba Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 22 Jul 2019 14:07:26 +0200 +Subject: [PATCH] dracut.spec: add 06rngd + +--- + dracut.spec | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.spec b/dracut.spec +index de57703c..92c7f7bf 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -346,6 +346,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne + %{dracutlibdir}/modules.d/03rescue + %{dracutlibdir}/modules.d/04watchdog + %{dracutlibdir}/modules.d/05busybox ++%{dracutlibdir}/modules.d/06rngd + %{dracutlibdir}/modules.d/10i18n + %{dracutlibdir}/modules.d/30convertfs + %{dracutlibdir}/modules.d/45url-lib + diff --git a/0018.patch b/0018.patch new file mode 100644 index 0000000..8e21561 --- /dev/null +++ b/0018.patch @@ -0,0 +1,49 @@ +From 927428e6a5e90b2214ee9edf15d4eb6c0fc5c203 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 11 Mar 2019 18:44:02 +0800 +Subject: [PATCH] squash: squash systemd binary and udevadm + +systemd binary and udevadm are not needed to be outside the squash +image. Some binaries are kept outside because they are required before +mounting the image, or after umounting the image (when switching root), +or they may block umounting the image. But we are using lazy umounting, +so actually nothing will block the umount. + +Keep more binaries outside the squash image won't hurt but cost extra +memories, the idea of squash image is to save memory usage. + +So, there is no reason to keep udevadm outside, that should be a debug +left over. For systemd binary, it's running when switch root happens, +But we have lazy umounted the image and overlay, once systemd process +exec the new systemd in new root, everything will be cleared by kernel. + +Also tidy up the comment make it less confussing. + +Signed-off-by: Kairui Song +(cherry picked from commit e1e1f6e8e6747d8f32c065e267e0a57587818c9e) + +Resolves: #1691705 +--- + dracut.sh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index e683a9bc..a0158f22 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1772,9 +1772,11 @@ if dracut_module_included "squash"; then + mv $initdir/$folder $squash_dir/$folder + done + +- # Reinstall required files, because we have moved some important folders to $squash_dir +- inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" \ +- "systemctl" "udevadm" "$systemdutildir/systemd" ++ # Reinstall required files for the squash image setup script. ++ # We have moved them inside the squashed image, but they need to be ++ # accessible before mounting the image. Also install systemctl, ++ # it's requires for switch-root, but we will umount the image before switch-root ++ inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" "systemctl" + hostonly="" instmods "loop" "squashfs" "overlay" + + for folder in "${squash_candidate[@]}"; do + diff --git a/0019.patch b/0019.patch new file mode 100644 index 0000000..6b7cac8 --- /dev/null +++ b/0019.patch @@ -0,0 +1,71 @@ +From b6d52b504fc7eefc3f405f75463d9e818471ee99 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 11 Mar 2019 19:46:19 +0800 +Subject: [PATCH] squash: fix and simplify required_in_root + +If required target is a symbol link, create the link then following the +link. If it's a directory, create new directory, else just move it. + +Signed-off-by: Kairui Song +(cherry picked from commit 11ce69e4bd9172cf54251ea62bb4a5ead1700fd6) + +Resolves: #1691705 +--- + dracut.sh | 42 +++++++++++++++++++----------------------- + 1 file changed, 19 insertions(+), 23 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index a0158f22..6de88b3e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1811,30 +1811,26 @@ if dracut_module_included "squash"; then + required_in_root $(dirname $file) + fi + +- if [[ -d $_sqsh_file ]]; then +- if [[ -L $_sqsh_file ]]; then +- cp --preserve=all -P $_sqsh_file $_init_file +- else +- mkdir $_init_file +- fi ++ if [[ -L $_sqsh_file ]]; then ++ cp --preserve=all -P $_sqsh_file $_init_file ++ _sqsh_file=$(realpath $_sqsh_file 2>/dev/null) ++ if [[ -e $_sqsh_file ]] && [[ "$_sqsh_file" == "$squash_dir"* ]]; then ++ # Relative symlink ++ required_in_root ${_sqsh_file#$squash_dir/} ++ return ++ fi ++ if [[ -e $squash_dir$_sqsh_file ]]; then ++ # Absolute symlink ++ required_in_root ${_sqsh_file#/} ++ return ++ fi ++ required_in_root ${module_spec#$squash_dir/} + else +- if [[ -L $_sqsh_file ]]; then +- cp --preserve=all -P $_sqsh_file $_init_file +- _sqsh_file=$(realpath $_sqsh_file 2>/dev/null) +- if [[ -e $_sqsh_file ]] && [[ "$_sqsh_file" == "$squash_dir"* ]]; then +- # Relative symlink +- required_in_root ${_sqsh_file#$squash_dir/} +- return +- fi +- if [[ -e $squash_dir$_sqsh_file ]]; then +- # Absolute symlink +- required_in_root ${_sqsh_file#/} +- return +- fi +- required_in_root ${module_spec#$squash_dir/} +- else +- mv $_sqsh_file $_init_file +- fi ++ if [[ -d $_sqsh_file ]]; then ++ mkdir $_init_file ++ else ++ mv $_sqsh_file $_init_file ++ fi + fi + } + + diff --git a/0020.patch b/0020.patch new file mode 100644 index 0000000..64dfdff --- /dev/null +++ b/0020.patch @@ -0,0 +1,94 @@ +From 829ed8ef5cca250fac475ad6b0265c792c3af015 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 13 Mar 2019 17:36:53 +0800 +Subject: [PATCH] squash: also squash systemctl if switch-root is not needed + +systemctl need to be accessible on switch-root, but we unmount the +squash image on switch-root, so it will fail. systemctl depends on a lot +of libraries, squash them can save more RAM. So allow modules +(eg. kdump) to tell dracut that switch-root will be intercepted, +then we don't need to take care of that. + +Signed-off-by: Kairui Song +(cherry picked from commit 3ee0ca5eb74be5d1fbd0e6d643f6fff06234177f) + +Resolves: #1691705 +--- + dracut-init.sh | 4 ++++ + dracut.sh | 40 ++++++++++++++++++++++------------------ + 2 files changed, 26 insertions(+), 18 deletions(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index 50d23e2d..b1ac9966 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -150,6 +150,10 @@ dracut_module_included() { + [[ " $mods_to_load $modules_loaded " == *\ $*\ * ]] + } + ++dracut_no_switch_root() { ++ >"$initdir/lib/dracut/no-switch-root" ++} ++ + if ! [[ $DRACUT_INSTALL ]]; then + DRACUT_INSTALL=$(find_binary dracut-install) + fi +diff --git a/dracut.sh b/dracut.sh +index 6de88b3e..8144a16e 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1772,24 +1772,6 @@ if dracut_module_included "squash"; then + mv $initdir/$folder $squash_dir/$folder + done + +- # Reinstall required files for the squash image setup script. +- # We have moved them inside the squashed image, but they need to be +- # accessible before mounting the image. Also install systemctl, +- # it's requires for switch-root, but we will umount the image before switch-root +- inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" "systemctl" +- hostonly="" instmods "loop" "squashfs" "overlay" +- +- for folder in "${squash_candidate[@]}"; do +- # Remove duplicated files in squashfs image, save some more space +- [[ ! -d $initdir/$folder/ ]] && continue +- for file in $(find $initdir/$folder/ -not -type d); +- do +- if [[ -e $squash_dir${file#$initdir} ]]; then +- mv $squash_dir${file#$initdir} $file +- fi +- done +- done +- + # Move some files out side of the squash image, including: + # - Files required to boot and mount the squashfs image + # - Files need to be accessable without mounting the squash image +@@ -1851,6 +1833,28 @@ if dracut_module_included "squash"; then + ln -s squash/init.sh $initdir/init + ln -s squash/shutdown.sh $initdir/shutdown + ++ # Reinstall required files for the squash image setup script. ++ # We have moved them inside the squashed image, but they need to be ++ # accessible before mounting the image. ++ inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" ++ hostonly="" instmods "loop" "squashfs" "overlay" ++ ++ # Only keep systemctl outsite if we need switch root ++ if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then ++ inst "systemctl" ++ fi ++ ++ for folder in "${squash_candidate[@]}"; do ++ # Remove duplicated files in squashfs image, save some more space ++ [[ ! -d $initdir/$folder/ ]] && continue ++ for file in $(find $initdir/$folder/ -not -type d); ++ do ++ if [[ -e $squash_dir${file#$initdir} ]]; then ++ mv $squash_dir${file#$initdir} $file ++ fi ++ done ++ done ++ + mksquashfs $squash_dir $squash_img -comp xz -b 64K -Xdict-size 100% &> /dev/null + + if [[ $? != 0 ]]; then + diff --git a/0021.patch b/0021.patch new file mode 100644 index 0000000..ed54a76 --- /dev/null +++ b/0021.patch @@ -0,0 +1,94 @@ +From 7ee74e539dba61c3765afe34426b085eff0de027 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 21 Feb 2019 13:18:37 +0800 +Subject: [PATCH] dracut: let module handling function accept optional path + option + +Let the caller pass in the module path instead of try to find the module +path everytime. This helps optimize the overall runtime. + +Test results (3 rounds) on Fedora 30 in KVM VM with 8 CPUs, 2G memory, HDD: + + $ time ./dracut.sh --local --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/fedora-root /sysroot xfs defaults' --no-hostonly-default-device -f initramfs.img + Before the commit: + real 0m11.782s | real 0m11.505s | real 0m11.958s + user 0m9.169s | user 0m9.218s | user 0m9.327s + sys 0m10.839s | sys 0m10.829s | sys 0m10.925s + + After this commit: + real 0m9.866s | real 0m9.580s | real 0m9.638s + user 0m9.048s | user 0m9.142s | user 0m9.120s + sys 0m7.411s | sys 0m7.775s | sys 0m7.745s + +Test result of building a ordinary image: + + $ time ./dracut.sh --local --quiet -f initramfs.img + Before the commit: + real 0m34.697s | real 0m34.371s | real 0m35.122s + user 0m27.608s | user 0m27.524s | user 0m27.705s + sys 0m22.341s | sys 0m22.032s | sys 0m22.246s + + After the commit: + real 0m31.914s | real 0m31.006 | real 0m31.289ss + user 0m27.315s | user 0m27.324 | user 0m27.290ss + sys 0m19.051s | sys 0m18.916 | sys 0m19.022ss + +This will have an ~2s speed up. + +Signed-off-by: Kairui Song +(cherry picked from commit 5916d31b24ad9eb21fd376929a96c459813315a1) + +Cherry-picked from: 5916d31b +Resolves: #1734047 +--- + dracut-init.sh | 4 ++++ + dracut.sh | 8 ++++---- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index b1ac9966..ab07cabf 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -154,6 +154,10 @@ dracut_no_switch_root() { + >"$initdir/lib/dracut/no-switch-root" + } + ++dracut_module_path() { ++ echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; } ++} ++ + if ! [[ $DRACUT_INSTALL ]]; then + DRACUT_INSTALL=$(find_binary dracut-install) + fi +diff --git a/dracut.sh b/dracut.sh +index 8144a16e..f270af76 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1373,7 +1373,7 @@ do_print_cmdline() + for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do + _d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]} + [[ ${_mods_to_print[$_d_mod]} ]] || continue +- module_cmdline "$_d_mod" ++ module_cmdline "$_d_mod" "$moddir" + done + unset moddir + } +@@ -1454,14 +1454,14 @@ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do + dinfo "*** Including module: $_d_mod ***" + fi + if [[ $kernel_only == yes ]]; then +- module_installkernel "$_d_mod" || { ++ module_installkernel "$_d_mod" "$moddir" || { + dfatal "installkernel failed in module $_d_mod" + exit 1 + } + else +- module_install "$_d_mod" ++ module_install "$_d_mod" "$moddir" + if [[ $no_kernel != yes ]]; then +- module_installkernel "$_d_mod" || { ++ module_installkernel "$_d_mod" "$moddir" || { + dfatal "installkernel failed in module $_d_mod" + exit 1 + } + diff --git a/0022.patch b/0022.patch new file mode 100644 index 0000000..4bcd5e4 --- /dev/null +++ b/0022.patch @@ -0,0 +1,36 @@ +From 17cd55169c3549d85ba3e4d7e0e81c496d1b2940 Mon Sep 17 00:00:00 2001 +From: Lianbo Jiang +Date: Mon, 13 May 2019 16:09:25 +0800 +Subject: [PATCH] 99base: enable the initqueue in both 'dracut --add-device' + and 'dracut --mount' cases. + +The commit 9f3c31cd8d68 ("99base: enable initqueue if extra devices are added") +only covers 'dracut --add-device' case, but it did not cover 'dracut --mount' +case, which causes the kdump failure in the Amazon virtual machine. + +Lets make sure that the initqueue is enabled in both cases in order to wake up +the device in time. + +Reported-by: Xiao Liang +Signed-off-by: Lianbo Jiang +(cherry picked from commit e0fc62f619ba55a96179382e22f7665e969c3d42) + +Resolves: #1678094 +--- + modules.d/99base/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 21523fc9..c9ead01d 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -93,7 +93,7 @@ install() { + + ## save host_devs which we need bring up + if [[ $hostonly_cmdline == "yes" ]]; then +- if [[ -n $add_device ]]; then ++ if [[ -n "${host_devs[@]}" ]]; then + dracut_need_initqueue + fi + if [[ -f "$initdir/lib/dracut/need-initqueue" ]] || ! dracut_module_included "systemd"; then + diff --git a/0023.patch b/0023.patch new file mode 100644 index 0000000..e0d31d5 --- /dev/null +++ b/0023.patch @@ -0,0 +1,34 @@ +From 1851348709df5413a767faecdee908534baf0da1 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 12 Jun 2019 14:27:44 +0800 +Subject: [PATCH] 95fcoe: load 'libfcoe' module as a fallback + +The kernel may only enable 'libfcoe' module. Some modules like bnx2fc +provides FCoE but only depend on 'libfcoe'. Loading 'fcoe' module may +fail but the kernel do support FCoE. + +'libfcoe' will be installed as a dependency when installing block device +drivers if it's required. So no need to install it in installkernel. + +Signed-off-by: Kairui Song +(cherry picked from commit 65fe1af2eca7d0ed340520577ab861fcd695b34a) + +Resolves: #1719645 +--- + modules.d/95fcoe/parse-fcoe.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index 75cca9a5..12701cdb 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -18,7 +18,7 @@ + # If it's not set we don't continue + [ -z "$fcoe" ] && return + +-[ -e /sys/bus/fcoe/ctlr_create ] || modprobe -b -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE" ++[ -e /sys/bus/fcoe/ctlr_create ] || modprobe -b -a fcoe || modprobe -b -a libfcoe || die "FCoE requested but kernel/initrd does not support FCoE" + + initqueue --onetime modprobe -b -q bnx2fc + + diff --git a/0024.patch b/0024.patch new file mode 100644 index 0000000..28b2e15 --- /dev/null +++ b/0024.patch @@ -0,0 +1,36 @@ +From 9b2497dffb8f699ce040cdbafa967f5fe02b57b6 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 2 Aug 2019 14:26:23 +0200 +Subject: [PATCH] 90kernel-modules-extra: don't resolve symlinks before instmod + +When you install a third-party driver, you will probably end in a +situation, where the module will be in a different directory and +in $depmod_module_dir you will only have symlink. If we resolve the +symlink before we pass the module path to instmod, the dracut-install +will only include the module with its original path, but not the +symlink. Hence the module can't be automatically loaded. + +Dracut-install is clever enough to handle symlinks and will include both +the symlink and the module to the initrd. + +(cherry picked from commit d1afff43aea01c8d43817adf3ac4041dd4b9f022) + +Resolves: #1720275 +--- + modules.d/90kernel-modules-extra/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/90kernel-modules-extra/module-setup.sh b/modules.d/90kernel-modules-extra/module-setup.sh +index c0a2b7f9..1706c822 100755 +--- a/modules.d/90kernel-modules-extra/module-setup.sh ++++ b/modules.d/90kernel-modules-extra/module-setup.sh +@@ -187,7 +187,7 @@ installkernel() + printf "^%s\.ko(\.gz|\.bz2|\.xz)?:\n" "${pathlist[@]}" \ + | (LANG=C grep -E -o -f - -- "$depmod_modules_dep" || exit 0) \ + | tr -d ':' \ +- | (cd "$depmod_module_dir" || exit; xargs -r realpath -e --) \ ++ | (cd "$depmod_module_dir" || exit; xargs -r realpath -se --) \ + | instmods || return 1 + + return 0 + diff --git a/0025.patch b/0025.patch new file mode 100644 index 0000000..664f9be --- /dev/null +++ b/0025.patch @@ -0,0 +1,26 @@ +From 3464297288b50a062e1094e57d46ad21e51b351b Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 6 Aug 2019 10:54:09 +0200 +Subject: [PATCH] net-lib: fix typo $li -> $_li + +(cherry picked from commit cd97d8d2c0646b95aee47efd5eee39f29d617a67) + +Resolves: #1625042 +--- + 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 f9569573..ad78d225 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -748,7 +748,7 @@ iface_has_link() { + iface_is_enslaved() { + local _li + _li=$(ip -o link show dev $1) +- strstr "$li" " master " || return 1 ++ strstr "$_li" " master " || return 1 + return 0 + } + + diff --git a/0026.patch b/0026.patch new file mode 100644 index 0000000..2c2c621 --- /dev/null +++ b/0026.patch @@ -0,0 +1,38 @@ +From 95bbcaa8550534f03b332487ef3a2ed6650424fe Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Wed, 21 Aug 2019 11:16:07 +0200 +Subject: [PATCH] git2spec: avoid malforming of SHA-1 hashes + +When a SHA-1 hash of a specific commit is used as a tag, the regex +shenanigans later in the script can (and will) corrupt it in certain +cases. + +e.g.: +$ perl -e ' +$tag="6e8cd92261577230daa1098f7e05ec198c3c4281"; +$tag=~s/[^0-9]+?([0-9]+)/$1/; +print("$tag\n"); +' +68cd92261577230daa1098f7e05ec198c3c4281 + +(Notice the missing 'e') + +Let's fix this by limiting the regex's scope to a non-SHA-1 tags only. +--- + git2spec.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/git2spec.pl b/git2spec.pl +index 7853791e..9ddc3805 100755 +--- a/git2spec.pl ++++ b/git2spec.pl +@@ -37,7 +37,7 @@ $tag=`git describe --abbrev=0 --tags` if not defined $tag; + chomp($tag); + my @patches=&create_patches($tag, $pdir); + my $num=$#patches + 2; +-$tag=~s/[^0-9]+?([0-9]+)/$1/; ++$tag=~s/[^0-9]+?([0-9]+)/$1/ if $tag !~ /\b[0-9a-f]{5,40}\b/; + my $release="$num.git$datestr"; + $release="1" if $num == 1; + + diff --git a/0027.patch b/0027.patch new file mode 100644 index 0000000..cf5627e --- /dev/null +++ b/0027.patch @@ -0,0 +1,25 @@ +From d3f542cc9d0135a408be7ba995b8adad80bcd606 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Wed, 21 Aug 2019 14:06:29 +0200 +Subject: [PATCH] travis: fetch only tags + +The original `git pull` would try to pull & merge changes from the +master branch, which breaks CI runs on PRs based on non-master branches +--- + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.travis.yml b/.travis.yml +index f913db57..efb0df1b 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -29,7 +29,7 @@ before_script: + sudo modprobe kvm-intel nested=1 || : + sudo modprobe kvm-amd nested=1 || : + dmesg | tail || : +- - git pull --depth=100 ++ - git fetch --tags --unshallow + - | + git describe --abbrev=0 --tags || : + git describe --tags || : + diff --git a/0028.patch b/0028.patch new file mode 100644 index 0000000..0203f97 --- /dev/null +++ b/0028.patch @@ -0,0 +1,98 @@ +From e3b2b02c7f5b4e9f1d2a3cfe8749534959e29e3e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 21 Jun 2019 18:39:48 +0200 +Subject: [PATCH] fs-lib: drop a bashism + +Bash 5 apparently longer propagates variable assignments to local variables +in front of function calls when in POSIX mode: + + [lkundrak@demiurge ~]$ cat feh.sh + print_VAR () { + echo "$VAR"; + } + + testfunc () { + local VAR="OLD" + VAR=NEW print_VAR + } + + testfunc + [lkundrak@demiurge ~]$ bash4 --posix feh.sh + NEW + [lkundrak@demiurge ~]$ bash5 --posix feh.sh + OLD + [lkundrak@demiurge ~]$ bash5 feh.sh + NEW + [lkundrak@demiurge ~]$ + +It works the way it did in Bash 4 in non-POSIX mode, for external programs, +or for non-local variables. Don't ask me why -- it's probably some +compatibility thing for some sad old people. + +However, this precisely happens when fsck_single() is calling into the +fsck_drv_com(), assigned to _drv by fsck_able(). That ruins the +TEST-70-BONDBRIDGETEAMVLAN test's server and probably more. + +Let's pass the fsck driver binary via the function argument instead. It's +less messy anyway. + +(cherry picked from commit 43c8c4ce0471abbb8c0fc4b8be2515cebc636030) +--- + modules.d/99fs-lib/fs-lib.sh | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh +index d39ca1b7..11e795d9 100755 +--- a/modules.d/99fs-lib/fs-lib.sh ++++ b/modules.d/99fs-lib/fs-lib.sh +@@ -44,22 +44,22 @@ fsck_able() { + ;; + ext?) + type e2fsck >/dev/null 2>&1 && +- _drv="_drv=e2fsck fsck_drv_com" && ++ _drv="fsck_drv_com e2fsck" && + return 0 + ;; + f2fs) + type fsck.f2fs >/dev/null 2>&1 && +- _drv="_drv=fsck.f2fs fsck_drv_com" && ++ _drv="fsck_drv_com fsck.f2fs" && + return 0 + ;; + jfs) + type jfs_fsck >/dev/null 2>&1 && +- _drv="_drv=jfs_fsck fsck_drv_com" && ++ _drv="fsck_drv_com jfs_fsck" && + return 0 + ;; + reiserfs) + type reiserfsck >/dev/null 2>&1 && +- _drv="_drv=reiserfsck fsck_drv_com" && ++ _drv="fsck_drv_com reiserfsck" && + return 0 + ;; + btrfs) +@@ -70,12 +70,12 @@ fsck_able() { + ;; + nfs*) + # nfs can be a nop, returning success +- _drv="_drv=none :" && ++ _drv=":" && + return 0 + ;; + *) + type fsck >/dev/null 2>&1 && +- _drv="_drv=fsck fsck_drv_std" && ++ _drv="fsck_drv_std fsck" && + return 0 + ;; + esac +@@ -97,6 +97,7 @@ fsck_drv_btrfs() { + + # common code for checkers that follow usual subset of options and return codes + fsck_drv_com() { ++ local _drv="$1" + local _ret + local _out + + diff --git a/0029.patch b/0029.patch new file mode 100644 index 0000000..b80d988 --- /dev/null +++ b/0029.patch @@ -0,0 +1,79 @@ +From e671c3a06a7e58461d4e9c9f3546cf6eac809300 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 4 Dec 2018 10:27:17 +0100 +Subject: [PATCH] 95iscsi/module-setup.sh: do not require 'hostname' anymore + +(cherry picked from commit ebe1821635dd99f07c817179ee5358d27aab53c5) + +[lkundrak@v3.sk: fixes TEST-30 that fails with: dracut: dracut module +'iscsi' will not be installed, because command 'hostname' could not be +found!] +--- + modules.d/40network/netroot.sh | 2 +- + modules.d/95iscsi/module-setup.sh | 4 ++-- + modules.d/98dracut-systemd/dracut-cmdline.sh | 2 +- + modules.d/99base/init.sh | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/modules.d/40network/netroot.sh b/modules.d/40network/netroot.sh +index 207364cd..654cfc72 100755 +--- a/modules.d/40network/netroot.sh ++++ b/modules.d/40network/netroot.sh +@@ -66,7 +66,7 @@ if [ -z "$2" ]; then + + # Check: do we really know how to handle (net)root? + [ -z "$root" ] && die "No or empty root= argument" +- [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" ++ [ -z "$rootok" ] && die "X2 Don't know how to handle 'root=$root'" + + handler=${netroot%%:*} + handler=${handler%%4} +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index 79af4a47..f6f3520d 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -4,7 +4,7 @@ + check() { + local _rootdev + # If our prerequisites are not met, fail anyways. +- require_binaries hostname iscsi-iname iscsiadm iscsid || return 1 ++ require_binaries iscsi-iname iscsiadm iscsid || return 1 + + # If hostonly was requested, fail the check if we are not actually + # booting from root. +@@ -206,7 +206,7 @@ cmdline() { + install() { + inst_multiple -o iscsiuio + inst_libdir_file 'libgcc_s.so*' +- inst_multiple umount hostname iscsi-iname iscsiadm iscsid ++ inst_multiple umount iscsi-iname iscsiadm iscsid + + inst_multiple -o \ + $systemdsystemunitdir/iscsid.socket \ +diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh +index bff9435a..89c52d13 100755 +--- a/modules.d/98dracut-systemd/dracut-cmdline.sh ++++ b/modules.d/98dracut-systemd/dracut-cmdline.sh +@@ -76,7 +76,7 @@ case "${root}${root_unset}" in + esac + + [ -z "${root}${root_unset}" ] && die "Empty root= argument" +-[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" ++[ -z "$rootok" ] && die "X1 Don't know how to handle 'root=$root'" + + export root rflags fstype netroot NEWROOT + +diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh +index e4f7cff1..3e20069f 100755 +--- a/modules.d/99base/init.sh ++++ b/modules.d/99base/init.sh +@@ -136,7 +136,7 @@ getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Br + source_hook cmdline + + [ -z "$root" ] && die "No or empty root= argument" +-[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" ++[ -z "$rootok" ] && die "X0 Don't know how to handle 'root=$root'" + + export root rflags fstype netroot NEWROOT + + diff --git a/0030.patch b/0030.patch new file mode 100644 index 0000000..f0a13c5 --- /dev/null +++ b/0030.patch @@ -0,0 +1,24 @@ +From 50192de38d756203a414405e2d7552e89b1c0423 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 4 Dec 2018 10:06:12 +0100 +Subject: [PATCH] test/test-functions: correctly move server.log + +(cherry picked from commit 712f471ebfae70fd71c0c740e9a3e120464ca7e7) +--- + test/test-functions | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/test-functions b/test/test-functions +index a6254ec7..51b3df80 100644 +--- a/test/test-functions ++++ b/test/test-functions +@@ -80,7 +80,7 @@ while (($# > 0)); do + ret=$? + test_cleanup + if ((ret!=0)) && [[ -f "$TESTDIR"/server.log ]]; then +- mv [[ -f "$TESTDIR"/server.log ]] ./server${TEST_RUN_ID:+-$TEST_RUN_ID}.log ++ mv "$TESTDIR"/server.log ./server${TEST_RUN_ID:+-$TEST_RUN_ID}.log + fi + rm -fr -- "$TESTDIR" + rm -f -- .testdir${TEST_RUN_ID:+-$TEST_RUN_ID} + diff --git a/0031.patch b/0031.patch new file mode 100644 index 0000000..b0741b9 --- /dev/null +++ b/0031.patch @@ -0,0 +1,43 @@ +From bf69beb6f3824b1ebed221c8255d1f5c9efd136a Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 26 Jun 2019 16:42:04 +0200 +Subject: [PATCH] test/TEST-17-LVM-THIN: fail setup if we run out of space in + the thin pool + +This condition is rather difficult to detect -- the writes will just remain +queued and get lost on shutdown, resulting in a corrupt filesystem. + +(cherry picked from commit 91c15babdf0215df59325f3086acfdf0ba247bfa) +--- + test/TEST-17-LVM-THIN/create-root.sh | 5 +++-- + test/TEST-17-LVM-THIN/test.sh | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/test/TEST-17-LVM-THIN/create-root.sh b/test/TEST-17-LVM-THIN/create-root.sh +index 117d1341..0e52f879 100755 +--- a/test/TEST-17-LVM-THIN/create-root.sh ++++ b/test/TEST-17-LVM-THIN/create-root.sh +@@ -27,6 +27,7 @@ cp -a -t /sysroot /source/* && \ + umount /sysroot && \ + sleep 1 && \ + lvm lvchange -a n /dev/dracut/root && \ +-sleep 1 && \ +-echo "dracut-root-block-created" >/dev/sda1 ++sleep 1 ++dmsetup status |grep out_of_data_space || \ ++ echo "dracut-root-block-created" >/dev/sda1 + poweroff -f +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index af349246..1b36a216 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -56,7 +56,7 @@ test_setup() { + ( + export initdir=$TESTDIR/overlay + . $basedir/dracut-init.sh +- inst_multiple sfdisk mke2fs poweroff cp umount ++ inst_multiple sfdisk mke2fs poweroff cp umount grep dmsetup + inst_hook initqueue 01 ./create-root.sh + inst_hook initqueue/finished 01 ./finished-false.sh + inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules + diff --git a/0032.patch b/0032.patch new file mode 100644 index 0000000..b849baf --- /dev/null +++ b/0032.patch @@ -0,0 +1,66 @@ +From 0f0b8c8f90cbcd56140e85b9997deda906c71118 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 25 Jun 2019 17:39:57 +0200 +Subject: [PATCH] test/TEST-14-IMSM: detect failure to compose the test setup + root + +The dracut-root-block-created line should not be created if we fail to copy +in the required files to sysroot. Let's turn on -e to trap failures and +poweroff on them, like some other tests do. + +Also remove the &&. Not only it is unnecessary with -e, but defeats it. +From bash(1): + + The shell does not exit if the command that fails is [...] part of any + command executed in a && or || list except the command following the + final && or || [...] + +(cherry picked from commit c27ed38bb2986d31b08257782ce2b24a80415c6c) +--- + test/TEST-14-IMSM/create-root.sh | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/test/TEST-14-IMSM/create-root.sh b/test/TEST-14-IMSM/create-root.sh +index f637ec88..a0324c6f 100755 +--- a/test/TEST-14-IMSM/create-root.sh ++++ b/test/TEST-14-IMSM/create-root.sh +@@ -1,4 +1,7 @@ + #!/bin/sh ++ ++trap 'poweroff -f' EXIT ++ + # don't let udev and this script step on eachother's toes + for x in 61-dmraid-imsm.rules 64-md-raid.rules 65-md-incremental-imsm.rules 65-md-incremental.rules 64-lvm.rules 70-mdadm.rules 99-mount-rules; do + rm -f -- "/etc/udev/rules.d/$x" +@@ -55,20 +58,20 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 \ + # wait for the array to finish initailizing, otherwise this sometimes fails + # randomly. + mdadm -W /dev/md0 ++set -e + lvm pvcreate -ff -y /dev/md0 +-lvm vgcreate dracut /dev/md0 && \ +-lvm lvcreate -l 100%FREE -n root dracut && \ +-lvm vgchange -ay && \ +-mke2fs -L root /dev/dracut/root && \ +-mkdir -p /sysroot && \ +-mount /dev/dracut/root /sysroot && \ +-cp -a -t /sysroot /source/* && \ +-umount /sysroot && \ +-lvm lvchange -a n /dev/dracut/root && \ ++lvm vgcreate dracut /dev/md0 ++lvm lvcreate -l 100%FREE -n root dracut ++lvm vgchange -ay ++mke2fs -L root /dev/dracut/root ++mkdir -p /sysroot ++mount /dev/dracut/root /sysroot ++cp -a -t /sysroot /source/* ++umount /sysroot ++lvm lvchange -a n /dev/dracut/root + udevadm settle + mdadm --detail --export /dev/md0 |grep -F MD_UUID > /tmp/mduuid + . /tmp/mduuid + echo "MD_UUID=$MD_UUID" + { echo "dracut-root-block-created"; echo MD_UUID=$MD_UUID;} > /dev/sda + mdadm --wait-clean /dev/md0 +-poweroff -f + diff --git a/0033.patch b/0033.patch new file mode 100644 index 0000000..e45f147 --- /dev/null +++ b/0033.patch @@ -0,0 +1,346 @@ +From e35e43c1c28a8935660fe72650614e5dc1defb65 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 26 Jun 2019 11:47:21 +0200 +Subject: [PATCH] test: tell systemd to reboot on fatal errors + +Otherwise systemd would freeze execution, causing the test to time out +instead of failing fast. + +(cherry picked from commit 7934c6f918de2e82d0df5da557c5792c4fb7b798) +--- + test/TEST-01-BASIC/test.sh | 2 +- + test/TEST-02-SYSTEMD/test.sh | 2 +- + test/TEST-03-USR-MOUNT/test.sh | 2 +- + test/TEST-04-FULL-SYSTEMD/test.sh | 2 +- + test/TEST-10-RAID/test.sh | 2 +- + test/TEST-11-LVM/test.sh | 2 +- + test/TEST-12-RAID-DEG/test.sh | 2 +- + test/TEST-13-ENC-RAID-LVM/test.sh | 6 +++--- + test/TEST-14-IMSM/test.sh | 2 +- + test/TEST-15-BTRFSRAID/test.sh | 2 +- + test/TEST-16-DMSQUASH/test.sh | 2 +- + test/TEST-17-LVM-THIN/test.sh | 2 +- + test/TEST-20-NFS/test.sh | 4 ++-- + test/TEST-30-ISCSI/test.sh | 4 ++-- + test/TEST-31-ISCSI-MULTI/test.sh | 4 ++-- + test/TEST-40-NBD/test.sh | 4 ++-- + test/TEST-50-MULTINIC/test.sh | 4 ++-- + test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 6 +++--- + 18 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh +index ed2ae5de..ca4a8288 100755 +--- a/test/TEST-01-BASIC/test.sh ++++ b/test/TEST-01-BASIC/test.sh +@@ -15,7 +15,7 @@ test_run() { + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing || return 1 + grep -F -m 1 -q dracut-root-block-success $TESTDIR/result || return 1 + } +diff --git a/test/TEST-02-SYSTEMD/test.sh b/test/TEST-02-SYSTEMD/test.sh +index 8c5eb168..848021e5 100755 +--- a/test/TEST-02-SYSTEMD/test.sh ++++ b/test/TEST-02-SYSTEMD/test.sh +@@ -11,7 +11,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1 + } +diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh +index 42c0da65..5d5ec8f8 100755 +--- a/test/TEST-03-USR-MOUNT/test.sh ++++ b/test/TEST-03-USR-MOUNT/test.sh +@@ -22,7 +22,7 @@ client_run() { + -net none \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 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 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh +index 97528e4f..f65f30f2 100755 +--- a/test/TEST-04-FULL-SYSTEMD/test.sh ++++ b/test/TEST-04-FULL-SYSTEMD/test.sh +@@ -23,7 +23,7 @@ client_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + + if (($? != 0)); then +diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh +index 444126b2..0beb26c3 100755 +--- a/test/TEST-10-RAID/test.sh ++++ b/test/TEST-10-RAID/test.sh +@@ -13,7 +13,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rd.auto rw rd.retry=10 console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1 + } +diff --git a/test/TEST-11-LVM/test.sh b/test/TEST-11-LVM/test.sh +index 5c105e01..a907c4b1 100755 +--- a/test/TEST-11-LVM/test.sh ++++ b/test/TEST-11-LVM/test.sh +@@ -12,7 +12,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh +index 4e381d84..c82cde1e 100755 +--- a/test/TEST-12-RAID-DEG/test.sh ++++ b/test/TEST-12-RAID-DEG/test.sh +@@ -20,7 +20,7 @@ client_run() { + -drive format=raw,index=3,media=disk,file=$TESTDIR/disk3.img.new \ + -net none \ + -no-reboot \ +- -append "panic=1 $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ ++ -append "panic=1 systemd.crash_reboot $* systemd.log_target=kmsg loglevel=7 root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 log_buf_len=2M selinux=0 rd.debug rd.shell=0 $DEBUGFAIL " \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 76ec36b3..99324ce9 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -20,7 +20,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto rd.retry=20 console=ttyS0,115200n81 selinux=0 rd.debug rootwait $LUKSARGS rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + echo "CLIENT TEST END: [OK]" +@@ -34,7 +34,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img || return 1 + echo "CLIENT TEST END: [OK]" +@@ -48,7 +48,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw quiet rd.auto rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL rd.luks.uuid=failme" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/check-success.img && return 1 + echo "CLIENT TEST END: [OK]" +diff --git a/test/TEST-14-IMSM/test.sh b/test/TEST-14-IMSM/test.sh +index 8ebc285a..ed60f052 100755 +--- a/test/TEST-14-IMSM/test.sh ++++ b/test/TEST-14-IMSM/test.sh +@@ -16,7 +16,7 @@ client_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot $* root=LABEL=root rw debug rd.retry=5 rd.debug console=ttyS0,115200n81 selinux=0 rd.info rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then + echo "CLIENT TEST END: $@ [FAIL]" +diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh +index 02cb4976..dda76672 100755 +--- a/test/TEST-15-BTRFSRAID/test.sh ++++ b/test/TEST-15-BTRFSRAID/test.sh +@@ -15,7 +15,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $MARKER_DISKIMAGE || return 1 + } +diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh +index 45d8c4c0..65d5bdbb 100755 +--- a/test/TEST-16-DMSQUASH/test.sh ++++ b/test/TEST-16-DMSQUASH/test.sh +@@ -23,7 +23,7 @@ test_run() { + -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.shell=0 $DEBUGFAIL" \ + -initrd "$TESTDIR"/initramfs.testing + + # mediacheck test with qemu GUI +diff --git a/test/TEST-17-LVM-THIN/test.sh b/test/TEST-17-LVM-THIN/test.sh +index 1b36a216..c13e9063 100755 +--- a/test/TEST-17-LVM-THIN/test.sh ++++ b/test/TEST-17-LVM-THIN/test.sh +@@ -12,7 +12,7 @@ test_run() { + -m 512M -smp 2 -nographic \ + -net none \ + -no-reboot \ +- -append "panic=1 root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/dracut/root rw rd.auto=1 quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -initrd $TESTDIR/initramfs.testing + grep -F -m 1 -q dracut-root-block-success $TESTDIR/root.ext2 || return 1 + } +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index e942745a..4ad7fd77 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -22,7 +22,7 @@ run_server() { + ${SERIAL:--serial file:"$TESTDIR"/server.log} \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ ++ -append "panic=1 systemd.crash_reboot rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.server \ + -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 +@@ -57,7 +57,7 @@ client_test() { + -net socket,connect=127.0.0.1:12320 \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ ++ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nfs-OK $TESTDIR/client.img; then +diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh +index f6cc56d5..d5a6ba58 100755 +--- a/test/TEST-30-ISCSI/test.sh ++++ b/test/TEST-30-ISCSI/test.sh +@@ -26,7 +26,7 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ + -net socket,listen=127.0.0.1:12330 \ + -no-reboot \ +- -append "panic=1 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ + -initrd $TESTDIR/initramfs.server \ + -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 +@@ -51,7 +51,7 @@ run_client() { + -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ + -net socket,connect=127.0.0.1:12330 \ + -no-reboot \ +- -append "panic=1 rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ ++ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +diff --git a/test/TEST-31-ISCSI-MULTI/test.sh b/test/TEST-31-ISCSI-MULTI/test.sh +index 5c38249c..20db2451 100755 +--- a/test/TEST-31-ISCSI-MULTI/test.sh ++++ b/test/TEST-31-ISCSI-MULTI/test.sh +@@ -26,7 +26,7 @@ run_server() { + -net nic,macaddr=52:54:00:12:34:57,model=e1000 \ + -net socket,listen=127.0.0.1:12331 \ + -no-reboot \ +- -append "panic=1 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 $SERVER_DEBUG" \ + -initrd $TESTDIR/initramfs.server \ + -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 +@@ -51,7 +51,7 @@ run_client() { + -net nic,macaddr=52:54:00:12:34:01,model=e1000 \ + -net socket,connect=127.0.0.1:12331 \ + -no-reboot \ +- -append "panic=1 rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ ++ -append "panic=1 systemd.crash_reboot rw rd.auto rd.retry=50 console=ttyS0,115200n81 selinux=0 rd.debug=0 rd.shell=0 $DEBUGFAIL $*" \ + -initrd $TESTDIR/initramfs.testing + if ! grep -F -m 1 -q iscsi-OK $TESTDIR/client.img; then + echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" +diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh +index 12736a15..19ec5b0e 100755 +--- a/test/TEST-40-NBD/test.sh ++++ b/test/TEST-40-NBD/test.sh +@@ -28,7 +28,7 @@ run_server() { + ${SERIAL:+-serial "$SERIAL"} \ + ${SERIAL:--serial file:"$TESTDIR"/server.log} \ + -no-reboot \ +- -append "panic=1 root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ ++ -append "panic=1 systemd.crash_reboot root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \ + -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1 + sudo chmod 644 $TESTDIR/server.pid || return 1 + +@@ -65,7 +65,7 @@ client_test() { + -net nic,macaddr=$mac,model=e1000 \ + -net socket,connect=127.0.0.1:12340 \ + -no-reboot \ +- -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ ++ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \ + -initrd $TESTDIR/initramfs.testing + + if [[ $? -ne 0 ]] || ! grep -F -m 1 -q nbd-OK $TESTDIR/flag.img; then +diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh +index 495a66f2..ff2961dc 100755 +--- a/test/TEST-50-MULTINIC/test.sh ++++ b/test/TEST-50-MULTINIC/test.sh +@@ -23,7 +23,7 @@ run_server() { + ${SERIAL:--serial file:"$TESTDIR"/server.log} \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ ++ -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \ + -initrd "$TESTDIR"/initramfs.server \ + -pidfile "$TESTDIR"/server.pid -daemonize || return 1 + +@@ -63,7 +63,7 @@ client_test() { + -device e1000,netdev=n2,mac=52:54:00:12:34:99 \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ ++ -append "panic=1 systemd.crash_reboot rd.shell=0 $cmdline $DEBUGFAIL rd.retry=5 ro console=ttyS0,115200n81 selinux=0 init=/sbin/init rd.debug systemd.log_target=console loglevel=7" \ + -initrd "$TESTDIR"/initramfs.testing + + { read OK; read IFACES; } < "$TESTDIR"/client.img +diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +index 8c11a7d3..5618baee 100755 +--- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh ++++ b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +@@ -31,7 +31,7 @@ run_server() { + ${SERIAL:--serial file:"$TESTDIR"/server.log} \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ ++ -append "panic=1 systemd.crash_reboot loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ + -initrd "$TESTDIR"/initramfs.server \ + -pidfile "$TESTDIR"/server.pid -daemonize || return 1 + chmod 644 -- "$TESTDIR"/server.pid || return 1 +@@ -79,7 +79,7 @@ client_test() { + $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ ++ -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ + -initrd "$TESTDIR"/initramfs.testing + else + $testdir/run-qemu \ +@@ -95,7 +95,7 @@ client_test() { + -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ + -watchdog i6300esb -watchdog-action poweroff \ + -no-reboot \ +- -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ ++ -append "panic=1 systemd.crash_reboot $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ + -initrd "$TESTDIR"/initramfs.testing + fi + + diff --git a/0034.patch b/0034.patch new file mode 100644 index 0000000..f9f8d59 --- /dev/null +++ b/0034.patch @@ -0,0 +1,229 @@ +From a34b1baa6ca45b420399ec4cefe3cfe225c14dcf Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 11 Jun 2019 09:56:13 +0200 +Subject: [PATCH] test/{10,12,13,14,17,30,31}: increase the disk sizes + +On Fedora 30 the paritition sizes turn out to be too small again: + + + mkdir -p /sysroot + + mount /dev/dracut/root /sysroot + + cp -a -t /sysroot /source/bin /source/dev /source/etc /source/lib /source/lib64 /source/proc /source/root /source/sbin /source/sys /source/tmp /source/usr /source/var + cp: error writing '/sysroot/usr/lib64/libkrb5.so.3.3': No space left on device + cp: error writing '/sysroot/usr/lib64/libkrb5support.so.0.1': No space left on device + +It turns out that there has been quite some size increase in some libraries, +notably glibc, though not all -- some even shrunk, ruling out a toolchain +problem. Here's are files over 1M we install on Fedora 30: + + f29 f30 + 2.7M => 6.4M /usr/lib64/{libc-2.28.so => libc-2.29.so} + 3.1M => 6.0M /usr/lib64/libcrypto.so.1.1.1c + 2.0M => 3.5M /usr/lib64/{libm-2.28.so => libm-2.29.so} + 2.9M => 2.8M /usr/lib/systemd/{libsystemd-shared-239.so => libsystemd-shared-241.so} + 1.7M => 2.5M /usr/lib64/libunistring.so.2.1.0 + 2.3M => 2.4M /usr/lib64/bind9-export/libdns-export.so.1105.0.0 + 1.2M => 2.1M /usr/bin/bash + 1.1M => 1.4M /usr/lib64/libkrb5.so.3.3 + 1.2M => 1.4M /usr/lib64/libgcrypt.so.20.2.4 + 612K => 1.1M /usr/lib64/libssl.so.1.1.1c + +This increases the image sizes to accomodate for this. There's probably +little else we can do. + +(cherry picked from commit e318ba30fbd84d510a5bbb071d868e523d965869) +--- + test/TEST-10-RAID/create-root.sh | 6 +++--- + test/TEST-10-RAID/test.sh | 2 +- + test/TEST-12-RAID-DEG/test.sh | 6 +++--- + test/TEST-13-ENC-RAID-LVM/create-root.sh | 6 +++--- + test/TEST-13-ENC-RAID-LVM/test.sh | 2 +- + test/TEST-14-IMSM/create-root.sh | 6 +++--- + test/TEST-14-IMSM/test.sh | 4 ++-- + test/TEST-17-LVM-THIN/create-root.sh | 8 ++++---- + test/TEST-17-LVM-THIN/test.sh | 2 +- + test/TEST-30-ISCSI/test.sh | 6 +++--- + test/TEST-31-ISCSI-MULTI/test.sh | 6 +++--- + 11 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh +index 7b5f2a76..af4cac0d 100755 +--- a/test/TEST-10-RAID/create-root.sh ++++ b/test/TEST-10-RAID/create-root.sh +@@ -8,9 +8,9 @@ udevadm control --reload + # save a partition at the beginning for future flagging purposes + sfdisk /dev/sda <keyfile +diff --git a/test/TEST-13-ENC-RAID-LVM/test.sh b/test/TEST-13-ENC-RAID-LVM/test.sh +index 99324ce9..9ffe24b1 100755 +--- a/test/TEST-13-ENC-RAID-LVM/test.sh ++++ b/test/TEST-13-ENC-RAID-LVM/test.sh +@@ -59,7 +59,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=80 ++ dd if=/dev/null of=$TESTDIR/root.ext2 bs=1M seek=134 + + kernel=$KVERSION + # Create what will eventually be our root filesystem onto an overlay +diff --git a/test/TEST-14-IMSM/create-root.sh b/test/TEST-14-IMSM/create-root.sh +index a0324c6f..0d10945b 100755 +--- a/test/TEST-14-IMSM/create-root.sh ++++ b/test/TEST-14-IMSM/create-root.sh +@@ -32,9 +32,9 @@ sfdisk -g /dev/mapper/isw*Test0 + # save a partition at the beginning for future flagging purposes + sfdisk --no-reread /dev/mapper/isw*Test0 < +Date: Thu, 27 Jun 2019 16:20:32 +0200 +Subject: [PATCH] travis: run TEST-14-IMSM on Fedora 29 + +Systemd in Fedora 30 is broken at the moment. +Fix: https://github.com/systemd/systemd/pull/12872/ + +(cherry picked from commit 7a2503ab8cec9473ad6dacf4f48b17344219f3c0) +--- + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.travis.yml b/.travis.yml +index efb0df1b..de0af438 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -19,7 +19,7 @@ env: + - IMAGE=latest TESTS=10 + - IMAGE=latest TESTS=11 + - IMAGE=latest TESTS=13 +- - IMAGE=latest TESTS=14 ++ - IMAGE=29 TESTS=14 + - IMAGE=latest TESTS=15 + - IMAGE=latest TESTS=17 + + diff --git a/0036.patch b/0036.patch new file mode 100644 index 0000000..4e3f921 --- /dev/null +++ b/0036.patch @@ -0,0 +1,27 @@ +From c60f4fc027272c221a887128070ac89547b6ecc3 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 27 Jun 2019 16:22:04 +0200 +Subject: [PATCH] travis: run TEST-13-ENC-RAID-LVM on Fedora 29 + +Systemd in Fedora 30 is broken at the moment. +Fix: https://github.com/systemd/systemd/pull/12897 + +(cherry picked from commit 8238f41b34777c3c75b03a9b598d4b9e1c7bf911) +--- + .travis.yml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/.travis.yml b/.travis.yml +index de0af438..364078cf 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -18,7 +18,7 @@ env: + - IMAGE=latest TESTS=04 + - IMAGE=latest TESTS=10 + - IMAGE=latest TESTS=11 +- - IMAGE=latest TESTS=13 ++ - IMAGE=29 TESTS=13 + - IMAGE=29 TESTS=14 + - IMAGE=latest TESTS=15 + - IMAGE=latest TESTS=17 + diff --git a/0037.patch b/0037.patch new file mode 100644 index 0000000..5d067a6 --- /dev/null +++ b/0037.patch @@ -0,0 +1,53 @@ +From d8f0e52ac7d05c364ca24d2058c970e5e03f82ff Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Fri, 30 Aug 2019 16:16:51 +0200 +Subject: [PATCH] all: remove debugging leftovers + +Accidentally folded into commit e671c3a06a7e5 ('95iscsi/module-setup.sh: +do not require 'hostname' anymore'). +--- + modules.d/40network/netroot.sh | 2 +- + modules.d/98dracut-systemd/dracut-cmdline.sh | 2 +- + modules.d/99base/init.sh | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/40network/netroot.sh b/modules.d/40network/netroot.sh +index 654cfc72..207364cd 100755 +--- a/modules.d/40network/netroot.sh ++++ b/modules.d/40network/netroot.sh +@@ -66,7 +66,7 @@ if [ -z "$2" ]; then + + # Check: do we really know how to handle (net)root? + [ -z "$root" ] && die "No or empty root= argument" +- [ -z "$rootok" ] && die "X2 Don't know how to handle 'root=$root'" ++ [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" + + handler=${netroot%%:*} + handler=${handler%%4} +diff --git a/modules.d/98dracut-systemd/dracut-cmdline.sh b/modules.d/98dracut-systemd/dracut-cmdline.sh +index 89c52d13..bff9435a 100755 +--- a/modules.d/98dracut-systemd/dracut-cmdline.sh ++++ b/modules.d/98dracut-systemd/dracut-cmdline.sh +@@ -76,7 +76,7 @@ case "${root}${root_unset}" in + esac + + [ -z "${root}${root_unset}" ] && die "Empty root= argument" +-[ -z "$rootok" ] && die "X1 Don't know how to handle 'root=$root'" ++[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" + + export root rflags fstype netroot NEWROOT + +diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh +index 3e20069f..e4f7cff1 100755 +--- a/modules.d/99base/init.sh ++++ b/modules.d/99base/init.sh +@@ -136,7 +136,7 @@ getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Br + source_hook cmdline + + [ -z "$root" ] && die "No or empty root= argument" +-[ -z "$rootok" ] && die "X0 Don't know how to handle 'root=$root'" ++[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" + + export root rflags fstype netroot NEWROOT + + diff --git a/0038.patch b/0038.patch new file mode 100644 index 0000000..43acb72 --- /dev/null +++ b/0038.patch @@ -0,0 +1,31 @@ +From 8eb08e55286e77f005246d1db1bfd2adf4a0e40b Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Tue, 27 Nov 2018 15:30:48 +0100 +Subject: [PATCH] network-manager: call the online hook for connected devices + +Look for "connection-uuid" instead of "managed" to determine the devices +that are actually activated with a connection and call the online hook. + +This fixes the anaconda-net root mount, which utilizes the online hook. + +(cherry picked from commit 79a17b0112995eb60c85c64d15070c52f213b28d) +--- + modules.d/35network-manager/nm-run.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh +index f6defa99..0f943631 100755 +--- a/modules.d/35network-manager/nm-run.sh ++++ b/modules.d/35network-manager/nm-run.sh +@@ -9,8 +9,9 @@ fi + for _i in /sys/class/net/*/ + do + state=/run/NetworkManager/devices/$(cat $_i/ifindex) +- grep -q managed=true $state 2>/dev/null || continue ++ grep -q connection-uuid= $state 2>/dev/null || continue + ifname=$(basename $_i) + sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts ++ source_hook initqueue/online $ifname + /sbin/netroot $ifname + done + diff --git a/0039.patch b/0039.patch new file mode 100644 index 0000000..df4625b --- /dev/null +++ b/0039.patch @@ -0,0 +1,24 @@ +From 34011ee53e745f74d70bc5b52dade6d4ef349e90 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 17 Jun 2019 10:07:38 +0200 +Subject: [PATCH] network-manager: remove useless use of basename + +(cherry picked from commit 5e0f8c8a4ced36268d0077acafa1db2402776fa6) +--- + 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 0f943631..5f4b38ca 100755 +--- a/modules.d/35network-manager/nm-run.sh ++++ b/modules.d/35network-manager/nm-run.sh +@@ -10,7 +10,7 @@ for _i in /sys/class/net/*/ + do + state=/run/NetworkManager/devices/$(cat $_i/ifindex) + grep -q connection-uuid= $state 2>/dev/null || continue +- ifname=$(basename $_i) ++ ifname=${_i##*/} + sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts + source_hook initqueue/online $ifname + /sbin/netroot $ifname + diff --git a/0040.patch b/0040.patch new file mode 100644 index 0000000..e2fa551 --- /dev/null +++ b/0040.patch @@ -0,0 +1,24 @@ +From 94c75a2a827ff09ffac18454d5c4ba4756d721d6 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 27 May 2019 12:44:17 +0200 +Subject: [PATCH] network-manager: also read out next-server from NM state + +(cherry picked from commit 4be95b67a73e7434f92a7d7c40955eae0b59717e) +--- + 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 5f4b38ca..a539d5b2 100755 +--- a/modules.d/35network-manager/nm-run.sh ++++ b/modules.d/35network-manager/nm-run.sh +@@ -11,7 +11,7 @@ do + state=/run/NetworkManager/devices/$(cat $_i/ifindex) + grep -q connection-uuid= $state 2>/dev/null || continue + ifname=${_i##*/} +- sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts ++ sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' <$state >/tmp/dhclient.$ifname.dhcpopts + source_hook initqueue/online $ifname + /sbin/netroot $ifname + done + diff --git a/0041.patch b/0041.patch new file mode 100644 index 0000000..52083c3 --- /dev/null +++ b/0041.patch @@ -0,0 +1,30 @@ +From 68fefe6f9424d3f29e6da9133579c385e7b470b2 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 27 May 2019 12:43:59 +0200 +Subject: [PATCH] network-manager: generate configuration with netroot= + +If the root is on network, let nm-initrd-generator create configuration +even if none was explicitly specified on the command line. + +Also do the same if /tmp/net.ifaces exists, because the anaconda plugin +creates an empty file in that location in hopes that will make us +configure the network. + +(cherry picked from commit 381ab6b7cd2d35bf7f9da63b10c20f5ef6e61a8b) +--- + modules.d/35network-manager/nm-config.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules.d/35network-manager/nm-config.sh b/modules.d/35network-manager/nm-config.sh +index 1339ebe7..1efa737c 100755 +--- a/modules.d/35network-manager/nm-config.sh ++++ b/modules.d/35network-manager/nm-config.sh +@@ -1,3 +1,7 @@ + #!/bin/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) + diff --git a/0042.patch b/0042.patch new file mode 100644 index 0000000..3bf3074 --- /dev/null +++ b/0042.patch @@ -0,0 +1,43 @@ +From 53cece208a44c53ecc001cb8eb769f6fb9b3d1dc Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 27 May 2019 11:12:22 +0200 +Subject: [PATCH] network: parse root=dhcp also with network-manager module + +Move the logic from network-legacy to common network code. + +(cherry picked from commit 35efada5ecffd139660b4a89f4cc3d627752c91e) +--- + modules.d/35network-legacy/module-setup.sh | 1 - + modules.d/{35network-legacy => 40network}/dhcp-root.sh | 0 + modules.d/40network/module-setup.sh | 1 + + 3 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh +index 71abda36..5a82e998 100755 +--- a/modules.d/35network-legacy/module-setup.sh ++++ b/modules.d/35network-legacy/module-setup.sh +@@ -36,7 +36,6 @@ install() { + inst_simple -H "/etc/dhclient.conf" + cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf" + inst_hook pre-udev 60 "$moddir/net-genrules.sh" +- inst_hook cmdline 91 "$moddir/dhcp-root.sh" + inst_hook cmdline 92 "$moddir/parse-ibft.sh" + inst_hook cmdline 95 "$moddir/parse-vlan.sh" + inst_hook cmdline 96 "$moddir/parse-bond.sh" +diff --git a/modules.d/35network-legacy/dhcp-root.sh b/modules.d/40network/dhcp-root.sh +similarity index 100% +rename from modules.d/35network-legacy/dhcp-root.sh +rename to modules.d/40network/dhcp-root.sh +diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh +index e8541636..8e2a74a3 100755 +--- a/modules.d/40network/module-setup.sh ++++ b/modules.d/40network/module-setup.sh +@@ -28,6 +28,7 @@ install() { + inst_script "$moddir/netroot.sh" "/sbin/netroot" + inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh" + inst_hook pre-udev 50 "$moddir/ifname-genrules.sh" ++ inst_hook cmdline 91 "$moddir/dhcp-root.sh" + + dracut_need_initqueue + } + diff --git a/0043.patch b/0043.patch new file mode 100644 index 0000000..b59dc53 --- /dev/null +++ b/0043.patch @@ -0,0 +1,620 @@ +From 4e10601254bb20891dc2919416d7151583678c3d Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 10 Jun 2019 16:04:18 +0200 +Subject: [PATCH] test: copy BONDBRIDGETEAMVLAN to IFCFG + +The IFCFG test will make sure the network-legacy plugin keeps writing +out correct ifcfg files. + +This is a separate commit so that actual changes are visible in the +following one. + +(cherry picked from commit 70787ab61957741a05e4046bad49758c4e9bc1cc) +--- + test/TEST-60-IFCFG/99-idesymlinks.rules | 8 + + test/TEST-60-IFCFG/Makefile | 10 + + test/TEST-60-IFCFG/client-init.sh | 22 +++ + test/TEST-60-IFCFG/dhcpd.conf | 27 +++ + test/TEST-60-IFCFG/exports | 1 + + test/TEST-60-IFCFG/finished-false.sh | 2 + + test/TEST-60-IFCFG/hard-off.sh | 3 + + test/TEST-60-IFCFG/hosts | 5 + + test/TEST-60-IFCFG/server-init.sh | 120 ++++++++++++ + test/TEST-60-IFCFG/test.sh | 336 ++++++++++++++++++++++++++++++++ + 10 files changed, 534 insertions(+) + +diff --git a/test/TEST-60-IFCFG/99-idesymlinks.rules b/test/TEST-60-IFCFG/99-idesymlinks.rules +new file mode 100644 +index 00000000..d557790a +--- /dev/null ++++ b/test/TEST-60-IFCFG/99-idesymlinks.rules +@@ -0,0 +1,8 @@ ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hda", SYMLINK+="sda" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hda*", SYMLINK+="sda$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdb", SYMLINK+="sdb" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdb*", SYMLINK+="sdb$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdc", SYMLINK+="sdc" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdc*", SYMLINK+="sdc$env{MINOR}" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="hdd", SYMLINK+="sdd" ++ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="hdd*", SYMLINK+="sdd$env{MINOR}" +diff --git a/test/TEST-60-IFCFG/Makefile b/test/TEST-60-IFCFG/Makefile +new file mode 100644 +index 00000000..aad27059 +--- /dev/null ++++ b/test/TEST-60-IFCFG/Makefile +@@ -0,0 +1,10 @@ ++all: ++ @$(MAKE) -s --no-print-directory -C ../.. all ++ @V=$(V) basedir=../.. testdir=../ ./test.sh --all ++setup: ++ @$(MAKE) --no-print-directory -C ../.. all ++ @basedir=../.. testdir=../ ./test.sh --setup ++clean: ++ @basedir=../.. testdir=../ ./test.sh --clean ++run: ++ @basedir=../.. testdir=../ ./test.sh --run +diff --git a/test/TEST-60-IFCFG/client-init.sh b/test/TEST-60-IFCFG/client-init.sh +new file mode 100755 +index 00000000..8c33ff0f +--- /dev/null ++++ b/test/TEST-60-IFCFG/client-init.sh +@@ -0,0 +1,22 @@ ++#!/bin/sh ++exec >/dev/console 2>&1 ++export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++strstr() { [ "${1#*$2*}" != "$1" ]; } ++CMDLINE=$(while read line; do echo $line;done < /proc/cmdline) ++export TERM=linux ++export PS1='initramfs-test:\w\$ ' ++stty sane ++echo "made it to the rootfs! Powering down." ++ ++( ++ echo OK ++ ip -o -4 address show scope global | while read n if rest; do echo $if;done | sort ++ for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do ++ echo $i ++ grep -v 'UUID=' $i ++ done ++ echo EOF ++) > /dev/sda ++ ++strstr "$CMDLINE" "rd.shell" && sh -i ++poweroff -f +diff --git a/test/TEST-60-IFCFG/dhcpd.conf b/test/TEST-60-IFCFG/dhcpd.conf +new file mode 100644 +index 00000000..e26bd60b +--- /dev/null ++++ b/test/TEST-60-IFCFG/dhcpd.conf +@@ -0,0 +1,27 @@ ++ddns-update-style none; ++ ++use-host-decl-names true; ++ ++subnet 192.168.50.0 netmask 255.255.255.0 { ++ option subnet-mask 255.255.255.0; ++ option routers 192.168.50.1; ++ next-server 192.168.50.1; ++ server-identifier 192.168.50.1; ++ option domain-name-servers 192.168.50.1; ++ option domain-search "example.com"; ++ option domain-name "other.com"; ++ option root-path "nfs:192.168.50.1:/nfs/client"; ++ range 192.168.50.10 192.168.50.100; ++} ++ ++subnet 192.168.51.0 netmask 255.255.255.0 { ++ option subnet-mask 255.255.255.0; ++ option routers 192.168.51.1; ++ next-server 192.168.51.1; ++ server-identifier 192.168.51.1; ++ option domain-name-servers 192.168.51.1; ++ option domain-search "example.com"; ++ option domain-name "other.com"; ++ option root-path "nfs:192.168.51.1:/nfs/client"; ++ range 192.168.51.10 192.168.51.100; ++} +diff --git a/test/TEST-60-IFCFG/exports b/test/TEST-60-IFCFG/exports +new file mode 100644 +index 00000000..ff5f29b1 +--- /dev/null ++++ b/test/TEST-60-IFCFG/exports +@@ -0,0 +1 @@ ++/nfs/client 192.168.50.0/24(rw,insecure,no_subtree_check,no_root_squash) +diff --git a/test/TEST-60-IFCFG/finished-false.sh b/test/TEST-60-IFCFG/finished-false.sh +new file mode 100755 +index 00000000..ecdbef95 +--- /dev/null ++++ b/test/TEST-60-IFCFG/finished-false.sh +@@ -0,0 +1,2 @@ ++#!/bin/sh ++exit 1 +diff --git a/test/TEST-60-IFCFG/hard-off.sh b/test/TEST-60-IFCFG/hard-off.sh +new file mode 100755 +index 00000000..12c3d5ac +--- /dev/null ++++ b/test/TEST-60-IFCFG/hard-off.sh +@@ -0,0 +1,3 @@ ++#!/bin/sh ++getarg rd.shell || poweroff -f ++getarg failme && poweroff -f +diff --git a/test/TEST-60-IFCFG/hosts b/test/TEST-60-IFCFG/hosts +new file mode 100644 +index 00000000..d02a4e9b +--- /dev/null ++++ b/test/TEST-60-IFCFG/hosts +@@ -0,0 +1,5 @@ ++127.0.0.1 localhost ++192.168.50.1 server ++192.168.50.100 client-if1 ++192.168.50.101 client-if2 ++192.168.50.102 client-if3 +diff --git a/test/TEST-60-IFCFG/server-init.sh b/test/TEST-60-IFCFG/server-init.sh +new file mode 100755 +index 00000000..b9f01c9b +--- /dev/null ++++ b/test/TEST-60-IFCFG/server-init.sh +@@ -0,0 +1,120 @@ ++#!/bin/sh ++exec /dev/console 2>&1 ++set -x ++export PATH=/sbin:/bin:/usr/sbin:/usr/bin ++export TERM=linux ++export PS1='nfstest-server:\w\$ ' ++stty sane ++echo "made it to the rootfs!" ++echo server > /proc/sys/kernel/hostname ++ ++wait_for_if_link() { ++ local cnt=0 ++ local li ++ while [ $cnt -lt 600 ]; do ++ li=$(ip -o link show dev $1 2>/dev/null) ++ [ -n "$li" ] && return 0 ++ sleep 0.1 ++ cnt=$(($cnt+1)) ++ done ++ return 1 ++} ++ ++wait_for_if_up() { ++ local cnt=0 ++ local li ++ while [ $cnt -lt 200 ]; do ++ li=$(ip -o link show up dev $1) ++ [ -n "$li" ] && return 0 ++ sleep 0.1 ++ cnt=$(($cnt+1)) ++ done ++ return 1 ++} ++ ++wait_for_route_ok() { ++ local cnt=0 ++ while [ $cnt -lt 200 ]; do ++ li=$(ip route show) ++ [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 ++ sleep 0.1 ++ cnt=$(($cnt+1)) ++ done ++ return 1 ++} ++ ++linkup() { ++ wait_for_if_link $1 2>/dev/null\ ++ && ip link set $1 up 2>/dev/null\ ++ && wait_for_if_up $1 2>/dev/null ++} ++ ++modprobe --all -b -q 8021q ipvlan macvlan ++>/dev/watchdog ++ip addr add 127.0.0.1/8 dev lo ++linkup lo ++ip link set dev eth0 name ens3 ++ip addr add 192.168.50.1/24 dev ens3 ++linkup ens3 ++>/dev/watchdog ++ip link set dev eth1 name ens4 ++ip link add dev ens4.1 link ens4 type vlan id 1 ++ip link add dev ens4.2 link ens4 type vlan id 2 ++ip link add dev ens4.3 link ens4 type vlan id 3 ++ip link add dev ens4.4 link ens4 type vlan id 4 ++ip addr add 192.168.54.1/24 dev ens4.1 ++ip addr add 192.168.55.1/24 dev ens4.2 ++ip addr add 192.168.56.1/24 dev ens4.3 ++ip addr add 192.168.57.1/24 dev ens4.4 ++linkup ens4 ++ip link set dev ens4.1 up ++ip link set dev ens4.2 up ++ip link set dev ens4.3 up ++ip link set dev ens4.4 up ++ip link set dev eth2 name ens5 ++ip addr add 192.168.51.1/24 dev ens5 ++linkup ens5 ++ip link set dev eth3 name ens6 ++linkup ens6 ++>/dev/watchdog ++modprobe af_packet ++> /dev/watchdog ++modprobe sunrpc ++>/dev/watchdog ++mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs ++>/dev/watchdog ++[ -x /sbin/portmap ] && portmap ++>/dev/watchdog ++mkdir -p /run/rpcbind ++[ -x /sbin/rpcbind ] && rpcbind ++>/dev/watchdog ++modprobe nfsd ++>/dev/watchdog ++mount -t nfsd nfsd /proc/fs/nfsd ++>/dev/watchdog ++exportfs -r ++>/dev/watchdog ++rpc.nfsd ++>/dev/watchdog ++rpc.mountd ++>/dev/watchdog ++rpc.idmapd ++>/dev/watchdog ++exportfs -r ++>/dev/watchdog ++>/var/lib/dhcpd/dhcpd.leases ++>/dev/watchdog ++chmod 777 /var/lib/dhcpd/dhcpd.leases ++>/dev/watchdog ++dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5 ++#echo -n 'V' > /dev/watchdog ++#sh -i ++#tcpdump -i ens3 ++# Wait forever for the VM to die ++echo "Serving NFS mounts" ++while :; do ++ sleep 10 ++ >/dev/watchdog ++done ++mount -n -o remount,ro / ++poweroff -f +diff --git a/test/TEST-60-IFCFG/test.sh b/test/TEST-60-IFCFG/test.sh +new file mode 100755 +index 00000000..8c11a7d3 +--- /dev/null ++++ b/test/TEST-60-IFCFG/test.sh +@@ -0,0 +1,336 @@ ++#!/bin/bash ++# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- ++# ex: ts=8 sw=4 sts=4 et filetype=sh ++TEST_DESCRIPTION="root filesystem on NFS with bridging/bonding/vlan" ++KVERSION=${KVERSION-$(uname -r)} ++ ++# Uncomment this to debug failures ++#DEBUGFAIL="rd.shell rd.break" ++#DEBUGFAIL="rd.shell rd.break rd.debug" ++#SERIAL="tcp:127.0.0.1:9999" ++ ++run_server() { ++ # Start server first ++ echo "MULTINIC TEST SETUP: Starting DHCP/NFS server" ++ ++ fsck -a "$TESTDIR"/server.ext3 || return 1 ++ ++ $testdir/run-qemu \ ++ -hda "$TESTDIR"/server.ext3 \ ++ -m 512M -smp 2 \ ++ -display none \ ++ -netdev socket,id=n0,listen=127.0.0.1:12370 \ ++ -netdev socket,id=n1,listen=127.0.0.1:12371 \ ++ -netdev socket,id=n2,listen=127.0.0.1:12372 \ ++ -netdev socket,id=n3,listen=127.0.0.1:12373 \ ++ -device e1000,netdev=n0,mac=52:54:01:12:34:56 \ ++ -device e1000,netdev=n1,mac=52:54:01:12:34:57 \ ++ -device e1000,netdev=n2,mac=52:54:01:12:34:58 \ ++ -device e1000,netdev=n3,mac=52:54:01:12:34:59 \ ++ ${SERIAL:+-serial "$SERIAL"} \ ++ ${SERIAL:--serial file:"$TESTDIR"/server.log} \ ++ -watchdog i6300esb -watchdog-action poweroff \ ++ -no-reboot \ ++ -append "panic=1 loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0 rd.debug" \ ++ -initrd "$TESTDIR"/initramfs.server \ ++ -pidfile "$TESTDIR"/server.pid -daemonize || return 1 ++ chmod 644 -- "$TESTDIR"/server.pid || return 1 ++ ++ # Cleanup the terminal if we have one ++ tty -s && stty sane ++ ++ echo Sleeping 10 seconds to give the server a head start ++ sleep 10 ++} ++ ++client_test() { ++ local test_name="$1" ++ local do_vlan13="$2" ++ local cmdline="$3" ++ local check="$4" ++ local CONF ++ ++ echo "CLIENT TEST START: $test_name" ++ ++ [ "$do_vlan13" != "yes" ] && unset do_vlan13 ++ ++ # Need this so kvm-qemu will boot (needs non-/dev/zero local disk) ++ if ! dd if=/dev/zero of="$TESTDIR"/client.img bs=1M count=1; then ++ echo "Unable to make client sda image" 1>&2 ++ return 1 ++ fi ++ if [[ $do_vlan13 ]]; then ++ nic1=" -netdev socket,connect=127.0.0.1:12371,id=n1" ++ nic3=" -netdev socket,connect=127.0.0.1:12373,id=n3" ++ else ++ nic1=" -netdev hubport,id=n1,hubid=2" ++ nic3=" -netdev hubport,id=n3,hubid=3" ++ fi ++ ++ if $testdir/run-qemu --help | grep -qF -m1 'netdev hubport,id=str,hubid=n[,netdev=nd]' && echo OK; then ++ $testdir/run-qemu \ ++ -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ ++ -netdev socket,connect=127.0.0.1:12370,id=s1 \ ++ -netdev hubport,hubid=1,id=h1,netdev=s1 \ ++ -netdev hubport,hubid=1,id=h2 -device e1000,mac=52:54:00:12:34:01,netdev=h2 \ ++ -netdev hubport,hubid=1,id=h3 -device e1000,mac=52:54:00:12:34:02,netdev=h3 \ ++ $nic1 -device e1000,mac=52:54:00:12:34:03,netdev=n1 \ ++ -netdev socket,connect=127.0.0.1:12372,id=n2 -device e1000,mac=52:54:00:12:34:04,netdev=n2 \ ++ $nic3 -device e1000,mac=52:54:00:12:34:05,netdev=n3 \ ++ -watchdog i6300esb -watchdog-action poweroff \ ++ -no-reboot \ ++ -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ ++ -initrd "$TESTDIR"/initramfs.testing ++ else ++ $testdir/run-qemu \ ++ -hda "$TESTDIR"/client.img -m 512M -smp 2 -nographic \ ++ -net socket,vlan=0,connect=127.0.0.1:12370 \ ++ ${do_vlan13:+-net socket,vlan=1,connect=127.0.0.1:12371} \ ++ -net socket,vlan=2,connect=127.0.0.1:12372 \ ++ ${do_vlan13:+-net socket,vlan=3,connect=127.0.0.1:12373} \ ++ -net nic,vlan=0,macaddr=52:54:00:12:34:01,model=e1000 \ ++ -net nic,vlan=0,macaddr=52:54:00:12:34:02,model=e1000 \ ++ -net nic,vlan=1,macaddr=52:54:00:12:34:03,model=e1000 \ ++ -net nic,vlan=2,macaddr=52:54:00:12:34:04,model=e1000 \ ++ -net nic,vlan=3,macaddr=52:54:00:12:34:05,model=e1000 \ ++ -watchdog i6300esb -watchdog-action poweroff \ ++ -no-reboot \ ++ -append "panic=1 $cmdline rd.debug $DEBUGFAIL rd.retry=5 rw console=ttyS0,115200n81 selinux=0 init=/sbin/init" \ ++ -initrd "$TESTDIR"/initramfs.testing ++ fi ++ ++ { ++ read OK ++ if [[ "$OK" != "OK" ]]; then ++ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]" ++ return 1 ++ fi ++ ++ while read line; do ++ [[ $line == END ]] && break ++ CONF+="$line " ++ done ++ } < "$TESTDIR"/client.img || return 1 ++ ++ if [[ "$check" != "$CONF" ]]; then ++ echo "Expected: '$check'" ++ echo ++ echo ++ echo "Got: '$CONF'" ++ echo "CLIENT TEST END: $test_name [FAILED - BAD CONF]" ++ return 1 ++ fi ++ ++ echo "CLIENT TEST END: $test_name [OK]" ++ return 0 ++} ++ ++ ++test_run() { ++ if ! run_server; then ++ echo "Failed to start server" 1>&2 ++ return 1 ++ fi ++ test_client || { kill_server; return 1; } ++} ++ ++test_client() { ++ client_test "Multiple VLAN" \ ++ "yes" \ ++ " ++vlan=vlan0001:ens5 ++vlan=vlan2:ens5 ++vlan=ens5.3:ens5 ++vlan=ens5.0004:ens5 ++ip=ens3:dhcp ++ip=192.168.54.101::192.168.54.1:24:test:vlan0001:none ++ip=192.168.55.102::192.168.55.1:24:test:vlan2:none ++ip=192.168.56.103::192.168.56.1:24:test:ens5.3:none ++ip=192.168.57.104::192.168.57.1:24:test:ens5.0004:none ++rd.neednet=1 ++root=nfs:192.168.50.1:/nfs/client bootdev=ens3 ++" \ ++ 'ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.0004 # Generated by dracut initrd NAME="ens5.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens5.0004" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.3 # Generated by dracut initrd NAME="ens5.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens5.3" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens5" EOF ' \ ++ || return 1 ++ ++ client_test "Multiple Bonds" \ ++ "yes" \ ++ " ++bond=bond0:ens4,ens5 ++bond=bond1:ens6,ens7 ++ip=bond0:dhcp ++ip=bond1:dhcp ++rd.neednet=1 ++root=nfs:192.168.50.1:/nfs/client bootdev=bond0 ++" \ ++ 'bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" EOF ' \ ++ || return 1 ++ ++ client_test "Multiple Bridges" \ ++ "no" \ ++ " ++bridge=br0:ens4,ens5 ++bridge=br1:ens6,ens7 ++ip=br0:dhcp ++ip=br1:dhcp ++rd.neednet=1 ++root=nfs:192.168.50.1:/nfs/client bootdev=br0 ++" \ ++ 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" EOF ' \ ++ || return 1 ++ ++ kill_server ++ return 0 ++} ++ ++test_setup() { ++ # Make server root ++ dd if=/dev/null of="$TESTDIR"/server.ext3 bs=1M seek=120 ++ mke2fs -j -F -- "$TESTDIR"/server.ext3 ++ mkdir -- "$TESTDIR"/mnt ++ mount -o loop -- "$TESTDIR"/server.ext3 "$TESTDIR"/mnt ++ kernel=$KVERSION ++ ( ++ export initdir="$TESTDIR"/mnt ++ . "$basedir"/dracut-init.sh ++ ++ ( ++ cd "$initdir"; ++ mkdir -p -- dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind} ++ mkdir -p -- var/lib/nfs/{v4recovery,rpc_pipefs} ++ chmod 777 -- var/lib/rpcbind var/lib/nfs ++ ) ++ ++ for _f in modules.builtin.bin modules.builtin; do ++ [[ $srcmods/$_f ]] && break ++ done || { ++ dfatal "No modules.builtin.bin and modules.builtin found!" ++ return 1 ++ } ++ ++ for _f in modules.builtin.bin modules.builtin modules.order; do ++ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" ++ done ++ ++ inst_multiple sh ls shutdown poweroff stty cat ps ln ip \ ++ dmesg mkdir cp ping exportfs \ ++ modprobe rpc.nfsd rpc.mountd showmount tcpdump \ ++ /etc/services sleep mount chmod ++ for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do ++ [ -f "${_terminfodir}"/l/linux ] && break ++ done ++ inst_multiple -o "${_terminfodir}"/l/linux ++ type -P portmap >/dev/null && inst_multiple portmap ++ type -P rpcbind >/dev/null && inst_multiple rpcbind ++ [ -f /etc/netconfig ] && inst_multiple /etc/netconfig ++ type -P dhcpd >/dev/null && inst_multiple dhcpd ++ [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd ++ instmods nfsd sunrpc ipv6 lockd af_packet 8021q ipvlan macvlan ++ inst_simple /etc/os-release ++ inst ./server-init.sh /sbin/init ++ inst ./hosts /etc/hosts ++ inst ./exports /etc/exports ++ inst ./dhcpd.conf /etc/dhcpd.conf ++ inst_multiple /etc/nsswitch.conf /etc/rpc /etc/protocols ++ ++ inst_multiple rpc.idmapd /etc/idmapd.conf ++ ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' ++ ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} ++ ++ inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' ++ ++ inst /etc/nsswitch.conf /etc/nsswitch.conf ++ inst /etc/passwd /etc/passwd ++ inst /etc/group /etc/group ++ ++ cp -a -- /etc/ld.so.conf* "$initdir"/etc ++ ldconfig -r "$initdir" ++ dracut_kernel_post ++ ) ++ ++ # Make client root inside server root ++ ( ++ export initdir="$TESTDIR"/mnt/nfs/client ++ . "$basedir"/dracut-init.sh ++ inst_multiple sh shutdown poweroff stty cat ps ln ip \ ++ mount dmesg mkdir cp ping grep ls sort ++ for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do ++ [[ -f ${_terminfodir}/l/linux ]] && break ++ done ++ inst_multiple -o "${_terminfodir}"/l/linux ++ inst_simple /etc/os-release ++ inst ./client-init.sh /sbin/init ++ ( ++ cd "$initdir" ++ mkdir -p -- dev sys proc etc run ++ mkdir -p -- var/lib/nfs/rpc_pipefs ++ ) ++ inst /etc/nsswitch.conf /etc/nsswitch.conf ++ inst /etc/passwd /etc/passwd ++ inst /etc/group /etc/group ++ ++ inst_multiple rpc.idmapd /etc/idmapd.conf ++ inst_libdir_file 'libnfsidmap_nsswitch.so*' ++ inst_libdir_file 'libnfsidmap/*.so*' ++ inst_libdir_file 'libnfsidmap*.so*' ++ ++ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' -- /etc/nsswitch.conf \ ++ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') ++ _nsslibs=${_nsslibs#|} ++ _nsslibs=${_nsslibs%|} ++ ++ inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' ++ ++ cp -a -- /etc/ld.so.conf* "$initdir"/etc ++ ldconfig -r "$initdir" ++ ) ++ ++ umount "$TESTDIR"/mnt ++ rm -fr -- "$TESTDIR"/mnt ++ ++ # Make an overlay with needed tools for the test harness ++ ( ++ export initdir="$TESTDIR"/overlay ++ . "$basedir"/dracut-init.sh ++ inst_multiple poweroff shutdown ++ inst_hook emergency 000 ./hard-off.sh ++ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules ++ ) ++ ++ # Make server's dracut image ++ $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ ++ --no-early-microcode \ ++ -m "udev-rules base rootfs-block fs-lib debug kernel-modules watchdog" \ ++ -d "ipvlan macvlan af_packet piix ide-gd_mod ata_piix ext3 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \ ++ --no-hostonly-cmdline -N \ ++ -f "$TESTDIR"/initramfs.server "$KVERSION" || return 1 ++ ++ # Make client's dracut image ++ $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ ++ --no-early-microcode \ ++ -o "plymouth" \ ++ -a "debug" \ ++ -d "ipvlan macvlan af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \ ++ --no-hostonly-cmdline -N \ ++ -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 ++} ++ ++kill_server() { ++ if [[ -s "$TESTDIR"/server.pid ]]; then ++ kill -TERM -- $(cat "$TESTDIR"/server.pid) ++ rm -f -- "$TESTDIR"/server.pid ++ fi ++} ++ ++test_cleanup() { ++ kill_server ++} ++ ++. "$testdir"/test-functions + diff --git a/0044.patch b/0044.patch new file mode 100644 index 0000000..b2c4f7f --- /dev/null +++ b/0044.patch @@ -0,0 +1,53 @@ +From 3b89c398895abe5fc62e3c9240718310222925ef Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 10 Jun 2019 16:04:33 +0200 +Subject: [PATCH] test/IFCFG: make sure the network-legacy plugin is being used + +If the network-manager plugin is used instead, it wouldn't write out +ifcfg files and we wouldn't have anything to check. + +While at that, also enable the test. + +(cherry picked from commit 2b1b3bcdcb0ddaa18337f18da515adb6284df0ab) +--- + .travis.yml | 1 + + README.md | 1 + + test/TEST-60-IFCFG/test.sh | 2 +- + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/.travis.yml b/.travis.yml +index 364078cf..37002e9a 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -11,6 +11,7 @@ env: + - IMAGE=latest TESTS=50 + - IMAGE=latest TESTS=30 + - IMAGE=latest TESTS=31 ++ - IMAGE=latest TESTS=60 + - IMAGE=latest TESTS=70 + - IMAGE=latest TESTS=99 + - IMAGE=latest TESTS=02 +diff --git a/README.md b/README.md +index 36ae7e1b..530f1c1b 100644 +--- a/README.md ++++ b/README.md +@@ -27,4 +27,5 @@ dracut is an initramfs infrastructure. + - Test 31: [![Test 31](https://ci.centos.org/job/dracut-matrix-master/TESTS=31,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=31,label=dracut-ci-slave01/) + - Test 40: [![Test 40](https://ci.centos.org/job/dracut-matrix-master/TESTS=40,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=40,label=dracut-ci-slave01/) + - Test 50: [![Test 50](https://ci.centos.org/job/dracut-matrix-master/TESTS=50,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=50,label=dracut-ci-slave01/) ++- Test 60: [![Test 60](https://ci.centos.org/job/dracut-matrix-master/TESTS=60,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=60,label=dracut-ci-slave01/) + - Test 70: [![Test 70](https://ci.centos.org/job/dracut-matrix-master/TESTS=70,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=70,label=dracut-ci-slave01/) +diff --git a/test/TEST-60-IFCFG/test.sh b/test/TEST-60-IFCFG/test.sh +index 8c11a7d3..8e8bd982 100755 +--- a/test/TEST-60-IFCFG/test.sh ++++ b/test/TEST-60-IFCFG/test.sh +@@ -316,7 +316,7 @@ test_setup() { + $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \ + --no-early-microcode \ + -o "plymouth" \ +- -a "debug" \ ++ -a "debug network-legacy" \ + -d "ipvlan macvlan af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \ + --no-hostonly-cmdline -N \ + -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 + diff --git a/0045.patch b/0045.patch new file mode 100644 index 0000000..2c2ccca --- /dev/null +++ b/0045.patch @@ -0,0 +1,83 @@ +From 15ff303dde65e97ba224a9f2cc6275cbaafee52c Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 10 Jun 2019 16:05:23 +0200 +Subject: [PATCH] test/BONDBRIDGETEAMVLAN: don't assert against ifcfg files + +The network-manager module writes keyfiles instead of ifcfg files. Just +check whether the configuration got actually applied correctly. + +(cherry picked from commit 9dfd73bcbd899d8da4bc680fa8b3326c47b939bd) +--- + test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh | 6 +----- + test/TEST-70-BONDBRIDGETEAMVLAN/test.sh | 12 ++++++------ + 2 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh +index 8c33ff0f..083e0f59 100755 +--- a/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh ++++ b/test/TEST-70-BONDBRIDGETEAMVLAN/client-init.sh +@@ -10,11 +10,7 @@ echo "made it to the rootfs! Powering down." + + ( + echo OK +- ip -o -4 address show scope global | while read n if rest; do echo $if;done | sort +- for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do +- echo $i +- grep -v 'UUID=' $i +- done ++ ip -o -4 address show scope global |sed -n 's/^[^:]*: \([^ ]*\) *\(.*\) scope.*/\1 \2/p' |sort + echo EOF + ) > /dev/sda + +diff --git a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +index 5618baee..b6dd080c 100755 +--- a/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh ++++ b/test/TEST-70-BONDBRIDGETEAMVLAN/test.sh +@@ -112,8 +112,8 @@ client_test() { + done + } < "$TESTDIR"/client.img || return 1 + +- if [[ "$check" != "$CONF" ]]; then +- echo "Expected: '$check'" ++ if [[ ! "$CONF" =~ ^$check$ ]]; then ++ echo "Expected: /^$check\$/" + echo + echo + echo "Got: '$CONF'" +@@ -150,7 +150,7 @@ ip=192.168.57.104::192.168.57.1:24:test:ens5.0004:none + rd.neednet=1 + root=nfs:192.168.50.1:/nfs/client bootdev=ens3 + " \ +- 'ens3 ens5.0004 ens5.3 vlan0001 vlan2 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens3 # Generated by dracut initrd NAME="ens3" DEVICE="ens3" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Ethernet /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.0004 # Generated by dracut initrd NAME="ens5.0004" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.57.104" PREFIX="24" GATEWAY="192.168.57.1" TYPE=Vlan DEVICE="ens5.0004" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5.3 # Generated by dracut initrd NAME="ens5.3" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.56.103" PREFIX="24" GATEWAY="192.168.56.1" TYPE=Vlan DEVICE="ens5.3" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan0001 # Generated by dracut initrd NAME="vlan0001" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.54.101" PREFIX="24" GATEWAY="192.168.54.1" TYPE=Vlan DEVICE="vlan0001" VLAN=yes PHYSDEV="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-vlan2 # Generated by dracut initrd NAME="vlan2" ONBOOT=yes NETBOOT=yes BOOTPROTO=none IPADDR="192.168.55.102" PREFIX="24" GATEWAY="192.168.55.1" TYPE=Vlan DEVICE="vlan2" VLAN=yes PHYSDEV="ens5" EOF ' \ ++ 'ens3 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 ens5\.0004 inet 192\.168\.57\.104/24 brd 192\.168\.57\.255 ens5\.3 inet 192\.168\.56\.103/24 brd 192\.168\.56\.255 vlan0001 inet 192\.168\.54\.101/24 brd 192\.168\.54\.255 vlan2 inet 192\.168\.55\.102/24 brd 192\.168\.55\.255 EOF ' \ + || return 1 + + client_test "Multiple Bonds" \ +@@ -163,7 +163,7 @@ ip=bond1:dhcp + rd.neednet=1 + root=nfs:192.168.50.1:/nfs/client bootdev=bond0 + " \ +- 'bond0 bond1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond0 # Generated by dracut initrd NAME="bond0" DEVICE="bond0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond0" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-bond1 # Generated by dracut initrd NAME="bond1" DEVICE="bond1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp BONDING_OPTS="" NAME="bond1" TYPE=Bond /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes SLAVE=yes MASTER="bond1" DEVICE="ens7" EOF ' \ ++ 'bond0 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 bond1 inet 192\.168\.51\.[0-9]*/24 brd 192\.168\.51\.255 EOF ' \ + || return 1 + + client_test "Multiple Bridges" \ +@@ -176,7 +176,7 @@ ip=br1:dhcp + rd.neednet=1 + root=nfs:192.168.50.1:/nfs/client bootdev=br0 + " \ +- 'br0 br1 /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br0 # Generated by dracut initrd NAME="br0" DEVICE="br0" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br0" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-br1 # Generated by dracut initrd NAME="br1" DEVICE="br1" ONBOOT=yes NETBOOT=yes IPV6INIT=yes BOOTPROTO=dhcp TYPE=Bridge NAME="br1" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens4 # Generated by dracut initrd NAME="ens4" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens4" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens5 # Generated by dracut initrd NAME="ens5" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br0" DEVICE="ens5" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens6 # Generated by dracut initrd NAME="ens6" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens6" /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-ens7 # Generated by dracut initrd NAME="ens7" TYPE=Ethernet ONBOOT=yes NETBOOT=yes BRIDGE="br1" DEVICE="ens7" EOF ' \ ++ 'br0 inet 192\.168\.50\.[0-9]*/24 brd 192\.168\.50\.255 br1 inet 192\.168\.51\.[0-9]*/24 brd 192\.168\.51\.255 EOF ' \ + || return 1 + + kill_server +@@ -260,7 +260,7 @@ test_setup() { + export initdir="$TESTDIR"/mnt/nfs/client + . "$basedir"/dracut-init.sh + inst_multiple sh shutdown poweroff stty cat ps ln ip \ +- mount dmesg mkdir cp ping grep ls sort ++ mount dmesg mkdir cp ping grep ls sort sed + for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do + [[ -f ${_terminfodir}/l/linux ]] && break + done + diff --git a/0046.patch b/0046.patch new file mode 100644 index 0000000..0a30c85 --- /dev/null +++ b/0046.patch @@ -0,0 +1,37 @@ +From 96976e84e2c8544ab32026f05da8a35b9c48b2e5 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Mon, 10 Jun 2019 16:05:49 +0200 +Subject: [PATCH] test/MULTINIC: correctly note activated devices when using + network-manager + +The .did-setup files are not there. What is there is the NetworkManager +connection files. + +(cherry picked from commit 393fb1ac05ec3386a07d885e99985a647634803e) +--- + test/TEST-50-MULTINIC/client-init.sh | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/test/TEST-50-MULTINIC/client-init.sh b/test/TEST-50-MULTINIC/client-init.sh +index 529379f0..7099dcf3 100755 +--- a/test/TEST-50-MULTINIC/client-init.sh ++++ b/test/TEST-50-MULTINIC/client-init.sh +@@ -105,7 +105,17 @@ export TERM=linux + export PS1='initramfs-test:\w\$ ' + stty sane + echo "made it to the rootfs! Powering down." ++for i in /sys/class/net/*/ ++do ++ # booting with network-manager module ++ state=/run/NetworkManager/devices/$(cat $i/ifindex) ++ grep -q connection-uuid= $state 2>/dev/null || continue ++ i=${i##*/} ++ ip link show $i |grep -q master && continue ++ IFACES+="$i " ++done + for i in /run/initramfs/net.*.did-setup; do ++ # booting with network-legacy module + [ -f "$i" ] || continue + strglobin "$i" ":*:*:*:*:" && continue + i=${i%.did-setup} + diff --git a/0047.patch b/0047.patch new file mode 100644 index 0000000..e30ed6a --- /dev/null +++ b/0047.patch @@ -0,0 +1,115 @@ +From 08961eef2ad09e4ce38ee034baf4e8c2b3934cd1 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Tue, 3 Sep 2019 10:44:36 -0500 +Subject: [PATCH] modules.d: fix udev rules detection of multipath devices + +Starting with the 0.7.7 release of the multipath tools, the multipath +udev rules always set a value in ENV{DM_MULTIPATH_DEVICE_PATH} for any +device that multipath scans. A value of 0 means that the device is not +claimed by multipath, and a value of 1 means that it is. Because of +this, udev rules that check ENV{DM_MULTIPATH_DEVICE_PATH}=="?*" will +always return True, and act as if every scanned device is claimed by +multipath. Checking ENV{DM_MULTIPATH_DEVICE_PATH}=="1" will work +correctly for both the old and new versions of the multipath tools. +--- + modules.d/90dm/59-persistent-storage-dm.rules | 2 +- + modules.d/90dmraid/61-dmraid-imsm.rules | 2 +- + modules.d/90lvm/64-lvm.rules | 2 +- + modules.d/90mdraid/59-persistent-storage-md.rules | 2 +- + modules.d/90mdraid/65-md-incremental-imsm.rules | 2 +- + modules.d/95udev-rules/59-persistent-storage.rules | 2 +- + modules.d/95udev-rules/61-persistent-storage.rules | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/modules.d/90dm/59-persistent-storage-dm.rules b/modules.d/90dm/59-persistent-storage-dm.rules +index 73b09376..2be11227 100644 +--- a/modules.d/90dm/59-persistent-storage-dm.rules ++++ b/modules.d/90dm/59-persistent-storage-dm.rules +@@ -1,7 +1,7 @@ + SUBSYSTEM!="block", GOTO="dm_end" + ACTION!="add|change", GOTO="dm_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="dm_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="dm_end" + + KERNEL!="dm-[0-9]*", GOTO="dm_end" + ACTION=="add", GOTO="dm_end" +diff --git a/modules.d/90dmraid/61-dmraid-imsm.rules b/modules.d/90dmraid/61-dmraid-imsm.rules +index 72267d3c..8a6b215e 100644 +--- a/modules.d/90dmraid/61-dmraid-imsm.rules ++++ b/modules.d/90dmraid/61-dmraid-imsm.rules +@@ -5,7 +5,7 @@ + SUBSYSTEM!="block", GOTO="dm_end" + ACTION!="add|change", GOTO="dm_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="dm_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="dm_end" + + ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end" + +diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules +index 3ce0c1f6..65f65249 100644 +--- a/modules.d/90lvm/64-lvm.rules ++++ b/modules.d/90lvm/64-lvm.rules +@@ -7,7 +7,7 @@ + SUBSYSTEM!="block", GOTO="lvm_end" + ACTION!="add|change", GOTO="lvm_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="lvm_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end" + KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" + ENV{ID_FS_TYPE}!="LVM?_member", GOTO="lvm_end" + +diff --git a/modules.d/90mdraid/59-persistent-storage-md.rules b/modules.d/90mdraid/59-persistent-storage-md.rules +index 6ef858aa..96b10108 100644 +--- a/modules.d/90mdraid/59-persistent-storage-md.rules ++++ b/modules.d/90mdraid/59-persistent-storage-md.rules +@@ -1,7 +1,7 @@ + SUBSYSTEM!="block", GOTO="md_end" + ACTION!="add|change", GOTO="md_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="md_end" + + KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" + +diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules +index d66dd012..52f5b195 100644 +--- a/modules.d/90mdraid/65-md-incremental-imsm.rules ++++ b/modules.d/90mdraid/65-md-incremental-imsm.rules +@@ -9,7 +9,7 @@ KERNEL=="md*", ENV{ID_FS_TYPE}!="linux_raid_member", GOTO="md_end" + KERNEL=="md*", ACTION!="change", GOTO="md_end" + + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="md_end" + + ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_try" + GOTO="md_end" +diff --git a/modules.d/95udev-rules/59-persistent-storage.rules b/modules.d/95udev-rules/59-persistent-storage.rules +index 47ff6edd..8d8650f7 100644 +--- a/modules.d/95udev-rules/59-persistent-storage.rules ++++ b/modules.d/95udev-rules/59-persistent-storage.rules +@@ -1,7 +1,7 @@ + SUBSYSTEM!="block", GOTO="ps_end" + ACTION!="add|change", GOTO="ps_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="ps_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="ps_end" + + KERNEL=="cciss[0-9]*", IMPORT BLKID + KERNEL=="nbd[0-9]*", IMPORT BLKID +diff --git a/modules.d/95udev-rules/61-persistent-storage.rules b/modules.d/95udev-rules/61-persistent-storage.rules +index 37148b07..895ecebd 100644 +--- a/modules.d/95udev-rules/61-persistent-storage.rules ++++ b/modules.d/95udev-rules/61-persistent-storage.rules +@@ -1,7 +1,7 @@ + SUBSYSTEM!="block", GOTO="pss_end" + ACTION!="add|change", GOTO="pss_end" + # Also don't process disks that are slated to be a multipath device +-ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="pss_end" ++ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="pss_end" + + ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" + KERNEL=="cciss[0-9]*", GOTO="do_pss" + diff --git a/0048.patch b/0048.patch new file mode 100644 index 0000000..1dd087a --- /dev/null +++ b/0048.patch @@ -0,0 +1,43 @@ +From b59ae228851713f645751742136e34b854b0712a Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 10 Nov 2016 13:57:26 +0100 +Subject: [PATCH] test/test-rpms.txt: add list of rpms to install + +(cherry picked from commit f432d367fc4fa7558761cb9bb4229e6c027bfa31) +--- + test/test-rpms.txt | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/test/test-rpms.txt b/test/test-rpms.txt +new file mode 100644 +index 00000000..1723d8e9 +--- /dev/null ++++ b/test/test-rpms.txt +@@ -0,0 +1,26 @@ ++dash ++bridge-utils ++asciidoc ++mdadm ++lvm2 ++dmraid ++cryptsetup ++nfs-utils ++nbd ++dhcp-server ++scsi-target-utils ++iscsi-initiator-utils ++net-tools ++strace ++syslinux ++python-imgcreate ++genisoimage ++btrfs-progs ++bridge-utils ++kmod-devel ++gcc ++bzip2 ++xz ++tar ++wget ++rpm-build + diff --git a/0049.patch b/0049.patch new file mode 100644 index 0000000..e23f5fd --- /dev/null +++ b/0049.patch @@ -0,0 +1,23 @@ +From 4ef5cdc120bdbb348345c964a19affbb3ca1fa32 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 11 Nov 2016 11:40:58 +0100 +Subject: [PATCH] test/test-rpms.txt: add gzip + +(cherry picked from commit 7b4173d698be5163da1e5b5b52bafd2facba4db5) +--- + test/test-rpms.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/test-rpms.txt b/test/test-rpms.txt +index 1723d8e9..10596da7 100644 +--- a/test/test-rpms.txt ++++ b/test/test-rpms.txt +@@ -19,6 +19,7 @@ btrfs-progs + bridge-utils + kmod-devel + gcc ++gzip + bzip2 + xz + tar + diff --git a/0050.patch b/0050.patch new file mode 100644 index 0000000..413d8b7 --- /dev/null +++ b/0050.patch @@ -0,0 +1,23 @@ +From fe44aa1b14f427245bdfb2026f2211a19b52f5e3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 11 Nov 2016 12:34:00 +0100 +Subject: [PATCH] test-rpms.txt: add dhcp + +(cherry picked from commit a081e072d894c91fcf037e267cb6793c4b0356c4) +--- + test/test-rpms.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/test-rpms.txt b/test/test-rpms.txt +index 10596da7..95376bd2 100644 +--- a/test/test-rpms.txt ++++ b/test/test-rpms.txt +@@ -8,6 +8,7 @@ cryptsetup + nfs-utils + nbd + dhcp-server ++dhcp + scsi-target-utils + iscsi-initiator-utils + net-tools + diff --git a/0051.patch b/0051.patch new file mode 100644 index 0000000..158b434 --- /dev/null +++ b/0051.patch @@ -0,0 +1,19 @@ +From 81babdedec8c6f7b23bbf0e3418126c4f9e5e15f Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Tue, 10 Sep 2019 16:46:55 +0200 +Subject: [PATCH] test-rpms.txt: add util-linux into the dependency list + +--- + test/test-rpms.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/test-rpms.txt b/test/test-rpms.txt +index 95376bd2..02577c8a 100644 +--- a/test/test-rpms.txt ++++ b/test/test-rpms.txt +@@ -26,3 +26,4 @@ xz + tar + wget + rpm-build ++util-linux + diff --git a/0052.patch b/0052.patch new file mode 100644 index 0000000..5a338e0 --- /dev/null +++ b/0052.patch @@ -0,0 +1,33 @@ +From 7843bc52777683f6a4ef953d8dde7171ff3b911c Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 24 Jul 2019 16:45:19 +0200 +Subject: [PATCH] [RHEL] network: default to network-legacy even in presence of + nm-initrd-generator + +In RHEL 8.2, NetworkManager will ship with the nm-initrd-generator, but +before the install bits fall into place we want to default to network-legacy. + +This unblocks the enablement of the NetworkManager bits and is intended +to be reverted later on. +--- + 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 8e2a74a3..bf252eb7 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 " +- if ! dracut_module_included "network-legacy" && [ -x "/usr/libexec/nm-initrd-generator" ] ; then +- echo "network-manager" +- else ++ # RHEL 8.1: Default to network-legacy unless the user chose ++ # network-manager manually ++ if ! dracut_module_included "network-manager" ; then + echo "network-legacy" + fi + return 0 + diff --git a/0053.patch b/0053.patch new file mode 100644 index 0000000..ef9e265 --- /dev/null +++ b/0053.patch @@ -0,0 +1,32 @@ +From dcbc74b01bfb360eecadb8e59480472b86fe63d0 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Tue, 29 Oct 2019 09:35:41 -0400 +Subject: [PATCH] 01fips: fix HMAC file path resolution + +There is a small regression in #343: when handling the 'separate boot +partition' case, we're checking for the kernel image in the wrong +location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image, +so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g. +`/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`. + +We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next +if-statement does this correctly, so it might've just been accidentally +left out of #343). +--- + modules.d/01fips/fips.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index beaa692b..c3dbcf74 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -118,7 +118,7 @@ do_fips() + + if [ -z "$BOOT_IMAGE_NAME" ]; then + BOOT_IMAGE_NAME="vmlinuz-${KERNEL}" +- elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then ++ elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then + #if /boot is not a separate partition BOOT_IMAGE might start with /boot + BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"} + #on some achitectures BOOT_IMAGE does not contain path to kernel + diff --git a/0054.patch b/0054.patch new file mode 100644 index 0000000..489c715 --- /dev/null +++ b/0054.patch @@ -0,0 +1,33 @@ +From 14310ca42f06c2156ab5cefd05dbaa47ae3b054d Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Tue, 29 Oct 2019 16:47:34 -0400 +Subject: [PATCH] 01fips: run sha512hmac from directory HMAC file directory + +That way, the HMAC file can contain a relative path instead of an +absolute one. The issue is that right now the kernel RPM bakes the +`/boot/vmlinuz-${kver}` path into the HMAC file which poses an issue for +rpm-ostree systems (and any other system where the kernel isn't simply +in the top-level `/boot`. + +For now, we're hacking around this in rpm-ostree: +https://github.com/coreos/rpm-ostree/pull/1934 + +Though I'd like to propose the same change in the kernel spec file. +--- + modules.d/01fips/fips.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index c3dbcf74..893143d0 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -135,7 +135,7 @@ do_fips() + return 1 + fi + +- sha512hmac -c "${BOOT_IMAGE_HMAC}" || return 1 ++ (cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1 + fi + + info "All initrd crypto checks done" + diff --git a/0055.patch b/0055.patch new file mode 100644 index 0000000..2d59629 --- /dev/null +++ b/0055.patch @@ -0,0 +1,26 @@ +From 89dcbbe92f008f6c4ebccfedf09d32bab4a575e5 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Tue, 29 Oct 2019 16:53:00 -0400 +Subject: [PATCH] 01fips: add / in BOOT_IMAGE_HMAC filename for clarity + +It's already the case the `BOOT_IMAGE_PATH` today, in the non-empty +case, includes a trailing `/`, but let's add it to the path we build +here too to make it more obvious. +--- + modules.d/01fips/fips.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index 893143d0..de2755b0 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -129,7 +129,7 @@ do_fips() + fi + fi + +- BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}.${BOOT_IMAGE_NAME}.hmac" ++ BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac" + if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then + warn "${BOOT_IMAGE_HMAC} does not exist" + return 1 + diff --git a/0056.patch b/0056.patch new file mode 100644 index 0000000..90ac5a9 --- /dev/null +++ b/0056.patch @@ -0,0 +1,34 @@ +From 9e8f172dc01f7e013bb5d302ef6c90e2dc6b30c8 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Tue, 29 Oct 2019 16:54:10 -0400 +Subject: [PATCH] 01fips: trim off GRUB boot device from BOOT_IMAGE + +E.g. in RHCOS, the `BOOT_IMAGE` from the cmdline is: + +(hd0,gpt1)/ostree/rhcos-e493371e5ee8407889029ec979955a2b86fd7e3cae5a0591b9db1cd248d966e8/vmlinuz-4.18.0-146.el8.x86_64 + +Which of course is a GRUB thing, not an actual pathname we'll be able to +resolve. In fact, we can simply scrap it off from the variable. Our code +is already able to handle both cases: whether the device refers to a +separate boot partition, or just the root filesystem with a regular +`/boot` directory. +--- + modules.d/01fips/fips.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index de2755b0..559952ca 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -113,6 +113,10 @@ do_fips() + do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1 + else + BOOT_IMAGE="$(getarg BOOT_IMAGE)" ++ ++ # Trim off any leading GRUB boot device (e.g. ($root) ) ++ BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')" ++ + BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}" + BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}" + + diff --git a/0057.patch b/0057.patch new file mode 100644 index 0000000..0729b82 --- /dev/null +++ b/0057.patch @@ -0,0 +1,25 @@ +From 346e57c1b6af4e2cfdbaae64941f2f3b8454a944 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 29 Nov 2019 13:29:23 +0100 +Subject: [PATCH] always include sg module + +RHEL-only +Resolves:#1579763 +--- + modules.d/00systemd/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 1ed4b34f..ed177826 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -18,7 +18,7 @@ depends() { + } + + installkernel() { +- hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256 ++ hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256 sg + instmods -s efivarfs + } + + diff --git a/0058.patch b/0058.patch new file mode 100644 index 0000000..728e07b --- /dev/null +++ b/0058.patch @@ -0,0 +1,44 @@ +From 8061a432844d1f780d9b18144def0faef0145c0c Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 7 Oct 2019 16:48:09 +0200 +Subject: [PATCH] net-lib: check if addr exists before checking for dad state + +Before we check if dad is done we should first make sure, +that there is a link local address where we do the check. + +Due to this issue, on ipv6 only setups sometimes dhclient started +asking for ip address, before the link local address was present +and failed immediately. + +(cherry picked from commit daa49cc2216d6387541ef36e8427081f6b02f224) + +Resolves: #1765014 +--- + modules.d/40network/net-lib.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index ad78d225..dcb53804 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -653,7 +653,8 @@ wait_for_ipv6_dad_link() { + timeout=$(($timeout*10)) + + while [ $cnt -lt $timeout ]; do +- [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \ ++ [ -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)" ] \ +@@ -671,7 +672,8 @@ wait_for_ipv6_dad() { + timeout=$(($timeout*10)) + + while [ $cnt -lt $timeout ]; do +- [ -z "$(ip -6 addr show dev "$1" tentative)" ] \ ++ [ -n "$(ip -6 addr show dev "$1")" ] \ ++ && [ -z "$(ip -6 addr show dev "$1" tentative)" ] \ + && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \ + && return 0 + [ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \ + diff --git a/0059.patch b/0059.patch new file mode 100644 index 0000000..625a662 --- /dev/null +++ b/0059.patch @@ -0,0 +1,58 @@ +From 2caaf8b9ba5b95983154bd641f0f493ff1562cc0 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 6 Aug 2019 15:39:31 +0800 +Subject: [PATCH] 99squash: Only start the cleaner on switch-root + +Currently it starts the cleaner early and do the clean up job if switch +root is called. It's better to just start the service only on switch +root to avoid any risk of service dependency failure and make is +simpler. + +Signed-off-by: Kairui Song +(cherry picked from commit 5d88809319049eb06e3472dcd11cca9c4557d8c2) + +Resolves: #1678248 +--- + modules.d/99squash/module-setup.sh | 3 ++- + modules.d/99squash/squash-mnt-clear.service | 11 ++++------- + 2 files changed, 6 insertions(+), 8 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 935fd721..e7e9ed8e 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -25,5 +25,6 @@ install() { + inst $moddir/init.sh /squash/init.sh + + inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service" +- ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd.target.wants/squash-mnt-clear.service" ++ mkdir -p "$initdir$systemdsystemunitdir/initrd-switch-root.target.wants" ++ ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd-switch-root.target.wants/squash-mnt-clear.service" + } +diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service +index f8d5db46..84441f60 100644 +--- a/modules.d/99squash/squash-mnt-clear.service ++++ b/modules.d/99squash/squash-mnt-clear.service +@@ -4,17 +4,14 @@ + [Unit] + Description=Cleanup squashfs mounts when switch root + DefaultDependencies=no +-After=initrd.target +-After=dracut-initqueue.service dracut-pre-pivot.service +-Before=initrd-cleanup.service ++Before=initrd-switch-root.service ++After=initrd-switch-root.target + ConditionPathExists=/squash/root +-Conflicts=initrd-switch-root.target +-IgnoreOnIsolate=true + + [Service] + Type=oneshot +-RemainAfterExit=yes ++RemainAfterExit=no + StandardInput=null + StandardOutput=syslog+console + StandardError=syslog+console +-ExecStop=/squash/clear-squash.sh ++ExecStart=/squash/clear-squash.sh + diff --git a/0060.patch b/0060.patch new file mode 100644 index 0000000..1160079 --- /dev/null +++ b/0060.patch @@ -0,0 +1,31 @@ +From ab679e91396a21489999c0acc9243415cb3235db Mon Sep 17 00:00:00 2001 +From: Colin Walters +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 + diff --git a/0061.patch b/0061.patch new file mode 100644 index 0000000..efbe84d --- /dev/null +++ b/0061.patch @@ -0,0 +1,31 @@ +From 7164155795f3f257cd119846de0b2a802a6a52c5 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 \ + diff --git a/0062.patch b/0062.patch new file mode 100644 index 0000000..f082cac --- /dev/null +++ b/0062.patch @@ -0,0 +1,26 @@ +From d20eb7b7b2a50f29ac02bd6b6d80113d495849ed Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 \ + diff --git a/0063.patch b/0063.patch new file mode 100644 index 0000000..54fb550 --- /dev/null +++ b/0063.patch @@ -0,0 +1,31 @@ +From 46a8b8e9e7f150c2a17d4adeacb25ccf003ec425 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +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 + } + + diff --git a/0064.patch b/0064.patch new file mode 100644 index 0000000..807d03f --- /dev/null +++ b/0064.patch @@ -0,0 +1,39 @@ +From 86d48f5c45d2d2c19cb575fa377763c069e57b8a Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +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 \ + diff --git a/0065.patch b/0065.patch new file mode 100644 index 0000000..9796dec --- /dev/null +++ b/0065.patch @@ -0,0 +1,32 @@ +From 543b1cff3c84af062da4d27ba81a9d394f44e4b6 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 + diff --git a/0066.patch b/0066.patch new file mode 100644 index 0000000..6d9c266 --- /dev/null +++ b/0066.patch @@ -0,0 +1,36 @@ +From 3468310486d0da8d2a6c6bdcddc598b7b8ce5587 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 + diff --git a/0067.patch b/0067.patch new file mode 100644 index 0000000..ccf1829 --- /dev/null +++ b/0067.patch @@ -0,0 +1,45 @@ +From 7b14ab060e50d0035e4c0b1979d49234aa8896b0 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 until IPv6 automatic addresses are assigned. Default is 40 seconds. + + **rd.net.timeout.carrier=**____:: +- Wait until carrier is recognized. Default is 5 seconds. ++ Wait 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" + diff --git a/0068.patch b/0068.patch new file mode 100644 index 0000000..810417a --- /dev/null +++ b/0068.patch @@ -0,0 +1,37 @@ +From fa15223b70c04de0fdbd209a4bb1cb74876f7cfb Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +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 + diff --git a/0069.patch b/0069.patch new file mode 100644 index 0000000..d39d324 --- /dev/null +++ b/0069.patch @@ -0,0 +1,59 @@ +From d6d50a239eebf9da13a0d7892df00a0e725ef9d6 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +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 + diff --git a/0070.patch b/0070.patch new file mode 100644 index 0000000..a6c2bba --- /dev/null +++ b/0070.patch @@ -0,0 +1,38 @@ +From 07e7e84ebea1d76aeaa77d097b34503ec3c8f2e1 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +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 + diff --git a/0071.patch b/0071.patch new file mode 100644 index 0000000..5fdf588 --- /dev/null +++ b/0071.patch @@ -0,0 +1,47 @@ +From 02c096d138cc8c788daf5fae75408059cbc7e283 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +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 + diff --git a/0072.patch b/0072.patch new file mode 100644 index 0000000..0299ccc --- /dev/null +++ b/0072.patch @@ -0,0 +1,49 @@ +From b692dbc7f2c6a3fb4fa587d9d63b80e4626dafae Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +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 + diff --git a/0073.patch b/0073.patch new file mode 100644 index 0000000..ed97628 --- /dev/null +++ b/0073.patch @@ -0,0 +1,32 @@ +From 1ade0d247fda747ed33632a7746f9278b74feaa8 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +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.*" + } + diff --git a/0074.patch b/0074.patch new file mode 100644 index 0000000..2181942 --- /dev/null +++ b/0074.patch @@ -0,0 +1,33 @@ +From 0945c8070e436eef908a1f88c946df6c27d3bc41 Mon Sep 17 00:00:00 2001 +From: Peter Georg +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)} + + diff --git a/0075.patch b/0075.patch new file mode 100644 index 0000000..ba6445c --- /dev/null +++ b/0075.patch @@ -0,0 +1,426 @@ +From cf74193cc37f2ace1197b1e6ebacc6fe542767c8 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 + diff --git a/0076.patch b/0076.patch new file mode 100644 index 0000000..755c8a6 --- /dev/null +++ b/0076.patch @@ -0,0 +1,320 @@ +From adacd8101e7558930e4499c21006eaa14629c234 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 ++} + diff --git a/0077.patch b/0077.patch new file mode 100644 index 0000000..b61275e --- /dev/null +++ b/0077.patch @@ -0,0 +1,35 @@ +From 8b3033c92a073f9e63074ffcdb1af6e69d99105c Mon Sep 17 00:00:00 2001 +From: Attila Bruncsak +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 + diff --git a/0078.patch b/0078.patch new file mode 100644 index 0000000..b50250b --- /dev/null +++ b/0078.patch @@ -0,0 +1,108 @@ +From cbebaacfd05c55fddd11b3090983a2be1d2b48d3 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(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" + diff --git a/0079.patch b/0079.patch new file mode 100644 index 0000000..116dc2b --- /dev/null +++ b/0079.patch @@ -0,0 +1,30 @@ +From b36c1ff083499c2cf1d1dbb7fe1663a2dd0683cc Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(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" + diff --git a/0080.patch b/0080.patch new file mode 100644 index 0000000..f7fd767 --- /dev/null +++ b/0080.patch @@ -0,0 +1,93 @@ +From 90d96c4f6a44d895f8999da8c4721a04612e6379 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(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 + diff --git a/0081.patch b/0081.patch new file mode 100644 index 0000000..3d3edb1 --- /dev/null +++ b/0081.patch @@ -0,0 +1,63 @@ +From 9eb855e073c077966a011146484b9b9596857361 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(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=**____:____:: ++ Assign network device name (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 + diff --git a/0082.patch b/0082.patch new file mode 100644 index 0000000..57c726e --- /dev/null +++ b/0082.patch @@ -0,0 +1,33 @@ +From 4f43dd89a1f9c21f66d6b460c0ad1b271ee40492 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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 + diff --git a/0083.patch b/0083.patch new file mode 100644 index 0000000..d33965e --- /dev/null +++ b/0083.patch @@ -0,0 +1,37 @@ +From 34ef33adfbb0b44ba6143f4ced206f948d814f86 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 who helped discover and +debug this issue. + +Signed-off-by: Kairui Song +(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 + diff --git a/0084.patch b/0084.patch new file mode 100644 index 0000000..62e0cb1 --- /dev/null +++ b/0084.patch @@ -0,0 +1,42 @@ +From f47136bada397328d0a6f36a81138699c793fe92 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(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 + diff --git a/0085.patch b/0085.patch new file mode 100644 index 0000000..48c3511 --- /dev/null +++ b/0085.patch @@ -0,0 +1,72 @@ +From 689454c727c2730b6aa89ee4c4b7676900e07f78 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +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} + diff --git a/0086.patch b/0086.patch new file mode 100644 index 0000000..884e7a5 --- /dev/null +++ b/0086.patch @@ -0,0 +1,79 @@ +From fc05c818dd862de2b6771dabe242bc9d26aa2160 Mon Sep 17 00:00:00 2001 +From: Jan Synacek +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 + diff --git a/0087.patch b/0087.patch new file mode 100644 index 0000000..bc029da --- /dev/null +++ b/0087.patch @@ -0,0 +1,82 @@ +From 3067edf07449e1dbc2dae0776da9426274b34cba Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +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 ++} + diff --git a/0088.patch b/0088.patch new file mode 100644 index 0000000..0bc04d2 --- /dev/null +++ b/0088.patch @@ -0,0 +1,34 @@ +From 7143750cf2e37f9c14ec47a8170b9186136874d7 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +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 + diff --git a/0089.patch b/0089.patch new file mode 100644 index 0000000..497a94c --- /dev/null +++ b/0089.patch @@ -0,0 +1,25 @@ +From 6c0071bc72dbbdd2a958277618a9b2c64c6ee460 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 2 Jul 2020 14:33:20 +0200 +Subject: [PATCH] spec: don't use NM on existing installations + +Resolves: #1839706 +--- + dracut.spec | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dracut.spec b/dracut.spec +index c82c24f6..a8076c18 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -481,4 +481,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne + %{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh + %endif + ++%triggerin network -- dracut-network < 049-83.git20200525 ++echo '# Since rhel-8.3 dracut moved to use NetworkManager ++# On existing installations we want to preserve the old scripts ++add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf ++ + %changelog + diff --git a/0090.patch b/0090.patch new file mode 100644 index 0000000..e9ac5b7 --- /dev/null +++ b/0090.patch @@ -0,0 +1,79 @@ +From 73242b75af92bc86c26cfbe2954b7ecb9aaaf765 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 4 Dec 2018 10:02:45 +0100 +Subject: [PATCH] install/dracut-install.c: install module dependencies of + dependencies + +(cherry picked from commit c38f9e980c1ee03151dd1c6602907c6228b78d30) + +Resolves: #1846343 +--- + install/dracut-install.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 88bca1d4..253ae194 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -84,6 +84,11 @@ static bool arg_mod_filter_noname = false; + static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst); + + ++static inline void kmod_module_unrefp(struct kmod_module **p) { ++ if (*p) ++ kmod_module_unref(*p); ++} ++#define _cleanup_kmod_module_unref_ _cleanup_(kmod_module_unrefp) + + static inline void kmod_module_unref_listp(struct kmod_list **p) { + if (*p) +@@ -1234,28 +1239,45 @@ static bool check_module_path(const char *path) + static int install_dependent_modules(struct kmod_list *modlist) + { + struct kmod_list *itr; +- struct kmod_module *mod; + const char *path = NULL; + const char *name = NULL; + int ret = 0; + + kmod_list_foreach(itr, modlist) { ++ _cleanup_kmod_module_unref_ struct kmod_module *mod = NULL; + mod = kmod_module_get_module(itr); + path = kmod_module_get_path(mod); + ++ if (check_hashmap(items_failed, path)) ++ return -1; ++ ++ if (check_hashmap(items, path)) { ++ continue; ++ } ++ + name = kmod_module_get_name(mod); ++ + if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) { +- kmod_module_unref(mod); + continue; + } ++ + ret = dracut_install(path, &path[kerneldirlen], false, false, true); + if (ret == 0) { ++ _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; ++ _cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL; ++ _cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL; + log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]); + install_firmware(mod); ++ modlist = kmod_module_get_dependencies(mod); ++ ret = install_dependent_modules(modlist); ++ if (ret == 0) { ++ ret = kmod_module_get_softdeps(mod, &modpre, &modpost); ++ if (ret == 0) ++ ret = install_dependent_modules(modpre); ++ } + } else { + log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]); + } +- kmod_module_unref(mod); + } + + return ret; + diff --git a/0091.patch b/0091.patch new file mode 100644 index 0000000..ab3411e --- /dev/null +++ b/0091.patch @@ -0,0 +1,50 @@ +From e4e1ab4e129fa17c5e90a2144e15096b0267c22a Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 2 Jul 2020 09:08:03 +0200 +Subject: [PATCH] install: also install post weak dependencies of kernel + modules + +(cherry picked from commit 6dafdda4a6bdb8721133e4267553c5d86564f9e8) + +Resolves: #1846343 +--- + 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 253ae194..51f79422 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -1272,9 +1272,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]); + } +@@ -1335,8 +1339,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; + diff --git a/0092.patch b/0092.patch new file mode 100644 index 0000000..d88db81 --- /dev/null +++ b/0092.patch @@ -0,0 +1,55 @@ +From 818746166fec7c1e572ef12618edadc0535d4663 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(cherry picked from commit de3cb0e3214c3fbab3a94e705445b4d1c2bf0dff) + +Cherry-picked from: de3cb0e3214c3fbab3a94e705445b4d1c2bf0dff +Resolves: #1841077 +--- + dracut.sh | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 487add57..4c5176a1 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1578,15 +1578,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 "$_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 +@@ -1840,6 +1831,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 \ + diff --git a/0093.patch b/0093.patch new file mode 100644 index 0000000..a3db552 --- /dev/null +++ b/0093.patch @@ -0,0 +1,43 @@ +From d8c0b10b15940d88a28acbcf93354e4da0babb8d Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(cherry picked from commit 5a4c3469338410b6aea9452994b4b0af1ba59be7) + +Resolves: #1841077 +--- + dracut.sh | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index 4c5176a1..86e95449 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1840,6 +1840,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 + diff --git a/0094.patch b/0094.patch new file mode 100644 index 0000000..fae2e92 --- /dev/null +++ b/0094.patch @@ -0,0 +1,28 @@ +From 41739f232f3f353d45206ceee89ef0bc1c544f31 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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. + +(cherry picked from commit f7ad1479f277ddffcc501bd08919a4a4a6facc26) + +Resolves: #1854001 +--- + 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 c91ba10c..86852038 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -56,7 +56,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 [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then + diff --git a/0095.patch b/0095.patch new file mode 100644 index 0000000..ccc063b --- /dev/null +++ b/0095.patch @@ -0,0 +1,31 @@ +From 6616132de5ec2991e0b55eca6e9d12e50f7be293 Mon Sep 17 00:00:00 2001 +From: Doan Tran Cong Danh +Date: Fri, 8 Nov 2019 10:53:41 +0700 +Subject: [PATCH] multipath: require kpartx binary + +multipath requires kpartx to activate device mapper. +But kpartx is only a recommend dependency. + +Check for kpartx's existent first. + +Signed-off-by: Doan Tran Cong Danh +(cherry picked from commit cf31ed2ae687d9898cafc11ec6e4f478e806ad38) + +Resolves: #1888779 +--- + modules.d/90multipath/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index f825c00c..2b9a3166 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -29,6 +29,7 @@ check() { + + # if there's no multipath binary, no go. + require_binaries multipath || return 1 ++ require_binaries kpartx || return 1 + + return 0 + } + diff --git a/0096.patch b/0096.patch new file mode 100644 index 0000000..5948403 --- /dev/null +++ b/0096.patch @@ -0,0 +1,167 @@ +From 59d51f92475f1b4dc81b1e6f5537f63876952c39 Mon Sep 17 00:00:00 2001 +From: Jan Macku +Date: Fri, 8 Nov 2019 16:24:13 +0100 +Subject: [PATCH] Replace ln with systemctl + +(cherry picked from commit 70b19acf941c0bf41b2c69c761124425910c0653) + +Cherry-picked from: 70b19acf941c0bf41b2c69c761124425910c0653 +Resolves: #1888779 +--- + modules.d/00systemd/module-setup.sh | 6 ++---- + modules.d/02systemd-networkd/module-setup.sh | 8 ++++---- + modules.d/06rngd/module-setup.sh | 5 ++--- + modules.d/90multipath/module-setup.sh | 3 +-- + modules.d/90stratis/module-setup.sh | 3 +-- + modules.d/95iscsi/module-setup.sh | 8 +++----- + modules.d/98dracut-systemd/module-setup.sh | 3 +-- + modules.d/99squash/module-setup.sh | 3 +-- + 8 files changed, 15 insertions(+), 24 deletions(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index e4a3f323..4ab2a896 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -225,9 +225,7 @@ install() { + systemd-ask-password-console.service \ + systemd-ask-password-plymouth.service \ + ; do +- mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants" +- ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \ +- "${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service" ++ systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service + done + + mkdir -p "$initdir/etc/systemd" +@@ -239,6 +237,6 @@ install() { + echo "RateLimitBurst=0" + } >> "$initdir/etc/systemd/journald.conf" + +- ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target" ++ systemctl -q --root "$initdir" set-default multi-user.target + } + +diff --git a/modules.d/02systemd-networkd/module-setup.sh b/modules.d/02systemd-networkd/module-setup.sh +index b86751ea..8b87923f 100755 +--- a/modules.d/02systemd-networkd/module-setup.sh ++++ b/modules.d/02systemd-networkd/module-setup.sh +@@ -61,11 +61,11 @@ install() { + + for i in \ + systemd-networkd-wait-online.service \ +- systemd-networkd.service \ +- systemd-networkd.socket +-# systemd-timesyncd.service ++ systemd-networkd.service \ ++ systemd-networkd.socket ++# systemd-timesyncd.service + do +- systemctl --root "$initdir" enable "$i" ++ systemctl -q --root "$initdir" enable "$i" + done + } + +diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh +index 43d5c2d3..354bd0bb 100644 +--- a/modules.d/06rngd/module-setup.sh ++++ b/modules.d/06rngd/module-setup.sh +@@ -33,7 +33,6 @@ check() { + install() { + inst rngd + inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service" +- mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants" +- ln -rfs "${initdir}${systemdsystemunitdir}/rngd.service" \ +- "${initdir}${systemdsystemunitdir}/sysinit.target.wants/rngd.service" ++ ++ systemctl -q --root "$initdir" add-wants sysinit.target rngd.service + } +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 2b9a3166..8a032c86 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -110,8 +110,7 @@ install() { + + if dracut_module_included "systemd"; then + inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" +- mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants" +- ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service" ++ systemctl -q --root "$initdir" enable multipathd.service + else + inst_hook pre-trigger 02 "$moddir/multipathd.sh" + inst_hook cleanup 02 "$moddir/multipathd-stop.sh" +diff --git a/modules.d/90stratis/module-setup.sh b/modules.d/90stratis/module-setup.sh +index 29f0765b..943f572e 100755 +--- a/modules.d/90stratis/module-setup.sh ++++ b/modules.d/90stratis/module-setup.sh +@@ -24,8 +24,7 @@ install() { + + if dracut_module_included "systemd"; then + inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service" +- mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants" +- ln -rfs "${initdir}${systemdsystemunitdir}/stratisd-init.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/stratisd-init.service" ++ systemctl -q --root "$initdir" enable stratisd-init.service + else + inst_hook cmdline 25 "$moddir/stratisd-start.sh" + inst_hook cleanup 25 "$moddir/stratisd-stop.sh" +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index f6f3520d..47a92e94 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -242,20 +242,18 @@ install() { + $systemdsystemunitdir/iscsiuio.socket \ + iscsiadm iscsid + +- mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants" + for i in \ + iscsid.socket \ + iscsiuio.socket \ + ; do +- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}" ++ systemctl -q --root "$initdir" enable "$i" + done +- +- mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants" ++ + for i in \ + iscsid.service \ + iscsiuio.service \ + ; do +- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}" ++ systemctl -q --root "$initdir" add-wants basic.target "$i" + done + + # Make sure iscsid is started after dracut-cmdline and ready for the initqueue +diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh +index 900162c3..1387433a 100755 +--- a/modules.d/98dracut-systemd/module-setup.sh ++++ b/modules.d/98dracut-systemd/module-setup.sh +@@ -43,7 +43,6 @@ install() { + + inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator + +- mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" + for i in \ + dracut-cmdline.service \ + dracut-cmdline-ask.service \ +@@ -55,7 +54,7 @@ install() { + dracut-pre-udev.service \ + ; do + inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}" +- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}" ++ systemctl -q --root "$initdir" add-wants initrd.target "$i" + done + + inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf" +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index e7e9ed8e..7aa0b447 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -25,6 +25,5 @@ install() { + inst $moddir/init.sh /squash/init.sh + + inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service" +- mkdir -p "$initdir$systemdsystemunitdir/initrd-switch-root.target.wants" +- ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd-switch-root.target.wants/squash-mnt-clear.service" ++ systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service + } + diff --git a/0097.patch b/0097.patch new file mode 100644 index 0000000..f3c00ad --- /dev/null +++ b/0097.patch @@ -0,0 +1,104 @@ +From 603f33e28cfad45c4bf9ade8e3ff3b9014b5bd4d Mon Sep 17 00:00:00 2001 +From: Ben Howard +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). + +(cherry picked from commit b8a92b715677d52dbc2b27a710b9816fd8b9a63b) + +Resolves: #1888779 +--- + 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 4a7c2517..19b5cc87 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -406,6 +406,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 8a032c86..a7f250f3 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 + diff --git a/0098.patch b/0098.patch new file mode 100644 index 0000000..fa8c6f2 --- /dev/null +++ b/0098.patch @@ -0,0 +1,66 @@ +From 1e7a27bd5f463409392d34816a10bf108ee896c6 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Fri, 9 Oct 2020 19:44:35 -0400 +Subject: [PATCH] 98dracut-systemd: don't wait for root device if remote + cryptsetup active + +This is a plain and simple hack around dependency issues between dracut +and systemd. + +When using Tang-pinned LUKS root devices, we want to rely on +`systemd-cryptsetup@.service` to unlock it. However, that service only +runs `After=remote-fs-pre.target`, while `dracut-initqueue.service` has +`Before=remote-fs-pre.target` (which makes sense because we don't want +to attempt networked root devices before networking is up). + +However, the rootfs-generator here wants to make sure that the root +device exists *before* exiting the initqueue via an initqueue/finished +"devexists" hook. This will never work though because by design +`systemd-cryptsetup@.service`, which unlocks the root device, won't run +until after we exit. + +So we have a dependency cycle: + + initqueue -> devexists hook -> root device -> + systemd-cryptsetup@.service -> remote-fs-pre.target -> initqueue + +There's no clean way to break this. The root issue is that there's no +way right now to split sequencing of systemd services across the +initqueue/online and initqueue/finished events because it's all bundled +in a single service. (The deeper root issue of course is that we have +two init systems. :) ). + +Here we do a tactical fix: if there's a `systemd-cryptsetup@.service` +instance, let's assume it's for the root device and skip waiting for it +to show up if it depends on `remote-fs-pre.target`. + +(cherry picked from commit 512c51d2677dd1637cc203e3676fefb50a3d73d0) + +Resolves: #1897384 +--- + modules.d/98dracut-systemd/rootfs-generator.sh | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/modules.d/98dracut-systemd/rootfs-generator.sh b/modules.d/98dracut-systemd/rootfs-generator.sh +index 4ae693bb..bb376c0f 100755 +--- a/modules.d/98dracut-systemd/rootfs-generator.sh ++++ b/modules.d/98dracut-systemd/rootfs-generator.sh +@@ -13,8 +13,15 @@ generator_wait_for_dev() + + if ! [ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ]; then + +- printf '[ -e "%s" ]\n' $1 \ +- >> "$hookdir/initqueue/finished/devexists-${_name}.sh" ++ # If a LUKS device needs unlocking via systemd in the initrd, assume ++ # it's for the root device. In that case, don't block on it if it's ++ # after remote-fs-pre.target since the initqueue is ordered before it so ++ # it will never actually show up (think Tang-pinned rootfs). ++ cat > "$hookdir/initqueue/finished/devexists-${_name}.sh" << EOF ++if ! grep -q After=remote-fs-pre.target /run/systemd/generator/systemd-cryptsetup@*.service 2>/dev/null; then ++ [ -e "$1" ] ++fi ++EOF + { + printf '[ -e "%s" ] || ' $1 + printf 'warn "\"%s\" does not exist"\n' $1 + diff --git a/0099.patch b/0099.patch new file mode 100644 index 0000000..317e3a6 --- /dev/null +++ b/0099.patch @@ -0,0 +1,43 @@ +From aa4cf6df94dd3a858144040138d970a57c701a8d Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Thu, 12 Nov 2020 11:27:39 -0500 +Subject: [PATCH] 90crypt: pull in remote-cryptsetup.target enablement + +This should've been part of #964. As mentioned there, the +`initrd-cryptsetup.target` approach was reverted in the end, and we went +back to relying in `remote-cryptsetup.target`: + +https://github.com/systemd/systemd/pull/17467 + +So we do need to ship the enablement symlink for it. + +(cherry picked from commit a23a4680e7d04d1016e9d5e4b53b1e65f1ca98aa) + +Resolves: #1897384 +--- + modules.d/90crypt/module-setup.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh +index 1ec59096..a26b6dff 100755 +--- a/modules.d/90crypt/module-setup.sh ++++ b/modules.d/90crypt/module-setup.sh +@@ -120,6 +120,8 @@ install() { + inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh" + + if dracut_module_included "systemd"; then ++ # the cryptsetup targets are already pulled in by 00systemd, but not ++ # the enablement symlinks + inst_multiple -o \ + $systemdutildir/system-generators/systemd-cryptsetup-generator \ + $systemdutildir/systemd-cryptsetup \ +@@ -127,6 +129,8 @@ install() { + $systemdsystemunitdir/systemd-ask-password-console.service \ + $systemdsystemunitdir/cryptsetup.target \ + $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \ ++ $systemdsystemunitdir/remote-cryptsetup.target \ ++ $systemdsystemunitdir/initrd-root-device.target.wants/remote-cryptsetup.target \ + systemd-ask-password systemd-tty-ask-password-agent + inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator + fi + diff --git a/0100.patch b/0100.patch new file mode 100644 index 0000000..80c2999 --- /dev/null +++ b/0100.patch @@ -0,0 +1,33 @@ +From 045aa82701ecdebf8482b25dc0abf1b3b7cc3ce5 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 30 Nov 2020 11:04:42 +0100 +Subject: [PATCH] fix backport of 70b19acf + +The patch was missing an important hunk of the original diff which +converted another `ln_r` to `systemctl set-default`. Without it, the +initrd would try to boot `multi-user.target` instead of `initrd.target`. +The reason is that `systemctl set-default` modifies `/etc` while `ln_r` +modifies `/usr`. And so the `set-default multi-user.target` in 00systemd +takes priority over the `ln_r initrd.target` in `01systemd-initrd`. + +Thanks Jonathan Lebon for spotting this. + +Resolves: #1888779 +--- + modules.d/01systemd-initrd/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh +index cb8a8fa6..a42e220a 100755 +--- a/modules.d/01systemd-initrd/module-setup.sh ++++ b/modules.d/01systemd-initrd/module-setup.sh +@@ -36,7 +36,7 @@ install() { + $systemdsystemunitdir/initrd-udevadm-cleanup-db.service \ + $systemdsystemunitdir/initrd-parse-etc.service + +- ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target" ++ systemctl -q --root "$initdir" set-default initrd.target + + local VERSION="" + local PRETTY_NAME="" + diff --git a/0101.patch b/0101.patch new file mode 100644 index 0000000..27ad4a6 --- /dev/null +++ b/0101.patch @@ -0,0 +1,29 @@ +From 08ef5f0da71b84f606c2a75bd0574b206b997fc3 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 27 Nov 2020 09:32:20 +0100 +Subject: [PATCH] multipathd: fix the comparison + +From shellcheck: +/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2039]: In POSIX sh, == in place of = is undefined. +/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2193]: The arguments to this comparison can never be equal. + +(cherry picked from commit 7c2521091f30d7c14caaf96850208afa2fe1d811) + +Resolves: #1888779 +--- + modules.d/90multipath/multipathd.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh +index 936c5dc7..b0183ffe 100755 +--- a/modules.d/90multipath/multipathd.sh ++++ b/modules.d/90multipath/multipathd.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-if [ "$(getarg rd.multipath)x" == "default" ] && [ ! -e /etc/multipath.conf ]; then ++if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then + mkdir -p /etc/multipath/multipath.conf.d + mpathconf --enable + fi + diff --git a/0102.patch b/0102.patch new file mode 100644 index 0000000..ad63926 --- /dev/null +++ b/0102.patch @@ -0,0 +1,25 @@ +From ab6377eebef8e811dd3fd6d43e2af14dbada75d9 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 15 Dec 2020 14:04:24 +0100 +Subject: [PATCH] dracut-systemd: create the initrd.target.wants directory + +kexec-tools depends on the existence of this directory in RHEL8 + +Resolves: #1888779 +--- + modules.d/98dracut-systemd/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/98dracut-systemd/module-setup.sh b/modules.d/98dracut-systemd/module-setup.sh +index 1387433a..9a0f476c 100755 +--- a/modules.d/98dracut-systemd/module-setup.sh ++++ b/modules.d/98dracut-systemd/module-setup.sh +@@ -43,6 +43,7 @@ install() { + + inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator + ++ mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" + for i in \ + dracut-cmdline.service \ + dracut-cmdline-ask.service \ + diff --git a/0103.patch b/0103.patch new file mode 100644 index 0000000..cdce751 --- /dev/null +++ b/0103.patch @@ -0,0 +1,26 @@ +From b0e5702c64f83449d62e83d70d0bb806c6abdc9a Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 4 Aug 2020 14:16:19 +0200 +Subject: [PATCH] match the whole string + +(cherry picked from commit ae83919a7a07b5c90cae8ce8b1349efc212a7aee) + +Resolves: #1552619 +--- + modules.d/95zfcp/parse-zfcp.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh +index 6e1514fd..fb4d9c9e 100755 +--- a/modules.d/95zfcp/parse-zfcp.sh ++++ b/modules.d/95zfcp/parse-zfcp.sh +@@ -3,7 +3,7 @@ + getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf + + for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do +- echo $zfcp_arg | grep '0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}' >/dev/null ++ echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}$' >/dev/null + test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format." + ( + IFS="," + diff --git a/0104.patch b/0104.patch new file mode 100644 index 0000000..ac55496 --- /dev/null +++ b/0104.patch @@ -0,0 +1,29 @@ +From b76aac712f822e75951b10f516c99c573b89e4fe Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 4 Aug 2020 14:18:54 +0200 +Subject: [PATCH] match simplified rd.zfcp format too + +The simplified format was introduced by commit +c8aa1d949aecaf146b0a0e1ce269f69e6048dc5a . + +(cherry picked from commit d9e27b091717a1ce1c58cc911d9d7b5ec3ed901e) + +Resolves: #1552619 +--- + modules.d/95zfcp/parse-zfcp.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh +index fb4d9c9e..5aa6add8 100755 +--- a/modules.d/95zfcp/parse-zfcp.sh ++++ b/modules.d/95zfcp/parse-zfcp.sh +@@ -3,7 +3,7 @@ + getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf + + for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do +- echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\},0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}$' >/dev/null ++ echo $zfcp_arg | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\}\(,0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}\)\?$' >/dev/null + test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format." + ( + IFS="," + diff --git a/0105.patch b/0105.patch new file mode 100644 index 0000000..dfd8c62 --- /dev/null +++ b/0105.patch @@ -0,0 +1,25 @@ +From 27921953a7508209deece59d74e5a957a247278d Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 20 Nov 2020 10:33:56 +0100 +Subject: [PATCH] base: hardcode rhel red + +RHEL-only +Resolves: #1650258 +--- + modules.d/99base/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 3578643c..d10aa6a2 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -74,7 +74,7 @@ install() { + VERSION+="dracut-$DRACUT_VERSION" + PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)" + VERSION_ID=$DRACUT_VERSION +- ANSI_COLOR="0;34" ++ ANSI_COLOR="0;31" + + [ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib + { + diff --git a/0106.patch b/0106.patch new file mode 100644 index 0000000..689d00a --- /dev/null +++ b/0106.patch @@ -0,0 +1,30 @@ +From dc6438116746147e55c624a58116cc7f9f254c8a Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 7 Feb 2019 16:09:43 +0100 +Subject: [PATCH] 95iscsi: + /sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not + exist + +cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory +/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 90: [: -eq: unary operator expected + +(cherry picked from commit 94eccd15c533f9e10cb0ccdec7e8a42c29bbc8d0) + +Resolves: #1552619 +--- + modules.d/95iscsi/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index 47a92e94..dc63ef46 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -86,6 +86,7 @@ install_iscsiroot() { + iscsi_host=${host##*/} + + for flash in ${host}/flashnode_sess-* ; do ++ [ ! -e "$flash/is_boot_target" ] && continue + is_boot=$(cat $flash/is_boot_target) + if [ $is_boot -eq 1 ] ; then + # qla4xxx flashnode session; skip iBFT discovery + diff --git a/0107.patch b/0107.patch new file mode 100644 index 0000000..d8abb6d --- /dev/null +++ b/0107.patch @@ -0,0 +1,32 @@ +From ba1a065c528bd5774c61a3c286e9a7ed7cc467e8 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 21 Mar 2019 14:40:33 +0100 +Subject: [PATCH] iscsi: fix error messages with iSCSI root + +Fixes these error messages during intird build: + +cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory +/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected +cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory +/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected + +(cherry picked from commit 78efd6988ec6b39ea80ba8e432d7df1abe1c081f) + +Resolves: #1552619 +--- + modules.d/95iscsi/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index dc63ef46..618d1dc2 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -86,6 +86,7 @@ install_iscsiroot() { + iscsi_host=${host##*/} + + for flash in ${host}/flashnode_sess-* ; do ++ [ -f "$flash" ] || continue + [ ! -e "$flash/is_boot_target" ] && continue + is_boot=$(cat $flash/is_boot_target) + if [ $is_boot -eq 1 ] ; then + diff --git a/0108.patch b/0108.patch new file mode 100644 index 0000000..dc9c2c8 --- /dev/null +++ b/0108.patch @@ -0,0 +1,225 @@ +From 0954a69e884e99af5082f93e2de30fa8dfdba83e Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +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 +(cherry picked from commit 2f03d69f9dfdc0c905c4d9cb69ee93a5256123cb) + +Resolves: #1731601 +--- + 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 a8076c18..3db5c0cf 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -370,6 +370,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= ++# nvmf.hostid= ++# nvmf.discover=::: ++# ++# 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 + diff --git a/0109.patch b/0109.patch new file mode 100644 index 0000000..c176606 --- /dev/null +++ b/0109.patch @@ -0,0 +1,26 @@ +From 605b45361ff9336bb9ac2526b5f7d50e7e33e99f Mon Sep 17 00:00:00 2001 +From: Jan Macku +Date: Fri, 1 Nov 2019 14:58:56 +0100 +Subject: [PATCH] Write dns values passed by ip argument to ifcfg-* files + +(cherry picked from commit cb86c560b0da465e06c18df12308cb3f30fa4803) + +Resolves: #1767100 +--- + modules.d/45ifcfg/write-ifcfg.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh +index 3bf847a5..abd111fc 100755 +--- a/modules.d/45ifcfg/write-ifcfg.sh ++++ b/modules.d/45ifcfg/write-ifcfg.sh +@@ -270,7 +270,7 @@ for netup in /tmp/net.*.did-setup ; do + done + fi + i=1 +- for ns in $(getargs nameserver); do ++ for ns in $(getargs nameserver) $dns1 $dns2; do + echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif + i=$((i+1)) + done + diff --git a/0110.patch b/0110.patch new file mode 100644 index 0000000..df8aa9c --- /dev/null +++ b/0110.patch @@ -0,0 +1,39 @@ +From 96c6e40774a78f2509aab1260d0f6aaa3b413597 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Thu, 13 Feb 2020 11:37:13 +0100 +Subject: [PATCH] dracut.sh: added help for --regenerate-all + +(cherry picked from commit cdc9cd0e41615d5f5f5af7887991a311cf5c4c7a) + +Resolves: #1802522 +--- + dracut.sh | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 86e95449..e70dab16 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -182,8 +182,8 @@ Creates initial ramdisk images for preloading modules + --mount "[DEV] [MP] [FSTYPE] [FSOPTS]" + Mount device [DEV] on mountpoint [MP] with filesystem + [FSTYPE] and options [FSOPTS] in the initramfs +- --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are +- determined by looking at the current mounts. ++ --mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are ++ determined by looking at the current mounts. + --add-device "[DEV]" Bring up [DEV] in initramfs + -i, --include [SOURCE] [TARGET] + Include the files in the SOURCE directory into the +@@ -234,7 +234,9 @@ Creates initial ramdisk images for preloading modules + --uefi Create an UEFI executable with the kernel cmdline and + kernel combined + --uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable +- --kernel-image [FILE] location of the kernel image ++ --kernel-image [FILE] Location of the kernel image ++ --regenerate-all Regenerate all initramfs images at the default location ++ for the kernel versions found on the system + + If [LIST] has multiple arguments, then you have to put these in quotes. + + diff --git a/0111.patch b/0111.patch new file mode 100644 index 0000000..d78b2ca --- /dev/null +++ b/0111.patch @@ -0,0 +1,39 @@ +From 8658cfd92b50197dd4f4d3b6d136950fe007ffc0 Mon Sep 17 00:00:00 2001 +From: Frank Deng +Date: Sat, 15 Jun 2019 13:35:42 -0700 +Subject: [PATCH] 35network-legacy: fix classless static route parsing + +(cherry picked from commit 11e1f680656177cfbba4e06f08b6707f4a812bc0) + +Resolves: #1811042 +--- + modules.d/35network-legacy/dhclient-script.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/modules.d/35network-legacy/dhclient-script.sh b/modules.d/35network-legacy/dhclient-script.sh +index f1a60005..44633b30 100755 +--- a/modules.d/35network-legacy/dhclient-script.sh ++++ b/modules.d/35network-legacy/dhclient-script.sh +@@ -126,9 +126,11 @@ parse_option_121() { + elif [ $mask -gt 8 ]; then + destination="$1.$2.0.0/$mask" + shift; shift +- else ++ elif [ $mask -gt 0 ]; then + destination="$1.0.0.0/$mask" + shift ++ else ++ destination="0.0.0.0/$mask" + fi + + # Read the gateway +@@ -138,7 +140,7 @@ parse_option_121() { + # Multicast routing on Linux + # - If you set a next-hop address for a multicast group, this breaks with Cisco switches + # - If you simply leave it link-local and attach it to an interface, it works fine. +- if [ $multicast -eq 1 ]; then ++ if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then + temp_result="$destination dev $interface" + else + temp_result="$destination via $gateway dev $interface" + diff --git a/0112.patch b/0112.patch new file mode 100644 index 0000000..9ca9806 --- /dev/null +++ b/0112.patch @@ -0,0 +1,34 @@ +From 33f3c41793b8c22ae4c7158f7480b38d4eed3a73 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +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. + +(cherry picked from commit 7069132ec7e94a3274aa1b3b3b6e339066118a4d) + +Resolves: #1812046 +--- + 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 6babcccf..fc914b30 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -508,7 +508,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" + ;; + diff --git a/0113.patch b/0113.patch new file mode 100644 index 0000000..0d38d96 --- /dev/null +++ b/0113.patch @@ -0,0 +1,37 @@ +From f9c068e999cc76eaa318cc0773ef9133ea986131 Mon Sep 17 00:00:00 2001 +From: Sebastian Mitterle +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 +``` + +(cherry picked from commit defb1611c771d9f05780aebb101baefde2f66874) + +Resolves: #1815043 +--- + 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 0da61309..ec33a9e0 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 + diff --git a/0114.patch b/0114.patch new file mode 100644 index 0000000..e9742e0 --- /dev/null +++ b/0114.patch @@ -0,0 +1,27 @@ +From af492162772a6ed26fbc8223012348ae4ad000e5 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Fri, 13 Nov 2020 10:45:59 +0100 +Subject: [PATCH] 90multipath: install kpartx's 11-dm-parts.rules + +This makes /dev/disk/by-uuid links point to the right device. + +(cherry picked from commit 0f89c0dff6b96c9ca09b48a2890399b145f38bdb) + +Resolves: #1849021 +--- + modules.d/90multipath/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index a7f250f3..1844a035 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -125,6 +125,6 @@ install() { + inst_rules 40-multipath.rules 56-multipath.rules \ + 62-multipath.rules 65-multipath.rules \ + 66-kpartx.rules 67-kpartx-compat.rules \ +- 11-dm-mpath.rules ++ 11-dm-mpath.rules 11-dm-parts.rules + } + + diff --git a/0115.patch b/0115.patch new file mode 100644 index 0000000..b0b33a4 --- /dev/null +++ b/0115.patch @@ -0,0 +1,47 @@ +From 8680b657da61ce533f1c91e79eadd3c46f9e98d0 Mon Sep 17 00:00:00 2001 +From: "Eugene S. Sobolev" +Date: Fri, 14 Feb 2020 11:49:06 +0300 +Subject: [PATCH] network/net-lib.sh: Configure all iBFT interfaces + +Added boolean command line option rd.iscsi.mp + +(cherry picked from commit c7ee6b3dbb8dfad61aa337b2ecf7e4eaeddc4b4b) + +Resolves: #1851984 +--- + dracut.cmdline.7.asc | 3 +++ + modules.d/40network/net-lib.sh | 6 ++++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 19b5cc87..9003c430 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -764,6 +764,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 + **rd.iscsi.ibft** **rd.iscsi.ibft=1**: + Turn on iBFT autoconfiguration for the interfaces + ++**rd.iscsi.mp** **rd.iscsi.mp=1**: ++ Configure all iBFT interfaces, not only used for booting (multipath) ++ + **rd.iscsi.waitnet=0**: + Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets. + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index fc914b30..f0c1c041 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -251,8 +251,10 @@ ibft_to_cmdline() { + [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a) + # Skip invalid interfaces + (( $flags & 1 )) || continue +- # Skip interfaces not used for booting +- (( $flags & 2 )) || continue ++ # Skip interfaces not used for booting unless using multipath ++ if ! getargbool 0 rd.iscsi.mp ; then ++ (( $flags & 2 )) || continue ++ fi + [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a) + [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a) + [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a) + diff --git a/0116.patch b/0116.patch new file mode 100644 index 0000000..4c94398 --- /dev/null +++ b/0116.patch @@ -0,0 +1,29 @@ +From b14ba27a3cdc7a71ded3c4b424129ffd61d7be85 Mon Sep 17 00:00:00 2001 +From: Denis Volkov +Date: Tue, 4 Aug 2020 19:51:27 +0500 +Subject: [PATCH] Change the order of NFS servers during the boot NFS server + provided by DHCP in next-server option has higher priority than DHCP-server + itself + +(cherry picked from commit 09a691af3b63543fe58faa02661f785b907a78a6) + +Resolves: #1859513 +--- + modules.d/95nfs/nfs-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh +index 1ba4f5ff..95844f58 100755 +--- a/modules.d/95nfs/nfs-lib.sh ++++ b/modules.d/95nfs/nfs-lib.sh +@@ -112,8 +112,8 @@ nfsroot_from_dhcp() { + [ -n "$new_root_path" ] && nfsroot_to_var "$nfs:$new_root_path" + [ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path=/tftpboot/%s + [ -z "$server" ] && server=$srv +- [ -z "$server" ] && server=$new_dhcp_server_identifier + [ -z "$server" ] && server=$new_next_server ++ [ -z "$server" ] && server=$new_dhcp_server_identifier + [ -z "$server" ] && server=${new_root_path%%:*} + } + + diff --git a/0117.patch b/0117.patch new file mode 100644 index 0000000..eedef89 --- /dev/null +++ b/0117.patch @@ -0,0 +1,39 @@ +From cfa57e264efa138e99257fbfbe18449150a96c4d Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 14 Feb 2019 20:18:04 +0100 +Subject: [PATCH] install: string_hash_func should not be fed with NULL + +If kmod_module_get_path returns NULL, we should skip that entry, +the hash function does not like NULL pointers. + +(cherry picked from commit fc141f22869bad2e5409d1cc555c1a42ea738343) + +Resolves: #1868525 +--- + install/dracut-install.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 51f79422..f8ec9a59 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -1248,6 +1248,9 @@ static int install_dependent_modules(struct kmod_list *modlist) + mod = kmod_module_get_module(itr); + path = kmod_module_get_path(mod); + ++ if (path == NULL) ++ continue; ++ + if (check_hashmap(items_failed, path)) + return -1; + +@@ -1257,7 +1260,7 @@ static int install_dependent_modules(struct kmod_list *modlist) + + name = kmod_module_get_name(mod); + +- if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) { ++ if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) { + continue; + } + + diff --git a/0118.patch b/0118.patch new file mode 100644 index 0000000..4588a96 --- /dev/null +++ b/0118.patch @@ -0,0 +1,36 @@ +From 561339d4d04c5481a3239017d714f035fc5bc55a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + +Date: Tue, 3 Mar 2020 21:20:34 +0100 +Subject: [PATCH] Consider also drm_dev_register when looking for gpu driver + +DRM drivers are filtered for drm_crtc_init symbol, +but not all drivers use it. Especially, cirrus driver +doesn't use it since Linux 5.2. + +The practical result is text plymouth theme instead of graphical when in qemu. + +Fix it by looking also for drm_dev_register symbol. +Suggested by @haraldh +Fixes #712 + +(cherry picked from commit ebeed55c073eeaf78b738fe2c91bb6327a2c3bfe) + +Resolves: #1874506 +--- + modules.d/50drm/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh +index 23545e34..a1711c00 100755 +--- a/modules.d/50drm/module-setup.sh ++++ b/modules.d/50drm/module-setup.sh +@@ -40,6 +40,6 @@ installkernel() { + fi + done + else +- dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging" ++ dracut_instmods -o -s "drm_crtc_init|drm_dev_register" "=drivers/gpu/drm" "=drivers/staging" + fi + } + diff --git a/0119.patch b/0119.patch new file mode 100644 index 0000000..42c2aef --- /dev/null +++ b/0119.patch @@ -0,0 +1,27 @@ +From add76751a1bc290088ca650cbec0be3696beb8d6 Mon Sep 17 00:00:00 2001 +From: GuoChuang +Date: Mon, 24 Aug 2020 14:03:48 +0800 +Subject: [PATCH] fix graphics startup failure with the rhgb paramter in + CentOS8.2 + +(cherry picked from commit d76e9ad5d7b16edb3c544ed3888640bea0efbf72) + +Resolves: #1874506 +--- + modules.d/50drm/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/50drm/module-setup.sh b/modules.d/50drm/module-setup.sh +index a1711c00..b4ead7f2 100755 +--- a/modules.d/50drm/module-setup.sh ++++ b/modules.d/50drm/module-setup.sh +@@ -33,7 +33,7 @@ installkernel() { + if [[ $hostonly ]]; then + for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do + [[ -e $i ]] || continue +- if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then ++ if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register" -S "iw_handler_get_spy" $(<$i); then + if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then + hostonly='' instmods amdkfd + fi + diff --git a/0120.patch b/0120.patch new file mode 100644 index 0000000..5df7f53 --- /dev/null +++ b/0120.patch @@ -0,0 +1,87 @@ +From e7f4acb6f7f902715277048be7cdba49c61189dd Mon Sep 17 00:00:00 2001 +From: Rumbaut Thomas +Date: Fri, 23 Oct 2020 12:38:04 +0200 +Subject: [PATCH] Configure the runner for team interfaces + +https://bugzilla.redhat.com/show_bug.cgi?id=1881463 +(cherry picked from commit e4483e5917b59918260ff0f0345abbea4a537f12) + +Resolves: #1881463 +--- + dracut.cmdline.7.asc | 6 +++++- + modules.d/35network-legacy/parse-team.sh | 18 +++++++++++++----- + 2 files changed, 18 insertions(+), 6 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index 9003c430..e220defb 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -593,9 +593,13 @@ interface name. Better name it "bootnet" or "bluesocket". + Bond without parameters assumes + bond=bond0:eth0,eth1:mode=balance-rr + +-**team=**____:____:: ++**team=**____:____[:____]:: + Setup team device on top of . + is a comma-separated list of physical (ethernet) interfaces. ++ is the runner type to be used (see *teamd.conf*(5)); defaults to ++ activebackup. ++ Team without parameters assumes ++ team=team0:eth0,eth1:activebackup + + **bridge=**____:____:: + Setup bridge with . is a comma-separated +diff --git a/modules.d/35network-legacy/parse-team.sh b/modules.d/35network-legacy/parse-team.sh +index a6eef18e..03fbcf20 100755 +--- a/modules.d/35network-legacy/parse-team.sh ++++ b/modules.d/35network-legacy/parse-team.sh +@@ -1,9 +1,12 @@ + #!/bin/sh + # + # Format: +-# team=: ++# team=:[:] + # + # teamslaves is a comma-separated list of physical (ethernet) interfaces ++# teamrunner is the runner type to be used (see teamd.conf(5)); defaults to activebackup ++# ++# team without parameters assumes team=team0:eth0,eth1:activebackup + # + + parseteam() { +@@ -15,8 +18,11 @@ parseteam() { + done + + case $# in +- 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;; +- *) die "team= requires two parameters" ;; ++ 0) teammaster=team0; teamslaves="eth0 eth1"; teamrunner="activebackup" ;; ++ 1) teammaster=$1; teamslaves="eth0 eth1"; teamrunner="activebackup" ;; ++ 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner="activebackup" ;; ++ 3) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner=$3 ;; ++ *) die "team= requires zero to three parameters" ;; + esac + return 0 + } +@@ -26,16 +32,18 @@ for team in $(getargs team); do + + unset teammaster + unset teamslaves ++ unset teamrunner + + parseteam "$team" || continue + + echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info + echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info ++ echo "teamrunner=\"$teamrunner\"" >> /tmp/team.${teammaster}.info + + if ! [ -e /etc/teamd/${teammaster}.conf ]; then +- warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using activebackup." ++ warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using $teamrunner." + mkdir -p /etc/teamd +- printf -- "%s" '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}' > "/etc/teamd/${teammaster}.conf" ++ printf -- "%s" "{\"runner\": {\"name\": \"$teamrunner\"}, \"link_watch\": {\"name\": \"ethtool\"}}" > "/tmp/${teammaster}.conf" + fi + done + + diff --git a/0121.patch b/0121.patch new file mode 100644 index 0000000..0939a89 --- /dev/null +++ b/0121.patch @@ -0,0 +1,42 @@ +From b75ab376748ee698763610769601bd81296bd060 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +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. + +(cherry picked from commit eb770a4a207b2e9e3080068c1df22b69ed44d4b5) + +Resolves: #1881974 +--- + 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 + + diff --git a/0122.patch b/0122.patch new file mode 100644 index 0000000..cad4c92 --- /dev/null +++ b/0122.patch @@ -0,0 +1,252 @@ +From f9883b51b1fafd30a91e9efda3260067a8f87ea5 Mon Sep 17 00:00:00 2001 +From: Enzo Matsumiya +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 +(cherry picked from commit 019610af266bcaef711715266bc0ca4be1044150) + +Resolves: #1885417 +--- + 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 + diff --git a/0123.patch b/0123.patch new file mode 100644 index 0000000..99df739 --- /dev/null +++ b/0123.patch @@ -0,0 +1,71 @@ +From 231c6e831262246af33696132c1be7c009477a96 Mon Sep 17 00:00:00 2001 +From: Patrick Talbert +Date: Fri, 30 Nov 2018 09:28:09 +0100 +Subject: [PATCH] 95fcoe: Add the rd.nofcoe option to disable the FCoE module + from the command line + +Images built with the fcoe module will always run the lldpad +service as part of their pre-trigger scripts if the network +is active. This prevents network installations in +environments where, for security reasons, LLDPDU frames +cause a switchport shutdown. + +Add a new rd.nofcoe option to cause dracut to skip the +lldpad.sh script and the entire 95-fcoe module. + +Signed-off-by: Patrick Talbert +(cherry picked from commit 7c6d2ad916bd536dc2f082fd96ef837a5031e497) + +Resolves: #1885621 +--- + dracut.cmdline.7.asc | 3 +++ + modules.d/95fcoe/lldpad.sh | 5 +++++ + modules.d/95fcoe/parse-fcoe.sh | 5 +++++ + 3 files changed, 13 insertions(+) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index e220defb..bf745575 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -779,6 +779,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 + + FCoE + ~~~~ ++**rd.nofcoe=0**:: ++ disable FCoE and lldpad ++ + **fcoe=**____:__{dcb|nodcb}__:__{fabric|vn2vn}__:: + Try to connect to a FCoE SAN through the NIC specified by __ or + __ or EDD settings. The second argument specifies if DCB +diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh +index d06a3bd8..c32feeed 100755 +--- a/modules.d/95fcoe/lldpad.sh ++++ b/modules.d/95fcoe/lldpad.sh +@@ -1,5 +1,10 @@ + #!/bin/bash + ++if ! getargbool 0 rd.nofcoe ; then ++ info "rd.nofcoe=0: skipping lldpad activation" ++ exit 0 ++fi ++ + # Note lldpad will stay running after switchroot, the system initscripts + # are to kill it and start a new lldpad to take over. Data is transfered + # between the 2 using a shm segment +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index 12701cdb..7a6ff755 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -13,6 +13,11 @@ + # fcoe=eth0:nodcb:vn2vn + # fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric + ++if ! getargbool 0 rd.nofcoe ; then ++ info "rd.nofcoe=0: skipping fcoe" ++ exit 0 ++fi ++ + [ -z "$fcoe" ] && fcoe=$(getarg fcoe=) + + # If it's not set we don't continue + diff --git a/0124.patch b/0124.patch new file mode 100644 index 0000000..328652e --- /dev/null +++ b/0124.patch @@ -0,0 +1,161 @@ +From 4e1d7a423253d4e3476b003fc2e17c2ac44bd8ca Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 10 Sep 2020 02:18:02 +0800 +Subject: [PATCH] 04watchdog: split the watchdog module install + +In some cases, user only want to include the watchdog module, not the +wdctl or any other userspace helper. For example, systemd have a +RebootWatchdogSec option that use watchdog to prevent reboot hangs. And +it can help prevent machines hangs when reboot directly within the +initramfs stage. So split the module installation to a standlone module. + +Also when watchdog-module get included, install driver for all loaded +watchdog instaed of only install driver for active watchdog. Both +watchdog and watchdog-module return 255 in check(), so it's enabled only +when manually included, the watchdog may get configured/activated later. + +Signed-off-by: Kairui Song +(cherry picked from commit 39d90012a652fa4d9d2534d0168ddad8cacec248) + +Resolves: #1890039 +--- + modules.d/04watchdog-modules/module-setup.sh | 61 ++++++++++++++++++++++++++++ + modules.d/04watchdog/module-setup.sh | 50 +---------------------- + 2 files changed, 63 insertions(+), 48 deletions(-) + +diff --git a/modules.d/04watchdog-modules/module-setup.sh b/modules.d/04watchdog-modules/module-setup.sh +new file mode 100755 +index 00000000..5fbd769b +--- /dev/null ++++ b/modules.d/04watchdog-modules/module-setup.sh +@@ -0,0 +1,61 @@ ++#!/bin/bash ++ ++# called by dracut ++check() { ++ return 255 ++} ++ ++# called by dracut ++depends() { ++ return 0 ++} ++ ++# called by dracut ++install() { ++ return 0 ++} ++ ++installkernel() { ++ local -A _drivers ++ local _alldrivers _wdtdrv _wdtppath _dir ++ [[ -d /sys/class/watchdog/ ]] || return ++ for _dir in /sys/class/watchdog/*; do ++ [[ -d "$_dir" ]] || continue ++ [[ -f "$_dir/state" ]] || continue ++ # device/modalias will return driver of this device ++ _wdtdrv=$(< "$_dir/device/modalias") ++ # There can be more than one module represented by same ++ # modalias. Currently load all of them. ++ # TODO: Need to find a way to avoid any unwanted module ++ # represented by modalias ++ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) ++ if [[ $_wdtdrv ]]; then ++ instmods $_wdtdrv ++ for i in $_wdtdrv; do ++ _drivers[$i]=1 ++ done ++ fi ++ # however in some cases, we also need to check that if there is ++ # a specific driver for the parent bus/device. In such cases ++ # we also need to enable driver for parent bus/device. ++ _wdtppath=$(readlink -f "$_dir/device") ++ while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do ++ _wdtppath=$(readlink -f "$_wdtppath/..") ++ [[ -f "$_wdtppath/modalias" ]] || continue ++ ++ _wdtdrv=$(< "$_wdtppath/modalias") ++ _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) ++ if [[ $_wdtdrv ]]; then ++ instmods $_wdtdrv ++ for i in $_wdtdrv; do ++ _drivers[$i]=1 ++ done ++ fi ++ done ++ done ++ # ensure that watchdog module is loaded as early as possible ++ _alldrivers="${!_drivers[*]}" ++ [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf ++ ++ return 0 ++} +diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh +index 7566d651..15bcd897 100755 +--- a/modules.d/04watchdog/module-setup.sh ++++ b/modules.d/04watchdog/module-setup.sh +@@ -7,7 +7,7 @@ check() { + + # called by dracut + depends() { +- return 0 ++ return "watchdog-modules" + } + + # called by dracut +@@ -27,53 +27,7 @@ install() { + inst_hook cleanup 00 "$moddir/watchdog.sh" + inst_hook cleanup 99 "$moddir/watchdog.sh" + fi ++ + inst_hook emergency 02 "$moddir/watchdog-stop.sh" + inst_multiple -o wdctl + } +- +-installkernel() { +- local -A _drivers +- local _alldrivers _active _wdtdrv _wdtppath _dir +- [[ -d /sys/class/watchdog/ ]] || return +- for _dir in /sys/class/watchdog/*; do +- [[ -d "$_dir" ]] || continue +- [[ -f "$_dir/state" ]] || continue +- _active=$(< "$_dir/state") +- ! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue +- # device/modalias will return driver of this device +- _wdtdrv=$(< "$_dir/device/modalias") +- # There can be more than one module represented by same +- # modalias. Currently load all of them. +- # TODO: Need to find a way to avoid any unwanted module +- # represented by modalias +- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) +- if [[ $_wdtdrv ]]; then +- instmods $_wdtdrv +- for i in $_wdtdrv; do +- _drivers[$i]=1 +- done +- fi +- # however in some cases, we also need to check that if there is +- # a specific driver for the parent bus/device. In such cases +- # we also need to enable driver for parent bus/device. +- _wdtppath=$(readlink -f "$_dir/device") +- while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do +- _wdtppath=$(readlink -f "$_wdtppath/..") +- [[ -f "$_wdtppath/modalias" ]] || continue +- +- _wdtdrv=$(< "$_wdtppath/modalias") +- _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) +- if [[ $_wdtdrv ]]; then +- instmods $_wdtdrv +- for i in $_wdtdrv; do +- _drivers[$i]=1 +- done +- fi +- done +- done +- # ensure that watchdog module is loaded as early as possible +- _alldrivers="${!_drivers[*]}" +- [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf +- +- return 0 +-} + diff --git a/0125.patch b/0125.patch new file mode 100644 index 0000000..e296067 --- /dev/null +++ b/0125.patch @@ -0,0 +1,28 @@ +From d1861df7552e2679ab48e5573ac23f4f1553f0e2 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Sun, 20 Sep 2020 09:44:08 +0200 +Subject: [PATCH] dracut.spec: include the 04watchdog-modules module + +Include the 04watchdog-modules module that was added in 39d90012a652 +("04watchdog: split the watchdog module install"). + +(cherry picked from commit f3e328a7fd30c7109a3af188e84e621770bb6b85) + +Resolves: #1890039 +--- + dracut.spec | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.spec b/dracut.spec +index 3db5c0cf..b371118e 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -346,6 +346,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne + %{dracutlibdir}/modules.d/03modsign + %{dracutlibdir}/modules.d/03rescue + %{dracutlibdir}/modules.d/04watchdog ++%{dracutlibdir}/modules.d/04watchdog-modules + %{dracutlibdir}/modules.d/05busybox + %{dracutlibdir}/modules.d/06rngd + %{dracutlibdir}/modules.d/10i18n + diff --git a/0126.patch b/0126.patch new file mode 100644 index 0000000..ee7c494 --- /dev/null +++ b/0126.patch @@ -0,0 +1,30 @@ +From 8300849e5d8825c6b60dec682eec4767701e95ac Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 16 Nov 2020 15:24:14 +0800 +Subject: [PATCH] 95fcoe: ensure needed modules are installed + +If fcoe module is loaded, the initramfs will always try load libfcoe +and bnx2fc, so also ensure they are installed if needed. + +Signed-off-by: Kairui Song +(cherry picked from commit 4339d47cf810d8a79f20cf2b86d15af7ec859052) + +Resolves: #1898814 +--- + modules.d/95fcoe/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index 63f45b52..c2224ec1 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -23,7 +23,7 @@ depends() { + + # called by dracut + installkernel() { +- instmods fcoe 8021q edd ++ instmods fcoe libfcoe 8021q edd bnx2fc + } + + get_vlan_parent() { + diff --git a/0127.patch b/0127.patch new file mode 100644 index 0000000..b78842f --- /dev/null +++ b/0127.patch @@ -0,0 +1,100 @@ +From 3085acbec79b3649ac906529778f86a14f330e62 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 21 Oct 2020 16:18:07 +0800 +Subject: [PATCH] Add a --hostonly-nics option + +Currently when network is enabled, dracut will install all network +drivers that are currently loaded, but some time only one NIC is needed +for the initramfs. + +So for strict hostonly mode, add a --hostonly-nics option, user can +provide a list of NICs to be enabled, and only needed drivers for +specifed NICs will be installed so save space. + +Signed-off-by: Kairui Song +(cherry picked from commit 1e92f7285d42fbd3bc01f534f9bd646f6fdd9504) + +Cherry-picked from: 1e92f7285d42fbd3bc01f534f9bd646f6fdd9504 +Resolves: #1890041 + +Cherry-picked from: c69961b403c1c83bb4717e1df1470e71cd0245d1 +Resolves: #1890041 +--- + dracut.sh | 6 ++++++ + modules.d/90kernel-network-modules/module-setup.sh | 18 +++++++++++++++--- + 2 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index e70dab16..01abe7a4 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -173,6 +173,8 @@ Creates initial ramdisk images for preloading modules + --hostonly-i18n Install only needed keyboard and font files according + to the host configuration (default). + --no-hostonly-i18n Install all keyboard and font files available. ++ --hostonly-nics [LIST] ++ Only enable listed NICs in the initramfs. + --persistent-policy [POLICY] + Use [POLICY] to address disks and partitions. + POLICY can be any directory name found in /dev/disk. +@@ -400,6 +402,7 @@ rearrange_params() + --long kernel-image: \ + --long no-hostonly-i18n \ + --long hostonly-i18n \ ++ --long hostonly-nics: \ + --long no-machineid \ + -- "$@") + +@@ -561,6 +564,8 @@ while :; do + hostonly_cmdline_l="yes" ;; + --hostonly-i18n) + i18n_install_all_l="no" ;; ++ --hostonly-nics) ++ hostonly_nics_l+=("$2"); PARMS_TO_STORE+=" '$2'"; shift;; + --no-hostonly-i18n) + i18n_install_all_l="yes" ;; + --no-hostonly-cmdline) +@@ -720,6 +725,7 @@ unset NPATH + (( ${#fstab_lines_l[@]} )) && fstab_lines+=( "${fstab_lines_l[@]}" ) + (( ${#install_items_l[@]} )) && install_items+=" ${install_items_l[@]} " + (( ${#install_optional_items_l[@]} )) && install_optional_items+=" ${install_optional_items_l[@]} " ++(( ${#hostonly_nics_l[@]} )) && hostonly_nics+=" ${hostonly_nics_l[@]} " + + # these options override the stuff in the config file + (( ${#dracutmodules_l[@]} )) && dracutmodules="${dracutmodules_l[@]}" +diff --git a/modules.d/90kernel-network-modules/module-setup.sh b/modules.d/90kernel-network-modules/module-setup.sh +index 600ef112..f36d31f7 100755 +--- a/modules.d/90kernel-network-modules/module-setup.sh ++++ b/modules.d/90kernel-network-modules/module-setup.sh +@@ -14,15 +14,27 @@ depends() { + installkernel() { + # Include wired net drivers, excluding wireless + local _arch=$(uname -m) +- local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open' ++ local _net_symbols='eth_type_trans|register_virtio_device|usbnet_open' + local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/' ++ local _net_drivers + + if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then +- _s390drivers="=drivers/s390/net" ++ dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/s390/net" + fi + +- dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"} ++ if [[ $hostonly_mode == 'strict' ]] && [[ $hostonly_nics ]]; then ++ for _nic in $hostonly_nics; do ++ _net_drivers=$(get_dev_module /sys/class/net/$_nic) ++ if ! [[ $_net_drivers ]]; then ++ derror "--hostonly-nics contains invalid NIC '$_nic'" ++ continue ++ fi ++ hostonly="" instmods $_net_drivers ++ done ++ return 0 ++ fi + ++ dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/net" + #instmods() will take care of hostonly + instmods \ + =drivers/net/phy \ + diff --git a/0128.patch b/0128.patch new file mode 100644 index 0000000..1fd6c24 --- /dev/null +++ b/0128.patch @@ -0,0 +1,35 @@ +From 2dbd11b81dae28a5c6291a56175c06665b615d66 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Thu, 1 Oct 2020 14:08:38 +0200 +Subject: [PATCH] dracut-install: ignore bogus preload libs + +If there are any nonexistent libraries listed in /etc/ld.so.preload, ldd +prints error messages like: + +ERROR: ld.so: object '/usr/lib64/libfoo.so.1' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored. + +This causes resolve_deps() to return error, which leads to symlinks +(like usr/bin/awk) not being copied into the initrd. + +(cherry picked from commit 4916dfc2b94dca0e84eb7dc58a9266d02c416b4a) + +Resolves: #1884149 +--- + install/dracut-install.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index f8ec9a59..baf6dcff 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -481,6 +481,9 @@ static int resolve_deps(const char *src) + if (strstr(buf, "cannot read header")) + break; + ++ if (strstr(buf, "cannot be preloaded")) ++ break; ++ + if (strstr(buf, destrootdir)) + break; + + diff --git a/0129.patch b/0129.patch new file mode 100644 index 0000000..873d410 --- /dev/null +++ b/0129.patch @@ -0,0 +1,26 @@ +From e03445a5e40bb8d6de3d401495e8645a6c1db04c Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 7 Jan 2021 11:57:56 +0100 +Subject: [PATCH] 00systemd: when putting systemd-vconsole-setup.service as a + dependency ignore missing services + +rhel-only +Resolves: #1906301 +--- + modules.d/00systemd/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 4ab2a896..1f0b5dad 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -225,7 +225,7 @@ install() { + systemd-ask-password-console.service \ + systemd-ask-password-plymouth.service \ + ; do +- systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service ++ systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service 2>/dev/null + done + + mkdir -p "$initdir/etc/systemd" + diff --git a/0130.patch b/0130.patch new file mode 100644 index 0000000..09f5e1b --- /dev/null +++ b/0130.patch @@ -0,0 +1,46 @@ +From 0e43b934b98e40efeed0781e8bdf9f805d8d7217 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +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 +(cherry picked from commit ff366790a6e30175f243d54c2922a8c781030ede) + +Resolves: #1894026 +--- + 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 5ac34ef3..47eb8e7d 100755 +--- a/51-dracut-rescue.install ++++ b/51-dracut-rescue.install +@@ -104,7 +104,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 + + diff --git a/0131.patch b/0131.patch new file mode 100644 index 0000000..c7946e6 --- /dev/null +++ b/0131.patch @@ -0,0 +1,31 @@ +From 1651c3074f596b80478473a126c02c27398429dd Mon Sep 17 00:00:00 2001 +From: Daniel Molkentin +Date: Thu, 18 Jul 2019 11:29:29 +0200 +Subject: [PATCH] 95fcoe: Fix startup when fcoe module is included + +The parse-fcoe.sh hook is sourced, and hence must not contain +exit 0 calls. Otherwise, the cmdline sequence will be interupted, +and no error will be reported to systemd. Use return instead. + +Reference: boo#1136977 +(cherry picked from commit 4f194276417237168f5bc929ba847a23b6a4c77f) + +Resolves: #1914957 +--- + modules.d/95fcoe/parse-fcoe.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index 7a6ff755..8bb55c6e 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -15,7 +15,7 @@ + + if ! getargbool 0 rd.nofcoe ; then + info "rd.nofcoe=0: skipping fcoe" +- exit 0 ++ return 0 + fi + + [ -z "$fcoe" ] && fcoe=$(getarg fcoe=) + diff --git a/0132.patch b/0132.patch new file mode 100644 index 0000000..0b9121d --- /dev/null +++ b/0132.patch @@ -0,0 +1,30 @@ +From e96bab3e688b7fc9b6f5e6b90c6d1ea4d517bc4a Mon Sep 17 00:00:00 2001 +From: Radek Vykydal +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. + +(cherry picked from commit 7fb8f939a52a904b1860e303a6a7fe69ba0d2ceb) + +Resolves: #1914957 +--- + 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 + diff --git a/0133.patch b/0133.patch new file mode 100644 index 0000000..650cad4 --- /dev/null +++ b/0133.patch @@ -0,0 +1,27 @@ +From 6297e8accadcddcdd390f4e0583f9bde29f3758e Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 7 Nov 2019 14:03:23 +0100 +Subject: [PATCH] spec: dracut-network is happy with either NM or dhclient + +(cherry picked from commit e8638076857621b28eb4dc36cdd49a94992835b7) + +Resolves: #1916174 +--- + dracut.spec | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dracut.spec b/dracut.spec +index b371118e..fa3e4b99 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -125,7 +125,8 @@ Requires: %{name} = %{version}-%{release} + %endif + Requires: iputils + Requires: iproute +-Requires: dhclient ++Requires: (NetworkManager >= 1.20 or dhclient) ++Suggests: NetworkManager + Obsoletes: dracut-generic < 008 + Provides: dracut-generic = %{version}-%{release} + + diff --git a/0134.patch b/0134.patch new file mode 100644 index 0000000..4f01b11 --- /dev/null +++ b/0134.patch @@ -0,0 +1,43 @@ +From db5fda123c2960e99cb29399bdedbd56d672c72d Mon Sep 17 00:00:00 2001 +From: Thomas Blume +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. + +(cherry picked from commit 8446c8f9deefcc6c47d96a128b1e9b23d8855a96) + +Resolves: #1885621 +--- + 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 + diff --git a/0135.patch b/0135.patch new file mode 100644 index 0000000..62d09ba --- /dev/null +++ b/0135.patch @@ -0,0 +1,116 @@ +From 2fe454f21b6b3890b02f52810a662530ec019968 Mon Sep 17 00:00:00 2001 +From: mulhern +Date: Wed, 19 Aug 2020 11:11:14 -0400 +Subject: [PATCH] Remove stratis module + +It is obsolete. An approach which does not start the daemon is being worked +on. + +Signed-off-by: mulhern +(cherry picked from commit fe761330e5db60f19f0ab2d937ea71a5b2438656) + +Cherry-picked from: fe761330e5db60f19f0ab2d937ea71a5b2438656 +Resolves: #1950572 +--- + dracut.spec | 1 - + modules.d/90stratis/module-setup.sh | 33 ------------------------------- + modules.d/90stratis/stratisd-init.service | 15 -------------- + modules.d/90stratis/stratisd-start.sh | 3 --- + modules.d/90stratis/stratisd-stop.sh | 6 ------ + 5 files changed, 58 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index fa3e4b99..dcaafa61 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -365,7 +365,6 @@ 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/90stratis + %{dracutlibdir}/modules.d/90qemu + %{dracutlibdir}/modules.d/91crypt-gpg + %{dracutlibdir}/modules.d/91crypt-loop +diff --git a/modules.d/90stratis/module-setup.sh b/modules.d/90stratis/module-setup.sh +deleted file mode 100755 +index 943f572e..00000000 +--- a/modules.d/90stratis/module-setup.sh ++++ /dev/null +@@ -1,33 +0,0 @@ +-#!/bin/bash +- +-# called by dracut +-check() { +- require_binaries stratisd-init thin_check thin_repair mkfs.xfs xfs_admin xfs_growfs || return 1 +- return 255 +-} +- +-# called by dracut +-depends() { +- echo dm +- return 0 +-} +- +-# called by dracut +-installkernel() { +- instmods xfs +-} +- +-# called by dracut +-install() { +- +- inst_multiple stratisd-init thin_check thin_repair mkfs.xfs xfs_admin xfs_growfs +- +- if dracut_module_included "systemd"; then +- inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service" +- systemctl -q --root "$initdir" enable stratisd-init.service +- else +- inst_hook cmdline 25 "$moddir/stratisd-start.sh" +- inst_hook cleanup 25 "$moddir/stratisd-stop.sh" +- fi +-} +- +diff --git a/modules.d/90stratis/stratisd-init.service b/modules.d/90stratis/stratisd-init.service +deleted file mode 100644 +index 318e8c27..00000000 +--- a/modules.d/90stratis/stratisd-init.service ++++ /dev/null +@@ -1,15 +0,0 @@ +-[Unit] +-Description=A daemon that manages a pool of block devices to create flexible file systems +-Documentation=man:stratisd(8) +-Before=local-fs-pre.target +-DefaultDependencies=no +- +-[Service] +-Type=simple +-ExecStart=/sbin/stratisd-init --debug +-KillSignal=SIGINT +-StandardOutput=syslog +-StandardError=syslog +- +-[Install] +-WantedBy=sysinit.target +diff --git a/modules.d/90stratis/stratisd-start.sh b/modules.d/90stratis/stratisd-start.sh +deleted file mode 100755 +index afcd81fd..00000000 +--- a/modules.d/90stratis/stratisd-start.sh ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/bin/sh +- +-stratisd-init --debug > /dev/kmsg 2>&1 & +\ No newline at end of file +diff --git a/modules.d/90stratis/stratisd-stop.sh b/modules.d/90stratis/stratisd-stop.sh +deleted file mode 100755 +index f394a843..00000000 +--- a/modules.d/90stratis/stratisd-stop.sh ++++ /dev/null +@@ -1,6 +0,0 @@ +-#!/bin/sh +- +-[ -f /lib/dracut-lib.sh ] && . /lib/dracut-lib.sh +- +-pid=$(pidof stratisd-init) +-[ -n "$pid" ] && kill ${pid} + diff --git a/0136.patch b/0136.patch new file mode 100644 index 0000000..91f4f33 --- /dev/null +++ b/0136.patch @@ -0,0 +1,60 @@ +From 7c6839180cd616cebaeefd0cb05b60d022388277 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 26 Nov 2020 11:29:45 -0800 +Subject: [PATCH] Drop 51-dracut-rescue-postinst.sh entirely + +It is only installed on RHEL 8+, but as noted in the first commit +that tried to do this - 0bb9a683 - we already have branches for +all RHEL releases, so there's no point keeping such a conditional +on the master branch. After 0bb9a683, 51-dracut-rescue-postinst.sh +was re-added because Fedora 30 needed it, with a FIXME saying to +remove it after F30 was released. But instead of that happening, it +got changed to a conditional to install it on Fedora <= 30 or RHEL +<= 8 in 9e68789d and the FIXME was removed, then in 9eb1d1ed that +conditional was simplified to only refer to RHEL, so we wound up +with this situation. + +Note the last two commits were never ported to the RHEL-8 branch, +so it's broken, I will send a separate PR for that. + +Signed-off-by: Adam Williamson + +Cherry-picked from: b3e55bde30b8d34c7ed888794ef3f5e9f028b267 +Resolves: #1771517 +--- + dracut.spec | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index dcaafa61..c8783699 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -277,15 +277,9 @@ rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd + rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd + %endif + +-%if 0%{?fedora} || 0%{?rhel} + 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 + +-# FIXME: remove after F30 +-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 +- + %files + %if %{with doc} + %doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg +@@ -477,11 +471,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne + + %files config-rescue + %{dracutlibdir}/dracut.conf.d/02-rescue.conf +-%if 0%{?fedora} || 0%{?rhel} + %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install +-# FIXME: remove after F30 +-%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh +-%endif + + %triggerin network -- dracut-network < 049-83.git20200525 + echo '# Since rhel-8.3 dracut moved to use NetworkManager + diff --git a/0137.patch b/0137.patch new file mode 100644 index 0000000..4e7190e --- /dev/null +++ b/0137.patch @@ -0,0 +1,26 @@ +From 862c5a97a69d61ff9122072d8c7bb2e828086650 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Wed, 5 May 2021 16:05:17 +0200 +Subject: [PATCH] fix(fips): add dh and ecdh ciphers + +(cherry picked from commit 543b8014fc10fc6a92ba83db0dfc994fc1d2129b) + +Resolves: #1775692 +--- + modules.d/01fips/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index f011f15d..8800a49e 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -24,7 +24,7 @@ installkernel() { + _fipsmodules+="crc32c crct10dif ghash " + + # Ciphers: +- _fipsmodules+="cipher_null des3_ede aes cfb " ++ _fipsmodules+="cipher_null des3_ede aes cfb dh ecdh " + + # Modes/templates: + _fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac " + diff --git a/0138.patch b/0138.patch new file mode 100644 index 0000000..9d012fb --- /dev/null +++ b/0138.patch @@ -0,0 +1,33 @@ +From 68826ecc8d1b0605cd69a4f679c0cd4de4e12b18 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Tue, 9 Feb 2021 16:46:07 +0100 +Subject: [PATCH] 35network-legacy: discard pointless RTNETLINK message + +This command prints + + RTNETLINK answers: Network is unreachable + +to stderr if IP is not assigned yet, but that's the thing we are +checking for, so there's no point in showing the message. + +(cherry picked from commit c46ed697a20798c09ead362443691d810e122996) + +Resolves: #1879597 +--- + 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 61838741..bd560379 100755 +--- a/modules.d/35network-legacy/ifup.sh ++++ b/modules.d/35network-legacy/ifup.sh +@@ -106,7 +106,7 @@ do_static() { + return 1 + fi + +- ip route get "$ip" | { ++ ip route get "$ip" 2>/dev/null | { + read a rest + if [ "$a" = "local" ]; then + warn "Not assigning $ip to interface $netif, cause it is already assigned!" + diff --git a/0139.patch b/0139.patch new file mode 100644 index 0000000..639d751 --- /dev/null +++ b/0139.patch @@ -0,0 +1,74 @@ +From 809423a5731e4433f3fa08e97ddf152e49cd00bf Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Fri, 13 Nov 2020 18:08:47 +0800 +Subject: [PATCH] 95fcoe: don't install if there is no FCoE hostonly devices + +When in hostonly mode, 95fcoe module will still be installed even there +is no FCoE hostonly device. So use the new block_is_fcoe helper to check +for hostonly device in hostonly mode, avoid installing unneccessary module. + +Signed-off-by: Kairui Song +(cherry picked from commit 8c8af8a2cd728e917be8465c79b12149e6877aef) + +Resolves: #1899456 +--- + modules.d/95fcoe-uefi/module-setup.sh | 17 +++++------------ + modules.d/95fcoe/module-setup.sh | 11 +++++------ + 2 files changed, 10 insertions(+), 18 deletions(-) + +diff --git a/modules.d/95fcoe-uefi/module-setup.sh b/modules.d/95fcoe-uefi/module-setup.sh +index a464df5a..9e5719df 100755 +--- a/modules.d/95fcoe-uefi/module-setup.sh ++++ b/modules.d/95fcoe-uefi/module-setup.sh +@@ -2,22 +2,15 @@ + + # called by dracut + check() { +- local _fcoe_ctlr +- [[ $hostonly ]] || [[ $mount_needs ]] && { +- for c in /sys/bus/fcoe/devices/ctlr_* ; do +- [ -L $c ] || continue +- _fcoe_ctlr=$c +- done +- [ -z "$_fcoe_ctlr" ] && return 255 ++ is_fcoe() { ++ block_is_fcoe $1 || return 1 + } ++ + [[ $hostonly ]] || [[ $mount_needs ]] && { ++ for_each_host_dev_and_slaves is_fcoe || return 255 + [ -d /sys/firmware/efi ] || return 255 +- for c in /sys/bus/fcoe/devices/ctlr_* ; do +- [ -L $c ] || continue +- fcoe_ctlr=$c +- done +- [ -z "$fcoe_ctlr" ] && return 255 + } ++ + require_binaries dcbtool fipvlan lldpad ip readlink || return 1 + return 0 + } +diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh +index c2224ec1..f5df705b 100755 +--- a/modules.d/95fcoe/module-setup.sh ++++ b/modules.d/95fcoe/module-setup.sh +@@ -2,13 +2,12 @@ + + # called by dracut + check() { +- local _fcoe_ctlr ++ is_fcoe() { ++ block_is_fcoe $1 || return 1 ++ } ++ + [[ $hostonly ]] || [[ $mount_needs ]] && { +- for c in /sys/bus/fcoe/devices/ctlr_* ; do +- [ -L $c ] || continue +- _fcoe_ctlr=$c +- done +- [ -z "$_fcoe_ctlr" ] && return 255 ++ for_each_host_dev_and_slaves is_fcoe || return 255 + } + + require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1 + diff --git a/0140.patch b/0140.patch new file mode 100644 index 0000000..d28c7b6 --- /dev/null +++ b/0140.patch @@ -0,0 +1,36 @@ +From 7a6dfe638d1ef92dfe830094db6b09cb0956c189 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 19 Jul 2021 11:27:28 +0200 +Subject: [PATCH] 95nfs: set correct ownership and permissions for statd + directory + +The directory ownership for the statd directory should be +rpcuser:rpcuser. + +Fixes: 5840c466 95nfs: /var/lib/nfs/statd/sm is /var/lib/nfs/sm on SUSE + +Resolves: #1924950 +--- + modules.d/95nfs/module-setup.sh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh +index 2ca75d07..ac6d1761 100755 +--- a/modules.d/95nfs/module-setup.sh ++++ b/modules.d/95nfs/module-setup.sh +@@ -104,7 +104,13 @@ install() { + 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" +- mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" ++ [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] && \ ++ mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" && \ ++ mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" && \ ++ chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd" ++ [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] && \ ++ mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" && ++ chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm" + + # Rather than copy the passwd file in, just set a user for rpcbind + # We'll save the state and restart the daemon from the root anyway + diff --git a/0141.patch b/0141.patch new file mode 100644 index 0000000..a79a87d --- /dev/null +++ b/0141.patch @@ -0,0 +1,52 @@ +From eaba11eff1156f7a0324a1aa46e43396c7ec3628 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Mon, 1 Mar 2021 17:43:10 +0100 +Subject: [PATCH] fix(dracut.sh): harden dracut against GZIP environment + variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When a GZIP environment variable is set, this leads to various breakage: + +In case 'pigz' is installed and GZIP is defined as a path, e.g. +/usr/local/bin/gzip, then dracut will fail with the following message: + + " + pigz: abort: cannot provide files in GZIP environment variable + " + +In case 'pigz' isn't installed and regular 'gzip' is used and GZIP is +defined as a path, e.g. /usr/local/bin/gzip, then the path will be +zipped and dracut will fail for no obvious reason. Trying again, dracut +will then fail with following message: + + " + gzip: /usr/local/bin/gzip.gz already exists; not overwritten + " + +In any case, GZIP environment should be unset to avoid breakage or +unwanted behaviour. This variable is anyway obsolescent, from gzip(1) +manpage. + +Signed-off-by: Renaud Métrich +(cherry picked from commit d8e47e201af4646e2a82e11220ea9c993bd2ed48) + +Resolves: #1933773 +--- + dracut.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.sh b/dracut.sh +index 01abe7a4..4340e646 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -24,6 +24,7 @@ + # store for logging + + unset BASH_ENV ++unset GZIP + + # Verify bash version, current minimum is 4 + if (( BASH_VERSINFO[0] < 4 )); then + diff --git a/0142.patch b/0142.patch new file mode 100644 index 0000000..86cb3b2 --- /dev/null +++ b/0142.patch @@ -0,0 +1,36 @@ +From 3789ef258ecced4b91139b10e71dc787e48519e7 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 23 Apr 2021 11:11:27 +0200 +Subject: [PATCH] fix(multipath): stop multipath before udev db cleanup + +All device-mapper based devices, including device-mapper-multipath, +do reuse the udev db from the initramfs after switching to the root fs. + +Therefore device-mapper devices have to be correctly initialized before +the udev daemon is stopped, to have the correct entries in the udev db. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=1949076 + +(cherry picked from commit 3c244c7ca3555b526883dc20104c469b39085cbe) + +Resolves: #1949076 +--- + modules.d/90multipath/multipathd.service | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service +index 646c7c14..b544de21 100644 +--- a/modules.d/90multipath/multipathd.service ++++ b/modules.d/90multipath/multipathd.service +@@ -4,8 +4,10 @@ Before=iscsi.service iscsid.service lvm2-activation-early.service + Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target + After=systemd-udev-trigger.service systemd-udev-settle.service + Before=local-fs-pre.target ++Before=initrd-cleanup.service + DefaultDependencies=no + Conflicts=shutdown.target ++Conflicts=initrd-cleanup.service + ConditionKernelCommandLine=!nompath + ConditionKernelCommandLine=!rd.multipath=0 + ConditionKernelCommandLine=!rd_NO_MULTIPATH + diff --git a/0143.patch b/0143.patch new file mode 100644 index 0000000..a680621 --- /dev/null +++ b/0143.patch @@ -0,0 +1,89 @@ +From f03ee48fab36a9fe55082f15111771b698081598 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Wed, 5 May 2021 15:46:08 +0200 +Subject: [PATCH] fix(dracut-functions): implement a cache for get_maj_min +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On systems with a large number of devices, usually multipath devices, +dracut can spend a lot of time stat'ing the devices to collect the +major/minor numbers, leading to huge slowness rebuilding the initramfs +when stat'ing devices is slow (seen with oracleasm file systems in +particular). +This commit implements a basic cache stored in a file under +DRACUT_TMPDIR storing the major:minor corresponding to the specified +device. + +Reproducer: create N loopback devices used as a LVM extension to volume +group hosting the root file system + + # LVMVG="rhel" + # NDEVICES=200 + # mkdir devices; for i in $(seq 1 $NDEVICES); do + truncate -s 10m devices/$i; losetup loop$i devices/$i + done + # vgextend $LVMVG $(/bin/ls -1 /dev/loop[0-9]*) + +With standard code (tested with RHEL8.3 dracut): + + # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug 2>&1 + # grep -c "stat -L -c" /tmp/debug + 2440 + +With this code: + + # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug_optim 2>&1 + # grep -c "stat -L -c" /tmp/debug_optim + 205 + +Signed-off-by: Renaud Métrich +(cherry picked from commit c3bb9d18dceed7db6d16f9c2a7f682c5934099d7) + +Cherry-picked from: c3bb9d18dceed7db6d16f9c2a7f682c5934099d7 +Resolves: #1957622 +--- + dracut-functions.sh | 10 +++++++--- + dracut.sh | 4 ++++ + 2 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 1431dd18..a221967c 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -199,12 +199,16 @@ get_fs_env() { + # $ get_maj_min /dev/sda2 + # 8:2 + get_maj_min() { +- local _maj _min _majmin ++ local _majmin ++ out="$(grep -m1 -oP "^$1 \K\S+$" "${get_maj_min_cache_file:?}")" ++ if [ -z "$out" ]; then + _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)" +- printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))" ++ out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" ++ echo "$1 $out" >> "${get_maj_min_cache_file:?}" ++ fi ++ echo -n "$out" + } + +- + # get_devpath_block + # get the DEVPATH in /sys of a block device + get_devpath_block() { +diff --git a/dracut.sh b/dracut.sh +index 4340e646..f8e68ccb 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -901,6 +901,10 @@ readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)" + exit 1 + } + ++# Cache file used to optimize get_maj_min() ++declare -x -r get_maj_min_cache_file="${DRACUT_TMPDIR}/majmin_cache" ++: > "$get_maj_min_cache_file" ++ + # clean up after ourselves no matter how we die. + trap ' + ret=$?; + diff --git a/0144.patch b/0144.patch new file mode 100644 index 0000000..8bbb105 --- /dev/null +++ b/0144.patch @@ -0,0 +1,48 @@ +From 6ed9cff05fb1015fe50951c93430052004d22b01 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 21 May 2021 12:19:32 +0200 +Subject: [PATCH] fix(dracut-functions): get_maj_min without + get_maj_min_cache_file set + +If `get_maj_min_cache_file` is unset `get_maj_min()` would error out. + +Fix it to work without a cache file set. + +(cherry picked from commit a277a5fc7acc0a9e8d853f09671495f9d27645c1) + +Cherry-picked from: a277a5fc7acc0a9e8d853f09671495f9d27645c1 +Resolves: #1957622 +--- + dracut-functions.sh | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index a221967c..eb2ce748 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -200,13 +200,20 @@ get_fs_env() { + # 8:2 + get_maj_min() { + local _majmin +- out="$(grep -m1 -oP "^$1 \K\S+$" "${get_maj_min_cache_file:?}")" +- if [ -z "$out" ]; then ++ local _out ++ ++ if [[ $get_maj_min_cache_file ]]; then ++ _out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")" ++ fi ++ ++ if ! [[ "$_out" ]]; then + _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)" + out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" +- echo "$1 $out" >> "${get_maj_min_cache_file:?}" ++ if [[ $get_maj_min_cache_file ]]; then ++ echo "$1 $_out" >> "$get_maj_min_cache_file" ++ fi + fi +- echo -n "$out" ++ echo -n "$_out" + } + + # get_devpath_block + diff --git a/0145.patch b/0145.patch new file mode 100644 index 0000000..bec6dae --- /dev/null +++ b/0145.patch @@ -0,0 +1,43 @@ +From 21b746743c146c94235c93611519db6d47c8c0c1 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 18 Feb 2021 11:01:31 +0100 +Subject: [PATCH] fix(fcoe): rd.nofcoe=0 should disable fcoe + +8446c8f9 Changed the default behavior, but also flipped meaning of 0/1. +Right now rd.nofcoe=0 enables fcoe, which is the opposite what manpage +says. + +(cherry picked from commit 805b46c2a81e04d69fc3af912942568516d05ee7) + +Resolves: #1929201 +--- + 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 7faa2e19..6b1844b0 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 1 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 86f4331e..5553602f 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 1 rd.nofcoe ; then + info "rd.nofcoe=0: skipping fcoe" + return 0 + fi + diff --git a/0146.patch b/0146.patch new file mode 100644 index 0000000..14c5981 --- /dev/null +++ b/0146.patch @@ -0,0 +1,63 @@ +From c588aea59c9a2441596b84722c6c32449676f07d Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 18 Feb 2021 11:23:41 +0100 +Subject: [PATCH] fix(fcoe): rename rd.nofcoe to rd.fcoe + +The current name of this bool is kinda stupid. Based on the manpage +setting it to 0 turns off fcoe, which means that nofcoe=1 should mean +that it is on. + +Let's just do the same thing as with rd.lvm=0, rd.luks=0,.... + +(cherry picked from commit 6f7823bce65dd4b52497dbb94892b637fd06471a) + +Resolves: #1929201 +--- + dracut.cmdline.7.asc | 2 +- + modules.d/95fcoe/lldpad.sh | 4 ++-- + modules.d/95fcoe/parse-fcoe.sh | 4 ++-- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc +index bf745575..327f85de 100644 +--- a/dracut.cmdline.7.asc ++++ b/dracut.cmdline.7.asc +@@ -779,7 +779,7 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30 + + FCoE + ~~~~ +-**rd.nofcoe=0**:: ++**rd.fcoe=0**:: + disable FCoE and lldpad + + **fcoe=**____:__{dcb|nodcb}__:__{fabric|vn2vn}__:: +diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh +index 6b1844b0..c860035f 100755 +--- a/modules.d/95fcoe/lldpad.sh ++++ b/modules.d/95fcoe/lldpad.sh +@@ -1,7 +1,7 @@ + #!/bin/bash + +-if ! getargbool 1 rd.nofcoe ; then +- info "rd.nofcoe=0: skipping lldpad activation" ++if ! getargbool 1 rd.fcoe -d -n rd.nofcoe ; then ++ info "rd.fcoe=0: skipping lldpad activation" + return 0 + fi + +diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh +index 5553602f..0a8067f5 100755 +--- a/modules.d/95fcoe/parse-fcoe.sh ++++ b/modules.d/95fcoe/parse-fcoe.sh +@@ -13,8 +13,8 @@ + # fcoe=eth0:nodcb:vn2vn + # fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric + +-if ! getargbool 1 rd.nofcoe ; then +- info "rd.nofcoe=0: skipping fcoe" ++if ! getargbool 1 rd.fcoe -d -n rd.nofcoe ; then ++ info "rd.fcoe=0: skipping fcoe" + return 0 + fi + + diff --git a/0147.patch b/0147.patch new file mode 100644 index 0000000..a11b66a --- /dev/null +++ b/0147.patch @@ -0,0 +1,170 @@ +From dc316701f752f5197a6a926a9a401688ffdb9bca Mon Sep 17 00:00:00 2001 +From: Mariusz Tkaczyk +Date: Thu, 26 Nov 2020 13:04:44 +0100 +Subject: [PATCH] fix(mdraid): remove offroot + +offroot is deprecated and can be safety removed. + +Signed-off-by: Mariusz Tkaczyk +(cherry picked from commit 30e49d51751c695be85782cfc162de2a63db471c) + +Resolves: #1958899 +--- + modules.d/90mdraid/65-md-incremental-imsm.rules | 2 +- + modules.d/90mdraid/md-shutdown.sh | 5 ++--- + modules.d/90mdraid/mdraid-cleanup.sh | 7 +++---- + modules.d/90mdraid/mdraid-waitclean.sh | 7 +++---- + modules.d/90mdraid/mdraid_start.sh | 10 +++------- + modules.d/90mdraid/parse-md.sh | 2 -- + 6 files changed, 12 insertions(+), 21 deletions(-) + +diff --git a/modules.d/90mdraid/65-md-incremental-imsm.rules b/modules.d/90mdraid/65-md-incremental-imsm.rules +index 52f5b195..6697f159 100644 +--- a/modules.d/90mdraid/65-md-incremental-imsm.rules ++++ b/modules.d/90mdraid/65-md-incremental-imsm.rules +@@ -39,6 +39,6 @@ RUN+="/sbin/initqueue --timeout --name 50-mdraid_start --onetime --unique /sbin/ + # + LABEL="md_incremental" + +-RUN+="/sbin/mdadm $env{rd_MD_OFFROOT} -I $env{DEVNAME}" ++RUN+="/sbin/mdadm -I $env{DEVNAME}" + + LABEL="md_end" +diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh +index 400bb003..40c82570 100755 +--- a/modules.d/90mdraid/md-shutdown.sh ++++ b/modules.d/90mdraid/md-shutdown.sh +@@ -3,12 +3,11 @@ + _do_md_shutdown() { + local ret + local final=$1 +- local _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) + info "Waiting for mdraid devices to be clean." +- mdadm $_offroot -vv --wait-clean --scan| vinfo ++ mdadm -vv --wait-clean --scan| vinfo + ret=$? + info "Disassembling mdraid devices." +- mdadm $_offroot -vv --stop --scan | vinfo ++ mdadm -vv --stop --scan | vinfo + ret=$(($ret+$?)) + if [ "x$final" != "x" ]; then + info "/proc/mdstat:" +diff --git a/modules.d/90mdraid/mdraid-cleanup.sh b/modules.d/90mdraid/mdraid-cleanup.sh +index 565449a5..007e581b 100755 +--- a/modules.d/90mdraid/mdraid-cleanup.sh ++++ b/modules.d/90mdraid/mdraid-cleanup.sh +@@ -2,7 +2,6 @@ + + type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + +-_offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) + containers="" + for md in /dev/md[0-9_]*; do + [ -b "$md" ] || continue +@@ -12,11 +11,11 @@ for md in /dev/md[0-9_]*; do + containers="$containers $md" + continue + fi +- mdadm $_offroot -S "$md" >/dev/null 2>&1 ++ mdadm -S "$md" >/dev/null 2>&1 + done + + for md in $containers; do +- mdadm $_offroot -S "$md" >/dev/null 2>&1 ++ mdadm -S "$md" >/dev/null 2>&1 + done + +-unset containers udevinfo _offroot ++unset containers udevinfo +diff --git a/modules.d/90mdraid/mdraid-waitclean.sh b/modules.d/90mdraid/mdraid-waitclean.sh +index 5c901982..0a7480f7 100755 +--- a/modules.d/90mdraid/mdraid-waitclean.sh ++++ b/modules.d/90mdraid/mdraid-waitclean.sh +@@ -1,7 +1,6 @@ + #!/bin/sh + + if getargbool 0 rd.md.waitclean; then +- _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) + type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + containers="" + for md in /dev/md[0-9_]*; do +@@ -13,13 +12,13 @@ if getargbool 0 rd.md.waitclean; then + continue + fi + info "Waiting for $md to become clean" +- mdadm $_offroot -W "$md" >/dev/null 2>&1 ++ mdadm -W "$md" >/dev/null 2>&1 + done + + for md in $containers; do + info "Waiting for $md to become clean" +- mdadm $_offroot -W "$md" >/dev/null 2>&1 ++ mdadm -W "$md" >/dev/null 2>&1 + done + +- unset containers udevinfo _offroot ++ unset containers udevinfo + fi +diff --git a/modules.d/90mdraid/mdraid_start.sh b/modules.d/90mdraid/mdraid_start.sh +index 77e843d7..ed8d8dfe 100755 +--- a/modules.d/90mdraid/mdraid_start.sh ++++ b/modules.d/90mdraid/mdraid_start.sh +@@ -7,7 +7,6 @@ _md_start() { + local _path_s + local _path_d + local _md="$1" +- local _offroot="$2" + + _udevinfo="$(udevadm info --query=env --name="${_md}")" + strstr "$_udevinfo" "MD_LEVEL=container" && continue +@@ -19,7 +18,7 @@ _md_start() { + # inactive ? + [ "$(cat "$_path_s")" != "inactive" ] && continue + +- mdadm $_offroot -R "${_md}" 2>&1 | vinfo ++ mdadm -R "${_md}" 2>&1 | vinfo + + # still inactive ? + [ "$(cat "$_path_s")" = "inactive" ] && continue +@@ -30,14 +29,11 @@ _md_start() { + } + + _md_force_run() { +- local _offroot + local _md + local _UUID + local _MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=) + [ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return + +- _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot) +- + if [ -n "$_MD_UUID" ]; then + _MD_UUID=$(str_replace "$_MD_UUID" "-" "") + _MD_UUID=$(str_replace "$_MD_UUID" ":" "") +@@ -58,13 +54,13 @@ _md_force_run() { + # check if we should handle this device + strstr " $_MD_UUID " " $_UUID " || continue + +- _md_start "${_md}" "${_offroot}" ++ _md_start "${_md}" + done + else + # try to force-run anything not running yet + for _md in /dev/md[0-9_]*; do + [ -b "$_md" ] || continue +- _md_start "${_md}" "${_offroot}" ++ _md_start "${_md}" + done + fi + } +diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh +index 4d9baa52..2cce9769 100755 +--- a/modules.d/90mdraid/parse-md.sh ++++ b/modules.d/90mdraid/parse-md.sh +@@ -60,5 +60,3 @@ if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then + info "no MD RAID for SNIA ddf raids" + udevproperty rd_NO_MDDDF=1 + fi +- +-strstr "$(mdadm --help-options 2>&1)" offroot && udevproperty rd_MD_OFFROOT=--offroot + diff --git a/0148.patch b/0148.patch new file mode 100644 index 0000000..36848c6 --- /dev/null +++ b/0148.patch @@ -0,0 +1,35 @@ +From 5818f56e99aecca0664f779c29c569f116f907e4 Mon Sep 17 00:00:00 2001 +From: Mariusz Tkaczyk +Date: Thu, 26 Nov 2020 12:51:47 +0100 +Subject: [PATCH] fix(mdraid): add grow continue service + +During raid assembly mdadm will call mdadm-grow-continue.service if +reshape is in progress. +If service doesn't exist then it is done via fork and systemd will kill +it unconditionally after processing all events. + +Add proper service to allow systemd to manage reshape correctly. + +Signed-off-by: Mariusz Tkaczyk +(cherry picked from commit 29e269a5225ad8f658a8d7ef64d77d0c02f8e31d) + +Resolves: #1958899 +--- + modules.d/90mdraid/module-setup.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 98a4ef5d..2e043041 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -136,6 +136,9 @@ install() { + if [ -e $systemdsystemunitdir/mdadm-last-resort@.timer ]; then + inst_simple $systemdsystemunitdir/mdadm-last-resort@.timer + fi ++ if [ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-grow-continue@.service ]; then ++ inst_simple $systemdsystemunitdir/mdadm-grow-continue@.service ++ fi + fi + inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh" + dracut_need_initqueue + diff --git a/0149.patch b/0149.patch new file mode 100644 index 0000000..5dc5c79 --- /dev/null +++ b/0149.patch @@ -0,0 +1,32 @@ +From 7b5182a572c03279b65f0c6abd434edd513e956d Mon Sep 17 00:00:00 2001 +From: Thomas Blume +Date: Fri, 7 Aug 2020 08:39:26 +0200 +Subject: [PATCH] net-lib.sh: support infiniband network mac addresses + +Infiniband MAC addresses have 20 octets. + +Reference: bsc#996146 +(cherry picked from commit 376ce85105121936666349aa5a777768d52516f7) + +Resolves: #1964538 +--- + modules.d/40network/net-lib.sh | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh +index f0c1c041..128d6343 100755 +--- a/modules.d/40network/net-lib.sh ++++ b/modules.d/40network/net-lib.sh +@@ -570,6 +570,11 @@ parse_ifname_opts() { + # udev requires MAC addresses to be lower case + ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | sed 'y/ABCDEF/abcdef/') + ;; ++ 21) ++ ifname_if=$1 ++ # udev requires MAC addresses to be lower case ++ ifname_mac=$(echo $2:$3:$4:$5:$6:$7:$8:$9:${10}:${11}:${12}:${13}:${14}:${15}:${16}:${17}:${18}:${19}:${20}:${21} | sed 'y/ABCDEF/abcdef/') ++ ;; + *) + die "Invalid arguments for ifname=" + ;; + diff --git a/0150.patch b/0150.patch new file mode 100644 index 0000000..a8bd04d --- /dev/null +++ b/0150.patch @@ -0,0 +1,55 @@ +From 81f38303351391b054e28d91cb101756233d2b64 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 28 Sep 2020 13:39:07 +0200 +Subject: [PATCH] 95nvmf: add nvmf-autoconnect script + +Add a script to run FC autoconnect. + +Signed-off-by: Hannes Reinecke +(cherry picked from commit 0e2ef80993858992f6219b5162289568937a1fac) + +Cherry-picked from: 0e2ef80993858992f6219b5162289568937a1fac +Resolves: #1975707 +--- + modules.d/95nvmf/module-setup.sh | 2 ++ + modules.d/95nvmf/nvmf-autoconnect.sh | 5 +++++ + modules.d/95nvmf/parse-nvmf-boot-connections.sh | 2 +- + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh +index 418b5e0c..3923451b 100755 +--- a/modules.d/95nvmf/module-setup.sh ++++ b/modules.d/95nvmf/module-setup.sh +@@ -79,6 +79,8 @@ install() { + + inst_multiple ip sed + ++ inst_script "${moddir}/nvmf-autoconnect.sh" /sbin/nvmf-autoconnect.sh ++ + inst_multiple nvme + inst_multiple -o \ + "$systemdsystemunitdir/nvm*-connect@.service" \ +diff --git a/modules.d/95nvmf/nvmf-autoconnect.sh b/modules.d/95nvmf/nvmf-autoconnect.sh +new file mode 100644 +index 00000000..c8f676a7 +--- /dev/null ++++ b/modules.d/95nvmf/nvmf-autoconnect.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++ ++[ -f /sys/class/fc/fc_udev_device/nvme_discovery ] || exit 1 ++echo add > /sys/class/fc/fc_udev_device/nvme_discovery ++exit 0 +diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh +index 61c6dec1..ceb52f1e 100755 +--- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh ++++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh +@@ -133,6 +133,6 @@ else + /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 ++ /sbin/initqueue --finished --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh + fi + fi + diff --git a/0151.patch b/0151.patch new file mode 100644 index 0000000..d92a68f --- /dev/null +++ b/0151.patch @@ -0,0 +1,24 @@ +From a1b8660316c7d0a541d9e4139df5c5efe2532365 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 29 Jul 2021 17:40:26 +0200 +Subject: [PATCH] dracut-functions: fix botched backport + +Resolves: #1957622 +--- + dracut-functions.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index eb2ce748..d75696fd 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -208,7 +208,7 @@ get_maj_min() { + + if ! [[ "$_out" ]]; then + _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)" +- out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" ++ _out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" + if [[ $get_maj_min_cache_file ]]; then + echo "$1 $_out" >> "$get_maj_min_cache_file" + fi + diff --git a/0152.patch b/0152.patch new file mode 100644 index 0000000..f6f7f64 --- /dev/null +++ b/0152.patch @@ -0,0 +1,75 @@ +From 20ea91703b98708579f3d531823ec56bcec2bf1a Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Fri, 9 Nov 2018 10:48:28 +0800 +Subject: [PATCH] squash: unsquash the root image instead of mounting it on + shutdown + +When building squash image, squash module forgot to install the new +shutdown.sh, and the shutdown hooks are always skipped on ordinary +shutdown if squash module is enabled. + +The new shutdown.sh will remount the squash image and then everything +will just work, but currently re-mounting the squash image on shutdown +may have selinux problem and make the system hang, and there is no +easy way to fix it. + +So skip fixing the shutdown.sh not being install problem, instead +just drop the new shutdown.sh, and unsquash the image on ordinary +shutdown, which is safer and should always work. + +Signed-off-by: Kairui Song +(cherry picked from commit a60af534132828fd46fa017291f7ed7cfeab1dc3) + +Resolves: #1959336 +--- + dracut-initramfs-restore.sh | 9 +++++++++ + dracut.sh | 2 -- + modules.d/99squash/shutdown.sh | 7 ------- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh +index 94794804..67fc88fa 100644 +--- a/dracut-initramfs-restore.sh ++++ b/dracut-initramfs-restore.sh +@@ -40,4 +40,13 @@ else + exit 1 + fi + ++if [[ -d squash ]]; then ++ unsquashfs -no-xattrs -f -d . squash/root.img >/dev/null ++ if [ $? -ne 0 ]; then ++ echo "Squash module is enabled for this initramfs but failed to unpack squash/root.img" >&2 ++ rm -f -- /run/initramfs/shutdown ++ exit 1 ++ fi ++fi ++ + exit 0 +diff --git a/dracut.sh b/dracut.sh +index f8e68ccb..966350c5 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1817,9 +1817,7 @@ if dracut_module_included "squash"; then + done + + mv $initdir/init $initdir/init.stock +- mv $initdir/shutdown $initdir/shutdown.stock + ln -s squash/init.sh $initdir/init +- ln -s squash/shutdown.sh $initdir/shutdown + + # Reinstall required files for the squash image setup script. + # We have moved them inside the squashed image, but they need to be +diff --git a/modules.d/99squash/shutdown.sh b/modules.d/99squash/shutdown.sh +deleted file mode 100755 +index 535779f4..00000000 +--- a/modules.d/99squash/shutdown.sh ++++ /dev/null +@@ -1,7 +0,0 @@ +-#!/bin/sh +-/squash/setup-squash.sh +- +-exec /shutdown.stock +- +-echo "Something went wrong when trying to start original shutdown executable!" +-exit 1 + diff --git a/0153.patch b/0153.patch new file mode 100644 index 0000000..e45b8a4 --- /dev/null +++ b/0153.patch @@ -0,0 +1,33 @@ +From 309c4b0a1756399d9bfd5576d904be63c0a9a8c8 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 25 Dec 2018 17:53:24 +0800 +Subject: [PATCH] 99squash: fail early if can't install require modules in + initramfs + +insmods will consider all arguments as optional modules by default, but +for squash module, all listed modules are required, if any of them is +missing the initramfs won't boot. So pass the '-c' argument to let instmos +know all those modules are mandatory, it will fail and give an error if +it failed to install any of those modules. + +(cherry picked from commit 90ac0a2d772ec0d4f90ea16fc5a31be10bdf205e) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 7aa0b447..72fa81f0 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -10,7 +10,7 @@ depends() { + } + + installkernel() { +- hostonly="" instmods squashfs loop overlay ++ hostonly="" instmods -c squashfs loop overlay + } + + install() { + diff --git a/0154.patch b/0154.patch new file mode 100644 index 0000000..b7bedc8 --- /dev/null +++ b/0154.patch @@ -0,0 +1,36 @@ +From 776ee36e59f6f2cb97f6cd2bca4c989b89a727d2 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 8 Jun 2020 15:31:56 +0800 +Subject: [PATCH] 99squash: Don't hardcode the squash sub directories + +Signed-off-by: Kairui Song +(cherry picked from commit 3a2beb037c822e1567f86b63ac24194bffeea991) + +Resolves: #1959336 +--- + 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 + diff --git a/0155.patch b/0155.patch new file mode 100644 index 0000000..25a88c6 --- /dev/null +++ b/0155.patch @@ -0,0 +1,56 @@ +From a5b46f9fad27954206fe47dedcef350f77f244a0 Mon Sep 17 00:00:00 2001 +From: Kairui Song +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 +(cherry picked from commit cfd872392c59c96665c558899880d6b2980065bb) + +Resolves: #1959336 +--- + 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 + diff --git a/0156.patch b/0156.patch new file mode 100644 index 0000000..e507a39 --- /dev/null +++ b/0156.patch @@ -0,0 +1,159 @@ +From 8272fd2f1b676abe22abaacfe7c1ebd24b56fcb6 Mon Sep 17 00:00:00 2001 +From: Pedro Monreal +Date: Thu, 8 Nov 2018 14:15:38 +0100 +Subject: [PATCH] Fixed some SUSE specific typos and outputs + +(cherry picked from commit f18d069d4664c148df8563139b358806ecfe6799) + +Resolves: #1959336 +--- + dracut.conf.5.asc | 2 +- + dracut.conf.d/suse.conf.example | 4 ++-- + dracut.sh | 4 ++-- + dracut.usage.asc | 6 +++--- + mkinitrd-suse.sh | 4 ++-- + modules.d/98dracut-systemd/dracut-shutdown.service.8.asc | 2 +- + modules.d/98syslog/README | 2 +- + modules.d/99base/dracut-lib.sh | 2 +- + 8 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/dracut.conf.5.asc b/dracut.conf.5.asc +index 1dfa28f6..081ed70c 100644 +--- a/dracut.conf.5.asc ++++ b/dracut.conf.5.asc +@@ -157,7 +157,7 @@ provide a valid _/etc/fstab_. + archive. This cpio archive gets glued (concatenated, uncompressed one + must be the first one) to the compressed cpio archive. The first, + uncompressed cpio archive is for data which the kernel must be able +- to access very early (and cannot make use of uncompress alogrithms yet) ++ to access very early (and cannot make use of uncompress algorithms yet) + like microcode or ACPI tables (default=no). + + *acpi_table_dir=*"____":: +diff --git a/dracut.conf.d/suse.conf.example b/dracut.conf.d/suse.conf.example +index 37ffd72b..b5d962db 100644 +--- a/dracut.conf.d/suse.conf.example ++++ b/dracut.conf.d/suse.conf.example +@@ -1,6 +1,6 @@ +-# SUSE specifc dracut settings ++# SUSE specific dracut settings + # +-# SUSE by default always builds a as small as possible initrd for performance ++# SUSE by default always builds as small as possible initrd for performance + # and resource reasons. + # If you like to build a generic initrd which works on other platforms than + # on the one dracut/mkinitrd got called comment out below setting(s). +diff --git a/dracut.sh b/dracut.sh +index 966350c5..b9657dc6 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1679,7 +1679,7 @@ if [[ $early_microcode = yes ]]; then + for _fwdir in $fw_dir; do + if [[ -d $_fwdir && -d $_fwdir/$_fw ]]; then + _src="*" +- dinfo "*** Constructing ${ucode_dest[$idx]} ****" ++ dinfo "*** Constructing ${ucode_dest[$idx]} ***" + if [[ $hostonly ]]; then + _src=$(get_ucode_file) + [[ $_src ]] || break +@@ -1762,7 +1762,7 @@ if dracut_module_included "squash"; then + + # Move some files out side of the squash image, including: + # - Files required to boot and mount the squashfs image +- # - Files need to be accessable without mounting the squash image ++ # - Files need to be accessible without mounting the squash image + required_in_root() { + local file=$1 + local _sqsh_file=$squash_dir/$file +diff --git a/dracut.usage.asc b/dracut.usage.asc +index 2b598ee6..0f219fc9 100644 +--- a/dracut.usage.asc ++++ b/dracut.usage.asc +@@ -83,7 +83,7 @@ on the command line: + === Adding Kernel Modules + If you need a special kernel module in the initramfs, which is not + automatically picked up by dracut, you have the use the --add-drivers option +-on the command line or the drivers vaiable in the _/etc/dracut.conf_ ++on the command line or the drivers variable in the _/etc/dracut.conf_ + or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)): + ---- + # dracut --add-drivers mymod initramfs-with-mymod.img +@@ -94,7 +94,7 @@ An initramfs generated without the "hostonly" mode, does not contain any system + configuration files (except for some special exceptions), so the configuration + has to be done on the kernel command line. With this flexibility, you can easily + boot from a changed root partition, without the need to recompile the initramfs +-image. So, you could completly change your root partition (move it inside a md ++image. So, you could completely change your root partition (move it inside a md + raid with encryption and LVM on top), as long as you specify the correct + filesystem LABEL or UUID on the kernel command line for your root device, dracut + will find it and boot from it. +@@ -185,7 +185,7 @@ This turns off every automatic assembly of LVM, MD raids, DM raids and + crypto LUKS. + + Of course, you could also omit the dracut modules in the initramfs creation +-process, but then you would lose the posibility to turn it on on demand. ++process, but then you would lose the possibility to turn it on on demand. + + + [[Injecting]] +diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh +index 20d85da1..b6af2b19 100755 +--- a/mkinitrd-suse.sh ++++ b/mkinitrd-suse.sh +@@ -1,6 +1,6 @@ + #!/bin/bash --norc + # +-# mkinitrd compability wrapper for SUSE. ++# mkinitrd compatibility wrapper for SUSE. + # + # Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved. + # +@@ -62,7 +62,7 @@ usage () { + $cmd " /etc/sysconfig/kernel." + $cmd " -d root_device Root device. Defaults to the device from" + $cmd " which / is mounted. Overrides the rootdev" +- $cmd " enviroment variable if set." ++ $cmd " environment variable if set." + $cmd " -j device Journal device" + $cmd " -D interface Run dhcp on the specified interface." + $cmd " -I interface Configure the specified interface statically." +diff --git a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc +index f4fbb618..ba80b187 100644 +--- a/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc ++++ b/modules.d/98dracut-systemd/dracut-shutdown.service.8.asc +@@ -15,7 +15,7 @@ dracut-shutdown.service + DESCRIPTION + ----------- + This service unpacks the initramfs image to /run/initramfs. +-systemd pivots into /run/initramfs at shutdown, so the root filesytem ++systemd pivots into /run/initramfs at shutdown, so the root filesystem + can be safely unmounted. + + The following steps are executed during a shutdown: +diff --git a/modules.d/98syslog/README b/modules.d/98syslog/README +index 30a819c0..9eb5adee 100644 +--- a/modules.d/98syslog/README ++++ b/modules.d/98syslog/README +@@ -11,7 +11,7 @@ Then if syslog is configured it is started and will forward all + kernel messages to the given syslog server. + + The syslog implementation is detected automatically by finding the +-apropriate binary with the following order: ++appropriate binary with the following order: + rsyslogd + syslogd + syslog-ng +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 96dd55ad..89a1d69a 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -620,7 +620,7 @@ nfsroot_to_var() { + # prints: + # ENV{ID_FS_LABEL}="boot" + # +-# TOOD: symlinks ++# TODO: symlinks + udevmatch() { + case "$1" in + UUID=????????-????-????-????-????????????|LABEL=*|PARTLABEL=*|PARTUUID=????????-????-????-????-????????????) + diff --git a/0157.patch b/0157.patch new file mode 100644 index 0000000..8205904 --- /dev/null +++ b/0157.patch @@ -0,0 +1,141 @@ +From 9a6b40f023db3763694fb99a820f11017cc56811 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 9 Jun 2020 00:41:24 +0800 +Subject: [PATCH] 99squash: simplify the code + +The new dracutsysrootdir could be used to replace the shell function +required_in_root, so drop it and also simplify the code. + +Signed-off-by: Kairui Song +(cherry picked from commit 4159819fbb20fca8c0a80ddb17e211f481ec7717) + +Resolves: #1959336 +--- + dracut.sh | 89 ++++++++++++++------------------------------------------------- + 1 file changed, 20 insertions(+), 69 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index b9657dc6..176b2259 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1736,23 +1736,19 @@ fi + + 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 +- fi +- if ! check_kernel_config CONFIG_OVERLAY_FS; then +- dfatal "CONFIG_OVERLAY_FS have to be enabled for dracut squash module to work" +- exit 1 +- fi +- if ! check_kernel_config CONFIG_DEVTMPFS; then +- dfatal "CONFIG_DEVTMPFS have to be enabled for dracut squash module to work" ++ for config in \ ++ CONFIG_SQUASHFS \ ++ CONFIG_OVERLAY_FS \ ++ CONFIG_DEVTMPFS; ++ do ++ if ! check_kernel_config $config; then ++ dfatal "$config have to be enabled for dracut squash module to work" + exit 1 +- fi ++ fi ++ done + + readonly squash_dir="$initdir/squash/root" +- readonly squash_img=$initdir/squash/root.img +- +- # Currently only move "usr" "etc" to squashdir ++ readonly squash_img="$initdir/squash/root.img" + readonly squash_candidate=( "usr" "etc" ) + + mkdir -m 0755 -p $squash_dir +@@ -1763,57 +1759,15 @@ if dracut_module_included "squash"; then + # Move some files out side of the squash image, including: + # - Files required to boot and mount the squashfs image + # - Files need to be accessible without mounting the squash image +- required_in_root() { +- local file=$1 +- local _sqsh_file=$squash_dir/$file +- local _init_file=$initdir/$file +- +- if [[ -e $_init_file ]]; then +- return +- fi +- +- if [[ ! -e $_sqsh_file ]] && [[ ! -L $_sqsh_file ]]; then +- derror "$file is required to boot a squashed initramfs but it's not installed!" +- return +- fi +- +- if [[ ! -d $(dirname $_init_file) ]]; then +- required_in_root $(dirname $file) +- fi +- +- if [[ -L $_sqsh_file ]]; then +- cp --preserve=all -P $_sqsh_file $_init_file +- _sqsh_file=$(realpath $_sqsh_file 2>/dev/null) +- if [[ -e $_sqsh_file ]] && [[ "$_sqsh_file" == "$squash_dir"* ]]; then +- # Relative symlink +- required_in_root ${_sqsh_file#$squash_dir/} +- return +- fi +- if [[ -e $squash_dir$_sqsh_file ]]; then +- # Absolute symlink +- required_in_root ${_sqsh_file#/} +- return +- fi +- required_in_root ${module_spec#$squash_dir/} +- else +- if [[ -d $_sqsh_file ]]; then +- mkdir $_init_file +- else +- mv $_sqsh_file $_init_file +- fi +- fi +- } +- +- required_in_root etc/initrd-release +- +- for module_spec in $squash_dir/usr/lib/modules/*/modules.*; +- do +- required_in_root ${module_spec#$squash_dir/} +- done +- +- for dracut_spec in $squash_dir/usr/lib/dracut/*; ++ # - Initramfs marker ++ for file in \ ++ $squash_dir/usr/lib/modules/*/modules.* \ ++ $squash_dir/usr/lib/dracut/* \ ++ $squash_dir/etc/initrd-release + do +- required_in_root ${dracut_spec#$squash_dir/} ++ [[ -d $file ]] && continue ++ DRACUT_RESOLVE_DEPS=1 dracutsysrootdir=$squash_dir inst ${file#$squash_dir} ++ rm $file + done + + mv $initdir/init $initdir/init.stock +@@ -1824,17 +1778,14 @@ if dracut_module_included "squash"; then + # accessible before mounting the image. + inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" + hostonly="" instmods "loop" "squashfs" "overlay" +- + # Only keep systemctl outsite if we need switch root + if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then + inst "systemctl" + fi + ++ # Remove duplicated files + for folder in "${squash_candidate[@]}"; do +- # Remove duplicated files in squashfs image, save some more space +- [[ ! -d $initdir/$folder/ ]] && continue +- for file in $(find $initdir/$folder/ -not -type d); +- do ++ for file in $(find $initdir/$folder/ -not -type d); do + if [[ -e $squash_dir${file#$initdir} ]]; then + mv $squash_dir${file#$initdir} $file + fi + diff --git a/0158.patch b/0158.patch new file mode 100644 index 0000000..478ba28 --- /dev/null +++ b/0158.patch @@ -0,0 +1,58 @@ +From debb3b29ca103e2dac8a3ccafe73f7f815b54979 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 12 Oct 2020 15:23:30 +0800 +Subject: [PATCH] 99squash: Check require module earlier, and properly + +Let 99squash fail earlier if required modules are not enabled or +missing, using the new added helper. + +Signed-off-by: Kairui Song +(cherry picked from commit 83c65fd3db9f5f3436cfe74ec67d2894dedda397) + +Resolves: #1959336 +--- + dracut.sh | 11 ----------- + modules.d/99squash/module-setup.sh | 7 +++++++ + 2 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 176b2259..2090d89f 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1736,17 +1736,6 @@ fi + + if dracut_module_included "squash"; then + dinfo "*** Install squash loader ***" +- for config in \ +- CONFIG_SQUASHFS \ +- CONFIG_OVERLAY_FS \ +- CONFIG_DEVTMPFS; +- do +- if ! check_kernel_config $config; then +- dfatal "$config have to be enabled for dracut squash module to work" +- exit 1 +- fi +- done +- + readonly squash_dir="$initdir/squash/root" + readonly squash_img="$initdir/squash/root.img" + readonly squash_candidate=( "usr" "etc" ) +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 6307377c..e2fe3dd4 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -11,6 +11,13 @@ check() { + return 1 + fi + ++ for i in squashfs loop overlay; do ++ if ! check_kernel_module $i; then ++ derror "dracut-squash module requires kernel module $i" ++ return 1 ++ fi ++ done ++ + return 255 + } + + diff --git a/0159.patch b/0159.patch new file mode 100644 index 0000000..9a0f339 --- /dev/null +++ b/0159.patch @@ -0,0 +1,35 @@ +From be22f63f7d7c62d88edb5a24dccfff2774094773 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= +Date: Tue, 19 Jan 2021 15:17:05 +0100 +Subject: [PATCH] fix(99squash): use kernel config instead of modprobe to check + modules +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Zoltán Böszörményi +(cherry picked from commit 911c2de9c34a2e96be3973954d368d3a14eb6785) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index e2fe3dd4..d3680d63 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -11,9 +11,9 @@ check() { + return 1 + fi + +- for i in squashfs loop overlay; do +- if ! check_kernel_module $i; then +- derror "dracut-squash module requires kernel module $i" ++ for i in CONFIG_SQUASHFS CONFIG_BLK_DEV_LOOP CONFIG_OVERLAY_FS ; do ++ if ! check_kernel_config $i; then ++ derror "dracut-squash module requires kernel configuration $i (y or m)" + return 1 + fi + done + diff --git a/0160.patch b/0160.patch new file mode 100644 index 0000000..2498efa --- /dev/null +++ b/0160.patch @@ -0,0 +1,29 @@ +From 3c9656769d33db55f6a9390a0f6d2c0be14d85c8 Mon Sep 17 00:00:00 2001 +From: Thierry Vignaud +Date: Fri, 30 Nov 2018 15:41:05 +0100 +Subject: [PATCH] kill bogus comment + +should have been killed in commit 4a855e6bebed956c108865823bcc131ebea2841a + +(cherry picked from commit a6bc200c28ac841edd12211c96dad8516095a68d) + +Resolves: #1959336 +--- + modules.d/05busybox/module-setup.sh | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh +index 14d401c2..ecbd6a13 100755 +--- a/modules.d/05busybox/module-setup.sh ++++ b/modules.d/05busybox/module-setup.sh +@@ -22,9 +22,6 @@ install() { + _progs="$_progs $_i" + done + +- # FIXME: switch_root should be in the above list, but busybox version hangs +- # (using busybox-1.15.1-7.fc14.i686 at the time of writing) +- + for _i in $_progs; do + _path=$(find_binary "$_i") + [ -z "$_path" ] && continue + diff --git a/0161.patch b/0161.patch new file mode 100644 index 0000000..b0fb6eb --- /dev/null +++ b/0161.patch @@ -0,0 +1,42 @@ +From c2f193cc422eac475bbc17261413c83ff13172d4 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +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. + +(cherry picked from commit 50cc23ba32b0fda63eff7623b529dbeb4e6a38c6) + +Resolves: #1959336 +--- + 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 + diff --git a/0162.patch b/0162.patch new file mode 100644 index 0000000..34c62b5 --- /dev/null +++ b/0162.patch @@ -0,0 +1,154 @@ +From 47bc3efe3e3d2b97b4a47e9380c061db0bc368c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= +Date: Sun, 7 Feb 2021 15:01:49 +0100 +Subject: [PATCH] fix: use find_binary +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use find_binary instead of type -P because the former works if +dracutsysrootdir is set. + +Signed-off-by: Zoltán Böszörményi +(cherry picked from commit 433a9ec0147e578b91b4c6e20629a0dbeb9d0725) + +Resolves: #1959336 +--- + modules.d/00systemd/module-setup.sh | 4 ++-- + modules.d/02caps/module-setup.sh | 2 +- + modules.d/05busybox/module-setup.sh | 2 +- + modules.d/50gensplash/module-setup.sh | 2 +- + modules.d/50plymouth/module-setup.sh | 2 +- + modules.d/90lvm/module-setup.sh | 2 +- + modules.d/98syslog/module-setup.sh | 6 +++--- + modules.d/99memstrack/module-setup.sh | 2 +- + modules.d/99squash/module-setup.sh | 2 +- + 9 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 1f0b5dad..38c244a2 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -209,8 +209,8 @@ install() { + ln_r $systemdutildir/systemd "/sbin/init" + + inst_binary true +- ln_r $(type -P true) "/usr/bin/loginctl" +- ln_r $(type -P true) "/bin/loginctl" ++ ln_r $(find_binary true) "/usr/bin/loginctl" ++ ln_r $(find_binary true) "/bin/loginctl" + inst_rules \ + 70-uaccess.rules \ + 71-seat.rules \ +diff --git a/modules.d/02caps/module-setup.sh b/modules.d/02caps/module-setup.sh +index fb16526a..d1ce6cdc 100755 +--- a/modules.d/02caps/module-setup.sh ++++ b/modules.d/02caps/module-setup.sh +@@ -15,7 +15,7 @@ depends() { + install() { + if ! dracut_module_included "systemd"; then + inst_hook pre-pivot 00 "$moddir/caps.sh" +- inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh ++ inst $(find_binary capsh 2>/dev/null) /usr/sbin/capsh + # capsh wants bash and we need bash also + inst /bin/bash + else +diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh +index 5d88c5d1..20b36c16 100755 +--- a/modules.d/05busybox/module-setup.sh ++++ b/modules.d/05busybox/module-setup.sh +@@ -16,7 +16,7 @@ depends() { + install() { + local _i _path _busybox + local _progs=() +- _busybox=$(type -P busybox) ++ _busybox=$(find_binary busybox) + inst $_busybox /usr/bin/busybox + for _i in $($_busybox --list); do + [[ ${_i} == busybox ]] && continue +diff --git a/modules.d/50gensplash/module-setup.sh b/modules.d/50gensplash/module-setup.sh +index d2fccc26..d0aa4a78 100755 +--- a/modules.d/50gensplash/module-setup.sh ++++ b/modules.d/50gensplash/module-setup.sh +@@ -40,7 +40,7 @@ install() { + return ${_ret} + } + +- type -P splash_geninitramfs >/dev/null || return 1 ++ find_binary splash_geninitramfs >/dev/null || return 1 + + _opts='' + if [[ ${DRACUT_GENSPLASH_THEME} ]]; then +diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh +index b51913e8..0568d21c 100755 +--- a/modules.d/50plymouth/module-setup.sh ++++ b/modules.d/50plymouth/module-setup.sh +@@ -2,7 +2,7 @@ + + pkglib_dir() { + local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/" +- if type -P dpkg-architecture &>/dev/null; then ++ if find_binary dpkg-architecture &>/dev/null; then + _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth" + fi + for _dir in $_dirs; do +diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh +index 6ca4ee44..fffcbe31 100755 +--- a/modules.d/90lvm/module-setup.sh ++++ b/modules.d/90lvm/module-setup.sh +@@ -119,7 +119,7 @@ install() { + + inst_libdir_file "libdevmapper-event-lvm*.so" + +- if [[ $hostonly ]] && type -P lvs &>/dev/null; then ++ if [[ $hostonly ]] && find_binary lvs &>/dev/null; then + for dev in "${!host_fs_types[@]}"; do + [ -e /sys/block/${dev#/dev/}/dm/name ] || continue + dev=$(/dev/null; then ++ if find_binary rsyslogd >/dev/null; then + _installs="rsyslogd" + inst_libdir_file rsyslog/lmnet.so rsyslog/imklog.so rsyslog/imuxsock.so rsyslog/imjournal.so +- elif type -P syslogd >/dev/null; then ++ elif find_binary syslogd >/dev/null; then + _installs="syslogd" +- elif type -P syslog-ng >/dev/null; then ++ elif find_binary syslog-ng >/dev/null; then + _installs="syslog-ng" + else + derror "Could not find any syslog binary although the syslogmodule" \ +diff --git a/modules.d/99memstrack/module-setup.sh b/modules.d/99memstrack/module-setup.sh +index d5bacb4d..e156290c 100755 +--- a/modules.d/99memstrack/module-setup.sh ++++ b/modules.d/99memstrack/module-setup.sh +@@ -1,7 +1,7 @@ + #!/usr/bin/bash + + check() { +- if type -P memstrack >/dev/null; then ++ if find_binary memstrack >/dev/null; then + dinfo "memstrack is available" + return 0 + fi +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index d3680d63..b183daf7 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -6,7 +6,7 @@ check() { + return 1 + fi + +- if ! type -P mksquashfs >/dev/null || ! type -P unsquashfs >/dev/null ; then ++ if ! find_binary mksquashfs >/dev/null || ! find_binary unsquashfs >/dev/null ; then + derror "dracut-squash module requires squashfs-tools" + return 1 + fi + diff --git a/0163.patch b/0163.patch new file mode 100644 index 0000000..2c58882 --- /dev/null +++ b/0163.patch @@ -0,0 +1,23 @@ +From 1fd68d6bf5a8752eec83ac19e29df6832ba3c48f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 11 Feb 2021 09:10:42 +0100 +Subject: [PATCH] fix: shellcheck for modules.d/99squash/setup-squash.sh + +(cherry picked from commit 836e2ffac6695201e334c8ef13488e2492b58db0) + +Resolves: #1959336 +--- + modules.d/99squash/setup-squash.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99squash/setup-squash.sh b/modules.d/99squash/setup-squash.sh +index d0000b6f..253e6101 100755 +--- a/modules.d/99squash/setup-squash.sh ++++ b/modules.d/99squash/setup-squash.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + PATH=/bin:/sbin + + SQUASH_IMG=/squash/root.img + diff --git a/0164.patch b/0164.patch new file mode 100644 index 0000000..ff6ae35 --- /dev/null +++ b/0164.patch @@ -0,0 +1,30 @@ +From 1fd29d8550d7d1573b2d2a60b41d6a5f3ca5003f Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 12 Feb 2021 13:26:14 +0100 +Subject: [PATCH] fix: shellcheck for modules.d/99squash/clear-squash.sh + +(cherry picked from commit 73f5cc7c3754f9561abe948b4b080a84b34c7d1a) + +Resolves: #1959336 +--- + modules.d/99squash/clear-squash.sh | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/modules.d/99squash/clear-squash.sh b/modules.d/99squash/clear-squash.sh +index 34cb4cf5..1d626f98 100755 +--- a/modules.d/99squash/clear-squash.sh ++++ b/modules.d/99squash/clear-squash.sh +@@ -1,9 +1,6 @@ +-#!/bin/sh ++#!/bin/bash + SQUASH_MNT_REC=/squash/mounts +-SQUASH_MNTS=( ) + +-while read mnt; do +- SQUASH_MNTS+=( "$mnt" ) +-done <<< "$(cat $SQUASH_MNT_REC)" ++mapfile -t SQUASH_MNTS < $SQUASH_MNT_REC + +-umount --lazy -- ${SQUASH_MNTS[@]} ++umount --lazy -- "${SQUASH_MNTS[@]}" + diff --git a/0165.patch b/0165.patch new file mode 100644 index 0000000..dacb119 --- /dev/null +++ b/0165.patch @@ -0,0 +1,30 @@ +From 0ebfdeafe3d2b023bd52704c6f7a8a2082379da5 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 12 Feb 2021 13:26:14 +0100 +Subject: [PATCH] fix: shellcheck for modules.d/99squash/module-setup.sh + +(cherry picked from commit 6510ab3f9d6ce555435cf57b716702b5b7663772) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index b183daf7..5b2435cc 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -32,9 +32,9 @@ installkernel() { + + install() { + 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 +- inst $moddir/init.sh /squash/init.sh ++ inst "$moddir"/setup-squash.sh /squash/setup-squash.sh ++ inst "$moddir"/clear-squash.sh /squash/clear-squash.sh ++ inst "$moddir"/init.sh /squash/init.sh + + inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service" + systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service + diff --git a/0166.patch b/0166.patch new file mode 100644 index 0000000..9def8ba --- /dev/null +++ b/0166.patch @@ -0,0 +1,28 @@ +From 58e04fa657c09322feaa195d465514a850acfcb7 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Fri, 4 Dec 2020 15:37:27 +0800 +Subject: [PATCH] fix(squash): this module shouldn't depend on bash + +Any other shell should just work. + +(cherry picked from commit c552c99ef8e5251e35242e0a3c09eafcd917b31a) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 5b2435cc..ba9d52ff 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -22,7 +22,7 @@ check() { + } + + depends() { +- echo "bash systemd-initrd" ++ echo "systemd-initrd" + return 0 + } + + diff --git a/0167.patch b/0167.patch new file mode 100644 index 0000000..e2b9f3a --- /dev/null +++ b/0167.patch @@ -0,0 +1,154 @@ +From 3b3dea36edc66300b84bb3887f8a5be971be959a Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 22:22:08 +0800 +Subject: [PATCH] refactor(squash): move the post install scripts into the + module-setup.sh + +No function change, just move the post install code to 99squash to clean +up dracut.sh. + +(cherry picked from commit 95ea16aa606912b7cc8f9942481c8a889b640c15) + +Cherry-picked from: 95ea16aa +Resolves: #1959336 +--- + dracut.sh | 44 ++------------------------------- + modules.d/99squash/init.sh | 2 +- + modules.d/99squash/module-setup.sh | 50 +++++++++++++++++++++++++++++++++++--- + 3 files changed, 50 insertions(+), 46 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 2090d89f..669bc6ce 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1735,51 +1735,11 @@ if [[ $hostonly_cmdline == "yes" ]] ; then + fi + + if dracut_module_included "squash"; then +- dinfo "*** Install squash loader ***" + readonly squash_dir="$initdir/squash/root" + readonly squash_img="$initdir/squash/root.img" +- readonly squash_candidate=( "usr" "etc" ) +- +- mkdir -m 0755 -p $squash_dir +- for folder in "${squash_candidate[@]}"; do +- mv $initdir/$folder $squash_dir/$folder +- done +- +- # Move some files out side of the squash image, including: +- # - Files required to boot and mount the squashfs image +- # - Files need to be accessible without mounting the squash image +- # - Initramfs marker +- for file in \ +- $squash_dir/usr/lib/modules/*/modules.* \ +- $squash_dir/usr/lib/dracut/* \ +- $squash_dir/etc/initrd-release +- do +- [[ -d $file ]] && continue +- DRACUT_RESOLVE_DEPS=1 dracutsysrootdir=$squash_dir inst ${file#$squash_dir} +- rm $file +- done + +- mv $initdir/init $initdir/init.stock +- ln -s squash/init.sh $initdir/init +- +- # Reinstall required files for the squash image setup script. +- # We have moved them inside the squashed image, but they need to be +- # accessible before mounting the image. +- inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" +- hostonly="" instmods "loop" "squashfs" "overlay" +- # Only keep systemctl outsite if we need switch root +- if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then +- inst "systemctl" +- fi +- +- # Remove duplicated files +- for folder in "${squash_candidate[@]}"; do +- for file in $(find $initdir/$folder/ -not -type d); do +- if [[ -e $squash_dir${file#$initdir} ]]; then +- mv $squash_dir${file#$initdir} $file +- fi +- done +- done ++ dinfo "*** Install squash loader ***" ++ DRACUT_SQUASH_POST_INST=1 module_install "squash" + fi + + if [[ $kernel_only != yes ]]; then +diff --git a/modules.d/99squash/init.sh b/modules.d/99squash/init.sh +index bca49db5..d8b2cbba 100755 +--- a/modules.d/99squash/init.sh ++++ b/modules.d/99squash/init.sh +@@ -1,7 +1,7 @@ + #!/bin/sh + /squash/setup-squash.sh + +-exec /init.stock ++exec /init.orig + + echo "Something went wrong when trying to start original init executable!" + exit 1 +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index ba9d52ff..0acf7c3a 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -30,11 +30,55 @@ installkernel() { + hostonly="" instmods -c squashfs loop overlay + } + +-install() { +- inst_multiple kmod modprobe mount mkdir ln echo ++installpost() { ++ local squash_candidate=( "usr" "etc" ) ++ ++ # shellcheck disable=SC2174 ++ mkdir -m 0755 -p "$squash_dir" ++ for folder in "${squash_candidate[@]}"; do ++ mv "$initdir/$folder" "$squash_dir/$folder" ++ done ++ ++ # Move some files out side of the squash image, including: ++ # - Files required to boot and mount the squashfs image ++ # - Files need to be accessible without mounting the squash image ++ # - Initramfs marker ++ for file in \ ++ "$squash_dir"/usr/lib/modules/*/modules.* \ ++ "$squash_dir"/usr/lib/dracut/* \ ++ "$squash_dir"/etc/initrd-release ++ do ++ [[ -f $file ]] || continue ++ DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#$squash_dir}" ++ rm "$file" ++ done ++ ++ # Install required files for the squash image setup script. ++ hostonly="" instmods "loop" "squashfs" "overlay" ++ inst_multiple modprobe mount mkdir ln echo + inst "$moddir"/setup-squash.sh /squash/setup-squash.sh + inst "$moddir"/clear-squash.sh /squash/clear-squash.sh +- inst "$moddir"/init.sh /squash/init.sh ++ ++ mv "$initdir"/init "$initdir"/init.orig ++ inst "$moddir"/init.sh "$initdir"/init ++ ++ # Keep systemctl outsite if we need switch root ++ if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then ++ inst "systemctl" ++ fi ++ ++ # Remove duplicated files ++ for folder in "${squash_candidate[@]}"; do ++ find "$initdir/$folder/" -not -type d \ ++ -exec bash -c 'mv -f "$squash_dir${1#$initdir}" "$1"' -- "{}" \; ++ done ++} ++ ++install() { ++ if [[ $DRACUT_SQUASH_POST_INST ]]; then ++ installpost ++ return ++ fi + + inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service" + systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service + diff --git a/0168.patch b/0168.patch new file mode 100644 index 0000000..dee04cb --- /dev/null +++ b/0168.patch @@ -0,0 +1,37 @@ +From 4a0aa64ecdcaf47e17e27c59e6ea4efc19359c00 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Fri, 23 Jul 2021 16:24:51 +0200 +Subject: [PATCH] fix: revise squash module checks + +Based on 16efdfa25c65c31acc97d91b7baf4f7bb4ea8510 +--- + modules.d/99squash/module-setup.sh | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 0acf7c3a..dd4f3ecf 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -1,19 +1,11 @@ + #!/bin/bash + + check() { +- if ! dracut_module_included "systemd-initrd"; then +- derror "dracut-squash only supports systemd bases initramfs" +- return 1 +- fi +- +- if ! find_binary mksquashfs >/dev/null || ! find_binary unsquashfs >/dev/null ; then +- derror "dracut-squash module requires squashfs-tools" +- return 1 +- fi ++ require_binaries mksquashfs unsquashfs || return 1 + + for i in CONFIG_SQUASHFS CONFIG_BLK_DEV_LOOP CONFIG_OVERLAY_FS ; do + if ! check_kernel_config $i; then +- derror "dracut-squash module requires kernel configuration $i (y or m)" ++ dinfo "dracut-squash module requires kernel configuration $i (y or m)" + return 1 + fi + done + diff --git a/0169.patch b/0169.patch new file mode 100644 index 0000000..5bc4b8c --- /dev/null +++ b/0169.patch @@ -0,0 +1,52 @@ +From ba8f0e0502d3cda2f4222745eebed37f45a4c5a1 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 11 Feb 2021 00:39:17 +0800 +Subject: [PATCH] fix(squash): post install should be the last step before + stripping + +Ensure dracut squash module doesn't effect other steps, and stripping +can cover the new binaries installed by it. + +(cherry picked from commit 8c8aecdc63c9389038e78ee712d4809e49add5e1) + +Cherry-picked from: 8c8aecdc +Resolves: #1959336 +--- + dracut.sh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 669bc6ce..1168fc16 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1734,14 +1734,6 @@ if [[ $hostonly_cmdline == "yes" ]] ; then + fi + fi + +-if dracut_module_included "squash"; then +- readonly squash_dir="$initdir/squash/root" +- readonly squash_img="$initdir/squash/root.img" +- +- dinfo "*** Install squash loader ***" +- DRACUT_SQUASH_POST_INST=1 module_install "squash" +-fi +- + if [[ $kernel_only != yes ]]; then + # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so + for _dir in $libdirs; do +@@ -1764,6 +1756,14 @@ if [[ $kernel_only != yes ]]; then + fi + fi + ++if dracut_module_included "squash"; then ++ readonly squash_dir="$initdir/squash/root" ++ readonly squash_img="$initdir/squash/root.img" ++ ++ dinfo "*** Install squash loader ***" ++ DRACUT_SQUASH_POST_INST=1 module_install "squash" ++fi ++ + if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then + dinfo "*** Stripping files ***" + find "$initdir" -type f \ + diff --git a/0170.patch b/0170.patch new file mode 100644 index 0000000..8b70846 --- /dev/null +++ b/0170.patch @@ -0,0 +1,64 @@ +From 8c31ef8476d302d11bbad81644e82872bd1e86f3 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 22:52:47 +0800 +Subject: [PATCH] refactor(squash): move all setup code to init-squash.sh + +Seperate of init.sh and setup-squash.sh is pointless, merge them into one. + +(cherry picked from commit f9f4264d038816990aa0a830b31e31d2e8b84cad) + +Resolves: #1959336 +--- + modules.d/99squash/{setup-squash.sh => init-squash.sh} | 5 +++++ + modules.d/99squash/init.sh | 7 ------- + modules.d/99squash/module-setup.sh | 5 ++--- + 3 files changed, 7 insertions(+), 10 deletions(-) + +diff --git a/modules.d/99squash/setup-squash.sh b/modules.d/99squash/init-squash.sh +similarity index 93% +rename from modules.d/99squash/setup-squash.sh +rename to modules.d/99squash/init-squash.sh +index 253e6101..449585f0 100755 +--- a/modules.d/99squash/setup-squash.sh ++++ b/modules.d/99squash/init-squash.sh +@@ -59,3 +59,8 @@ for file in $SQUASH_MNT/*; do + + echo $mntdir >> $SQUASH_MNT_REC + done ++ ++exec /init.orig ++ ++echo "Something went wrong when trying to exec original init!" ++exit 1 +diff --git a/modules.d/99squash/init.sh b/modules.d/99squash/init.sh +deleted file mode 100755 +index d8b2cbba..00000000 +--- a/modules.d/99squash/init.sh ++++ /dev/null +@@ -1,7 +0,0 @@ +-#!/bin/sh +-/squash/setup-squash.sh +- +-exec /init.orig +- +-echo "Something went wrong when trying to start original init executable!" +-exit 1 +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index dd4f3ecf..c0eb4acd 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -48,11 +48,10 @@ installpost() { + # Install required files for the squash image setup script. + hostonly="" instmods "loop" "squashfs" "overlay" + inst_multiple modprobe mount mkdir ln echo +- inst "$moddir"/setup-squash.sh /squash/setup-squash.sh +- inst "$moddir"/clear-squash.sh /squash/clear-squash.sh + + mv "$initdir"/init "$initdir"/init.orig +- inst "$moddir"/init.sh "$initdir"/init ++ inst "$moddir"/init-squash.sh /init ++ inst "$moddir"/clear-squash.sh /squash/clear-squash.sh + + # Keep systemctl outsite if we need switch root + if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then + diff --git a/0171.patch b/0171.patch new file mode 100644 index 0000000..33b19a8 --- /dev/null +++ b/0171.patch @@ -0,0 +1,78 @@ +From 39d06b934fd4bec88b0945b5277407d7b5510c22 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 22:58:20 +0800 +Subject: [PATCH] feat(squash): install and depmod modules seperately + +Separately install the modules required for squash image setup. +These modules can be deleted after squash image setup to save +memory. + +Signed-off-by: Kairui Song +(cherry picked from commit 5a18b24a8b9c20c98f711963ce5407ceb2f3d57b) + +Cherry-picked from: 5a18b24a8b9c20c98f711963ce5407ceb2f3d57b +Resolves: #1959336 +--- + modules.d/99squash/init-squash.sh | 3 +++ + modules.d/99squash/module-setup.sh | 12 +++++------- + 2 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh +index 449585f0..ecb6cc58 100755 +--- a/modules.d/99squash/init-squash.sh ++++ b/modules.d/99squash/init-squash.sh +@@ -34,6 +34,9 @@ if [ $? != 0 ]; then + echo "Unable to setup overlay module" + fi + ++# These modules are no longer needed, delete to save memory ++rm -rf /usr/lib/modules/ ++ + [ ! -d "$SQUASH_MNT" ] && \ + mkdir -m 0755 -p $SQUASH_MNT + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index c0eb4acd..ad619176 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -18,10 +18,6 @@ depends() { + return 0 + } + +-installkernel() { +- hostonly="" instmods -c squashfs loop overlay +-} +- + installpost() { + local squash_candidate=( "usr" "etc" ) + +@@ -36,7 +32,6 @@ installpost() { + # - Files need to be accessible without mounting the squash image + # - Initramfs marker + for file in \ +- "$squash_dir"/usr/lib/modules/*/modules.* \ + "$squash_dir"/usr/lib/dracut/* \ + "$squash_dir"/etc/initrd-release + do +@@ -46,8 +41,7 @@ installpost() { + done + + # Install required files for the squash image setup script. +- hostonly="" instmods "loop" "squashfs" "overlay" +- inst_multiple modprobe mount mkdir ln echo ++ inst_multiple modprobe mount mkdir ln echo rm + + mv "$initdir"/init "$initdir"/init.orig + inst "$moddir"/init-squash.sh /init +@@ -63,6 +57,10 @@ installpost() { + find "$initdir/$folder/" -not -type d \ + -exec bash -c 'mv -f "$squash_dir${1#$initdir}" "$1"' -- "{}" \; + done ++ ++ # Install required modules for the squash image init script. ++ hostonly="" instmods "loop" "squashfs" "overlay" ++ dracut_kernel_post + } + + install() { + diff --git a/0172.patch b/0172.patch new file mode 100644 index 0000000..a3f9c5f --- /dev/null +++ b/0172.patch @@ -0,0 +1,67 @@ +From 122da496446405e60a6eb5b037af263b5fd14378 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 23:05:08 +0800 +Subject: [PATCH] refactor(squash): don't record mount points in text file + +The squasn mount points are recorded in text file so later clean up +script can umount them, this is not needed, the mount points are fixed +so just detect the umount by hardcoded pattern. + +(cherry picked from commit bdd194bb8c0427921b87b4dce16c05e18e0c2fb0) + +Resolves: #1959336 +--- + modules.d/99squash/clear-squash.sh | 10 +++++----- + modules.d/99squash/init-squash.sh | 8 -------- + 2 files changed, 5 insertions(+), 13 deletions(-) + +diff --git a/modules.d/99squash/clear-squash.sh b/modules.d/99squash/clear-squash.sh +index 1d626f98..4f357817 100755 +--- a/modules.d/99squash/clear-squash.sh ++++ b/modules.d/99squash/clear-squash.sh +@@ -1,6 +1,6 @@ + #!/bin/bash +-SQUASH_MNT_REC=/squash/mounts +- +-mapfile -t SQUASH_MNTS < $SQUASH_MNT_REC +- +-umount --lazy -- "${SQUASH_MNTS[@]}" ++mnt="/squash/root" ++for dir in jsquash/root/*; do ++ mnt="$mnt ${dir#$SQUASH_MNT}" ++done ++umount --lazy -- $mnt +diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh +index ecb6cc58..fee0105e 100755 +--- a/modules.d/99squash/init-squash.sh ++++ b/modules.d/99squash/init-squash.sh +@@ -3,9 +3,6 @@ PATH=/bin:/sbin + + SQUASH_IMG=/squash/root.img + SQUASH_MNT=/squash/root +-SQUASH_MNT_REC=/squash/mounts +- +-echo $SQUASH_MNT > $SQUASH_MNT_REC + + # Following mount points are neccessary for mounting a squash image + +@@ -34,9 +31,6 @@ if [ $? != 0 ]; then + echo "Unable to setup overlay module" + fi + +-# These modules are no longer needed, delete to save memory +-rm -rf /usr/lib/modules/ +- + [ ! -d "$SQUASH_MNT" ] && \ + mkdir -m 0755 -p $SQUASH_MNT + +@@ -59,8 +53,6 @@ for file in $SQUASH_MNT/*; do + + mount -t overlay overlay -o\ + lowerdir=$lowerdir,upperdir=$upperdir,workdir=$workdir $mntdir +- +- echo $mntdir >> $SQUASH_MNT_REC + done + + exec /init.orig + diff --git a/0173.patch b/0173.patch new file mode 100644 index 0000000..769ef03 --- /dev/null +++ b/0173.patch @@ -0,0 +1,53 @@ +From 0c2ac6b7503661948ead031f745736e35fef2e3f Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 26 Dec 2018 17:38:02 +0800 +Subject: [PATCH] lsinitrd: list squash content as well + +When the initramfs is built with squash module enabled, the content +inside squash image will be invisible from the lsinitrd tool. This +commit make lsinitrd detect and list the content of the squash image as +well to avoid possible confusion. + +Signed-off-by: Kairui Song +(cherry picked from commit 1ff306a3964840fc548188a8aa4862143b347e8a) + +Resolves: #1959336 +--- + lsinitrd.sh | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/lsinitrd.sh b/lsinitrd.sh +index a2fa4d7a..0b42b9a4 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -160,6 +160,21 @@ list_files() + echo "========================================================================" + } + ++list_squash_content() ++{ ++ SQUASH_IMG="squash/root.img" ++ SQUASH_TMPFILE="$(mktemp -t --suffix=.root.sqsh lsinitrd.XXXXXX)" ++ trap "rm -f '$SQUASH_TMPFILE'" EXIT ++ $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- \ ++ $SQUASH_IMG > "$SQUASH_TMPFILE" 2>/dev/null ++ if [[ -s $SQUASH_TMPFILE ]]; then ++ echo "Squashed content ($SQUASH_IMG):" ++ echo "========================================================================" ++ unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4 ++ echo "========================================================================" ++ fi ++} ++ + unpack_files() + { + if (( ${#filenames[@]} > 0 )); then +@@ -287,6 +302,7 @@ else + echo + list_modules + list_files ++ list_squash_content + fi + fi + + diff --git a/0174.patch b/0174.patch new file mode 100644 index 0000000..a6f257b --- /dev/null +++ b/0174.patch @@ -0,0 +1,286 @@ +From 5e4bc6e2d6b6829c45f4e25cce4d81661b798587 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 29 Jul 2021 15:16:39 +0200 +Subject: [PATCH] refactor(squash): structure in a cleaner way + +Simplify the squash mount layout. Instead of overlay on each top +directory (/etc, /usr), just mount and switch_root into the squash +image, with a overlay on top of it. + +Also install the binaries and setup scripts separately, so the squash +setup code and the squash image content is independent of each other, +all squash setup script and binaries can be deleted safely upon +switch_root. + +With this change, previous squash clean up service and other tricky +implementations are all gone. + +This commit depends on systemd commits from: +https://github.com/systemd/systemd/pull/18124 + +Previouly systemd doesn't recognize non-ramfs initramfs, now this is +doable with SYSTEMD_IN_INITRD=lenient + +Signed-off-by: Kairui Song +(cherry picked from commit 8f7c332e488f88e5845a3c7954af7934c2f1e37b) + +Cherry-picked from: 8f7c332e +Resolves: #1959336 +--- + dracut-initramfs-restore.sh | 4 +- + dracut.sh | 4 +- + lsinitrd.sh | 6 +-- + modules.d/99squash/clear-squash.sh | 6 --- + modules.d/99squash/init-squash.sh | 70 ++++++++--------------------- + modules.d/99squash/module-setup.sh | 56 ++++++++--------------- + modules.d/99squash/squash-mnt-clear.service | 17 ------- + 7 files changed, 44 insertions(+), 119 deletions(-) + +diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh +index 67fc88fa..74a952c4 100644 +--- a/dracut-initramfs-restore.sh ++++ b/dracut-initramfs-restore.sh +@@ -41,9 +41,9 @@ else + fi + + if [[ -d squash ]]; then +- unsquashfs -no-xattrs -f -d . squash/root.img >/dev/null ++ unsquashfs -no-xattrs -f -d . squash-root.img >/dev/null + if [ $? -ne 0 ]; then +- echo "Squash module is enabled for this initramfs but failed to unpack squash/root.img" >&2 ++ echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2 + rm -f -- /run/initramfs/shutdown + exit 1 + fi +diff --git a/dracut.sh b/dracut.sh +index 1168fc16..b403f401 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1758,8 +1758,8 @@ fi + + if dracut_module_included "squash"; then + readonly squash_dir="$initdir/squash/root" +- readonly squash_img="$initdir/squash/root.img" +- ++ readonly squash_img="$initdir/squash-root.img" ++ mkdir -p "$squash_dir" + dinfo "*** Install squash loader ***" + DRACUT_SQUASH_POST_INST=1 module_install "squash" + fi +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 0b42b9a4..04ce9e8b 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -162,9 +162,9 @@ list_files() + + list_squash_content() + { +- SQUASH_IMG="squash/root.img" +- SQUASH_TMPFILE="$(mktemp -t --suffix=.root.sqsh lsinitrd.XXXXXX)" +- trap "rm -f '$SQUASH_TMPFILE'" EXIT ++ SQUASH_IMG="squash-root.img" ++ SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" ++ + $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- \ + $SQUASH_IMG > "$SQUASH_TMPFILE" 2>/dev/null + if [[ -s $SQUASH_TMPFILE ]]; then +diff --git a/modules.d/99squash/clear-squash.sh b/modules.d/99squash/clear-squash.sh +deleted file mode 100755 +index 4f357817..00000000 +--- a/modules.d/99squash/clear-squash.sh ++++ /dev/null +@@ -1,6 +0,0 @@ +-#!/bin/bash +-mnt="/squash/root" +-for dir in jsquash/root/*; do +- mnt="$mnt ${dir#$SQUASH_MNT}" +-done +-umount --lazy -- $mnt +diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh +index fee0105e..3de6f819 100755 +--- a/modules.d/99squash/init-squash.sh ++++ b/modules.d/99squash/init-squash.sh +@@ -1,61 +1,29 @@ +-#!/bin/bash ++#!/bin/sh + PATH=/bin:/sbin + +-SQUASH_IMG=/squash/root.img +-SQUASH_MNT=/squash/root ++# Basic mounts for mounting a squash image ++mkdir /proc /sys /dev /run ++mount -t proc -o nosuid,noexec,nodev proc /proc ++mount -t sysfs -o nosuid,noexec,nodev sysfs /sys ++mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev ++mount -t tmpfs -o mode=755,nodev,nosuid,strictatime tmpfs /run + +-# Following mount points are neccessary for mounting a squash image +- +-[ ! -d /proc/self ] && \ +- mount -t proc -o nosuid,noexec,nodev proc /proc +- +-[ ! -d /sys/kernel ] && \ +- mount -t sysfs -o nosuid,noexec,nodev sysfs /sys +- +-[ ! -e /dev/loop-control ] && \ +- mount -t devtmpfs -o mode=0755,noexec,nosuid,strictatime devtmpfs /dev +- +-# Need a loop device backend, overlayfs, and squashfs module ++# Load required modules + modprobe loop +-if [ $? != 0 ]; then +- echo "Unable to setup loop module" +-fi +- + modprobe squashfs +-if [ $? != 0 ]; then +- echo "Unable to setup squashfs module" +-fi +- + modprobe overlay +-if [ $? != 0 ]; then +- echo "Unable to setup overlay module" +-fi +- +-[ ! -d "$SQUASH_MNT" ] && \ +- mkdir -m 0755 -p $SQUASH_MNT +- +-# Mount the squashfs image +-mount -t squashfs -o ro,loop $SQUASH_IMG $SQUASH_MNT +- +-if [ $? != 0 ]; then +- echo "Unable to mount squashed initramfs image" +-fi +- +-for file in $SQUASH_MNT/*; do +- file=${file#$SQUASH_MNT/} +- lowerdir=$SQUASH_MNT/$file +- workdir=/squash/overlay-work/$file +- upperdir=/$file +- mntdir=/$file + +- mkdir -m 0755 -p $workdir +- mkdir -m 0755 -p $mntdir ++# Mount the squash image ++mount -t ramfs ramfs /squash ++mkdir -p /squash/root /squash/overlay/upper /squash/overlay/work ++mount -t squashfs -o ro,loop /squash-root.img /squash/root + +- mount -t overlay overlay -o\ +- lowerdir=$lowerdir,upperdir=$upperdir,workdir=$workdir $mntdir +-done ++# Setup new root overlay ++mkdir /newroot ++mount -t overlay overlay -o lowerdir=/squash/root,upperdir=/squash/overlay/upper,workdir=/squash/overlay/work/ /newroot/ + +-exec /init.orig ++# Move all mount points to new root to prepare chroot ++mount --move /squash /newroot/squash + +-echo "Something went wrong when trying to exec original init!" +-exit 1 ++# Jump to new root and clean setup files ++SYSTEMD_IN_INITRD=lenient exec switch_root /newroot /init +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index ad619176..50c92c31 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -19,56 +19,36 @@ depends() { + } + + installpost() { +- local squash_candidate=( "usr" "etc" ) +- +- # shellcheck disable=SC2174 +- mkdir -m 0755 -p "$squash_dir" +- for folder in "${squash_candidate[@]}"; do +- mv "$initdir/$folder" "$squash_dir/$folder" ++ # Move everything under $initdir except $squash_dir ++ # itself into squash image ++ for i in "$initdir"/*; do ++ [[ "$squash_dir" == "$i"/* ]] || mv "$i" "$squash_dir"/ + done + +- # Move some files out side of the squash image, including: +- # - Files required to boot and mount the squashfs image +- # - Files need to be accessible without mounting the squash image +- # - Initramfs marker +- for file in \ +- "$squash_dir"/usr/lib/dracut/* \ +- "$squash_dir"/etc/initrd-release +- do ++ # Create mount points for squash loader ++ mkdir -p "$initdir"/squash/ ++ mkdir -p "$squash_dir"/squash/ ++ ++ # Copy dracut spec files out side of the squash image ++ # so dracut rebuild and lsinitrd can work ++ for file in "$squash_dir"/usr/lib/dracut/*; do + [[ -f $file ]] || continue + DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#$squash_dir}" +- rm "$file" +- done +- +- # Install required files for the squash image setup script. +- inst_multiple modprobe mount mkdir ln echo rm +- +- mv "$initdir"/init "$initdir"/init.orig +- inst "$moddir"/init-squash.sh /init +- inst "$moddir"/clear-squash.sh /squash/clear-squash.sh +- +- # Keep systemctl outsite if we need switch root +- if [[ ! -f "$initdir/lib/dracut/no-switch-root" ]]; then +- inst "systemctl" +- fi +- +- # Remove duplicated files +- for folder in "${squash_candidate[@]}"; do +- find "$initdir/$folder/" -not -type d \ +- -exec bash -c 'mv -f "$squash_dir${1#$initdir}" "$1"' -- "{}" \; + done + +- # Install required modules for the squash image init script. ++ # Install required modules and binaries for the squash image init script. ++ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root + hostonly="" instmods "loop" "squashfs" "overlay" + dracut_kernel_post ++ ++ # Install squash image init script. ++ ln -sfn /usr/bin "$initdir/bin" ++ ln -sfn /usr/sbin "$initdir/sbin" ++ inst_simple "$moddir"/init-squash.sh /init + } + + install() { + if [[ $DRACUT_SQUASH_POST_INST ]]; then + installpost +- return + fi +- +- inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service" +- systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service + } +diff --git a/modules.d/99squash/squash-mnt-clear.service b/modules.d/99squash/squash-mnt-clear.service +deleted file mode 100644 +index 84441f60..00000000 +--- a/modules.d/99squash/squash-mnt-clear.service ++++ /dev/null +@@ -1,17 +0,0 @@ +-# This file is part of dracut. +-# +- +-[Unit] +-Description=Cleanup squashfs mounts when switch root +-DefaultDependencies=no +-Before=initrd-switch-root.service +-After=initrd-switch-root.target +-ConditionPathExists=/squash/root +- +-[Service] +-Type=oneshot +-RemainAfterExit=no +-StandardInput=null +-StandardOutput=syslog+console +-StandardError=syslog+console +-ExecStart=/squash/clear-squash.sh + diff --git a/0175.patch b/0175.patch new file mode 100644 index 0000000..0e5629d --- /dev/null +++ b/0175.patch @@ -0,0 +1,80 @@ +From f462176a19f463861fea7a26af6288403785eb9b Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 14:04:05 +0800 +Subject: [PATCH] feat(squash): use busybox for early setup if available + +Use busybox can help reduce the size of early setup environment. + +With this change, everything is packed in the squash image, and +the setup files will be dropped once squash image setup is done, +so initramfs stage memory usage is reduced to the minimun, +and initramfs decompress is also faster. + +File layout of a squash initramfs looks like this: + +======================================================================== +drwxr-xr-x 1 root root 0 Feb 15 14:07 . +-rwxr-xr-x 1 root root 946 Feb 15 14:07 init +lrwxrwxrwx 1 root root 7 Feb 15 14:07 lib -> usr/lib +drwxr-xr-x 1 root root 0 Feb 15 14:07 squash +-rw-r--r-- 1 root root 91000832 Feb 15 14:07 squash-root.img +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/bin +-rwxr-xr-x 1 root root 1293688 Jul 27 2020 usr/bin/busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/echo -> busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/mkdir -> busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/modprobe -> busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/mount -> busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/sh -> busybox +lrwxrwxrwx 1 root root 7 Feb 15 14:07 usr/bin/switch_root -> busybox +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/dracut +-rw-r--r-- 1 root root 23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt +-rw-r--r-- 1 root root 31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33 +-rw-r--r-- 1 root root 358 Feb 15 14:07 usr/lib/dracut/modules.txt +-rw-r--r-- 1 root root 0 Feb 15 14:07 usr/lib/dracut/need-initqueue +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64 +drwxr-xr-x 1 root root 0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel +<... kernel module misc files skipped ... > +======================================================================== + +(cherry picked from commit 90f269f6afe409925bad86f0bd7e9322ad9b4fb0) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 50c92c31..72cc83ad 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -19,6 +19,9 @@ depends() { + } + + installpost() { ++ local _busybox ++ _busybox=$(find_binary busybox) ++ + # Move everything under $initdir except $squash_dir + # itself into squash image + for i in "$initdir"/*; do +@@ -37,7 +40,15 @@ installpost() { + done + + # Install required modules and binaries for the squash image init script. +- DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root ++ if [[ $_busybox ]]; then ++ inst "$_busybox" /usr/bin/busybox ++ for _i in sh echo mount modprobe mkdir switch_root; do ++ ln_r /usr/bin/busybox /usr/bin/$_i ++ done ++ else ++ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root ++ fi ++ + hostonly="" instmods "loop" "squashfs" "overlay" + dracut_kernel_post + + diff --git a/0176.patch b/0176.patch new file mode 100644 index 0000000..64970bb --- /dev/null +++ b/0176.patch @@ -0,0 +1,51 @@ +From 0a2f7b1779ddcac1c4e79aa58212c7ee528ac6e1 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 15 Feb 2021 23:15:26 +0800 +Subject: [PATCH] feat: squash module follow --compress option + +Try to make mksquashfs follow --compress option if squash module is +included, if not specified or invalid, fall back to use mksquashfs's +default compressor. + +(cherry picked from commit 5d05ffbd87bc27e27f517ebc3454d50729c687e6) + +Cherry-picked from: 5d05ffbd +Resolves: #1959336 +--- + dracut.sh | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index b403f401..d9a66c5a 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1781,14 +1781,25 @@ fi + + if dracut_module_included "squash"; then + dinfo "*** Squashing the files inside the initramfs ***" +- mksquashfs $squash_dir $squash_img -no-xattrs -no-exports -noappend -always-use-fragments -comp xz -Xdict-size 100% -no-progress 1> /dev/null ++ declare squash_compress_arg ++ # shellcheck disable=SC2086 ++ if [[ $compress ]]; then ++ if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $compress &>/dev/null; then ++ dwarn "mksquashfs doesn't support compressor '$compress', failing back to default compressor." ++ else ++ squash_compress_arg="$compress" ++ fi ++ fi + +- if [[ $? != 0 ]]; then ++ # shellcheck disable=SC2086 ++ if ! mksquashfs "$squash_dir" "$squash_img" \ ++ -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ ++ -no-progress ${squash_compress_arg:+-comp $squash_compress_arg} 1> /dev/null; then + dfatal "dracut: Failed making squash image" + exit 1 + fi + +- rm -rf $squash_dir ++ rm -rf "$squash_dir" + dinfo "*** Squashing the files inside the initramfs done ***" + fi + + diff --git a/0177.patch b/0177.patch new file mode 100644 index 0000000..03d1ba1 --- /dev/null +++ b/0177.patch @@ -0,0 +1,31 @@ +From 878384403378526535a737acfdbf4154f7af5f50 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 1 Feb 2021 01:49:54 +0800 +Subject: [PATCH] perf: disable initrd compression when squash module is + enabled + +With squash module, the initramfs is double compressed, which slow down +the build progress and doesn't shrink the size much. + +(cherry picked from commit 7c0bc0b2fd167da42035020dae49af94844f053c) + +Resolves: #1959336 +--- + dracut.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/dracut.sh b/dracut.sh +index d9a66c5a..bf79568c 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1801,6 +1801,9 @@ if dracut_module_included "squash"; then + + rm -rf "$squash_dir" + dinfo "*** Squashing the files inside the initramfs done ***" ++ ++ # Skip initramfs compress ++ compress="cat" + fi + + dinfo "*** Creating image file '$outfile' ***" + diff --git a/0178.patch b/0178.patch new file mode 100644 index 0000000..aac1f21 --- /dev/null +++ b/0178.patch @@ -0,0 +1,16 @@ +From 9795be398d697d9b5346f4e398b1a5511830546b Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Fri, 26 Mar 2021 10:29:35 +0100 +Subject: [PATCH] fix(squash): shellcheck for modules.d/99squash + +(cherry picked from commit cbef7cf3dac79f014200017e9b13e012f2a53f47) + +Resolves: #1959336 +--- + modules.d/99squash/.shchkdir | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + +diff --git a/modules.d/99squash/.shchkdir b/modules.d/99squash/.shchkdir +new file mode 100644 +index 00000000..e69de29b + diff --git a/0179.patch b/0179.patch new file mode 100644 index 0000000..f42df18 --- /dev/null +++ b/0179.patch @@ -0,0 +1,64 @@ +From 3f7410e7f3c08866c84e01ccfb423d7cff4eb5a3 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Wed, 7 Apr 2021 02:11:41 +0800 +Subject: [PATCH] fix(squash): don't mount the mount points if already mounted + +It is possible that user setup some early mount in the rootfs even +earlier, so just be more robust and cover that case too. + +Signed-off-by: Kairui Song +(cherry picked from commit 636d6df3134dde1dac72241937724bc59deb9303) + +Resolves: #1959336 +--- + modules.d/99squash/init-squash.sh | 17 +++++++++++------ + modules.d/99squash/module-setup.sh | 4 ++-- + 2 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh +index 3de6f819..59769f62 100755 +--- a/modules.d/99squash/init-squash.sh ++++ b/modules.d/99squash/init-squash.sh +@@ -1,12 +1,17 @@ + #!/bin/sh + PATH=/bin:/sbin + +-# Basic mounts for mounting a squash image +-mkdir /proc /sys /dev /run +-mount -t proc -o nosuid,noexec,nodev proc /proc +-mount -t sysfs -o nosuid,noexec,nodev sysfs /sys +-mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev +-mount -t tmpfs -o mode=755,nodev,nosuid,strictatime tmpfs /run ++[ -e /proc/self/mounts ] \ ++ || (mkdir -p /proc && mount -t proc -o nosuid,noexec,nodev proc /proc) ++ ++grep -q '^sysfs /sys sysfs' /proc/self/mounts \ ++ || (mkdir -p /sys && mount -t sysfs -o nosuid,noexec,nodev sysfs /sys) ++ ++grep -q '^devtmpfs /dev devtmpfs' /proc/self/mounts \ ++ || (mkdir -p /dev && mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev) ++ ++grep -q '^tmpfs /run tmpfs' /proc/self/mounts \ ++ || (mkdir -p /run && mount -t tmpfs -o mode=755,noexec,nosuid,strictatime tmpfs /run) + + # Load required modules + modprobe loop +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 72cc83ad..81a5b3f7 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -42,11 +42,11 @@ installpost() { + # Install required modules and binaries for the squash image init script. + if [[ $_busybox ]]; then + inst "$_busybox" /usr/bin/busybox +- for _i in sh echo mount modprobe mkdir switch_root; do ++ for _i in sh echo mount modprobe mkdir switch_root grep; do + ln_r /usr/bin/busybox /usr/bin/$_i + done + else +- DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root ++ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep + fi + + hostonly="" instmods "loop" "squashfs" "overlay" + diff --git a/0180.patch b/0180.patch new file mode 100644 index 0000000..e2c03d9 --- /dev/null +++ b/0180.patch @@ -0,0 +1,36 @@ +From faadc1cbcd1ca35393b75f93757a89621957453c Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 22 Jun 2021 21:49:20 +0800 +Subject: [PATCH] feat(squash): install umount util + +Also install umount binary, make it possible to cleanup squash overlay +mounts. This is useful for other tools reusing the dracut initramfs built +with squash module enabled. + +Signed-off-by: Kairui Song +(cherry picked from commit 563f543424c66bf38e6cbd3f489655d45ad9b5c5) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 81a5b3f7..9bb30b2e 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -42,11 +42,11 @@ installpost() { + # Install required modules and binaries for the squash image init script. + if [[ $_busybox ]]; then + inst "$_busybox" /usr/bin/busybox +- for _i in sh echo mount modprobe mkdir switch_root grep; do ++ for _i in sh echo mount modprobe mkdir switch_root grep umount; do + ln_r /usr/bin/busybox /usr/bin/$_i + done + else +- DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep ++ DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount + fi + + hostonly="" instmods "loop" "squashfs" "overlay" + diff --git a/0181.patch b/0181.patch new file mode 100644 index 0000000..300b387 --- /dev/null +++ b/0181.patch @@ -0,0 +1,32 @@ +From 487d2686a78cfa52419b330fa2b62af715c4356b Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Thu, 10 Jun 2021 16:45:03 +0800 +Subject: [PATCH] fix(squash): create relative symlinks + +Don't use absolute path, or it may resolve to wrong files after unpack +the initramfs to a sub path on a running system. + +Signed-off-by: Kairui Song +(cherry picked from commit a2b6be44792b68218e3378a7d844b0f8527a4805) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 9bb30b2e..8c9982c0 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -53,8 +53,8 @@ installpost() { + dracut_kernel_post + + # Install squash image init script. +- ln -sfn /usr/bin "$initdir/bin" +- ln -sfn /usr/sbin "$initdir/sbin" ++ ln_r /usr/bin /bin ++ ln_r /usr/sbin /sbin + inst_simple "$moddir"/init-squash.sh /init + } + + diff --git a/0182.patch b/0182.patch new file mode 100644 index 0000000..87de433 --- /dev/null +++ b/0182.patch @@ -0,0 +1,85 @@ +From f0f83da2c608202205f1092289a64de044ecc130 Mon Sep 17 00:00:00 2001 +From: Hari Bathini +Date: Fri, 11 Jun 2021 15:20:28 +0530 +Subject: [PATCH] fix(dracut.sh): handle '-i' option to include files beginning + with '.' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +While including a directory using '--include' option, the file and +subdirectory names that begin with '.' are not included. Also, dracut +throws a warning message when a subdirectory is empty or only has +files or subdirectories that begin with '.'. + +For example, while trying to include /tmpdata directory with the +below tree: + + # tree -a /tmpdata + /tmpdata + ├── .anothertestdir + ├── testdir + │   └── .testsubdir + └── .testfile + +dracut throws the below warning message: + + # dracut --include /tmpdata /root + cp: cannot stat '/tmpdata/testdir/*': No such file or directory + # + +and this is how the included /tmpdata directory tree looks: + + # tree -a root + root + └── testdir + +No file or directory beginning with '.' is included & also, copying +/tmpdata/testdir reported "No such file or directory" warning. Using +'.' instead of '*' in the below command will fix the warning whether +the directory being copied is empty or only has files or directories +that begin with dot: + + $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/* + +Also, enable 'dotglob' temporarily to include files and directories +beginning with a `.' in the results of pathname expansion of source +directory being included. + +Signed-off-by: Hari Bathini +(cherry picked from commit f1138012c9dc44e6614466c0a8e929fc55e4a5dd) + +Cherry-picked from: f1138012 +Resolves: #1959336 +--- + dracut.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index bf79568c..3fd31e21 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1606,6 +1606,8 @@ for ((i=0; i < ${#include_src[@]}; i++)); do + # check for preexisting symlinks, so we can cope with the + # symlinks to $prefix + # Objectname is a file or a directory ++ reset_dotglob="$(shopt -p dotglob)" ++ shopt -q -s dotglob + for objectname in "$src"/*; do + [[ -e "$objectname" || -h "$objectname" ]] || continue + if [[ -d "$objectname" ]]; then +@@ -1615,11 +1617,12 @@ for ((i=0; i < ${#include_src[@]}; i++)); do + mkdir -m 0755 -p "$object_destdir" + chmod --reference="$objectname" "$object_destdir" + fi +- $DRACUT_CP -t "$object_destdir" "$objectname"/* ++ $DRACUT_CP -t "$object_destdir" "$objectname"/. + else + $DRACUT_CP -t "$destdir" "$objectname" + fi + done ++ eval "$reset_dotglob" + fi + fi + done + diff --git a/0183.patch b/0183.patch new file mode 100644 index 0000000..fcfb083 --- /dev/null +++ b/0183.patch @@ -0,0 +1,35 @@ +From 9fdbd56ecef7498d2d61fc7123b958add945f46b Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Sat, 12 Jun 2021 02:25:09 +0800 +Subject: [PATCH] fix(dracut.sh): handle symlinks appropriately while using + '-i' option + +[[ -d $symlink ]] will return true if the symlink points to a directory. +So the symlink will not be copied, instead a directory is created with +the symlink name and the content is copied. + +Signed-off-by: Kairui Song +(cherry picked from commit c7fbc0c8901917baf0d1f0822568e65c6ec00d18) + +Cherry-picked from: c7fbc0c8 +Resolves: #1959336 +--- + dracut.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 3fd31e21..fa14e3ce 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1609,8 +1609,8 @@ for ((i=0; i < ${#include_src[@]}; i++)); do + reset_dotglob="$(shopt -p dotglob)" + shopt -q -s dotglob + for objectname in "$src"/*; do +- [[ -e "$objectname" || -h "$objectname" ]] || continue +- if [[ -d "$objectname" ]]; then ++ [[ -e $objectname || -L $objectname ]] || continue ++ if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then + # objectname is a directory, let's compute the final directory name + object_destdir=${destdir}/${objectname#$src/} + if ! [[ -e "$object_destdir" ]]; then + diff --git a/0184.patch b/0184.patch new file mode 100644 index 0000000..5fc34d5 --- /dev/null +++ b/0184.patch @@ -0,0 +1,76 @@ +From c6d8832f86bc2ef7fbab6f703479816dd6078902 Mon Sep 17 00:00:00 2001 +From: Pingfan Liu +Date: Fri, 9 Jul 2021 11:55:16 +0800 +Subject: [PATCH] fix(squash): keep ld cache under initdir + +When running kdump on PowerPC, the following bug is hit: +[ 0.391629] Freeing unused kernel memory: 5568K +[ 0.391634] This architecture does not have kernel memory protection. +/bin/sh: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory +[ 0.392214] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 +[ 0.392214] +[ 0.392223] CPU: 6 PID: 1 Comm: init Not tainted 4.18.0-319.el8.ppc64le #1 +[ 0.392228] Call Trace: +[ 0.392234] [c00000000c703c10] [c000000008ecb94c] dump_stack+0xb0/0xf4 (unreliable) +[ 0.392243] [c00000000c703c50] [c000000008167324] panic+0x148/0x3c4 +[ 0.392249] [c00000000c703cf0] [c000000008170474] do_exit+0xcd4/0xd40 +[ 0.392255] [c00000000c703dc0] [c0000000081705b0] do_group_exit+0x60/0x110 +[ 0.392261] [c00000000c703e00] [c000000008170684] sys_exit_group+0x24/0x30 +[ 0.392268] [c00000000c703e20] [c00000000800b408] system_call+0x5c/0x70 + +This is due to the non-conventional library path: +ldd /bin/bash + linux-vdso64.so.1 (0x00007fffbdc90000) + libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fffbda80000) + libdl.so.2 => /lib64/libdl.so.2 (0x00007fffbda50000) + libc.so.6 => /lib64/glibc-hwcaps/power9/libc-2.28.so (0x00007fffbd830000) + ^^^ + /lib64/ld64.so.2 (0x00007fffbdcb0000) + +ldd finds the path by libc.so.6 -> /usr/lib64/libc.so.6 -> +/usr/lib64/glibc-hwcaps/power9/libc-2.28.so and cache the result. So +when dracut_install, it only saw +'/usr/lib64/glibc-hwcaps/power9/libc-2.28.so' and blind to +'/usr/lib64/libc.so.6' + +In the final kdumpimg, the symlink /usr/lib64/libc.so.6 is not created, +hence ld.so can not find the /usr/lib64/glibc-hwcaps/power9/libc-2.28.so + +On the other hand, during the process of building kdumpimg, all of dynamic library info +have been cached in ld.so.cache. Hence this bug can be simplely resolved +by keeping ld cache under $initdir/etc. + +Signed-off-by: Pingfan Liu +--- +v3 -> v4: + use inst() instead of copy +v2 -> v3: + fix format by shfmt -s -w modules.d/99squash/module-setup.sh +v1 -> v2: + cp -r /etc/ld.so* instead of move, since after switch-root, initdir +can not be seen any longer + +(cherry picked from commit dc21638c3f0acbb54417f3bfb6294ad5514bf2db) + +Resolves: #1959336 +--- + modules.d/99squash/module-setup.sh | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 8c9982c0..14790ce8 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -28,6 +28,11 @@ installpost() { + [[ "$squash_dir" == "$i"/* ]] || mv "$i" "$squash_dir"/ + done + ++ # initdir also needs ld.so.* to make ld.so work ++ inst /etc/ld.so.cache ++ inst /etc/ld.so.conf ++ inst_dir /etc/ld.so.conf.d/ ++ + # Create mount points for squash loader + mkdir -p "$initdir"/squash/ + mkdir -p "$squash_dir"/squash/ + diff --git a/0185.patch b/0185.patch new file mode 100644 index 0000000..589d702 --- /dev/null +++ b/0185.patch @@ -0,0 +1,67 @@ +From bc6b4ffd4e7babd34e207c2aa8bed7f0fd8bafcf Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 2 Aug 2021 12:42:09 +0200 +Subject: [PATCH] dracut-functions: backport block_is_* functions + +Based on 480aa9695f8c2e2b30c8f41ae8483140020d23db +RHEL-only + +Related: #1959336 +--- + dracut-functions.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index d75696fd..14e60a9c 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -718,3 +718,47 @@ btrfs_devs() { + printf -- "%s\n" "$_dev" + done + } ++ ++# block_is_nbd ++# Check whether $1 is an nbd device ++block_is_nbd() { ++ [[ -b /dev/block/$1 && $1 == 43:* ]] ++} ++ ++# block_is_iscsi ++# 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 ++# 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 ++# Check whether $1 is a net device ++block_is_netdevice() { ++ block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1" ++} +\ No newline at end of file + diff --git a/0186.patch b/0186.patch new file mode 100644 index 0000000..7129181 --- /dev/null +++ b/0186.patch @@ -0,0 +1,143 @@ +From f24f363eb329f8ce4b2435fb5d14786c104dec99 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 2 Aug 2021 13:33:18 +0200 +Subject: [PATCH] fix(squash): fixes related to squash module rebase + +fix fro missing dracutsysrootdir +move the $compress args parsing to later part after mksquashfs, so mksquashfs can use $compress as the original parameter value + +Related:#1959336 +--- + dracut.sh | 94 +++++++++++++++++++------------------- + modules.d/99squash/module-setup.sh | 3 +- + 2 files changed, 49 insertions(+), 48 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index fa14e3ce..e559bb96 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -825,53 +825,6 @@ if [[ $_no_compress_l = "cat" ]]; then + compress="cat" + fi + +-if ! [[ $compress ]]; then +- # check all known compressors, if none specified +- for i in pigz gzip lz4 lzop zstd lzma xz lbzip2 bzip2 cat; do +- command -v "$i" &>/dev/null || continue +- compress="$i" +- break +- done +- if [[ $compress = cat ]]; then +- printf "%s\n" "dracut: no compression tool available. Initramfs image is going to be big." >&2 +- fi +-fi +- +-# choose the right arguments for the compressor +-case $compress in +- bzip2|lbzip2) +- if [[ "$compress" = lbzip2 ]] || command -v lbzip2 &>/dev/null; then +- compress="lbzip2 -9" +- else +- compress="bzip2 -9" +- fi +- ;; +- lzma) +- compress="lzma -9 -T0" +- ;; +- xz) +- compress="xz --check=crc32 --lzma2=dict=1MiB -T0" +- ;; +- gzip|pigz) +- if [[ "$compress" = pigz ]] || command -v pigz &>/dev/null; then +- compress="pigz -9 -n -T -R" +- elif command -v gzip &>/dev/null && gzip --help 2>&1 | grep -q rsyncable; then +- compress="gzip -n -9 --rsyncable" +- else +- compress="gzip -n -9" +- fi +- ;; +- lzo|lzop) +- compress="lzop -9" +- ;; +- lz4) +- compress="lz4 -l -9" +- ;; +- zstd) +- compress="zstd -15 -q -T0" +- ;; +-esac +- + [[ $hostonly = yes ]] && hostonly="-h" + [[ $hostonly != "-h" ]] && unset hostonly + +@@ -1848,6 +1801,53 @@ if [[ $create_early_cpio = yes ]]; then + fi + fi + ++if ! [[ $compress ]]; then ++ # check all known compressors, if none specified ++ for i in pigz gzip lz4 lzop zstd lzma xz lbzip2 bzip2 cat; do ++ command -v "$i" &>/dev/null || continue ++ compress="$i" ++ break ++ done ++ if [[ $compress = cat ]]; then ++ printf "%s\n" "dracut: no compression tool available. Initramfs image is going to be big." >&2 ++ fi ++fi ++ ++# choose the right arguments for the compressor ++case $compress in ++ bzip2|lbzip2) ++ if [[ "$compress" = lbzip2 ]] || command -v lbzip2 &>/dev/null; then ++ compress="lbzip2 -9" ++ else ++ compress="bzip2 -9" ++ fi ++ ;; ++ lzma) ++ compress="lzma -9 -T0" ++ ;; ++ xz) ++ compress="xz --check=crc32 --lzma2=dict=1MiB -T0" ++ ;; ++ gzip|pigz) ++ if [[ "$compress" = pigz ]] || command -v pigz &>/dev/null; then ++ compress="pigz -9 -n -T -R" ++ elif command -v gzip &>/dev/null && gzip --help 2>&1 | grep -q rsyncable; then ++ compress="gzip -n -9 --rsyncable" ++ else ++ compress="gzip -n -9" ++ fi ++ ;; ++ lzo|lzop) ++ compress="lzop -9" ++ ;; ++ lz4) ++ compress="lz4 -l -9" ++ ;; ++ zstd) ++ compress="zstd -15 -q -T0" ++ ;; ++esac ++ + if ! ( + umask 077; cd "$initdir" + find . -print0 | sort -z \ +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 14790ce8..11964b97 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -39,9 +39,10 @@ installpost() { + + # Copy dracut spec files out side of the squash image + # so dracut rebuild and lsinitrd can work ++ mkdir -p "$initdir/usr/lib/dracut/" + for file in "$squash_dir"/usr/lib/dracut/*; do + [[ -f $file ]] || continue +- DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#$squash_dir}" ++ cp "$file" "$initdir/${file#$squash_dir}" + done + + # Install required modules and binaries for the squash image init script. + diff --git a/0187.patch b/0187.patch new file mode 100644 index 0000000..dd18f9a --- /dev/null +++ b/0187.patch @@ -0,0 +1,31 @@ +From 094514ae8383e03d95869a98ba8858ad74da1f0d Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Fri, 30 Jul 2021 21:54:11 +0800 +Subject: [PATCH] fix(squash): remove tailing '/' when installing ld.so.conf.d + +This tailing '/' will result in following error: + +dracut-install: ERROR: installing '/etc/ld.so.conf.d/' +dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.kEFQLs/initramfs -d /etc/ld.so.conf.d/ + +Signed-off-by: Kairui Song + +Related:#1959336 +--- + modules.d/99squash/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 11964b97..7f5d365a 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -31,7 +31,7 @@ installpost() { + # initdir also needs ld.so.* to make ld.so work + inst /etc/ld.so.cache + inst /etc/ld.so.conf +- inst_dir /etc/ld.so.conf.d/ ++ inst_dir /etc/ld.so.conf.d + + # Create mount points for squash loader + mkdir -p "$initdir"/squash/ + diff --git a/0188.patch b/0188.patch new file mode 100644 index 0000000..a418a83 --- /dev/null +++ b/0188.patch @@ -0,0 +1,32 @@ +From 090aa276b8d4b5041472743ea7472a3a1d398a92 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Tue, 10 Aug 2021 17:37:08 +0800 +Subject: [PATCH] fix(lsinitrd): TMP_DIR doesn't exist in RHEL8 + +lsinitrd should create a seperate temp file for extracting squash image +when squash module is enabled. + +Signed-off-by: Kairui Song +(cherry picked from commit 52fcd3373f0cf715b3744f832643dc3170aefbf5) + +Resolves: #1991647 +--- + lsinitrd.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lsinitrd.sh b/lsinitrd.sh +index 04ce9e8b..85981e58 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -163,8 +163,8 @@ list_files() + list_squash_content() + { + SQUASH_IMG="squash-root.img" +- SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" +- ++ SQUASH_TMPFILE="$(mktemp -t --suffix=.root.sqsh lsinitrd.XXXXXX)" ++ trap "rm -f '$SQUASH_TMPFILE'" EXIT + $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- \ + $SQUASH_IMG > "$SQUASH_TMPFILE" 2>/dev/null + if [[ -s $SQUASH_TMPFILE ]]; then + diff --git a/0189.patch b/0189.patch new file mode 100644 index 0000000..698c67b --- /dev/null +++ b/0189.patch @@ -0,0 +1,41 @@ +From 2ee3efdfa0c7f12c2f8446721937bfe713858854 Mon Sep 17 00:00:00 2001 +From: Kairui Song +Date: Mon, 9 Aug 2021 18:23:43 +0800 +Subject: [PATCH] fix(squash): apply FIPS and libpthread workaround + +There are some workarounds in dracut.sh for FIPS/libpthread covering +some hidden lib dependency issues. These workarounds didn't take effect +for the squash loader since the squash loader is installed +independently. So apply these workarounds again. + +Also skip the lib detection code, since these extra installed libs +are small, and squash loader contents are dropped after switch root, +won't be an issue to be always installed. And this makes the code +cleaner. + +Signed-off-by: Kairui Song +(cherry picked from commit 5ab18dee996f0eeb2b0bfe354570e1b1af46d025) + +Resolves: #1990847 +--- + modules.d/99squash/module-setup.sh | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index 7f5d365a..e73d3184 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -53,6 +53,12 @@ installpost() { + done + else + DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount ++ ++ # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so ++ inst_libdir_file -o "libgcc_s.so*" ++ ++ # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled ++ [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*" + fi + + hostonly="" instmods "loop" "squashfs" "overlay" + diff --git a/0190.patch b/0190.patch new file mode 100644 index 0000000..395305c --- /dev/null +++ b/0190.patch @@ -0,0 +1,59 @@ +From e6cb22f2d12dfe61abf32389fa7d8927105081e2 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Mon, 30 Aug 2021 10:02:22 +0200 +Subject: [PATCH] fix(install): extend hwcaps library handling to libraries + under glibc-hwcaps/ + +(cherry picked from commit 10ed204f873f454dcd15ffcc82dc3a1c781c1514) + +Resolves: #1983030 +--- + install/dracut-install.c | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index baf6dcff..4962316d 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -335,8 +335,8 @@ static int cp(const char *src, const char *dst) + static int library_install(const char *src, const char *lib) + { + _cleanup_free_ char *p = NULL; +- _cleanup_free_ char *pdir = NULL, *ppdir = NULL, *clib = NULL; +- char *q; ++ _cleanup_free_ char *pdir = NULL, *ppdir = NULL, *pppdir = NULL, *clib = NULL; ++ char *q, *clibdir; + int r, ret = 0; + + p = strdup(lib); +@@ -358,7 +358,8 @@ static int library_install(const char *src, const char *lib) + log_debug("Lib install: '%s'", p); + } + +- /* Also try to install the same library from one directory above. ++ /* Also try to install the same library from one directory above ++ * or from one directory above glibc-hwcaps. + This fixes the case, where only the HWCAP lib would be installed + # ldconfig -p|grep -F libc.so + libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6 +@@ -379,10 +380,18 @@ static int library_install(const char *src, const char *lib) + return ret; + + ppdir = strdup(ppdir); ++ pppdir = dirname(ppdir); ++ if (!pppdir) ++ return ret; ++ ++ pppdir = strdup(pppdir); ++ if (!pppdir) ++ return ret; + + strcpy(p, lib); + +- clib = strjoin(ppdir, "/", basename(p), NULL); ++ clibdir = streq(basename(ppdir), "glibc-hwcaps") ? pppdir : ppdir; ++ clib = strjoin(clibdir, "/", basename(p), NULL); + if (dracut_install(clib, clib, false, false, true) == 0) + log_debug("Lib install: '%s'", clib); + /* also install lib.so for lib.so.* files */ + diff --git a/0191.patch b/0191.patch new file mode 100644 index 0000000..2368589 --- /dev/null +++ b/0191.patch @@ -0,0 +1,243 @@ +From e2c7b61f97465b26c598d655c8717403c0a73726 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Sat, 13 Nov 2021 16:35:23 +0100 +Subject: [PATCH] ci: introduce C8S based GHA CI + +Loosely based on the upstream dracut CI to make things simpler. + +rhel-only +--- + .github/workflows/container.yml | 52 +++++++++++++++++++++++++++++ + .github/workflows/integration.yml | 48 +++++++++++++++++++++++++++ + test/container/Dockerfile-CentOS-8-Stream | 54 +++++++++++++++++++++++++++++++ + tools/test-github.sh | 49 ++++++++++++++++++++++++++++ + 4 files changed, 203 insertions(+) + +diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml +new file mode 100644 +index 00000000..0a4c000f +--- /dev/null ++++ b/.github/workflows/container.yml +@@ -0,0 +1,52 @@ ++name: Container ++on: ++ schedule: ++ - cron: '30 11 * * *' ++ push: ++ branches: [ main ] ++ paths: ++ - 'test/container/**' ++ - '.github/workflows/container.yml' ++ pull_request: ++ branches: [ main ] ++ paths: ++ - 'test/container/**' ++ - '.github/workflows/container.yml' ++ ++permissions: ++ packages: write ++ contents: read ++ ++jobs: ++ push_to_registry: ++ name: Build and push containers image to GitHub Packages ++ runs-on: ubuntu-latest ++ concurrency: ++ group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} ++ cancel-in-progress: true ++ strategy: ++ fail-fast: false ++ matrix: ++ config: ++ # Use a prefixed image name to not conflict with the "centos" ++ # image from redhat-plumbers/dracut-rhel9 ++ - { dockerfile: 'Dockerfile-CentOS-8-Stream', tag: 'rhel8_centos:stream8' } ++ steps: ++ - name: Check out the repo ++ uses: actions/checkout@v2 ++ - name: Set up Docker Buildx ++ uses: docker/setup-buildx-action@v1 ++# with: ++# buildkitd-flags: --debug ++ - name: Login to GitHub Container Registry ++ uses: docker/login-action@v1 ++ with: ++ registry: ghcr.io ++ username: ${{ github.repository_owner }} ++ password: ${{ secrets.GITHUB_TOKEN }} ++ - name: Build and Push Container ++ uses: docker/build-push-action@v2 ++ with: ++ file: test/container/${{ matrix.config.dockerfile }} ++ tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }} ++ push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} +diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml +new file mode 100644 +index 00000000..80a856a2 +--- /dev/null ++++ b/.github/workflows/integration.yml +@@ -0,0 +1,48 @@ ++name: Integration Test ++ ++on: ++ pull_request: ++ branches: [ main ] ++ ++jobs: ++ centos-8-stream: ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ concurrency: ++ group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} ++ cancel-in-progress: true ++ strategy: ++ matrix: ++ container: [ ++ "rhel8_centos:stream8", ++ ] ++ # Disabled tests (due to dropped packages in RHEL/CentOS): ++ # 03, 04, 15: requires btrfs ++ # 14: requires dmraid ++ # 30, 31, 35, 36: requires scsi-target-utils ++ test: [ ++ "01", ++ "02", ++ "10", ++ "11", ++ "12", ++ "13", ++ "17", ++ "20", ++ #"21", needs backport (NFS + NM) ++ "40", ++ #"41", needws backport (NBD + NM) ++ "98", ++ ] ++ fail-fast: false ++ container: ++ image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }} ++ options: "--privileged -v /dev:/dev" ++ steps: ++ - name: "Checkout Repository" ++ uses: actions/checkout@v2 ++ with: ++ fetch-depth: 0 ++ ++ - name: "${{ matrix.container }} TEST-${{ matrix.test }}" ++ run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} +diff --git a/test/container/Dockerfile-CentOS-8-Stream b/test/container/Dockerfile-CentOS-8-Stream +new file mode 100644 +index 00000000..0eda4a7e +--- /dev/null ++++ b/test/container/Dockerfile-CentOS-8-Stream +@@ -0,0 +1,54 @@ ++FROM quay.io/centos/centos:stream8 ++ ++MAINTAINER https://github.com/dracutdevs/dracut ++ ++ENV container docker ++LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE" ++ ++RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh ++ ++# Install needed packages for the dracut CI container ++RUN dnf -y install epel-release && \ ++ dnf -y install --enablerepo powertools --enablerepo epel --setopt=install_weak_deps=False \ ++ qemu-kvm \ ++ NetworkManager \ ++ asciidoc \ ++ bash-completion \ ++ bzip2 \ ++ cryptsetup \ ++ dash \ ++ dbus-daemon \ ++ dhcp-client \ ++ dhcp-server \ ++ e2fsprogs \ ++ gcc \ ++ git \ ++ iproute \ ++ iputils \ ++ iscsi-initiator-utils \ ++ kbd \ ++ kernel \ ++ kmod-devel \ ++ lvm2 \ ++ make \ ++ mdadm \ ++ nfs-utils \ ++ pigz \ ++ python3-imgcreate \ ++ rpm-build \ ++ strace \ ++ sudo \ ++ tar \ ++ tcpdump \ ++ wget \ ++ which \ ++ xz \ ++ && dnf -y update && dnf clean all ++ ++# CentOS 8 ships only qemu-kvm, but it disables the KVM accel when it's not ++# available ++RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \ ++ ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m) ++ ++# Set default command ++CMD ["/usr/bin/bash"] +diff --git a/tools/test-github.sh b/tools/test-github.sh +new file mode 100755 +index 00000000..eab59dcc +--- /dev/null ++++ b/tools/test-github.sh +@@ -0,0 +1,49 @@ ++#!/bin/bash ++ ++set -ex ++ ++[[ -d ${0%/*} ]] && cd "${0%/*}"/../ ++ ++RUN_ID="$1" ++TESTS=$2 ++ ++./configure ++ ++NCPU=$(getconf _NPROCESSORS_ONLN) ++ ++if ! [[ $TESTS ]]; then ++ # GitHub workflows fetch a clone of the dracut repository which doesn't ++ # contain git tags, thus "breaking" the RPM build in certain situations ++ # i.e.: ++ # DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`, ++ # which in full git clone returns a tag with a numeric version. However, ++ # without tags it returns SHA of the last commit, which later propagates into ++ # `Provides:` attribute of the built RPM and can break dependency tree when ++ # installed ++ [[ -d .git ]] && git fetch --tags && git describe --tags ++ make -j "$NCPU" all syncheck rpm logtee ++else ++ if [[ $TESTS == "99" ]]; then ++ [[ -d .git ]] && git fetch --tags && git describe --tags ++ make_docs=yes ++ else ++ make_docs=no ++ fi ++ ++ make -j "$NCPU" enable_documentation=$make_docs all logtee ++ ++ cd test ++ ++ # shellcheck disable=SC2012 ++ time LOGTEE_TIMEOUT_MS=590000 make \ ++ enable_documentation=$make_docs \ ++ KVERSION="$( ++ cd /lib/modules ++ ls -1 | tail -1 ++ )" \ ++ DRACUT_NO_XATTR=1 \ ++ TEST_RUN_ID="$RUN_ID" \ ++ ${TESTS:+TESTS="$TESTS"} \ ++ -k V=1 \ ++ check ++fi + diff --git a/0192.patch b/0192.patch new file mode 100644 index 0000000..d4f31aa --- /dev/null +++ b/0192.patch @@ -0,0 +1,78 @@ +From 436135496469ec24be1fc6fbc03a39d2575c8686 Mon Sep 17 00:00:00 2001 +From: Frantisek Sumsal +Date: Sat, 13 Nov 2021 17:55:45 +0100 +Subject: [PATCH] ci: backport TEST-21-NFS-NM + +Loosely cherry-picked from a3f73298f287e75810d6784efa52e80af15da2bd. + +rhel-only +--- + .github/workflows/integration.yml | 3 +-- + test/TEST-20-NFS/test.sh | 14 +++++++++++--- + test/TEST-21-NFS-NM/Makefile | 12 ++++++++++++ + 3 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml +index 80a856a2..9c7c8486 100644 +--- a/.github/workflows/integration.yml ++++ b/.github/workflows/integration.yml +@@ -29,9 +29,8 @@ jobs: + "13", + "17", + "20", +- #"21", needs backport (NFS + NM) ++ "21", + "40", +- #"41", needws backport (NBD + NM) + "98", + ] + fail-fast: false +diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh +index 4ad7fd77..320f9c3e 100755 +--- a/test/TEST-20-NFS/test.sh ++++ b/test/TEST-20-NFS/test.sh +@@ -1,5 +1,13 @@ + #!/bin/bash +-TEST_DESCRIPTION="root filesystem on NFS" ++if [[ $NM ]]; then ++ USE_NETWORK="network-manager" ++ OMIT_NETWORK="network-legacy" ++else ++ USE_NETWORK="network-legacy" ++ OMIT_NETWORK="network-manager" ++fi ++ ++TEST_DESCRIPTION="root filesystem on NFS with $USE_NETWORK" + + KVERSION=${KVERSION-$(uname -r)} + +@@ -353,8 +361,8 @@ test_setup() { + + # Make client's dracut image + $basedir/dracut.sh -l -i $TESTDIR/overlay / \ +- -o "plymouth dash" \ +- -a "debug watchdog" \ ++ -o "plymouth dash ${OMIT_NETWORK}" \ ++ -a "debug watchdog ${USE_NETWORK}" \ + -d "af_packet piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc i6300esb" \ + --no-hostonly-cmdline -N \ + -f $TESTDIR/initramfs.testing $KVERSION || return 1 +diff --git a/test/TEST-21-NFS-NM/Makefile b/test/TEST-21-NFS-NM/Makefile +new file mode 100644 +index 00000000..b19122a1 +--- /dev/null ++++ b/test/TEST-21-NFS-NM/Makefile +@@ -0,0 +1,12 @@ ++.PHONY: all setup clean run ++ ++BASETEST=../TEST-20-NFS ++ ++all: ++ @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) all ++setup: ++ @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) setup ++clean: ++ @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) clean ++run: ++ @$(MAKE) NM=1 -s --no-print-directory -C $(BASETEST) run + diff --git a/0193.patch b/0193.patch new file mode 100644 index 0000000..7137d69 --- /dev/null +++ b/0193.patch @@ -0,0 +1,57 @@ +From fd907a1b2b1f087afa2eccfa1686043e4dbb5ff6 Mon Sep 17 00:00:00 2001 +From: q66 +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 + +Resolves: rhbz#2022414 +--- + dracut.sh | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index e559bb96..952c57c8 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1070,19 +1070,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) + diff --git a/0194.patch b/0194.patch new file mode 100644 index 0000000..563777a --- /dev/null +++ b/0194.patch @@ -0,0 +1,24 @@ +From ccd2823f5b75273445c7de36ff306fd23163f955 Mon Sep 17 00:00:00 2001 +From: Masahiro Matsuya +Date: Fri, 11 Jun 2021 10:40:04 +0900 +Subject: [PATCH] fix(url-lib): make pre-pivot hook separetely per nfs mount + +Resolves: rhbz#1967802 +--- + modules.d/45url-lib/url-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh +index 08c3ebb4..56d0d683 100755 +--- a/modules.d/45url-lib/url-lib.sh ++++ b/modules.d/45url-lib/url-lib.sh +@@ -143,7 +143,7 @@ nfs_fetch_url() { + local mntdir="$(mkuniqdir /run nfs_mnt)" + mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir" + # lazy unmount during pre-pivot hook +- inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l -- "$mntdir" ++ inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-"$(basename "$mntdir")" umount -l -- "$mntdir" + fi + + if [ -z "$outloc" ]; then + diff --git a/0195.patch b/0195.patch new file mode 100644 index 0000000..d9e6084 --- /dev/null +++ b/0195.patch @@ -0,0 +1,27 @@ +From 8a4e5b5988d716259ad5b684dc2814d265007cb5 Mon Sep 17 00:00:00 2001 +From: Peter Levine +Date: Mon, 1 Feb 2021 22:17:06 -0500 +Subject: [PATCH] fix(watchdog): replace return with echo + +(cherry picked from commit c35cbd2e561714207388af69820cee2743dbcbc3) + +Resolves: #1890039 +--- + modules.d/04watchdog/module-setup.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh +index 15bcd897..fdc62986 100755 +--- a/modules.d/04watchdog/module-setup.sh ++++ b/modules.d/04watchdog/module-setup.sh +@@ -7,7 +7,8 @@ check() { + + # called by dracut + depends() { +- return "watchdog-modules" ++ echo watchdog-modules ++ return 0 + } + + # called by dracut + diff --git a/0196.patch b/0196.patch new file mode 100644 index 0000000..481d6f5 --- /dev/null +++ b/0196.patch @@ -0,0 +1,68 @@ +From c7b21c88d27aace097ce9bc1fc36f4b742858737 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Mon, 22 Nov 2021 16:40:39 +0100 +Subject: [PATCH] fix(network): add errors and warnings when network interface + does not exist + +End with error, or show a warning when nonexistent device is specified for network setup like +`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`. + +I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written. + +Resolves: #1712424 +--- + modules.d/35network-legacy/ifup.sh | 6 +++++- + modules.d/35network-legacy/parse-ip-opts.sh | 5 +++++ + modules.d/45ifcfg/write-ifcfg.sh | 5 +++++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh +index bd560379..0e9a6928 100755 +--- a/modules.d/35network-legacy/ifup.sh ++++ b/modules.d/35network-legacy/ifup.sh +@@ -413,7 +413,11 @@ for p in $(getargs ip=); do + + # If this option isn't directed at our interface, skip it + if [ -n "$dev" ]; then +- [ "$dev" != "$netif" ] && continue ++ if [ "$dev" != "$netif" ]; then ++ [ ! -e "/sys/class/net/$dev" ] \ ++ && warn "Network interface '$dev' does not exist!" ++ continue ++ fi + else + iface_is_enslaved "$netif" && continue + fi +diff --git a/modules.d/35network-legacy/parse-ip-opts.sh b/modules.d/35network-legacy/parse-ip-opts.sh +index 10a2d19b..eea0988c 100755 +--- a/modules.d/35network-legacy/parse-ip-opts.sh ++++ b/modules.d/35network-legacy/parse-ip-opts.sh +@@ -96,6 +96,11 @@ for p in $(getargs ip=); do + fi + # IFACES list for later use + IFACES="$IFACES $dev" ++ ++ # Interface should exist ++ if [ ! -e "/sys/class/net/$dev" ]; then ++ warn "Network interface '$dev' does not exist" ++ fi + fi + + # Do we need to check for specific options? +diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh +index abd111fc..7e767f15 100755 +--- a/modules.d/45ifcfg/write-ifcfg.sh ++++ b/modules.d/45ifcfg/write-ifcfg.sh +@@ -100,6 +100,11 @@ interface_bind() { + local _netif="$1" + local _macaddr="$2" + ++ if [ ! -e "/sys/class/net/$_netif" ]; then ++ derror "Cannot find network interface '$_netif'!" ++ return 1 ++ fi ++ + # see, if we can bind it to some hw parms + if hw_bind "$_netif" "$_macaddr"; then + # only print out DEVICE, if it's user assigned + diff --git a/0197.patch b/0197.patch new file mode 100644 index 0000000..7781b40 --- /dev/null +++ b/0197.patch @@ -0,0 +1,54 @@ +From 0a6125bf834c5a1808e4898f46093bc2ab2fed05 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +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. + +(cherry picked from commit dfe2247a43d6a216d9af533825c9a103e3b056cd) + +Resolves: #1946245 +--- + dracut.sh | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index 952c57c8..702b2f78 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -277,6 +277,14 @@ read_arg() { + fi + } + ++check_conf_file() ++{ ++ if grep -H -e '^[^#]*[+]=\("[^ ]\|.*[^ ]"\)' "$@"; then ++ printf '\ndracut: WARNING: +=" ": 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 +@@ -697,10 +705,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 + + diff --git a/0198.patch b/0198.patch new file mode 100644 index 0000000..4231fb1 --- /dev/null +++ b/0198.patch @@ -0,0 +1,34 @@ +From c99f396a5d456520b34c60f43c589ca39a301955 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Wed, 14 Nov 2018 13:19:27 +0100 +Subject: [PATCH] fips: removed false-positive 'FATAL: Module xxx not found' + error message when kernel provides a generic algo for module + +Resolves: rhbz#1996019 +--- + modules.d/01fips/fips.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index 03da6861..1d57a889 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -77,7 +77,7 @@ fips_load_crypto() + mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak + for _module in $FIPSMODULES; do + if [ "$_module" != "tcrypt" ]; then +- if ! modprobe "${_module}"; then ++ if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then + # check if kernel provides generic algo + _found=0 + while read _k _s _v || [ -n "$_k" ]; do +@@ -86,7 +86,7 @@ fips_load_crypto() + _found=1 + break + done &2 && return 1 + fi + fi + done + diff --git a/0199.patch b/0199.patch new file mode 100644 index 0000000..5863d26 --- /dev/null +++ b/0199.patch @@ -0,0 +1,37 @@ +From 876196e809f4ffac055737921cfe273d8399b6e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Renaud=20M=C3=A9trich?= +Date: Tue, 16 Nov 2021 11:15:52 +0100 +Subject: [PATCH] fix(shutdown): be robust against forced shutdown + +When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del +keys, systemd sends SIGTERM to all processes. This ends up killing +dracut-initramfs-restore as well, preventing the script from detecting +that the unpack of the initramfs is incomplete, which later causes a +crash to happen when "shutdown" tries to execute from the unpacked +initramfs. + +This fix makes sure dracut-initramfs-restore remains alive to detect +the unpack failed (because cpio was killed by systemd too). + +Resolves: rhbz#2023665 +--- + dracut-initramfs-restore.sh | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh +index 74a952c4..708f98d7 100644 +--- a/dracut-initramfs-restore.sh ++++ b/dracut-initramfs-restore.sh +@@ -6,6 +6,11 @@ set -e + [ -e /run/initramfs/bin/sh ] && exit 0 + [ -e /run/initramfs/.need_shutdown ] || exit 0 + ++# SIGTERM signal is received upon forced shutdown: ignore the signal ++# We want to remain alive to be able to trap unpacking errors to avoid ++# switching root to an incompletely unpacked initramfs ++trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM ++ + KERNEL_VERSION="$(uname -r)" + + [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut + diff --git a/0200.patch b/0200.patch new file mode 100644 index 0000000..32ea347 --- /dev/null +++ b/0200.patch @@ -0,0 +1,84 @@ +From f5ffe8bc95ee989ef39b7c149d268b5988f952a0 Mon Sep 17 00:00:00 2001 +From: Jonathan Lebon +Date: Thu, 17 Jun 2021 10:47:33 -0400 +Subject: [PATCH] fix(fips): handle s390x OSTree systems + +On s390x, the `BOOT_IMAGE` karg injected by the bootloader is not a path +to the kernel image, but rather an integer describing the index of the +menu entry selected. Because of the way the s390x bootloader works, +there is no information retained about e.g. the path of the kernel that +was loaded. + +This causes issues for the FIPS code which assumes that `BOOT_IMAGE` is +a path to the kernel image to derive the HMAC path. In non-OSTree +systems, this ends up working anyway, because the kernel is located at +the root of the boot partition. In OSTree systems, this is not the +case. However, OSTree systems use BLS configs, and they are named in +reverse order of precedence (i.e. menu ordering). So from the +`BOOT_IMAGE` integer, we can figure out which BLS entry was selected. + +Add some code to do just this on s390x. This isn't completely foolproof, +because it presumes that (1) BLS configs were used to populate the +bootloader (and that they were exactly in the same state they currently +are when `zipl` was run), and (2) there are no other menu entries +originating from outside the BLS configs. However, if these assumptions +are wrong we would simply fail the boot, which is currently what is +happening anyway. + +See also: +https://github.com/openshift/os/pull/546 +https://github.com/ibm-s390-linux/s390-tools/issues/78 + +Tested-by: Muhammad Adeel + +Resolves: rhbz#2007586 +--- + modules.d/01fips/fips.sh | 21 +++++++++++++++++++++ + modules.d/01fips/module-setup.sh | 2 +- + 2 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh +index 1d57a889..c57fd426 100755 +--- a/modules.d/01fips/fips.sh ++++ b/modules.d/01fips/fips.sh +@@ -114,6 +114,27 @@ do_fips() + else + BOOT_IMAGE="$(getarg BOOT_IMAGE)" + ++ # On s390x, BOOT_IMAGE isn't a path but an integer representing the ++ # entry number selected. Let's try the root of /boot first, and ++ # otherwise fallback to trying to parse the BLS entries if it's a ++ # BLS-based system. ++ if [ "$(uname -m)" = s390x ]; then ++ if [ -e "/boot/vmlinuz-${KERNEL}" ]; then ++ BOOT_IMAGE="vmlinuz-${KERNEL}" ++ elif [ -d /boot/loader/entries ]; then ++ i=0 ++ for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do ++ ((i++)) ++ ++ if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then ++ BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')" ++ BOOT_IMAGE=${BOOT_IMAGE:1} ++ break ++ fi ++ done ++ fi ++ fi ++ + # Trim off any leading GRUB boot device (e.g. ($root) ) + BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')" + +diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh +index 8800a49e..71bea53a 100755 +--- a/modules.d/01fips/module-setup.sh ++++ b/modules.d/01fips/module-setup.sh +@@ -67,7 +67,7 @@ install() { + inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh" + inst_script "$moddir/fips.sh" /sbin/fips.sh + +- inst_multiple sha512hmac rmmod insmod mount uname umount ++ inst_multiple sha512hmac rmmod insmod mount uname umount grep sort + + inst_simple /etc/system-fips + [ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \ diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/dracut.spec b/dracut.spec new file mode 100644 index 0000000..9da2ef9 --- /dev/null +++ b/dracut.spec @@ -0,0 +1,2287 @@ +%define dracutlibdir %{_prefix}/lib/dracut +%bcond_without doc + +# We ship a .pc file but don't want to have a dep on pkg-config. We +# strip the automatically generated dep here and instead co-own the +# directory. +%global __requires_exclude pkg-config +%define dist_free_release 201.git20220131 + +Name: dracut +Version: 049 +Release: %{dist_free_release}%{?dist} + +Summary: Initramfs generator using udev +%if 0%{?fedora} || 0%{?rhel} +Group: System Environment/Base +%endif +%if 0%{?suse_version} +Group: System/Base +%endif + +# The entire source code is GPLv2+ +# except install/* which is LGPLv2+ +License: GPLv2+ and LGPLv2+ + +URL: https://dracut.wiki.kernel.org/ + +# Source can be generated by +# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz +Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz +Patch1: 0001.patch +Patch2: 0002.patch +Patch3: 0003.patch +Patch4: 0004.patch +Patch5: 0005.patch +Patch6: 0006.patch +Patch7: 0007.patch +Patch8: 0008.patch +Patch9: 0009.patch +Patch10: 0010.patch +Patch11: 0011.patch +Patch12: 0012.patch +Patch13: 0013.patch +Patch14: 0014.patch +Patch15: 0015.patch +Patch16: 0016.patch +Patch17: 0017.patch +Patch18: 0018.patch +Patch19: 0019.patch +Patch20: 0020.patch +Patch21: 0021.patch +Patch22: 0022.patch +Patch23: 0023.patch +Patch24: 0024.patch +Patch25: 0025.patch +Patch26: 0026.patch +Patch27: 0027.patch +Patch28: 0028.patch +Patch29: 0029.patch +Patch30: 0030.patch +Patch31: 0031.patch +Patch32: 0032.patch +Patch33: 0033.patch +Patch34: 0034.patch +Patch35: 0035.patch +Patch36: 0036.patch +Patch37: 0037.patch +Patch38: 0038.patch +Patch39: 0039.patch +Patch40: 0040.patch +Patch41: 0041.patch +Patch42: 0042.patch +Patch43: 0043.patch +Patch44: 0044.patch +Patch45: 0045.patch +Patch46: 0046.patch +Patch47: 0047.patch +Patch48: 0048.patch +Patch49: 0049.patch +Patch50: 0050.patch +Patch51: 0051.patch +Patch52: 0052.patch +Patch53: 0053.patch +Patch54: 0054.patch +Patch55: 0055.patch +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 +Patch89: 0089.patch +Patch90: 0090.patch +Patch91: 0091.patch +Patch92: 0092.patch +Patch93: 0093.patch +Patch94: 0094.patch +Patch95: 0095.patch +Patch96: 0096.patch +Patch97: 0097.patch +Patch98: 0098.patch +Patch99: 0099.patch +Patch100: 0100.patch +Patch101: 0101.patch +Patch102: 0102.patch +Patch103: 0103.patch +Patch104: 0104.patch +Patch105: 0105.patch +Patch106: 0106.patch +Patch107: 0107.patch +Patch108: 0108.patch +Patch109: 0109.patch +Patch110: 0110.patch +Patch111: 0111.patch +Patch112: 0112.patch +Patch113: 0113.patch +Patch114: 0114.patch +Patch115: 0115.patch +Patch116: 0116.patch +Patch117: 0117.patch +Patch118: 0118.patch +Patch119: 0119.patch +Patch120: 0120.patch +Patch121: 0121.patch +Patch122: 0122.patch +Patch123: 0123.patch +Patch124: 0124.patch +Patch125: 0125.patch +Patch126: 0126.patch +Patch127: 0127.patch +Patch128: 0128.patch +Patch129: 0129.patch +Patch130: 0130.patch +Patch131: 0131.patch +Patch132: 0132.patch +Patch133: 0133.patch +Patch134: 0134.patch +Patch135: 0135.patch +Patch136: 0136.patch +Patch137: 0137.patch +Patch138: 0138.patch +Patch139: 0139.patch +Patch140: 0140.patch +Patch141: 0141.patch +Patch142: 0142.patch +Patch143: 0143.patch +Patch144: 0144.patch +Patch145: 0145.patch +Patch146: 0146.patch +Patch147: 0147.patch +Patch148: 0148.patch +Patch149: 0149.patch +Patch150: 0150.patch +Patch151: 0151.patch +Patch152: 0152.patch +Patch153: 0153.patch +Patch154: 0154.patch +Patch155: 0155.patch +Patch156: 0156.patch +Patch157: 0157.patch +Patch158: 0158.patch +Patch159: 0159.patch +Patch160: 0160.patch +Patch161: 0161.patch +Patch162: 0162.patch +Patch163: 0163.patch +Patch164: 0164.patch +Patch165: 0165.patch +Patch166: 0166.patch +Patch167: 0167.patch +Patch168: 0168.patch +Patch169: 0169.patch +Patch170: 0170.patch +Patch171: 0171.patch +Patch172: 0172.patch +Patch173: 0173.patch +Patch174: 0174.patch +Patch175: 0175.patch +Patch176: 0176.patch +Patch177: 0177.patch +Patch178: 0178.patch +Patch179: 0179.patch +Patch180: 0180.patch +Patch181: 0181.patch +Patch182: 0182.patch +Patch183: 0183.patch +Patch184: 0184.patch +Patch185: 0185.patch +Patch186: 0186.patch +Patch187: 0187.patch +Patch188: 0188.patch +Patch189: 0189.patch +Patch190: 0190.patch +Patch191: 0191.patch +Patch192: 0192.patch +Patch193: 0193.patch +Patch194: 0194.patch +Patch195: 0195.patch +Patch196: 0196.patch +Patch197: 0197.patch +Patch198: 0198.patch +Patch199: 0199.patch +Patch200: 0200.patch + +Source1: https://www.gnu.org/licenses/lgpl-2.1.txt + +BuildRequires: bash +BuildRequires: git +BuildRequires: kmod-devel >= 23 +BuildRequires: gcc + +%if 0%{?fedora} || 0%{?rhel} +BuildRequires: pkgconfig +BuildRequires: systemd +%endif +%if 0%{?fedora} +BuildRequires: bash-completion +%endif + +%if %{with doc} +%if 0%{?fedora} || 0%{?rhel} +BuildRequires: docbook-style-xsl docbook-dtds libxslt +%endif + +%if 0%{?suse_version} +BuildRequires: docbook-xsl-stylesheets libxslt +%endif + +BuildRequires: asciidoc +%endif + +%if 0%{?suse_version} > 9999 +Obsoletes: mkinitrd < 2.6.1 +Provides: mkinitrd = 2.6.1 +%endif + +Obsoletes: dracut-fips <= 047 +Provides: dracut-fips = %{version}-%{release} +Obsoletes: dracut-fips-aesni <= 047 +Provides: dracut-fips-aesni = %{version}-%{release} + +Obsoletes: dracut-kernel < 005 +Provides: dracut-kernel = %{version}-%{release} + +Obsoletes: dracut < 030 +Obsoletes: dracut-norescue < 030 +Provides: dracut-norescue = %{version}-%{release} + +Requires: bash >= 4 +Requires: coreutils +Requires: cpio +Requires: filesystem >= 2.1.0 +Requires: findutils +Requires: grep +Requires: kmod +Requires: sed +Requires: xz +Requires: gzip + +%if 0%{?fedora} || 0%{?rhel} +Recommends: memstrack +Recommends: hardlink +Recommends: pigz +Recommends: kpartx +Requires: util-linux >= 2.21 +Requires: systemd >= 239-23 +Requires: systemd-udev >= 219 +Requires: procps-ng +%else +Requires: hardlink +Requires: gzip +Requires: kpartx +Requires: udev > 166 +Requires: util-linux-ng >= 2.21 +%endif + +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +Requires: libkcapi-hmaccalc +%endif + +%description +dracut contains tools to create bootable initramfses for the Linux +kernel. Unlike previous 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 +package. + +%package network +Summary: dracut modules to build a dracut initramfs with network support +%if 0%{?_module_build} +# In the module-build-service, we have pieces of dracut provided by different +# modules ("base-runtime" provides most functionality, but we need +# dracut-network in "installer". Since these two modules build with separate +# dist-tags, we need to reduce this strict requirement to ignore the dist-tag. +Requires: %{name} >= %{version}-%{dist_free_release} +%else +Requires: %{name} = %{version}-%{release} +%endif +Requires: iputils +Requires: iproute +Requires: (NetworkManager >= 1.20 or dhclient) +Suggests: NetworkManager +Obsoletes: dracut-generic < 008 +Provides: dracut-generic = %{version}-%{release} + +%description network +This package requires everything which is needed to build a generic +all purpose initramfs with network support with dracut. + +%package caps +Summary: dracut modules to build a dracut initramfs which drops capabilities +Requires: %{name} = %{version}-%{release} +Requires: libcap + +%description caps +This package requires everything which is needed to build an +initramfs with dracut, which drops capabilities. + +%package live +Summary: dracut modules to build a dracut initramfs with live image capabilities +%if 0%{?_module_build} +# See the network subpackage comment. +Requires: %{name} >= %{version}-%{dist_free_release} +%else +Requires: %{name} = %{version}-%{release} +%endif +Requires: %{name}-network = %{version}-%{release} +Requires: tar gzip coreutils bash device-mapper curl +%if 0%{?fedora} +Requires: fuse ntfs-3g +%endif + +%description live +This package requires everything which is needed to build an +initramfs with dracut, with live image capabilities, like Live CDs. + +%package config-generic +Summary: dracut configuration to turn off hostonly image generation +Requires: %{name} = %{version}-%{release} +Obsoletes: dracut-nohostonly < 030 +Provides: dracut-nohostonly = %{version}-%{release} + +%description config-generic +This package provides the configuration to turn off the host specific initramfs +generation with dracut and generates a generic image by default. + +%package config-rescue +Summary: dracut configuration to turn on rescue image generation +Requires: %{name} = %{version}-%{release} +Obsoletes: dracut < 030 + +%description config-rescue +This package provides the configuration to turn on the rescue initramfs +generation with dracut. + +%package tools +Summary: dracut tools to build the local initramfs +Requires: %{name} = %{version}-%{release} + +%description tools +This package contains tools to assemble the local initrd and host configuration. + +%package squash +Summary: dracut module to build an initramfs with most files in a squashfs image +Requires: %{name} = %{version}-%{release} +Requires: squashfs-tools + +%description squash +This package provides a dracut module to build an initramfs, but store most files +in a squashfs image, result in a smaller initramfs size and reduce runtime memory +usage. + +%prep +%autosetup -n %{name}-%{version} -S git_am +cp %{SOURCE1} . + +%build +%configure --systemdsystemunitdir=%{_unitdir} \ + --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \ + --libdir=%{_prefix}/lib \ +%if %{without doc} + --disable-documentation \ +%endif + ${NULL} + +make %{?_smp_mflags} + +%install +make %{?_smp_mflags} install \ + DESTDIR=$RPM_BUILD_ROOT \ + libdir=%{_prefix}/lib + +echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh + +%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips +%endif + +%if %{defined _unitdir} +# for systemd, better use systemd-bootchart +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart +%endif + +# we do not support dash in the initramfs +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash + +# remove gentoo specific modules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash + +%if %{defined _unitdir} +# with systemd IMA and selinux modules do not make sense +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity +%endif + +%ifnarch s390 s390x +# remove architecture specific modules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet +%else +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock +%endif + +mkdir -p $RPM_BUILD_ROOT/boot/dracut +mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log +touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs + +%if 0%{?fedora} || 0%{?rhel} +install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf +rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse* +%endif +%if 0%{?suse_version} +install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf +%endif + +%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999 +rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd +rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd +%endif + +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 + +%files +%if %{with doc} +%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg +%endif +%{!?_licensedir:%global license %%doc} +%license COPYING lgpl-2.1.txt +%{_bindir}/dracut +%{_datadir}/bash-completion/completions/dracut +%{_datadir}/bash-completion/completions/lsinitrd +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 +%{_bindir}/mkinitrd +%{_bindir}/lsinitrd +%endif +%dir %{dracutlibdir} +%dir %{dracutlibdir}/modules.d +%{dracutlibdir}/dracut-functions.sh +%{dracutlibdir}/dracut-init.sh +%{dracutlibdir}/dracut-functions +%{dracutlibdir}/dracut-version.sh +%{dracutlibdir}/dracut-logger.sh +%{dracutlibdir}/dracut-initramfs-restore +%{dracutlibdir}/dracut-install +%{dracutlibdir}/skipcpio +%config(noreplace) %{_sysconfdir}/dracut.conf +%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} +%{dracutlibdir}/dracut.conf.d/01-dist.conf +%endif +%dir %{_sysconfdir}/dracut.conf.d +%dir %{dracutlibdir}/dracut.conf.d +%dir %{_datadir}/pkgconfig +%{_datadir}/pkgconfig/dracut.pc + +%if %{with doc} +%{_mandir}/man8/dracut.8* +%{_mandir}/man8/*service.8* +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 +%{_mandir}/man8/mkinitrd.8* +%{_mandir}/man1/lsinitrd.1* +%endif +%{_mandir}/man7/dracut.kernel.7* +%{_mandir}/man7/dracut.cmdline.7* +%{_mandir}/man7/dracut.modules.7* +%{_mandir}/man7/dracut.bootup.7* +%{_mandir}/man5/dracut.conf.5* +%endif + +%if %{undefined _unitdir} +%{dracutlibdir}/modules.d/00bootchart +%endif +%{dracutlibdir}/modules.d/00bash +%{dracutlibdir}/modules.d/00systemd +%ifnarch s390 s390x +%{dracutlibdir}/modules.d/00warpclock +%endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +%{dracutlibdir}/modules.d/01fips +%endif +%{dracutlibdir}/modules.d/01systemd-initrd +%{dracutlibdir}/modules.d/03modsign +%{dracutlibdir}/modules.d/03rescue +%{dracutlibdir}/modules.d/04watchdog +%{dracutlibdir}/modules.d/04watchdog-modules +%{dracutlibdir}/modules.d/05busybox +%{dracutlibdir}/modules.d/06rngd +%{dracutlibdir}/modules.d/10i18n +%{dracutlibdir}/modules.d/30convertfs +%{dracutlibdir}/modules.d/45url-lib +%{dracutlibdir}/modules.d/50drm +%{dracutlibdir}/modules.d/50plymouth +%{dracutlibdir}/modules.d/80lvmmerge +%{dracutlibdir}/modules.d/90btrfs +%{dracutlibdir}/modules.d/90crypt +%{dracutlibdir}/modules.d/90dm +%{dracutlibdir}/modules.d/90dmraid +%{dracutlibdir}/modules.d/90kernel-modules +%{dracutlibdir}/modules.d/90kernel-modules-extra +%{dracutlibdir}/modules.d/90lvm +%{dracutlibdir}/modules.d/90mdraid +%{dracutlibdir}/modules.d/90multipath +%{dracutlibdir}/modules.d/90qemu +%{dracutlibdir}/modules.d/91crypt-gpg +%{dracutlibdir}/modules.d/91crypt-loop +%{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 +%{dracutlibdir}/modules.d/95udev-rules +%{dracutlibdir}/modules.d/95virtfs +%ifarch s390 s390x +%{dracutlibdir}/modules.d/80cms +%{dracutlibdir}/modules.d/81cio_ignore +%{dracutlibdir}/modules.d/91zipl +%{dracutlibdir}/modules.d/95dasd +%{dracutlibdir}/modules.d/95dasd_mod +%{dracutlibdir}/modules.d/95dasd_rules +%{dracutlibdir}/modules.d/95dcssblk +%{dracutlibdir}/modules.d/95qeth_rules +%{dracutlibdir}/modules.d/95zfcp +%{dracutlibdir}/modules.d/95zfcp_rules +%endif +%if %{undefined _unitdir} +%{dracutlibdir}/modules.d/96securityfs +%{dracutlibdir}/modules.d/97masterkey +%{dracutlibdir}/modules.d/98integrity +%endif +%{dracutlibdir}/modules.d/97biosdevname +%{dracutlibdir}/modules.d/98dracut-systemd +%{dracutlibdir}/modules.d/98ecryptfs +%{dracutlibdir}/modules.d/98pollcdrom +%{dracutlibdir}/modules.d/98selinux +%{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 +%dir %{_sharedstatedir}/initramfs +%if %{defined _unitdir} +%{_unitdir}/dracut-shutdown.service +%{_unitdir}/sysinit.target.wants/dracut-shutdown.service +%{_unitdir}/dracut-cmdline.service +%{_unitdir}/dracut-initqueue.service +%{_unitdir}/dracut-mount.service +%{_unitdir}/dracut-pre-mount.service +%{_unitdir}/dracut-pre-pivot.service +%{_unitdir}/dracut-pre-trigger.service +%{_unitdir}/dracut-pre-udev.service +%{_unitdir}/initrd.target.wants/dracut-cmdline.service +%{_unitdir}/initrd.target.wants/dracut-initqueue.service +%{_unitdir}/initrd.target.wants/dracut-mount.service +%{_unitdir}/initrd.target.wants/dracut-pre-mount.service +%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service +%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service +%{_unitdir}/initrd.target.wants/dracut-pre-udev.service + +%endif +%if 0%{?fedora} || 0%{?rhel} +%{_prefix}/lib/kernel/install.d/50-dracut.install +%endif + +%files network +%{dracutlibdir}/modules.d/02systemd-networkd +%{dracutlibdir}/modules.d/35network-manager +%{dracutlibdir}/modules.d/35network-legacy +%{dracutlibdir}/modules.d/40network +%{dracutlibdir}/modules.d/45ifcfg +%{dracutlibdir}/modules.d/90kernel-network-modules +%{dracutlibdir}/modules.d/90qemu-net +%{dracutlibdir}/modules.d/95cifs +%{dracutlibdir}/modules.d/95fcoe +%{dracutlibdir}/modules.d/95fcoe-uefi +%{dracutlibdir}/modules.d/95iscsi +%{dracutlibdir}/modules.d/95nbd +%{dracutlibdir}/modules.d/95nfs +%{dracutlibdir}/modules.d/95ssh-client +%ifarch s390 s390x +%{dracutlibdir}/modules.d/95znet +%endif +%{dracutlibdir}/modules.d/99uefi-lib + +%files caps +%{dracutlibdir}/modules.d/02caps + +%files live +%{dracutlibdir}/modules.d/99img-lib +%{dracutlibdir}/modules.d/90dmsquash-live +%{dracutlibdir}/modules.d/90dmsquash-live-ntfs +%{dracutlibdir}/modules.d/90livenet + +%files tools +%if %{with doc} +%doc %{_mandir}/man8/dracut-catimages.8* +%endif + +%{_bindir}/dracut-catimages +%dir /boot/dracut +%dir /var/lib/dracut +%dir /var/lib/dracut/overlay + +%files squash +%{dracutlibdir}/modules.d/99squash + +%files config-generic +%{dracutlibdir}/dracut.conf.d/02-generic-image.conf + +%files config-rescue +%{dracutlibdir}/dracut.conf.d/02-rescue.conf +%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install + +%triggerin network -- dracut-network < 049-83.git20200525 +echo '# Since rhel-8.3 dracut moved to use NetworkManager +# On existing installations we want to preserve the old scripts +add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf + +%changelog +* Mon Jan 31 2022 Pavel Valena - 049-201.git20220131 +- ci: introduce C8S based GHA CI +- ci: backport TEST-21-NFS-NM +- dracut.sh: fix early microcode detection logic +- fix(url-lib): make pre-pivot hook separetely per nfs mount +- fix(watchdog): replace return with echo +- fix(network): add errors and warnings when network interface +- dracut.sh: add check for invalid configuration files +- fips: removed false-positive 'FATAL: Module xxx not found' +- fix(shutdown): be robust against forced shutdown +- fix(fips): handle s390x OSTree systems + +* Mon Sep 20 2021 Lukas Nykryn - 049-191.git20210920 +- fix(install): extend hwcaps library handling to libraries + +* Wed Aug 11 2021 Lukas Nykryn - 049-190.git20210811 +- fix(lsinitrd): TMP_DIR doesn't exist in RHEL8 +- fix(squash): apply FIPS and libpthread workaround + +* Mon Aug 02 2021 Lukas Nykryn - 049-188.git20210802 +- dracut-functions: fix botched backport +- squash: unsquash the root image instead of mounting it on +- 99squash: fail early if can't install require modules in +- 99squash: Don't hardcode the squash sub directories +- 99squash: improve pre-requirements check +- Fixed some SUSE specific typos and outputs +- 99squash: simplify the code +- 99squash: Check require module earlier, and properly +- fix(99squash): use kernel config instead of modprobe to check +- kill bogus comment +- busybox: simplify listing of supported utilities +- fix: use find_binary +- fix: shellcheck for modules.d/99squash/setup-squash.sh +- fix: shellcheck for modules.d/99squash/clear-squash.sh +- fix: shellcheck for modules.d/99squash/module-setup.sh +- fix(squash): this module shouldn't depend on bash +- refactor(squash): move the post install scripts into the +- fix: revise squash module checks +- fix(squash): post install should be the last step before +- refactor(squash): move all setup code to init-squash.sh +- feat(squash): install and depmod modules seperately +- refactor(squash): don't record mount points in text file +- lsinitrd: list squash content as well +- refactor(squash): structure in a cleaner way +- feat(squash): use busybox for early setup if available +- feat: squash module follow --compress option +- perf: disable initrd compression when squash module is +- fix(squash): shellcheck for modules.d/99squash +- fix(squash): don't mount the mount points if already mounted +- feat(squash): install umount util +- fix(squash): create relative symlinks +- fix(dracut.sh): handle '-i' option to include files beginning +- fix(dracut.sh): handle symlinks appropriately while using +- fix(squash): keep ld cache under initdir +- dracut-functions: backport block_is_* functions +- fix(squash): fixes related to squash module rebase +- fix(squash): remove tailing '/' when installing ld.so.conf.d + +* Mon Jul 19 2021 Lukas Nykryn - 049-151.git20210719 +- Drop 51-dracut-rescue-postinst.sh entirely +- fix(fips): add dh and ecdh ciphers +- 35network-legacy: discard pointless RTNETLINK message +- 95fcoe: don't install if there is no FCoE hostonly devices +- 95nfs: set correct ownership and permissions for statd +- fix(dracut.sh): harden dracut against GZIP environment +- fix(multipath): stop multipath before udev db cleanup +- fix(dracut-functions): implement a cache for get_maj_min +- fix(dracut-functions): get_maj_min without +- fix(fcoe): rd.nofcoe=0 should disable fcoe +- fix(fcoe): rename rd.nofcoe to rd.fcoe +- fix(mdraid): remove offroot +- fix(mdraid): add grow continue service +- net-lib.sh: support infiniband network mac addresses +- 95nvmf: add nvmf-autoconnect script + +* Mon Apr 26 2021 Lukas Nykryn - 049-136.git20210426 +- Remove stratis module + +* Thu Jan 21 2021 Lukas Nykryn - 049-135.git20210121 +- 95fcoe: default rd.nofcoe to false + +* Thu Jan 14 2021 Lukas Nykryn - 049-134.git20210114 +- spec: dracut-network is happy with either NM or dhclient + +* Tue Jan 12 2021 Lukas Nykryn - 049-133.git20210112 +- 95fcoe: Fix startup when fcoe module is included +- Fix pre-trigger stage by replacing exit with return in + +* Thu Jan 07 2021 Lukas Nykryn - 049-131.git20210107 +- 00systemd: when putting systemd-vconsole-setup.service as a +- 51-dracut-rescue.install: Don't use BLS fragment shipped by + +* Thu Jan 07 2021 Lukas Nykryn - 049-129.git20210107 +- Add a --hostonly-nics option +- dracut-install: ignore bogus preload libs + +* Thu Jan 07 2021 Lukas Nykryn - 049-127.git20210107 +- match the whole string +- match simplified rd.zfcp format too +- base: hardcode rhel red +- 95iscsi: +- iscsi: fix error messages with iSCSI root +- 95nvmf: add module for NVMe-oF +- Write dns values passed by ip argument to ifcfg-* files +- dracut.sh: added help for --regenerate-all +- 35network-legacy: fix classless static route parsing +- network: fix glob matching ipv6 addresses +- dasd: only install /etc/dasd.conf if present +- 90multipath: install kpartx's 11-dm-parts.rules +- network/net-lib.sh: Configure all iBFT interfaces +- Change the order of NFS servers during the boot NFS server +- install: string_hash_func should not be fed with NULL +- Consider also drm_dev_register when looking for gpu driver +- fix graphics startup failure with the rhgb paramter in +- Configure the runner for team interfaces +- network-manager: set kernel hostname from the command line +- 95nvmf: add NVMe over TCP support +- 95fcoe: Add the rd.nofcoe option to disable the FCoE module +- 04watchdog: split the watchdog module install +- dracut.spec: include the 04watchdog-modules module +- 95fcoe: ensure needed modules are installed + +* Tue Dec 15 2020 Lukas Nykryn - 049-103.git20201215 +- dracut-systemd: create the initrd.target.wants directory + +* Mon Nov 30 2020 Lukas Nykryn - 049-102.git20201130 +- multipathd: fix the comparison + +* Mon Nov 30 2020 Lukas Nykryn - 049-101.git20201130 +- fix backport of 70b19acf + +* Fri Nov 20 2020 Lukas Nykryn - 049-100.git20201120 +- multipath: require kpartx binary +- Replace ln with systemctl +- multipath: add automatic configuration for multipath +- 98dracut-systemd: don't wait for root device if remote +- 90crypt: pull in remote-cryptsetup.target enablement + +* Tue Aug 04 2020 Lukas Nykryn - 049-95.git20200804 +- 90kernel-modules: add pci_hyperv + +* Thu Jul 09 2020 Lukas Nykryn - 049-94.git20200709 +- dracut.sh: Move the library workaround after squash +- dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL + +* Thu Jul 02 2020 Lukas Nykryn - 049-92.git20200702 +- install/dracut-install.c: install module dependencies of +- install: also install post weak dependencies of kernel + +* Thu Jul 02 2020 Lukas Nykryn - 049-90.git20200702 +- spec: don't use NM on existing installations + +* Thu Jun 25 2020 Lukas Nykryn - 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 - 049-86.git20200602 +- Do not require non-empty kernel cmdline + +* Wed May 27 2020 Lukas Nykryn - 049-85.git20200527 +- 99memstrack: hook script should not call exit +- Remove cleanup_trace_mem calls + +* Mon May 25 2020 Lukas Nykryn - 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 - 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 - 049-70.git20200228 +- network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic + +* Tue Feb 11 2020 Lukas Nykryn - 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 - 049-65.git20200205 +- added debug-shell to initrd + +* Thu Jan 23 2020 Harald Hoyer - 049-64.git20200123 +- network-legacy/ifup: nuke pid and lease files if dhclient failed +Resolves: rhbz#1787620 + +* Tue Jan 14 2020 Lukas Nykryn - 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 - 049-60.git20191129 +- 99squash: Only start the cleaner on switch-root +- net-lib: check if addr exists before checking for dad state +- always include sg module + +* Thu Oct 31 2019 Lukas Nykryn - 049-57.git20191031 +- various fixes to adapt to RHCOS and FCOS + +* Tue Oct 01 2019 Lukas Nykryn - 049-53.git20191001 +- apply patches to allow enablement of nm-initrd-generator + +* Fri Sep 06 2019 Lukas Nykryn - 049-27.git20190906 +- modules.d: fix udev rules detection of multipath devices + +* Tue Aug 06 2019 Lukas Nykryn - 049-26.git20190806 +- net-lib: fix typo $li -> $_li + +* Tue Aug 06 2019 Lukas Nykryn - 049-25.git20190806 +- 90kernel-modules-extra: don't resolve symlinks before instmod + +* Fri Aug 02 2019 Lukas Nykryn - 049-24.git20190802 +- 95fcoe: load 'libfcoe' module as a fallback +- 99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases +- dracut: let module handling function accept optional path option +- squash: also squash systemctl if switch-root is not needed +- squash: fix and simplify required_in_root +- squash: squash systemd binary and udevadm + +* Thu Jul 25 2019 Lukas Nykryn - 049-18.git20190725 +- dracut.spec: add 06rngd + +* Thu Jul 25 2019 Lukas Nykryn - 049-17.git20190725 +- rngd: new module running early during boot to help generating entropy when system's default entropy sources are poor (e.g. use of SSD disks or UEFI RNG not available) + +* Tue Jul 16 2019 Lukas Nykryn - 049-16.git20190716 +- 01fips: add cfb cipher + +* Mon Jul 08 2019 Lukas Nykryn - 049-15.git20190708 +- network: skip already enslaved interfaces + +* Wed Jun 26 2019 Lukas Nykryn - 049-14.git20190626 +- fips: ensure fs module for /boot is installed + +* Fri Jun 14 2019 Lukas Nykryn - 049-13.git20190614 +- fips: split loading the crypto modules and checking the kernel + +* Mon Jun 03 2019 Lukas Nykryn - 049-12.git20190603 +- 95iscsi: rd.iscsi.initiator should have priority over stored configuration +- net-lib: strstr is not for globs + +* Tue Jan 15 2019 Lukas Nykryn - 049-10.git20190115 +- 95iscsi: decouple iscsi from sysinit.target + +* Tue Oct 30 2018 Lukas Nykryn - 049-8.git20181030 +- dracut.install: call dracut with --force +- 99squash: Don't clean up squahfs on isolate + +* Mon Oct 15 2018 Lukas Nykryn - 049-5.git20181015 +- 40network: Don't include 40network by default + +* Tue Oct 09 2018 Lukas Nykryn - 049-4.git20181009 +- rebase to 049 + +* Tue Sep 04 2018 Lukas Nykryn - 048-37.git20180904 +- dmsquash-live/apply-live-updates: Test proper file link. + +* Mon Sep 03 2018 Dan Horák - 048-37.git20180831 +- apply the reflink patch + +* Wed Aug 29 2018 Lukas Nykryn - 048-36.git20180831 +- merge upstream master +- rever --reflink=auto usage + +* Tue Aug 14 2018 Lukas Nykryn - 048-34.git20180814 +- TEST-50-MULTINIC/test.sh: fixed server startup +- kernel-network-modules: add vlan kernel modules +- test: fixed KVERSION and qemu backwards compatiblity +- TEST-70-BONDBRIDGETEAMVLAN: load vlan kernel modules +- test: also output server.log on failure +- TEST-50-MULTINIC: s/--device/-device +- enable parallel test suite +- TEST-31-ISCSI-MULTI: use different port than TEST-30 +- load modules earlier for iscsi via dhcp root-path +- test/{TEST-50-MULTINIC,TEST-70-BONDBRIDGETEAMVLAN}: use qemu-3.0 syntax +- multipath-shutdown: fix shell syntax +- dracut.spec: remove warpclock from z-series, not the other way round +- iscsi: remove $() where it does not fit +- mdraid: better handling of various UUID formats +- dracut-functions: fix the word splitting +- Add gpio and pinctrl drivers for arm*/aarch64 +- mdraid/parse-md.sh: also accept rd.md.uuid with ":" +- spec: sort modules +- spec: warpclock is not available on s390 or s390x +- dracut.spec: Remove needless use of defattr +- dracut.spec: add 00warpclock dracut module +- Bring back 51-dracut-rescue-postinst.sh +- lsinitrd: update help message and man page +- lsinitrd: optimize performance when handling multiple files +- lsinitrd: allow to only unpack certain files +- NEWS: forgot to update the latest version +- 00warpclock: Set correct timezone +- dracut-install: skip modules with empty path +- Record loaded kernel modules when hostonly mode is enabled +- modules.d/95fcoe/cleanup-fcoe.sh: chmod +x +- TEST-40-NBD: disable for now +- TEST-30-ISCSI: readd multiple target test + +* Wed Jul 11 2018 Lukas Nykryn - 048-1.1 +- return some old provides + +* Fri Jul 06 2018 Harald Hoyer - 048-1 +- version 048 + +* Fri Jun 22 2018 Adam Williamson - 047-34.git20180604.1 +- Test build with proposed fix for #1593028 + +* Mon Jun 04 2018 Harald Hoyer - 047-34.git20180604 +- git snapshot + +* Tue May 15 2018 Harald Hoyer - 047-32.git20180515 +- git snapshot + +* Mon Mar 05 2018 Harald Hoyer - 047-8 +- git snapshot + +* Tue Feb 27 2018 Javier Martinez Canillas - 047-2 +- Allow generating initramfs images on the /boot directory + +* Mon Feb 19 2018 Harald Hoyer - 047-1 +- version 047 + +* Wed Feb 07 2018 Fedora Release Engineering - 046-92.git20180118.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 18 2018 Harald Hoyer - 046-92 +- git snapshot + +* Fri Jan 05 2018 Harald Hoyer - 046-64 +- git snapshot + +* Fri Dec 01 2017 Harald Hoyer - 046-36 +- git snapshot + +* Wed Nov 29 2017 Harald Hoyer - 046-33 +- git snapshot + +* Thu Oct 12 2017 Peter Robinson 046-20 +- Add fix for some ARM SBCs + +* Tue Oct 10 2017 Harald Hoyer - 046-19 +- git snapshot + +* Thu Aug 24 2017 Harald Hoyer - 046-7 +- git snapshot + +* Fri Aug 11 2017 Harald Hoyer - 046-2 +- add support for dist-tag less build + +* Fri Aug 11 2017 Harald Hoyer - 046-1 +- version 046 + +* Mon Aug 7 2017 Peter Robinson 045-21.git20170515 +- Add upstream patches to fix a number of ARM devices with generic initrd + +* Wed Aug 02 2017 Fedora Release Engineering - 045-20.git20170515 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 045-19.git20170515 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 15 2017 Harald Hoyer - 045-18.git20170515 +- git snapshot + +* Wed Apr 12 2017 Peter Robinson 044-178 +- Add upstream patches needed for ARMv7/aarch64 fixes + +* Fri Feb 10 2017 Fedora Release Engineering - 044-177 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Dec 08 2016 Harald Hoyer - 044-176 +- git snapshot + +* Fri Aug 19 2016 Harald Hoyer - 044-117 +- git snapshot + +* Thu Aug 18 2016 Harald Hoyer - 044-109 +- git snapshot + +* Fri Aug 05 2016 Adam Williamson - 044-76 +- backport a single commit to fix RHBZ #1358416 (anaconda network init) + +* Tue Jun 07 2016 Harald Hoyer - 044-75 +- fix for systemd >= 230 +- git snapshot + +* Wed Feb 03 2016 Fedora Release Engineering - 044-18.git20160108 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 8 2016 Harald Hoyer - 044-17.git20160108 +- include more HID driver +- include machine info file +- fix network carrier detection +- fix nbd +- do not copy over lldpad state +- restorecon the final initramfs image + +* Tue Dec 1 2015 Harald Hoyer - 044-6.git20151201 +- fix for readonly /run on shutdown +- fix for the dmsquash-live module +Resolves: rhbz#1286866 + +* Wed Nov 25 2015 Harald Hoyer - 044-4.git20151127 +- fixes for the dmsquash-live module +- remove udev watch for raid members +- mode 0755 for the livenet generator +Resolves: rhbz#1285903 + +* Wed Nov 25 2015 Harald Hoyer - 044-1 +- version 044 + +* Mon Nov 16 2015 Harald Hoyer - 043-174.git20151116 +- git snapshot + +* Mon Nov 16 2015 Harald Hoyer - 043-173.git20151116 +- git snapshot + +* Fri Nov 13 2015 Harald Hoyer - 043-172.git20151113 +- git snapshot + +* Tue Aug 11 2015 Harald Hoyer 043-60.git20150811 +- fixed checkiso timeout +- fixed log output although quiet is set +- fixed qemu detection +- cleanup compressor handling + +* Wed Jul 22 2015 Harald Hoyer 043-40.git20150710.2 +- require "xz" to handle the kernel modules + +* Fri Jul 10 2015 Harald Hoyer 043-40.git20150710 +- git snapshot + +* Wed Jun 17 2015 Fedora Release Engineering - 043-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 15 2015 Harald Hoyer 043-1 +- version 043, now with the complete tarball + +* Thu Jun 11 2015 Harald Hoyer 042-1 +- version 042, the answer to life, the universe and everything + +* Thu Feb 19 2015 Harald Hoyer 041-10.git20150219 +- git snapshot + +* Sat Jan 31 2015 Harald Hoyer 041-1 +- version 041 + +* Thu Jan 08 2015 Harald Hoyer 040-83.git20150108 +- git snapshot + +* Fri Dec 19 2014 Harald Hoyer 040-78.git20141219 +- git snapshot + +* Mon Dec 08 2014 Harald Hoyer 040-30.git20141208 +- fixed dracut-shutdown + +* Thu Dec 04 2014 Harald Hoyer 040-29.git20141204 +- git snapshot + +* Tue Sep 30 2014 Zbigniew Jędrzejewski-Szmek - 038-36.git20140815 +- Allow media check to be cancelled (rhbz 1147941) + +* Fri Sep 26 2014 Josh Boyer - 038-35.git20140815 +- Enable early-microcode by default (rhbz 1083716) +- Fix changelog date + +* Tue Aug 19 2014 Harald Hoyer - 038-34.git20140815 +- git snapshot + +* Sat Aug 16 2014 Fedora Release Engineering - 038-31.git20140815 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Harald Hoyer 038-30.git20140815 +- git snapshot + +* Thu Jul 24 2014 Harald Hoyer 038-14.git20140724 +- fixed lvm modules issues +Resolves: rhbz#1118890 +- fixed vlan issues +- fixed prelink for FIPS +- new rd.route parameter +- more ARM modules + +* Fri Jul 11 2014 Tom Callaway - 038-2 +- fix license handling + +* Mon Jun 30 2014 Harald Hoyer 038-1 +- version 038 + +* Sat Jun 28 2014 Zbigniew Jędrzejewski-Szmek - 037-14.git20140628 +- Pull most bugfixy commits from current git +Resolves: rhbz#1112061 + +* Sat Jun 07 2014 Fedora Release Engineering - 037-13.git20140402 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 23 2014 Peter Robinson 037-12.git20140402 +- Fix achi/mmc/sdhci selection for non host based initrd + +* Thu Apr 17 2014 Adam Williamson - 037-11.git20140402 +- revert broken upstream change that causes RHBZ#1084766 + +* Wed Apr 02 2014 Harald Hoyer 037-10.git20140402 +- fixed fstab.sys with systemd +- DHCPv6 fixes +- dm-cache module now included +- FCoE fixes + +* Thu Mar 20 2014 Harald Hoyer 037-3.git20140320 +- fixed dracut-initramfs-restore with microcode + +* Thu Mar 20 2014 Harald Hoyer 037-1 +- version 037 + +* Thu Feb 06 2014 Harald Hoyer 036-16.git20140206 +- version 036 +- parse dns information on "ip=" command line arg +- preserve ownership of files, if root creates the initramfs +- parse ibft nameserver settings +- do not run dhcp twice on an interface +- try to not reload systemd + +* Wed Dec 18 2013 Harald Hoyer 034-74.git20131218 +- do not systemctl daemon-reload +- do iscsistart for iscsi_firmware even without network + +* Mon Dec 16 2013 Harald Hoyer 034-70.git20131216 +- fixed systemd password waiting +- split out fcoe uefi +- fixed lvm thin tools check + +* Thu Dec 05 2013 Harald Hoyer 034-62.git20131205 +- fixed PATH shortener +- also install /etc/system-fips in the initramfs +- nbd, do not fail in hostonly mode +- add ohci-pci to the list of hardcoded modules +- lvm: do not run pvscan for lvmetad +- network fixes +- skip crypt swaps with password files +- fixed i18n + +* Wed Oct 30 2013 Harald Hoyer 034-24.git20131030 +- fixed booting with rd.iscsi.firmware and without root= +- fips: include crct10dif_generic +- fixed missing modules in hostonly, which have no modalias +- moved dracut to /usr/sbin + +* Mon Oct 21 2013 Harald Hoyer 034-19.git20131021 +- Fixed LVM with thin provisioning +Resolves: rhbz#1013767 +Resolves: rhbz#1021083 + +* Fri Oct 18 2013 Harald Hoyer 034-18.git20131018 +- Fixed LVM with thin provisioning +Resolves: rhbz#1013767 +- fixed swap detection in host only mode + +* Fri Oct 11 2013 Kyle McMartin 034-8.git20131008 +- Force mmc_block and usb_storage into ARM initramfs. +Resolves: rhbz#1015234 + +* Tue Oct 08 2013 Harald Hoyer 034-7.git20131008 +- lvm: install thin utils for non-hostonly +- do not bail out, if kernel modules dir is missing +- dmsquash-live: add /dev/mapper/live-base +Resolves: rhbz#1016726 + +* Tue Oct 08 2013 Harald Hoyer 034-1 +- version 034 +- add option to turn on/off prelinking + --prelink, --noprelink + do_prelink=[yes|no] +- add ACPI table overriding +- do not log to syslog/kmsg/journal for UID != 0 +- lvm/mdraid: Fix LVM on MD activation +- bcache module removed (now in bcache-tools upstream) +- mdadm: also install configs from /etc/mdadm.conf.d +- fixes for mdadm-3.2.6+ +- fcoe: add FCoE UEFI boot device support +- rootfs-block: add support for the rootfallback= kernel cmdline option + +* Fri Sep 13 2013 Harald Hoyer 033-3.git20130913 +- do not dhcp members of team, bond, etc. +- harden against weird ppc kernel driver +Resolves: rhbz#1007891 + +* Thu Sep 12 2013 Harald Hoyer 033-1 +- do not cache the kernel cmdline +Resolves: rhbz#989944 +- fixed iso-scan +Resolves: rhbz#1005487 +- support blkid with bcache +Resolves: rhbz#1003207 +- ifup with dhcp, if no ip= params specified +Resolves: rhbz#989944 +- silently try to umount rpc_pipefs +Resolves: rhbz#999996 + +* Wed Sep 04 2013 Harald Hoyer 032-23.git20130904 +- fixed curl error with zero size kickstart file +Resolves: rhbz#989133 +- fixed systemd-cat failure, when systemd is installed + but not actually running +Resolves: rhbz#1002021 +- do not fail on empty dracut module directories +Resolves: rhbz#1003153 + +* Tue Aug 20 2013 Harald Hoyer 032-1 +- fix for kdump in FIPS mode +Resolves: rhbz#920931 +- fixed iBFT booting +Resolves: rhbz#989944 +- fixed FIPS mode initramfs creation +Resolves: rhbz#990250 +- shutdown: fixed killall_proc_mountpoint() +Resolves: rhbz#996549 +- disable lvmetad in the initramfs +Resolves: rhbz#996627 +- require dhclient + +* Mon Aug 12 2013 Harald Hoyer 031-29.git20130812 +- added missing "then" in initqueue + +* Mon Aug 12 2013 Harald Hoyer 031-28.git20130812 +- fixed typo in hostonly device recognition + +* Fri Aug 09 2013 Harald Hoyer 031-24.git20130809 +- fixed logging to journal + +* Fri Aug 09 2013 Harald Hoyer 031-23.git20130809 +- fixed lsinitrd + +* Fri Aug 09 2013 Harald Hoyer 031-22.git20130809 +- lsinitrd.sh: add old cpio signature +- dracut.sh: call find with -print0 and cpio with --null +- dracut.asc: small corrections +- systemd/dracut-initqueue.sh: continue to boot if finished failed +- dracut.sh/dracut-functions.sh: handle root on non-block device +- dracut-functions.sh: removed non dracut-install shell functions +- dracut-functions.sh: inst_multiple == dracut_install +- 51-dracut-rescue.install: fixed rescue image creation +- dracut.sh: do not strip in FIPS mode +Resolves: rhbz#990250 +- dracut.sh: check the value of --kver +- crypt: Fix typo--/etc/crypttab not /etc/cryptab +- network/net-lib.sh: fix ibft interface configuration +- iscsi/module-setup.sh: install some modules regardless of hostonly +- multipath: need_shutdown if multipath devices exist +Resolves: rhbz#994913 +- omit drivers fix + +* Thu Aug 01 2013 Harald Hoyer 031-7.git20130801 +- also install vt102 terminfo + +* Wed Jul 31 2013 Harald Hoyer 031-6.git20130731 +- cmssetup: fixed port for zfcp.conf +- lvm: call lvchange with --yes to boot from snapshots + +* Wed Jul 31 2013 Harald Hoyer 031-4.git20130731 +- remove action_on_fail kernel command line parameter + +* Wed Jul 31 2013 Harald Hoyer 031-3.git20130731 +- do not include adjtime and localtime in the initramfs +- write out vlan configs + +* Wed Jul 31 2013 Harald Hoyer 031-1 +- do not include the resume dracut module in hostonly mode, + if no swap is present +- don't warn twice about omitted modules +- use systemd-cat for logging on systemd systems, if logfile is unset +- fixed PARTUUID parsing +- support kernel module signing keys +- do not install the usrmount dracut module in hostonly mode, + if /sbin/init does not live in /usr +- add debian udev rule files +- add support for bcache +- network: handle bootif style interfaces + e.g. ip=77-77-6f-6f-64-73:dhcp +- add support for kmod static devnodes +- add vlan support for iBFT + +* Wed Jul 24 2013 Kyle McMartin 030-2 +- Add ehci-tegra.ko to initramfs to allow rawhide tegra based platforms + to boot off USB disks. + +* Wed Jul 17 2013 Harald Hoyer 030-1 +- support new persistent network interface names +- fix findmnt calls, prevents hang on stale NFS mounts +- add systemd.slice and slice.target units +- major shell cleanup +- support root=PARTLABEL= and root=PARTUUID= +- terminfo: only install l/linux v/vt100 and v/vt220 +- unset all LC_* and LANG, 10% faster +- fixed dependency loop for dracut-cmdline.service +- do not wait_for_dev for the root devices +- do not wait_for_dev for devices, if dracut-initqueue is not needed +- support early microcode loading with --early-microcode +- dmraid, let dmraid setup its own partitions +- sosreport renamed to rdsosreport + +* Fri Jun 14 2013 Harald Hoyer 029-1 +- wait for IPv6 auto configuration +Resolves: rhbz#973719 +- i18n: make the default font configurable +- systemd/dracut-pre-pivot.service: also execute for cleanup hooks or rd.break +- add dracut-shutdown.service.8 manpage +- lvm: redirect error message of lvs to /dev/null +Resolves: rhbz#921235 + +* Wed Jun 12 2013 Harald Hoyer 028-1 +- lvm: fixed "thin" recognition +Resolves: rhbz#921235 +- install libs also from one dir above + fixes booting power6 generated initramfs on power7 +- setup correct system time and time zone in initrd +- cms fixups +Resolves: rhbz#970982 rhbz#971025 rhbz#825199 +- iso-scan/filename fixes +Resolves: rhbz#972337 +- add udev rules for persistent network naming +Resolves: rhbz#972662 + +* Tue Jun 04 2013 Dennis Gilmore 027-82.git20130531 +- add patch to include panel-tfp410 module on arm systems + +* Fri May 31 2013 Harald Hoyer 027-81.git20130531 +- fix btrfs mount flags for /usr +- degrade message about missing tools for stripping +Resolves: rhbz#958519 +- set environment vars DRACUT_SYSTEMD, NEWROOT in service file +Resolves: rhbz#963159 +- don't add volatile swap partitions to host_devs +- add libssl.so.10 to make kdump work with fips mode +- readd selinux dracut module for kdump +- url-lib/url-lib.sh: turn off curl globbing +Resolves: rhbz#907497 +- include btrfs-zero-log in the initramfs +Resolves: rhbz#963257 +- proper NAME the network interfaces +Resolves: rhbz#965842 +- install default font latarcyrheb-sun16 +Resolves: rhbz#927564 +- optionally install /etc/pcmcia/config.opts +Resolves: rhbz#920076 +- fix ONBOOT for slaves, set TYPE=Bond for bonding +Resolves: rhbz#919001 +- add nvme kernel module +Resolves: rhbz#910734 +- add xfs_metadump +- selinux: load_policy script fix +- add hid-hyperv and hv-vmbus kernel modules +- add parameter rd.live.squashimg +Resolves: rhbz#789036 rhbz#782108 +- wait for all required interfaces if "rd.neednet=1" +Resolves: rhbz#801829 +- lvm: add tools for thin provisioning +Resolves: rhbz#921235 +- ifcfg/write-ifcfg.sh: fixed ifcfg file generation +- do not wait for mpath* devices +Resolves: rhbz#969068 + +* Wed May 22 2013 Adam Williamson 027-46.git20130430 +- don't specify "p" as a separator for dmraid +Resolves: rhbz#966162 + +* Tue Apr 30 2013 Harald Hoyer 027-45.git20130430 +- fixed fips mode more +Resolves: rhbz#956521 + +* Thu Apr 25 2013 Harald Hoyer 027-39.git20130425 +- fix shutdown, if /dev/console is not writeable +- fixed fips mode +Resolves: rhbz#956521 + +* Thu Apr 18 2013 Harald Hoyer 027-36.git20130418 +- fix initramfs creation on noexec tmpdir +Resolves: rhbz#953426 +- more options for lsinitrd +- bash completion for lsinitrd +- do not output debug information on initramfs creation, if rd.debug is + on the kernel command line +- drop requirement on 'file', lsinitrd can find the magic on its own + +* Mon Apr 15 2013 Harald Hoyer 027-26.git20130415 +- do not call plymouth with full path +- include systemd-random-seed-load.service +- fix ca-bundle.crt for ssl curl +Resolves: rhbz#950770 +- add support for "iso-scan/filename" kernel parameter + +* Wed Apr 10 2013 Harald Hoyer 027-19.git20130410 +- also handle UUID= entries in crypttab in host-only mode +Resolves:rhbz#919752 + +* Tue Apr 09 2013 Harald Hoyer 027-17.git20130409 +- only include needed /etc/crypttab entries +Resolves:rhbz#919752 +- add support for bridge over team and vlan +- support multiple bonding interfaces +- add "action_on_fail=" kernel command line parameter +- add support for bridge over a vlan tagged interface + +* Fri Apr 05 2013 Harald Hoyer 027-10.git20130405 +- fix crypto password timeout on the dracut side + +* Tue Mar 26 2013 Harald Hoyer 027-1 +- version 027 + +* Wed Mar 20 2013 Harald Hoyer 026-72.git20130320 +- fix rescue image naming +Resolves: rhbz#923439 +- turn off host-only mode if essential system filesystems not mounted +- turn off host-only mode if udev database is not accessible + +* Tue Mar 19 2013 Harald Hoyer 026-62.git20130319 +- fix dracut service ordering +Resolves: rhbz#922991 + +* Mon Mar 18 2013 Harald Hoyer 026-56.git20130318 +- don't fail hard on kernel modules install +Resolves: rhbz#922565 + +* Mon Mar 18 2013 Harald Hoyer 026-55.git20130318 +- install all host filesystem drivers +Resolves: rhbz#922565 + +* Sat Mar 16 2013 Harald Hoyer 026-54.git20130316 +- fix for squashfs +Resolves: rhbz#922248 +- documentation fixes +- sosreport, mkdir /run/initramfs + +* Fri Mar 15 2013 Harald Hoyer 026-48.git20130315 +- use new initrd.target from systemd +- fixed rescue generation + +* Wed Mar 13 2013 Harald Hoyer 026-33.git20130313 +- add module-load.d modules to the initramfs +- add sysctl.d to the initramfs +- optimize plymouth module for systemd mode +- add new dracut parameter "--regenerate-all" +- add new dracut parameter "--noimageifnotneeded" +- shutdown: mount move /run /sys /dev /proc out of /oldroot + before pre-shutdown +- add bash completion for dracut + +* Wed Mar 13 2013 Harald Hoyer 026-19.git20130313 +- fix switch-root and local-fs.target problem +- add norescue and nohostonly subpackages + +* Mon Mar 11 2013 Harald Hoyer 026-15.git20130311 +- update to recent git + +* Fri Mar 08 2013 Harald Hoyer 026-1 +- version 026 + +* Mon Feb 11 2013 Harald Hoyer 025-35.git20130211 +- update to recent git + +* Wed Jan 23 2013 Harald Hoyer 025-1 +- version 025 + +* Tue Aug 21 2012 Harald Hoyer 023-13.git20120821 +- reintroduce rd.neednet, which reenables anaconda networking +- fix some dracut-install corner cases +- fix FIPS for /boot not on extra partition + +* Wed Aug 01 2012 Dennis Gilmore - 023-2 +- add patch to include omap_hsmmc for arm + +* Wed Aug 01 2012 Harald Hoyer 023-1 +- version 023 + +* Mon Jul 30 2012 Harald Hoyer 022-99.git20120730 +- removed install of missing finished-ask-password.sh + +* Mon Jul 30 2012 Harald Hoyer 022-97.git20120730 +- moved crypt setup to systemd units + +* Fri Jul 27 2012 Harald Hoyer 022-63.git20120727 +- fixed dracut-install bug if /var/tmp contains a symlink +- fixed some partx issues + +* Mon Jul 23 2012 Harald Hoyer 022-5.git20120723 +- dracut.8: added more documentation about executing dracut + +* Fri Jul 20 2012 Harald Hoyer 022-2.git20120720 +- fixed some race condition for resume from hibernation + +* Fri Jul 20 2012 Harald Hoyer 022-1 +- version 022 +- host-only kernel modules fix + +* Fri Jul 20 2012 Harald Hoyer 021-1 +- version 21 +- systemd in the initramfs reenabled +- new option "--kver" + +* Wed Jul 18 2012 Fedora Release Engineering - 020-97.git20120717 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 17 2012 Harald Hoyer 020-96.git20120717 +- disabled systemd in the initramfs, until it works correctly + +* Wed Jul 11 2012 Harald Hoyer 020-84.git20120711 +- add back "--force" to switch-root, otherwise systemd umounts /run + +* Wed Jul 11 2012 Harald Hoyer 020-83.git20120711 +- more systemd journal fixes +- nfs module fix +- install also /lib/modprobe.d/* +- fixed dracut-shutdown service +- safeguards for dracut-install +- for --include also copy symlinks + +* Tue Jul 10 2012 Harald Hoyer 020-72.git20120710 +- stop journal rather than restart +- copy over dracut services to /run/systemd/system + +* Tue Jul 10 2012 Harald Hoyer 020-70.git20120710 +- more systemd unit fixups +- restart systemd-journald in switch-root post +- fixed dracut-install loader ldd error message + +* Mon Jul 09 2012 Harald Hoyer 020-64.git20120709 +- fixed plymouth install +- fixed resume +- fixed dhcp +- no dracut systemd services installed in the system + +* Mon Jul 09 2012 Harald Hoyer 020-57.git20120709 +- more fixups for systemd-udevd unit renaming + +* Mon Jul 09 2012 Harald Hoyer 020-55.git20120709 +- require systemd >= 186 +- more fixups for systemd-udevd unit renaming + +* Mon Jul 09 2012 Harald Hoyer 020-52.git20120709 +- fixed prefix in 01-dist.conf + +* Fri Jul 06 2012 Harald Hoyer 020-51.git20120706 +- cope with systemd-udevd unit renaming +- fixed network renaming +- removed dash module + +* Mon Jul 02 2012 Harald Hoyer 020-22.git20120702 +- fixed kernel modules install + +* Mon Jul 02 2012 Harald Hoyer 020-21.git20120702 +- moved /usr/bin/dracut-install to /usr/lib +- more speedups + +* Fri Jun 29 2012 Harald Hoyer 020-1 +- version 020 +- new /usr/bin/dracut-install tool +- major speedup of the image creation + +* Mon Jun 25 2012 Harald Hoyer 019-92.git20120625 +- support vlan tagged binding +- speedup initramfs emergency service +- speedup image creation +- fix installkernel() return codes +Resolves: rhbz#833256 +- add qemu and qemu-net modules to add qemu drivers even in host-only +- speedup btrfs and xfs fsck (nop) +- no more mknod in the initramfs (fixes plymouth on s390) + +* Thu Jun 21 2012 Harald Hoyer 019-62.git20120621 +- do not require pkg-config for systemd +- i18n fixes +- less systemd services in the initramfs + +* Thu Jun 21 2012 Harald Hoyer 019-57.git20120620 +- systemd is now the default init in the initramfs + +* Mon Jun 18 2012 Harald Hoyer 019-40.git20120618 +- new upstream version + +* Mon Jun 11 2012 Harald Hoyer 019-16.git20120611 +- new upstream version + +* Tue Jun 05 2012 Dennis Gilmore 019-2 +- include omapdrm with the arm modules + +* Mon Jun 04 2012 Harald Hoyer 019-1 +- version 019-1 + +* Tue May 22 2012 Harald Hoyer 018-74.git20120522 +- new upstream version + +* Thu May 17 2012 Dennis Gilmore 018-53.git20120509 +- add patch to pull in arm storage modules + +* Wed May 09 2012 Harald Hoyer 018-52.git20120509 +- new upstream version + +* Fri May 04 2012 Harald Hoyer 018-40.git20120504 +- new upstream version + +* Wed Apr 25 2012 Harald Hoyer 018-37.git20120425.1 +- fixup for multipath and iscsi host-only detection + +* Wed Apr 25 2012 Harald Hoyer 018-37.git20120425 +- fixed udevd location + +* Tue Apr 24 2012 Harald Hoyer 018-33.git20120424 +- new upstream version + +* Thu Apr 19 2012 Harald Hoyer 018-25.git20120419 +- fixed network for non-network root (like installer media) + +* Wed Apr 18 2012 Harald Hoyer 018-22.git20120418 +- new upstream version + +* Mon Apr 16 2012 Harald Hoyer 018-12.git20120416 +- new upstream version, which fixes various anaconda loader issues + +* Thu Apr 05 2012 Harald Hoyer 018-1 +- version 018 + +* Thu Mar 22 2012 Harald Hoyer 017-62.git20120322 +- fixed /run prefix copying + +* Wed Mar 21 2012 Harald Hoyer 017-59.git20120321 +- new upstream version, which fixes various anaconda loader issues + +* Mon Mar 12 2012 Harald Hoyer 017-43.git20120312 +- live image: fixed image uncompression +- live updates for livenet + +* Thu Mar 08 2012 Harald Hoyer 017-40.git20120308 +- add s390 ctcm network kernel module + +* Thu Mar 08 2012 Harald Hoyer 017-39.git20120308 +- kill dhclient silently +- cleanup and fix network config writeout to /run/initramfs/state +Resolves: rhbz#799989 +- various cleanups + +* Fri Mar 02 2012 Harald Hoyer 017-22.git20120302 +- nfs path fixes for live image over nfs + root=live:nfs://10.10.10.10:/srv/all/install.img ip=dhcp rd.neednet + +* Thu Mar 01 2012 Harald Hoyer 017-19.git20120301 +- fixed include of some kernel modules + +* Wed Feb 29 2012 Harald Hoyer 017-17.git20120229 +- update to latest git +- fixes for convertfs (/usr-move) + +* Fri Feb 24 2012 Harald Hoyer 017-1 +- version 017 + +* Fri Feb 17 2012 Harald Hoyer 016-9.git20120217 +- update to latest git + +* Wed Feb 15 2012 Harald Hoyer 016-1 +- version 016 + +* Mon Feb 13 2012 Harald Hoyer 015-9.git20120213 +- update to latest git + +* Sun Feb 12 2012 Kay Sievers - 015-9.git20120210 +- fix dependency loop in systemd service files + +* Fri Feb 10 2012 Harald Hoyer 015-8.git20120210 +- update to latest git + +* Thu Feb 09 2012 Harald Hoyer 015-7.git20120209 +- update to latest git + +* Thu Feb 09 2012 Harald Hoyer 015-4.git20120209 +- update to latest git + +* Wed Feb 08 2012 Harald Hoyer 015-3.git20120208 +- update to latest git + +* Tue Feb 07 2012 Harald Hoyer 015-1 +- version 015 + +* Thu Feb 02 2012 Harald Hoyer 014-81.git20120202 +- update to latest git + +* Thu Feb 02 2012 Harald Hoyer 014-80.git20120202 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-77.git20120126.1 +- rebuild for rawhide + +* Thu Jan 26 2012 Harald Hoyer 014-77.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-76.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-75.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-74.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-73.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-72.git20120126 +- update to latest git + +* Mon Jan 23 2012 Harald Hoyer 014-65.git20120123 +- update to latest git + +* Mon Jan 23 2012 Harald Hoyer 014-61.git20120123 +- update to latest git + +* Tue Jan 17 2012 Harald Hoyer 014-38.git20120117 +- update to latest git + +* Fri Jan 13 2012 Fedora Release Engineering - 014-10.git20111215 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Dec 15 2011 Harald Hoyer 014-9.git20111215 +- update to latest git +- lots of patch changes + +* Fri Oct 21 2011 Harald Hoyer 013-100.git20111021 +- update to latest git + +* Thu Oct 20 2011 Harald Hoyer 013-93.git20111020 +- update to latest git + +* Wed Oct 19 2011 Harald Hoyer 013-85.git20111019 +- update to latest git + +* Tue Oct 04 2011 Harald Hoyer 013-15 +- fixed mdraid container handling +Resolves: rhbz#743240 + +* Thu Sep 22 2011 Harald Hoyer 013-13 +- fixed mdraid issues +- fixed btrfsck +Resolves: rhbz#735602 + +* Wed Sep 21 2011 Harald Hoyer 013-12 +- removed patch backup files +- reintroduced /dev/live + +* Tue Sep 20 2011 Harald Hoyer 013-11 +- move mounting of securitfs to a seperate module +Resolves: rhbz#737140 + +* Tue Sep 20 2011 Harald Hoyer 013-10 +- mount securitfs with the correct source +Resolves: rhbz#737140 + +* Tue Sep 20 2011 Harald Hoyer 013-9 +- do not carry over initramfs udev rules +Resolves: rhbz#734096 + +* Fri Sep 02 2011 Harald Hoyer 013-8 +- hopefully fixed one part of a loop/udev and loop/mount race +Resolves: rhbz#735199 + +* Wed Aug 31 2011 Harald Hoyer 013-7 +- add /lib/udev/input_id to the initramfs +- fix hmac install + +* Tue Aug 30 2011 Harald Hoyer 013-6 +- fixed environment passing to real init +Resolves: rhbz#733674 +- fixed lvm on md + +* Mon Aug 29 2011 Harald Hoyer 013-5 +- fixed rhel/fedora version checks + +* Wed Aug 17 2011 Harald Hoyer 013-4 +- fixed crash with livenet installed + +* Wed Aug 17 2011 Harald Hoyer 013-3 +- fixed live iso mounting +Resolves: rhbz#730579 + +* Fri Aug 12 2011 Harald Hoyer 013-1 +- fixed symlink creation for lorax + +* Wed Aug 10 2011 Harald Hoyer 011-41.git20110810 +- fixed getargs() for empty args + +* Wed Aug 10 2011 Harald Hoyer 011-40.git20110810 +- fixed symbolic link creation in the initramfs +Resolves: rhbz#728863 + +* Wed Jul 20 2011 Harald Hoyer 011-15.git20110720 +- "eject" is optional now +- refined shutdown procedure + +* Mon Jul 18 2011 Harald Hoyer 011-1 +- version 011 + +* Fri May 20 2011 Harald Hoyer 011-0.1 +- git snapshot of pre-version 011 + +* Fri Apr 01 2011 Harald Hoyer 010-1 +- version 010 + +* Thu Mar 31 2011 Harald Hoyer 009-5 +- fixed PATH and kmsg logging + +* Thu Mar 31 2011 Harald Hoyer 009-4 +- fixed dmsquash rule generation +- fixed fips boot arg parsing +- fixed plymouth pid generation + +* Wed Mar 30 2011 Harald Hoyer 009-3 +- fixed dhcp +- added /lib/firmware/updates to firmware directories +- fixed LiveCD /dev/.initramfs fallback +- fixed cdrom polling +- dropped net-tools dependency + +* Tue Mar 29 2011 Harald Hoyer 009-2 +- fixed empty output file argument handling: + "dracut '' " + +* Mon Mar 28 2011 Harald Hoyer 009-1 +- version 009 + +* Thu Mar 17 2011 Harald Hoyer 009-0.1 +- version 009 prerelease + +* Tue Feb 22 2011 Harald Hoyer 008-7 +- fixed lvm version parsing + +* Tue Feb 22 2011 Harald Hoyer 008-6 +- fixed lvm version parsing + +* Mon Feb 21 2011 Harald Hoyer 008-5 +- fixed i18n unicode setting +- set cdrom in kernel polling + +* Fri Feb 18 2011 Harald Hoyer 008-4 +- readded dist tag + +* Fri Feb 18 2011 Harald Hoyer 008-3 +- fixed i18n +- turned off selinux by default + +* Wed Feb 09 2011 Harald Hoyer 008-2 +- do not write dracut.log to /tmp under any circumstances +- touch /dev/.systemd/plymouth after plymouth started + +* Tue Feb 08 2011 Fedora Release Engineering - 008-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Feb 02 2011 Harald Hoyer 008-1 +- version 008-1 + +* Mon Jan 17 2011 Harald Hoyer 008-0.11 +- removed "mount" requirement + +* Thu Nov 18 2010 Harald Hoyer - 008-0.10 +- dracut-008 pre git snapshot +- fixes /dev/dri permissions +Resolves: rhbz#626559 + +* Fri Nov 12 2010 Harald Hoyer 008-0.9 +- dracut-008 pre git snapshot +- fixes /dev/.udev permissions +Resolves: rhbz#651594 + +* Wed Nov 3 2010 Harald Hoyer - 008-0.8 +- fixed fsck -a option + +* Fri Oct 29 2010 Harald Hoyer 008-0.7 +- added fsck to initramfs + +* Fri Oct 29 2010 Harald Hoyer 008-0.6 +- fixed rpm macros + +* Fri Oct 29 2010 Harald Hoyer 008-0.5 +- dracut-008 pre git snapshot + +* Mon Aug 09 2010 Harald Hoyer 007-1 +- version 007 + +* Thu Jun 17 2010 Harald Hoyer 006-1 +- version 006 + +* Fri Jun 11 2010 Harald Hoyer +- Remove requirements, which are not really needed +Resolves: rhbz#598509 +- fixed copy of network config to /dev/.initramfs/ (patch 146) +Resolves: rhbz#594649 +- more password beauty (patch 142) +Resolves: rhbz#561092 +- support multiple iSCSI disks (patch 143) +Resolves: rbhz#580190 +- fixed selinux=0 (patch 130) +Resolves: rhbz#593080 +- add support for booting LVM snapshot root volume (patch 145) +Resolves: rbhz#602723 +- remove hardware field from BOOTIF= (patch 148) +Resolves: rhbz#599593 +- add aes kernel modules and fix crypt handling (patch 137, patch 140 and patch 147) +Resolves: rhbz#600170 + +* Thu May 27 2010 Harald Hoyer +- fixed Requirements +- fixed autoip6 +Resolves: rhbz#538388 +- fixed multipath +Resolves: rhbz#595719 + +* Thu May 06 2010 Harald Hoyer +- only display short password messages +Resolves: rhbz#561092 + +* Thu May 06 2010 Harald Hoyer +- fixed dracut manpages +Resolves: rhbz#589109 +- use ccw-init and ccw rules from s390utils +Resolves: rhbz#533494 +- fixed fcoe +Resolves: rhbz#486244 +- various other bugfixes seen in Fedora + +* Tue Apr 20 2010 Harald Hoyer +- fixed network with multiple nics +- fixed nfsidmap paths +- do not run blkid on non active container raids +- fixed cdrom polling mechanism +- update to latest git + +* Thu Apr 15 2010 Harald Hoyer +- fixed dracut manpages +- dmraid parse different error messages +- add cdrom polling mechanism for slow cdroms +- add module btrfs +- teach dmsquash live-root to use rootflags +- trigger udev with action=add +- fixed add_drivers handling +- add sr_mod +- use pigz instead of gzip, if available + +* Thu Mar 25 2010 Harald Hoyer +- removed firmware requirements (rhbz#572634) +- add /etc/dracut.conf.d +- Resolves: rhbz#572634 + +* Fri Mar 19 2010 Harald Hoyer +- version 005 + +* Fri Mar 19 2010 Harald Hoyer +- fixed rpmlint errors (rhbz#570547) +- removed firmware package from dracut-kernel (rhbz#572634) +- add dcb support to dracut's FCoE support (rhbz#563794) +- force install some modules in hostonly mode (rhbz#573094) +- various other bugfixes +- Resolves: rhbz#570547, rhbz#572634, rhbz#563794, rhbz#573094 + +* Thu Feb 18 2010 Harald Hoyer 004-15 +- fixed "selinux=0" booting (rhbz#566376) +- fixed internal IFS handling +- Resolves: rhbz#566376 + +* Fri Jan 29 2010 Harald Hoyer 004-5 +- fixed firmware.sh bug (#559975 #559597) + +* Tue Jan 26 2010 Harald Hoyer 004-4 +- add multipath check + +* Tue Jan 26 2010 Harald Hoyer 004-3 +- fix selinux handling if .autorelabel is present +- Resolves: rhbz#557744 + +* Wed Jan 20 2010 Harald Hoyer 004-2 +- fix emergency_shell argument parsing +- Related: rhbz#543948 + +* Fri Jan 15 2010 Harald Hoyer 004-1 +- version 004 +- Resolves: rhbz#529339 rhbz#533494 rhbz#548550 +- Resolves: rhbz#548555 rhbz#553195 + +* Wed Jan 13 2010 Harald Hoyer 003-3 +- add Obsoletes of mkinitrd/nash/libbdevid-python +- Related: rhbz#543948 + +* Wed Jan 13 2010 Warren Togami 003-2 +- nbd is Fedora only + +* Fri Nov 27 2009 Harald Hoyer 003-1 +- version 003 + +* Mon Nov 23 2009 Harald Hoyer 002-26 +- add WITH_SWITCH_ROOT make flag +- add fips requirement conditional +- add more device mapper modules (bug #539656) + +* Fri Nov 20 2009 Dennis Gregorovic - 002-25.1 +- nss changes for Alpha 3 + +* Thu Nov 19 2009 Harald Hoyer 002-25 +- add more requirements for dracut-fips (bug #539257) + +* Tue Nov 17 2009 Harald Hoyer 002-24 +- put fips module in a subpackage (bug #537619) + +* Tue Nov 17 2009 Harald Hoyer 002-23 +- install xdr utils for multipath (bug #463458) + +* Thu Nov 12 2009 Harald Hoyer 002-22 +- add module 90multipath +- add module 01fips +- renamed module 95ccw to 95znet (bug #533833) +- crypt: ignore devices in /etc/crypttab (root is not in there) +- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833) +- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833) +- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750) +- dasd: use dasdconf.sh from s390utils (bug #533833) + +* Fri Nov 06 2009 Harald Hoyer 002-21 +- fix rd_DASD argument handling (bug #531720) +- Resolves: rhbz#531720 + +* Wed Nov 04 2009 Harald Hoyer 002-20 +- fix rd_DASD argument handling (bug #531720) +- Resolves: rhbz#531720 + +* Tue Nov 03 2009 Harald Hoyer 002-19 +- changed rd_DASD to rd_DASD_MOD (bug #531720) +- Resolves: rhbz#531720 + +* Tue Oct 27 2009 Harald Hoyer 002-18 +- renamed lvm/device-mapper udev rules according to upstream changes +- fixed dracut search path issue + +* Mon Oct 26 2009 Harald Hoyer 002-17 +- load dm_mod module (bug #530540) + +* Fri Oct 09 2009 Jesse Keating - 002-16 +- Upgrade plymouth to Requires(pre) to make it show up before kernel + +* Thu Oct 08 2009 Harald Hoyer 002-15 +- s390 ccw: s/layer1/layer2/g + +* Thu Oct 08 2009 Harald Hoyer 002-14 +- add multinic support +- add s390 zfcp support +- add s390 network support + +* Wed Oct 07 2009 Harald Hoyer 002-13 +- fixed init= handling +- kill loginit if "rdinitdebug" specified +- run dmsquash-live-root after udev has settled (bug #527514) + +* Tue Oct 06 2009 Harald Hoyer 002-12 +- add missing loginit helper +- corrected dracut manpage + +* Thu Oct 01 2009 Harald Hoyer 002-11 +- fixed dracut-gencmdline for root=UUID or LABEL + +* Thu Oct 01 2009 Harald Hoyer 002-10 +- do not destroy assembled raid arrays if mdadm.conf present +- mount /dev/shm +- let udevd not resolve group and user names +- preserve timestamps of tools on initramfs generation +- generate symlinks for binaries correctly +- moved network from udev to initqueue +- mount nfs3 with nfsvers=3 option and retry with nfsvers=2 +- fixed nbd initqueue-finished +- improved debug output: specifying "rdinitdebug" now logs + to dmesg, console and /init.log +- stop udev before killing it +- add ghost /var/log/dracut.log +- dmsquash: use info() and die() rather than echo +- strip kernel modules which have no x bit set +- redirect stdin, stdout, stderr all RW to /dev/console + so the user can use "less" to view /init.log and dmesg + +* Tue Sep 29 2009 Harald Hoyer 002-9 +- make install of new dm/lvm udev rules optionally +- correct dasd module typo + +* Fri Sep 25 2009 Warren Togami 002-8 +- revert back to dracut-002-5 tarball 845dd502 + lvm2 was reverted to pre-udev + +* Wed Sep 23 2009 Harald Hoyer 002-7 +- build with the correct tarball + +* Wed Sep 23 2009 Harald Hoyer 002-6 +- add new device mapper udev rules and dmeventd + bug 525319, 525015 + +* Wed Sep 23 2009 Warren Togami 002-5 +- Revert back to -3, Add umount back to initrd + This makes no functional difference to LiveCD. See Bug #525319 + +* Mon Sep 21 2009 Warren Togami 002-4 +- Fix LiveCD boot regression + +* Mon Sep 21 2009 Harald Hoyer 002-3 +- bail out if selinux policy could not be loaded and + selinux=0 not specified on kernel command line + (bug #524113) +- set finished criteria for dmsquash live images + +* Fri Sep 18 2009 Harald Hoyer 002-2 +- do not cleanup dmraids +- copy over lvm.conf + +* Thu Sep 17 2009 Harald Hoyer 002-1 +- version 002 +- set correct PATH +- workaround for broken mdmon implementation + +* Wed Sep 16 2009 Harald Hoyer 001-12 +- removed lvm/mdraid/dmraid lock files +- add missing ifname= files + +* Wed Sep 16 2009 Harald Hoyer 001-11 +- generate dracut-version during rpm build time + +* Tue Sep 15 2009 Harald Hoyer 001-10 +- add ifname= argument for persistent netdev names +- new /initqueue-finished to check if the main loop can be left +- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf + +* Wed Sep 09 2009 Harald Hoyer 001-9 +- added Requires: plymouth-scripts + +* Wed Sep 09 2009 Harald Hoyer 001-8 +- plymouth: use plymouth-populate-initrd +- add add_drivers for dracut and dracut.conf +- do not mount /proc and /selinux manually in selinux-load-policy + +* Wed Sep 09 2009 Harald Hoyer 001-7 +- add scsi_wait_scan to be sure everything was scanned + +* Tue Sep 08 2009 Harald Hoyer 001-6 +- fixed several problems with md raid containers +- fixed selinux policy loading + +* Tue Sep 08 2009 Harald Hoyer 001-5 +- patch does not honor file modes, fixed them manually + +* Mon Sep 07 2009 Harald Hoyer 001-4 +- fixed mdraid for IMSM + +* Mon Sep 07 2009 Harald Hoyer 001-3 +- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109) + +* Thu Sep 03 2009 Harald Hoyer 001-2 +- fixed missing grep for md +- reorder cleanup + +* Wed Sep 02 2009 Harald Hoyer 001-1 +- version 001 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Aug 14 2009 Harald Hoyer 0.9-1 +- version 0.9 + +* Thu Aug 06 2009 Harald Hoyer 0.8-1 +- version 0.8 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Jul 24 2009 Harald Hoyer 0.7-1 +- version 0.7 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Wed Jul 22 2009 Harald Hoyer 0.6-1 +- version 0.6 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Jul 17 2009 Harald Hoyer 0.5-1 +- version 0.5 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Sat Jul 04 2009 Harald Hoyer 0.4-1 +- version 0.4 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Thu Jul 02 2009 Harald Hoyer 0.3-1 +- version 0.3 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Wed Jul 01 2009 Harald Hoyer 0.2-1 +- version 0.2 + +* Fri Jun 19 2009 Harald Hoyer 0.1-1 +- first release + +* Thu Dec 18 2008 Jeremy Katz - 0.0-1 +- Initial build diff --git a/lgpl-2.1.txt b/lgpl-2.1.txt new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/lgpl-2.1.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/sources b/sources new file mode 100644 index 0000000..4ea463b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (dracut-049.tar.xz) = 40c9fde88bfb51152427dc3c2f00f71e43be92c7ee00ecf573e6b03aa16cd70da32f1024596245b09c778a2b006cfbb1073511c50504149a1f7a88d3fe4766c9