From b209f50dd69f467ee77559898c087669c1254b39 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Tue, 30 Aug 2022 02:03:58 +0200 Subject: [PATCH] - updated to 056 --- arch-libdir.patch | 15 +- bash-5.patch | 57 -- bash.patch | 19 + compressors.patch | 20 +- crypttab-keyscript.patch | 18 +- dracut.spec | 84 +- initrd-release.patch | 85 +- misc_fixes.patch | 33 +- no_systemd.patch | 1995 +++++++++++++++++++++----------------- proc_sys_remount.patch | 10 +- update-initramfs | 2 +- 11 files changed, 1286 insertions(+), 1052 deletions(-) delete mode 100644 bash-5.patch create mode 100644 bash.patch diff --git a/arch-libdir.patch b/arch-libdir.patch index aacb6c9..86126db 100644 --- a/arch-libdir.patch +++ b/arch-libdir.patch @@ -1,12 +1,11 @@ -diff -ur dracut-044.orig/modules.d/95resume/module-setup.sh dracut-044/modules.d/95resume/module-setup.sh ---- dracut-044.orig/modules.d/95resume/module-setup.sh 2015-11-25 13:22:28.000000000 +0000 -+++ dracut-044/modules.d/95resume/module-setup.sh 2015-11-30 12:49:38.099305000 +0000 -@@ -43,7 +43,7 @@ +--- dracut-056/modules.d/95resume/module-setup.sh.orig 2022-05-07 19:58:20.569138739 +0200 ++++ dracut-056/modules.d/95resume/module-setup.sh 2022-05-07 20:02:27.501134327 +0200 +@@ -50,7 +50,7 @@ install() { fi # Optional uswsusp support -- for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume -+ for _bin in /usr/sbin/resume /usr/@lib@/suspend/resume /usr/@lib@/uswsusp/resume - do - [[ -x "${_bin}" ]] && { +- for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib64/suspend/resume /usr/lib/uswsusp/resume /usr/lib64/uswsusp/resume; do ++ for _bin in /usr/sbin/resume /usr/@lib@/suspend/resume /usr/@lib@/uswsusp/resume; do + [[ -x $dracutsysrootdir${_bin} ]] && { inst "${_bin}" /usr/sbin/resume + [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/suspend.conf ]] && inst -H /etc/suspend.conf diff --git a/bash-5.patch b/bash-5.patch deleted file mode 100644 index 1f8f29c..0000000 --- a/bash-5.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh -index d39ca1b7..8dbc8b3c 100755 ---- ./modules.d/99fs-lib/fs-lib.sh -+++ ./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="_drv=e2fsck fsck_drv_com e2fsck" && - return 0 - ;; - f2fs) - type fsck.f2fs >/dev/null 2>&1 && -- _drv="_drv=fsck.f2fs fsck_drv_com" && -+ _drv="_drv=fsck.f2fs fsck_drv_com fsck.f2fs" && - return 0 - ;; - jfs) - type jfs_fsck >/dev/null 2>&1 && -- _drv="_drv=jfs_fsck fsck_drv_com" && -+ _drv="_drv=jfs_fsck fsck_drv_com jfs_fsck" && - return 0 - ;; - reiserfs) - type reiserfsck >/dev/null 2>&1 && -- _drv="_drv=reiserfsck fsck_drv_com" && -+ _drv="_drv=reiserfsck fsck_drv_com reiserfsck" && - return 0 - ;; - btrfs) -@@ -75,7 +75,7 @@ fsck_able() { - ;; - *) - type fsck >/dev/null 2>&1 && -- _drv="_drv=fsck fsck_drv_std" && -+ _drv="_drv=fsck fsck_drv_std fsck" && - return 0 - ;; - esac -@@ -99,6 +99,7 @@ fsck_drv_btrfs() { - fsck_drv_com() { - local _ret - local _out -+ local _drv=$1 - - if ! strglobin "$_fop" "-[ynap]"; then - _fop="-a ${_fop}" -@@ -177,7 +178,7 @@ fsck_batch() { - _out="$(fsck -M -T "$@" -- -a)" - _ret=$? - -- fsck_tail -+ _drv=$_drv fsck_tail - - return $_ret - } diff --git a/bash.patch b/bash.patch new file mode 100644 index 0000000..4c56e4d --- /dev/null +++ b/bash.patch @@ -0,0 +1,19 @@ +--- dracut-055/modules.d/00bash/module-setup.sh~ 2021-05-27 14:34:19.000000000 +0200 ++++ dracut-055/modules.d/00bash/module-setup.sh 2021-10-30 23:03:00.931687353 +0200 +@@ -9,7 +9,7 @@ + require_binaries bash || return 1 + + # Return 255 to only include the module, if another module requires it. +- return 255 ++ return 0 + + } + +@@ -27,6 +27,6 @@ + inst /bin/bash + + # Prefer bash as default shell if no other shell is preferred. +- [[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh" ++ ln -sf bash "${initdir}/bin/sh" + + } diff --git a/compressors.patch b/compressors.patch index cf01069..518e919 100644 --- a/compressors.patch +++ b/compressors.patch @@ -1,7 +1,7 @@ -diff -urpa dracut-048.orig/dracut.sh dracut-048/dracut.sh ---- dracut-048.orig/dracut.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/dracut.sh 2018-07-21 21:09:03.431060990 +0000 -@@ -195,8 +195,6 @@ Creates initial ramdisk images for prelo +diff -urpa dracut-056.orig/dracut.sh dracut-056/dracut.sh +--- dracut-056.orig/dracut.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/dracut.sh 2022-08-28 17:26:54.017178064 +0200 +@@ -202,8 +202,6 @@ Creates initial ramdisk images for prelo --install-optional [LIST] Install the space separated list of files into the initramfs, if they exist. --gzip Compress the generated initramfs using gzip. @@ -10,7 +10,7 @@ diff -urpa dracut-048.orig/dracut.sh dracut-048/dracut.sh --bzip2 Compress the generated initramfs using bzip2. Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. -@@ -204,6 +202,8 @@ Creates initial ramdisk images for prelo +@@ -211,6 +209,8 @@ Creates initial ramdisk images for prelo Make sure your kernel has lzma support compiled in, otherwise you will not be able to boot. --xz Compress the generated initramfs using xz. @@ -19,12 +19,12 @@ diff -urpa dracut-048.orig/dracut.sh dracut-048/dracut.sh Make sure that your kernel has xz support compiled in, otherwise you will not be able to boot. --lzo Compress the generated initramfs using lzop. -@@ -821,7 +821,7 @@ fi +@@ -2388,7 +2388,7 @@ 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 -+ for i in xz lzma bzip2 lbzip2 gzip pigz lz4 lzop zstd cat; do - command -v "$i" &>/dev/null || continue +- for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do ++ for i in $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_CAT; do + [[ $i != "$DRACUT_COMPRESS_ZSTD" || $DRACUT_KERNEL_RD_ZSTD ]] || continue + command -v "$i" &> /dev/null || continue compress="$i" - break diff --git a/crypttab-keyscript.patch b/crypttab-keyscript.patch index a276b23..df1b59f 100644 --- a/crypttab-keyscript.patch +++ b/crypttab-keyscript.patch @@ -1,7 +1,7 @@ -diff -urpa dracut-048.orig/modules.d/90crypt/cryptroot-ask.sh dracut-048/modules.d/90crypt/cryptroot-ask.sh ---- dracut-048.orig/modules.d/90crypt/cryptroot-ask.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90crypt/cryptroot-ask.sh 2018-07-21 14:44:47.121435253 +0000 -@@ -106,6 +106,9 @@ while [ $# -gt 0 ]; do +diff -urpa dracut-056.orig/modules.d/90crypt/cryptroot-ask.sh dracut-056/modules.d/90crypt/cryptroot-ask.sh +--- dracut-056.orig/modules.d/90crypt/cryptroot-ask.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90crypt/cryptroot-ask.sh 2022-08-28 19:27:11.079536407 +0200 +@@ -112,6 +112,9 @@ while [ $# -gt 0 ]; do header=*) cryptsetupopts="${cryptsetupopts} --${1}" ;; @@ -11,7 +11,7 @@ diff -urpa dracut-048.orig/modules.d/90crypt/cryptroot-ask.sh dracut-048/modules esac shift done -@@ -163,6 +166,14 @@ else +@@ -174,6 +177,14 @@ else done fi @@ -26,10 +26,10 @@ diff -urpa dracut-048.orig/modules.d/90crypt/cryptroot-ask.sh dracut-048/modules if [ $ask_passphrase -ne 0 ]; then luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen" _timeout=$(getargs "rd.luks.timeout") -diff -urpa dracut-048.orig/modules.d/90crypt/module-setup.sh dracut-048/modules.d/90crypt/module-setup.sh ---- dracut-048.orig/modules.d/90crypt/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90crypt/module-setup.sh 2018-07-21 14:44:47.121435253 +0000 -@@ -97,10 +97,26 @@ install() { +diff -urpa dracut-056.orig/modules.d/90crypt/module-setup.sh dracut-056/modules.d/90crypt/module-setup.sh +--- dracut-056.orig/modules.d/90crypt/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90crypt/module-setup.sh 2022-08-28 19:27:11.079536407 +0200 +@@ -136,10 +136,26 @@ install() { forceentry="yes" break ;; diff --git a/dracut.spec b/dracut.spec index 1b173c2..3a669b2 100644 --- a/dracut.spec +++ b/dracut.spec @@ -1,12 +1,12 @@ Summary: Initramfs generator using udev Summary(pl.UTF-8): Generator initramfs wykorzystujący udev Name: dracut -Version: 048 -Release: 2 +Version: 056 +Release: 1 License: GPL v2+ Group: Base Source0: https://www.kernel.org/pub/linux/utils/boot/dracut/%{name}-%{version}.tar.xz -# Source0-md5: a9705d3c32c7523428f6e5e3e17244f8 +# Source0-md5: 17d51f3ccc3a3a790bab6da0355ca4c2 Source1: tld.conf Source2: update-initramfs Patch1: os-release.patch @@ -17,7 +17,7 @@ Patch5: proc_sys_remount.patch Patch6: misc_fixes.patch Patch7: initrd-release.patch Patch8: crypttab-keyscript.patch -Patch9: bash-5.patch +Patch9: bash.patch Patch100: no_systemd.patch URL: https://dracut.wiki.kernel.org/ BuildRequires: asciidoc @@ -27,6 +27,9 @@ BuildRequires: docbook-style-xsl BuildRequires: kmod-devel >= 23 BuildRequires: libxslt-progs BuildRequires: pkgconfig +BuildRequires: rpmbuild(macros) >= 1.752 +BuildRequires: tar >= 1:1.22 +BuildRequires: xz Requires: bash Requires: bzip2 Requires: coreutils @@ -63,7 +66,6 @@ Suggests: losetup Suggests: lvm2 Suggests: mdadm Suggests: multipath-tools -Suggests: plymouth Suggests: suspend-utils Suggests: syslogdaemon Suggests: xfsprogs @@ -98,12 +100,12 @@ Requires: bridge-utils Requires: dhcp-client Requires: iproute2 Requires: iputils-arping -Requires: ping Requires: nbd Requires: net-tools Requires: nfs-utils-clients Requires: open-iscsi Requires: openssh-clients +Requires: ping Requires: rpcbind Suggests: curl @@ -123,7 +125,7 @@ Group: Base Requires: %{name} = %{version}-%{release} Requires: hmaccalc Requires: nss-softokn-freebl -Obsoletes: dracut-fips-aesni +Obsoletes: dracut-fips-aesni < 048 %description fips This package requires everything which is needed to build an all @@ -170,6 +172,7 @@ Summary(pl.UTF-8): Bashowe dopełnianie składni dla polecenia dracut Group: Applications/Shells Requires: %{name} = %{version} Requires: bash-completion >= 2.0 +BuildArch: noarch %description -n bash-completion-dracut bash-completion for dracut. @@ -183,14 +186,13 @@ Bashowe dopełnianie składni dla polecenia dracut. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 - %patch100 -p1 -%{__sed} -i -e 's,@lib@,%{_lib},g' modules.d/50plymouth/module-setup.sh %{__sed} -i -e 's,@lib@,%{_lib},g' modules.d/95resume/module-setup.sh find modules.d -name '*.orig' | xargs -r %{__rm} @@ -205,7 +207,7 @@ find modules.d -name '*.orig' | xargs -r %{__rm} %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{/boot/dracut,/etc/logrotate.d,/sbin} \ +install -d $RPM_BUILD_ROOT{/boot/dracut,/sbin} \ $RPM_BUILD_ROOT/var/{log,lib/{dracut/overlay,initramfs}} %{__make} install \ @@ -214,47 +216,46 @@ install -d $RPM_BUILD_ROOT{/boot/dracut,/etc/logrotate.d,/sbin} \ install -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/dracut.conf.d/01-dist.conf install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/update-initramfs install -p dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dracut.conf.d/40-fips.conf -install -p dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut_log -echo "DRACUT_VERSION=%{version}-%{release}" >$RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh +echo "DRACUT_VERSION=%{version}-%{release}" >$RPM_BUILD_ROOT%{dracutlibdir}/dracut-version.sh # create compat symlink ln -s %{_bindir}/dracut $RPM_BUILD_ROOT/sbin/dracut +# remove foreign arch modules +%ifnarch ppc ppc64 +%{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/90ppcmac +%endif # remove gentoo specific modules %{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/50gensplash -# SuSE specific man page -%{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/mkinitrd-suse.8 - # remove systemd and related stuff -%{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/{00systemd,01systemd-initrd,02systemd-networkd,80lvmmerge,98dracut-systemd} -%{__rm} $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/{90multipath/multipathd,90dmsquash-live/checkisomd5@,90stratis/stratisd-init}.service +%{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/{00systemd*,01systemd*,98dracut-systemd} +%{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/{06dbus-broker,06dbus-daemon,06rngd,09dbus,35network-manager,35network-wicked,50plymouth,62bluetooth,80lvmmerge,91fido2,91pcsc,91pkcs11,91tpm2-tss,99memstrack} +%{__rm} $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/{90dmsquash-live/checkisomd5@.service,90multipath/multipathd{,-configure}.service} %{__rm} $RPM_BUILD_ROOT%{_mandir}/man8/dracut-*.service.8 -# remove other, uncesessary stuff -%{__rm} -r $RPM_BUILD_ROOT%{dracutlibdir}/modules.d/91zipl -%{__rm} -r $RPM_BUILD_ROOT/usr/lib/kernel/install.d/50-dracut.install -%{__rm} -r $RPM_BUILD_ROOT/usr/lib/kernel/install.d/51-dracut-rescue.install +# remove unneded files +%{__rm} -r $RPM_BUILD_ROOT/usr/lib/kernel/install.d/*.install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc AUTHORS HACKING NEWS README* TODO dracut.html dracut.png dracut.svg +%doc AUTHORS NEWS.md README.md docs/HACKING.md dracut.html docs/dracut.png docs/dracut.svg %dir %{_sysconfdir}/dracut.conf.d %config(noreplace) %{_sysconfdir}/dracut.conf %config(noreplace) %{_sysconfdir}/dracut.conf.d/01-dist.conf -%config(noreplace) /etc/logrotate.d/dracut_log # compat symlink %attr(755,root,root) /sbin/dracut %attr(755,root,root) %{_bindir}/dracut -%attr(755,root,root) %{_bindir}/mkinitrd %attr(755,root,root) %{_bindir}/lsinitrd %attr(755,root,root) %{_bindir}/update-initramfs %dir %{dracutlibdir} +%dir %{dracutlibdir}/dracut.conf.d %attr(755,root,root) %{dracutlibdir}/dracut-install +%attr(755,root,root) %{dracutlibdir}/dracut-util %dir %{dracutlibdir}/modules.d %attr(755,root,root) %{dracutlibdir}/dracut-functions.sh %attr(755,root,root) %{dracutlibdir}/dracut-functions @@ -263,16 +264,20 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/dracut-initramfs-restore %dir %{dracutlibdir}/modules.d/00bash %attr(755,root,root) %{dracutlibdir}/modules.d/00bash/module-setup.sh -%dir %{dracutlibdir}/modules.d/00bootchart -%attr(755,root,root) %{dracutlibdir}/modules.d/00bootchart/*.sh %dir %{dracutlibdir}/modules.d/00dash %attr(755,root,root) %{dracutlibdir}/modules.d/00dash/*.sh +%dir %{dracutlibdir}/modules.d/00mksh +%attr(755,root,root) %{dracutlibdir}/modules.d/00mksh/module-setup.sh +%dir %{dracutlibdir}/modules.d/00warpclock +%attr(755,root,root) %{dracutlibdir}/modules.d/00warpclock/*.sh %dir %{dracutlibdir}/modules.d/03modsign %attr(755,root,root) %{dracutlibdir}/modules.d/03modsign/*.sh %dir %{dracutlibdir}/modules.d/03rescue %attr(755,root,root) %{dracutlibdir}/modules.d/03rescue/module-setup.sh %dir %{dracutlibdir}/modules.d/04watchdog %attr(755,root,root) %{dracutlibdir}/modules.d/04watchdog/*.sh +%dir %{dracutlibdir}/modules.d/04watchdog-modules +%attr(755,root,root) %{dracutlibdir}/modules.d/04watchdog-modules/module-setup.sh %dir %{dracutlibdir}/modules.d/05busybox %attr(755,root,root) %{dracutlibdir}/modules.d/05busybox/*.sh %dir %{dracutlibdir}/modules.d/10i18n @@ -283,8 +288,6 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/30convertfs/*.sh %dir %{dracutlibdir}/modules.d/50drm %attr(755,root,root) %{dracutlibdir}/modules.d/50drm/module-setup.sh -%dir %{dracutlibdir}/modules.d/50plymouth -%attr(755,root,root) %{dracutlibdir}/modules.d/50plymouth/*.sh %dir %{dracutlibdir}/modules.d/80cms %attr(755,root,root) %{dracutlibdir}/modules.d/80cms/*.sh %dir %{dracutlibdir}/modules.d/81cio_ignore @@ -306,6 +309,8 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/90dmsquash-live-ntfs/*.sh %dir %{dracutlibdir}/modules.d/90kernel-modules %attr(755,root,root) %{dracutlibdir}/modules.d/90kernel-modules/*.sh +%dir %{dracutlibdir}/modules.d/90kernel-modules-extra +%attr(755,root,root) %{dracutlibdir}/modules.d/90kernel-modules-extra/*.sh %dir %{dracutlibdir}/modules.d/90lvm %{dracutlibdir}/modules.d/90lvm/*.rules %attr(755,root,root) %{dracutlibdir}/modules.d/90lvm/*.sh @@ -314,15 +319,17 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/90mdraid/*.sh %dir %{dracutlibdir}/modules.d/90multipath %attr(755,root,root) %{dracutlibdir}/modules.d/90multipath/*.sh +%dir %{dracutlibdir}/modules.d/90nvdimm +%attr(755,root,root) %{dracutlibdir}/modules.d/90nvdimm/module-setup.sh %dir %{dracutlibdir}/modules.d/90qemu %attr(755,root,root) %{dracutlibdir}/modules.d/90qemu/*.sh -%dir %{dracutlibdir}/modules.d/90stratis -%attr(755,root,root) %{dracutlibdir}/modules.d/90stratis/*.sh %dir %{dracutlibdir}/modules.d/91crypt-gpg %{dracutlibdir}/modules.d/91crypt-gpg/README %attr(755,root,root) %{dracutlibdir}/modules.d/91crypt-gpg/*.sh %dir %{dracutlibdir}/modules.d/91crypt-loop %attr(755,root,root) %{dracutlibdir}/modules.d/91crypt-loop/*.sh +%dir %{dracutlibdir}/modules.d/91zipl +%attr(755,root,root) %{dracutlibdir}/modules.d/91zipl/*.sh %dir %{dracutlibdir}/modules.d/95dcssblk %attr(755,root,root) %{dracutlibdir}/modules.d/95dcssblk/*.sh %dir %{dracutlibdir}/modules.d/95debug @@ -343,6 +350,9 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/95fcoe-uefi/*.sh %dir %{dracutlibdir}/modules.d/95fstab-sys %attr(755,root,root) %{dracutlibdir}/modules.d/95fstab-sys/*.sh +%dir %{dracutlibdir}/modules.d/95nvmf +%attr(755,root,root) %{dracutlibdir}/modules.d/95nvmf/*.sh +%{dracutlibdir}/modules.d/95nvmf/95-nvmf-initqueue.rules %dir %{dracutlibdir}/modules.d/95qeth_rules %attr(755,root,root) %{dracutlibdir}/modules.d/95qeth_rules/*.sh %dir %{dracutlibdir}/modules.d/95zfcp @@ -387,6 +397,8 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/99img-lib/*.sh %dir %{dracutlibdir}/modules.d/99shutdown %attr(755,root,root) %{dracutlibdir}/modules.d/99shutdown/*.sh +%dir %{dracutlibdir}/modules.d/99squash +%attr(755,root,root) %{dracutlibdir}/modules.d/99squash/*.sh %dir %{dracutlibdir}/modules.d/99uefi-lib %attr(755,root,root) %{dracutlibdir}/modules.d/99uefi-lib/*.sh %attr(755,root,root) %{dracutlibdir}/dracut-version.sh @@ -403,12 +415,16 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man7/dracut.kernel.7* %{_mandir}/man7/dracut.modules.7* %{_mandir}/man8/dracut.8* -%{_mandir}/man8/mkinitrd.8* + +#/usr/lib/kernel/install.d/50-dracut.install +#/usr/lib/kernel/install.d/51-dracut-rescue.install %files network %defattr(644,root,root,755) +%dir %{dracutlibdir}/modules.d/35network-legacy +%{dracutlibdir}/modules.d/35network-legacy/dhclient.conf +%attr(755,root,root) %{dracutlibdir}/modules.d/35network-legacy/*.sh %dir %{dracutlibdir}/modules.d/40network -%{dracutlibdir}/modules.d/40network/dhclient.conf %attr(755,root,root) %{dracutlibdir}/modules.d/40network/*.sh %dir %{dracutlibdir}/modules.d/45ifcfg %attr(755,root,root) %{dracutlibdir}/modules.d/45ifcfg/*.sh @@ -418,6 +434,10 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{dracutlibdir}/modules.d/90kernel-network-modules/module-setup.sh %dir %{dracutlibdir}/modules.d/90livenet %attr(755,root,root) %{dracutlibdir}/modules.d/90livenet/*.sh +%ifarch ppc ppc64 +%dir %{dracutlibdir}/modules.d/90ppcmac +%attr(755,root,root) %{dracutlibdir}/modules.d/90ppcmac/*.sh +%endif %dir %{dracutlibdir}/modules.d/90qemu-net %attr(755,root,root) %{dracutlibdir}/modules.d/90qemu-net/*.sh %dir %{dracutlibdir}/modules.d/95cifs diff --git a/initrd-release.patch b/initrd-release.patch index 61613c1..80ff994 100644 --- a/initrd-release.patch +++ b/initrd-release.patch @@ -1,34 +1,19 @@ -diff -urpa dracut-048.orig/modules.d/01systemd-initrd/module-setup.sh dracut-048/modules.d/01systemd-initrd/module-setup.sh ---- dracut-048.orig/modules.d/01systemd-initrd/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/01systemd-initrd/module-setup.sh 2018-07-21 14:42:37.171442999 +0000 -@@ -60,10 +60,8 @@ install() { - echo VERSION_ID=$VERSION_ID - echo PRETTY_NAME=\"$PRETTY_NAME\" - echo ANSI_COLOR=\"$ANSI_COLOR\" -- } > $initdir/usr/lib/initrd-release -+ } > $initdir/etc/initrd-release - echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION -- ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release -- ln -sf initrd-release $initdir/usr/lib/os-release - ln -sf initrd-release $initdir/etc/os-release - } - -diff -urpa dracut-048.orig/modules.d/98dracut-systemd/dracut-cmdline.sh dracut-048/modules.d/98dracut-systemd/dracut-cmdline.sh ---- dracut-048.orig/modules.d/98dracut-systemd/dracut-cmdline.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/98dracut-systemd/dracut-cmdline.sh 2018-07-21 14:42:37.171442999 +0000 +diff -urpa dracut-056.orig/modules.d/98dracut-systemd/dracut-cmdline.sh dracut-056/modules.d/98dracut-systemd/dracut-cmdline.sh +--- dracut-056.orig/modules.d/98dracut-systemd/dracut-cmdline.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/98dracut-systemd/dracut-cmdline.sh 2022-08-28 19:16:30.262174543 +0200 @@ -5,7 +5,7 @@ if [ -f /dracut-state.sh ]; then fi - type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh + type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh -[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release +[ -f /etc/initrd-release ] && . /etc/initrd-release [ -n "$VERSION" ] && info "dracut-$VERSION" if ! getargbool 1 'rd.hostonly'; then -diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/99base/dracut-lib.sh ---- dracut-048.orig/modules.d/99base/dracut-lib.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/99base/dracut-lib.sh 2018-07-21 14:42:37.171442999 +0000 -@@ -406,7 +406,7 @@ splitsep() { +diff -urpa dracut-056.orig/modules.d/99base/dracut-lib.sh dracut-056/modules.d/99base/dracut-lib.sh +--- dracut-056.orig/modules.d/99base/dracut-lib.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/99base/dracut-lib.sh 2022-08-28 19:16:30.263174545 +0200 +@@ -385,7 +385,7 @@ splitsep() { } setdebug() { @@ -37,11 +22,11 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 if [ -z "$RD_DEBUG" ]; then if [ -e /proc/cmdline ]; then RD_DEBUG=no -diff -urpa dracut-048.orig/modules.d/99base/init.sh dracut-048/modules.d/99base/init.sh ---- dracut-048.orig/modules.d/99base/init.sh 2018-07-21 14:41:40.189446395 +0000 -+++ dracut-048/modules.d/99base/init.sh 2018-07-21 14:42:37.172442998 +0000 -@@ -111,7 +111,7 @@ else - exec 0<>/dev/console 1<>/dev/console 2<>/dev/console +diff -urpa dracut-056.orig/modules.d/99base/init.sh dracut-056/modules.d/99base/init.sh +--- dracut-056.orig/modules.d/99base/init.sh 2022-08-28 19:12:37.568702916 +0200 ++++ dracut-056/modules.d/99base/init.sh 2022-08-28 19:16:30.263174545 +0200 +@@ -102,7 +102,7 @@ else + exec 0<> /dev/console 1<> /dev/console 2<> /dev/console fi -[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release @@ -49,18 +34,36 @@ diff -urpa dracut-048.orig/modules.d/99base/init.sh dracut-048/modules.d/99base/ [ -n "$VERSION_ID" ] && info "$NAME-$VERSION_ID" source_conf /etc/conf.d -diff -urpa dracut-048.orig/modules.d/99base/module-setup.sh dracut-048/modules.d/99base/module-setup.sh ---- dracut-048.orig/modules.d/99base/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/99base/module-setup.sh 2018-07-21 14:42:37.172442998 +0000 -@@ -86,10 +86,8 @@ install() { - echo VERSION_ID=$VERSION_ID - echo PRETTY_NAME=\"$PRETTY_NAME\" - echo ANSI_COLOR=\"$ANSI_COLOR\" -- } > $initdir/usr/lib/initrd-release -+ } > $initdir/etc/initrd-release - echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION -- ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release -- ln -sf initrd-release $initdir/usr/lib/os-release - ln -sf initrd-release $initdir/etc/os-release +diff -urpa dracut-056.orig/modules.d/99base/module-setup.sh dracut-056/modules.d/99base/module-setup.sh +--- dracut-056.orig/modules.d/99base/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/99base/module-setup.sh 2022-08-28 19:23:42.688085700 +0200 +@@ -78,7 +78,7 @@ install() { + if [[ -e $dracutsysrootdir/etc/os-release ]]; then + # shellcheck disable=SC1090 + . "$dracutsysrootdir"/etc/os-release +- grep -hE -ve '^VERSION=' -ve '^PRETTY_NAME' "$dracutsysrootdir"/etc/os-release > "${initdir}"/usr/lib/initrd-release ++ grep -hE -ve '^VERSION=' -ve '^PRETTY_NAME' "$dracutsysrootdir"/etc/os-release > "${initdir}"/etc/initrd-release + [[ -n ${VERSION} ]] && VERSION+=" " + [[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" " + else +@@ -89,7 +89,7 @@ install() { + echo "ID=dracut" + echo "VERSION_ID=\"$DRACUT_VERSION\"" + echo 'ANSI_COLOR="0;34"' +- } > "${initdir}"/usr/lib/initrd-release ++ } > "${initdir}"/etc/initrd-release + fi + VERSION+="dracut-$DRACUT_VERSION" + PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)" +@@ -100,10 +100,8 @@ install() { + # to easily detect the dracut version if need be without + # having it mixed in with the real underlying OS version. + echo "DRACUT_VERSION=\"${DRACUT_VERSION}\"" +- } >> "$initdir"/usr/lib/initrd-release ++ } >> "$initdir"/etc/initrd-release + echo "dracut-$DRACUT_VERSION" > "$initdir/lib/dracut/dracut-$DRACUT_VERSION" +- ln -sf ../usr/lib/initrd-release "$initdir"/etc/initrd-release +- ln -sf initrd-release "$initdir"/usr/lib/os-release + ln -sf initrd-release "$initdir"/etc/os-release ## save host_devs which we need bring up diff --git a/misc_fixes.patch b/misc_fixes.patch index be00a69..5358ba7 100644 --- a/misc_fixes.patch +++ b/misc_fixes.patch @@ -1,29 +1,30 @@ -diff -urpa dracut-047.orig/modules.d/90lvm/module-setup.sh dracut-047/modules.d/90lvm/module-setup.sh ---- dracut-047.orig/modules.d/90lvm/module-setup.sh 2018-02-19 09:00:33.000000000 +0000 -+++ dracut-047/modules.d/90lvm/module-setup.sh 2018-03-15 12:12:46.548976493 +0000 -@@ -73,9 +73,9 @@ install() { - if [ -f /etc/lvm/lvmlocal.conf ]; then +diff -urpa dracut-056.orig/modules.d/90lvm/module-setup.sh dracut-056/modules.d/90lvm/module-setup.sh +--- dracut-056.orig/modules.d/90lvm/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90lvm/module-setup.sh 2022-08-28 19:15:35.294063140 +0200 +@@ -68,9 +68,9 @@ install() { + if [[ -f $dracutsysrootdir/etc/lvm/lvmlocal.conf ]]; then inst_simple -H /etc/lvm/lvmlocal.conf fi -- eval $(lvm dumpconfig global/system_id_source &>/dev/null) -+ eval $(lvm dumpconfig global/system_id_source 2>/dev/null) +- eval "$(lvm dumpconfig global/system_id_source &> /dev/null)" ++ eval "$(lvm dumpconfig global/system_id_source 2> /dev/null)" if [ "$system_id_source" == "file" ]; then -- eval $(lvm dumpconfig global/system_id_file) -+ eval $(lvm dumpconfig global/system_id_file 2>/dev/null) +- eval "$(lvm dumpconfig global/system_id_file)" ++ eval "$(lvm dumpconfig global/system_id_file 2> /dev/null)" if [ -f "$system_id_file" ]; then - inst_simple -H $system_id_file + inst_simple -H "$system_id_file" fi -diff -urpa dracut-047.orig/modules.d/95terminfo/module-setup.sh dracut-047/modules.d/95terminfo/module-setup.sh ---- dracut-047.orig/modules.d/95terminfo/module-setup.sh 2018-02-19 09:00:33.000000000 +0000 -+++ dracut-047/modules.d/95terminfo/module-setup.sh 2018-03-15 12:16:03.615974274 +0000 +diff -urpa dracut-056.orig/modules.d/95terminfo/module-setup.sh dracut-056/modules.d/95terminfo/module-setup.sh +--- dracut-056.orig/modules.d/95terminfo/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95terminfo/module-setup.sh 2022-08-28 19:14:48.579968472 +0200 @@ -11,7 +11,9 @@ install() { - if [ -d ${_terminfodir} ]; then + if [[ -d $dracutsysrootdir${_terminfodir} ]]; then for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do inst_dir "$_terminfodir/${i%/*}" -- $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i" +- $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$dracutsysrootdir$_terminfodir/$i" + if [ -f "${initdir}/${_terminfodir}/${i%/*}" ]; then -+ $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i" ++ $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$dracutsysrootdir$_terminfodir/$i" + fi done fi } +Only in dracut-056.orig/modules.d/99base: init.sh.rej diff --git a/no_systemd.patch b/no_systemd.patch index 4250532..a6a10ff 100644 --- a/no_systemd.patch +++ b/no_systemd.patch @@ -1,268 +1,576 @@ -diff -urpa dracut-048.orig/dracut-logger.sh dracut-048/dracut-logger.sh ---- dracut-048.orig/dracut-logger.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/dracut-logger.sh 2018-07-21 21:00:11.629092688 +0000 -@@ -144,16 +144,7 @@ dlog_init() { +diff -urpa dracut-056.orig/dracut-init.sh dracut-056/dracut-init.sh +--- dracut-056.orig/dracut-init.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/dracut-init.sh 2022-08-30 01:20:04.811493149 +0200 +@@ -1089,16 +1089,6 @@ fi + is_qemu_virtualized() { + # 0 if a virt environment was detected + # 1 if a virt environment could not be detected +- # 255 if any error was encountered +- if type -P systemd-detect-virt > /dev/null 2>&1; then +- if ! vm=$(systemd-detect-virt --vm > /dev/null 2>&1); then +- return 255 +- fi +- [[ $vm == "qemu" ]] && return 0 +- [[ $vm == "kvm" ]] && return 0 +- [[ $vm == "bochs" ]] && return 0 +- fi +- + for i in /sys/class/dmi/id/*_vendor; do + [[ -f $i ]] || continue + read -r vendor < "$i" +diff -urpa dracut-056.orig/dracut-logger.sh dracut-056/dracut-logger.sh +--- dracut-056.orig/dracut-logger.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/dracut-logger.sh 2022-08-30 01:41:07.943471592 +0200 +@@ -142,16 +142,7 @@ dlog_init() { fi - if (( $sysloglvl > 0 )); then + if ((sysloglvl > 0)); then - if [[ -d /run/systemd/journal ]] \ -- && type -P systemd-cat &>/dev/null \ -- && systemctl --quiet is-active systemd-journald.socket &>/dev/null \ -- && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then +- && type -P systemd-cat &> /dev/null \ +- && systemctl --quiet is-active systemd-journald.socket &> /dev/null \ +- && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then - readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat" - mkfifo "$_systemdcatfile" - readonly _dlogfd=15 -- systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" & -- exec 15>"$_systemdcatfile" -- elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then -+ if ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then +- systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" & +- exec 15> "$_systemdcatfile" +- elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then ++ if ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then # We cannot log to syslog, so turn this facility off. kmsgloglvl=$sysloglvl sysloglvl=0 -diff -urpa dracut-048.orig/dracut.sh dracut-048/dracut.sh ---- dracut-048.orig/dracut.sh 2018-07-21 20:59:45.490094246 +0000 -+++ dracut-048/dracut.sh 2018-07-21 21:00:11.630092687 +0000 -@@ -1077,8 +1077,7 @@ if [[ ! $print_cmdline ]]; then - - if ! [[ -s $uefi_stub ]]; then - for uefi_stub in \ -- "${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \ -- "/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do -+ "/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do - [[ -s $uefi_stub ]] || continue - break - done -@@ -1319,32 +1318,6 @@ if ! [[ -d "$udevdir" ]]; then - [[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev +diff -urpa dracut-056.orig/dracut.sh dracut-056/dracut.sh +--- dracut-056.orig/dracut.sh 2022-08-28 17:26:54.017178064 +0200 ++++ dracut-056/dracut.sh 2022-08-30 01:40:33.614418115 +0200 +@@ -1186,13 +1186,6 @@ if [[ -f $dracutbasedir/dracut-version.s + . "$dracutbasedir"/dracut-version.sh fi --[[ -d $systemdutildir ]] \ -- || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null) +-if systemd-detect-virt -c &> /dev/null; then +- export DRACUT_NO_MKNOD=1 DRACUT_NO_XATTR=1 +- if [[ $hostonly ]]; then +- printf "%s\n" "dracut: WARNING: running in hostonly mode in a container!!" +- fi +-fi +- + if [[ -f $dracutbasedir/dracut-init.sh ]]; then + # shellcheck source=./dracut-init.sh + . "$dracutbasedir"/dracut-init.sh +@@ -1284,19 +1277,6 @@ esac + + abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile" + +-[[ -d $dracutsysrootdir$systemdutildir ]] \ +- || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2> /dev/null) - --if ! [[ -d "$systemdutildir" ]]; then -- [[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd -- [[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd +-if ! [[ -d $dracutsysrootdir$systemdutildir ]]; then +- [[ -e $dracutsysrootdir/lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd +- [[ -e $dracutsysrootdir/usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd -fi - --[[ -d $systemdsystemunitdir ]] \ -- || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null) +-[[ -d $dracutsysrootdir$systemdutilconfdir ]] \ +- || systemdutilconfdir=$(pkg-config systemd --variable=systemdutilconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdutilconfdir ]] || systemdutilconfdir=/etc/systemd +- + if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then + if ! [[ -f $srcmods/modules.dep ]]; then + if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then +@@ -1356,10 +1336,6 @@ if [[ ! $print_cmdline ]]; then + esac + + if ! [[ -s $uefi_stub ]]; then +- uefi_stub="$dracutsysrootdir${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" +- fi +- +- if ! [[ -s $uefi_stub ]]; then + dfatal "Can't find a uefi stub '$uefi_stub' to create a UEFI executable" + exit 1 + fi +@@ -1597,66 +1573,6 @@ for dev in "${!host_fs_types[@]}"; do + fi + done + +-[[ -d $dracutsysrootdir$dbus ]] \ +- || dbus=$(pkg-config dbus --variable=dbus 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbus ]] || dbus=/usr/share/dbus-1 +- +-[[ -d $dracutsysrootdir$dbusconfdir ]] \ +- || dbusconfdir=$(pkg-config dbus --variable=dbusconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbusconfdir ]] || dbusconfdir=/etc/dbus-1 +- +-[[ -d $dracutsysrootdir$dbusinterfaces ]] \ +- || dbusinterfaces=$(pkg-config dbus --variable=dbusinterfaces 2> /dev/null) - --[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system +-[[ -d $dracutsysrootdir$dbusinterfaces ]] || dbusinterfaces=${dbus}/interfaces - --[[ -d $systemdsystemconfdir ]] \ -- || systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2>/dev/null) +-[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] \ +- || dbusinterfacesconfdir=$(pkg-config dbus --variable=dbusinterfacesconfdir 2> /dev/null) - --[[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system +-[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] || dbusinterfacesconfdir=${dbusconfdir}/interfaces - --[[ -d $tmpfilesdir ]] \ -- || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null) +-[[ -d $dracutsysrootdir$dbusservices ]] \ +- || dbusservices=$(pkg-config dbus --variable=dbusservices 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbusservices ]] || dbusservices=${dbus}/services +- +-[[ -d $dracutsysrootdir$dbusservicesconfdir ]] \ +- || dbusservicesconfdir=$(pkg-config dbus --variable=dbusservicesconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbusservicesconfdir ]] || dbusservicesconfdir=${dbusconfdir}/services +- +-[[ -d $dracutsysrootdir$dbussession ]] \ +- || dbussession=$(pkg-config dbus --variable=dbussession 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussession ]] || dbussession=${dbus}/session.d +- +-[[ -d $dracutsysrootdir$dbussessionconfdir ]] \ +- || dbussessionconfdir=$(pkg-config dbus --variable=dbussessionconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussessionconfdir ]] || dbussessionconfdir=${dbusconfdir}/session.d +- +-[[ -d $dracutsysrootdir$dbussystem ]] \ +- || dbussystem=$(pkg-config dbus --variable=dbussystem 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussystem ]] || dbussystem=${dbus}/system.d +- +-[[ -d $dracutsysrootdir$dbussystemconfdir ]] \ +- || dbussystemconfdir=$(pkg-config dbus --variable=dbussystemconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussystemconfdir ]] || dbussystemconfdir=${dbusconfdir}/system.d +- +-[[ -d $dracutsysrootdir$dbussystemservices ]] \ +- || dbussystemservices=$(pkg-config dbus --variable=dbussystemservices 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussystemservices ]] || dbussystemservices=${dbus}/system-services +- +-[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] \ +- || dbussystemservicesconfdir=$(pkg-config dbus --variable=dbussystemservicesconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] || dbussystemservicesconfdir=${dbusconfdir}/system-services +- + [[ -d $dracutsysrootdir$udevdir ]] \ + || udevdir="$(pkg-config udev --variable=udevdir 2> /dev/null)" + if ! [[ -d $dracutsysrootdir$udevdir ]]; then +@@ -1679,114 +1595,22 @@ fi + + [[ -d $dracutsysrootdir$udevrulesconfdir ]] || udevrulesconfdir=${udevconfdir}/rules.d + +-[[ -d $dracutsysrootdir$sysctld ]] \ +- || sysctld=$(pkg-config systemd --variable=sysctld 2> /dev/null) +- + [[ -d $dracutsysrootdir$sysctld ]] || sysctld=/usr/lib/sysctl.d + +-[[ -d $dracutsysrootdir$sysctlconfdir ]] \ +- || sysctlconfdir=$(pkg-config systemd --variable=sysctlconfdir 2> /dev/null) +- + [[ -d $dracutsysrootdir$sysctlconfdir ]] || sysctlconfdir=/etc/sysctl.d + +-[[ -d $dracutsysrootdir$environment ]] \ +- || environment=$(pkg-config systemd --variable=environment 2> /dev/null) +- + [[ -d $dracutsysrootdir$environment ]] || environment=/usr/lib/environment.d + +-[[ -d $dracutsysrootdir$environmentconfdir ]] \ +- || environmentconfdir=$(pkg-config systemd --variable=environmentconfdir 2> /dev/null) +- + [[ -d $dracutsysrootdir$environmentconfdir ]] || environmentconfdir=/etc/environment.d + +-[[ -d $dracutsysrootdir$systemdcatalog ]] \ +- || systemdcatalog=$(pkg-config systemd --variable=systemdcatalog 2> /dev/null) - --if ! [[ -d "$tmpfilesdir" ]]; then -- [[ -d /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d -- [[ -d /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d +-[[ -d $dracutsysrootdir$systemdcatalog ]] || systemdcatalog=${systemdutildir}/catalog +- +-[[ -d $dracutsysrootdir$modulesload ]] \ +- || modulesload=$(pkg-config systemd --variable=modulesload 2> /dev/null) +- + [[ -d $dracutsysrootdir$modulesload ]] || modulesload=/usr/lib/modules-load.d + +-[[ -d $dracutsysrootdir$modulesloadconfdir ]] \ +- || modulesloadconfdir=$(pkg-config systemd --variable=modulesloadconfdir 2> /dev/null) +- + [[ -d $dracutsysrootdir$modulesloadconfdir ]] || modulesloadconfdir=/etc/modules-load.d + +-[[ -d $dracutsysrootdir$systemdnetwork ]] \ +- || systemdnetwork=$(pkg-config systemd --variable=systemdnetwork 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdnetwork ]] || systemdnetwork=${systemdutildir}/network +- +-[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] \ +- || systemdnetworkconfdir=$(pkg-config systemd --variable=systemdnetworkconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] || systemdnetworkconfdir=${systemdsystemconfdir}/network +- +-[[ -d $dracutsysrootdir$systemdntpunits ]] \ +- || systemdntpunits=$(pkg-config systemd --variable=systemdntpunits 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdntpunits ]] || systemdntpunits=${systemdutildir}/ntp-units.d +- +-[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] \ +- || systemdntpunitsconfdir=$(pkg-config systemd --variable=systemdntpunitsconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] || systemdntpunitsconfdir=${systemdsystemconfdir}/ntp-units.d +- +-[[ -d $dracutsysrootdir$systemdportable ]] \ +- || systemdportable=$(pkg-config systemd --variable=systemdportable 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdportable ]] || systemdportable=${systemdutildir}/portable +- +-[[ -d $dracutsysrootdir$systemdportableconfdir ]] \ +- || systemdportableconfdir=$(pkg-config systemd --variable=systemdportableconfdir 2> /dev/null) +- +-[[ -d "$dracutsysrootdir$systemdportableconfdir" ]] || systemdportableconfdir=${systemdsystemconfdir}/portable +- +-[[ -d $dracutsysrootdir$systemdsystemunitdir ]] \ +- || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2> /dev/null) +- +-[[ -d "$dracutsysrootdir$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system +- +-[[ -d $dracutsysrootdir$systemduser ]] \ +- || systemduser=$(pkg-config systemd --variable=systemduser 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemduser ]] || systemduser=${systemdutildir}/user +- +-[[ -d $dracutsysrootdir$systemduserconfdir ]] \ +- || systemduserconfdir=$(pkg-config systemd --variable=systemduserconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemduserconfdir ]] || systemduserconfdir=${systemdsystemconfdir}/user +- +-[[ -d $dracutsysrootdir$systemdsystemconfdir ]] \ +- || systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$systemdsystemconfdir ]] || systemdsystemconfdir=/etc/systemd/system +- +-[[ -d $dracutsysrootdir$sysusers ]] \ +- || sysusers=$(pkg-config systemd --variable=sysusers 2> /dev/null) +- + [[ -d $dracutsysrootdir$sysusers ]] || sysusers=/usr/lib/sysusers.d + +-[[ -d $dracutsysrootdir$sysusersconfdir ]] \ +- || sysusersconfdir=$(pkg-config systemd --variable=sysusersconfdir 2> /dev/null) +- + [[ -d $dracutsysrootdir$sysusersconfdir ]] || sysusersconfdir=/etc/sysusers.d + +-[[ -d $dracutsysrootdir$tmpfilesdir ]] \ +- || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2> /dev/null) +- +-if ! [[ -d $dracutsysrootdir$tmpfilesdir ]]; then +- [[ -d $dracutsysrootdir/lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d +- [[ -d $dracutsysrootdir/usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d -fi - - export initdir dracutbasedir \ - dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \ - mods_to_load \ -@@ -1354,9 +1327,7 @@ export initdir dracutbasedir \ +-[[ -d $dracutsysrootdir$tmpfilesconfdir ]] \ +- || tmpfilesconfdir=$(pkg-config systemd --variable=tmpfilesconfdir 2> /dev/null) +- +-[[ -d $dracutsysrootdir$tmpfilesconfdir ]] || tmpfilesconfdir=/etc/tmpfiles.d +- + [[ -d $dracutsysrootdir$depmodd ]] \ + || sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null) + +@@ -1806,15 +1630,9 @@ export initdir dracutbasedir \ stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ debug host_fs_types host_devs swap_devs sshkey add_fstab \ - DRACUT_VERSION udevdir prefix filesystems drivers \ -- systemdutildir systemdsystemunitdir systemdsystemconfdir \ -- hostonly_cmdline loginstall \ -- tmpfilesdir -+ hostonly_cmdline loginstall + DRACUT_VERSION udevdir udevconfdir udevrulesdir udevrulesconfdir \ +- prefix filesystems drivers dbus dbusconfdir dbusinterfaces \ +- dbusinterfacesconfdir dbusservices dbusservicesconfdir dbussession \ +- dbussessionconfdir dbussystem dbussystemconfdir dbussystemservices \ +- dbussystemservicesconfdir environment environmentconfdir modulesload \ ++ prefix filesystems drivers environment environmentconfdir modulesload \ + modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \ +- systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \ +- systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \ +- hostonly_cmdline loginstall tmpfilesdir tmpfilesconfdir depmodd \ +- depmodconfdir ++ hostonly_cmdline loginstall depmodd depmodconfdir mods_to_load="" # check all our modules to see if they should be sourced. -@@ -1558,17 +1529,6 @@ if [[ $kernel_only != yes ]]; then +@@ -2042,17 +1860,6 @@ if [[ $kernel_only != yes ]]; then cat "$f" >> "${initdir}/etc/fstab" done -- if [[ $systemdutildir ]]; then -- if [ -d ${initdir}/$systemdutildir ]; then -- mkdir -p ${initdir}/etc/conf.d +- if [[ $dracutsysrootdir$systemdutildir ]]; then +- if [[ -d ${initdir}/$systemdutildir ]]; then +- mkdir -p "${initdir}"/etc/conf.d - { - printf "%s\n" "systemdutildir=\"$systemdutildir\"" - printf "%s\n" "systemdsystemunitdir=\"$systemdsystemunitdir\"" - printf "%s\n" "systemdsystemconfdir=\"$systemdsystemconfdir\"" -- } > ${initdir}/etc/conf.d/systemd.conf +- } > "${initdir}"/etc/conf.d/systemd.conf - fi - fi - if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then dinfo "*** Resolving executable dependencies ***" find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \ -@@ -1849,23 +1809,4 @@ fi - - command -v restorecon &>/dev/null && restorecon -- "$outfile" +@@ -2587,25 +2394,4 @@ freeze_ok_for_fstype() { + esac + } -# We sync/fsfreeze only if we're operating on a live booted system. -# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, -# and there's no reason to sync, and *definitely* no reason to fsfreeze. -# 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 [[ -d $dracutsysrootdir/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 +- if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then +- FSFROZEN="$(dirname "$outfile")" +- if ! (fsfreeze -f "${FSFROZEN}" 2> /dev/null && fsfreeze -u "${FSFROZEN}" 2> /dev/null); then - dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" - fi +- unset FSFROZEN - fi -fi - exit 0 -diff -urpa dracut-048.orig/modules.d/02caps/module-setup.sh dracut-048/modules.d/02caps/module-setup.sh ---- dracut-048.orig/modules.d/02caps/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/02caps/module-setup.sh 2018-07-21 21:00:11.630092687 +0000 -@@ -13,13 +13,9 @@ depends() { +diff -urpa dracut-056.orig/modules.d/01fips/fips.sh dracut-056/modules.d/01fips/fips.sh +--- dracut-056.orig/modules.d/01fips/fips.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/01fips/fips.sh 2022-08-30 00:01:50.073198984 +0200 +@@ -4,15 +4,9 @@ type getarg > /dev/null 2>&1 || . /lib/d + + # systemd lets stdout go to journal only, but the system + # has to halt when the integrity check fails to satisfy FIPS. +-if [ -z "$DRACUT_SYSTEMD" ]; then +- fips_info() { +- info "$*" +- } +-else +- fips_info() { +- echo "$*" >&2 +- } +-fi ++fips_info() { ++ info "$*" ++} + + mount_boot() { + boot=$(getarg boot=) +diff -urpa dracut-056.orig/modules.d/02caps/module-setup.sh dracut-056/modules.d/02caps/module-setup.sh +--- dracut-056.orig/modules.d/02caps/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/02caps/module-setup.sh 2022-08-29 23:46:09.489747726 +0200 +@@ -14,12 +14,8 @@ depends() { # called by dracut 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 - dwarning "caps: does not work with systemd in the initramfs" - fi + 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 } - -diff -urpa dracut-048.orig/modules.d/04watchdog/module-setup.sh dracut-048/modules.d/04watchdog/module-setup.sh ---- dracut-048.orig/modules.d/04watchdog/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/04watchdog/module-setup.sh 2018-07-21 21:00:11.630092687 +0000 -@@ -12,21 +12,17 @@ depends() { - - # called by dracut +diff -urpa dracut-056.orig/modules.d/04watchdog/module-setup.sh dracut-056/modules.d/04watchdog/module-setup.sh +--- dracut-056.orig/modules.d/04watchdog/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/04watchdog/module-setup.sh 2022-08-29 23:49:02.214014930 +0200 +@@ -15,20 +15,17 @@ depends() { install() { -- # Do not add watchdog hooks if systemd module is included -- # In that case, systemd will manage watchdog kick + # Do not add watchdog hooks if systemd module is included + # In that case, systemd will manage watchdog kick - if ! dracut_module_included "systemd"; then -- inst_hook cmdline 00 "$moddir/watchdog.sh" -- inst_hook cmdline 50 "$moddir/watchdog.sh" +- inst_hook cmdline 00 "$moddir/watchdog.sh" +- inst_hook cmdline 50 "$moddir/watchdog.sh" - inst_hook pre-trigger 00 "$moddir/watchdog.sh" - inst_hook initqueue 00 "$moddir/watchdog.sh" -- inst_hook mount 00 "$moddir/watchdog.sh" -- inst_hook mount 50 "$moddir/watchdog.sh" -- inst_hook mount 99 "$moddir/watchdog.sh" +- inst_hook mount 00 "$moddir/watchdog.sh" +- inst_hook mount 50 "$moddir/watchdog.sh" +- inst_hook mount 99 "$moddir/watchdog.sh" - inst_hook pre-pivot 00 "$moddir/watchdog.sh" - inst_hook pre-pivot 99 "$moddir/watchdog.sh" -- inst_hook cleanup 00 "$moddir/watchdog.sh" -- inst_hook cleanup 99 "$moddir/watchdog.sh" +- inst_hook cleanup 00 "$moddir/watchdog.sh" +- inst_hook cleanup 99 "$moddir/watchdog.sh" - fi -+ inst_hook cmdline 00 "$moddir/watchdog.sh" -+ inst_hook cmdline 50 "$moddir/watchdog.sh" +- ++ inst_hook cmdline 00 "$moddir/watchdog.sh" ++ inst_hook cmdline 50 "$moddir/watchdog.sh" + inst_hook pre-trigger 00 "$moddir/watchdog.sh" + inst_hook initqueue 00 "$moddir/watchdog.sh" -+ inst_hook mount 00 "$moddir/watchdog.sh" -+ inst_hook mount 50 "$moddir/watchdog.sh" -+ inst_hook mount 99 "$moddir/watchdog.sh" ++ inst_hook mount 00 "$moddir/watchdog.sh" ++ inst_hook mount 50 "$moddir/watchdog.sh" ++ inst_hook mount 99 "$moddir/watchdog.sh" + inst_hook pre-pivot 00 "$moddir/watchdog.sh" + inst_hook pre-pivot 99 "$moddir/watchdog.sh" -+ inst_hook cleanup 00 "$moddir/watchdog.sh" -+ inst_hook cleanup 99 "$moddir/watchdog.sh" ++ inst_hook cleanup 00 "$moddir/watchdog.sh" ++ inst_hook cleanup 99 "$moddir/watchdog.sh" inst_hook emergency 02 "$moddir/watchdog-stop.sh" inst_multiple -o wdctl } -diff -urpa dracut-048.orig/modules.d/10i18n/console_init.sh dracut-048/modules.d/10i18n/console_init.sh ---- dracut-048.orig/modules.d/10i18n/console_init.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/10i18n/console_init.sh 2018-07-21 21:00:11.630092687 +0000 +diff -urpa dracut-056.orig/modules.d/10i18n/console_init.sh dracut-056/modules.d/10i18n/console_init.sh +--- dracut-056.orig/modules.d/10i18n/console_init.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/10i18n/console_init.sh 2022-08-30 01:27:10.881161304 +0200 @@ -1,11 +1,5 @@ #!/bin/sh -[ -n "$DRACUT_SYSTEMD" ] && exit 0 - --if [ -x $systemdutildir/systemd-vconsole-setup ]; then -- $systemdutildir/systemd-vconsole-setup "$@" +-if [ -x "$systemdutildir"/systemd-vconsole-setup ]; then +- "$systemdutildir"/systemd-vconsole-setup "$@" -fi - [ -e /etc/vconsole.conf ] && . /etc/vconsole.conf - DEFAULT_FONT=LatArCyrHeb-16 -diff -urpa dracut-048.orig/modules.d/10i18n/module-setup.sh dracut-048/modules.d/10i18n/module-setup.sh ---- dracut-048.orig/modules.d/10i18n/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/10i18n/module-setup.sh 2018-07-21 21:00:11.630092687 +0000 -@@ -16,12 +16,6 @@ depends() { - - # called by dracut + DEFAULT_FONT=eurlatgr +diff -urpa dracut-056.orig/modules.d/10i18n/module-setup.sh dracut-056/modules.d/10i18n/module-setup.sh +--- dracut-056.orig/modules.d/10i18n/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/10i18n/module-setup.sh 2022-08-29 23:49:56.738099274 +0200 +@@ -18,13 +18,6 @@ depends() { install() { + declare -A KEYMAPS + - if dracut_module_included "systemd"; then - unset FONT - unset KEYMAP -- [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf +- # shellcheck disable=SC1090 +- [[ -f "$dracutsysrootdir"/etc/vconsole.conf ]] && . "$dracutsysrootdir"/etc/vconsole.conf - fi - - KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps - DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}" + KBDSUBDIRS=(consolefonts consoletrans keymaps unimaps) + DEFAULT_FONT="${i18n_default_font:-eurlatgr}" I18N_CONF="/etc/locale.conf" -@@ -99,11 +93,9 @@ install() { +@@ -121,11 +114,9 @@ install() { install_base() { inst_multiple setfont loadkeys kbd_mode stty - if ! dracut_module_included "systemd"; then -- inst ${moddir}/console_init.sh /lib/udev/console_init -- inst_rules ${moddir}/10-console.rules +- inst "${moddir}"/console_init.sh /lib/udev/console_init +- inst_rules "${moddir}"/10-console.rules - inst_hook cmdline 20 "${moddir}/parse-i18n.sh" - fi -+ inst ${moddir}/console_init.sh /lib/udev/console_init -+ inst_rules ${moddir}/10-console.rules ++ inst "${moddir}"/console_init.sh /lib/udev/console_init ++ inst_rules "${moddir}"/10-console.rules + inst_hook cmdline 20 "${moddir}/parse-i18n.sh" if [[ ${kbddir} != "/usr/share" ]]; then inst_dir /usr/share -@@ -222,19 +214,11 @@ install() { - inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni +@@ -239,17 +230,11 @@ install() { + inst_simple "${kbddir}"/unimaps/"${FONT_UNIMAP}".uni fi -- if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then +- if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${I18N_CONF} ]]; then - inst_simple ${I18N_CONF} - else -- mksubdirs ${initdir}${I18N_CONF} -- print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} +- mksubdirs "${initdir}"${I18N_CONF} +- print_vars LC_ALL LANG >> "${initdir}"${I18N_CONF} - fi -+ mksubdirs ${initdir}${I18N_CONF} -+ print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} ++ mksubdirs "${initdir}"${I18N_CONF} ++ print_vars LC_ALL LANG >> "${initdir}"${I18N_CONF} -- if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then -- inst_simple ${VCONFIG_CONF} -- else -- mksubdirs ${initdir}${VCONFIG_CONF} -- print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} +- if ! dracut_module_included "systemd"; then +- mksubdirs "${initdir}"${VCONFIG_CONF} +- print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> "${initdir}"${VCONFIG_CONF} - fi -+ mksubdirs ${initdir}${VCONFIG_CONF} -+ print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} ++ mksubdirs "${initdir}"${VCONFIG_CONF} ++ print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> "${initdir}"${VCONFIG_CONF} return 0 } -diff -urpa dracut-048.orig/modules.d/40network/net-lib.sh dracut-048/modules.d/40network/net-lib.sh ---- dracut-048.orig/modules.d/40network/net-lib.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/40network/net-lib.sh 2018-07-21 21:00:11.630092687 +0000 -@@ -52,7 +52,7 @@ iface_name() { +@@ -278,11 +263,6 @@ install() { + if checks; then + install_base + +- # https://github.com/dracutdevs/dracut/issues/796 +- if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then +- inst_simple ${VCONFIG_CONF} +- fi +- + if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then + install_local_i18n || install_all_kbd + else +diff -urpa dracut-056.orig/modules.d/35network-legacy/module-setup.sh dracut-056/modules.d/35network-legacy/module-setup.sh +--- dracut-056.orig/modules.d/35network-legacy/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/35network-legacy/module-setup.sh 2022-08-29 23:48:24.023955850 +0200 +@@ -22,12 +22,6 @@ installkernel() { + install() { + local _arch + +- #Adding default link +- if dracut_module_included "systemd"; then +- inst_multiple -o "${systemdutildir}/network/99-default.link" +- [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link" +- fi +- + inst_multiple ip dhclient sed awk grep pgrep tr expr + + inst_multiple -o arping arping2 +diff -urpa dracut-056.orig/modules.d/35network-legacy/net-genrules.sh dracut-056/modules.d/35network-legacy/net-genrules.sh +--- dracut-056.orig/modules.d/35network-legacy/net-genrules.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/35network-legacy/net-genrules.sh 2022-08-29 23:59:17.879964809 +0200 +@@ -102,11 +102,8 @@ command -v fix_bootif > /dev/null || . / + + for iface in $IFACES; do + if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then +- if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then +- echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]" +- else +- echo "[ -f /tmp/net.${iface}.did-setup ]" +- fi > "$hookdir"/initqueue/finished/wait-"$iface".sh ++ echo "[ -f /tmp/net.${iface}.did-setup ]" ++ > "$hookdir"/initqueue/finished/wait-"$iface".sh + fi + done + # Default: We don't know the interface to use, handle all +diff -urpa dracut-056.orig/modules.d/40network/module-setup.sh dracut-056/modules.d/40network/module-setup.sh +--- dracut-056.orig/modules.d/40network/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/40network/module-setup.sh 2022-08-29 23:39:01.349085410 +0200 +@@ -9,23 +9,12 @@ check() { + depends() { + is_qemu_virtualized && echo -n "qemu-net " + +- for module in network-wicked network-manager network-legacy systemd-networkd; do +- if dracut_module_included "$module"; then +- network_handler="$module" +- break +- fi +- done ++ if dracut_module_included "network-legacy"; then ++ network_handler="$module" ++ fi + + if [ -z "$network_handler" ]; then +- if [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then +- network_handler="network-wicked" +- elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then +- network_handler="network-manager" +- elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then +- network_handler="systemd-networkd" +- else +- network_handler="network-legacy" +- fi ++ network_handler="network-legacy" + fi + echo "kernel-network-modules $network_handler" + return 0 +diff -urpa dracut-056.orig/modules.d/40network/net-lib.sh dracut-056/modules.d/40network/net-lib.sh +--- dracut-056.orig/modules.d/40network/net-lib.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/40network/net-lib.sh 2022-08-30 01:56:14.047883232 +0200 +@@ -59,7 +59,7 @@ iface_name() { configured_ifaces() { local IFACES="" iface_id="" rv=1 - [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces + [ -e "/tmp/net.ifaces" ] && read -r IFACES < /tmp/net.ifaces - if { pidof udevd || pidof systemd-udevd; } > /dev/null; then + if { pidof udevd; } > /dev/null; then for iface_id in $IFACES; do - echo $(iface_name $iface_id) + printf "%s\n" "$(iface_name "$iface_id")" rv=0 -diff -urpa dracut-048.orig/modules.d/50plymouth/module-setup.sh dracut-048/modules.d/50plymouth/module-setup.sh ---- dracut-048.orig/modules.d/50plymouth/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/50plymouth/module-setup.sh 2018-07-21 21:00:11.631092687 +0000 -@@ -41,9 +41,7 @@ install() { +diff -urpa dracut-056.orig/modules.d/50plymouth/module-setup.sh dracut-056/modules.d/50plymouth/module-setup.sh +--- dracut-056.orig/modules.d/50plymouth/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/50plymouth/module-setup.sh 2022-08-29 23:49:11.145028746 +0200 +@@ -44,8 +44,6 @@ install() { - inst_multiple readlink + inst_multiple plymouthd plymouth plymouth-set-default-theme - if ! dracut_module_included "systemd"; then - inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh @@ -271,33 +579,11 @@ diff -urpa dracut-048.orig/modules.d/50plymouth/module-setup.sh dracut-048/modul + inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh + inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh } - -diff -urpa dracut-048.orig/modules.d/50plymouth/plymouth-newroot.sh dracut-048/modules.d/50plymouth/plymouth-newroot.sh ---- dracut-048.orig/modules.d/50plymouth/plymouth-newroot.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/50plymouth/plymouth-newroot.sh 2018-07-21 21:00:11.631092687 +0000 -@@ -1,5 +1,5 @@ - #!/bin/sh - --if type plymouth >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then -+if type plymouth >/dev/null 2>&1; then - plymouth --newroot=$NEWROOT - fi -diff -urpa dracut-048.orig/modules.d/50plymouth/plymouth-pretrigger.sh dracut-048/modules.d/50plymouth/plymouth-pretrigger.sh ---- dracut-048.orig/modules.d/50plymouth/plymouth-pretrigger.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/50plymouth/plymouth-pretrigger.sh 2018-07-21 21:00:11.631092687 +0000 -@@ -1,6 +1,6 @@ - #!/bin/sh - --if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then -+if type plymouthd >/dev/null 2>&1; then - if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then - # first trigger graphics subsystem - udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1 -diff -urpa dracut-048.orig/modules.d/90btrfs/module-setup.sh dracut-048/modules.d/90btrfs/module-setup.sh ---- dracut-048.orig/modules.d/90btrfs/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90btrfs/module-setup.sh 2018-07-21 21:00:11.631092687 +0000 -@@ -42,9 +42,7 @@ install() { - esac +diff -urpa dracut-056.orig/modules.d/90btrfs/module-setup.sh dracut-056/modules.d/90btrfs/module-setup.sh +--- dracut-056.orig/modules.d/90btrfs/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90btrfs/module-setup.sh 2022-08-29 23:45:54.430724429 +0200 +@@ -43,9 +43,7 @@ install() { + inst_rules 64-btrfs-dm.rules fi - if ! dracut_module_included "systemd"; then @@ -306,32 +592,107 @@ diff -urpa dracut-048.orig/modules.d/90btrfs/module-setup.sh dracut-048/modules. + inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" inst_multiple -o btrfsck btrfs-zero-log - inst $(command -v btrfs) /sbin/btrfs -diff -urpa dracut-048.orig/modules.d/90crypt/crypt-run-generator.sh dracut-048/modules.d/90crypt/crypt-run-generator.sh ---- dracut-048.orig/modules.d/90crypt/crypt-run-generator.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90crypt/crypt-run-generator.sh 2018-07-21 21:00:11.631092687 +0000 + inst "$(command -v btrfs)" /sbin/btrfs +diff -urpa dracut-056.orig/modules.d/90crypt/crypt-lib.sh dracut-056/modules.d/90crypt/crypt-lib.sh +--- dracut-056.orig/modules.d/90crypt/crypt-lib.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90crypt/crypt-lib.sh 2022-08-30 00:31:11.632917988 +0200 +@@ -105,30 +105,22 @@ ask_for_password() { + + { + flock -s 9 +- # Prompt for password with plymouth, if installed and running. +- if type plymouth > /dev/null 2>&1 && plymouth --ping 2> /dev/null; then +- plymouth ask-for-password \ +- --prompt "$ply_prompt" --number-of-tries="$ply_tries" \ +- --command="$ply_cmd" +- ret=$? +- else +- if [ "$tty_echo_off" = yes ]; then +- stty_orig="$(stty -g)" +- stty -echo +- fi ++ if [ "$tty_echo_off" = yes ]; then ++ stty_orig="$(stty -g)" ++ stty -echo ++ fi + +- local i=1 +- while [ $i -le "$tty_tries" ]; do +- [ -n "$tty_prompt" ] \ +- && printf "%s" "$tty_prompt [$i/$tty_tries]:" >&2 +- eval "$tty_cmd" && ret=0 && break +- ret=$? +- i=$((i + 1)) +- [ -n "$tty_prompt" ] && printf '\n' >&2 +- done ++ local i=1 ++ while [ $i -le "$tty_tries" ]; do ++ [ -n "$tty_prompt" ] \ ++ && printf "%s" "$tty_prompt [$i/$tty_tries]:" >&2 ++ eval "$tty_cmd" && ret=0 && break ++ ret=$? ++ i=$((i + 1)) ++ [ -n "$tty_prompt" ] && printf '\n' >&2 ++ done + +- [ "$tty_echo_off" = yes ] && stty "$stty_orig" +- fi ++ [ "$tty_echo_off" = yes ] && stty "$stty_orig" + } 9> /.console_lock + + [ $ret -ne 0 ] && echo "Wrong password" >&2 +diff -urpa dracut-056.orig/modules.d/90crypt/crypt-run-generator.sh dracut-056/modules.d/90crypt/crypt-run-generator.sh +--- dracut-056.orig/modules.d/90crypt/crypt-run-generator.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90crypt/crypt-run-generator.sh 2022-08-30 00:00:07.766041555 +0200 +@@ -11,7 +11,7 @@ crypttab_contains "$luks" "$dev" && exit + allowdiscards="-" + + # parse for allow-discards +-if [ -n "$DRACUT_SYSTEMD" ] || strstr "$(cryptsetup --help)" "allow-discards"; then ++if strstr "$(cryptsetup --help)" "allow-discards"; then + if discarduuids=$(getargs "rd.luks.allow-discards"); then + discarduuids=$(str_replace "$discarduuids" 'luks-' '') + if strstr " $discarduuids " " ${luks##luks-}"; then @@ -24,8 +24,4 @@ fi echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab --if command -v systemctl >/dev/null; then +-if command -v systemctl > /dev/null; then - systemctl daemon-reload - systemctl start cryptsetup.target -fi exit 0 -diff -urpa dracut-048.orig/modules.d/90crypt/module-setup.sh dracut-048/modules.d/90crypt/module-setup.sh ---- dracut-048.orig/modules.d/90crypt/module-setup.sh 2018-07-21 20:59:45.494094245 +0000 -+++ dracut-048/modules.d/90crypt/module-setup.sh 2018-07-21 21:00:11.631092687 +0000 +diff -urpa dracut-056.orig/modules.d/90crypt/module-setup.sh dracut-056/modules.d/90crypt/module-setup.sh +--- dracut-056.orig/modules.d/90crypt/module-setup.sh 2022-08-28 19:27:11.079536407 +0200 ++++ dracut-056/modules.d/90crypt/module-setup.sh 2022-08-30 01:50:10.450316831 +0200 @@ -4,7 +4,7 @@ check() { - local _rootdev + local fs # if cryptsetup is not installed, then we cannot support encrypted devices. -- require_any_binary $systemdutildir/systemd-cryptsetup cryptsetup || return 1 +- require_any_binary "$systemdutildir"/systemd-cryptsetup cryptsetup || return 1 + require_any_binary cryptsetup || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do -@@ -59,13 +59,11 @@ install() { +@@ -20,17 +20,6 @@ check() { + depends() { + local deps + deps="dm rootfs-block" +- if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then +- if grep -q -e "fido2-device=" -e "fido2-cid=" "$dracutsysrootdir"/etc/crypttab; then +- deps+=" fido2" +- fi +- if grep -q "pkcs11-uri" "$dracutsysrootdir"/etc/crypttab; then +- deps+=" pkcs11" +- fi +- if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then +- deps+=" tpm2-tss" +- fi +- fi + echo "$deps" + return 0 + } +@@ -96,13 +85,11 @@ install() { fi inst_hook cmdline 30 "$moddir/parse-crypt.sh" @@ -348,30 +709,34 @@ diff -urpa dracut-048.orig/modules.d/90crypt/module-setup.sh dracut-048/modules. + inst_hook cmdline 10 "$moddir/parse-keydev.sh" + inst_hook cleanup 30 "$moddir/crypt-cleanup.sh" - if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then + if [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/crypttab ]]; then # filter /etc/crypttab for the devices we need -@@ -135,17 +133,5 @@ install() { - +@@ -176,21 +163,5 @@ install() { inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh" + inst_script "$moddir/crypt-run-generator.sh" "/sbin/crypt-run-generator" - 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 \ -- $systemdsystemunitdir/systemd-ask-password-console.path \ -- $systemdsystemunitdir/systemd-ask-password-console.service \ -- $systemdsystemunitdir/cryptsetup.target \ -- $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \ -- systemd-ask-password systemd-tty-ask-password-agent -- inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator +- "$tmpfilesdir"/cryptsetup.conf \ +- "$systemdutildir"/system-generators/systemd-cryptsetup-generator \ +- "$systemdutildir"/systemd-cryptsetup \ +- "$systemdsystemunitdir"/systemd-ask-password-console.path \ +- "$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 - fi - dracut_need_initqueue } -diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d/90crypt/parse-crypt.sh ---- dracut-048.orig/modules.d/90crypt/parse-crypt.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90crypt/parse-crypt.sh 2018-07-21 21:00:11.631092687 +0000 -@@ -40,12 +40,6 @@ else +diff -urpa dracut-056.orig/modules.d/90crypt/parse-crypt.sh dracut-056/modules.d/90crypt/parse-crypt.sh +--- dracut-056.orig/modules.d/90crypt/parse-crypt.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90crypt/parse-crypt.sh 2022-08-30 01:48:49.594190856 +0200 +@@ -36,12 +36,6 @@ else LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID) tout=$(getarg rd.luks.key.tout) @@ -384,7 +749,7 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d if [ -n "$PARTUUID" ]; then for uuid in $PARTUUID; do -@@ -56,26 +50,12 @@ else +@@ -58,28 +52,13 @@ else luksname="luks-$uuid" fi @@ -393,10 +758,12 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d - printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -- printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" +- # shellcheck disable=SC2016 +- printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") +- # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$uuid"; then @@ -412,12 +779,13 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d + printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -+ printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" ++ # shellcheck disable=SC2016 ++ printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new done elif [ -n "$SERIAL" ]; then -@@ -88,26 +68,12 @@ else +@@ -98,28 +77,13 @@ else luksname="luks-$serialid" fi @@ -426,10 +794,12 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d - printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -- printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" +- # shellcheck disable=SC2016 +- printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") +- # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$serialid"; then @@ -445,12 +815,13 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d + printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -+ printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" ++ # shellcheck disable=SC2016 ++ printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new done elif [ -n "$LUKS" ]; then -@@ -120,28 +86,13 @@ else +@@ -138,30 +102,14 @@ else luksname="luks-$luksid" fi @@ -460,10 +831,12 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d - printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -- printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" +- # shellcheck disable=SC2016 +- printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") +- # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$luksid"; then @@ -481,102 +854,106 @@ diff -urpa dracut-048.orig/modules.d/90crypt/parse-crypt.sh dracut-048/modules.d + printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" -+ printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" ++ # shellcheck disable=SC2016 ++ printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new - uuid=$luksid - while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done -@@ -154,19 +105,11 @@ else - } >> "$hookdir/emergency/90-crypt.sh" + if [ $is_keysource -eq 0 ]; then + uuid=$luksid +@@ -175,21 +123,12 @@ else + fi done elif getargbool 0 rd.auto; then - if [ -z "$DRACUT_SYSTEMD" ]; then - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" - printf -- '--unique --settled --onetime --name cryptroot-ask-%%k ' +- # shellcheck disable=SC2016 - printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' "$(command -v cryptroot-ask)" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" - printf -- '--unique --settled --onetime --name crypt-run-generator-%%k ' +- # shellcheck disable=SC2016 - printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' "$(command -v crypt-run-generator)" - } >> /etc/udev/rules.d/70-luks.rules.new - fi + { + printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" + printf -- '--unique --settled --onetime --name cryptroot-ask-%%k ' ++ # shellcheck disable=SC2016 + printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' "$(command -v cryptroot-ask)" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new fi echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new -diff -urpa dracut-048.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh dracut-048/modules.d/90dmsquash-live/dmsquash-live-root.sh ---- dracut-048.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90dmsquash-live/dmsquash-live-root.sh 2018-07-21 21:00:11.632092687 +0000 -@@ -41,12 +41,7 @@ fi +diff -urpa dracut-056.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh dracut-056/modules.d/90dmsquash-live/dmsquash-live-root.sh +--- dracut-056.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90dmsquash-live/dmsquash-live-root.sh 2022-08-30 00:32:12.334011986 +0200 +@@ -40,18 +40,11 @@ if [ "$fs" = "iso9660" -o "$fs" = "udf" + fi getarg rd.live.check -d check || check="" if [ -n "$check" ]; then - type plymouth >/dev/null 2>&1 && plymouth --hide-splash +- type plymouth > /dev/null 2>&1 && plymouth --hide-splash - if [ -n "$DRACUT_SYSTEMD" ]; then - p=$(dev_unit_name "$livedev") -- systemctl start checkisomd5@${p}.service +- systemctl start checkisomd5@"${p}".service - else -- checkisomd5 --verbose $livedev +- checkisomd5 --verbose "$livedev" - fi -+ checkisomd5 --verbose $livedev ++ checkisomd5 --verbose "$livedev" if [ $? -eq 1 ]; then die "CD check failed!" exit 1 -@@ -81,9 +76,6 @@ else - if [ "$(blkid -o value -s TYPE $livedev)" != "ntfs" ]; then - mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live - else -- # Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot -- # at the first glance, but ends with lots and lots of squashfs -- # errors, because systemd attempts to kill the ntfs-3g process?! - if [ -x "/usr/bin/ntfs-3g" ]; then - ( exec -a @ntfs-3g ntfs-3g -o ${liverw:-ro} $livedev /run/initramfs/live ) | vwarn - else -@@ -137,7 +129,6 @@ do_live_overlay() { + fi +- type plymouth > /dev/null 2>&1 && plymouth --show-splash + fi + + ln -s "$livedev" /run/initramfs/livedev +@@ -142,7 +135,6 @@ do_live_overlay() { fi if [ -n "$overlayfs" ]; then unset -v overlayfs -- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes" +- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" fi setup="yes" else -@@ -148,7 +139,6 @@ do_live_overlay() { - ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork$opt - if [ -z "$overlayfs" ]; then - overlayfs="yes" -- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes" - fi +@@ -151,9 +143,6 @@ do_live_overlay() { + && [ -d /run/initramfs/overlayfs/ovlwork ]; then + ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs${readonly_overlay:+-r} + ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork${readonly_overlay:+-r} +- if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then +- reloadsysrootmountunit=":>/xor_overlayfs;" +- fi + overlayfs="required" setup="yes" fi -@@ -159,7 +149,6 @@ do_live_overlay() { - ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork$opt - if [ -z "$overlayfs" ]; then - overlayfs="yes" -- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes" - fi +@@ -162,9 +151,6 @@ do_live_overlay() { + && [ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then + ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs${readonly_overlay:+-r} + ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork${readonly_overlay:+-r} +- if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then +- reloadsysrootmountunit=":>/xor_overlayfs;" +- fi + overlayfs="required" setup="yes" fi -@@ -169,7 +158,6 @@ do_live_overlay() { - if [ $? != 0 ]; then +@@ -175,7 +161,6 @@ do_live_overlay() { + die "OverlayFS is required but not available." + exit 1 + fi +- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" m='OverlayFS is not available; using temporary Device-mapper overlay.' + info "$m" unset -v overlayfs setup -- [ -n "$reloadsysrootmountunit" ] && unset -v reloadsysrootmountunit - fi - fi - -@@ -182,23 +170,8 @@ do_live_overlay() { +@@ -191,29 +176,12 @@ do_live_overlay() { m="$m"$'\n All root filesystem changes will be lost on shutdown.' m="$m"$'\n Press [Enter] to continue.' - echo -e "\n\n\n\n${m}\n\n\n" > /dev/kmsg + printf "\n\n\n\n%s\n\n\n" "${m}" > /dev/kmsg - if [ -n "$DRACUT_SYSTEMD" ]; then -- if type plymouth >/dev/null 2>&1 && plymouth --ping ; then -- if getargbool 0 rhgb || getargbool 0 splash ; then +- if type plymouth > /dev/null 2>&1 && plymouth --ping; then +- if getargbool 0 rhgb || getargbool 0 splash; then - m='>>>'$'\n''>>>'$'\n''>>>'$'\n\n\n'"$m" - m="${m%n.*}"$'n.\n\n\n''<<<'$'\n''<<<'$'\n''<<<' - plymouth display-message --text="${m}" @@ -588,82 +965,71 @@ diff -urpa dracut-048.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh dracu - systemd-ask-password --timeout=0 "${m}" - fi - else -- type plymouth >/dev/null 2>&1 && plymouth --ping && plymouth --quit -- read -s -r -p $'\n\n'"${m}" -n 1 reply +- type plymouth > /dev/null 2>&1 && plymouth --ping && plymouth --quit +- read -s -r -p $'\n\n'"${m}" -n 1 _ - fi -+ type plymouth >/dev/null 2>&1 && plymouth --ping && plymouth --quit -+ read -s -r -p $'\n\n'"${m}" -n 1 reply ++ read -s -r -p $'\n\n'"${m}" -n 1 _ fi if [ -n "$overlayfs" ]; then - mkdir -m 0755 /run/overlayfs -@@ -354,11 +327,6 @@ if [ -b "$OSMIN_LOOPDEV" ]; then - echo "0 $sz snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV P 8" | dmsetup create --readonly live-osimg-min - fi - --if [ -n "$reloadsysrootmountunit" ]; then -- > /xor_overlayfs -- systemctl daemon-reload --fi -- - ROOTFLAGS="$(getarg rootflags)" - - if [ -n "$overlayfs" ]; then -@@ -375,18 +343,14 @@ if [ -n "$overlayfs" ]; then + if [ -n "$readonly_overlay" ] && ! [ -h /run/overlayfs-r ]; then + info "No persistent overlay found." + unset -v readonly_overlay +- [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="${reloadsysrootmountunit}:>/xor_readonly;" + fi + else + dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size * 1024)) 2> /dev/null +@@ -296,9 +264,6 @@ if [ -e "$SQUASHED" ]; then + fi + elif [ -d /run/initramfs/squashfs/proc ]; then + FSIMG=$SQUASHED +- if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then +- reloadsysrootmountunit=":>/xor_overlayfs;" +- fi + overlayfs="required" + else + die "Failed to find a root filesystem in $SQUASHED." +@@ -384,16 +349,12 @@ if [ -n "$overlayfs" ]; then else - mount -r $FSIMG /run/rootfsbase + ovlfs=lowerdir=/run/rootfsbase fi - if [ -z "$DRACUT_SYSTEMD" ]; then -- #FIXME What to link to /dev/root? Is it even needed? - printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ -- 'lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork' \ -- "$NEWROOT" > $hookdir/mount/01-$$-live.sh +- "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ +- "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh - fi -+ #FIXME What to link to /dev/root? Is it even needed? + printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ -+ 'lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork' \ -+ "$NEWROOT" > $hookdir/mount/01-$$-live.sh ++ "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ ++ "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh else - ln -s /dev/mapper/live-rw /dev/root - if [ -z "$DRACUT_SYSTEMD" ]; then - [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" -- printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh +- printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh - fi + [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" -+ printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh - ln -s $BASE_LOOPDEV /run/rootfsbase ++ printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh fi + [ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs -diff -urpa dracut-048.orig/modules.d/90dmsquash-live/iso-scan.sh dracut-048/modules.d/90dmsquash-live/iso-scan.sh ---- dracut-048.orig/modules.d/90dmsquash-live/iso-scan.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90dmsquash-live/iso-scan.sh 2018-07-21 21:00:11.632092687 +0000 -@@ -16,7 +16,7 @@ do_iso_scan() { - local _name - local dev - for dev in /dev/disk/by-uuid/*; do -- _name=$(dev_unit_name "$dev") -+ _name="$dev" - [ -e /tmp/isoscan-${_name} ] && continue - > /tmp/isoscan-${_name} - mount -t auto -o ro "$dev" "/run/initramfs/isoscan" || continue -diff -urpa dracut-048.orig/modules.d/90dmsquash-live/module-setup.sh dracut-048/modules.d/90dmsquash-live/module-setup.sh ---- dracut-048.orig/modules.d/90dmsquash-live/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90dmsquash-live/module-setup.sh 2018-07-21 21:00:11.632092687 +0000 -@@ -31,9 +31,7 @@ install() { +diff -urpa dracut-056.orig/modules.d/90dmsquash-live/module-setup.sh dracut-056/modules.d/90dmsquash-live/module-setup.sh +--- dracut-056.orig/modules.d/90dmsquash-live/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90dmsquash-live/module-setup.sh 2022-08-30 01:22:36.037730409 +0200 +@@ -31,10 +31,6 @@ install() { inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh" inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root" inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan" -- inst_script "$moddir/dmsquash-generator.sh" $systemdutildir/system-generators/dracut-dmsquash-generator +- if dracut_module_included "systemd-initrd"; then +- inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator +- inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service" +- fi # should probably just be generally included inst_rules 60-cdrom_id.rules -- inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service" dracut_need_initqueue - } -diff -urpa dracut-048.orig/modules.d/90kernel-modules/module-setup.sh dracut-048/modules.d/90kernel-modules/module-setup.sh ---- dracut-048.orig/modules.d/90kernel-modules/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90kernel-modules/module-setup.sh 2018-07-21 21:00:11.632092687 +0000 -@@ -92,8 +92,6 @@ installkernel() { - install() { - inst_multiple -o /lib/modprobe.d/*.conf +diff -urpa dracut-056.orig/modules.d/90kernel-modules/module-setup.sh dracut-056/modules.d/90kernel-modules/module-setup.sh +--- dracut-056.orig/modules.d/90kernel-modules/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90kernel-modules/module-setup.sh 2022-08-29 23:47:25.754865711 +0200 +@@ -152,8 +152,6 @@ install() { + [[ -d /lib/modprobe.d ]] && inst_multiple -o "/lib/modprobe.d/*.conf" + [[ -d /usr/lib/modprobe.d ]] && inst_multiple -o "/usr/lib/modprobe.d/*.conf" [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf - if ! dracut_module_included "systemd"; then - inst_hook cmdline 01 "$moddir/parse-kernel.sh" @@ -671,218 +1037,162 @@ diff -urpa dracut-048.orig/modules.d/90kernel-modules/module-setup.sh dracut-048 + inst_hook cmdline 01 "$moddir/parse-kernel.sh" inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh } -diff -urpa dracut-048.orig/modules.d/90livenet/module-setup.sh dracut-048/modules.d/90livenet/module-setup.sh ---- dracut-048.orig/modules.d/90livenet/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90livenet/module-setup.sh 2018-07-21 21:00:11.632092687 +0000 +diff -urpa dracut-056.orig/modules.d/90livenet/module-setup.sh dracut-056/modules.d/90livenet/module-setup.sh +--- dracut-056.orig/modules.d/90livenet/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90livenet/module-setup.sh 2022-08-30 01:22:43.539742171 +0200 @@ -17,8 +17,5 @@ install() { inst_hook cmdline 29 "$moddir/parse-livenet.sh" inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh" inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot" - if dracut_module_included "systemd-initrd"; then -- inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator +- inst_script "$moddir/livenet-generator.sh" "$systemdutildir"/system-generators/dracut-livenet-generator - fi dracut_need_initqueue } -diff -urpa dracut-048.orig/modules.d/90lvm/module-setup.sh dracut-048/modules.d/90lvm/module-setup.sh ---- dracut-048.orig/modules.d/90lvm/module-setup.sh 2018-07-21 20:59:45.491094245 +0000 -+++ dracut-048/modules.d/90lvm/module-setup.sh 2018-07-21 21:00:11.632092687 +0000 -@@ -97,15 +97,8 @@ install() { - - # Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut! - if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]]; then -- if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then -- sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \ -- ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules -- sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules -- sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules -- else -- sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \ -- ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules -- fi -+ sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \ -+ ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules - fi - - # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules -diff -urpa dracut-048.orig/modules.d/90mdraid/module-setup.sh dracut-048/modules.d/90mdraid/module-setup.sh ---- dracut-048.orig/modules.d/90mdraid/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90mdraid/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -126,17 +126,6 @@ install() { +diff -urpa dracut-056.orig/modules.d/90mdraid/module-setup.sh dracut-056/modules.d/90mdraid/module-setup.sh +--- dracut-056.orig/modules.d/90mdraid/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90mdraid/module-setup.sh 2022-08-29 23:45:43.188707041 +0200 +@@ -121,20 +121,6 @@ install() { inst_hook shutdown 30 "$moddir/md-shutdown.sh" inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start - if dracut_module_included "systemd"; then -- if [ -e $systemdsystemunitdir/mdmon@.service ]; then -- inst_simple $systemdsystemunitdir/mdmon@.service +- if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]]; then +- inst_simple "$systemdsystemunitdir"/mdmon@.service - fi -- if [ -e $systemdsystemunitdir/mdadm-last-resort@.service ]; then -- inst_simple $systemdsystemunitdir/mdadm-last-resort@.service +- if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.service ]]; then +- inst_simple "$systemdsystemunitdir"/mdadm-last-resort@.service - fi -- if [ -e $systemdsystemunitdir/mdadm-last-resort@.timer ]; then -- inst_simple $systemdsystemunitdir/mdadm-last-resort@.timer +- if [[ -e $dracutsysrootdir$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 -urpa dracut-048.orig/modules.d/90multipath/module-setup.sh dracut-048/modules.d/90multipath/module-setup.sh ---- dracut-048.orig/modules.d/90multipath/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90multipath/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -107,14 +107,8 @@ install() { +diff -urpa dracut-056.orig/modules.d/90multipath/module-setup.sh dracut-056/modules.d/90multipath/module-setup.sh +--- dracut-056.orig/modules.d/90multipath/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/90multipath/module-setup.sh 2022-08-29 23:46:41.394797087 +0200 +@@ -132,17 +132,8 @@ install() { [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf" fi - if dracut_module_included "systemd"; then +- if mpathconf_installed; then +- inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service" +- $SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service +- fi - 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" +- inst_hook cleanup 02 "$moddir/multipathd-stop.sh" - fi + inst_hook pre-trigger 02 "$moddir/multipathd.sh" -+ inst_hook cleanup 02 "$moddir/multipathd-stop.sh" - - inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh" - inst_hook shutdown 20 "$moddir/multipath-shutdown.sh" -diff -urpa dracut-048.orig/modules.d/90qemu/module-setup.sh dracut-048/modules.d/90qemu/module-setup.sh ---- dracut-048.orig/modules.d/90qemu/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90qemu/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -3,14 +3,6 @@ - # called by dracut - check() { - if [[ $hostonly ]] || [[ $mount_needs ]]; then -- if type -P systemd-detect-virt >/dev/null 2>&1; then -- vm=$(systemd-detect-virt --vm 2>/dev/null) -- (($? != 0)) && return 255 -- [[ $vm = "qemu" ]] && return 0 -- [[ $vm = "kvm" ]] && return 0 -- [[ $vm = "bochs" ]] && return 0 -- fi -- - for i in /sys/class/dmi/id/*_vendor; do - [[ -f $i ]] || continue - read vendor < $i -diff -urpa dracut-048.orig/modules.d/90qemu-net/module-setup.sh dracut-048/modules.d/90qemu-net/module-setup.sh ---- dracut-048.orig/modules.d/90qemu-net/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90qemu-net/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -3,14 +3,6 @@ - # called by dracut - check() { - if [[ $hostonly ]] || [[ $mount_needs ]]; then -- if type -P systemd-detect-virt >/dev/null 2>&1; then -- vm=$(systemd-detect-virt --vm >/dev/null 2>&1) -- (($? != 0)) && return 255 -- [[ $vm = "qemu" ]] && return 0 -- [[ $vm = "kvm" ]] && return 0 -- [[ $vm = "bochs" ]] && return 0 -- fi -- - for i in /sys/class/dmi/id/*_vendor; do - [[ -f $i ]] || continue - read vendor < $i -diff -urpa dracut-048.orig/modules.d/90stratis/module-setup.sh dracut-048/modules.d/90stratis/module-setup.sh ---- dracut-048.orig/modules.d/90stratis/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/90stratis/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -22,13 +22,7 @@ install() { ++ inst_hook cleanup 02 "$moddir/multipathd-stop.sh" - inst_multiple stratisd-init thin_check thin_repair + inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh" + inst_hook shutdown 20 "$moddir/multipath-shutdown.sh" +diff -urpa dracut-056.orig/modules.d/91zipl/install_zipl_cmdline.sh dracut-056/modules.d/91zipl/install_zipl_cmdline.sh +--- dracut-056.orig/modules.d/91zipl/install_zipl_cmdline.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/91zipl/install_zipl_cmdline.sh 2022-08-30 01:53:26.508622304 +0200 +@@ -30,10 +30,6 @@ fi -- 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 -+ inst_hook cmdline 25 "$moddir/stratisd-start.sh" -+ inst_hook cleanup 25 "$moddir/stratisd-stop.sh" - } + umount ${MNT} -diff -urpa dracut-048.orig/modules.d/95debug/module-setup.sh dracut-048/modules.d/95debug/module-setup.sh ---- dracut-048.orig/modules.d/95debug/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95debug/module-setup.sh 2018-07-21 21:00:11.633092687 +0000 +-if [ -f /etc/cmdline.d/99zipl.conf ]; then +- systemctl restart dracut-cmdline.service +- systemctl restart systemd-udev-trigger.service +-fi + : > /tmp/install.zipl.cmdline-done + + exit 0 +diff -urpa dracut-056.orig/modules.d/95debug/module-setup.sh dracut-056/modules.d/95debug/module-setup.sh +--- dracut-056.orig/modules.d/95debug/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95debug/module-setup.sh 2022-08-30 01:51:43.760462213 +0200 @@ -15,7 +15,7 @@ depends() { install() { - inst_multiple -o cat ls ps grep more cat rm strace free showmount \ - ping netstat rpcinfo vi scp ping6 ssh find vi \ -- tcpdump cp less hostname mkdir systemd-analyze \ -+ tcpdump cp less hostname mkdir \ - fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck - - grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" -diff -urpa dracut-048.orig/modules.d/95fcoe/cleanup-fcoe.sh dracut-048/modules.d/95fcoe/cleanup-fcoe.sh ---- dracut-048.orig/modules.d/95fcoe/cleanup-fcoe.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95fcoe/cleanup-fcoe.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -4,11 +4,7 @@ - - if [ -e /var/run/lldpad.pid ]; then + inst_multiple -o ls ps grep more cat rm strace free showmount df du lsblk \ + ping netstat rpcinfo vi scp ping6 ssh find \ +- tcpdump cp dd less hostname mkdir systemd-analyze \ ++ tcpdump cp dd less hostname mkdir \ + fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck + + grep '^tcpdump:' "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd" +diff -urpa dracut-056.orig/modules.d/95fcoe/cleanup-fcoe.sh dracut-056/modules.d/95fcoe/cleanup-fcoe.sh +--- dracut-056.orig/modules.d/95fcoe/cleanup-fcoe.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95fcoe/cleanup-fcoe.sh 2022-08-30 00:01:38.521181213 +0200 +@@ -6,10 +6,8 @@ if [ -e /var/run/lldpad.pid ]; then lldpad -k -- # with systemd version 230, this is not necessary anymore -- # systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354 + # with systemd version 230, this is not necessary anymore + # systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354 - if [ -z "$DRACUT_SYSTEMD" ]; then +- # shellcheck disable=SC2174 - mkdir -m 0755 -p /run/initramfs/state/dev/shm - cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 - echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab - fi ++ # shellcheck disable=SC2174 + mkdir -m 0755 -p /run/initramfs/state/dev/shm + cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 + echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab fi -diff -urpa dracut-048.orig/modules.d/95fstab-sys/mount-sys.sh dracut-048/modules.d/95fstab-sys/mount-sys.sh ---- dracut-048.orig/modules.d/95fstab-sys/mount-sys.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95fstab-sys/mount-sys.sh 2018-07-21 21:00:11.633092687 +0000 -@@ -25,11 +25,7 @@ fstab_mount() { - return 0 - } +diff -urpa dracut-056.orig/modules.d/95fstab-sys/mount-sys.sh dracut-056/modules.d/95fstab-sys/mount-sys.sh +--- dracut-056.orig/modules.d/95fstab-sys/mount-sys.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95fstab-sys/mount-sys.sh 2022-08-29 23:58:56.546931985 +0200 +@@ -27,9 +27,7 @@ fstab_mount() { --# systemd will mount and run fsck from /etc/fstab and we don't want to --# run into a race condition. + # systemd will mount and run fsck from /etc/fstab and we don't want to + # run into a race condition. -if [ -z "$DRACUT_SYSTEMD" ]; then - [ -f /etc/fstab ] && fstab_mount /etc/fstab -fi +[ -f /etc/fstab ] && fstab_mount /etc/fstab # prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys - if [ -f $NEWROOT/etc/fstab.sys ]; then -diff -urpa dracut-048.orig/modules.d/95iscsi/cleanup-iscsi.sh dracut-048/modules.d/95iscsi/cleanup-iscsi.sh ---- dracut-048.orig/modules.d/95iscsi/cleanup-iscsi.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95iscsi/cleanup-iscsi.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -1,4 +1,4 @@ + if [ -f "$NEWROOT"/etc/fstab.sys ]; then +diff -urpa dracut-056.orig/modules.d/95iscsi/cleanup-iscsi.sh dracut-056/modules.d/95iscsi/cleanup-iscsi.sh +--- dracut-056.orig/modules.d/95iscsi/cleanup-iscsi.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95iscsi/cleanup-iscsi.sh 2022-08-30 00:02:04.813221666 +0200 +@@ -1,5 +1,5 @@ #!/bin/sh --[ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio -+[ -e /sys/module/bnx2i ] && killproc iscsiuio - -diff -urpa dracut-048.orig/modules.d/95iscsi/iscsiroot.sh dracut-048/modules.d/95iscsi/iscsiroot.sh ---- dracut-048.orig/modules.d/95iscsi/iscsiroot.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95iscsi/iscsiroot.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -36,7 +36,7 @@ iroot=${iroot#:} - # figured out a way how to check whether this is built-in or not - modprobe crc32c 2>/dev/null - --if [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then -+if [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then - iscsiuio - > /tmp/iscsiuio-started +-if [ -z "${DRACUT_SYSTEMD}" ] && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then ++if { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then + killproc iscsiuio fi -@@ -142,11 +142,6 @@ handle_netroot() - mkdir -p /etc/iscsi - ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi - > /tmp/iscsi_set_initiator -- if [ -n "$DRACUT_SYSTEMD" ]; then -- systemctl try-restart iscsid -- # FIXME: iscsid is not yet ready, when the service is :-/ -- sleep 1 -- fi +diff -urpa dracut-056.orig/modules.d/95iscsi/iscsiroot.sh dracut-056/modules.d/95iscsi/iscsiroot.sh +--- dracut-056.orig/modules.d/95iscsi/iscsiroot.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95iscsi/iscsiroot.sh 2022-08-30 00:04:28.936443406 +0200 +@@ -37,8 +37,7 @@ iroot=${iroot#:} + modprobe crc32c 2> /dev/null + + # start iscsiuio if needed +-if [ -z "${DRACUT_SYSTEMD}" ] \ +- && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \ ++if { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \ + && ! [ -e /tmp/iscsiuio-started ]; then + iscsiuio + : > /tmp/iscsiuio-started +@@ -159,11 +158,6 @@ handle_netroot() { + mkdir -p /etc/iscsi + ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi + : > /tmp/iscsi_set_initiator +- if [ -n "$DRACUT_SYSTEMD" ]; then +- systemctl try-restart iscsid +- # FIXME: iscsid is not yet ready, when the service is :-/ +- sleep 1 +- fi fi if [ -z "$iscsi_initiator" ]; then -@@ -163,11 +158,6 @@ handle_netroot() +@@ -180,11 +174,6 @@ handle_netroot() { mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi - > /tmp/iscsi_set_initiator + : > /tmp/iscsi_set_initiator - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ @@ -890,8 +1200,8 @@ diff -urpa dracut-048.orig/modules.d/95iscsi/iscsiroot.sh dracut-048/modules.d/9 - fi fi - -@@ -188,11 +178,6 @@ handle_netroot() + if [ -z "$iscsi_target_port" ]; then +@@ -204,17 +193,10 @@ handle_netroot() { if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi @@ -901,137 +1211,164 @@ diff -urpa dracut-048.orig/modules.d/95iscsi/iscsiroot.sh dracut-048/modules.d/9 - sleep 1 - fi fi - # FIXME $iscsi_protocol?? -@@ -204,12 +189,9 @@ handle_netroot() +- if [ -z "$DRACUT_SYSTEMD" ]; then +- iscsid +- sleep 2 +- fi ++ iscsid ++ sleep 2 + + # FIXME $iscsi_protocol?? + +@@ -226,8 +208,7 @@ handle_netroot() { wait_for_dev -n /dev/root # install mount script -- [ -z "$DRACUT_SYSTEMD" ] && \ -- echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh -+ echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh +- [ -z "$DRACUT_SYSTEMD" ] \ +- && echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > "$hookdir"/mount/01-$$-iscsi.sh ++ echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > "$hookdir"/mount/01-$$-iscsi.sh fi -- ### ToDo: Upstream calls systemd-run - Shall we, do we have to port this? -- - targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/') - [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1 - -@@ -250,14 +232,6 @@ if [ "$netif" != "timeout" ] && getargbo - all_ifaces_setup || exit 0 - fi - --if [ "$netif" = "timeout" ] && all_ifaces_setup; then -- # s.th. went wrong and the timeout script hits -- # restart -- systemctl restart iscsid -- # damn iscsid is not ready after unit says it's ready -- sleep 2 --fi -- - if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then - if [ "$netif" = "timeout" ] || [ "$netif" = "online" ] || [ "$netif" = "dummy" ]; then - [ -f /tmp/session-retry ] || echo 1 > /tmp/session-retry -diff -urpa dracut-048.orig/modules.d/95iscsi/module-setup.sh dracut-048/modules.d/95iscsi/module-setup.sh ---- dracut-048.orig/modules.d/95iscsi/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95iscsi/module-setup.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -208,17 +208,6 @@ install() { - inst_libdir_file 'libgcc_s.so*' - inst_multiple umount hostname iscsi-iname iscsiadm iscsid + if strglobin "$iscsi_target_ip" '*:*:*' && ! strglobin "$iscsi_target_ip" '['; then +diff -urpa dracut-056.orig/modules.d/95iscsi/module-setup.sh dracut-056/modules.d/95iscsi/module-setup.sh +--- dracut-056.orig/modules.d/95iscsi/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95iscsi/module-setup.sh 2022-08-30 01:38:50.480257424 +0200 +@@ -190,14 +190,6 @@ install() { + inst_multiple umount iscsi-iname iscsiadm iscsid + inst_binary sort -- ln -sf $systemdsystemunitdir/iscsid.socket $systemdsystemunitdir/sockets.target.wants/iscsid.socket -- ln -sf $systemdsystemunitdir/iscsiuio.socket $systemdsystemunitdir/sockets.target.wants/iscsiuio.socket -- - inst_multiple -o \ -- $systemdsystemunitdir/iscsid.socket \ -- $systemdsystemunitdir/iscsid.service \ -- $systemdsystemunitdir/iscsiuio.service \ -- $systemdsystemunitdir/iscsiuio.socket \ -- $systemdsystemunitdir/sockets.target.wants/iscsid.socket \ -- $systemdsystemunitdir/sockets.target.wants/iscsiuio.socket +- "$systemdsystemunitdir"/iscsid.socket \ +- "$systemdsystemunitdir"/iscsid.service \ +- "$systemdsystemunitdir"/iscsiuio.service \ +- "$systemdsystemunitdir"/iscsiuio.socket \ +- "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket \ +- "$systemdsystemunitdir"/sockets.target.wants/iscsiuio.socket - - [[ -d /etc/iscsi ]] && inst_dir $(/usr/bin/find /etc/iscsi) + if [[ $hostonly ]]; then + local -a _filenames - # Detect iBFT and perform mandatory steps -@@ -230,40 +219,7 @@ install() { +@@ -218,74 +210,7 @@ install() { inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh" inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh" inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot" +- - if ! dracut_module_included "systemd"; then - inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh" - else - inst_multiple -o \ -- $systemdsystemunitdir/iscsi.service \ -- $systemdsystemunitdir/iscsid.service \ -- $systemdsystemunitdir/iscsid.socket \ -- $systemdsystemunitdir/iscsiuio.service \ -- $systemdsystemunitdir/iscsiuio.socket \ -- iscsiadm iscsid -- -- mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants" -- for i in \ -- iscsiuio.socket \ -- ; do -- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}" -- done +- "$systemdsystemunitdir"/iscsi.service \ +- "$systemdsystemunitdir"/iscsi-init.service \ +- "$systemdsystemunitdir"/iscsid.service \ +- "$systemdsystemunitdir"/iscsid.socket \ +- "$systemdsystemunitdir"/iscsiuio.service \ +- "$systemdsystemunitdir"/iscsiuio.socket \ +- iscsiadm iscsid - -- mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants" - for i in \ -- iscsid.service \ -- iscsiuio.service \ -- ; do -- ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}" +- iscsid.socket \ +- iscsiuio.socket; do +- $SYSTEMCTL -q --root "$initdir" enable "$i" - done - -- # Make sure iscsid is started after dracut-cmdline and ready for the initqueue - mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d" -- ( +- { +- echo "[Unit]" +- echo "DefaultDependencies=no" +- echo "Conflicts=shutdown.target" +- echo "Before=shutdown.target" +- } > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" +- +- 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/iscsiuio.service.d" +- { +- echo "[Unit]" +- echo "DefaultDependencies=no" +- echo "Conflicts=shutdown.target" +- echo "Before=shutdown.target" +- } > "${initdir}/$systemdsystemunitdir/iscsiuio.service.d/dracut.conf" +- +- mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d" +- { - echo "[Unit]" -- echo "After=dracut-cmdline.service" -- echo "Before=dracut-initqueue.service" -- ) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" +- echo "DefaultDependencies=no" +- echo "Conflicts=shutdown.target" +- echo "Before=shutdown.target sockets.target" +- } > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf" +- +- # Fedora 34 iscsid requires iscsi-shutdown.service +- # which would terminate all iSCSI connections on switch root +- cat > "${initdir}/$systemdsystemunitdir/iscsi-shutdown.service" << EOF +-[Unit] +-Description=Dummy iscsi-shutdown.service for the initrd +-Documentation=man:iscsid(8) man:iscsiadm(8) +-DefaultDependencies=no +-Conflicts=shutdown.target +-After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service +-Before=remote-fs-pre.target +- +-[Service] +-Type=oneshot +-RemainAfterExit=false +-ExecStart=-/usr/bin/true +-EOF - fi + inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh" inst_dir /var/lib/iscsi - dracut_need_initqueue - } -diff -urpa dracut-048.orig/modules.d/95iscsi/parse-iscsiroot.sh dracut-048/modules.d/95iscsi/parse-iscsiroot.sh ---- dracut-048.orig/modules.d/95iscsi/parse-iscsiroot.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95iscsi/parse-iscsiroot.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -41,7 +41,7 @@ if [ "${root%%:*}" = "iscsi" ] ; then + mkdir -p "${initdir}/var/lib/iscsi/nodes" + # Fedora 34 iscsid wants a non-empty /var/lib/iscsi/nodes directory +diff -urpa dracut-056.orig/modules.d/95iscsi/parse-iscsiroot.sh dracut-056/modules.d/95iscsi/parse-iscsiroot.sh +--- dracut-056.orig/modules.d/95iscsi/parse-iscsiroot.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95iscsi/parse-iscsiroot.sh 2022-08-30 00:03:21.583339788 +0200 +@@ -41,7 +41,6 @@ if [ "${root%%:*}" = "iscsi" ]; then netroot=$root # if root is not specified try to mount the whole iSCSI LUN printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules - [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules -+ udevadm control --reload-rules root=/dev/root write_fs_tab /dev/root -@@ -58,7 +58,7 @@ done - if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp" ; then +@@ -58,7 +57,6 @@ done + if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp"; then # if root is not specified try to mount the whole iSCSI LUN printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules - [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules -+ udevadm control --reload-rules fi - if [ -n "$iscsiroot" ] ; then -@@ -116,11 +116,6 @@ if arg=$(getarg rd.iscsi.initiator -d is - 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 - fi + if [ -n "$iscsiroot" ]; then +@@ -84,7 +82,7 @@ if [ -n "$iscsi_firmware" ]; then + modprobe -b -q iscsi_boot_sysfs 2> /dev/null + modprobe -b -q iscsi_ibft + # if no ip= is given, but firmware +- echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-firmware' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh ++ echo "[ -f '/tmp/iscsistarted-firmware' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh + initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT" + initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT" + initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'" +@@ -110,11 +108,6 @@ if arg=$(getarg rd.iscsi.initiator -d is + 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 -@@ -133,11 +128,6 @@ if [ -z $iscsi_initiator ] && [ -f /sys/ + # If not given on the cmdline and initiator-name available via iBFT +@@ -126,11 +119,6 @@ if [ -z "$iscsi_initiator" ] && [ -f /sy mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi - > /tmp/iscsi_set_initiator + : > /tmp/iscsi_set_initiator - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ @@ -1040,112 +1377,83 @@ diff -urpa dracut-048.orig/modules.d/95iscsi/parse-iscsiroot.sh dracut-048/modul fi fi -diff -urpa dracut-048.orig/modules.d/95nbd/module-setup.sh dracut-048/modules.d/95nbd/module-setup.sh ---- dracut-048.orig/modules.d/95nbd/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95nbd/module-setup.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -34,9 +34,6 @@ install() { +@@ -145,7 +133,7 @@ for nroot in $(getargs netroot); do + type parse_iscsi_root > /dev/null 2>&1 || . /lib/net-lib.sh + parse_iscsi_root "$nroot" || return 1 + netroot_enc=$(str_replace "$nroot" '/' '\2f') +- echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh ++ echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh + done + + # Done, all good! +diff -urpa dracut-056.orig/modules.d/95nbd/module-setup.sh dracut-056/modules.d/95nbd/module-setup.sh +--- dracut-056.orig/modules.d/95nbd/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95nbd/module-setup.sh 2022-08-30 01:22:13.502695076 +0200 +@@ -32,8 +32,5 @@ install() { inst nbd-client inst_hook cmdline 90 "$moddir/parse-nbdroot.sh" inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot" - if dracut_module_included "systemd-initrd"; then -- inst_script "$moddir/nbd-generator.sh" $systemdutildir/system-generators/dracut-nbd-generator +- inst_script "$moddir/nbd-generator.sh" "$systemdutildir"/system-generators/dracut-nbd-generator - fi dracut_need_initqueue } - -diff -urpa dracut-048.orig/modules.d/95nbd/nbdroot.sh dracut-048/modules.d/95nbd/nbdroot.sh ---- dracut-048.orig/modules.d/95nbd/nbdroot.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95nbd/nbdroot.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -97,37 +97,15 @@ if [ "$root" = "block:/dev/root" -o "$ro - write_fs_tab /dev/root "$nbdfstype" "$fsopts" +diff -urpa dracut-056.orig/modules.d/95nbd/nbdroot.sh dracut-056/modules.d/95nbd/nbdroot.sh +--- dracut-056.orig/modules.d/95nbd/nbdroot.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95nbd/nbdroot.sh 2022-08-30 01:41:57.958549518 +0200 +@@ -101,27 +101,13 @@ if [ "$root" = "block:/dev/root" -o "$ro + udevadm control --reload wait_for_dev -n /dev/root - if [ -z "$DRACUT_SYSTEMD" ]; then -- printf '/bin/mount %s\n' \ -- "$NEWROOT" \ -- > $hookdir/mount/01-$$-nbd.sh -- fi --fi -- --if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then -- preopts="--systemd-mark $preopts" -+ printf '/bin/mount %s\n' \ -+ "$NEWROOT" \ -+ > $hookdir/mount/01-$$-nbd.sh - fi +- type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh ++ type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh - if [ "$nbdport" -gt 0 ] 2>/dev/null; then -- if [ -z "$DRACUT_SYSTEMD" ]; then -- nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1 -- else -- systemd-run --no-block --service-type=forking --quiet \ -- --description="nbd nbd0" \ -- -p 'DefaultDependencies=no' \ -- -p 'KillMode=none' \ -- --unit="nbd0" -- nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 -- fi -+ nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1 - else -- if [ -z "$DRACUT_SYSTEMD" ]; then -- nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1 +- write_fs_tab /dev/root "$nbdfstype" "$fsopts" ++ write_fs_tab /dev/root "$nbdfstype" "$fsopts" + +- printf '/bin/mount %s\n' \ +- "$NEWROOT" \ +- > "$hookdir"/mount/01-$$-nbd.sh - else -- systemd-run --no-block --service-type=forking --quiet \ -- --description="nbd nbd0" \ -- -p 'DefaultDependencies=no' \ -- -p 'KillMode=none' \ -- --unit="nbd0" -- nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 +- mkdir -p /run/systemd/system/sysroot.mount.d +- cat << EOF > /run/systemd/system/sysroot.mount.d/dhcp.conf +-[Mount] +-Where=/sysroot +-What=/dev/root +-Type=$nbdfstype +-Options=$fsopts +-EOF +- systemctl --no-block daemon-reload - fi -+ nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1 +- # if we're on systemd, use the nbd-generator script +- # to create the /sysroot mount. ++ printf '/bin/mount %s\n' \ ++ "$NEWROOT" \ ++ > "$hookdir"/mount/01-$$-nbd.sh fi - # NBD doesn't emit uevents when it gets connected, so kick it -diff -urpa dracut-048.orig/modules.d/95nbd/parse-nbdroot.sh dracut-048/modules.d/95nbd/parse-nbdroot.sh ---- dracut-048.orig/modules.d/95nbd/parse-nbdroot.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95nbd/parse-nbdroot.sh 2018-07-21 21:00:11.634092687 +0000 -@@ -46,11 +46,6 @@ fi - [ "${netroot%%:*}" = "nbd" ] || return - - --if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then -- echo "root=$netroot" > /etc/cmdline.d/root.conf -- systemctl --no-block daemon-reload --fi -- - # Check required arguments - netroot_to_var $netroot - [ -z "$server" ] && die "Argument server for nbdroot is missing" -diff -urpa dracut-048.orig/modules.d/95nfs/module-setup.sh dracut-048/modules.d/95nfs/module-setup.sh ---- dracut-048.orig/modules.d/95nfs/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95nfs/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -73,7 +73,7 @@ install() { - local _i - local _nsslibs - inst_multiple -o portmap rpcbind rpc.statd mount.nfs \ -- mount.nfs4 umount rpc.idmapd sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf" -+ mount.nfs4 umount rpc.idmapd sed /etc/netconfig chmod - inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf - - if [[ $hostonly_cmdline == "yes" ]]; then -diff -urpa dracut-048.orig/modules.d/95resume/module-setup.sh dracut-048/modules.d/95resume/module-setup.sh ---- dracut-048.orig/modules.d/95resume/module-setup.sh 2018-07-21 20:59:45.488094246 +0000 -+++ dracut-048/modules.d/95resume/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -33,15 +33,6 @@ install() { - [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf" + if ! [ "$nbdport" -gt 0 ] 2> /dev/null; then +diff -urpa dracut-056.orig/modules.d/95resume/module-setup.sh dracut-056/modules.d/95resume/module-setup.sh +--- dracut-056.orig/modules.d/95resume/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95resume/module-setup.sh 2022-08-29 23:50:05.938113509 +0200 +@@ -40,15 +40,6 @@ install() { + [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf" fi - # if systemd is included and has the hibernate-resume tool, use it and nothing else -- if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then +- if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then - inst_multiple -o \ -- $systemdutildir/system-generators/systemd-hibernate-resume-generator \ -- $systemdsystemunitdir/systemd-hibernate-resume@.service \ -- $systemdutildir/systemd-hibernate-resume +- "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \ +- "$systemdsystemunitdir"/systemd-hibernate-resume@.service \ +- "$systemdutildir"/systemd-hibernate-resume - return 0 - fi - # Optional uswsusp support - for _bin in /usr/sbin/resume /usr/@lib@/suspend/resume /usr/@lib@/uswsusp/resume - do -@@ -52,11 +43,7 @@ install() { + for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib64/suspend/resume /usr/lib/uswsusp/resume /usr/lib64/uswsusp/resume; do + [[ -x $dracutsysrootdir${_bin} ]] && { +@@ -58,11 +49,7 @@ install() { } done @@ -1156,12 +1464,12 @@ diff -urpa dracut-048.orig/modules.d/95resume/module-setup.sh dracut-048/modules - fi + inst_hook cmdline 10 "$moddir/parse-resume.sh" - inst_script "$moddir/resume.sh" /lib/dracut/resume.sh + inst_script "$moddir/resume.sh" /lib/dracut/resume.sh } -diff -urpa dracut-048.orig/modules.d/95rootfs-block/module-setup.sh dracut-048/modules.d/95rootfs-block/module-setup.sh ---- dracut-048.orig/modules.d/95rootfs-block/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95rootfs-block/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -69,11 +69,9 @@ install() { +diff -urpa dracut-056.orig/modules.d/95rootfs-block/module-setup.sh dracut-056/modules.d/95rootfs-block/module-setup.sh +--- dracut-056.orig/modules.d/95rootfs-block/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95rootfs-block/module-setup.sh 2022-08-29 23:46:22.156767313 +0200 +@@ -77,11 +77,9 @@ install() { inst_multiple umount inst_multiple tr @@ -1176,65 +1484,35 @@ diff -urpa dracut-048.orig/modules.d/95rootfs-block/module-setup.sh dracut-048/m inst_hook initqueue/timeout 99 "$moddir/rootfallback.sh" } -diff -urpa dracut-048.orig/modules.d/95udev-rules/module-setup.sh dracut-048/modules.d/95udev-rules/module-setup.sh ---- dracut-048.orig/modules.d/95udev-rules/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95udev-rules/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -11,20 +11,7 @@ install() { +diff -urpa dracut-056.orig/modules.d/95udev-rules/module-setup.sh dracut-056/modules.d/95udev-rules/module-setup.sh +--- dracut-056.orig/modules.d/95udev-rules/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/95udev-rules/module-setup.sh 2022-08-30 01:26:13.553071427 +0200 +@@ -11,18 +11,13 @@ install() { inst_dir /etc/udev inst_multiple -o /etc/udev/udev.conf -- [ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir -- for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do -- [ -x "$_i" ] || continue -- inst "$_i" +- [[ -d ${initdir}/$systemdutildir ]] || mkdir -p "${initdir}/$systemdutildir" +- for _i in "${systemdutildir}"/systemd-udevd "${udevdir}"/udevd /sbin/udevd; do ++ for _i in /sbin/udevd; do + [[ -x $dracutsysrootdir$_i ]] || continue + inst "$_i" - -- if ! [[ -f ${initdir}${systemdutildir}/systemd-udevd ]]; then -- ln -fs "$_i" ${initdir}${systemdutildir}/systemd-udevd +- if ! [[ -f ${initdir}${systemdutildir}/systemd-udevd ]]; then +- ln -fs "$_i" "${initdir}${systemdutildir}"/systemd-udevd - fi -- break -- done + break + done - if ! [[ -e ${initdir}${systemdutildir}/systemd-udevd ]]; then - derror "Cannot find [systemd-]udevd binary!" -- exit 1 -- fi -+ inst /sbin/udevd; - - inst_rules \ - 40-redhat.rules \ -@@ -56,11 +43,6 @@ install() { - # eudev rules - inst_rules 80-drivers-modprobe.rules - -- if dracut_module_included "systemd"; then -- inst_multiple -o ${systemdutildir}/network/*.link -- [[ $hostonly ]] && inst_multiple -H -o /etc/systemd/network/*.link -- fi -- - { - for i in cdrom tape dialout floppy; do - if ! grep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then -diff -urpa dracut-048.orig/modules.d/95virtfs/module-setup.sh dracut-048/modules.d/95virtfs/module-setup.sh ---- dracut-048.orig/modules.d/95virtfs/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/95virtfs/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -9,14 +9,6 @@ check() { - return 255 - } ++ if ! [[ -e /sbin/udevd ]]; then ++ derror "Cannot find udevd binary!" + exit 1 + fi -- if type -P systemd-detect-virt >/dev/null 2>&1; then -- vm=$(systemd-detect-virt --vm >/dev/null 2>&1) -- (($? != 0)) && return 255 -- [[ $vm = "qemu" ]] && return 0 -- [[ $vm = "kvm" ]] && return 0 -- [[ $vm = "bochs" ]] && return 0 -- fi -- - for i in /sys/class/dmi/id/*_vendor; do - [[ -f $i ]] || continue - read vendor < $i -diff -urpa dracut-048.orig/modules.d/98usrmount/module-setup.sh dracut-048/modules.d/98usrmount/module-setup.sh ---- dracut-048.orig/modules.d/98usrmount/module-setup.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/98usrmount/module-setup.sh 2018-07-21 21:00:11.635092687 +0000 -@@ -13,9 +13,7 @@ depends() { +diff -urpa dracut-056.orig/modules.d/98usrmount/module-setup.sh dracut-056/modules.d/98usrmount/module-setup.sh +--- dracut-056.orig/modules.d/98usrmount/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/98usrmount/module-setup.sh 2022-08-29 23:46:30.068779565 +0200 +@@ -13,8 +13,6 @@ depends() { # called by dracut install() { @@ -1244,18 +1522,106 @@ diff -urpa dracut-048.orig/modules.d/98usrmount/module-setup.sh dracut-048/modul + inst_hook pre-pivot 50 "$moddir/mount-usr.sh" : } +diff -urpa dracut-056.orig/modules.d/99base/dracut-dev-lib.sh dracut-056/modules.d/99base/dracut-dev-lib.sh +--- dracut-056.orig/modules.d/99base/dracut-dev-lib.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/99base/dracut-dev-lib.sh 2022-08-30 01:48:05.734122524 +0200 +@@ -25,11 +25,6 @@ str_replace() { + dev_unit_name() { + local dev="$1" + +- if command -v systemd-escape > /dev/null; then +- systemd-escape -p -- "$dev" +- return $? +- fi +- + if [ "$dev" = "/" -o -z "$dev" ]; then + printf -- "-" + return 0 +@@ -48,53 +43,6 @@ dev_unit_name() { + printf -- "%s" "$dev" + } -diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/99base/dracut-lib.sh ---- dracut-048.orig/modules.d/99base/dracut-lib.sh 2018-07-21 20:59:45.493094245 +0000 -+++ dracut-048/modules.d/99base/dracut-lib.sh 2018-07-21 21:00:11.636092687 +0000 -@@ -1,6 +1,5 @@ - #!/bin/sh +-# set_systemd_timeout_for_dev [-n] [] +-# Set 'rd.timeout' as the systemd timeout for +-set_systemd_timeout_for_dev() { +- local _name +- local _needreload +- local _noreload +- local _timeout +- +- [ -z "$DRACUT_SYSTEMD" ] && return 0 +- +- if [ "$1" = "-n" ]; then +- _noreload=1 +- shift +- fi +- +- if [ -n "$2" ]; then +- _timeout="$2" +- else +- _timeout=$(getarg rd.timeout) +- fi +- +- _timeout=${_timeout:-0} +- +- _name=$(dev_unit_name "$1") +- if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then +- [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants +- ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" +- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device +- _needreload=1 +- fi +- +- if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then +- mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d" +- { +- echo "[Unit]" +- echo "JobTimeoutSec=$_timeout" +- echo "JobRunningTimeoutSec=$_timeout" +- } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" +- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf +- _needreload=1 +- fi +- +- if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then +- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload +- fi +-} +- + # wait_for_dev [] + # + # Installs a initqueue-finished script, +@@ -122,7 +70,6 @@ wait_for_dev() { + printf 'warn "\"%s\" does not exist"\n' "$1" + } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" + +- set_systemd_timeout_for_dev $_noreload "$@" + } + + cancel_wait_for_dev() { +@@ -130,10 +77,4 @@ cancel_wait_for_dev() { + _name="$(str_replace "$1" '/' '\x2f')" + rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" + rm -f -- "$hookdir/emergency/80-${_name}.sh" +- if [ -n "$DRACUT_SYSTEMD" ]; then +- _name=$(dev_unit_name "$1") +- rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" +- rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" +- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload +- fi + } +diff -urpa dracut-056.orig/modules.d/99base/dracut-lib.sh dracut-056/modules.d/99base/dracut-lib.sh +--- dracut-056.orig/modules.d/99base/dracut-lib.sh 2022-08-28 19:16:30.263174545 +0200 ++++ dracut-056/modules.d/99base/dracut-lib.sh 2022-08-30 00:31:36.280956151 +0200 +@@ -2,7 +2,6 @@ + + type wait_for_dev > /dev/null 2>&1 || . /lib/dracut-dev-lib.sh -export DRACUT_SYSTEMD export NEWROOT if [ -n "$NEWROOT" ]; then - [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT -@@ -58,32 +57,13 @@ trim() { + [ -d "$NEWROOT" ] || mkdir -p -m 0755 "$NEWROOT" +@@ -63,33 +62,19 @@ trim() { printf "%s" "$var" } @@ -1270,8 +1636,9 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 - info() { - check_quiet - echo "<30>dracut: $*" > /dev/kmsg -- [ "$DRACUT_QUIET" != "yes" ] && \ +- if [ "$DRACUT_QUIET" != "yes" ]; then - echo "dracut: $*" >&2 +- fi - } - -else @@ -1284,17 +1651,23 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 - echo "$*" - } +warn() { -+ echo "Warning: $*" >&2 ++ check_quiet ++ echo "<28>dracut Warning: $*" > /dev/kmsg ++ echo "dracut Warning: $*" >&2 +} -fi +info() { -+ echo "$*" ++ check_quiet ++ echo "<30>dracut: $*" > /dev/kmsg ++ if [ "$DRACUT_QUIET" != "yes" ]; then ++ echo "dracut: $*" >&2 ++ fi +} vwarn() { - while read line || [ -n "$line" ]; do -@@ -475,10 +455,6 @@ die() { + while read -r line || [ -n "$line" ]; do +@@ -464,10 +449,6 @@ die() { source_hook "shutdown-emergency" fi @@ -1305,113 +1678,13 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 exit 1 } -@@ -883,77 +859,7 @@ wait_for_mount() - } >> "$hookdir/emergency/90-${_name}.sh" - } - --# get a systemd-compatible unit name from a path --# (mimicks unit_name_from_path_instance()) --dev_unit_name() --{ -- local dev="$1" -- -- if command -v systemd-escape >/dev/null; then -- systemd-escape -p -- "$dev" -- return -- fi - -- if [ "$dev" = "/" -o -z "$dev" ]; then -- printf -- "-" -- exit 0 -- fi -- -- dev="${1%%/}" -- dev="${dev##/}" -- dev="$(str_replace "$dev" '\' '\x5c')" -- dev="$(str_replace "$dev" '-' '\x2d')" -- if [ "${dev##.}" != "$dev" ]; then -- dev="\x2e${dev##.}" -- fi -- dev="$(str_replace "$dev" '/' '-')" -- -- printf -- "%s" "$dev" --} -- --# set_systemd_timeout_for_dev --# Set 'rd.timeout' as the systemd timeout for -- --set_systemd_timeout_for_dev() --{ -- local _name -- local _needreload -- local _noreload -- local _timeout -- -- if [ "$1" = "-n" ]; then -- _noreload=1 -- shift -- fi -- -- _timeout=$(getarg rd.timeout) -- _timeout=${_timeout:-0} -- -- if [ -n "$DRACUT_SYSTEMD" ]; then -- _name=$(dev_unit_name "$1") -- if ! [ -L ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device ]; then -- [ -d ${PREFIX}/etc/systemd/system/initrd.target.wants ] || mkdir -p ${PREFIX}/etc/systemd/system/initrd.target.wants -- ln -s ../${_name}.device ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device -- type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/${_name}.device -- _needreload=1 -- fi -- -- if ! [ -f ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf ]; then -- mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d -- { -- echo "[Unit]" -- echo "JobTimeoutSec=$_timeout" -- echo "JobRunningTimeoutSec=$_timeout" -- } > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf -- type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/systemd/system/${_name}.device.d/timeout.conf -- _needreload=1 -- fi -- -- if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then -- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload -- fi -- fi --} - # wait_for_dev - # - # Installs a initqueue-finished script, -@@ -981,8 +887,6 @@ wait_for_dev() - printf '[ -e "%s" ] || ' $1 - printf 'warn "\"%s\" does not exist"\n' $1 - } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" -- -- set_systemd_timeout_for_dev $_noreload $1 - } - - cancel_wait_for_dev() -@@ -991,12 +895,6 @@ cancel_wait_for_dev() - _name="$(str_replace "$1" '/' '\x2f')" - rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" - rm -f -- "$hookdir/emergency/80-${_name}.sh" -- if [ -n "$DRACUT_SYSTEMD" ]; then -- _name=$(dev_unit_name "$1") -- rm -f -- ${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device -- rm -f -- ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf -- /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload -- fi - } +@@ -924,43 +905,34 @@ fi - killproc() { -@@ -1081,43 +979,35 @@ fi - _emergency_shell() - { + _emergency_shell() { local _name="$1" - if [ -n "$DRACUT_SYSTEMD" ]; then -- > /.console_lock -- echo "PS1=\"$_name:\\\${PWD}# \"" >/etc/profile +- : > /.console_lock +- echo "PS1=\"$_name:\\\${PWD}# \"" > /etc/profile - systemctl start dracut-emergency.service - rm -f -- /etc/profile - rm -f -- /.console_lock @@ -1422,7 +1695,7 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 - /sbin/rdsosreport - echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot' - echo 'after mounting them and attach it to a bug report.' -- if ! RD_DEBUG= getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then +- if ! RD_DEBUG='' getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then - echo - echo 'To get more debug information in the report,' - echo 'reboot with "rd.debug" added to the kernel command line.' @@ -1435,12 +1708,20 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 + /sbin/rdsosreport + echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot' + echo 'after mounting them and attach it to a bug report.' -+ if ! RD_DEBUG= getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then ++ if ! RD_DEBUG='' getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then echo - export PS1="$_name:\${PWD}# " -- [ -e /.profile ] || >/.profile +- [ -e /.profile ] || : > /.profile - -- _ctty="$(RD_DEBUG= getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}" ++ echo 'To get more debug information in the report,' ++ echo 'reboot with "rd.debug" added to the kernel command line.' ++ fi ++ echo ++ echo 'Dropping to debug shell.' ++ echo ++ export PS1="$_name:\${PWD}# " ++ [ -e /.profile ] || : > /.profile + _ctty="$(RD_DEBUG='' getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}" - if [ -z "$_ctty" ]; then - _ctty=console - while [ -f /sys/class/tty/$_ctty/active ]; do @@ -1450,18 +1731,8 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 - _ctty=/dev/$_ctty - fi - [ -c "$_ctty" ] || _ctty=/dev/tty1 -- case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty";; esac -- setsid $CTTY /bin/sh -i -l 0<>$_ctty 1<>$_ctty 2<>$_ctty -+ echo 'To get more debug information in the report,' -+ echo 'reboot with "rd.debug" added to the kernel command line.' -+ fi -+ echo -+ echo 'Dropping to debug shell.' -+ echo -+ export PS1="$_name:\${PWD}# " -+ [ -e /.profile ] || >/.profile -+ -+ _ctty="$(RD_DEBUG= getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}" +- case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty" ;; esac +- setsid $CTTY /bin/sh -i -l 0<> $_ctty 1<> $_ctty 2<> $_ctty + if [ -z "$_ctty" ]; then + _ctty=console + while [ -f /sys/class/tty/$_ctty/active ]; do @@ -1471,84 +1742,62 @@ diff -urpa dracut-048.orig/modules.d/99base/dracut-lib.sh dracut-048/modules.d/9 + _ctty=/dev/$_ctty fi + [ -c "$_ctty" ] || _ctty=/dev/tty1 -+ case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty";; esac -+ setsid $CTTY /bin/sh -i -l 0<>$_ctty 1<>$_ctty 2<>$_ctty ++ case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty" ;; esac ++ setsid $CTTY /bin/sh -i -l 0<> $_ctty 1<> $_ctty 2<> $_ctty } - emergency_shell() -diff -urpa dracut-048.orig/modules.d/99base/init.sh dracut-048/modules.d/99base/init.sh ---- dracut-048.orig/modules.d/99base/init.sh 2018-07-21 20:59:45.493094245 +0000 -+++ dracut-048/modules.d/99base/init.sh 2018-07-21 21:00:11.636092687 +0000 -@@ -150,7 +150,7 @@ getargbool 0 rd.udev.info -d -y rdudevin + emergency_shell() { +@@ -976,11 +948,6 @@ emergency_shell() { + _rdshell_name=$2 + action="Shutdown" + hook="shutdown-emergency" +- if type plymouth > /dev/null 2>&1; then +- plymouth --hide-splash +- elif [ -x /oldroot/bin/plymouth ]; then +- /oldroot/bin/plymouth --hide-splash +- fi + shift 2 + fi + +diff -urpa dracut-056.orig/modules.d/99base/init.sh dracut-056/modules.d/99base/init.sh +--- dracut-056.orig/modules.d/99base/init.sh 2022-08-28 19:16:30.263174545 +0200 ++++ dracut-056/modules.d/99base/init.sh 2022-08-30 01:26:56.596138918 +0200 +@@ -141,7 +141,7 @@ getargbool 0 rd.udev.info -d -y rdudevin getargbool 0 rd.udev.debug -d -y rdudevdebug && UDEV_LOG=debug # start up udev and trigger cold plugs --UDEV_LOG=$UDEV_LOG $systemdutildir/systemd-udevd --daemon --resolve-names=never +-UDEV_LOG=$UDEV_LOG "$systemdutildir"/systemd-udevd --daemon --resolve-names=never +UDEV_LOG=$UDEV_LOG /sbin/udevd --daemon --resolve-names=never UDEV_QUEUE_EMPTY="udevadm settle --timeout=0" -diff -urpa dracut-048.orig/modules.d/99base/memtrace-ko.sh dracut-048/modules.d/99base/memtrace-ko.sh ---- dracut-048.orig/modules.d/99base/memtrace-ko.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/99base/memtrace-ko.sh 2018-07-21 21:00:11.636092687 +0000 -@@ -23,7 +23,7 @@ get_want_events() { - } - - get_event_filter() { -- echo "comm == systemd-udevd || comm == modprobe || comm == insmod" -+ echo "comm == udevd || comm == modprobe || comm == insmod" - } - - is_trace_ready() { -@@ -63,7 +63,7 @@ prepare_trace() { - echo "$(get_want_events)" > $trace_base/tracing/set_event - - # There are three kinds of known applications for module loading: -- # "systemd-udevd", "modprobe" and "insmod". -+ # "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. -diff -urpa dracut-048.orig/modules.d/99base/module-setup.sh dracut-048/modules.d/99base/module-setup.sh ---- dracut-048.orig/modules.d/99base/module-setup.sh 2018-07-21 20:59:45.493094245 +0000 -+++ dracut-048/modules.d/99base/module-setup.sh 2018-07-21 21:00:11.636092687 +0000 -@@ -46,11 +46,8 @@ install() { - inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" - mkdir -p "${initdir}/var" +diff -urpa dracut-056.orig/modules.d/99base/module-setup.sh dracut-056/modules.d/99base/module-setup.sh +--- dracut-056.orig/modules.d/99base/module-setup.sh 2022-08-28 19:23:42.688085700 +0200 ++++ dracut-056/modules.d/99base/module-setup.sh 2022-08-29 23:51:05.024204902 +0200 +@@ -53,11 +53,8 @@ install() { + inst_simple "$moddir/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" + mkdir -p "${initdir}"/var - if ! dracut_module_included "systemd"; then - inst_multiple switch_root || dfatal "Failed to install switch_root" - inst_hook cmdline 10 "$moddir/parse-root-opts.sh" -- inst_multiple -o $systemdutildir/systemd-timestamp +- inst_multiple -o "$systemdutildir"/systemd-timestamp - fi + inst_multiple switch_root || dfatal "Failed to install switch_root" + inst_hook cmdline 10 "$moddir/parse-root-opts.sh" if [[ $realinitpath ]]; then for i in $realinitpath; do -@@ -92,11 +89,8 @@ install() { - - ## save host_devs which we need bring up - if [[ $hostonly_cmdline == "yes" ]]; then -- if [[ -f "$initdir/lib/dracut/need-initqueue" ]] || ! dracut_module_included "systemd"; then -+ if [[ -f "$initdir/lib/dracut/need-initqueue" ]]; then +@@ -109,11 +106,8 @@ install() { + if [[ -n ${host_devs[*]} ]]; then + dracut_need_initqueue + fi +- if [[ -f $initdir/lib/dracut/need-initqueue ]] || ! dracut_module_included "systemd"; then ++ if [[ -f $initdir/lib/dracut/need-initqueue ]]; then ( - if dracut_module_included "systemd"; then -- DRACUT_SYSTEMD=1 +- export DRACUT_SYSTEMD=1 - fi - PREFIX="$initdir" - - . "$moddir/dracut-lib.sh" -diff -urpa dracut-048.orig/modules.d/99fs-lib/fs-lib.sh dracut-048/modules.d/99fs-lib/fs-lib.sh ---- dracut-048.orig/modules.d/99fs-lib/fs-lib.sh 2018-07-06 08:37:51.000000000 +0000 -+++ dracut-048/modules.d/99fs-lib/fs-lib.sh 2018-07-21 21:00:11.636092687 +0000 -@@ -247,9 +247,4 @@ write_fs_tab() { - fi + export PREFIX="$initdir" + export hookdir=/lib/dracut/hooks - echo "$_root /sysroot $_rootfstype $_rootflags $_fspassno 0" >> /etc/fstab -- -- if type systemctl >/dev/null 2>/dev/null; then -- systemctl daemon-reload -- systemctl --no-block start initrd-root-fs.target -- fi - } diff --git a/proc_sys_remount.patch b/proc_sys_remount.patch index 38b2ef4..9dc6e4e 100644 --- a/proc_sys_remount.patch +++ b/proc_sys_remount.patch @@ -1,7 +1,7 @@ -diff -urpa dracut-047.orig/modules.d/99base/init.sh dracut-047/modules.d/99base/init.sh ---- dracut-047.orig/modules.d/99base/init.sh 2018-02-19 09:00:33.000000000 +0000 -+++ dracut-047/modules.d/99base/init.sh 2018-03-15 12:11:57.060977050 +0000 -@@ -277,6 +277,26 @@ getarg 'rd.break=cleanup' -d 'rdbreak=cl +diff -urpa dracut-056.orig/modules.d/99base/init.sh dracut-056/modules.d/99base/init.sh +--- dracut-056.orig/modules.d/99base/init.sh 2022-02-18 12:32:53.000000000 +0100 ++++ dracut-056/modules.d/99base/init.sh 2022-08-28 19:12:37.568702916 +0200 +@@ -271,6 +271,26 @@ getarg 'rd.break=cleanup' -d 'rdbreak=cl source_hook cleanup # By the time we get here, the root filesystem should be mounted. @@ -25,6 +25,6 @@ diff -urpa dracut-047.orig/modules.d/99base/init.sh dracut-047/modules.d/99base/ +mount -o remount,$procopts /proc 2>&1 +mount -o remount,$sysopts /sys 2>&1 + - # Try to find init. + # Try to find init. for i in "$(getarg real_init=)" "$(getarg init=)" $(getargs rd.distroinit=) /sbin/init; do [ -n "$i" ] || continue diff --git a/update-initramfs b/update-initramfs index 23fc21d..d520b3c 100755 --- a/update-initramfs +++ b/update-initramfs @@ -23,7 +23,7 @@ if [ "x${1}" = "x" ]; then echo "Usage: update-initramfs " echo "Examples:" echo " update-initramfs all" - echo " update-initramfs 4.4.127-4.4-vanilla-1" + echo " update-initramfs 5.10.138-5.10-1" exit 0 elif [ "x${1}" = "xall" ]; then for kernel in $(/bin/ls -1 /lib/modules/ 2>/dev/null); do -- 2.46.0