diff --git a/0007.patch b/0007.patch index f011552..a43a4f4 100644 --- a/0007.patch +++ b/0007.patch @@ -19,3 +19,4 @@ index 94592e6b..7de44735 100755 "=drivers/phy" \ "=drivers/power" \ "=drivers/regulator" \ + diff --git a/0008.patch b/0008.patch new file mode 100644 index 0000000..40f239e --- /dev/null +++ b/0008.patch @@ -0,0 +1,45 @@ +From f8c24964cdde2b8c1569ab33225108573682d3b7 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 9 Mar 2018 18:54:49 +0100 +Subject: [PATCH] 51-dracut-rescue.install: fix initramfs not generated in + /boot case + +Commit 5e574046e76e ("5?-dracut*.install: Allow scripts to install +the initramfs in /boot dir") added support to generate initramfs +images in the /boot directory and copy the respective BLS files. + +Unfortunately, it broke the rescue initramfs generation when it's +not installed on /boot due not checking for the correct condition. + +It checks for the 0-rescue sub-dir to exist, but this is created so +instead if the parent sub-dir exists has to be checked. Also, check +if the destination directory is /boot or not, instead if it exists. + +Signed-off-by: Javier Martinez Canillas +--- + 51-dracut-rescue.install | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install +index 3f07a698..679e94b1 100755 +--- a/51-dracut-rescue.install ++++ b/51-dracut-rescue.install +@@ -63,7 +63,7 @@ if ! [[ ${BOOT_OPTIONS[*]} ]]; then + exit 1 + fi + +-if [[ -d "$BOOT_DIR_ABS" ]]; then ++if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then + BOOT_DIR="/${MACHINE_ID}/0-rescue" + BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR} + LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf" +@@ -106,7 +106,7 @@ case "$COMMAND" in + ((ret+=$?)) + fi + +- if [[ -d "$BOOT_DIR" ]]; then ++ if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then + { + echo "title $PRETTY_NAME - Rescue Image" + echo "version $KERNEL_VERSION" + diff --git a/0009.patch b/0009.patch new file mode 100644 index 0000000..9528ce1 --- /dev/null +++ b/0009.patch @@ -0,0 +1,23 @@ +From ebfd53e1d9f3fabbf336086492f42be0a399ca51 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Thu, 15 Mar 2018 09:56:18 +0100 +Subject: [PATCH] lsinitrd.sh: fixed zstd file signature + +--- + lsinitrd.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsinitrd.sh b/lsinitrd.sh +index dbcc330f..80fbf922 100755 +--- a/lsinitrd.sh ++++ b/lsinitrd.sh +@@ -219,7 +219,7 @@ case $bin in + $'\x89'LZO$'\0'*) + CAT="lzop -d -c" + ;; +- $'0xFD2FB528'*) ++ $'\x28\xB5\x2F\xFD'*) + CAT="zstd -d -c" + ;; + *) + diff --git a/0010.patch b/0010.patch new file mode 100644 index 0000000..c27b81d --- /dev/null +++ b/0010.patch @@ -0,0 +1,25 @@ +From d23f32dd4b927f4ac6c6a67c2ff17d5c82a132c9 Mon Sep 17 00:00:00 2001 +From: Daniel Molkentin +Date: Fri, 16 Mar 2018 15:17:41 +0100 +Subject: [PATCH] 90kernel-modules: Include Intel Volume Management Device + support + +Reference: bsc#1079924 +--- + 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 7de44735..35b4af7f 100755 +--- a/modules.d/90kernel-modules/module-setup.sh ++++ b/modules.d/90kernel-modules/module-setup.sh +@@ -24,7 +24,7 @@ installkernel() { + yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \ + atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \ + virtio virtio_blk virtio_ring virtio_pci virtio_scsi \ +- "=drivers/pcmcia" =ide nvme ++ "=drivers/pcmcia" =ide nvme vmd + + if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then + # arm/aarch64 specific modules + diff --git a/0011.patch b/0011.patch new file mode 100644 index 0000000..10ec5ee --- /dev/null +++ b/0011.patch @@ -0,0 +1,271 @@ +From 0bb9a683d4df27427a0ab1d247b6dbb8343d820e Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 15 Mar 2018 16:57:47 +0100 +Subject: [PATCH] spec: drop support for legacy distributions + +rhel <= 7 has its own branch and there is no point in supporting the old +fedora +--- + 51-dracut-rescue-postinst.sh | 68 --------------------------------------- + dracut.spec | 75 +++++++------------------------------------- + 2 files changed, 12 insertions(+), 131 deletions(-) + +diff --git a/51-dracut-rescue-postinst.sh b/51-dracut-rescue-postinst.sh +deleted file mode 100755 +index 67f5b717..00000000 +--- a/51-dracut-rescue-postinst.sh ++++ /dev/null +@@ -1,68 +0,0 @@ +-#!/bin/bash +- +-export LANG=C +- +-KERNEL_VERSION="$1" +-KERNEL_IMAGE="$2" +- +-[[ -f /etc/os-release ]] && . /etc/os-release +- +-if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then +- systemd-machine-id-setup +-fi +- +-[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id +- +-[[ $MACHINE_ID ]] || exit 1 +-[[ -f $KERNEL_IMAGE ]] || exit 1 +- +-INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img" +-NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}" +- +-[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0 +- +-dropindirs_sort() +-{ +- suffix=$1; shift +- args=("$@") +- files=$( +- while (( $# > 0 )); do +- for i in ${1}/*${suffix}; do +- [[ -f $i ]] && echo ${i##*/} +- done +- shift +- done | sort -Vu +- ) +- +- for f in $files; do +- for d in "${args[@]}"; do +- if [[ -f "$d/$f" ]]; then +- echo "$d/$f" +- continue 2 +- fi +- done +- done +-} +- +-# source our config dir +-for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do +- [[ -e $f ]] && . "$f" +-done +- +-[[ $dracut_rescue_image != "yes" ]] && exit 0 +- +-if [[ ! -f $INITRDFILE ]]; then +- dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION" +- ((ret+=$?)) +-fi +- +-if [[ ! -f $NEW_KERNEL_IMAGE ]]; then +- cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE" +- ((ret+=$?)) +-fi +- +-new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID" +- +-((ret+=$?)) +- +-exit $ret +diff --git a/dracut.spec b/dracut.spec +index 725f89d6..9c2fc9d4 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -5,15 +5,6 @@ + # strip the automatically generated dep here and instead co-own the + # directory. + %global __requires_exclude pkg-config +- +-# Variables must be defined +-%define with_nbd 1 +- +-# nbd in Fedora only +-%if 0%{?rhel} >= 6 +-%define with_nbd 0 +-%endif +- + %define dist_free_release xxx + + Name: dracut +@@ -46,6 +37,7 @@ BuildRequires: gcc + + %if 0%{?fedora} || 0%{?rhel} + BuildRequires: pkgconfig ++BuildRequires: systemd + %endif + %if 0%{?fedora} + BuildRequires: bash-completion +@@ -63,31 +55,11 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt + BuildRequires: asciidoc + %endif + +-%if 0%{?fedora} > 12 || 0%{?rhel} +-# no "provides", because dracut does not offer +-# all functionality of the obsoleted packages +-Obsoletes: mkinitrd < 6.0.94 +-Obsoletes: mkinitrd-devel < 6.0.94 +-Obsoletes: nash < 6.0.94 +-Obsoletes: libbdevid-python < 6.0.94 +-%endif +- +-%if 0%{?fedora} > 16 || 0%{?rhel} > 6 +-BuildRequires: systemd-units +-%endif +- + %if 0%{?suse_version} > 9999 + Obsoletes: mkinitrd < 2.6.1 + Provides: mkinitrd = 2.6.1 + %endif + +-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 +@@ -99,33 +71,23 @@ Requires: sed + Requires: xz + Requires: gzip + +-%if 0%{?fedora} > 22 || 0%{?rhel} > 7 ++%if 0%{?fedora} || 0%{?rhel} + Recommends: grubby + Recommends: hardlink + Recommends: pigz + Recommends: kpartx +-%else +-Requires: hardlink +-Requires: gzip +-Requires: kpartx +-%endif +- +-%if 0%{?fedora} || 0%{?rhel} > 6 + Requires: util-linux >= 2.21 + Requires: systemd >= 219 + Requires: systemd-udev >= 219 + Requires: procps-ng +-Conflicts: grubby < 8.23 +-Conflicts: initscripts < 8.63-1 +-Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1 +-Conflicts: bcache-tools < 0-0.14.20130909git + %else ++Requires: hardlink ++Requires: gzip ++Requires: kpartx + Requires: udev > 166 + Requires: util-linux-ng >= 2.21 + %endif + +-Conflicts: mdadm < 3.2.6-14 +- + %description + dracut contains tools to create bootable initramfses for the Linux + kernel. Unlike previous implementations, dracut hard-codes as little +@@ -155,17 +117,12 @@ Provides: dracut-generic = %{version}-%{release} + This package requires everything which is needed to build a generic + all purpose initramfs with network support with dracut. + +-%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version} ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} + %package fips + Summary: dracut modules to build a dracut initramfs with an integrity check + Requires: %{name} = %{version}-%{release} + Requires: hmaccalc +-%if 0%{?rhel} > 5 +-# For Alpha 3, we want nss instead of nss-softokn + Requires: nss +-%else +-Requires: nss-softokn +-%endif + Requires: nss-softokn-freebl + + %description fips +@@ -250,9 +207,6 @@ cp %{SOURCE1} . + make %{?_smp_mflags} + + %install +-%if 0%{?fedora} || 0%{?rhel} +-rm -rf -- $RPM_BUILD_ROOT +-%endif + make %{?_smp_mflags} install \ + DESTDIR=$RPM_BUILD_ROOT \ + libdir=%{_prefix}/lib +@@ -314,16 +268,12 @@ install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir} + install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf + %endif + +-%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999 ++%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 + +-%if 0%{?fedora} || 0%{?rhel} > 6 +-# FIXME: remove after F19 +-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 +- ++%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 + %endif +@@ -342,7 +292,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %{_bindir}/dracut + %{_datadir}/bash-completion/completions/dracut + %{_datadir}/bash-completion/completions/lsinitrd +-%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 + %{_bindir}/mkinitrd + %{_bindir}/lsinitrd + %endif +@@ -368,7 +318,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %if %{with doc} + %{_mandir}/man8/dracut.8* + %{_mandir}/man8/*service.8* +-%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 + %{_mandir}/man8/mkinitrd.8* + %{_mandir}/man1/lsinitrd.1* + %endif +@@ -462,7 +412,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %{_unitdir}/initrd.target.wants/dracut-pre-udev.service + + %endif +-%if 0%{?fedora} || 0%{?rhel} > 6 ++%if 0%{?fedora} || 0%{?rhel} + %{_prefix}/lib/kernel/install.d/50-dracut.install + %endif + +@@ -527,9 +477,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %files config-rescue + %defattr(-,root,root,0755) + %{dracutlibdir}/dracut.conf.d/02-rescue.conf +-%if 0%{?fedora} || 0%{?rhel} > 6 ++%if 0%{?fedora} || 0%{?rhel} + %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install +-%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh + %endif + + %changelog + diff --git a/0012.patch b/0012.patch new file mode 100644 index 0000000..78fb97f --- /dev/null +++ b/0012.patch @@ -0,0 +1,109 @@ +From 1f50d5b86d3c9b5c212a9d2201483a1bddb19013 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Mon, 19 Mar 2018 13:02:24 +0100 +Subject: [PATCH] spec: merge fips subpackages to main package + +--- + dracut.spec | 53 ++++++++++++----------------------------------------- + 1 file changed, 12 insertions(+), 41 deletions(-) + +diff --git a/dracut.spec b/dracut.spec +index 9c2fc9d4..5a31a1f3 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -88,6 +88,12 @@ Requires: udev > 166 + Requires: util-linux-ng >= 2.21 + %endif + ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} ++Requires: hmaccalc ++Requires: nss ++Requires: nss-softokn-freebl ++%endif ++ + %description + dracut contains tools to create bootable initramfses for the Linux + kernel. Unlike previous implementations, dracut hard-codes as little +@@ -117,27 +123,6 @@ Provides: dracut-generic = %{version}-%{release} + This package requires everything which is needed to build a generic + all purpose initramfs with network support with dracut. + +-%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +-%package fips +-Summary: dracut modules to build a dracut initramfs with an integrity check +-Requires: %{name} = %{version}-%{release} +-Requires: hmaccalc +-Requires: nss +-Requires: nss-softokn-freebl +- +-%description fips +-This package requires everything which is needed to build an +-initramfs with dracut, which does an integrity check. +-%endif +- +-%package fips-aesni +-Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel +-Requires: %{name}-fips = %{version}-%{release} +- +-%description fips-aesni +-This package requires everything which is needed to build an +-initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module. +- + %package caps + Summary: dracut modules to build a dracut initramfs which drops capabilities + Requires: %{name} = %{version}-%{release} +@@ -264,10 +249,6 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse* + install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf + %endif + +-%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +-install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.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 +@@ -278,10 +259,6 @@ echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-i + echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf + %endif + +-%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +-> $RPM_BUILD_ROOT/etc/system-fips +-%endif +- + %files + %defattr(-,root,root,0755) + %if %{with doc} +@@ -416,6 +393,12 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %{_prefix}/lib/kernel/install.d/50-dracut.install + %endif + ++%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} ++%defattr(-,root,root,0755) ++%{dracutlibdir}/modules.d/01fips ++%{dracutlibdir}/modules.d/02fips-aesni ++%endif ++ + %files network + %defattr(-,root,root,0755) + %{dracutlibdir}/modules.d/02systemd-networkd +@@ -435,18 +418,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %endif + %{dracutlibdir}/modules.d/99uefi-lib + +-%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +-%files fips +-%defattr(-,root,root,0755) +-%{dracutlibdir}/modules.d/01fips +-%{dracutlibdir}/dracut.conf.d/40-fips.conf +-%config(missingok) /etc/system-fips +-%endif +- +-%files fips-aesni +-%defattr(-,root,root,0755) +-%{dracutlibdir}/modules.d/02fips-aesni +- + %files caps + %defattr(-,root,root,0755) + %{dracutlibdir}/modules.d/02caps + diff --git a/0013.patch b/0013.patch new file mode 100644 index 0000000..c43967c --- /dev/null +++ b/0013.patch @@ -0,0 +1,27 @@ +From 3c3b2cf093302b1441206cc690bd77c487e0b06d Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Thu, 22 Mar 2018 16:25:46 +0100 +Subject: [PATCH] spec: add missing obsoletes and provides for removed fips + subpackages + +--- + dracut.spec | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dracut.spec b/dracut.spec +index 5a31a1f3..3bfbd5c4 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -60,6 +60,11 @@ 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} ++ + Requires: bash >= 4 + Requires: coreutils + Requires: cpio + diff --git a/0014.patch b/0014.patch new file mode 100644 index 0000000..ddf5465 --- /dev/null +++ b/0014.patch @@ -0,0 +1,28 @@ +From fe6c7e0f06cde65effb3503a47c31ac39aceefb6 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Fri, 23 Mar 2018 11:52:27 +0300 +Subject: [PATCH] plymouth: fix detection of plymouth directory + +Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth +directorirs, so we should check the existance of plymouth-populate-initrd +script. + +Fixes: 421b46f8ae89cfe2b62e880a8a5079ee8c1b3aae +--- + modules.d/50plymouth/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh +index 5fbca8b0..b51913e8 100755 +--- a/modules.d/50plymouth/module-setup.sh ++++ b/modules.d/50plymouth/module-setup.sh +@@ -6,7 +6,7 @@ pkglib_dir() { + _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth" + fi + for _dir in $_dirs; do +- if [ -d $_dir ]; then ++ if [ -x $_dir/plymouth-populate-initrd ]; then + echo $_dir + return + fi + diff --git a/0015.patch b/0015.patch new file mode 100644 index 0000000..1b8103d --- /dev/null +++ b/0015.patch @@ -0,0 +1,22 @@ +From 2b5192c18d9190980a58abc665b1455c4ac8ab89 Mon Sep 17 00:00:00 2001 +From: Enno Boland +Date: Fri, 30 Mar 2018 15:46:04 +0200 +Subject: [PATCH] make failing installation of drm modules nonfatal + +--- + 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 382f51a9..eb3fc9d3 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 -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging" ++ dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging" + fi + } + diff --git a/0016.patch b/0016.patch new file mode 100644 index 0000000..bf947d5 --- /dev/null +++ b/0016.patch @@ -0,0 +1,33 @@ +From 65cfabf7a6778f513119eace254826feda718833 Mon Sep 17 00:00:00 2001 +From: Marcos Mello +Date: Fri, 6 Apr 2018 08:17:30 -0300 +Subject: [PATCH] fs-lib: remove redundancy + +--- + modules.d/99fs-lib/module-setup.sh | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index bd61838b..e614fe5f 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -20,9 +20,6 @@ echo_fs_helper() { + ext?) + echo -n " e2fsck " + ;; +- f2fs) +- echo -n " fsck.f2fs " +- ;; + jfs) + echo -n " jfs_fsck " + ;; +@@ -74,7 +71,7 @@ install() { + _helpers="\ + umount mount /sbin/fsck* + xfs_db xfs_check xfs_repair xfs_metadump +- e2fsck fsck.f2fs jfs_fsck reiserfsck btrfsck ++ e2fsck jfs_fsck reiserfsck btrfsck + " + if [[ $hostonly ]]; then + _helpers="umount mount " + diff --git a/0017.patch b/0017.patch new file mode 100644 index 0000000..fd4fdef --- /dev/null +++ b/0017.patch @@ -0,0 +1,27 @@ +From 384eeedd2d24b6953a8591524edde810ab880883 Mon Sep 17 00:00:00 2001 +From: Marcos Mello +Date: Fri, 6 Apr 2018 08:19:27 -0300 +Subject: [PATCH] fs-lib: install crc32c for ext4 + +EXT4 filesystems created with metadata_csum (enabled by default in mke2fs 1.44+) or ea_inode need crc32c. + +https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=d0b9e0a6aa7d6805338a43b4e372623352d8df09 +https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/ext4/super.c?h=v4.15.15#n3491 +--- + modules.d/99fs-lib/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index e614fe5f..b69277e2 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -38,7 +38,7 @@ echo_fs_helper() { + include_fs_helper_modules() { + local dev=$1 fs=$2 + case "$fs" in +- xfs|btrfs) ++ xfs|btrfs|ext4) + instmods crc32c + ;; + f2fs) + diff --git a/0018.patch b/0018.patch new file mode 100644 index 0000000..c191a66 --- /dev/null +++ b/0018.patch @@ -0,0 +1,48 @@ +From ccaf52901fbbdfedbf1764b88ef45be89419a2c8 Mon Sep 17 00:00:00 2001 +From: Marcos Mello +Date: Mon, 16 Apr 2018 07:59:09 -0300 +Subject: [PATCH] fs-lib: install crc32 in no-hostonly + +It is needed by f2fs. +--- + modules.d/99fs-lib/module-setup.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules.d/99fs-lib/module-setup.sh b/modules.d/99fs-lib/module-setup.sh +index b69277e2..68726614 100755 +--- a/modules.d/99fs-lib/module-setup.sh ++++ b/modules.d/99fs-lib/module-setup.sh +@@ -15,7 +15,7 @@ echo_fs_helper() { + local dev=$1 fs=$2 + case "$fs" in + xfs) +- echo -n " xfs_db xfs_repair xfs_check xfs_metadump" ++ echo -n " xfs_db xfs_repair xfs_check xfs_metadump " + ;; + ext?) + echo -n " e2fsck " +@@ -49,12 +49,12 @@ include_fs_helper_modules() { + + # called by dracut + installkernel() { +- # xfs and btrfs needs crc32c... ++ # xfs/btrfs/ext4 need crc32c, f2fs needs crc32 + if [[ $hostonly ]]; then + for_each_host_dev_fs include_fs_helper_modules + : + else +- instmods crc32c ++ instmods crc32c crc32 + fi + } + +@@ -81,7 +81,7 @@ install() { + _helpers="$fscks" + fi + +- if [[ "$_helpers" == *e2fsck* ]] && [ -e /etc/e2fsck.conf ]; then ++ if [[ "$_helpers" == *e2fsck* ]] && [ -e /etc/e2fsck.conf ]; then + inst_simple /etc/e2fsck.conf + fi + + diff --git a/0019.patch b/0019.patch new file mode 100644 index 0000000..27340ac --- /dev/null +++ b/0019.patch @@ -0,0 +1,23 @@ +From 654484b82bf6a3983244e76e4f38e9a2d080cb9b Mon Sep 17 00:00:00 2001 +From: tpgxyz +Date: Wed, 18 Apr 2018 20:57:33 +0200 +Subject: [PATCH] fix zstd magic header + +--- + modules.d/99img-lib/img-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/99img-lib/img-lib.sh b/modules.d/99img-lib/img-lib.sh +index 43785812..f4774153 100755 +--- a/modules.d/99img-lib/img-lib.sh ++++ b/modules.d/99img-lib/img-lib.sh +@@ -8,7 +8,7 @@ + # works with stdin if $1 is not set. + det_archive() { + # NOTE: echo -e works in ash and bash, but not dash +- local bz="BZh" xz="$(echo -e '\xfd7zXZ')" gz="$(echo -e '\x1f\x8b')" zs="$(echo -e '0xFD2FB528')" ++ local bz="BZh" xz="$(echo -e '\xfd7zXZ')" gz="$(echo -e '\x1f\x8b')" zs="$(echo -e '\x28\xB5\x2F\xFD')" + local headerblock="$(dd ${1:+if=$1} bs=262 count=1 2>/dev/null)" + case "$headerblock" in + $xz*) echo "xz" ;; + diff --git a/0020.patch b/0020.patch new file mode 100644 index 0000000..82b3d5a --- /dev/null +++ b/0020.patch @@ -0,0 +1,99 @@ +From c4f8329cc2b158c8d91ad9d9b7776b3970d3735a Mon Sep 17 00:00:00 2001 +From: Tony Asleson +Date: Mon, 2 Apr 2018 09:32:12 -0500 +Subject: [PATCH] Initial Stratis support + +Ref. https://github.com/stratis-storage + +Signed-off-by: Tony Asleson +--- + modules.d/90stratis/module-setup.sh | 34 +++++++++++++++++++++++++++++++ + modules.d/90stratis/stratisd-init.service | 15 ++++++++++++++ + modules.d/90stratis/stratisd-start.sh | 3 +++ + modules.d/90stratis/stratisd-stop.sh | 6 ++++++ + 4 files changed, 58 insertions(+) + +diff --git a/modules.d/90stratis/module-setup.sh b/modules.d/90stratis/module-setup.sh +new file mode 100755 +index 00000000..2787b63b +--- /dev/null ++++ b/modules.d/90stratis/module-setup.sh +@@ -0,0 +1,34 @@ ++#!/bin/bash ++ ++# called by dracut ++check() { ++ require_binaries stratisd-init thin_check thin_repair || 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 ++ ++ 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" ++ 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 +new file mode 100644 +index 00000000..318e8c27 +--- /dev/null ++++ b/modules.d/90stratis/stratisd-init.service +@@ -0,0 +1,15 @@ ++[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 +new file mode 100755 +index 00000000..afcd81fd +--- /dev/null ++++ b/modules.d/90stratis/stratisd-start.sh +@@ -0,0 +1,3 @@ ++#!/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 +new file mode 100755 +index 00000000..f394a843 +--- /dev/null ++++ b/modules.d/90stratis/stratisd-stop.sh +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++[ -f /lib/dracut-lib.sh ] && . /lib/dracut-lib.sh ++ ++pid=$(pidof stratisd-init) ++[ -n "$pid" ] && kill ${pid} + diff --git a/0021.patch b/0021.patch new file mode 100644 index 0000000..32312f0 --- /dev/null +++ b/0021.patch @@ -0,0 +1,27 @@ +From 3c8a69677b53562dcde0849f5497fd90e7bd358e Mon Sep 17 00:00:00 2001 +From: Hendrik Brueckner +Date: Wed, 25 Apr 2018 17:29:26 +0200 +Subject: [PATCH] crypt: correct s390 arch to include arch-specific crypto + modules + +Convert the s390x into s390 to also include s390-specific crypto +modules, for example, aes_s390 into the initramfs. + +Signed-off-by: Hendrik Brueckner +--- + modules.d/90crypt/module-setup.sh | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh +index b7232e98..1ec59096 100755 +--- a/modules.d/90crypt/module-setup.sh ++++ b/modules.d/90crypt/module-setup.sh +@@ -27,6 +27,7 @@ installkernel() { + hostonly="" instmods drbg + arch=$(arch) + [[ $arch == x86_64 ]] && arch=x86 ++ [[ $arch == s390x ]] && arch=s390 + instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto + } + + diff --git a/0022.patch b/0022.patch new file mode 100644 index 0000000..a0d3258 --- /dev/null +++ b/0022.patch @@ -0,0 +1,23 @@ +From cae0004dbe27fcedea8e762b2bf725f18fc6b151 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Fri, 27 Apr 2018 12:00:53 +0900 +Subject: [PATCH] spec: add stratis module + +Follow-up for c4f8329cc2b158c8d91ad9d9b7776b3970d3735a. +--- + dracut.spec | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dracut.spec b/dracut.spec +index 3bfbd5c4..d25adcb0 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -336,6 +336,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ + %{dracutlibdir}/modules.d/90mdraid + %{dracutlibdir}/modules.d/90multipath + %{dracutlibdir}/modules.d/90multipath-hostonly ++%{dracutlibdir}/modules.d/90stratis + %{dracutlibdir}/modules.d/90qemu + %{dracutlibdir}/modules.d/91crypt-gpg + %{dracutlibdir}/modules.d/91crypt-loop + diff --git a/0023.patch b/0023.patch new file mode 100644 index 0000000..bcf1435 --- /dev/null +++ b/0023.patch @@ -0,0 +1,28 @@ +From 3161dea8e116625ef5267fa745409a4949a36ecf Mon Sep 17 00:00:00 2001 +From: Michael McCracken +Date: Thu, 26 Apr 2018 23:27:17 -0700 +Subject: [PATCH] Update dracut.modules.7.asc + +Update manpage to reflect code behavior for `inst` with >2 args. + +Signed-off-by: Michael McCracken +--- + dracut.modules.7.asc | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dracut.modules.7.asc b/dracut.modules.7.asc +index 9c3f5475..69ac6c44 100644 +--- a/dracut.modules.7.asc ++++ b/dracut.modules.7.asc +@@ -255,7 +255,9 @@ not lead to an error. + ==== inst [] + + installs _one_ file either to the same place in the initramfs or to an +-optional . ++optional . inst with more than two arguments is treated the same as ++inst_multiple, all arguments are treated as files to install and none as ++install destinations. + + ==== inst_hook + + diff --git a/0024.patch b/0024.patch new file mode 100644 index 0000000..7709073 --- /dev/null +++ b/0024.patch @@ -0,0 +1,50 @@ +From 740e41b84380bfccf1dd93278f8b89f1403e89ec Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Wed, 2 May 2018 11:11:59 -0400 +Subject: [PATCH] Suppress sync/fsfreeze if not running on a live system + +It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, +and there's no reason to sync, and *definitely* no reason to fsfreeze. + +Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze +globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0 +--- + dracut.sh | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 8b0465df..f52d38ac 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1832,15 +1832,22 @@ fi + + command -v restorecon &>/dev/null && restorecon -- "$outfile" + +-if ! sync "$outfile" 2> /dev/null; then +- dinfo "dracut: sync operation on newly created initramfs $outfile failed" +- exit 1 +-fi ++# We sync/fsfreeze only if we're operating on a live booted system. ++# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, ++# and there's no reason to sync, and *definitely* no reason to fsfreeze. ++# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze ++# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0 ++if test -d /run/systemd/system; then ++ if ! sync "$outfile" 2> /dev/null; then ++ dinfo "dracut: sync operation on newly created initramfs $outfile failed" ++ exit 1 ++ fi + +-# use fsfreeze only if we're not writing to / +-if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then +- if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then +- dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" ++ # use fsfreeze only if we're not writing to / ++ if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then ++ if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then ++ dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" ++ fi + fi + fi + + diff --git a/0025.patch b/0025.patch new file mode 100644 index 0000000..a9ff03a --- /dev/null +++ b/0025.patch @@ -0,0 +1,23 @@ +From c9b5165daa666d5aec44a3ac6c56786b8df1b58f Mon Sep 17 00:00:00 2001 +From: Daniel Molkentin +Date: Fri, 27 Apr 2018 16:59:47 +0200 +Subject: [PATCH] 10i18n: Fix possible infinite recursion + +--- + modules.d/10i18n/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh +index 7320a919..08971814 100755 +--- a/modules.d/10i18n/module-setup.sh ++++ b/modules.d/10i18n/module-setup.sh +@@ -45,7 +45,7 @@ install() { + + for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do + for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do +- findkeymap $FN ++ strstr "$KEYMAPS" "$FN" || findkeymap $FN + done + done + done + diff --git a/0026.patch b/0026.patch new file mode 100644 index 0000000..3de991a --- /dev/null +++ b/0026.patch @@ -0,0 +1,23 @@ +From bfa4e45fa74fabf70ca0d80869e3b209f300ef6d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 May 2018 10:26:05 +0200 +Subject: [PATCH] s/find_btrfs_devs/btrfs_devs + +--- + dracut.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index f52d38ac..5b5b27e3 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1236,7 +1236,7 @@ if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then + + push_host_devs "$_dev" + if [[ "$_t" == btrfs ]]; then +- for i in $(find_btrfs_devs "$_m"); do ++ for i in $(btrfs_devs "$_m"); do + push_host_devs "$i" + done + fi + diff --git a/0027.patch b/0027.patch new file mode 100644 index 0000000..8655d92 --- /dev/null +++ b/0027.patch @@ -0,0 +1,13 @@ +From b2a024991f82a15e45df7d5eb2cc3e3e894a5dc8 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 May 2018 10:40:32 +0200 +Subject: [PATCH] 80lvmmerge/README.md: remove executable bits + +--- + modules.d/80lvmmerge/README.md | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + +diff --git a/modules.d/80lvmmerge/README.md b/modules.d/80lvmmerge/README.md +old mode 100755 +new mode 100644 + diff --git a/0028.patch b/0028.patch new file mode 100644 index 0000000..5c3315a --- /dev/null +++ b/0028.patch @@ -0,0 +1,58 @@ +From 8ad32155907fc4accd0a822365f6fcf1c355cfcb Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 May 2018 15:21:35 +0200 +Subject: [PATCH] don't error out, if no modules were installed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +dracut-install … -m -s drm_crtc_init =drivers/staging +should not return an error, if no module was found in =drivers/staging + +https://bugzilla.redhat.com/show_bug.cgi?id=1575527 +--- + install/dracut-install.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 4b2ff896..14fc0ab9 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -1394,6 +1394,7 @@ static int install_modules(int argc, char **argv) + const char *abskpath = NULL; + char *p; + int i; ++ int modinst = 0; + + ctx = kmod_new(kerneldir, NULL); + abskpath = kmod_get_dirname(ctx); +@@ -1498,6 +1499,7 @@ static int install_modules(int argc, char **argv) + return -ENOENT; + }; + ret = ( ret == 0 ? 0 : r ); ++ modinst = 1; + } + } else if (argv[i][0] == '=') { + _cleanup_free_ char *path1 = NULL, *path2 = NULL, *path3 = NULL; +@@ -1592,6 +1594,7 @@ static int install_modules(int argc, char **argv) + return -ENOENT; + }; + ret = ( ret == 0 ? 0 : r ); ++ modinst = 1; + } + } + if (errno) { +@@ -1638,10 +1641,11 @@ static int install_modules(int argc, char **argv) + return -ENOENT; + }; + ret = ( ret == 0 ? 0 : r ); ++ modinst = 1; + } + } + +- if ((ret != 0) && (!arg_optional)) { ++ if ((modinst != 0) && (ret != 0) && (!arg_optional)) { + if (!arg_silent) + log_error("ERROR: installing '%s'", argv[i]); + return EXIT_FAILURE; + diff --git a/0029.patch b/0029.patch new file mode 100644 index 0000000..f2c3f01 --- /dev/null +++ b/0029.patch @@ -0,0 +1,93 @@ +From 731b37e92902fd659270da89b1b46f92264db538 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 May 2018 15:23:04 +0200 +Subject: [PATCH] dracut-install.c: untabify + +--- + install/dracut-install.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +diff --git a/install/dracut-install.c b/install/dracut-install.c +index 14fc0ab9..f104f664 100644 +--- a/install/dracut-install.c ++++ b/install/dracut-install.c +@@ -402,9 +402,9 @@ static int resolve_deps(const char *src) + _cleanup_pclose_ FILE *fptr = NULL; + _cleanup_free_ char *cmd = NULL; + +- buf = malloc(LINE_MAX); +- if (buf == NULL) +- return -errno; ++ buf = malloc(LINE_MAX); ++ if (buf == NULL) ++ return -errno; + + if (strstr(src, ".so") == 0) { + _cleanup_close_ int fd = -1; +@@ -456,11 +456,11 @@ static int resolve_deps(const char *src) + break; + } + +- /* musl ldd */ +- if (strstr(buf, "Not a valid dynamic program")) +- break; ++ /* musl ldd */ ++ if (strstr(buf, "Not a valid dynamic program")) ++ break; + +- /* glibc */ ++ /* glibc */ + if (strstr(buf, "cannot execute binary file")) + break; + +@@ -1061,7 +1061,7 @@ static int install_one(const char *src, const char *dst) + if (strchr(src, '/') == NULL) { + char **p = find_binary(src); + if (p) { +- char **q = NULL; ++ char **q = NULL; + STRV_FOREACH(q, p) { + char *newsrc = *q; + log_debug("dracut_install '%s' '%s'", newsrc, dst); +@@ -1097,7 +1097,7 @@ static int install_all(int argc, char **argv) + if (strchr(argv[i], '/') == NULL) { + char **p = find_binary(argv[i]); + if (p) { +- char **q = NULL; ++ char **q = NULL; + STRV_FOREACH(q, p) { + char *newsrc = *q; + log_debug("dracut_install '%s'", newsrc); +@@ -1440,12 +1440,11 @@ static int install_modules(int argc, char **argv) + for (i = 0; i < argc; i++) { + int r = 0; + int ret = -1; +- + log_debug("Handle module '%s'", argv[i]); + + if (argv[i][0] == '/') { + _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; +- _cleanup_free_ const char *modname = NULL; ++ _cleanup_free_ const char *modname = NULL; + + r = kmod_module_new_from_path(ctx, argv[i], &mod_o); + if (r < 0) { +@@ -1532,7 +1531,7 @@ static int install_modules(int argc, char **argv) + + for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) { + _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; +- _cleanup_free_ const char *modname = NULL; ++ _cleanup_free_ const char *modname = NULL; + + if((ftsent->fts_info == FTS_D) && !check_module_path(ftsent->fts_accpath)) { + fts_set(fts, ftsent, FTS_SKIP); +@@ -1602,7 +1601,7 @@ static int install_modules(int argc, char **argv) + } + } else { + _cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL; +- char *modname = argv[i]; ++ char *modname = argv[i]; + + if (endswith(modname, ".ko")) { + int len = strlen(modname); + diff --git a/0030.patch b/0030.patch new file mode 100644 index 0000000..49040ea --- /dev/null +++ b/0030.patch @@ -0,0 +1,22 @@ +From 08e11e30e328ad2789fd0485dc477a48745af4d6 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Mon, 7 May 2018 15:27:22 +0200 +Subject: [PATCH] dracut.spec: do not recommend grubby + +--- + dracut.spec | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dracut.spec b/dracut.spec +index d25adcb0..ca8accb5 100644 +--- a/dracut.spec ++++ b/dracut.spec +@@ -77,7 +77,6 @@ Requires: xz + Requires: gzip + + %if 0%{?fedora} || 0%{?rhel} +-Recommends: grubby + Recommends: hardlink + Recommends: pigz + Recommends: kpartx + diff --git a/0031.patch b/0031.patch new file mode 100644 index 0000000..1948f9b --- /dev/null +++ b/0031.patch @@ -0,0 +1,70 @@ +From df6bb5e959178cba06118493a7c8d019e84d54e7 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 15 May 2018 13:37:53 +0200 +Subject: [PATCH] shutdown: sleep a little, if a process was killed + +If a process (maybe plymouth) was still pinning /oldroot, then shutdown +would +- kill -9 $pid +- umount_a +- umount_a +in a very short timeframe. A small sleep hopefully lets the scheduler free +up /oldroot in the mean time. +--- + modules.d/99base/dracut-lib.sh | 7 ++++++- + modules.d/99shutdown/module-setup.sh | 2 +- + modules.d/99shutdown/shutdown.sh | 2 +- + 3 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh +index 99cb9dbc..b78272a3 100755 +--- a/modules.d/99base/dracut-lib.sh ++++ b/modules.d/99base/dracut-lib.sh +@@ -118,6 +118,7 @@ str_replace() { + killall_proc_mountpoint() { + local _pid + local _t ++ local _killed=0 + for _pid in /proc/*; do + _pid=${_pid##/proc/} + case $_pid in +@@ -125,8 +126,12 @@ killall_proc_mountpoint() { + esac + [ -e "/proc/$_pid/exe" ] || continue + [ -e "/proc/$_pid/root" ] || continue +- strstr "$(ls -l -- "/proc/$_pid" "/proc/$_pid/fd" 2>/dev/null)" "$1" && kill -9 "$_pid" ++ if strstr "$(ls -l -- "/proc/$_pid" "/proc/$_pid/fd" 2>/dev/null)" "$1" ; then ++ kill -9 "$_pid" ++ _killed=1 ++ fi + done ++ return $_killed + } + + getcmdline() { +diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh +index 5cb3594a..dfd6caa2 100755 +--- a/modules.d/99shutdown/module-setup.sh ++++ b/modules.d/99shutdown/module-setup.sh +@@ -14,7 +14,7 @@ depends() { + # called by dracut + install() { + local _d +- inst_multiple umount poweroff reboot halt losetup stat ++ inst_multiple umount poweroff reboot halt losetup stat sleep + inst_multiple -o kexec + inst "$moddir/shutdown.sh" "$prefix/shutdown" + [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib +diff --git a/modules.d/99shutdown/shutdown.sh b/modules.d/99shutdown/shutdown.sh +index 918a8a4f..f21cc811 100755 +--- a/modules.d/99shutdown/shutdown.sh ++++ b/modules.d/99shutdown/shutdown.sh +@@ -38,7 +38,7 @@ source_hook pre-shutdown + + warn "Killing all remaining processes" + +-killall_proc_mountpoint /oldroot ++killall_proc_mountpoint /oldroot || sleep 0.2 + + umount_a() { + local _did_umount="n" diff --git a/dracut.spec b/dracut.spec index 6750673..69bc0f8 100644 --- a/dracut.spec +++ b/dracut.spec @@ -5,16 +5,7 @@ # strip the automatically generated dep here and instead co-own the # directory. %global __requires_exclude pkg-config - -# Variables must be defined -%define with_nbd 1 - -# nbd in Fedora only -%if 0%{?rhel} >= 6 -%define with_nbd 0 -%endif - -%define dist_free_release 8.git20180305 +%define dist_free_release 32.git20180515 Name: dracut Version: 047 @@ -44,6 +35,30 @@ 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 Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -54,6 +69,7 @@ BuildRequires: gcc %if 0%{?fedora} || 0%{?rhel} BuildRequires: pkgconfig +BuildRequires: systemd %endif %if 0%{?fedora} BuildRequires: bash-completion @@ -71,30 +87,15 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt BuildRequires: asciidoc %endif -%if 0%{?fedora} > 12 || 0%{?rhel} -# no "provides", because dracut does not offer -# all functionality of the obsoleted packages -Obsoletes: mkinitrd < 6.0.94 -Obsoletes: mkinitrd-devel < 6.0.94 -Obsoletes: nash < 6.0.94 -Obsoletes: libbdevid-python < 6.0.94 -%endif - -%if 0%{?fedora} > 16 || 0%{?rhel} > 6 -BuildRequires: systemd-units -%endif - %if 0%{?suse_version} > 9999 Obsoletes: mkinitrd < 2.6.1 Provides: mkinitrd = 2.6.1 %endif -Obsoletes: dracut-kernel < 005 -Provides: dracut-kernel = %{version}-%{release} - -Obsoletes: dracut < 030 -Obsoletes: dracut-norescue < 030 -Provides: dracut-norescue = %{version}-%{release} +Obsoletes: dracut-fips <= 047 +Provides: dracut-fips = %{version}-%{release} +Obsoletes: dracut-fips-aesni <= 047 +Provides: dracut-fips-aesni = %{version}-%{release} Requires: bash >= 4 Requires: coreutils @@ -107,32 +108,27 @@ Requires: sed Requires: xz Requires: gzip -%if 0%{?fedora} > 22 || 0%{?rhel} > 7 -Recommends: grubby +%if 0%{?fedora} || 0%{?rhel} Recommends: hardlink Recommends: pigz Recommends: kpartx -%else -Requires: hardlink -Requires: gzip -Requires: kpartx -%endif - -%if 0%{?fedora} || 0%{?rhel} > 6 Requires: util-linux >= 2.21 Requires: systemd >= 219 Requires: systemd-udev >= 219 Requires: procps-ng -Conflicts: grubby < 8.23 -Conflicts: initscripts < 8.63-1 -Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1 -Conflicts: bcache-tools < 0-0.14.20130909git %else +Requires: hardlink +Requires: gzip +Requires: kpartx Requires: udev > 166 Requires: util-linux-ng >= 2.21 %endif -Conflicts: mdadm < 3.2.6-14 +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +Requires: hmaccalc +Requires: nss +Requires: nss-softokn-freebl +%endif %description dracut contains tools to create bootable initramfses for the Linux @@ -163,32 +159,6 @@ Provides: dracut-generic = %{version}-%{release} This package requires everything which is needed to build a generic all purpose initramfs with network support with dracut. -%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version} -%package fips -Summary: dracut modules to build a dracut initramfs with an integrity check -Requires: %{name} = %{version}-%{release} -Requires: hmaccalc -%if 0%{?rhel} > 5 -# For Alpha 3, we want nss instead of nss-softokn -Requires: nss -%else -Requires: nss-softokn -%endif -Requires: nss-softokn-freebl - -%description fips -This package requires everything which is needed to build an -initramfs with dracut, which does an integrity check. -%endif - -%package fips-aesni -Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel -Requires: %{name}-fips = %{version}-%{release} - -%description fips-aesni -This package requires everything which is needed to build an -initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module. - %package caps Summary: dracut modules to build a dracut initramfs which drops capabilities Requires: %{name} = %{version}-%{release} @@ -258,9 +228,6 @@ cp %{SOURCE1} . make %{?_smp_mflags} %install -%if 0%{?fedora} || 0%{?rhel} -rm -rf -- $RPM_BUILD_ROOT -%endif make %{?_smp_mflags} install \ DESTDIR=$RPM_BUILD_ROOT \ libdir=%{_prefix}/lib @@ -318,28 +285,16 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse* install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf %endif -%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} -install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf -%endif - -%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999 +%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 -%if 0%{?fedora} || 0%{?rhel} > 6 -# FIXME: remove after F19 -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 - +%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 %endif -%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} -> $RPM_BUILD_ROOT/etc/system-fips -%endif - %files %defattr(-,root,root,0755) %if %{with doc} @@ -350,7 +305,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_bindir}/dracut %{_datadir}/bash-completion/completions/dracut %{_datadir}/bash-completion/completions/lsinitrd -%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 %{_bindir}/mkinitrd %{_bindir}/lsinitrd %endif @@ -376,7 +331,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %if %{with doc} %{_mandir}/man8/dracut.8* %{_mandir}/man8/*service.8* -%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999 %{_mandir}/man8/mkinitrd.8* %{_mandir}/man1/lsinitrd.1* %endif @@ -412,6 +367,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/90mdraid %{dracutlibdir}/modules.d/90multipath %{dracutlibdir}/modules.d/90multipath-hostonly +%{dracutlibdir}/modules.d/90stratis %{dracutlibdir}/modules.d/90qemu %{dracutlibdir}/modules.d/91crypt-gpg %{dracutlibdir}/modules.d/91crypt-loop @@ -470,10 +426,16 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_unitdir}/initrd.target.wants/dracut-pre-udev.service %endif -%if 0%{?fedora} || 0%{?rhel} > 6 +%if 0%{?fedora} || 0%{?rhel} %{_prefix}/lib/kernel/install.d/50-dracut.install %endif +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} +%defattr(-,root,root,0755) +%{dracutlibdir}/modules.d/01fips +%{dracutlibdir}/modules.d/02fips-aesni +%endif + %files network %defattr(-,root,root,0755) %{dracutlibdir}/modules.d/02systemd-networkd @@ -493,18 +455,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %endif %{dracutlibdir}/modules.d/99uefi-lib -%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} -%files fips -%defattr(-,root,root,0755) -%{dracutlibdir}/modules.d/01fips -%{dracutlibdir}/dracut.conf.d/40-fips.conf -%config(missingok) /etc/system-fips -%endif - -%files fips-aesni -%defattr(-,root,root,0755) -%{dracutlibdir}/modules.d/02fips-aesni - %files caps %defattr(-,root,root,0755) %{dracutlibdir}/modules.d/02caps @@ -535,12 +485,14 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %files config-rescue %defattr(-,root,root,0755) %{dracutlibdir}/dracut.conf.d/02-rescue.conf -%if 0%{?fedora} || 0%{?rhel} > 6 +%if 0%{?fedora} || 0%{?rhel} %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install -%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh %endif %changelog +* Tue May 15 2018 Harald Hoyer - 047-32.git20180515 +- git snapshot + * Mon Mar 05 2018 Harald Hoyer - 047-8 - git snapshot