From c6c9fbdab00d17dd2815606c004025434cdcefc8 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 20 Feb 2024 15:01:44 +0100 Subject: [PATCH 01/58] Initialize as a source-git repository From-dist-git-commit: a1ebaf27b616010bc672be9409ff42b8234b008d --- .distro/.gitignore | 2 + .distro/dracut.spec | 1970 ++++++++++++++++++++++++ .distro/lgpl-2.1.txt | 502 ++++++ .distro/newdracut.sh | 82 + .distro/source-git.yaml | 20 + .distro/tests/add-luks-keys/Makefile | 52 + .distro/tests/add-luks-keys/PURPOSE | 3 + .distro/tests/add-luks-keys/runtest.sh | 59 + .distro/tests/tests.yml | 11 + 9 files changed, 2701 insertions(+) create mode 100644 .distro/.gitignore create mode 100644 .distro/dracut.spec create mode 100644 .distro/lgpl-2.1.txt create mode 100755 .distro/newdracut.sh create mode 100644 .distro/source-git.yaml create mode 100644 .distro/tests/add-luks-keys/Makefile create mode 100644 .distro/tests/add-luks-keys/PURPOSE create mode 100644 .distro/tests/add-luks-keys/runtest.sh create mode 100644 .distro/tests/tests.yml diff --git a/.distro/.gitignore b/.distro/.gitignore new file mode 100644 index 000000000..de8aa9e3f --- /dev/null +++ b/.distro/.gitignore @@ -0,0 +1,2 @@ +# Reset gitignore rules +!* diff --git a/.distro/dracut.spec b/.distro/dracut.spec new file mode 100644 index 000000000..d5632a3f3 --- /dev/null +++ b/.distro/dracut.spec @@ -0,0 +1,1970 @@ +%define dracutlibdir %{_prefix}/lib/dracut +%bcond_without doc + +# We ship a .pc file but don't want to have a dep on pkg-config. We +# strip the automatically generated dep here and instead co-own the +# directory. +%global __requires_exclude pkg-config + +# rpmdev-bumpspec and releng automation compatible variable +%global baserelease 22 + +Name: dracut +Version: 059 +Release: %{baserelease}%{?dist} + +Summary: Initramfs generator using udev + +# The entire source code is GPLv2+ +# except install/* which is LGPLv2+ +# except util/* which is GPLv2 +License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-only + +URL: https://github.com/dracutdevs/dracut/wiki/ + +Source0: https://github.com/dracutdevs/dracut/archive/refs/tags/%{version}.tar.gz + +Source1: https://www.gnu.org/licenses/lgpl-2.1.txt + +BuildRequires: bash +BuildRequires: git-core +BuildRequires: pkgconfig(libkmod) >= 23 +BuildRequires: gcc + +BuildRequires: pkgconfig +BuildRequires: systemd +BuildRequires: bash-completion + +%if %{with doc} +BuildRequires: docbook-style-xsl docbook-dtds libxslt +BuildRequires: asciidoc +%endif + +Obsoletes: dracut-fips <= 047 +Provides: dracut-fips = %{version}-%{release} +Obsoletes: dracut-fips-aesni <= 047 +Provides: dracut-fips-aesni = %{version}-%{release} + +Requires: bash >= 4 +Requires: coreutils +Requires: cpio +Requires: filesystem >= 2.1.0 +Requires: findutils +Requires: grep +Requires: kmod +Requires: sed +Requires: xz +Requires: gzip + +Recommends: memstrack +Recommends: hardlink +Recommends: pigz +Recommends: kpartx +Recommends: (tpm2-tools if tpm2-tss) +Requires: util-linux >= 2.21 +Requires: systemd >= 219 +Requires: systemd-udev >= 219 +Requires: procps-ng + +Requires: libkcapi-hmaccalc + +%description +dracut contains tools to create bootable initramfses for the Linux +kernel. Unlike other implementations, dracut hard-codes as little +as possible into the initramfs. dracut contains various modules which +are driven by the event-based udev. Having root on MD, DM, LVM2, LUKS +is supported as well as NFS, iSCSI, NBD, FCoE with the dracut-network +package. + +%package network +Summary: dracut modules to build a dracut initramfs with network support +Requires: %{name} = %{version}-%{release} +Requires: iputils +Requires: iproute +Requires: jq +Requires: NetworkManager >= 1.20 +Suggests: NetworkManager +Obsoletes: dracut-generic < 008 +Provides: dracut-generic = %{version}-%{release} + +%description network +This package requires everything which is needed to build a generic +all purpose initramfs with network support with dracut. + +%package caps +Summary: dracut modules to build a dracut initramfs which drops capabilities +Requires: %{name} = %{version}-%{release} +Requires: libcap + +%description caps +This package requires everything which is needed to build an +initramfs with dracut, which drops capabilities. + +%package live +Summary: dracut modules to build a dracut initramfs with live image capabilities +Requires: %{name} = %{version}-%{release} +Requires: %{name}-network = %{version}-%{release} +Requires: tar gzip coreutils bash device-mapper curl parted +%if ! 0%{?rhel} +Requires: fuse ntfs-3g +%endif + +%description live +This package requires everything which is needed to build an +initramfs with dracut, with live image capabilities, like Live CDs. + +%package config-generic +Summary: dracut configuration to turn off hostonly image generation +Requires: %{name} = %{version}-%{release} +Obsoletes: dracut-nohostonly < 030 +Provides: dracut-nohostonly = %{version}-%{release} + +%description config-generic +This package provides the configuration to turn off the host specific initramfs +generation with dracut and generates a generic image by default. + +%package config-rescue +Summary: dracut configuration to turn on rescue image generation +Requires: %{name} = %{version}-%{release} +Obsoletes: dracut < 030 + +%description config-rescue +This package provides the configuration to turn on the rescue initramfs +generation with dracut. + +%package tools +Summary: dracut tools to build the local initramfs +Requires: %{name} = %{version}-%{release} + +%description tools +This package contains tools to assemble the local initrd and host configuration. + +%package squash +Summary: dracut module to build an initramfs with most files in a squashfs image +Requires: %{name} = %{version}-%{release} +Requires: squashfs-tools + +%description squash +This package provides a dracut module to build an initramfs, but store most files +in a squashfs image, result in a smaller initramfs size and reduce runtime memory +usage. + +%prep +%autosetup -n %{name}-%{version} -S git_am +cp %{SOURCE1} . + +%build +%configure --systemdsystemunitdir=%{_unitdir} \ + --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \ + --libdir=%{_prefix}/lib \ +%if %{without doc} + --disable-documentation \ +%endif + ${NULL} + +%make_build + +%install +%make_install %{?_smp_mflags} \ + libdir=%{_prefix}/lib + +echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh + +%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips +%endif + +# we do not support dash in the initramfs +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash + +# we do not support mksh in the initramfs +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh + +# Remove obsolete module +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/35network-legacy + +%ifnarch s390 s390x +# remove architecture specific modules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet +%else +rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock +%endif + +mkdir -p $RPM_BUILD_ROOT/boot/dracut +mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs + +install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf +rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse* + +echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf +echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf + +%files +%if %{with doc} +%doc README.md docs/HACKING.md AUTHORS NEWS.md dracut.html docs/dracut.png docs/dracut.svg +%endif +%license COPYING lgpl-2.1.txt +%{_bindir}/dracut +%{_datadir}/bash-completion/completions/dracut +%{_datadir}/bash-completion/completions/lsinitrd +%{_bindir}/lsinitrd +%dir %{dracutlibdir} +%dir %{dracutlibdir}/modules.d +%{dracutlibdir}/dracut-functions.sh +%{dracutlibdir}/dracut-init.sh +%{dracutlibdir}/dracut-functions +%{dracutlibdir}/dracut-version.sh +%{dracutlibdir}/dracut-logger.sh +%{dracutlibdir}/dracut-initramfs-restore +%{dracutlibdir}/dracut-install +%{dracutlibdir}/dracut-util +%{dracutlibdir}/skipcpio +%config(noreplace) %{_sysconfdir}/dracut.conf +%{dracutlibdir}/dracut.conf.d/01-dist.conf +%dir %{_sysconfdir}/dracut.conf.d +%dir %{dracutlibdir}/dracut.conf.d +%dir %{_datadir}/pkgconfig +%{_datadir}/pkgconfig/dracut.pc + +%if %{with doc} +%{_mandir}/man8/dracut.8* +%{_mandir}/man8/*service.8* +%{_mandir}/man1/lsinitrd.1* +%{_mandir}/man7/dracut.kernel.7* +%{_mandir}/man7/dracut.cmdline.7* +%{_mandir}/man7/dracut.modules.7* +%{_mandir}/man7/dracut.bootup.7* +%{_mandir}/man5/dracut.conf.5* +%endif + +%{dracutlibdir}/modules.d/00bash +%{dracutlibdir}/modules.d/00systemd +%{dracutlibdir}/modules.d/00systemd-network-management +%ifnarch s390 s390x +%{dracutlibdir}/modules.d/00warpclock +%endif +%{dracutlibdir}/modules.d/01fips +%{dracutlibdir}/modules.d/01systemd-ac-power +%{dracutlibdir}/modules.d/01systemd-ask-password +%{dracutlibdir}/modules.d/01systemd-coredump +%{dracutlibdir}/modules.d/01systemd-hostnamed +%{dracutlibdir}/modules.d/01systemd-initrd +%{dracutlibdir}/modules.d/01systemd-integritysetup +%{dracutlibdir}/modules.d/01systemd-journald +%{dracutlibdir}/modules.d/01systemd-ldconfig +%{dracutlibdir}/modules.d/01systemd-modules-load +%{dracutlibdir}/modules.d/01systemd-pcrphase +%{dracutlibdir}/modules.d/01systemd-portabled +%{dracutlibdir}/modules.d/01systemd-pstore +%{dracutlibdir}/modules.d/01systemd-repart +%{dracutlibdir}/modules.d/01systemd-resolved +%{dracutlibdir}/modules.d/01systemd-rfkill +%{dracutlibdir}/modules.d/01systemd-sysext +%{dracutlibdir}/modules.d/01systemd-sysctl +%{dracutlibdir}/modules.d/01systemd-sysusers +%{dracutlibdir}/modules.d/01systemd-timedated +%{dracutlibdir}/modules.d/01systemd-timesyncd +%{dracutlibdir}/modules.d/01systemd-tmpfiles +%{dracutlibdir}/modules.d/01systemd-udevd +%{dracutlibdir}/modules.d/01systemd-veritysetup +%{dracutlibdir}/modules.d/03modsign +%{dracutlibdir}/modules.d/03rescue +%{dracutlibdir}/modules.d/04watchdog +%{dracutlibdir}/modules.d/04watchdog-modules +%{dracutlibdir}/modules.d/05busybox +%{dracutlibdir}/modules.d/06dbus-broker +%{dracutlibdir}/modules.d/06dbus-daemon +%{dracutlibdir}/modules.d/06rngd +%{dracutlibdir}/modules.d/09dbus +%{dracutlibdir}/modules.d/10i18n +%{dracutlibdir}/modules.d/30convertfs +%{dracutlibdir}/modules.d/45url-lib +%{dracutlibdir}/modules.d/50drm +%{dracutlibdir}/modules.d/50plymouth +%{dracutlibdir}/modules.d/62bluetooth +%{dracutlibdir}/modules.d/80lvmmerge +%{dracutlibdir}/modules.d/80lvmthinpool-monitor +%{dracutlibdir}/modules.d/80test +%{dracutlibdir}/modules.d/80test-makeroot +%{dracutlibdir}/modules.d/80test-root +%{dracutlibdir}/modules.d/90btrfs +%{dracutlibdir}/modules.d/90crypt +%{dracutlibdir}/modules.d/90dm +%{dracutlibdir}/modules.d/90dmraid +%{dracutlibdir}/modules.d/90kernel-modules +%{dracutlibdir}/modules.d/90kernel-modules-extra +%{dracutlibdir}/modules.d/90lvm +%{dracutlibdir}/modules.d/90mdraid +%{dracutlibdir}/modules.d/90multipath +%{dracutlibdir}/modules.d/90nvdimm +%{dracutlibdir}/modules.d/90overlayfs +%{dracutlibdir}/modules.d/90ppcmac +%{dracutlibdir}/modules.d/90qemu +%{dracutlibdir}/modules.d/91crypt-gpg +%{dracutlibdir}/modules.d/91crypt-loop +%{dracutlibdir}/modules.d/91fido2 +%{dracutlibdir}/modules.d/91pcsc +%{dracutlibdir}/modules.d/91pkcs11 +%{dracutlibdir}/modules.d/91tpm2-tss +%{dracutlibdir}/modules.d/95debug +%{dracutlibdir}/modules.d/95fstab-sys +%{dracutlibdir}/modules.d/95lunmask +%{dracutlibdir}/modules.d/95resume +%{dracutlibdir}/modules.d/95rootfs-block +%{dracutlibdir}/modules.d/95terminfo +%{dracutlibdir}/modules.d/95udev-rules +%{dracutlibdir}/modules.d/95virtfs +%{dracutlibdir}/modules.d/95virtiofs +%ifarch s390 s390x +%{dracutlibdir}/modules.d/80cms +%{dracutlibdir}/modules.d/81cio_ignore +%{dracutlibdir}/modules.d/91zipl +%{dracutlibdir}/modules.d/95dasd +%{dracutlibdir}/modules.d/95dasd_mod +%{dracutlibdir}/modules.d/95dasd_rules +%{dracutlibdir}/modules.d/95dcssblk +%{dracutlibdir}/modules.d/95qeth_rules +%{dracutlibdir}/modules.d/95zfcp +%{dracutlibdir}/modules.d/95zfcp_rules +%endif +%{dracutlibdir}/modules.d/96securityfs +%{dracutlibdir}/modules.d/97masterkey +%{dracutlibdir}/modules.d/98integrity +%{dracutlibdir}/modules.d/97biosdevname +%{dracutlibdir}/modules.d/98dracut-systemd +%{dracutlibdir}/modules.d/98ecryptfs +%{dracutlibdir}/modules.d/98pollcdrom +%{dracutlibdir}/modules.d/98selinux +%{dracutlibdir}/modules.d/98syslog +%{dracutlibdir}/modules.d/98usrmount +%{dracutlibdir}/modules.d/99base +%{dracutlibdir}/modules.d/99memstrack +%{dracutlibdir}/modules.d/99fs-lib +%{dracutlibdir}/modules.d/99shutdown +%dir %{_sharedstatedir}/initramfs +%if %{defined _unitdir} +%{_unitdir}/dracut-shutdown.service +%{_unitdir}/dracut-shutdown-onfailure.service +%{_unitdir}/sysinit.target.wants/dracut-shutdown.service +%{_unitdir}/dracut-cmdline.service +%{_unitdir}/dracut-initqueue.service +%{_unitdir}/dracut-mount.service +%{_unitdir}/dracut-pre-mount.service +%{_unitdir}/dracut-pre-pivot.service +%{_unitdir}/dracut-pre-trigger.service +%{_unitdir}/dracut-pre-udev.service +%{_unitdir}/initrd.target.wants/dracut-cmdline.service +%{_unitdir}/initrd.target.wants/dracut-initqueue.service +%{_unitdir}/initrd.target.wants/dracut-mount.service +%{_unitdir}/initrd.target.wants/dracut-pre-mount.service +%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service +%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service +%{_unitdir}/initrd.target.wants/dracut-pre-udev.service +%endif +%{_prefix}/lib/kernel/install.d/50-dracut.install + +%files network +%{dracutlibdir}/modules.d/01systemd-networkd +%{dracutlibdir}/modules.d/35connman +%{dracutlibdir}/modules.d/35network-manager +%{dracutlibdir}/modules.d/35network-wicked +%{dracutlibdir}/modules.d/40network +%{dracutlibdir}/modules.d/45ifcfg +%{dracutlibdir}/modules.d/90kernel-network-modules +%{dracutlibdir}/modules.d/90qemu-net +%{dracutlibdir}/modules.d/95cifs +%{dracutlibdir}/modules.d/95fcoe +%{dracutlibdir}/modules.d/95fcoe-uefi +%{dracutlibdir}/modules.d/95iscsi +%{dracutlibdir}/modules.d/95nbd +%{dracutlibdir}/modules.d/95nfs +%{dracutlibdir}/modules.d/95nvmf +%{dracutlibdir}/modules.d/95ssh-client +%ifarch s390 s390x +%{dracutlibdir}/modules.d/95znet +%endif +%{dracutlibdir}/modules.d/99uefi-lib + +%files caps +%{dracutlibdir}/modules.d/02caps + +%files live +%{dracutlibdir}/modules.d/99img-lib +%{dracutlibdir}/modules.d/90dmsquash-live +%{dracutlibdir}/modules.d/90dmsquash-live-autooverlay +%{dracutlibdir}/modules.d/90dmsquash-live-ntfs +%{dracutlibdir}/modules.d/90livenet + +%files tools +%if %{with doc} +%doc %{_mandir}/man8/dracut-catimages.8* +%endif + +%{_bindir}/dracut-catimages +%dir /boot/dracut +%dir /var/lib/dracut +%dir /var/lib/dracut/overlay + +%files squash +%{dracutlibdir}/modules.d/99squash + +%files config-generic +%{dracutlibdir}/dracut.conf.d/02-generic-image.conf + +%files config-rescue +%{dracutlibdir}/dracut.conf.d/02-rescue.conf +%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install + +%changelog +* Mon Feb 12 2024 Pavel Valena - 059-22 +- Remove network-legacy module. + +* Sat Jan 27 2024 Manuel Fombuena - 059-21 +- fix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so +- fix(pcsc): add opensc load module file +- fix(pcsc): add --disable-polkit to pcscd.service + +* Wed Jan 24 2024 Fedora Release Engineering - 059-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 059-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Dec 08 2023 Dennis Gilmore - 059-18 +- Add Qualcomm IPC router to enable USB(Lenovo x13s) + +* Thu Nov 16 2023 Pavel Valena - 059-17 +- fix(dracut.sh): remove microcode check based on + +* Wed Nov 8 2023 Zbigniew Jedrzejewski-Szmek - 059-16 +- Backport patches to fix compatibility with systemd 255 + +* Sat Oct 28 2023 Adam Williamson - 059-15 +- Backport PR #2545 to fix media check failure visibility + +* Thu Oct 05 2023 Adam Williamson - 059-14 +- Backport PR #2196 to fix boot with iso-scan feature + +* Wed Sep 20 2023 Pavel Valena - 059-13 +- fix(dracut.spec): add jq dependency to network subpackage + +* Wed Aug 02 2023 Peter Robinson - 059-12 +- Include modules for IMA + +* Mon Jul 24 2023 Lukáš Nykrýn - 059-11 +- fix(dracut.sh): use dynamically uefi's sections offset + +* Mon Jul 24 2023 Pavel Valena - 059-10 +- feat(nvmf): support for NVMeoF + +* Wed Jul 19 2023 Fedora Release Engineering - 059-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jun 08 2023 Brian Masney - 059-8 +- Backport fix to add the interconnect drivers + +* Thu Apr 27 2023 Lukáš Zaoral - 059-7 +- migrate to SPDX license format + +* Thu Apr 27 2023 Michael Hofmann - 059-6 +- Backport fix to remove dependency on multipathd.socket + +* Tue Mar 14 2023 Dusty Mabe - 059-5 +- feat(network): include 98-default-mac-none.link if it exists + +* Thu Mar 09 2023 Pavel Valena - 059-4 +- fix(dmsquash-live): restore compatibility with earlier releases +- Re-add overlayfs module (drop patch 1934) +- revert(network-manager): avoid restarting NetworkManager + +* Fri Feb 24 2023 Pavel Valena - 059-3 +- fix(dracut.sh): handle --kmoddir with trailing / + +* Tue Feb 21 2023 Pavel Valena - 059-2 +- Revert: PR#1934 add overlayfs module + +* Mon Feb 13 2023 Pavel Valena - 059-1 +- Update to 059 +- feat(dracut.sh): option to skip creating initrd +- feat(kernel-modules): driver support for macbook keyboards + +* Thu Jan 19 2023 Fedora Release Engineering - 057-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sun Nov 13 2022 Davide Cavalca - 057-5 +- Backport fix to add sysctl to initramfs to handle modprobe files + +* Sat Oct 15 2022 Neal Gompa - 057-4 +- Backport dmsquash-live-autooverlay module + +* Thu Aug 25 2022 Pavel Valena - 057-3 +- Re-add patch Never-enable-the-bluetooth-module-by-default-1521 +- Recommend tpm2-tools package, as it's required by crypt module + +* Tue Aug 16 2022 Pavel Valena - 057-2 +- dmsquash-live-root: Run checkisomd5 on correct device + +* Thu Jul 21 2022 Fedora Release Engineering - 057-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jul 18 2022 Pavel Valena - 057-1 +- Update to 057 + +* Tue Apr 19 2022 Kevin Fenzi - 056-2 +- Add already upstream patch to change dracut-initramfs-restore to hopefully not break oz/composes + +* Thu Mar 03 2022 Peter Robinson - 056-1 +- Update to 056 + +* Thu Jan 20 2022 Fedora Release Engineering - 055-8.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 20 2021 Hans de Goede - 055-8 +- Backport upstream changes for drm-privacy screen support in kernel >= 5.17 + +* Thu Nov 4 2021 Jeremy Linton - 055-7 +- Backport Upstream: 15398458 fix(90kernel-modules): add isp1760 USB controller + +* Tue Oct 26 2021 Olivier Lemasle - 055-6 +- Backport PR #1611 to fix network manager when console is not usable + +* Mon Oct 18 2021 Adam Williamson - 055-5 +- Backport PR #1584 to fix missing block drivers, boot in EC2 (#2010058) + +* Wed Oct 06 2021 Peter Robinson - 055-4 +- Add USB Type-C to fix display/input/storage attached via it (rhbz #1964218) + +* Wed Jul 21 2021 Fedora Release Engineering - 055-3.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jul 09 2021 Dusty Mabe - 055-3 +- Fixes for NM running via systemd+dbus in the initramfs +- Drop requirement on deprecated systemd-udev-settle + +* Thu Jun 10 2021 Adam Williamson - 055-2 +- Never include bluetooth module by default (rhbz 1964879) (workaround) + +* Thu May 27 2021 Harald Hoyer - 055-1 +- version 055 +- install the missing fsck utils + +* Fri May 21 2021 Harald Hoyer - 054-12.git20210521 +- fix `get_maj_min` for kdump +- suppress hardlink output +- sane default --kerneldir for dracut-install +- squash: don't mount the mount points if already mounted + +* Tue May 18 2021 Harald Hoyer - 054-6.git20210518 +- fix for `str_replace: command not found` + +* Mon May 17 2021 Harald Hoyer - 054-4.git20210517 +- version 054 + +* Thu Apr 22 2021 Peter Robinson - 053-5 +- Backport: fix(90kernel-modules): add watchdog drivers for generic initrd (rhbz 1592148) + +* Mon Apr 19 2021 Dusty Mabe - 053-4 +- Backport: fix(dracut-logger.sh): double dash trigger unknown logger warnings during run +- Backport: fix(network-manager): nm-run.service: don't kill forked processes +- Backport: fix(network-manager): only run NetworkManager if rd.neednet=1 +- Backport: fix(network-manager): use /run/NetworkManager/initrd/neednet in initqueue + +* Mon Apr 19 2021 Adam Williamson - 053-3 +- Fix removal of key system files when kdump enabled (thanks kasong) (#1936781) + +* Thu Apr 08 2021 Adam Williamson - 053-2 +- Backport upstream change reported to fix boot on some encrypted LVM setups (#1946074) + +* Tue Feb 23 2021 Harald Hoyer - 053-1 +- version 053 + +* Tue Jan 26 2021 Fedora Release Engineering - 051-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Dec 15 2020 Harald Hoyer - 051-1 +- version 051 + +* Tue Oct 06 2020 Harald Hoyer - 050-167.git20201006 +- git snapshot + +* Fri Oct 02 2020 Harald Hoyer - 050-157.git20201002 +- git snapshot + +* Tue Sep 29 2020 Peter Robinson - 050-63.git20200529 +- Fixes for Arm GPUs in early boot + +* Fri Sep 25 2020 Peter Robinson - 050-62.git20200529 +- Fix for Rockchip devices + +* Wed Aug 19 2020 Merlin Mathesius - 050-61.git20200529.3 +- Correct conditionals to drop 51-dracut-rescue-postinst.sh for Fedora and + recent RHEL releases + +* Mon Jul 27 2020 Fedora Release Engineering - 050-61.git20200529.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 13 2020 Tom Stellard - 050-61.git20200529.1 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + +* Fri May 29 2020 Harald Hoyer - 050-61.git20200529 +- git snapshot + +* Mon Mar 16 2020 Harald Hoyer - 050-26.git20200316 +- fixed `--tmpdir` mishandling + +* Fri Mar 13 2020 Harald Hoyer - 050-25.git20200313 +- network-manager: ensure that nm-run.sh is executed for rd.neednet + +* Tue Mar 10 2020 Adam Williamson - 050-2 +- Backport fix for pre-trigger stage early exit from upstream (#1811070) + +* Wed Mar 04 2020 Harald Hoyer - 050-1 +- version 050 + +* Tue Jan 28 2020 Fedora Release Engineering - 049-27.git20181204.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 049-27.git20181204.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jun 12 2019 Adam Williamson - 049-27.git20181204 +- Backport PR #578 to fix RHBZ #1719057 (installer boot bug) + +* Thu Feb 14 2019 Adam Williamson - 049-26.git20181204 +- Backport PR #541 to fix RHBZ #1676357 (crasher bug) + +* Thu Jan 31 2019 Fedora Release Engineering - 049-25.git20181204.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Dec 04 2018 Harald Hoyer - 049-25.git20181204 +- git snapshot + +* Wed Oct 24 2018 Harald Hoyer - 049-11.git20181024 +- git snapshot + +* Wed Oct 10 2018 Harald Hoyer - 049-4.git20181010 +- fixed spec file +- git snapshot + +* Mon Oct 08 2018 Harald Hoyer - 049-1 +- version 049 + +* Fri Sep 21 2018 Harald Hoyer - 048-99.git20180921 +- git snapshot + +* Thu Jul 26 2018 Harald Hoyer - 048-14.git20180726 +- bring back 51-dracut-rescue-postinst.sh + +* Wed Jul 18 2018 Harald Hoyer - 048-6.git20180718 +- git snapshot + +* Thu Jul 12 2018 Fedora Release Engineering - 048-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jul 06 2018 Harald Hoyer - 048-1 +- version 048 + +* Fri Jun 22 2018 Adam Williamson - 047-34.git20180604.1 +- Test build with proposed fix for #1593028 + +* Mon Jun 04 2018 Harald Hoyer - 047-34.git20180604 +- git snapshot + +* Tue May 15 2018 Harald Hoyer - 047-32.git20180515 +- git snapshot + +* Mon Mar 05 2018 Harald Hoyer - 047-8 +- git snapshot + +* Tue Feb 27 2018 Javier Martinez Canillas - 047-2 +- Allow generating initramfs images on the /boot directory + +* Mon Feb 19 2018 Harald Hoyer - 047-1 +- version 047 + +* Wed Feb 07 2018 Fedora Release Engineering - 046-92.git20180118.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 18 2018 Harald Hoyer - 046-92 +- git snapshot + +* Fri Jan 05 2018 Harald Hoyer - 046-64 +- git snapshot + +* Fri Dec 01 2017 Harald Hoyer - 046-36 +- git snapshot + +* Wed Nov 29 2017 Harald Hoyer - 046-33 +- git snapshot + +* Thu Oct 12 2017 Peter Robinson 046-20 +- Add fix for some ARM SBCs + +* Tue Oct 10 2017 Harald Hoyer - 046-19 +- git snapshot + +* Thu Aug 24 2017 Harald Hoyer - 046-7 +- git snapshot + +* Fri Aug 11 2017 Harald Hoyer - 046-2 +- add support for dist-tag less build + +* Fri Aug 11 2017 Harald Hoyer - 046-1 +- version 046 + +* Mon Aug 7 2017 Peter Robinson 045-21.git20170515 +- Add upstream patches to fix a number of ARM devices with generic initrd + +* Wed Aug 02 2017 Fedora Release Engineering - 045-20.git20170515 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 045-19.git20170515 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 15 2017 Harald Hoyer - 045-18.git20170515 +- git snapshot + +* Wed Apr 12 2017 Peter Robinson 044-178 +- Add upstream patches needed for ARMv7/aarch64 fixes + +* Fri Feb 10 2017 Fedora Release Engineering - 044-177 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Dec 08 2016 Harald Hoyer - 044-176 +- git snapshot + +* Fri Aug 19 2016 Harald Hoyer - 044-117 +- git snapshot + +* Thu Aug 18 2016 Harald Hoyer - 044-109 +- git snapshot + +* Fri Aug 05 2016 Adam Williamson - 044-76 +- backport a single commit to fix RHBZ #1358416 (anaconda network init) + +* Tue Jun 07 2016 Harald Hoyer - 044-75 +- fix for systemd >= 230 +- git snapshot + +* Wed Feb 03 2016 Fedora Release Engineering - 044-18.git20160108 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 8 2016 Harald Hoyer - 044-17.git20160108 +- include more HID driver +- include machine info file +- fix network carrier detection +- fix nbd +- do not copy over lldpad state +- restorecon the final initramfs image + +* Tue Dec 1 2015 Harald Hoyer - 044-6.git20151201 +- fix for readonly /run on shutdown +- fix for the dmsquash-live module +Resolves: rhbz#1286866 + +* Wed Nov 25 2015 Harald Hoyer - 044-4.git20151127 +- fixes for the dmsquash-live module +- remove udev watch for raid members +- mode 0755 for the livenet generator +Resolves: rhbz#1285903 + +* Wed Nov 25 2015 Harald Hoyer - 044-1 +- version 044 + +* Mon Nov 16 2015 Harald Hoyer - 043-174.git20151116 +- git snapshot + +* Mon Nov 16 2015 Harald Hoyer - 043-173.git20151116 +- git snapshot + +* Fri Nov 13 2015 Harald Hoyer - 043-172.git20151113 +- git snapshot + +* Tue Aug 11 2015 Harald Hoyer 043-60.git20150811 +- fixed checkiso timeout +- fixed log output although quiet is set +- fixed qemu detection +- cleanup compressor handling + +* Wed Jul 22 2015 Harald Hoyer 043-40.git20150710.2 +- require "xz" to handle the kernel modules + +* Fri Jul 10 2015 Harald Hoyer 043-40.git20150710 +- git snapshot + +* Wed Jun 17 2015 Fedora Release Engineering - 043-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Jun 15 2015 Harald Hoyer 043-1 +- version 043, now with the complete tarball + +* Thu Jun 11 2015 Harald Hoyer 042-1 +- version 042, the answer to life, the universe and everything + +* Thu Feb 19 2015 Harald Hoyer 041-10.git20150219 +- git snapshot + +* Sat Jan 31 2015 Harald Hoyer 041-1 +- version 041 + +* Thu Jan 08 2015 Harald Hoyer 040-83.git20150108 +- git snapshot + +* Fri Dec 19 2014 Harald Hoyer 040-78.git20141219 +- git snapshot + +* Mon Dec 08 2014 Harald Hoyer 040-30.git20141208 +- fixed dracut-shutdown + +* Thu Dec 04 2014 Harald Hoyer 040-29.git20141204 +- git snapshot + +* Tue Sep 30 2014 Zbigniew Jędrzejewski-Szmek - 038-36.git20140815 +- Allow media check to be cancelled (rhbz 1147941) + +* Fri Sep 26 2014 Josh Boyer - 038-35.git20140815 +- Enable early-microcode by default (rhbz 1083716) +- Fix changelog date + +* Tue Aug 19 2014 Harald Hoyer - 038-34.git20140815 +- git snapshot + +* Sat Aug 16 2014 Fedora Release Engineering - 038-31.git20140815 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Harald Hoyer 038-30.git20140815 +- git snapshot + +* Thu Jul 24 2014 Harald Hoyer 038-14.git20140724 +- fixed lvm modules issues +Resolves: rhbz#1118890 +- fixed vlan issues +- fixed prelink for FIPS +- new rd.route parameter +- more ARM modules + +* Fri Jul 11 2014 Tom Callaway - 038-2 +- fix license handling + +* Mon Jun 30 2014 Harald Hoyer 038-1 +- version 038 + +* Sat Jun 28 2014 Zbigniew Jędrzejewski-Szmek - 037-14.git20140628 +- Pull most bugfixy commits from current git +Resolves: rhbz#1112061 + +* Sat Jun 07 2014 Fedora Release Engineering - 037-13.git20140402 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 23 2014 Peter Robinson 037-12.git20140402 +- Fix achi/mmc/sdhci selection for non host based initrd + +* Thu Apr 17 2014 Adam Williamson - 037-11.git20140402 +- revert broken upstream change that causes RHBZ#1084766 + +* Wed Apr 02 2014 Harald Hoyer 037-10.git20140402 +- fixed fstab.sys with systemd +- DHCPv6 fixes +- dm-cache module now included +- FCoE fixes + +* Thu Mar 20 2014 Harald Hoyer 037-3.git20140320 +- fixed dracut-initramfs-restore with microcode + +* Thu Mar 20 2014 Harald Hoyer 037-1 +- version 037 + +* Thu Feb 06 2014 Harald Hoyer 036-16.git20140206 +- version 036 +- parse dns information on "ip=" command line arg +- preserve ownership of files, if root creates the initramfs +- parse ibft nameserver settings +- do not run dhcp twice on an interface +- try to not reload systemd + +* Wed Dec 18 2013 Harald Hoyer 034-74.git20131218 +- do not systemctl daemon-reload +- do iscsistart for iscsi_firmware even without network + +* Mon Dec 16 2013 Harald Hoyer 034-70.git20131216 +- fixed systemd password waiting +- split out fcoe uefi +- fixed lvm thin tools check + +* Thu Dec 05 2013 Harald Hoyer 034-62.git20131205 +- fixed PATH shortener +- also install /etc/system-fips in the initramfs +- nbd, do not fail in hostonly mode +- add ohci-pci to the list of hardcoded modules +- lvm: do not run pvscan for lvmetad +- network fixes +- skip crypt swaps with password files +- fixed i18n + +* Wed Oct 30 2013 Harald Hoyer 034-24.git20131030 +- fixed booting with rd.iscsi.firmware and without root= +- fips: include crct10dif_generic +- fixed missing modules in hostonly, which have no modalias +- moved dracut to /usr/sbin + +* Mon Oct 21 2013 Harald Hoyer 034-19.git20131021 +- Fixed LVM with thin provisioning +Resolves: rhbz#1013767 +Resolves: rhbz#1021083 + +* Fri Oct 18 2013 Harald Hoyer 034-18.git20131018 +- Fixed LVM with thin provisioning +Resolves: rhbz#1013767 +- fixed swap detection in host only mode + +* Fri Oct 11 2013 Kyle McMartin 034-8.git20131008 +- Force mmc_block and usb_storage into ARM initramfs. +Resolves: rhbz#1015234 + +* Tue Oct 08 2013 Harald Hoyer 034-7.git20131008 +- lvm: install thin utils for non-hostonly +- do not bail out, if kernel modules dir is missing +- dmsquash-live: add /dev/mapper/live-base +Resolves: rhbz#1016726 + +* Tue Oct 08 2013 Harald Hoyer 034-1 +- version 034 +- add option to turn on/off prelinking + --prelink, --noprelink + do_prelink=[yes|no] +- add ACPI table overriding +- do not log to syslog/kmsg/journal for UID != 0 +- lvm/mdraid: Fix LVM on MD activation +- bcache module removed (now in bcache-tools upstream) +- mdadm: also install configs from /etc/mdadm.conf.d +- fixes for mdadm-3.2.6+ +- fcoe: add FCoE UEFI boot device support +- rootfs-block: add support for the rootfallback= kernel cmdline option + +* Fri Sep 13 2013 Harald Hoyer 033-3.git20130913 +- do not dhcp members of team, bond, etc. +- harden against weird ppc kernel driver +Resolves: rhbz#1007891 + +* Thu Sep 12 2013 Harald Hoyer 033-1 +- do not cache the kernel cmdline +Resolves: rhbz#989944 +- fixed iso-scan +Resolves: rhbz#1005487 +- support blkid with bcache +Resolves: rhbz#1003207 +- ifup with dhcp, if no ip= params specified +Resolves: rhbz#989944 +- silently try to umount rpc_pipefs +Resolves: rhbz#999996 + +* Wed Sep 04 2013 Harald Hoyer 032-23.git20130904 +- fixed curl error with zero size kickstart file +Resolves: rhbz#989133 +- fixed systemd-cat failure, when systemd is installed + but not actually running +Resolves: rhbz#1002021 +- do not fail on empty dracut module directories +Resolves: rhbz#1003153 + +* Tue Aug 20 2013 Harald Hoyer 032-1 +- fix for kdump in FIPS mode +Resolves: rhbz#920931 +- fixed iBFT booting +Resolves: rhbz#989944 +- fixed FIPS mode initramfs creation +Resolves: rhbz#990250 +- shutdown: fixed killall_proc_mountpoint() +Resolves: rhbz#996549 +- disable lvmetad in the initramfs +Resolves: rhbz#996627 +- require dhclient + +* Mon Aug 12 2013 Harald Hoyer 031-29.git20130812 +- added missing "then" in initqueue + +* Mon Aug 12 2013 Harald Hoyer 031-28.git20130812 +- fixed typo in hostonly device recognition + +* Fri Aug 09 2013 Harald Hoyer 031-24.git20130809 +- fixed logging to journal + +* Fri Aug 09 2013 Harald Hoyer 031-23.git20130809 +- fixed lsinitrd + +* Fri Aug 09 2013 Harald Hoyer 031-22.git20130809 +- lsinitrd.sh: add old cpio signature +- dracut.sh: call find with -print0 and cpio with --null +- dracut.asc: small corrections +- systemd/dracut-initqueue.sh: continue to boot if finished failed +- dracut.sh/dracut-functions.sh: handle root on non-block device +- dracut-functions.sh: removed non dracut-install shell functions +- dracut-functions.sh: inst_multiple == dracut_install +- 51-dracut-rescue.install: fixed rescue image creation +- dracut.sh: do not strip in FIPS mode +Resolves: rhbz#990250 +- dracut.sh: check the value of --kver +- crypt: Fix typo--/etc/crypttab not /etc/cryptab +- network/net-lib.sh: fix ibft interface configuration +- iscsi/module-setup.sh: install some modules regardless of hostonly +- multipath: need_shutdown if multipath devices exist +Resolves: rhbz#994913 +- omit drivers fix + +* Thu Aug 01 2013 Harald Hoyer 031-7.git20130801 +- also install vt102 terminfo + +* Wed Jul 31 2013 Harald Hoyer 031-6.git20130731 +- cmssetup: fixed port for zfcp.conf +- lvm: call lvchange with --yes to boot from snapshots + +* Wed Jul 31 2013 Harald Hoyer 031-4.git20130731 +- remove action_on_fail kernel command line parameter + +* Wed Jul 31 2013 Harald Hoyer 031-3.git20130731 +- do not include adjtime and localtime in the initramfs +- write out vlan configs + +* Wed Jul 31 2013 Harald Hoyer 031-1 +- do not include the resume dracut module in hostonly mode, + if no swap is present +- don't warn twice about omitted modules +- use systemd-cat for logging on systemd systems, if logfile is unset +- fixed PARTUUID parsing +- support kernel module signing keys +- do not install the usrmount dracut module in hostonly mode, + if /sbin/init does not live in /usr +- add debian udev rule files +- add support for bcache +- network: handle bootif style interfaces + e.g. ip=77-77-6f-6f-64-73:dhcp +- add support for kmod static devnodes +- add vlan support for iBFT + +* Wed Jul 24 2013 Kyle McMartin 030-2 +- Add ehci-tegra.ko to initramfs to allow rawhide tegra based platforms + to boot off USB disks. + +* Wed Jul 17 2013 Harald Hoyer 030-1 +- support new persistent network interface names +- fix findmnt calls, prevents hang on stale NFS mounts +- add systemd.slice and slice.target units +- major shell cleanup +- support root=PARTLABEL= and root=PARTUUID= +- terminfo: only install l/linux v/vt100 and v/vt220 +- unset all LC_* and LANG, 10% faster +- fixed dependency loop for dracut-cmdline.service +- do not wait_for_dev for the root devices +- do not wait_for_dev for devices, if dracut-initqueue is not needed +- support early microcode loading with --early-microcode +- dmraid, let dmraid setup its own partitions +- sosreport renamed to rdsosreport + +* Fri Jun 14 2013 Harald Hoyer 029-1 +- wait for IPv6 auto configuration +Resolves: rhbz#973719 +- i18n: make the default font configurable +- systemd/dracut-pre-pivot.service: also execute for cleanup hooks or rd.break +- add dracut-shutdown.service.8 manpage +- lvm: redirect error message of lvs to /dev/null +Resolves: rhbz#921235 + +* Wed Jun 12 2013 Harald Hoyer 028-1 +- lvm: fixed "thin" recognition +Resolves: rhbz#921235 +- install libs also from one dir above + fixes booting power6 generated initramfs on power7 +- setup correct system time and time zone in initrd +- cms fixups +Resolves: rhbz#970982 rhbz#971025 rhbz#825199 +- iso-scan/filename fixes +Resolves: rhbz#972337 +- add udev rules for persistent network naming +Resolves: rhbz#972662 + +* Tue Jun 04 2013 Dennis Gilmore 027-82.git20130531 +- add patch to include panel-tfp410 module on arm systems + +* Fri May 31 2013 Harald Hoyer 027-81.git20130531 +- fix btrfs mount flags for /usr +- degrade message about missing tools for stripping +Resolves: rhbz#958519 +- set environment vars DRACUT_SYSTEMD, NEWROOT in service file +Resolves: rhbz#963159 +- don't add volatile swap partitions to host_devs +- add libssl.so.10 to make kdump work with fips mode +- readd selinux dracut module for kdump +- url-lib/url-lib.sh: turn off curl globbing +Resolves: rhbz#907497 +- include btrfs-zero-log in the initramfs +Resolves: rhbz#963257 +- proper NAME the network interfaces +Resolves: rhbz#965842 +- install default font latarcyrheb-sun16 +Resolves: rhbz#927564 +- optionally install /etc/pcmcia/config.opts +Resolves: rhbz#920076 +- fix ONBOOT for slaves, set TYPE=Bond for bonding +Resolves: rhbz#919001 +- add nvme kernel module +Resolves: rhbz#910734 +- add xfs_metadump +- selinux: load_policy script fix +- add hid-hyperv and hv-vmbus kernel modules +- add parameter rd.live.squashimg +Resolves: rhbz#789036 rhbz#782108 +- wait for all required interfaces if "rd.neednet=1" +Resolves: rhbz#801829 +- lvm: add tools for thin provisioning +Resolves: rhbz#921235 +- ifcfg/write-ifcfg.sh: fixed ifcfg file generation +- do not wait for mpath* devices +Resolves: rhbz#969068 + +* Wed May 22 2013 Adam Williamson 027-46.git20130430 +- don't specify "p" as a separator for dmraid +Resolves: rhbz#966162 + +* Tue Apr 30 2013 Harald Hoyer 027-45.git20130430 +- fixed fips mode more +Resolves: rhbz#956521 + +* Thu Apr 25 2013 Harald Hoyer 027-39.git20130425 +- fix shutdown, if /dev/console is not writeable +- fixed fips mode +Resolves: rhbz#956521 + +* Thu Apr 18 2013 Harald Hoyer 027-36.git20130418 +- fix initramfs creation on noexec tmpdir +Resolves: rhbz#953426 +- more options for lsinitrd +- bash completion for lsinitrd +- do not output debug information on initramfs creation, if rd.debug is + on the kernel command line +- drop requirement on 'file', lsinitrd can find the magic on its own + +* Mon Apr 15 2013 Harald Hoyer 027-26.git20130415 +- do not call plymouth with full path +- include systemd-random-seed-load.service +- fix ca-bundle.crt for ssl curl +Resolves: rhbz#950770 +- add support for "iso-scan/filename" kernel parameter + +* Wed Apr 10 2013 Harald Hoyer 027-19.git20130410 +- also handle UUID= entries in crypttab in host-only mode +Resolves:rhbz#919752 + +* Tue Apr 09 2013 Harald Hoyer 027-17.git20130409 +- only include needed /etc/crypttab entries +Resolves:rhbz#919752 +- add support for bridge over team and vlan +- support multiple bonding interfaces +- add "action_on_fail=" kernel command line parameter +- add support for bridge over a vlan tagged interface + +* Fri Apr 05 2013 Harald Hoyer 027-10.git20130405 +- fix crypto password timeout on the dracut side + +* Tue Mar 26 2013 Harald Hoyer 027-1 +- version 027 + +* Wed Mar 20 2013 Harald Hoyer 026-72.git20130320 +- fix rescue image naming +Resolves: rhbz#923439 +- turn off host-only mode if essential system filesystems not mounted +- turn off host-only mode if udev database is not accessible + +* Tue Mar 19 2013 Harald Hoyer 026-62.git20130319 +- fix dracut service ordering +Resolves: rhbz#922991 + +* Mon Mar 18 2013 Harald Hoyer 026-56.git20130318 +- don't fail hard on kernel modules install +Resolves: rhbz#922565 + +* Mon Mar 18 2013 Harald Hoyer 026-55.git20130318 +- install all host filesystem drivers +Resolves: rhbz#922565 + +* Sat Mar 16 2013 Harald Hoyer 026-54.git20130316 +- fix for squashfs +Resolves: rhbz#922248 +- documentation fixes +- sosreport, mkdir /run/initramfs + +* Fri Mar 15 2013 Harald Hoyer 026-48.git20130315 +- use new initrd.target from systemd +- fixed rescue generation + +* Wed Mar 13 2013 Harald Hoyer 026-33.git20130313 +- add module-load.d modules to the initramfs +- add sysctl.d to the initramfs +- optimize plymouth module for systemd mode +- add new dracut parameter "--regenerate-all" +- add new dracut parameter "--noimageifnotneeded" +- shutdown: mount move /run /sys /dev /proc out of /oldroot + before pre-shutdown +- add bash completion for dracut + +* Wed Mar 13 2013 Harald Hoyer 026-19.git20130313 +- fix switch-root and local-fs.target problem +- add norescue and nohostonly subpackages + +* Mon Mar 11 2013 Harald Hoyer 026-15.git20130311 +- update to recent git + +* Fri Mar 08 2013 Harald Hoyer 026-1 +- version 026 + +* Mon Feb 11 2013 Harald Hoyer 025-35.git20130211 +- update to recent git + +* Wed Jan 23 2013 Harald Hoyer 025-1 +- version 025 + +* Tue Aug 21 2012 Harald Hoyer 023-13.git20120821 +- reintroduce rd.neednet, which reenables anaconda networking +- fix some dracut-install corner cases +- fix FIPS for /boot not on extra partition + +* Wed Aug 01 2012 Dennis Gilmore - 023-2 +- add patch to include omap_hsmmc for arm + +* Wed Aug 01 2012 Harald Hoyer 023-1 +- version 023 + +* Mon Jul 30 2012 Harald Hoyer 022-99.git20120730 +- removed install of missing finished-ask-password.sh + +* Mon Jul 30 2012 Harald Hoyer 022-97.git20120730 +- moved crypt setup to systemd units + +* Fri Jul 27 2012 Harald Hoyer 022-63.git20120727 +- fixed dracut-install bug if /var/tmp contains a symlink +- fixed some partx issues + +* Mon Jul 23 2012 Harald Hoyer 022-5.git20120723 +- dracut.8: added more documentation about executing dracut + +* Fri Jul 20 2012 Harald Hoyer 022-2.git20120720 +- fixed some race condition for resume from hibernation + +* Fri Jul 20 2012 Harald Hoyer 022-1 +- version 022 +- host-only kernel modules fix + +* Fri Jul 20 2012 Harald Hoyer 021-1 +- version 21 +- systemd in the initramfs reenabled +- new option "--kver" + +* Wed Jul 18 2012 Fedora Release Engineering - 020-97.git20120717 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 17 2012 Harald Hoyer 020-96.git20120717 +- disabled systemd in the initramfs, until it works correctly + +* Wed Jul 11 2012 Harald Hoyer 020-84.git20120711 +- add back "--force" to switch-root, otherwise systemd umounts /run + +* Wed Jul 11 2012 Harald Hoyer 020-83.git20120711 +- more systemd journal fixes +- nfs module fix +- install also /lib/modprobe.d/* +- fixed dracut-shutdown service +- safeguards for dracut-install +- for --include also copy symlinks + +* Tue Jul 10 2012 Harald Hoyer 020-72.git20120710 +- stop journal rather than restart +- copy over dracut services to /run/systemd/system + +* Tue Jul 10 2012 Harald Hoyer 020-70.git20120710 +- more systemd unit fixups +- restart systemd-journald in switch-root post +- fixed dracut-install loader ldd error message + +* Mon Jul 09 2012 Harald Hoyer 020-64.git20120709 +- fixed plymouth install +- fixed resume +- fixed dhcp +- no dracut systemd services installed in the system + +* Mon Jul 09 2012 Harald Hoyer 020-57.git20120709 +- more fixups for systemd-udevd unit renaming + +* Mon Jul 09 2012 Harald Hoyer 020-55.git20120709 +- require systemd >= 186 +- more fixups for systemd-udevd unit renaming + +* Mon Jul 09 2012 Harald Hoyer 020-52.git20120709 +- fixed prefix in 01-dist.conf + +* Fri Jul 06 2012 Harald Hoyer 020-51.git20120706 +- cope with systemd-udevd unit renaming +- fixed network renaming +- removed dash module + +* Mon Jul 02 2012 Harald Hoyer 020-22.git20120702 +- fixed kernel modules install + +* Mon Jul 02 2012 Harald Hoyer 020-21.git20120702 +- moved /usr/bin/dracut-install to /usr/lib +- more speedups + +* Fri Jun 29 2012 Harald Hoyer 020-1 +- version 020 +- new /usr/bin/dracut-install tool +- major speedup of the image creation + +* Mon Jun 25 2012 Harald Hoyer 019-92.git20120625 +- support vlan tagged binding +- speedup initramfs emergency service +- speedup image creation +- fix installkernel() return codes +Resolves: rhbz#833256 +- add qemu and qemu-net modules to add qemu drivers even in host-only +- speedup btrfs and xfs fsck (nop) +- no more mknod in the initramfs (fixes plymouth on s390) + +* Thu Jun 21 2012 Harald Hoyer 019-62.git20120621 +- do not require pkg-config for systemd +- i18n fixes +- less systemd services in the initramfs + +* Thu Jun 21 2012 Harald Hoyer 019-57.git20120620 +- systemd is now the default init in the initramfs + +* Mon Jun 18 2012 Harald Hoyer 019-40.git20120618 +- new upstream version + +* Mon Jun 11 2012 Harald Hoyer 019-16.git20120611 +- new upstream version + +* Tue Jun 05 2012 Dennis Gilmore 019-2 +- include omapdrm with the arm modules + +* Mon Jun 04 2012 Harald Hoyer 019-1 +- version 019-1 + +* Tue May 22 2012 Harald Hoyer 018-74.git20120522 +- new upstream version + +* Thu May 17 2012 Dennis Gilmore 018-53.git20120509 +- add patch to pull in arm storage modules + +* Wed May 09 2012 Harald Hoyer 018-52.git20120509 +- new upstream version + +* Fri May 04 2012 Harald Hoyer 018-40.git20120504 +- new upstream version + +* Wed Apr 25 2012 Harald Hoyer 018-37.git20120425.1 +- fixup for multipath and iscsi host-only detection + +* Wed Apr 25 2012 Harald Hoyer 018-37.git20120425 +- fixed udevd location + +* Tue Apr 24 2012 Harald Hoyer 018-33.git20120424 +- new upstream version + +* Thu Apr 19 2012 Harald Hoyer 018-25.git20120419 +- fixed network for non-network root (like installer media) + +* Wed Apr 18 2012 Harald Hoyer 018-22.git20120418 +- new upstream version + +* Mon Apr 16 2012 Harald Hoyer 018-12.git20120416 +- new upstream version, which fixes various anaconda loader issues + +* Thu Apr 05 2012 Harald Hoyer 018-1 +- version 018 + +* Thu Mar 22 2012 Harald Hoyer 017-62.git20120322 +- fixed /run prefix copying + +* Wed Mar 21 2012 Harald Hoyer 017-59.git20120321 +- new upstream version, which fixes various anaconda loader issues + +* Mon Mar 12 2012 Harald Hoyer 017-43.git20120312 +- live image: fixed image uncompression +- live updates for livenet + +* Thu Mar 08 2012 Harald Hoyer 017-40.git20120308 +- add s390 ctcm network kernel module + +* Thu Mar 08 2012 Harald Hoyer 017-39.git20120308 +- kill dhclient silently +- cleanup and fix network config writeout to /run/initramfs/state +Resolves: rhbz#799989 +- various cleanups + +* Fri Mar 02 2012 Harald Hoyer 017-22.git20120302 +- nfs path fixes for live image over nfs + root=live:nfs://10.10.10.10:/srv/all/install.img ip=dhcp rd.neednet + +* Thu Mar 01 2012 Harald Hoyer 017-19.git20120301 +- fixed include of some kernel modules + +* Wed Feb 29 2012 Harald Hoyer 017-17.git20120229 +- update to latest git +- fixes for convertfs (/usr-move) + +* Fri Feb 24 2012 Harald Hoyer 017-1 +- version 017 + +* Fri Feb 17 2012 Harald Hoyer 016-9.git20120217 +- update to latest git + +* Wed Feb 15 2012 Harald Hoyer 016-1 +- version 016 + +* Mon Feb 13 2012 Harald Hoyer 015-9.git20120213 +- update to latest git + +* Sun Feb 12 2012 Kay Sievers - 015-9.git20120210 +- fix dependency loop in systemd service files + +* Fri Feb 10 2012 Harald Hoyer 015-8.git20120210 +- update to latest git + +* Thu Feb 09 2012 Harald Hoyer 015-7.git20120209 +- update to latest git + +* Thu Feb 09 2012 Harald Hoyer 015-4.git20120209 +- update to latest git + +* Wed Feb 08 2012 Harald Hoyer 015-3.git20120208 +- update to latest git + +* Tue Feb 07 2012 Harald Hoyer 015-1 +- version 015 + +* Thu Feb 02 2012 Harald Hoyer 014-81.git20120202 +- update to latest git + +* Thu Feb 02 2012 Harald Hoyer 014-80.git20120202 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-77.git20120126.1 +- rebuild for rawhide + +* Thu Jan 26 2012 Harald Hoyer 014-77.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-76.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-75.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-74.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-73.git20120126 +- update to latest git + +* Thu Jan 26 2012 Harald Hoyer 014-72.git20120126 +- update to latest git + +* Mon Jan 23 2012 Harald Hoyer 014-65.git20120123 +- update to latest git + +* Mon Jan 23 2012 Harald Hoyer 014-61.git20120123 +- update to latest git + +* Tue Jan 17 2012 Harald Hoyer 014-38.git20120117 +- update to latest git + +* Fri Jan 13 2012 Fedora Release Engineering - 014-10.git20111215 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Dec 15 2011 Harald Hoyer 014-9.git20111215 +- update to latest git +- lots of patch changes + +* Fri Oct 21 2011 Harald Hoyer 013-100.git20111021 +- update to latest git + +* Thu Oct 20 2011 Harald Hoyer 013-93.git20111020 +- update to latest git + +* Wed Oct 19 2011 Harald Hoyer 013-85.git20111019 +- update to latest git + +* Tue Oct 04 2011 Harald Hoyer 013-15 +- fixed mdraid container handling +Resolves: rhbz#743240 + +* Thu Sep 22 2011 Harald Hoyer 013-13 +- fixed mdraid issues +- fixed btrfsck +Resolves: rhbz#735602 + +* Wed Sep 21 2011 Harald Hoyer 013-12 +- removed patch backup files +- reintroduced /dev/live + +* Tue Sep 20 2011 Harald Hoyer 013-11 +- move mounting of securitfs to a seperate module +Resolves: rhbz#737140 + +* Tue Sep 20 2011 Harald Hoyer 013-10 +- mount securitfs with the correct source +Resolves: rhbz#737140 + +* Tue Sep 20 2011 Harald Hoyer 013-9 +- do not carry over initramfs udev rules +Resolves: rhbz#734096 + +* Fri Sep 02 2011 Harald Hoyer 013-8 +- hopefully fixed one part of a loop/udev and loop/mount race +Resolves: rhbz#735199 + +* Wed Aug 31 2011 Harald Hoyer 013-7 +- add /lib/udev/input_id to the initramfs +- fix hmac install + +* Tue Aug 30 2011 Harald Hoyer 013-6 +- fixed environment passing to real init +Resolves: rhbz#733674 +- fixed lvm on md + +* Mon Aug 29 2011 Harald Hoyer 013-5 +- fixed rhel/fedora version checks + +* Wed Aug 17 2011 Harald Hoyer 013-4 +- fixed crash with livenet installed + +* Wed Aug 17 2011 Harald Hoyer 013-3 +- fixed live iso mounting +Resolves: rhbz#730579 + +* Fri Aug 12 2011 Harald Hoyer 013-1 +- fixed symlink creation for lorax + +* Wed Aug 10 2011 Harald Hoyer 011-41.git20110810 +- fixed getargs() for empty args + +* Wed Aug 10 2011 Harald Hoyer 011-40.git20110810 +- fixed symbolic link creation in the initramfs +Resolves: rhbz#728863 + +* Wed Jul 20 2011 Harald Hoyer 011-15.git20110720 +- "eject" is optional now +- refined shutdown procedure + +* Mon Jul 18 2011 Harald Hoyer 011-1 +- version 011 + +* Fri May 20 2011 Harald Hoyer 011-0.1 +- git snapshot of pre-version 011 + +* Fri Apr 01 2011 Harald Hoyer 010-1 +- version 010 + +* Thu Mar 31 2011 Harald Hoyer 009-5 +- fixed PATH and kmsg logging + +* Thu Mar 31 2011 Harald Hoyer 009-4 +- fixed dmsquash rule generation +- fixed fips boot arg parsing +- fixed plymouth pid generation + +* Wed Mar 30 2011 Harald Hoyer 009-3 +- fixed dhcp +- added /lib/firmware/updates to firmware directories +- fixed LiveCD /dev/.initramfs fallback +- fixed cdrom polling +- dropped net-tools dependency + +* Tue Mar 29 2011 Harald Hoyer 009-2 +- fixed empty output file argument handling: + "dracut '' " + +* Mon Mar 28 2011 Harald Hoyer 009-1 +- version 009 + +* Thu Mar 17 2011 Harald Hoyer 009-0.1 +- version 009 prerelease + +* Tue Feb 22 2011 Harald Hoyer 008-7 +- fixed lvm version parsing + +* Tue Feb 22 2011 Harald Hoyer 008-6 +- fixed lvm version parsing + +* Mon Feb 21 2011 Harald Hoyer 008-5 +- fixed i18n unicode setting +- set cdrom in kernel polling + +* Fri Feb 18 2011 Harald Hoyer 008-4 +- readded dist tag + +* Fri Feb 18 2011 Harald Hoyer 008-3 +- fixed i18n +- turned off selinux by default + +* Wed Feb 09 2011 Harald Hoyer 008-2 +- do not write dracut.log to /tmp under any circumstances +- touch /dev/.systemd/plymouth after plymouth started + +* Tue Feb 08 2011 Fedora Release Engineering - 008-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Feb 02 2011 Harald Hoyer 008-1 +- version 008-1 + +* Mon Jan 17 2011 Harald Hoyer 008-0.11 +- removed "mount" requirement + +* Thu Nov 18 2010 Harald Hoyer - 008-0.10 +- dracut-008 pre git snapshot +- fixes /dev/dri permissions +Resolves: rhbz#626559 + +* Fri Nov 12 2010 Harald Hoyer 008-0.9 +- dracut-008 pre git snapshot +- fixes /dev/.udev permissions +Resolves: rhbz#651594 + +* Wed Nov 3 2010 Harald Hoyer - 008-0.8 +- fixed fsck -a option + +* Fri Oct 29 2010 Harald Hoyer 008-0.7 +- added fsck to initramfs + +* Fri Oct 29 2010 Harald Hoyer 008-0.6 +- fixed rpm macros + +* Fri Oct 29 2010 Harald Hoyer 008-0.5 +- dracut-008 pre git snapshot + +* Mon Aug 09 2010 Harald Hoyer 007-1 +- version 007 + +* Thu Jun 17 2010 Harald Hoyer 006-1 +- version 006 + +* Fri Jun 11 2010 Harald Hoyer +- Remove requirements, which are not really needed +Resolves: rhbz#598509 +- fixed copy of network config to /dev/.initramfs/ (patch 146) +Resolves: rhbz#594649 +- more password beauty (patch 142) +Resolves: rhbz#561092 +- support multiple iSCSI disks (patch 143) +Resolves: rbhz#580190 +- fixed selinux=0 (patch 130) +Resolves: rhbz#593080 +- add support for booting LVM snapshot root volume (patch 145) +Resolves: rbhz#602723 +- remove hardware field from BOOTIF= (patch 148) +Resolves: rhbz#599593 +- add aes kernel modules and fix crypt handling (patch 137, patch 140 and patch 147) +Resolves: rhbz#600170 + +* Thu May 27 2010 Harald Hoyer +- fixed Requirements +- fixed autoip6 +Resolves: rhbz#538388 +- fixed multipath +Resolves: rhbz#595719 + +* Thu May 06 2010 Harald Hoyer +- only display short password messages +Resolves: rhbz#561092 + +* Thu May 06 2010 Harald Hoyer +- fixed dracut manpages +Resolves: rhbz#589109 +- use ccw-init and ccw rules from s390utils +Resolves: rhbz#533494 +- fixed fcoe +Resolves: rhbz#486244 +- various other bugfixes seen in Fedora + +* Tue Apr 20 2010 Harald Hoyer +- fixed network with multiple nics +- fixed nfsidmap paths +- do not run blkid on non active container raids +- fixed cdrom polling mechanism +- update to latest git + +* Thu Apr 15 2010 Harald Hoyer +- fixed dracut manpages +- dmraid parse different error messages +- add cdrom polling mechanism for slow cdroms +- add module btrfs +- teach dmsquash live-root to use rootflags +- trigger udev with action=add +- fixed add_drivers handling +- add sr_mod +- use pigz instead of gzip, if available + +* Thu Mar 25 2010 Harald Hoyer +- removed firmware requirements (rhbz#572634) +- add /etc/dracut.conf.d +- Resolves: rhbz#572634 + +* Fri Mar 19 2010 Harald Hoyer +- version 005 + +* Fri Mar 19 2010 Harald Hoyer +- fixed rpmlint errors (rhbz#570547) +- removed firmware package from dracut-kernel (rhbz#572634) +- add dcb support to dracut's FCoE support (rhbz#563794) +- force install some modules in hostonly mode (rhbz#573094) +- various other bugfixes +- Resolves: rhbz#570547, rhbz#572634, rhbz#563794, rhbz#573094 + +* Thu Feb 18 2010 Harald Hoyer 004-15 +- fixed "selinux=0" booting (rhbz#566376) +- fixed internal IFS handling +- Resolves: rhbz#566376 + +* Fri Jan 29 2010 Harald Hoyer 004-5 +- fixed firmware.sh bug (#559975 #559597) + +* Tue Jan 26 2010 Harald Hoyer 004-4 +- add multipath check + +* Tue Jan 26 2010 Harald Hoyer 004-3 +- fix selinux handling if .autorelabel is present +- Resolves: rhbz#557744 + +* Wed Jan 20 2010 Harald Hoyer 004-2 +- fix emergency_shell argument parsing +- Related: rhbz#543948 + +* Fri Jan 15 2010 Harald Hoyer 004-1 +- version 004 +- Resolves: rhbz#529339 rhbz#533494 rhbz#548550 +- Resolves: rhbz#548555 rhbz#553195 + +* Wed Jan 13 2010 Harald Hoyer 003-3 +- add Obsoletes of mkinitrd/nash/libbdevid-python +- Related: rhbz#543948 + +* Wed Jan 13 2010 Warren Togami 003-2 +- nbd is Fedora only + +* Fri Nov 27 2009 Harald Hoyer 003-1 +- version 003 + +* Mon Nov 23 2009 Harald Hoyer 002-26 +- add WITH_SWITCH_ROOT make flag +- add fips requirement conditional +- add more device mapper modules (bug #539656) + +* Fri Nov 20 2009 Dennis Gregorovic - 002-25.1 +- nss changes for Alpha 3 + +* Thu Nov 19 2009 Harald Hoyer 002-25 +- add more requirements for dracut-fips (bug #539257) + +* Tue Nov 17 2009 Harald Hoyer 002-24 +- put fips module in a subpackage (bug #537619) + +* Tue Nov 17 2009 Harald Hoyer 002-23 +- install xdr utils for multipath (bug #463458) + +* Thu Nov 12 2009 Harald Hoyer 002-22 +- add module 90multipath +- add module 01fips +- renamed module 95ccw to 95znet (bug #533833) +- crypt: ignore devices in /etc/crypttab (root is not in there) +- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833) +- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833) +- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750) +- dasd: use dasdconf.sh from s390utils (bug #533833) + +* Fri Nov 06 2009 Harald Hoyer 002-21 +- fix rd_DASD argument handling (bug #531720) +- Resolves: rhbz#531720 + +* Wed Nov 04 2009 Harald Hoyer 002-20 +- fix rd_DASD argument handling (bug #531720) +- Resolves: rhbz#531720 + +* Tue Nov 03 2009 Harald Hoyer 002-19 +- changed rd_DASD to rd_DASD_MOD (bug #531720) +- Resolves: rhbz#531720 + +* Tue Oct 27 2009 Harald Hoyer 002-18 +- renamed lvm/device-mapper udev rules according to upstream changes +- fixed dracut search path issue + +* Mon Oct 26 2009 Harald Hoyer 002-17 +- load dm_mod module (bug #530540) + +* Fri Oct 09 2009 Jesse Keating - 002-16 +- Upgrade plymouth to Requires(pre) to make it show up before kernel + +* Thu Oct 08 2009 Harald Hoyer 002-15 +- s390 ccw: s/layer1/layer2/g + +* Thu Oct 08 2009 Harald Hoyer 002-14 +- add multinic support +- add s390 zfcp support +- add s390 network support + +* Wed Oct 07 2009 Harald Hoyer 002-13 +- fixed init= handling +- kill loginit if "rdinitdebug" specified +- run dmsquash-live-root after udev has settled (bug #527514) + +* Tue Oct 06 2009 Harald Hoyer 002-12 +- add missing loginit helper +- corrected dracut manpage + +* Thu Oct 01 2009 Harald Hoyer 002-11 +- fixed dracut-gencmdline for root=UUID or LABEL + +* Thu Oct 01 2009 Harald Hoyer 002-10 +- do not destroy assembled raid arrays if mdadm.conf present +- mount /dev/shm +- let udevd not resolve group and user names +- preserve timestamps of tools on initramfs generation +- generate symlinks for binaries correctly +- moved network from udev to initqueue +- mount nfs3 with nfsvers=3 option and retry with nfsvers=2 +- fixed nbd initqueue-finished +- improved debug output: specifying "rdinitdebug" now logs + to dmesg, console and /init.log +- stop udev before killing it +- add ghost /var/log/dracut.log +- dmsquash: use info() and die() rather than echo +- strip kernel modules which have no x bit set +- redirect stdin, stdout, stderr all RW to /dev/console + so the user can use "less" to view /init.log and dmesg + +* Tue Sep 29 2009 Harald Hoyer 002-9 +- make install of new dm/lvm udev rules optionally +- correct dasd module typo + +* Fri Sep 25 2009 Warren Togami 002-8 +- revert back to dracut-002-5 tarball 845dd502 + lvm2 was reverted to pre-udev + +* Wed Sep 23 2009 Harald Hoyer 002-7 +- build with the correct tarball + +* Wed Sep 23 2009 Harald Hoyer 002-6 +- add new device mapper udev rules and dmeventd + bug 525319, 525015 + +* Wed Sep 23 2009 Warren Togami 002-5 +- Revert back to -3, Add umount back to initrd + This makes no functional difference to LiveCD. See Bug #525319 + +* Mon Sep 21 2009 Warren Togami 002-4 +- Fix LiveCD boot regression + +* Mon Sep 21 2009 Harald Hoyer 002-3 +- bail out if selinux policy could not be loaded and + selinux=0 not specified on kernel command line + (bug #524113) +- set finished criteria for dmsquash live images + +* Fri Sep 18 2009 Harald Hoyer 002-2 +- do not cleanup dmraids +- copy over lvm.conf + +* Thu Sep 17 2009 Harald Hoyer 002-1 +- version 002 +- set correct PATH +- workaround for broken mdmon implementation + +* Wed Sep 16 2009 Harald Hoyer 001-12 +- removed lvm/mdraid/dmraid lock files +- add missing ifname= files + +* Wed Sep 16 2009 Harald Hoyer 001-11 +- generate dracut-version during rpm build time + +* Tue Sep 15 2009 Harald Hoyer 001-10 +- add ifname= argument for persistent netdev names +- new /initqueue-finished to check if the main loop can be left +- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf + +* Wed Sep 09 2009 Harald Hoyer 001-9 +- added Requires: plymouth-scripts + +* Wed Sep 09 2009 Harald Hoyer 001-8 +- plymouth: use plymouth-populate-initrd +- add add_drivers for dracut and dracut.conf +- do not mount /proc and /selinux manually in selinux-load-policy + +* Wed Sep 09 2009 Harald Hoyer 001-7 +- add scsi_wait_scan to be sure everything was scanned + +* Tue Sep 08 2009 Harald Hoyer 001-6 +- fixed several problems with md raid containers +- fixed selinux policy loading + +* Tue Sep 08 2009 Harald Hoyer 001-5 +- patch does not honor file modes, fixed them manually + +* Mon Sep 07 2009 Harald Hoyer 001-4 +- fixed mdraid for IMSM + +* Mon Sep 07 2009 Harald Hoyer 001-3 +- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109) + +* Thu Sep 03 2009 Harald Hoyer 001-2 +- fixed missing grep for md +- reorder cleanup + +* Wed Sep 02 2009 Harald Hoyer 001-1 +- version 001 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Aug 14 2009 Harald Hoyer 0.9-1 +- version 0.9 + +* Thu Aug 06 2009 Harald Hoyer 0.8-1 +- version 0.8 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Jul 24 2009 Harald Hoyer 0.7-1 +- version 0.7 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Wed Jul 22 2009 Harald Hoyer 0.6-1 +- version 0.6 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Fri Jul 17 2009 Harald Hoyer 0.5-1 +- version 0.5 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Sat Jul 04 2009 Harald Hoyer 0.4-1 +- version 0.4 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Thu Jul 02 2009 Harald Hoyer 0.3-1 +- version 0.3 +- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS + +* Wed Jul 01 2009 Harald Hoyer 0.2-1 +- version 0.2 + +* Fri Jun 19 2009 Harald Hoyer 0.1-1 +- first release + +* Thu Dec 18 2008 Jeremy Katz - 0.0-1 +- Initial build diff --git a/.distro/lgpl-2.1.txt b/.distro/lgpl-2.1.txt new file mode 100644 index 000000000..4362b4915 --- /dev/null +++ b/.distro/lgpl-2.1.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/.distro/newdracut.sh b/.distro/newdracut.sh new file mode 100755 index 000000000..381fba5f3 --- /dev/null +++ b/.distro/newdracut.sh @@ -0,0 +1,82 @@ +#!/usr/bin/bash + +bash -n "$0" || exit 1 +shopt -s extglob + +patchnr() { + local nr + while [[ -n "$1" ]]; do + nr=$(cut -d'.' -f1 <<< "$1") + shift + [[ $((10#$nr)) -gt 0 ]] || echo "Invalid patch number: $nr" >&2 + echo "$nr" + done +} + +if [[ -e "$HOME/git/dracut/$1" ]]; then + srcrpm="$HOME/git/dracut/$1" +elif [[ -e "$HOME/dev/upstream/dracut/$1" ]]; then + srcrpm="$HOME/dev/upstream/dracut/$1" +else + srcrpm="$1" +fi + +[[ -f $srcrpm ]] || exit 3 + +old_release=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{release}' dracut.spec) +old_release=${old_release%%.*} + +cp dracut.spec dracut.spec.old + +rm *.patch; git reset --hard HEAD +last_patch_nr=$(patchnr *.patch | sort -n | tail -n 1) +last_patch_nr=${last_patch_nr:-0000} +#for i in *.patch; do git rm -f $i;done + +if rpm -ivh --define "_srcrpmdir $PWD" --define "_specdir $PWD" --define "_sourcedir $PWD" "$srcrpm"; then + for nr in $(patchnr *.patch); do + [[ $((10#$nr)) -gt $((10#$last_patch_nr)) ]] && git add "${nr}.patch" + done + + new_version=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{version}' dracut.spec) + new_release=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{release}' dracut.spec) + new_release_full=${new_release%.*} + new_release=${new_release%%.*} + + do_print="" + while IFS=$'\n' read -r line + do + if [ -z "$do_print" ] && [ "$line" = "%changelog" ]; then + do_print="yes" + echo "* $(LANG='C' date '+%a %b %d %Y') $(git config user.name) <$(git config user.email)> - ${new_version}-${new_release_full}" + + for ((i=old_release; i> dracut.spec + + # Patch list: + # ls *.patch | tr -s ' ' '\n' | cut -d'.' -f1 | xargs -i zsh -c "nr=\$((10#{})); echo \"Patch\${nr}: {}.patch\"" + + git add dracut.spec + + msg="Resolves: $( + for ((i=old_release; i +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. All rights reserved. +# Red Hat Internal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/dracut/add-luks-keys +export TESTVERSION=1.0 +export DESCRIPTION="Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase" + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Jan Stodola " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: $(DESCRIPTION)" >> $(METADATA) + @echo "Type: Install" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: dracut" >> $(METADATA) + @echo "Requires: dracut" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: Red Hat Internal" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/.distro/tests/add-luks-keys/PURPOSE b/.distro/tests/add-luks-keys/PURPOSE new file mode 100644 index 000000000..a7c606363 --- /dev/null +++ b/.distro/tests/add-luks-keys/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /dracut/add-luks-keys +Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase. +Author: Jan Stodola diff --git a/.distro/tests/add-luks-keys/runtest.sh b/.distro/tests/add-luks-keys/runtest.sh new file mode 100644 index 000000000..7ef652b08 --- /dev/null +++ b/.distro/tests/add-luks-keys/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /dracut/add-luks-keys +# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase +# Author: Jan Stodola +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2016 Red Hat, Inc. All rights reserved. +# Red Hat Internal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="dracut" + +keyfile="/root/keyfile" +kernel_file=`grubby --default-kernel` +initrd_file=`grubby --info=$kernel_file | grep ^initrd= | sed 's/^initrd=//' | head -n1` +kernel_version=`rpm -qf $kernel_file --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n'` + +rlJournalStart + rlPhaseStartTest "Add luks keys to initramfs" + + if [ ! -e "$keyfile" ]; then + rlLog "Creating new key file: $keyfile" + rlRun "dd if=/dev/urandom bs=1 count=32 of=$keyfile" + rlRun "chmod 0400 $keyfile" + else + rlLog "Using existing key file: $keyfile" + fi + + rlAssertExists "/etc/crypttab" + rlFileSubmit "/etc/crypttab" + UUIDS=`cat /etc/crypttab | cut -d' ' -f2 | cut -d'=' -f2` + for UUID in $UUIDS; do + rlRun "echo 'redhat' | /sbin/cryptsetup luksAddKey /dev/disk/by-uuid/$UUID $keyfile" + done; + + # modify /etc/crypttab, set key file in the thirth column of the file + rlRun "awk -v \"KEY_FILE=$keyfile\" '{\$3=KEY_FILE; print \$0}' /etc/crypttab > crypttab_mod" + rlRun "mv -Z crypttab_mod /etc/crypttab" + rlRun "chmod 0600 /etc/crypttab" + + rlRun "dracut -f -I $keyfile $initrd_file $kernel_version" + + # zipl has to be executed on s390x + if [ -x /sbin/zipl ]; then + rlRun "/sbin/zipl" + fi + + rlPhaseEnd +rlJournalEnd + diff --git a/.distro/tests/tests.yml b/.distro/tests/tests.yml new file mode 100644 index 000000000..60a098dca --- /dev/null +++ b/.distro/tests/tests.yml @@ -0,0 +1,11 @@ +--- +# This first play always runs on the local staging system +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - add-luks-keys + required_packages: + - dracut # Required for add-luks-keys From 4abf6b93b632a4ef9d1805d3536dba8748a5c78c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 20 Mar 2024 11:59:48 +0100 Subject: [PATCH 02/58] ci: add packit config. --- .packit.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .packit.yml diff --git a/.packit.yml b/.packit.yml new file mode 100644 index 000000000..7bb2a0d96 --- /dev/null +++ b/.packit.yml @@ -0,0 +1,50 @@ +# Docs: https://packit.dev/docs/ + +specfile_path: .distro/dracut.spec + +files_to_sync: + - .distro/dracut.spec + +patch_generation_ignore_paths: +- .distro/ +- .packit.yml +patch_generation_patch_id_digits: 1 +sync_changelog: true + +upstream_ref: 856e7acdb1462803c2517c8d64afb2e34c73c735 + +upstream_package_name: dracut +downstream_package_name: dracut + +#actions: +# post-upstream-clone: + # Use the current specfile +# - "cp pkgbuild/dracut.spec ." + +jobs: +# Build test +- job: upstream_koji_build + trigger: pull_request + scratch: true + targets: + - fedora-rawhide-x86_64 + - fedora-eln-x86_64 + +- job: copr_build + trigger: pull_request + targets: + - fedora-rawhide-x86_64 + - fedora-eln-x86_64 + +# Run tests (via testing farm) +- job: tests + trigger: pull_request + targets: + - fedora-rawhide-x86_64 +# - fedora-eln-x86_64 + +## Create fedora PR +#- job: propose_downstream +# trigger: release +# dist_git_branches: +# - rawhide From 31f662f3638715f5c9d7070e8f8374a2c5130641 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 20 Mar 2024 10:14:24 +0100 Subject: [PATCH 03/58] build: update to dracut 060 Based on a commit 856e7acdb1462803c2517c8d64afb2e34c73c735. Currently upstream does not create releases. Reference PR: https://github.com/dracutdevs/dracut/pull/2509 Unpacked archive: https://github.com/pvalena/dracut-fedora/tree/v60-srpm-unpacked --- .distro/dracut.spec | 30 ++++++++++++++++++------------ .distro/source-git.yaml | 9 +++++---- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index d5632a3f3..674136300 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -6,12 +6,9 @@ # directory. %global __requires_exclude pkg-config -# rpmdev-bumpspec and releng automation compatible variable -%global baserelease 22 - Name: dracut -Version: 059 -Release: %{baserelease}%{?dist} +Version: 060 +Release: 1%{?dist} Summary: Initramfs generator using udev @@ -22,10 +19,19 @@ License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-only URL: https://github.com/dracutdevs/dracut/wiki/ -Source0: https://github.com/dracutdevs/dracut/archive/refs/tags/%{version}.tar.gz +# Currently upstream does not create releases, therefore +# source is created from commit 856e7acdb1462803c2517c8d64afb2e34c73c735 +# Reference PR: https://github.com/dracutdevs/dracut/pull/2509 +# Unpacked archive: https://github.com/pvalena/dracut-fedora/tree/v60-srpm-unpacked +Source0: dracut-%{version}.tar.xz +#Source0: https://github.com/dracutdevs/dracut/archive/refs/tags/%%{version}.tar.gz Source1: https://www.gnu.org/licenses/lgpl-2.1.txt +# Please use source-git to work with this spec file: +# HowTo: https://packit.dev/source-git/work-with-source-git +# Source-git repository: https://github.com/redhat-plumbers/dracut-fedora/ + BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -170,10 +176,6 @@ cp %{SOURCE1} . echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh -%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0 -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips -%endif - # we do not support dash in the initramfs rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash @@ -203,6 +205,7 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock mkdir -p $RPM_BUILD_ROOT/boot/dracut mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log +touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf @@ -259,6 +262,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/01systemd-ac-power %{dracutlibdir}/modules.d/01systemd-ask-password %{dracutlibdir}/modules.d/01systemd-coredump +%{dracutlibdir}/modules.d/01systemd-creds %{dracutlibdir}/modules.d/01systemd-hostnamed %{dracutlibdir}/modules.d/01systemd-initrd %{dracutlibdir}/modules.d/01systemd-integritysetup @@ -270,7 +274,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/01systemd-pstore %{dracutlibdir}/modules.d/01systemd-repart %{dracutlibdir}/modules.d/01systemd-resolved -%{dracutlibdir}/modules.d/01systemd-rfkill %{dracutlibdir}/modules.d/01systemd-sysext %{dracutlibdir}/modules.d/01systemd-sysctl %{dracutlibdir}/modules.d/01systemd-sysusers @@ -353,6 +356,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/99memstrack %{dracutlibdir}/modules.d/99fs-lib %{dracutlibdir}/modules.d/99shutdown +%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log %dir %{_sharedstatedir}/initramfs %if %{defined _unitdir} %{_unitdir}/dracut-shutdown.service @@ -379,7 +383,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/01systemd-networkd %{dracutlibdir}/modules.d/35connman %{dracutlibdir}/modules.d/35network-manager -%{dracutlibdir}/modules.d/35network-wicked %{dracutlibdir}/modules.d/40network %{dracutlibdir}/modules.d/45ifcfg %{dracutlibdir}/modules.d/90kernel-network-modules @@ -428,6 +431,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Wed Mar 20 2024 Pavel Valena - 060-1 +- Update to dracut 060. + * Mon Feb 12 2024 Pavel Valena - 059-22 - Remove network-legacy module. diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index 14472e50a..249179470 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -1,9 +1,10 @@ upstream_project_url: git@github.com:pvalena/dracut-fedora.git -upstream_ref: 856e7acdb1462803c2517c8d64afb2e34c73c735 +upstream_ref: 72a126415227cfcdf806c4d165d26983fe3b8b56 downstream_package_name: dracut specfile_path: .distro/dracut.spec patch_generation_ignore_paths: -- .distro +- .distro/ +- .packit.yml patch_generation_patch_id_digits: 1 sync_changelog: true files_to_sync: @@ -16,5 +17,5 @@ files_to_sync: - exclude source-git.yaml - exclude .gitignore sources: -- path: 059.tar.gz - url: https://src.fedoraproject.org/repo/pkgs/rpms/dracut/059.tar.gz/sha512/196bc8bf18703c72bffb51a7e0493719c58173ad2da7d121eb42f9a8de47e953af36d109214dc4a10b2dc2d3bd19e844f7f51c2bdec087e064ea11f75124032d/059.tar.gz +- path: dracut-060.tar.gz + url: https://src.fedoraproject.org/repo/pkgs/rpms/dracut/059.tar.gz/sha512/eca5b779307a86f1072201f576ebdd2187d0ae3603dfe009acb9ff6fff81f028c9b5b3d2fa70c723d138e00d40b1c0f97a8ae6cd1fcbeefc898d692c54db33e3/dracut-60.tar.gz From eb91bf03bcc9d92e056c30c8c44281583e6720c4 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 22 Mar 2024 20:43:40 +0100 Subject: [PATCH 04/58] ci: update .github configs - rebased from state acf404af26c4add66ba0dd13509a94589dce86df - rebased from state a24e1272faba2875f9b78fcf42109028af0869bc --- .distro/newdracut.sh | 82 ------------------- .distro/source-git.yaml | 1 + .distro/tests/add-luks-keys/Makefile | 52 ------------ .distro/tests/add-luks-keys/PURPOSE | 3 - .distro/tests/add-luks-keys/runtest.sh | 59 ------------- .distro/tests/tests.yml | 11 --- .github/pull_request_template.md | 11 +-- .github/workflows/container.yml | 42 +--------- .github/workflows/differential-shellcheck.yml | 19 +++++ .github/workflows/integration.yml | 39 +++++---- .github/workflows/manualtest.yml | 10 +-- .packit.yml | 1 + 12 files changed, 47 insertions(+), 283 deletions(-) delete mode 100755 .distro/newdracut.sh delete mode 100644 .distro/tests/add-luks-keys/Makefile delete mode 100644 .distro/tests/add-luks-keys/PURPOSE delete mode 100644 .distro/tests/add-luks-keys/runtest.sh delete mode 100644 .distro/tests/tests.yml create mode 100644 .github/workflows/differential-shellcheck.yml diff --git a/.distro/newdracut.sh b/.distro/newdracut.sh deleted file mode 100755 index 381fba5f3..000000000 --- a/.distro/newdracut.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/bash - -bash -n "$0" || exit 1 -shopt -s extglob - -patchnr() { - local nr - while [[ -n "$1" ]]; do - nr=$(cut -d'.' -f1 <<< "$1") - shift - [[ $((10#$nr)) -gt 0 ]] || echo "Invalid patch number: $nr" >&2 - echo "$nr" - done -} - -if [[ -e "$HOME/git/dracut/$1" ]]; then - srcrpm="$HOME/git/dracut/$1" -elif [[ -e "$HOME/dev/upstream/dracut/$1" ]]; then - srcrpm="$HOME/dev/upstream/dracut/$1" -else - srcrpm="$1" -fi - -[[ -f $srcrpm ]] || exit 3 - -old_release=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{release}' dracut.spec) -old_release=${old_release%%.*} - -cp dracut.spec dracut.spec.old - -rm *.patch; git reset --hard HEAD -last_patch_nr=$(patchnr *.patch | sort -n | tail -n 1) -last_patch_nr=${last_patch_nr:-0000} -#for i in *.patch; do git rm -f $i;done - -if rpm -ivh --define "_srcrpmdir $PWD" --define "_specdir $PWD" --define "_sourcedir $PWD" "$srcrpm"; then - for nr in $(patchnr *.patch); do - [[ $((10#$nr)) -gt $((10#$last_patch_nr)) ]] && git add "${nr}.patch" - done - - new_version=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{version}' dracut.spec) - new_release=$(rpmspec -D "_sourcedir $(pwd)" -q --srpm --qf '%{release}' dracut.spec) - new_release_full=${new_release%.*} - new_release=${new_release%%.*} - - do_print="" - while IFS=$'\n' read -r line - do - if [ -z "$do_print" ] && [ "$line" = "%changelog" ]; then - do_print="yes" - echo "* $(LANG='C' date '+%a %b %d %Y') $(git config user.name) <$(git config user.email)> - ${new_version}-${new_release_full}" - - for ((i=old_release; i> dracut.spec - - # Patch list: - # ls *.patch | tr -s ' ' '\n' | cut -d'.' -f1 | xargs -i zsh -c "nr=\$((10#{})); echo \"Patch\${nr}: {}.patch\"" - - git add dracut.spec - - msg="Resolves: $( - for ((i=old_release; i -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2016 Red Hat, Inc. All rights reserved. -# Red Hat Internal -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/dracut/add-luks-keys -export TESTVERSION=1.0 -export DESCRIPTION="Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase" - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Jan Stodola " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: $(DESCRIPTION)" >> $(METADATA) - @echo "Type: Install" >> $(METADATA) - @echo "TestTime: 10m" >> $(METADATA) - @echo "RunFor: dracut" >> $(METADATA) - @echo "Requires: dracut" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: Red Hat Internal" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/.distro/tests/add-luks-keys/PURPOSE b/.distro/tests/add-luks-keys/PURPOSE deleted file mode 100644 index a7c606363..000000000 --- a/.distro/tests/add-luks-keys/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /dracut/add-luks-keys -Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase. -Author: Jan Stodola diff --git a/.distro/tests/add-luks-keys/runtest.sh b/.distro/tests/add-luks-keys/runtest.sh deleted file mode 100644 index 7ef652b08..000000000 --- a/.distro/tests/add-luks-keys/runtest.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /dracut/add-luks-keys -# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase -# Author: Jan Stodola -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2016 Red Hat, Inc. All rights reserved. -# Red Hat Internal -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGE="dracut" - -keyfile="/root/keyfile" -kernel_file=`grubby --default-kernel` -initrd_file=`grubby --info=$kernel_file | grep ^initrd= | sed 's/^initrd=//' | head -n1` -kernel_version=`rpm -qf $kernel_file --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n'` - -rlJournalStart - rlPhaseStartTest "Add luks keys to initramfs" - - if [ ! -e "$keyfile" ]; then - rlLog "Creating new key file: $keyfile" - rlRun "dd if=/dev/urandom bs=1 count=32 of=$keyfile" - rlRun "chmod 0400 $keyfile" - else - rlLog "Using existing key file: $keyfile" - fi - - rlAssertExists "/etc/crypttab" - rlFileSubmit "/etc/crypttab" - UUIDS=`cat /etc/crypttab | cut -d' ' -f2 | cut -d'=' -f2` - for UUID in $UUIDS; do - rlRun "echo 'redhat' | /sbin/cryptsetup luksAddKey /dev/disk/by-uuid/$UUID $keyfile" - done; - - # modify /etc/crypttab, set key file in the thirth column of the file - rlRun "awk -v \"KEY_FILE=$keyfile\" '{\$3=KEY_FILE; print \$0}' /etc/crypttab > crypttab_mod" - rlRun "mv -Z crypttab_mod /etc/crypttab" - rlRun "chmod 0600 /etc/crypttab" - - rlRun "dracut -f -I $keyfile $initrd_file $kernel_version" - - # zipl has to be executed on s390x - if [ -x /sbin/zipl ]; then - rlRun "/sbin/zipl" - fi - - rlPhaseEnd -rlJournalEnd - diff --git a/.distro/tests/tests.yml b/.distro/tests/tests.yml deleted file mode 100644 index 60a098dca..000000000 --- a/.distro/tests/tests.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# This first play always runs on the local staging system -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - tests: - - add-luks-keys - required_packages: - - dracut # Required for add-luks-keys diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ef281c3da..877a2322b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,5 @@ -This pull request changes... + -## Changes +(Cherry picked from commit ) -## Checklist -- [ ] I have tested it locally -- [ ] I have reviewed and updated any documentation if relevant -- [ ] I am providing new code and test(s) for it - -Fixes # +Resolves: diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 666f8879e..931ec2980 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -19,7 +19,6 @@ permissions: jobs: arm64: - if: github.repository == 'dracut-ng/dracut-ng' || vars.CONTAINER == 'enabled' name: ${{ matrix.config.tag }} on ${{ matrix.config.platform }} runs-on: ubuntu-latest concurrency: @@ -29,7 +28,6 @@ jobs: fail-fast: false matrix: config: - - { dockerfile: 'Dockerfile-Debian', tag: 'debian', platform: 'linux/arm64,linux/amd64' } - { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora', platform: 'linux/arm64,linux/amd64' } steps: - name: Set up QEMU @@ -52,44 +50,6 @@ jobs: uses: docker/build-push-action@v5 with: file: test/container/${{ matrix.config.dockerfile }} - tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}:latest - push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} - platforms: ${{ matrix.config.platform }} - - amd64: - if: github.repository == 'dracut-ng/dracut-ng' || vars.CONTAINER == 'enabled' - name: ${{ matrix.config.tag }} on ${{ matrix.config.platform }} - runs-on: ubuntu-latest - concurrency: - group: amd64-${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} - cancel-in-progress: true - strategy: - fail-fast: false - matrix: - config: - - { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse', platform: 'linux/amd64' } - - { dockerfile: 'Dockerfile-Arch', tag: 'arch', platform: 'linux/amd64' } - - { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo', platform: 'linux/amd64' } - - { dockerfile: 'Dockerfile-Ubuntu', tag: 'ubuntu', platform: 'linux/amd64' } - - { dockerfile: 'Dockerfile-alpine', tag: 'alpine', platform: 'linux/amd64' } - - { dockerfile: 'Dockerfile-Void', tag: 'void', platform: 'linux/amd64' } - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up env - run: echo "repository_owner=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV} - - name: Build and Push Container - uses: docker/build-push-action@v5 - with: - file: test/container/${{ matrix.config.dockerfile }} - tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}:latest + tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }}:latest push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} platforms: ${{ matrix.config.platform }} diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml new file mode 100644 index 000000000..4cfbba6e1 --- /dev/null +++ b/.github/workflows/differential-shellcheck.yml @@ -0,0 +1,19 @@ +name: Differential ShellCheck +on: + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-20.04 + + steps: + - name: Repository checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Differential ShellCheck + uses: redhat-plumbers-in-action/differential-shellcheck@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 6e323b76d..d32e6bb50 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -11,21 +11,14 @@ jobs: basic: name: ${{ matrix.test }} on ${{ matrix.container }} runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 45 concurrency: group: basic-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} cancel-in-progress: true strategy: matrix: container: [ - "alpine", - "arch", - "debian", "fedora", - "gentoo", - "opensuse", - "ubuntu", - "void", ] test: [ "01", @@ -136,11 +129,7 @@ jobs: strategy: matrix: container: [ - "arch", - "debian", "fedora", - "gentoo", - "ubuntu", ] test: [ "02", @@ -160,7 +149,7 @@ jobs: ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" @@ -173,24 +162,39 @@ jobs: timeout-minutes: 30 concurrency: group: dracut-cpio-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }} + + cancel-in-progress: true strategy: matrix: container: [ - "opensuse", + "fedora", + ] + network: [ + "network-manager", + #"systemd-networkd", + #"connman", ] test: [ - "63", + "20", + "30", + "35", + "40", + "50", + "60", ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: "${{ matrix.container }} TEST-${{ matrix.test }}" - run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} arm64: name: ${{ matrix.test }} on ${{ matrix.container }} on arm64 runs-on: ubuntu-latest @@ -201,7 +205,6 @@ jobs: strategy: matrix: container: [ - "debian", "fedora", ] test: [ diff --git a/.github/workflows/manualtest.yml b/.github/workflows/manualtest.yml index 74e56478e..98a68deb6 100644 --- a/.github/workflows/manualtest.yml +++ b/.github/workflows/manualtest.yml @@ -9,17 +9,9 @@ on: container: type: choice description: 'distro' - default: 'all' + default: 'fedora' options: - - "all" - - "alpine" - "fedora" - - "arch" - - "debian" - - "ubuntu" - - "opensuse" - - "gentoo" - - "void" env: description: 'Environment (optional)' default: '{"DEBUGFAIL": "rd.debug"}' diff --git a/.packit.yml b/.packit.yml index 7bb2a0d96..04dda4078 100644 --- a/.packit.yml +++ b/.packit.yml @@ -8,6 +8,7 @@ files_to_sync: patch_generation_ignore_paths: - .distro/ - .packit.yml +- .github/ patch_generation_patch_id_digits: 1 sync_changelog: true From bb752b7a4a4ddd0054639bbb81ecd37b3a491018 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 16 May 2024 14:30:39 +0200 Subject: [PATCH 05/58] build: sync with dist-git From-dist-git-commit: 4faeede00276da9101b9f279a9f1d1a188824021 --- .distro/dracut.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 674136300..51755a5df 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -431,6 +431,10 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Fri Apr 26 2024 Adam Williamson - 060-2 +- Backport fix to pull in required libs for systemd (dracut-ng PR #118) +- Backport fix to move hook directory for systemd (dracut-ng PR #194) + * Wed Mar 20 2024 Pavel Valena - 060-1 - Update to dracut 060. From c02d3e2bdeb1b92aa76efae6c6f6d69fdcb18d0a Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 19 Apr 2024 15:03:39 +0200 Subject: [PATCH 06/58] build: switch to dracut-ng upstream fork The original dracut repository is no longer maintained, new initiative was started: https://github.com/dracut-ng/dracut-ng/ --- .distro/dracut.spec | 11 +++-------- .distro/source-git.yaml | 8 ++++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 51755a5df..dd4ee3b08 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -17,14 +17,9 @@ Summary: Initramfs generator using udev # except util/* which is GPLv2 License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-only -URL: https://github.com/dracutdevs/dracut/wiki/ +URL: https://github.com/dracut-ng/dracut-ng/wiki/ -# Currently upstream does not create releases, therefore -# source is created from commit 856e7acdb1462803c2517c8d64afb2e34c73c735 -# Reference PR: https://github.com/dracutdevs/dracut/pull/2509 -# Unpacked archive: https://github.com/pvalena/dracut-fedora/tree/v60-srpm-unpacked -Source0: dracut-%{version}.tar.xz -#Source0: https://github.com/dracutdevs/dracut/archive/refs/tags/%%{version}.tar.gz +Source0: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/%{version}.tar.gz Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -156,7 +151,7 @@ in a squashfs image, result in a smaller initramfs size and reduce runtime memor usage. %prep -%autosetup -n %{name}-%{version} -S git_am +%autosetup -n %{name}-ng-%{version} -S git_am cp %{SOURCE1} . %build diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index 266b8089e..5d62ef439 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -1,5 +1,5 @@ -upstream_project_url: git@github.com:pvalena/dracut-fedora.git -upstream_ref: 72a126415227cfcdf806c4d165d26983fe3b8b56 +upstream_project_url: git@github.com:dracut-ng/dracut-ng.git +upstream_ref: 856e7acdb1462803c2517c8d64afb2e34c73c735 downstream_package_name: dracut specfile_path: .distro/dracut.spec patch_generation_ignore_paths: @@ -18,5 +18,5 @@ files_to_sync: - exclude source-git.yaml - exclude .gitignore sources: -- path: dracut-060.tar.gz - url: https://src.fedoraproject.org/repo/pkgs/rpms/dracut/059.tar.gz/sha512/eca5b779307a86f1072201f576ebdd2187d0ae3603dfe009acb9ff6fff81f028c9b5b3d2fa70c723d138e00d40b1c0f97a8ae6cd1fcbeefc898d692c54db33e3/dracut-60.tar.gz +- path: dracut-ng-060.tar.gz + url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/060.tar.gz From 1b1c69388c317d1d0b9a5a539d1e34e507ff0d7f Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 24 Apr 2024 08:15:45 +0200 Subject: [PATCH 07/58] build: Update to dracut 101 --- .distro/dracut.spec | 6 +++++- .distro/source-git.yaml | 6 +++--- .packit.yml | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index dd4ee3b08..60879a04f 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -7,7 +7,7 @@ %global __requires_exclude pkg-config Name: dracut -Version: 060 +Version: 101 Release: 1%{?dist} Summary: Initramfs generator using udev @@ -288,6 +288,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/09dbus %{dracutlibdir}/modules.d/10i18n %{dracutlibdir}/modules.d/30convertfs +%{dracutlibdir}/modules.d/45net-lib %{dracutlibdir}/modules.d/45url-lib %{dracutlibdir}/modules.d/50drm %{dracutlibdir}/modules.d/50plymouth @@ -426,6 +427,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Thu May 16 2024 Pavel Valena - 101-1 +- Update to dracut 101. + * Fri Apr 26 2024 Adam Williamson - 060-2 - Backport fix to pull in required libs for systemd (dracut-ng PR #118) - Backport fix to move hook directory for systemd (dracut-ng PR #194) diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index 5d62ef439..7df58107d 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -1,5 +1,5 @@ upstream_project_url: git@github.com:dracut-ng/dracut-ng.git -upstream_ref: 856e7acdb1462803c2517c8d64afb2e34c73c735 +upstream_ref: 2255bf3464536b02342d13398c5331999fcfd4fa downstream_package_name: dracut specfile_path: .distro/dracut.spec patch_generation_ignore_paths: @@ -18,5 +18,5 @@ files_to_sync: - exclude source-git.yaml - exclude .gitignore sources: -- path: dracut-ng-060.tar.gz - url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/060.tar.gz +- path: dracut-ng-101.tar.gz + url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/101.tar.gz diff --git a/.packit.yml b/.packit.yml index 04dda4078..c7b82cdad 100644 --- a/.packit.yml +++ b/.packit.yml @@ -12,7 +12,7 @@ patch_generation_ignore_paths: patch_generation_patch_id_digits: 1 sync_changelog: true -upstream_ref: 856e7acdb1462803c2517c8d64afb2e34c73c735 +upstream_ref: 2255bf3464536b02342d13398c5331999fcfd4fa upstream_package_name: dracut downstream_package_name: dracut From 3bcb0a9f06bac7fa62dc7241860deb8b671f17cd Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 25 Apr 2023 14:56:59 +0200 Subject: [PATCH 08/58] feat(hwdb): add hwdb module to install hwdb.bin on demand Module to install hwdb.bin. Further extensions might make only selected part of hwdb installable to save space. The module is not included by default. Including the module adds 2MB of compressed data (on Fedora, the file has 12MB). Installing hwdb.bin is needed in case of custom HW like a keyboard/mouse, or various interfaces. Original PR: https://github.com/dracutdevs/dracut/pull/1681 --- .distro/dracut.spec | 1 + .github/labeler.yml | 4 ++++ modules.d/95hwdb/module-setup.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100755 modules.d/95hwdb/module-setup.sh diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 60879a04f..08f452993 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -319,6 +319,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/91tpm2-tss %{dracutlibdir}/modules.d/95debug %{dracutlibdir}/modules.d/95fstab-sys +%{dracutlibdir}/modules.d/95hwdb %{dracutlibdir}/modules.d/95lunmask %{dracutlibdir}/modules.d/95resume %{dracutlibdir}/modules.d/95rootfs-block diff --git a/.github/labeler.yml b/.github/labeler.yml index 00142bc80..0cea58c29 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -418,6 +418,10 @@ fstab-sys: - changed-files: - any-glob-to-any-file: 'modules.d/95fstab-sys/*' +hwdb: + - changed-files: + - any-glob-to-any-file: 'modules.d/95hwdb/*' + iscsi: - changed-files: - any-glob-to-any-file: 'modules.d/95iscsi/*' diff --git a/modules.d/95hwdb/module-setup.sh b/modules.d/95hwdb/module-setup.sh new file mode 100755 index 000000000..5d3250f3c --- /dev/null +++ b/modules.d/95hwdb/module-setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# This file is part of dracut. +# SPDX-License-Identifier: GPL-2.0-or-later + +check() { + return 255 +} + +# called by dracut +install() { + local hwdb_bin + + # Follow the same priority as `systemd-hwdb`; `/etc` is the default + # and `/usr/lib` an alternative location. + hwdb_bin="${udevconfdir}"/hwdb.bin + + if [[ ! -r ${hwdb_bin} ]]; then + hwdb_bin="${udevdir}"/hwdb.bin + fi + + if [[ $hostonly ]]; then + inst_multiple -H "${hwdb_bin}" + else + inst_multiple "${hwdb_bin}" + fi +} From d14d724620fe4810930d1c2f07d10fa6b8bc9557 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Sun, 23 Jul 2023 19:44:17 +0200 Subject: [PATCH 09/58] fix(rngd): install system service file as there's no reason to keep a copy; there shouldn't be any modifications. In case there are args stored in a separate file (Fedora and alike), it needs to be supplied too, but without the option to change the user. --- modules.d/06rngd/module-setup.sh | 7 ++++++- modules.d/06rngd/rngd.service | 8 -------- modules.d/06rngd/sysconfig | 1 + 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 modules.d/06rngd/rngd.service create mode 100644 modules.d/06rngd/sysconfig diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh index aec8d576c..e8bdf7f57 100755 --- a/modules.d/06rngd/module-setup.sh +++ b/modules.d/06rngd/module-setup.sh @@ -32,7 +32,12 @@ depends() { install() { inst rngd - inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service" + inst_simple "${systemdsystemunitdir}/rngd.service" + + if [ -r /etc/sysconfig/rngd ]; then + inst_simple "${moddir}/sysconfig" "/etc/sysconfig/rngd" + fi + # make sure dependent libs are installed too inst_libdir_file opensc-pkcs11.so diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service deleted file mode 100644 index dd5374d7a..000000000 --- a/modules.d/06rngd/rngd.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Hardware RNG Entropy Gatherer Daemon -DefaultDependencies=no -Before=systemd-udevd.service -ConditionVirtualization=!container - -[Service] -ExecStart=/usr/sbin/rngd -f diff --git a/modules.d/06rngd/sysconfig b/modules.d/06rngd/sysconfig new file mode 100644 index 000000000..68047ec18 --- /dev/null +++ b/modules.d/06rngd/sysconfig @@ -0,0 +1 @@ +RNGD_ARGS="-x pkcs11 -x nist" From 344600264fec312c473183e9729d263fe4e87358 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 16 May 2024 17:15:55 +0200 Subject: [PATCH 10/58] build: spec - fix s390 modules --- .distro/dracut.spec | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 08f452993..829a46dd4 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -187,11 +187,8 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet %else rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock @@ -333,11 +330,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/91zipl %{dracutlibdir}/modules.d/95dasd %{dracutlibdir}/modules.d/95dasd_mod -%{dracutlibdir}/modules.d/95dasd_rules %{dracutlibdir}/modules.d/95dcssblk -%{dracutlibdir}/modules.d/95qeth_rules %{dracutlibdir}/modules.d/95zfcp -%{dracutlibdir}/modules.d/95zfcp_rules %endif %{dracutlibdir}/modules.d/96securityfs %{dracutlibdir}/modules.d/97masterkey From 12b0bc7c2aee332290048dc7586c2afef928d308 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 5 Jun 2024 01:39:53 +0200 Subject: [PATCH 11/58] build: Upgrade to dracut 102 --- .distro/dracut.spec | 9 ++++++++- .distro/source-git.yaml | 6 +++--- .packit.yml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 829a46dd4..fc5d80907 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -7,7 +7,7 @@ %global __requires_exclude pkg-config Name: dracut -Version: 101 +Version: 102 Release: 1%{?dist} Summary: Initramfs generator using udev @@ -253,6 +253,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/01fips %{dracutlibdir}/modules.d/01systemd-ac-power %{dracutlibdir}/modules.d/01systemd-ask-password +%{dracutlibdir}/modules.d/01systemd-bsod %{dracutlibdir}/modules.d/01systemd-coredump %{dracutlibdir}/modules.d/01systemd-creds %{dracutlibdir}/modules.d/01systemd-hostnamed @@ -305,9 +306,12 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/90mdraid %{dracutlibdir}/modules.d/90multipath %{dracutlibdir}/modules.d/90nvdimm +%{dracutlibdir}/modules.d/90numlock %{dracutlibdir}/modules.d/90overlayfs %{dracutlibdir}/modules.d/90ppcmac +%{dracutlibdir}/modules.d/90pcmcia %{dracutlibdir}/modules.d/90qemu +%{dracutlibdir}/modules.d/90systemd-cryptsetup %{dracutlibdir}/modules.d/91crypt-gpg %{dracutlibdir}/modules.d/91crypt-loop %{dracutlibdir}/modules.d/91fido2 @@ -422,6 +426,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Tue Jun 04 2024 Pavel Valena - 102-1 +- Update to dracut 102. + * Thu May 16 2024 Pavel Valena - 101-1 - Update to dracut 101. diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index 7df58107d..7b2df1327 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -1,5 +1,5 @@ upstream_project_url: git@github.com:dracut-ng/dracut-ng.git -upstream_ref: 2255bf3464536b02342d13398c5331999fcfd4fa +upstream_ref: 1a8ee6e00bbe017717a5ef9e9bcfefb3b88f629e downstream_package_name: dracut specfile_path: .distro/dracut.spec patch_generation_ignore_paths: @@ -18,5 +18,5 @@ files_to_sync: - exclude source-git.yaml - exclude .gitignore sources: -- path: dracut-ng-101.tar.gz - url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/101.tar.gz +- path: dracut-ng-102.tar.gz + url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/102.tar.gz diff --git a/.packit.yml b/.packit.yml index c7b82cdad..7c9ca5011 100644 --- a/.packit.yml +++ b/.packit.yml @@ -12,7 +12,7 @@ patch_generation_ignore_paths: patch_generation_patch_id_digits: 1 sync_changelog: true -upstream_ref: 2255bf3464536b02342d13398c5331999fcfd4fa +upstream_ref: 1a8ee6e00bbe017717a5ef9e9bcfefb3b88f629e upstream_package_name: dracut downstream_package_name: dracut From 6fa596ca039300e5f4bb3cca14768976efe95eac Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 12 Jun 2024 06:30:42 +0200 Subject: [PATCH 12/58] revert: "fix(install.d): correctly install pre-genned image and die if no args" revert: "fix(install.d): simplify and use what kernel-install gives us" This reverts commits: d40155385d060f8d8608fa8a4931e2e42ddc3a8f 8388ad149c698c951089606352fdb0cdcaaf40c9 https://github.com/dracut-ng/dracut-ng/issues/334 This is temporary, until the `20-grub.install` will be able to handle initrd from kernel staging area. --- install.d/50-dracut.install | 152 ++++++++++++++++++----------- install.d/51-dracut-rescue.install | 22 +---- 2 files changed, 97 insertions(+), 77 deletions(-) diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index 14f877216..441414ac3 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -1,13 +1,13 @@ #!/bin/bash -COMMAND="${1:?}" -KERNEL_VERSION="${2:?}" -#shellcheck disable=SC2034 +COMMAND="$1" +KERNEL_VERSION="$2" BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" -# If the initrd was provided on the kernel command line, we shouldn't generate our own. -if [[ "$COMMAND" != "add" || "$#" -gt 4 ]]; then +# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. +# So, let's skip to create initrd. +if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then exit 0 fi @@ -16,64 +16,102 @@ if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then exit 0 fi -if [[ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" = "dracut" ]]; then - # We are the initrd generator - IMAGE="initrd" - UEFI_OPTS="--no-uefi" +# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess. +if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then + BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" + if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then + # No uki generator preference set or we have been chosen + IMAGE="uki.efi" + UEFI_OPTS="--uefi" + elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then + # We aren't the uki generator, but we have been requested to make the initrd + IMAGE="initrd" + UEFI_OPTS="--no-uefi" + else + exit 0 + fi +elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then + BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" + if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then + IMAGE="initrd" + UEFI_OPTS="--no-uefi" + else + exit 0 + fi else - exit 0 + # No layout information, use users --uefi/--no-uefi preference + UEFI_OPTS="" + if [[ -d $BOOT_DIR_ABS ]]; then + IMAGE="initrd" + else + BOOT_DIR_ABS="/boot" + IMAGE="initramfs-${KERNEL_VERSION}.img" + fi fi -if [[ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]]; then - # We are chosen to generate the UKI as well as initrd - IMAGE="uki.efi" - UEFI_OPTS="--uefi" -fi +ret=0 -if [[ -f ${KERNEL_IMAGE%/*}/$IMAGE ]]; then - # we found an initrd or uki.efi at the same place as the kernel - # use this and don't generate a new one - [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \ - "There is an $IMAGE image at the same place as the kernel, skipping generating a new one" - cp --reflink=auto "${KERNEL_IMAGE%/*}/$IMAGE" "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" \ - && chown root:root "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" \ - && chmod 0600 "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" \ - && exit 0 -fi +case "$COMMAND" in + add) + if [[ $IMAGE == "uki.efi" ]]; then + IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi + else + IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd + fi + if [[ -f ${IMAGE_PREGENERATED} ]]; then + # we found an initrd or uki.efi at the same place as the kernel + # use this and don't generate a new one + [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \ + "There is an ${IMAGE} image at the same place as the kernel, skipping generating a new one" + cp --reflink=auto "$IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$IMAGE" \ + && chown root:root "$BOOT_DIR_ABS/$IMAGE" \ + && chmod 0600 "$BOOT_DIR_ABS/$IMAGE" \ + && exit 0 + fi -if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then - if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then - read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline" - fi -elif [[ -f /etc/kernel/cmdline ]]; then - read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline -elif [[ -f /usr/lib/kernel/cmdline ]]; then - read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline -else - declare -a BOOT_OPTIONS + if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then + if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then + read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline" + fi + elif [[ -f /etc/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline + elif [[ -f /usr/lib/kernel/cmdline ]]; then + read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline + else + declare -a BOOT_OPTIONS - read -r -d '' -a line < /proc/cmdline - for i in "${line[@]}"; do - [[ ${i#initrd=*} != "$i" ]] && continue - BOOT_OPTIONS+=("$i") - done -fi + read -r -d '' -a line < /proc/cmdline + for i in "${line[@]}"; do + [[ ${i#initrd=*} != "$i" ]] && continue + BOOT_OPTIONS+=("$i") + done + fi -unset noimageifnotneeded + unset noimageifnotneeded -for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do - # shellcheck disable=SC1001 - if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then - noimageifnotneeded="yes" - break - fi -done + for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do + # shellcheck disable=SC1001 + if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then + noimageifnotneeded="yes" + break + fi + done + + # shellcheck disable=SC2046 + dracut -f \ + ${noimageifnotneeded:+--noimageifnotneeded} \ + $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \ + $([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \ + "$UEFI_OPTS" \ + --kver "$KERNEL_VERSION" \ + "$BOOT_DIR_ABS/$IMAGE" + ret=$? + ;; + + remove) + rm -f -- "$BOOT_DIR_ABS/$IMAGE" + ret=$? + ;; +esac -# shellcheck disable=SC2046 -dracut -f \ - ${noimageifnotneeded:+--noimageifnotneeded} \ - $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \ - $([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \ - "$UEFI_OPTS" \ - --kver "$KERNEL_VERSION" \ - "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" || exit 1 +exit $ret diff --git a/install.d/51-dracut-rescue.install b/install.d/51-dracut-rescue.install index 25f75557a..aa0ccdc5e 100755 --- a/install.d/51-dracut-rescue.install +++ b/install.d/51-dracut-rescue.install @@ -2,29 +2,11 @@ export LANG=C -COMMAND="${1:?}" -KERNEL_VERSION="${2:?}" +COMMAND="$1" +KERNEL_VERSION="$2" BOOT_DIR_ABS="${3%/*}/0-rescue" KERNEL_IMAGE="$4" -# If the initrd was provided on the kernel command line, we shouldn't generate our own. -if [[ "$COMMAND" = "add" && "$#" -gt 4 ]]; then - exit 0 -fi - -# Do not attempt to create initramfs if the supplied image is already a UKI -if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then - exit 0 -fi - -if [[ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]]; then - # Rescue images currently not compatible with UKIs - exit 0 -elif [[ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]]; then - # We are not the initrd generator - exit 0 -fi - dropindirs_sort() { suffix=$1 shift From c6d18c3c71597e78572378fc4dde391f1845b8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Jan 2022 18:08:42 +0100 Subject: [PATCH 13/58] feat(kernel-install): do nothing when $KERNEL_INSTALL_INITRD_GENERATOR says so dracut may be installed without being actually used. This is very common in binary distros where a package may be pulled in through dependencies, even though the user does not need it in a particular setup. KERNEL_INSTALL_INITRD_GENERATOR is being added in systemd's kernel-install to select which of the possibly many initrd generation mechanisms will be used. For backwards compat, if it not set, continue as before. But if set to something else, skip our kernel-install plugins. (Cherry-picked commit f47bcdd7342ca0d46b889e712a1c7446e18434bc from PR#1825) --- install.d/50-dracut.install | 31 ++++++------------------------ install.d/51-dracut-rescue.install | 12 +++++++++--- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index 441414ac3..efb184cd2 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -6,38 +6,19 @@ BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" # If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. -# So, let's skip to create initrd. +# In this case, do not create the initrd. if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then exit 0 fi -# Do not attempt to create initramfs if the supplied image is already a UKI -if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then +# Skip this plugin if we're using a different generator. If nothing is specified, +# assume we're wanted since we're installed. +if [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]; then exit 0 fi -# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess. -if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then - BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" - if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then - # No uki generator preference set or we have been chosen - IMAGE="uki.efi" - UEFI_OPTS="--uefi" - elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then - # We aren't the uki generator, but we have been requested to make the initrd - IMAGE="initrd" - UEFI_OPTS="--no-uefi" - else - exit 0 - fi -elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then - BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" - if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then - IMAGE="initrd" - UEFI_OPTS="--no-uefi" - else - exit 0 - fi +if [[ -d "$BOOT_DIR_ABS" ]]; then + INITRD="initrd" else # No layout information, use users --uefi/--no-uefi preference UEFI_OPTS="" diff --git a/install.d/51-dracut-rescue.install b/install.d/51-dracut-rescue.install index aa0ccdc5e..be4172b51 100755 --- a/install.d/51-dracut-rescue.install +++ b/install.d/51-dracut-rescue.install @@ -7,9 +7,15 @@ KERNEL_VERSION="$2" BOOT_DIR_ABS="${3%/*}/0-rescue" KERNEL_IMAGE="$4" -dropindirs_sort() { - suffix=$1 - shift +# Skip this plugin if we're using a different generator. If nothing is specified, +# assume we're wanted since we're installed. +if [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]; then + exit 0 +fi + +dropindirs_sort() +{ + suffix=$1; shift args=("$@") files=$( while (($# > 0)); do From 1bd81956dc050db071c5885cfbcde393370468ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 18 Jan 2022 18:58:58 +0100 Subject: [PATCH 14/58] fix(kernel-install): do not generate an initrd when one was specified According to the synopsis, kernel-install can be called with an already-prepared initrd. In that case, no initrd should be generated by dracut. (Cherry-picked commit 0b72cf5c4eca0e0db76e3e210cfdc48e6b49bb74 from PR#1825) --- install.d/50-dracut.install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index efb184cd2..3907e303b 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -4,6 +4,7 @@ COMMAND="$1" KERNEL_VERSION="$2" BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" +INITRD_OPTIONS_SHIFT=4 # If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. # In this case, do not create the initrd. @@ -34,6 +35,9 @@ ret=0 case "$COMMAND" in add) + # If the initrd was provided on the kernel command line, we shouldn't generate our own. + [ "$#" -gt "$INITRD_OPTIONS_SHIFT" ] && exit 0 + if [[ $IMAGE == "uki.efi" ]]; then IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi else From 6cb58e86ae65cf9922023b12e889446323a89080 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Sat, 15 Jun 2024 15:21:44 -0400 Subject: [PATCH 15/58] fix(crypt): decryption when rd.luks.name is set --- modules.d/90crypt/parse-crypt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh index 39fc6d211..9567a4a97 100755 --- a/modules.d/90crypt/parse-crypt.sh +++ b/modules.d/90crypt/parse-crypt.sh @@ -174,7 +174,7 @@ else } >> "$hookdir/emergency/90-crypt.sh" fi done - elif getargbool 1 rd.auto; then + elif getargbool 1 rd.auto && [ -z "$(getargs rd.luks.name)" ]; then if [ -z "$DRACUT_SYSTEMD" ]; then { printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" From 30e7870504d09183bb9d99ed04f148c7dfb0c645 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 11 Jul 2024 07:33:05 +0200 Subject: [PATCH 16/58] fix: incorrectly applied patch in commit c6d18c3c71597e78572378fc4dde391f1845b8 named: "feat(kernel-install): do nothing when $KERNEL_INSTALL_INITRD_GENERATOR says so" Resolves: rhbz#2276271 --- install.d/50-dracut.install | 30 ++++++++++++++++++++++++++++-- install.d/51-dracut-rescue.install | 6 +++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install index 3907e303b..076b4f5e7 100755 --- a/install.d/50-dracut.install +++ b/install.d/50-dracut.install @@ -18,8 +18,34 @@ if [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]; then exit 0 fi -if [[ -d "$BOOT_DIR_ABS" ]]; then - INITRD="initrd" +# Do not attempt to create initramfs if the supplied image is already a UKI +if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then + exit 0 +fi + +# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess. +if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then + BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" + if [[ -z $KERNEL_INSTALL_UKI_GENERATOR || $KERNEL_INSTALL_UKI_GENERATOR == "dracut" ]]; then + # No uki generator preference set or we have been chosen + IMAGE="uki.efi" + UEFI_OPTS="--uefi" + elif [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then + # We aren't the uki generator, but we have been requested to make the initrd + IMAGE="initrd" + UEFI_OPTS="--no-uefi" + else + exit 0 + fi +elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then + BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA" + if [[ -z $KERNEL_INSTALL_INITRD_GENERATOR || $KERNEL_INSTALL_INITRD_GENERATOR == "dracut" ]]; then + IMAGE="initrd" + UEFI_OPTS="--no-uefi" + else + exit 0 + fi + else # No layout information, use users --uefi/--no-uefi preference UEFI_OPTS="" diff --git a/install.d/51-dracut-rescue.install b/install.d/51-dracut-rescue.install index be4172b51..5310229e0 100755 --- a/install.d/51-dracut-rescue.install +++ b/install.d/51-dracut-rescue.install @@ -13,9 +13,9 @@ if [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]; then exit 0 fi -dropindirs_sort() -{ - suffix=$1; shift +dropindirs_sort() { + suffix=$1 + shift args=("$@") files=$( while (($# > 0)); do From 93937d805f8166d9f708f9163fc93839fc1437d3 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 11 Jul 2024 16:24:14 +0200 Subject: [PATCH 17/58] revert: "fix(crypt): unlock encrypted devices by default during boot" This reverts commit 2339acfaeee60d6bb26a1103db2e53bc8f9cb2d1. Resolves: rhbz#2295215 --- modules.d/90crypt/parse-crypt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/90crypt/parse-crypt.sh b/modules.d/90crypt/parse-crypt.sh index 9567a4a97..e46e347ac 100755 --- a/modules.d/90crypt/parse-crypt.sh +++ b/modules.d/90crypt/parse-crypt.sh @@ -174,7 +174,7 @@ else } >> "$hookdir/emergency/90-crypt.sh" fi done - elif getargbool 1 rd.auto && [ -z "$(getargs rd.luks.name)" ]; then + elif getargbool 0 rd.auto; then if [ -z "$DRACUT_SYSTEMD" ]; then { printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" From e02ef9afa1ede698623f25d5694949e9b4fedb4e Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Tue, 6 Dec 2022 21:46:01 +0100 Subject: [PATCH 18/58] fix(90kernel-modules): install blk modules using symbol blk_alloc_disk Corresponding kernel symbol blk_cleanup_disk is no longer used in the nvdimm driver and calls are made directly instead. blk_alloc_disk is used: https://elixir.bootlin.com/linux/v6.1-rc8/source/drivers/nvdimm/pmem.c#L522 Resolves: RHEL-32237 --- modules.d/90kernel-modules/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh index ec60f3935..89f332319 100755 --- a/modules.d/90kernel-modules/module-setup.sh +++ b/modules.d/90kernel-modules/module-setup.sh @@ -2,7 +2,7 @@ # called by dracut installkernel() { - local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk' + local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_alloc_disk|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk' local -A _hostonly_drvs record_block_dev_drv() { From 6f7820cb0de9a241ae5935a344a92033407bfd21 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 4 Jul 2024 21:00:07 +0200 Subject: [PATCH 19/58] ci: fix packit & .github/* configuration + add C10s dockerfile. --- .github/workflows/container.yml | 8 +- .github/workflows/integration.yml | 22 ++-- .github/workflows/manualtest.yml | 4 +- .packit.yml | 25 ++--- test/container/Dockerfile-Arch | 52 --------- test/container/Dockerfile-CentOS-10-Stream | 123 +++++++++++++++++++++ test/container/Dockerfile-Debian | 66 ----------- test/container/Dockerfile-Fedora-latest | 71 ------------ test/container/Dockerfile-Gentoo | 59 ---------- test/container/Dockerfile-OpenSuse-latest | 52 --------- test/container/Dockerfile-Ubuntu | 67 ----------- test/container/Dockerfile-Void | 64 ----------- test/container/Dockerfile-alpine | 62 ----------- 13 files changed, 152 insertions(+), 523 deletions(-) delete mode 100644 test/container/Dockerfile-Arch create mode 100644 test/container/Dockerfile-CentOS-10-Stream delete mode 100644 test/container/Dockerfile-Debian delete mode 100644 test/container/Dockerfile-Fedora-latest delete mode 100644 test/container/Dockerfile-Gentoo delete mode 100644 test/container/Dockerfile-OpenSuse-latest delete mode 100644 test/container/Dockerfile-Ubuntu delete mode 100644 test/container/Dockerfile-Void delete mode 100644 test/container/Dockerfile-alpine diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 931ec2980..ad4fbb90d 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -18,17 +18,17 @@ permissions: contents: read jobs: - arm64: + push_to_registry: name: ${{ matrix.config.tag }} on ${{ matrix.config.platform }} runs-on: ubuntu-latest concurrency: - group: arm64-${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }} cancel-in-progress: true strategy: fail-fast: false matrix: config: - - { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora', platform: 'linux/arm64,linux/amd64' } + - { dockerfile: 'Dockerfile-CentOS-10-Stream', tag: 'centos:stream10' } steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -50,6 +50,6 @@ jobs: uses: docker/build-push-action@v5 with: file: test/container/${{ matrix.config.dockerfile }} - tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }}:latest + tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.config.tag }} push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} platforms: ${{ matrix.config.platform }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d32e6bb50..328487d42 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -18,14 +18,14 @@ jobs: strategy: matrix: container: [ - "fedora", + "centos:stream10", ] test: [ "01", ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/redhat-plumbers/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" @@ -42,7 +42,7 @@ jobs: strategy: matrix: container: [ - "fedora", + "centos:stream10", ] network: [ "network", @@ -55,7 +55,7 @@ jobs: ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/redhat-plumbers/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" @@ -72,7 +72,7 @@ jobs: strategy: matrix: container: [ - "opensuse", + "centos:stream10", ] network: [ "network-legacy", @@ -84,7 +84,7 @@ jobs: ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/redhat-plumbers/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" @@ -112,7 +112,7 @@ jobs: ] fail-fast: false container: - image: ghcr.io/dracut-ng/${{ matrix.container }} + image: ghcr.io/redhat-plumbers/${{ matrix.container }} options: "--privileged -v /dev:/dev" steps: - name: "Checkout Repository" @@ -129,7 +129,7 @@ jobs: strategy: matrix: container: [ - "fedora", + "centos:stream10", ] test: [ "02", @@ -168,7 +168,7 @@ jobs: strategy: matrix: container: [ - "fedora", + "centos:stream10", ] network: [ "network-manager", @@ -205,7 +205,7 @@ jobs: strategy: matrix: container: [ - "fedora", + "centos:stream10", ] test: [ "98", @@ -219,4 +219,4 @@ jobs: - name: "Checkout Repository" uses: actions/checkout@v4 - name: "${{ matrix.container }} TEST-${{ matrix.test }}" - run: docker run --platform linux/arm64 --privileged -v /dev:/dev -v $PWD:/w ghcr.io/dracut-ng/${{ matrix.container }} /w/tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} + run: docker run --platform linux/arm64 --privileged -v /dev:/dev -v $PWD:/w ghcr.io/redhat-plumbers/${{ matrix.container }} /w/tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} diff --git a/.github/workflows/manualtest.yml b/.github/workflows/manualtest.yml index 98a68deb6..7fbd35b2f 100644 --- a/.github/workflows/manualtest.yml +++ b/.github/workflows/manualtest.yml @@ -9,9 +9,9 @@ on: container: type: choice description: 'distro' - default: 'fedora' + default: 'centos:stream10' options: - - "fedora" + - "centos:stream10" env: description: 'Environment (optional)' default: '{"DEBUGFAIL": "rd.debug"}' diff --git a/.packit.yml b/.packit.yml index 7c9ca5011..1128bf86f 100644 --- a/.packit.yml +++ b/.packit.yml @@ -23,29 +23,28 @@ downstream_package_name: dracut # - "cp pkgbuild/dracut.spec ." jobs: -# Build test -- job: upstream_koji_build - trigger: pull_request - scratch: true - targets: - - fedora-rawhide-x86_64 - - fedora-eln-x86_64 +#- job: upstream_koji_build +# trigger: pull_request +# scratch: true +# targets: +# - fedora-rawhide-x86_64 +# - fedora-eln-x86_64 - job: copr_build trigger: pull_request targets: - - fedora-rawhide-x86_64 - - fedora-eln-x86_64 + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 # Run tests (via testing farm) - job: tests trigger: pull_request targets: - - fedora-rawhide-x86_64 -# - fedora-eln-x86_64 + - centos-stream-10-x86_64 + - centos-stream-10-aarch64 -## Create fedora PR +## Create PR #- job: propose_downstream # trigger: release # dist_git_branches: -# - rawhide +# - diff --git a/test/container/Dockerfile-Arch b/test/container/Dockerfile-Arch deleted file mode 100644 index 2af810a0c..000000000 --- a/test/container/Dockerfile-Arch +++ /dev/null @@ -1,52 +0,0 @@ -FROM docker.io/archlinux - -RUN pacman --noconfirm -Syu \ - asciidoc \ - astyle \ - base-devel \ - bluez \ - btrfs-progs \ - busybox \ - cargo \ - cifs-utils \ - connman \ - cpio \ - dash \ - dhclient \ - dhcp \ - dmraid \ - elfutils \ - f2fs-tools \ - git \ - glibc \ - jq \ - linux \ - lvm2 \ - lzop \ - mdadm \ - multipath-tools \ - nbd \ - networkmanager \ - nfsidmap \ - nfs-utils \ - ntfs-3g \ - nvme-cli \ - open-iscsi \ - openssh \ - parted \ - pigz \ - plymouth \ - qemu \ - qrencode \ - rng-tools \ - sbsigntools \ - shellcheck \ - shfmt \ - squashfs-tools \ - strace \ - systemd-ukify \ - tcpdump \ - tgt \ - tpm2-tools \ - vi \ - && yes | pacman -Scc diff --git a/test/container/Dockerfile-CentOS-10-Stream b/test/container/Dockerfile-CentOS-10-Stream new file mode 100644 index 000000000..1beb9b581 --- /dev/null +++ b/test/container/Dockerfile-CentOS-10-Stream @@ -0,0 +1,123 @@ +FROM quay.io/centos/centos:stream10-development + +MAINTAINER https://github.com/redhat-plumbers/dracut-rhel10 + +ENV container=docker +LABEL RUN="docker run -it --name NAME --privileged --ipc=host --net=host --pid=host -e NAME=NAME -e IMAGE=IMAGE IMAGE" + +RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' > /etc/profile.d/dracut-test.sh + +# Install needed packages for the dracut CI container +# FIXME: properly re-add dash once C10S EPEL is available +# http://mirrors.kernel.org/fedora/releases/34/Everything/x86_64/os/Packages/d/dash-0.5.10.2-8.fc34.x86_64.rpm \ +RUN dnf -y install --skip-broken --enablerepo crb --setopt=install_weak_deps=False \ + qemu-kvm \ + NetworkManager \ + asciidoc \ + bash-completion \ + bzip2 \ + cryptsetup \ + dbus-daemon \ + dhcp \ + e2fsprogs \ + gcc \ + git \ + iproute \ + iputils \ + iscsi-initiator-utils \ + kbd \ + kernel \ + kmod-devel \ + lvm2 \ + make \ + mdadm \ + nfs-utils \ + parted \ + pigz \ + rpm-build \ + squashfs-tools \ + strace \ + sudo \ + tar \ + tcpdump \ + wget \ + which \ + xz +# && dnf -y update && dnf clean all + +# C10S ships only qemu-kvm, but it disables the KVM accel when it's not +# available +RUN ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm && \ + ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m) + +# From Fedora container +# Install needed packages for the dracut CI container +RUN dnf -y install --skip-broken --setopt=install_weak_deps=False \ + asciidoc \ + astyle \ + bash-completion \ + bluez \ + btrfs-progs \ + busybox \ + bzip2 \ + cargo \ + cifs-utils \ + cryptsetup \ + dash \ + dbus-daemon \ + device-mapper-multipath \ + dhcp-client \ + dhcp-server \ + dmraid \ + e2fsprogs \ + erofs-utils \ + f2fs-tools \ + fcoe-utils \ + fuse3 \ + gcc \ + git \ + iproute \ + iputils \ + iscsi-initiator-utils \ + jq \ + kbd \ + kernel \ + kmod-devel \ + libkcapi-hmaccalc \ + libselinux-utils \ + lvm2 \ + lzop \ + make \ + mdadm \ + memstrack \ + mksh \ + nbd \ + ndctl \ + NetworkManager \ + nfs-utils \ + ntfs-3g \ + ntfsprogs \ + nvme-cli \ + parted \ + pcsc-lite \ + pigz \ + qemu \ + qrencode \ + rng-tools \ + rpm-build \ + sbsigntools \ + scsi-target-utils \ + ShellCheck \ + shfmt \ + squashfs-tools \ + strace \ + systemd-boot-unsigned \ + systemd-networkd \ + systemd-resolved \ + systemd-ukify \ + tar \ + tcpdump \ + tpm2-tools \ + wget \ + xz \ + && dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all diff --git a/test/container/Dockerfile-Debian b/test/container/Dockerfile-Debian deleted file mode 100644 index 7e7e6d443..000000000 --- a/test/container/Dockerfile-Debian +++ /dev/null @@ -1,66 +0,0 @@ -FROM docker.io/debian:latest - -# Install needed packages for the dracut CI container -# Install dracut as a linux-initramfs-tool provider so that the default initramfs-tool package does not get installed -# Uninstall initramfs-tools-core as a workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994492 -RUN apt-get update -y -qq && apt-get upgrade -y -qq && apt-get install -y -qq --no-install-recommends dracut && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \ - asciidoc \ - astyle \ - bluez \ - btrfs-progs \ - busybox-static \ - bzip2 \ - ca-certificates \ - cargo \ - console-setup \ - cpio \ - cryptsetup \ - curl \ - dmraid \ - docbook \ - docbook-xml \ - docbook-xsl \ - fdisk \ - g++ \ - gawk \ - git \ - iputils-arping \ - iputils-ping \ - isc-dhcp-client \ - isc-dhcp-server \ - iscsiuio \ - kmod \ - less \ - libdmraid-dev \ - libkmod-dev \ - linux-image-generic \ - lvm2 \ - make \ - mdadm \ - multipath-tools \ - nbd-client \ - nbd-server \ - network-manager \ - nfs-kernel-server \ - ntfs-3g \ - open-iscsi \ - ovmf \ - parted \ - pigz \ - pkg-config \ - procps \ - qemu-kvm \ - rng-tools5 \ - shellcheck \ - sbsigntool \ - squashfs-tools \ - strace \ - systemd-boot-efi \ - tcpdump \ - tgt \ - thin-provisioning-tools \ - tpm2-tools \ - vim \ - wget \ - && apt-get clean && dpkg -P --force-depends dracut dracut-core initramfs-tools-core diff --git a/test/container/Dockerfile-Fedora-latest b/test/container/Dockerfile-Fedora-latest deleted file mode 100644 index 106af17a6..000000000 --- a/test/container/Dockerfile-Fedora-latest +++ /dev/null @@ -1,71 +0,0 @@ -FROM registry.fedoraproject.org/fedora:latest - -# Install needed packages for the dracut CI container -RUN dnf -y install --setopt=install_weak_deps=False \ - asciidoc \ - astyle \ - bash-completion \ - bluez \ - btrfs-progs \ - busybox \ - bzip2 \ - cargo \ - cifs-utils \ - cryptsetup \ - dash \ - dbus-daemon \ - device-mapper-multipath \ - dhcp-client \ - dhcp-server \ - dmraid \ - e2fsprogs \ - f2fs-tools \ - fcoe-utils \ - fuse3 \ - gcc \ - git \ - iproute \ - iputils \ - iscsi-initiator-utils \ - jq \ - kbd \ - kernel \ - kmod-devel \ - libkcapi-hmaccalc \ - libselinux-utils \ - lvm2 \ - lzop \ - make \ - mdadm \ - memstrack \ - mksh \ - nbd \ - ndctl \ - NetworkManager \ - nfs-utils \ - ntfs-3g \ - ntfsprogs \ - nvme-cli \ - parted \ - pcsc-lite \ - pigz \ - qemu \ - qrencode \ - rng-tools \ - rpm-build \ - sbsigntools \ - scsi-target-utils \ - ShellCheck \ - shfmt \ - squashfs-tools \ - strace \ - systemd-boot-unsigned \ - systemd-networkd \ - systemd-resolved \ - systemd-ukify \ - tar \ - tcpdump \ - tpm2-tools \ - wget \ - xz \ - && dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all diff --git a/test/container/Dockerfile-Gentoo b/test/container/Dockerfile-Gentoo deleted file mode 100644 index 7b4eb2a3f..000000000 --- a/test/container/Dockerfile-Gentoo +++ /dev/null @@ -1,59 +0,0 @@ -FROM docker.io/gentoo/portage:latest as portage - -FROM docker.io/gentoo/stage3:systemd -COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo - -# Speed-up using binpkgs -RUN echo "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"" >> /etc/portage/make.conf -RUN echo "EMERGE_DEFAULT_OPTS=\"-j$(nproc) -l$(nproc)\"" >> /etc/portage/make.conf -RUN echo "FEATURES=\"getbinpkg binpkg-ignore-signature parallel-fetch parallel-install pkgdir-index-trusted\"" >> /etc/portage/make.conf - -# systemd-boot, no need to install intramfs with kernel -RUN echo "USE=\"boot kernel-install -initramfs\"" >> /etc/portage/make.conf - -# Use debian's installkernel -RUN echo 'sys-kernel/installkernel -systemd' >> /etc/portage/package.use/kernel - -# Enable ukify and cryptsetup tools (includes unit generator for crypttab) -RUN echo 'sys-apps/systemd ukify cryptsetup' >> /etc/portage/package.use/systemd - -# Support thin volumes and build all of LVM2 including daemons and tools like lvchange -RUN echo 'sys-fs/lvm2 thin lvm' >> /etc/portage/package.use/lvm2 - -RUN emerge --quiet --deep --autounmask-continue=y --with-bdeps=n \ - app-admin/rsyslog \ - app-arch/cpio \ - app-crypt/tpm2-tools \ - app-crypt/sbsigntools \ - app-emulation/qemu \ - app-misc/jq \ - app-portage/gentoolkit \ - app-shells/dash \ - dev-lang/rust-bin \ - net-fs/cifs-utils \ - net-fs/nfs-utils \ - net-misc/dhcp \ - net-wireless/bluez \ - sys-apps/biosdevname \ - sys-apps/busybox \ - sys-apps/nvme-cli \ - sys-apps/rng-tools \ - sys-apps/systemd \ - sys-block/nbd \ - sys-block/open-iscsi \ - sys-block/parted \ - sys-block/tgt \ - sys-fs/btrfs-progs \ - sys-fs/cryptsetup \ - sys-fs/dmraid \ - sys-fs/mdadm \ - sys-fs/multipath-tools \ - sys-fs/ntfs3g \ - sys-fs/squashfs-tools \ - sys-kernel/gentoo-kernel-bin \ - sys-libs/libxcrypt \ - sys-libs/glibc \ - virtual/pkgconfig \ - && rm -rf /var/cache/* /usr/share/doc/* /usr/share/man/* - -RUN emerge --depclean --with-bdeps=n diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest deleted file mode 100644 index a5fb7de5c..000000000 --- a/test/container/Dockerfile-OpenSuse-latest +++ /dev/null @@ -1,52 +0,0 @@ -FROM registry.opensuse.org/opensuse/tumbleweed-dnf:latest - -# Install needed packages for the dracut CI container -RUN dnf -y install --setopt=install_weak_deps=False \ - asciidoc \ - bash-completion \ - btrfsprogs \ - bzip2 \ - cargo \ - cryptsetup \ - dash \ - dbus-broker \ - dhcp-client \ - dhcp-server \ - dmraid \ - e2fsprogs \ - gcc \ - git \ - iproute \ - iputils \ - iscsiuio \ - kbd \ - kernel \ - libkmod-devel \ - lvm2 \ - make \ - mdadm \ - nbd \ - NetworkManager \ - nfs-utils \ - open-iscsi \ - parted \ - pigz \ - procps \ - qemu-kvm \ - rng-tools \ - rpm-build \ - sbsigntools \ - ShellCheck \ - shfmt \ - squashfs \ - strace \ - systemd-boot \ - tar \ - tcpdump \ - tgt \ - tpm2.0-tools \ - /usr/bin/qemu-system-$(uname -m) \ - util-linux-systemd \ - wget \ - xz \ - && rpm -e --nodeps dracut && dnf -y update && dnf clean all diff --git a/test/container/Dockerfile-Ubuntu b/test/container/Dockerfile-Ubuntu deleted file mode 100644 index ef15a67fb..000000000 --- a/test/container/Dockerfile-Ubuntu +++ /dev/null @@ -1,67 +0,0 @@ -FROM docker.io/ubuntu:latest - -# Install needed packages for the dracut CI container -# The Linux kernel is only readable by root. See https://launchpad.net/bugs/759725 -RUN apt-get update -y -qq && apt-get upgrade -y -qq && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends -o Dpkg::Use-Pty=0 \ - asciidoc \ - astyle \ - bluez \ - btrfs-progs \ - busybox-static \ - bzip2 \ - ca-certificates \ - cargo \ - console-setup \ - cpio \ - cryptsetup \ - curl \ - dmraid \ - docbook \ - docbook-xml \ - docbook-xsl \ - fdisk \ - g++ \ - gawk \ - git \ - iputils-arping \ - iputils-ping \ - isc-dhcp-client \ - isc-dhcp-server \ - iscsiuio \ - kmod \ - less \ - libdmraid-dev \ - libkmod-dev \ - linux-image-generic \ - lvm2 \ - make \ - mdadm \ - multipath-tools \ - nbd-client \ - nbd-server \ - network-manager \ - nfs-kernel-server \ - ntfs-3g \ - open-iscsi \ - ovmf \ - parted \ - pigz \ - pkg-config \ - procps \ - qemu-kvm \ - rng-tools5 \ - sbsigntool \ - shellcheck \ - squashfs-tools \ - strace \ - systemd-boot-efi \ - systemd-ukify \ - tcpdump \ - tgt \ - thin-provisioning-tools \ - tpm2-tools \ - vim \ - wget \ - && apt-get clean \ - && chmod a+r /boot/vmlinu* diff --git a/test/container/Dockerfile-Void b/test/container/Dockerfile-Void deleted file mode 100644 index 99044c31b..000000000 --- a/test/container/Dockerfile-Void +++ /dev/null @@ -1,64 +0,0 @@ -FROM ghcr.io/void-linux/void-glibc-full - -RUN xbps-install -Syu xbps && xbps-install -yu \ - asciidoc \ - astyle \ - base-devel \ - bash \ - binutils \ - bluez \ - btrfs-progs \ - busybox \ - cargo \ - cifs-utils \ - connman \ - cpio \ - cryptsetup \ - curl \ - dash \ - dhclient \ - dhcp \ - dmraid \ - dosfstools \ - e2fsprogs \ - edk2-ovmf \ - elfutils \ - eudev \ - f2fs-tools \ - git \ - glibc \ - gnupg \ - iputils \ - jq \ - kbd \ - libkmod-devel \ - linux \ - lvm2 \ - lzop \ - make \ - mdadm \ - mtools \ - nbd \ - NetworkManager \ - nfs-utils \ - ntfs-3g \ - nvme-cli \ - open-iscsi \ - openssh \ - parted \ - pigz \ - plymouth \ - qemu \ - rng-tools \ - sbsigntool \ - shellcheck \ - shfmt \ - squashfs-tools \ - strace \ - systemd-boot-efistub \ - tcpdump \ - tgt \ - tpm2-tools \ - ukify \ - xz \ - && rm -rf /var/cache/xbps diff --git a/test/container/Dockerfile-alpine b/test/container/Dockerfile-alpine deleted file mode 100644 index 4f28c95ee..000000000 --- a/test/container/Dockerfile-alpine +++ /dev/null @@ -1,62 +0,0 @@ -FROM docker.io/alpine:latest - -RUN apk add --no-cache \ - alpine-sdk \ - asciidoc \ - bash \ - binutils \ - blkid \ - btrfs-progs \ - busybox \ - bzip2 \ - cargo \ - coreutils \ - cpio \ - cryptsetup \ - curl \ - dash \ - dhclient \ - dmraid \ - dosfstools \ - e2fsprogs \ - eudev \ - findmnt \ - gawk \ - git \ - gpg \ - grep \ - iputils \ - kbd \ - kmod-dev \ - linux-virt \ - losetup \ - lvm2 \ - make \ - mdadm \ - mtools \ - multipath-tools \ - musl-fts-dev \ - nbd \ - ntfs-3g-progs \ - open-iscsi \ - openssh \ - parted \ - partx \ - pigz \ - procps \ - qemu-img \ - qemu-system-x86_64 \ - rng-tools \ - sed \ - sfdisk \ - squashfs-tools \ - sudo \ - util-linux-misc \ - xz - -RUN \ - cp /usr/lib/udev/rules.d/* /lib/udev/rules.d/ && \ - ln -sf /sbin/poweroff /sbin/shutdown && \ - ln -sf /usr/bin/dash /bin/dash && \ - ln -sf /bin/sh /usr/bin/sh && \ - ln -sf /boot/vmlinuz-virt /boot/vmlinuz-$(cd /lib/modules; ls -1 | tail -1) From a755a0f158fa3740f98c4e92686b733bdd113848 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 7 Aug 2024 16:46:02 +0200 Subject: [PATCH 20/58] ci: add dash dependency to container rhel-only --- test/container/Dockerfile-CentOS-10-Stream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/container/Dockerfile-CentOS-10-Stream b/test/container/Dockerfile-CentOS-10-Stream index 1beb9b581..55c9d2121 100644 --- a/test/container/Dockerfile-CentOS-10-Stream +++ b/test/container/Dockerfile-CentOS-10-Stream @@ -9,8 +9,8 @@ RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' # Install needed packages for the dracut CI container # FIXME: properly re-add dash once C10S EPEL is available -# http://mirrors.kernel.org/fedora/releases/34/Everything/x86_64/os/Packages/d/dash-0.5.10.2-8.fc34.x86_64.rpm \ RUN dnf -y install --skip-broken --enablerepo crb --setopt=install_weak_deps=False \ + https://kojipkgs.fedoraproject.org//packages/dash/0.5.12/4.eln141/x86_64/dash-0.5.12-4.eln141.x86_64.rpm \ qemu-kvm \ NetworkManager \ asciidoc \ From c622312709758b95c932d0626caea60959f4087c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 22 Jul 2024 19:40:07 +0200 Subject: [PATCH 21/58] build: do not include test/* changes for source-git --- .packit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.packit.yml b/.packit.yml index 1128bf86f..143ef2603 100644 --- a/.packit.yml +++ b/.packit.yml @@ -9,6 +9,7 @@ patch_generation_ignore_paths: - .distro/ - .packit.yml - .github/ +- test/ patch_generation_patch_id_digits: 1 sync_changelog: true From 8ee4a915e5138f7e1c0bfd24c581c4b2c4c62cc9 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 7 Aug 2024 17:05:20 +0200 Subject: [PATCH 22/58] ci: remove network-legacy tests --- .github/workflows/integration.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 328487d42..6fd4bbe1d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -62,35 +62,6 @@ jobs: uses: actions/checkout@v4 - name: "${{ matrix.container }} TEST-${{ matrix.test }}" run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} - network-legacy: - name: ${{ matrix.test }} on ${{ matrix.container }} using ${{ matrix.network }} - runs-on: ubuntu-latest - timeout-minutes: 45 - concurrency: - group: network-legacy-${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }} - cancel-in-progress: true - strategy: - matrix: - container: [ - "centos:stream10", - ] - network: [ - "network-legacy", - ] - test: [ - "20", - "30", - "40", - ] - fail-fast: false - container: - image: ghcr.io/redhat-plumbers/${{ matrix.container }} - options: "--privileged -v /dev:/dev" - steps: - - name: "Checkout Repository" - uses: actions/checkout@v4 - - name: "${{ matrix.container }} TEST-${{ matrix.test }}" - run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }} systemd-networkd: name: ${{ matrix.test }} on ${{ matrix.container }} using ${{ matrix.network }} runs-on: ubuntu-latest From b889ebd2dd028cbe2ae8adc7c0cf14414cfcfcdc Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Thu, 25 Jul 2024 15:00:43 -0400 Subject: [PATCH 23/58] test: do not force no-hostonly for all test runs Different distributions and containers might prefer different defaults. The motivation of this work is to increase test coverage and to run the tests in the same configurations as dracut is used. (cherry picked from commit e9be0ecc01d35ab8613b2e104ab624ab8f066fbd) --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index b664fb084..25a3371e3 100644 --- a/test/test-functions +++ b/test/test-functions @@ -20,7 +20,7 @@ DRACUT=${DRACUT-${basedir}/dracut.sh} PKGLIBDIR=${PKGLIBDIR-$basedir} test_dracut() { - TEST_DRACUT_ARGS+=" --local --no-hostonly --no-hostonly-cmdline --no-early-microcode --add test --force --kver $KVERSION" + TEST_DRACUT_ARGS+=" --local --no-early-microcode --add test --force --kver $KVERSION" # include $TESTDIR"/overlay if exists if [ -d "$TESTDIR"/overlay ]; then From d0a9bf2b6c7459cf0a87d7e8d6d9c46cbc7d6914 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Thu, 25 Jul 2024 15:46:16 -0400 Subject: [PATCH 24/58] test: grab the distro configuration from the host and make it available Fix failing test cases by enforcing no-hostonly for those tests cases that need it. (cherry picked from commit 51f392a4624bc1cb172a03e4cc28ff0a5cae02a8) --- test/TEST-16-DMSQUASH/test.sh | 8 ++++++-- test/TEST-20-NFS/test.sh | 1 + test/TEST-30-ISCSI/test.sh | 1 + test/TEST-35-ISCSI-MULTI/test.sh | 1 + test/TEST-40-NBD/test.sh | 1 + test/TEST-50-MULTINIC/test.sh | 1 + test/TEST-60-BONDBRIDGEVLAN/test.sh | 1 + test/test-functions | 11 ++++++++++- 8 files changed, 22 insertions(+), 3 deletions(-) diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index 6087ccd20..51559ce62 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -128,14 +128,18 @@ SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs3" EOF test_dracut \ - --modules "dash dmsquash-live qemu" \ + --no-hostonly \ + --add "dmsquash-live qemu" \ + --omit "systemd" \ --drivers "ntfs3" \ --install "mkfs.ext4" \ --include /tmp/ntfs3.rules /lib/udev/rules.d/ntfs3.rules \ "$TESTDIR"/initramfs.testing test_dracut \ - --modules "dmsquash-live-autooverlay qemu" \ + --no-hostonly \ + --add "dmsquash-live-autooverlay qemu" \ + --omit "systemd" \ --install "mkfs.ext4" \ "$TESTDIR"/initramfs.testing-autooverlay diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh index 1be5a7361..7f00b7588 100755 --- a/test/TEST-20-NFS/test.sh +++ b/test/TEST-20-NFS/test.sh @@ -402,6 +402,7 @@ test_setup() { # Make client's dracut image test_dracut \ + --no-hostonly --no-hostonly-cmdline \ -a "dmsquash-live ${USE_NETWORK}" \ "$TESTDIR"/initramfs.testing diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index f4bf33ebb..90f55cd02 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -222,6 +222,7 @@ test_setup() { # Make client's dracut image test_dracut \ + --no-hostonly --no-hostonly-cmdline \ --add "$USE_NETWORK" \ --include "./client.link" "/etc/systemd/network/01-client.link" \ --kernel-cmdline "rw rd.auto rd.retry=50" \ diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh index f80779830..c25bdeeaa 100755 --- a/test/TEST-35-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -227,6 +227,7 @@ test_setup() { # Make client's dracut image test_dracut \ + --no-hostonly --no-hostonly-cmdline \ --add "$USE_NETWORK" \ -i "./client.link" "/etc/systemd/network/01-client.link" \ "$TESTDIR"/initramfs.testing diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh index e935f5345..1613f6033 100755 --- a/test/TEST-40-NBD/test.sh +++ b/test/TEST-40-NBD/test.sh @@ -332,6 +332,7 @@ test_setup() { echo -n test > /tmp/key test_dracut \ + --no-hostonly --no-hostonly-cmdline \ -a "${USE_NETWORK}" \ -i "./cryptroot-ask.sh" "/sbin/cryptroot-ask" \ -i "./client.link" "/etc/systemd/network/01-client.link" \ diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh index e2aa5a304..6ea7b52f8 100755 --- a/test/TEST-50-MULTINIC/test.sh +++ b/test/TEST-50-MULTINIC/test.sh @@ -341,6 +341,7 @@ test_setup() { ) # Make client's dracut image test_dracut \ + --no-hostonly --no-hostonly-cmdline \ -a "${USE_NETWORK}" \ "$TESTDIR"/initramfs.testing diff --git a/test/TEST-60-BONDBRIDGEVLAN/test.sh b/test/TEST-60-BONDBRIDGEVLAN/test.sh index be4cb6d98..331d9e407 100755 --- a/test/TEST-60-BONDBRIDGEVLAN/test.sh +++ b/test/TEST-60-BONDBRIDGEVLAN/test.sh @@ -367,6 +367,7 @@ test_setup() { ) # Make client's dracut image test_dracut \ + --no-hostonly --no-hostonly-cmdline \ -a "debug ${USE_NETWORK} ifcfg" \ "$TESTDIR"/initramfs.testing diff --git a/test/test-functions b/test/test-functions index 25a3371e3..b62509b86 100644 --- a/test/test-functions +++ b/test/test-functions @@ -20,7 +20,16 @@ DRACUT=${DRACUT-${basedir}/dracut.sh} PKGLIBDIR=${PKGLIBDIR-$basedir} test_dracut() { - TEST_DRACUT_ARGS+=" --local --no-early-microcode --add test --force --kver $KVERSION" + # directory for test configurations + mkdir -p /tmp/dracut.conf.d + + # grab the distro configuration from the host and make it available for the tests + if [ -d /usr/lib/dracut/dracut.conf.d ]; then + cp -a /usr/lib/dracut/dracut.conf.d /tmp/ + fi + + # pick up configuration from /tmp/dracut.conf.d when running the tests + TEST_DRACUT_ARGS+=" --local --confdir /tmp/dracut.conf.d --no-early-microcode --add test --force --kver $KVERSION" # include $TESTDIR"/overlay if exists if [ -d "$TESTDIR"/overlay ]; then From aded658821983ba7d92def26793813c1b3a83475 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Sat, 20 Jul 2024 18:49:38 -0400 Subject: [PATCH 25/58] test: do not force include dash, let sh module make a selection This is important for alpine, so that it does not install both dash and busybox dracut modules that are potentially conflicting. (cherry picked from commit 6e3c2bf9d01ad0f93176ee121bb70404f24de4e7) --- modules.d/80test-makeroot/module-setup.sh | 2 +- test/TEST-30-ISCSI/test.sh | 2 +- test/TEST-35-ISCSI-MULTI/test.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules.d/80test-makeroot/module-setup.sh b/modules.d/80test-makeroot/module-setup.sh index f311e4a06..fc105d7ee 100755 --- a/modules.d/80test-makeroot/module-setup.sh +++ b/modules.d/80test-makeroot/module-setup.sh @@ -6,7 +6,7 @@ check() { } depends() { - echo "dash rootfs-block kernel-modules qemu" + echo "rootfs-block kernel-modules qemu" } installkernel() { diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh index 90f55cd02..e342d09c4 100755 --- a/test/TEST-30-ISCSI/test.sh +++ b/test/TEST-30-ISCSI/test.sh @@ -213,7 +213,7 @@ test_setup() { # Make server's dracut image "$DRACUT" -l \ - -a "dash rootfs-block test kernel-modules network-legacy" \ + -a "rootfs-block test kernel-modules ${USE_NETWORK}" \ -d "piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg virtio_pci virtio_scsi" \ -i "./server.link" "/etc/systemd/network/01-server.link" \ -i ./wait-if-server.sh /lib/dracut/hooks/pre-mount/99-wait-if-server.sh \ diff --git a/test/TEST-35-ISCSI-MULTI/test.sh b/test/TEST-35-ISCSI-MULTI/test.sh index c25bdeeaa..f2f856141 100755 --- a/test/TEST-35-ISCSI-MULTI/test.sh +++ b/test/TEST-35-ISCSI-MULTI/test.sh @@ -234,7 +234,7 @@ test_setup() { # Make server's dracut image "$DRACUT" -l -i "$TESTDIR"/overlay / \ - -a "test dash rootfs-block debug kernel-modules network-legacy" \ + -a "test rootfs-block debug kernel-modules ${USE_NETWORK}" \ -d "af_packet piix ide-gd_mod ata_piix ext4 sd_mod e1000 drbg" \ -i "./server.link" "/etc/systemd/network/01-server.link" \ -i "./wait-if-server.sh" "/lib/dracut/hooks/pre-mount/99-wait-if-server.sh" \ From bae6cb94a2c58e5a42df77be83eb9abba95d4ed8 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 02:15:17 +0200 Subject: [PATCH 26/58] ci: remove dracut native config that is not compatible with upstream ci Authored-by: Laszlo Gombos --- test/container/Dockerfile-CentOS-10-Stream | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/container/Dockerfile-CentOS-10-Stream b/test/container/Dockerfile-CentOS-10-Stream index 55c9d2121..417ccef6d 100644 --- a/test/container/Dockerfile-CentOS-10-Stream +++ b/test/container/Dockerfile-CentOS-10-Stream @@ -121,3 +121,9 @@ RUN dnf -y install --skip-broken --setopt=install_weak_deps=False \ wget \ xz \ && dnf -y remove dracut --noautoremove && dnf -y update && dnf clean all + +# discard configurations that enforce an out-of-tree dracut module +# which would break test automation +# since this is a distro specific change, lets do it in the container +RUN \ + rm -rf /usr/lib/dracut/dracut.conf.d/50-nss-softokn.conf From 45a1020de920c1b597148ec6dfa76862448a134c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 02:26:20 +0200 Subject: [PATCH 27/58] ci: add btrfs-progs to container file as tests are failing without it (and someone might actually use it). https://koji.fedoraproject.org/koji/packageinfo?packageID=6398 --- test/container/Dockerfile-CentOS-10-Stream | 1 + 1 file changed, 1 insertion(+) diff --git a/test/container/Dockerfile-CentOS-10-Stream b/test/container/Dockerfile-CentOS-10-Stream index 417ccef6d..237dfce64 100644 --- a/test/container/Dockerfile-CentOS-10-Stream +++ b/test/container/Dockerfile-CentOS-10-Stream @@ -11,6 +11,7 @@ RUN echo 'export DRACUT_NO_XATTR=1 KVERSION=$(cd /lib/modules; ls -1 | tail -1)' # FIXME: properly re-add dash once C10S EPEL is available RUN dnf -y install --skip-broken --enablerepo crb --setopt=install_weak_deps=False \ https://kojipkgs.fedoraproject.org//packages/dash/0.5.12/4.eln141/x86_64/dash-0.5.12-4.eln141.x86_64.rpm \ + https://kojipkgs.fedoraproject.org//packages/btrfs-progs/6.9.2/1.eln141/x86_64/btrfs-progs-6.9.2-1.eln141.x86_64.rpm \ qemu-kvm \ NetworkManager \ asciidoc \ From a891ae527aaf3c015d3b4b0290655b89fdf8f03d Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 01:30:50 +0200 Subject: [PATCH 28/58] fix(dracut-functions): allow for \ in get_maj_min file path as the path might be f.e. /dev/disk/by-partlabel/EFI\x20System\x20Partition which would produce Warning 'grep: warning: stray \ before x' in get_maj_min Resolves: RHEL-47145 --- dracut-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index f9e5d3bc6..c8cb2e151 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -243,7 +243,7 @@ get_maj_min() { local _out if [[ $get_maj_min_cache_file ]]; then - _out="$(grep -m1 -oE "^$1 \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')" + _out="$(grep -m1 -oE "^${1//\\/\\\\} \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')" fi if ! [[ "$_out" ]]; then From 821ffb39cd0c3003b2711d30302b713ab9b5da9b Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Mon, 5 Aug 2024 11:28:32 +0200 Subject: [PATCH 29/58] fix(dracut-functions.sh): only return block devices from get_persistent_dev With udev 256, there are now directories such as /dev/disk/by-path/pci-0000:02:00.0-nvme-1-part/ which match here. In case a nonexisting file/device was passed to get_persistent_dev, it returned the first directory it looked at because both have maj:min 0:0. This accidental conversion from garbage to a sensible looking path leads to weird behaviour later. Instead of filtering out directories explicitly switch the check to only return block devices, which also takes care of the character special /dev/mapper/control. (cherry picked from commit 55d2fb5b459f356fdbde60ddefb97be942a0c141) Resolves: RHEL-49744 --- dracut-functions.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index c8cb2e151..43d905e38 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -294,8 +294,7 @@ get_persistent_dev() { /dev/disk/by-partlabel/* \ /dev/disk/by-id/* \ /dev/disk/by-path/*; do - [[ -e $i ]] || continue - [[ $i == /dev/mapper/control ]] && continue + [[ -b $i ]] || continue [[ $i == /dev/mapper/mpath* ]] && continue _tmp=$(get_maj_min "$i") if [ "$_tmp" = "$_dev" ]; then From 3e4a22f2b72d0723fd43ca917b8aa9003c6c7f8f Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 12 Jun 2024 06:06:32 +0200 Subject: [PATCH 30/58] feat(systemd*): include systemd config files from /usr/lib/systemd and also use proper variables for the paths, and fixup invalid paths. -- The new systemd reads from both /etc and /usr/, so to accomodate this, I've added new paths to install configs from (I probably haven't covered all). This changes only hostonly behaviour; uses global variables: systemdutilconfdir: "/etc/systemd" systemdutildir: "/lib/systemd:/lib/systemd/systemd-udevd" "/usr/lib/systemd:/usr/lib/systemd/systemd-udevd" (cherry picked from commit ea4905e944a2acd75ba3a48a5dfeaba417f724e8) Resolves: RHEL-32506 --- modules.d/00systemd/module-setup.sh | 6 ++++-- modules.d/01systemd-coredump/module-setup.sh | 3 ++- modules.d/01systemd-pstore/module-setup.sh | 2 ++ modules.d/01systemd-resolved/module-setup.sh | 1 + modules.d/01systemd-timesyncd/module-setup.sh | 1 + 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index d173c99ff..0f151289d 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -42,6 +42,8 @@ install() { "$systemdutildir"/system-generators/systemd-debug-generator \ "$systemdutildir"/system-generators/systemd-fstab-generator \ "$systemdutildir"/system-generators/systemd-gpt-auto-generator \ + "$systemdutildir"/system.conf \ + "$systemdutildir"/system.conf.d/*.conf \ "$systemdsystemunitdir"/debug-shell.service \ "$systemdsystemunitdir"/cryptsetup.target \ "$systemdsystemunitdir"/cryptsetup-pre.target \ @@ -94,8 +96,8 @@ install() { if [[ $hostonly ]]; then inst_multiple -H -o \ - /etc/systemd/system.conf \ - /etc/systemd/system.conf.d/*.conf \ + "$systemdutilconfdir"/system.conf \ + "$systemdutilconfdir"/system.conf.d/*.conf \ /etc/hosts \ /etc/hostname \ /etc/nsswitch.conf \ diff --git a/modules.d/01systemd-coredump/module-setup.sh b/modules.d/01systemd-coredump/module-setup.sh index 47666b6ca..17deb088a 100755 --- a/modules.d/01systemd-coredump/module-setup.sh +++ b/modules.d/01systemd-coredump/module-setup.sh @@ -33,6 +33,7 @@ install() { inst_multiple -o \ "$sysctld"/50-coredump.conf \ "$systemdutildir"/coredump.conf \ + "$systemdutildir/coredump.conf.d/*.conf" \ "$systemdutildir"/systemd-coredump \ "$systemdsystemunitdir"/systemd-coredump.socket \ "$systemdsystemunitdir"/systemd-coredump@.service \ @@ -51,7 +52,7 @@ install() { if [[ $hostonly ]]; then inst_multiple -H -o \ "$systemdutilconfdir"/coredump.conf \ - "$systemdsystemconfdir/coredump.conf.d/*.conf" \ + "$systemdutilconfdir/coredump.conf.d/*.conf" \ "$systemdsystemconfdir"/systemd-coredump.socket \ "$systemdsystemconfdir/systemd-coredump.socket.d/*.conf" \ "$systemdsystemconfdir"/systemd-coredump@.service \ diff --git a/modules.d/01systemd-pstore/module-setup.sh b/modules.d/01systemd-pstore/module-setup.sh index 67034bbfa..5de5db4b6 100755 --- a/modules.d/01systemd-pstore/module-setup.sh +++ b/modules.d/01systemd-pstore/module-setup.sh @@ -34,6 +34,8 @@ install() { inst_dir /var/lib/systemd/pstore inst_multiple -o \ "$tmpfilesdir/systemd-pstore.conf" \ + "$systemdutildir"/pstore.conf \ + "$systemdutildir/pstore.conf.d/*.conf" \ "$systemdutildir"/systemd-pstore \ "$systemdsystemunitdir"/systemd-pstore.service \ "$systemdsystemunitdir/systemd-pstore.service.d/*.conf" diff --git a/modules.d/01systemd-resolved/module-setup.sh b/modules.d/01systemd-resolved/module-setup.sh index 0c2e8c282..7b4b26e81 100755 --- a/modules.d/01systemd-resolved/module-setup.sh +++ b/modules.d/01systemd-resolved/module-setup.sh @@ -49,6 +49,7 @@ install() { # Install the hosts local user configurations if enabled. if [[ $hostonly ]]; then inst_multiple -H -o \ + "$systemdutilconfdir"/resolv.conf \ "$systemdutilconfdir"/resolved.conf \ "$systemdutilconfdir/resolved.conf.d/*.conf" \ "$systemdsystemconfdir"/systemd-resolved.service \ diff --git a/modules.d/01systemd-timesyncd/module-setup.sh b/modules.d/01systemd-timesyncd/module-setup.sh index a2c675408..77f7b1139 100755 --- a/modules.d/01systemd-timesyncd/module-setup.sh +++ b/modules.d/01systemd-timesyncd/module-setup.sh @@ -38,6 +38,7 @@ install() { "$systemdntpunits/*.list" \ "$systemdutildir"/systemd-timesyncd \ "$systemdutildir"/systemd-time-wait-sync \ + "$systemdutildir"/timesyncd.conf \ "$systemdutildir/timesyncd.conf.d/*.conf" \ "$systemdsystemunitdir"/systemd-timesyncd.service \ "$systemdsystemunitdir/systemd-timesyncd.service.d/*.conf" \ From 53d78f4eb236500465279c424c296ff576421c7c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 00:21:12 +0200 Subject: [PATCH 31/58] fix(resume): always include the resume module as we can't determine with certainity that it won't be needed. rhel-only Resolves: RHEL-53350 --- modules.d/95resume/module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh index d419566e2..c0f04a6c1 100755 --- a/modules.d/95resume/module-setup.sh +++ b/modules.d/95resume/module-setup.sh @@ -1,7 +1,12 @@ #!/bin/bash # called by dracut +# shellcheck disable=SC2317 check() { + + # Always include resume module + return 0 + swap_on_netdevice() { local _dev for _dev in "${swap_devs[@]}"; do From b8b7e0245bb3c645b45d4a31847ed227a8431ec8 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 22 Jul 2024 16:46:47 +0200 Subject: [PATCH 32/58] feat(dracut-init.sh): allow changing the destination directory for inst et al When using 99squash dracut actually builds two separate initrds. The "normal" one, that gets squashed into a squashfs image, and a "minimalistic" one, whose only task is to mount and switch_root to the squashfs image. This is currently done the following way: 1. Skipp install() for 99squash during the "normal" installation phase. 2. Trigger a special postinstall hook in 99squash that moves the content of $initdir to $squashdir and installs the "minimalistic" initrd to $initdir. 3. Strip the binaries in $initdir (of which $squashdir is a sub directory of). 4. Squash the content of $squashdir into the squashfs image and remove $squashdir. The problem with this approach is that the steps 2 and 4 specific to 99squash but need to be done in dracut.sh. Thus a lot of special handling for 99squash is needed in dracut.sh. This will get even more complex once support for different filesystem images, e.g. erofs, are implemented. In order to be able to move most of the functionality into 99squash itself a new approach will be chosen, i.e. 1. During the installation phase install the "normal" initrd into $initdir and the "minimalistic" initrd into $squashdir. 2. Strip the binaries in $initdir. 3. Trigger a special postinstall hook in 99squash that squashes the content of $initdir (excluding $squashdir) into the squashfs image, removes the content of $intidir (excluding $suqashdir) and, moves the content of $squashdir into $initdir. With that the only special handling remaining in dracut.sh is triggering the postinstall hook. However, in inst et al. the destination directory is hard coded to $initdir. Thus allow setting a different destination directory in inst et al. to get the new approach to work. For the time being only do that for the functions required by 99squash. Signed-off-by: Philipp Rudo (cherry picked from commit 5ab4470cf136c2d9983564b84b49fd700d4b8514) Related: RHEL-43460 --- dracut-init.sh | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 863df0cbe..58e657b5d 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -240,34 +240,36 @@ inst_dir() { } inst() { + local dstdir="${dstdir:-"$initdir"}" local _ret _hostonly_install if [[ $1 == "-H" ]]; then _hostonly_install="-H" shift fi - [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there - if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then + [[ -e ${dstdir}/"${2:-$1}" ]] && return 0 # already there + if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then return 0 else _ret=$? - derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" return $_ret fi } inst_simple() { + local dstdir="${dstdir:-"$initdir"}" local _ret _hostonly_install if [[ $1 == "-H" ]]; then _hostonly_install="-H" shift fi - [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there - [[ -e $1 ]] || return 1 # no source - if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then + [[ -e ${dstdir}/"${2:-$1}" ]] && return 0 # already there + [[ -e $1 ]] || return 1 # no source + if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then return 0 else _ret=$? - derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" return $_ret fi } @@ -290,16 +292,17 @@ inst_symlink() { } inst_multiple() { + local dstdir="${dstdir:-"$initdir"}" local _ret _hostonly_install if [[ $1 == "-H" ]]; then _hostonly_install="-H" shift fi - if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then + if $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then return 0 else _ret=$? - derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" + derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${dstdir:+-D "$dstdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" return $_ret fi } @@ -566,6 +569,8 @@ inst_rules_wildcard() { # make sure that library links are correct and up to date build_ld_cache() { + local dstdir="${dstdir:-"$initdir"}" + for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do [[ -f $f ]] && inst_simple "${f#"$dracutsysrootdir"}" done @@ -1047,13 +1052,15 @@ for_each_module_dir() { } dracut_kernel_post() { + local dstdir="${dstdir:-"$initdir"}" + for _f in modules.builtin modules.builtin.alias modules.builtin.modinfo modules.order; do [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" done # generate module dependencies for the initrd - if [[ -d $initdir/lib/modules/$kernel ]] \ - && ! depmod -a -b "$initdir" "$kernel"; then + if [[ -d $dstdir/lib/modules/$kernel ]] \ + && ! depmod -a -b "$dstdir" "$kernel"; then dfatal "\"depmod -a $kernel\" failed." exit 1 fi @@ -1067,6 +1074,7 @@ instmods() { # can be e.g. "=block" or "=drivers/usb/storage" # -c check # -s silent + local dstdir="${dstdir:-"$initdir"}" local _optional="-o" local _silent local _ret @@ -1092,7 +1100,7 @@ instmods() { fi $DRACUT_INSTALL \ - ${initdir:+-D "$initdir"} \ + ${dstdir:+-D "$dstdir"} \ ${dracutsysrootdir:+-r "$dracutsysrootdir"} \ ${loginstall:+-L "$loginstall"} \ ${hostonly:+-H} \ @@ -1106,7 +1114,7 @@ instmods() { if ((_ret != 0)) && [[ -z $_silent ]]; then derror "FAILED: " \ "$DRACUT_INSTALL" \ - ${initdir:+-D "$initdir"} \ + ${dstdir:+-D "$dstdir"} \ ${dracutsysrootdir:+-r "$dracutsysrootdir"} \ ${loginstall:+-L "$loginstall"} \ ${hostonly:+-H} \ @@ -1123,14 +1131,16 @@ instmods() { if [[ "$(ln --help)" == *--relative* ]]; then ln_r() { - ln -sfnr "${initdir}/$1" "${initdir}/$2" + local dstdir="${dstdir:-"$initdir"}" + ln -sfnr "${dstdir}/$1" "${dstdir}/$2" } else ln_r() { + local dstdir="${dstdir:-"$initdir"}" local _source=$1 local _dest=$2 [[ -d ${_dest%/*} ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} - ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" + ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${dstdir}/${_dest}" } fi From c81d6422d71b02ed9158a67c00fa0a5eec232f37 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Thu, 25 Jul 2024 12:47:00 +0200 Subject: [PATCH 33/58] fix(dracut-init.sh): add module to mods_to_load before checking dependencies When implementing erofs support for 99squash we end up with three modules 99squash, 95squash-squashfs and 95squash-erofs. Where 99squash contains the common code for filesystem images and 95squash-{squashfs,erofs} the special handing depending on the filesystem used. This leads to a dependency cycle as we want to allow users both to choose 99squash, when the exact filesystem doesn't matter, as well as 95squash-{squashfs,erofs} when a specific filesystem is required. But when 99squash is added as a dependency calling dracut_module_included fails in its depends() function. This lead to cases where both handlers, 95squash-squashfs and 95squash-erofs, were added to the initrd. Reason for the failure is that a module only is marked to be loaded after all it's dependencies have been checked as well. Thus a child module cannot detect which parent module wants it to be included. Fix this by marking modules to be loaded before checking its dependencies in check_module. Do the same change in check_mount for consistency. Signed-off-by: Philipp Rudo (cherry picked from commit 634b4a5c6fbe595eb240cd529d669d21eadd510c) Related: RHEL-43460 --- dracut-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 58e657b5d..840c6167b 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -915,6 +915,9 @@ check_mount() { fi fi + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + for _moddep in $(module_depends "$_mod" "$_moddir"); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ @@ -933,9 +936,6 @@ check_mount() { fi done - [[ " $mods_to_load " == *\ $_mod\ * ]] \ - || mods_to_load+=" $_mod " - return 0 } @@ -990,6 +990,9 @@ check_module() { fi fi + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + for _moddep in $(module_depends "$_mod" "$_moddir"); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ @@ -1008,9 +1011,6 @@ check_module() { fi done - [[ " $mods_to_load " == *\ $_mod\ * ]] \ - || mods_to_load+=" $_mod " - return 0 } From bbb64f449a4f3cd76ea63d73ebc1043a3dd14118 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 22 Jul 2024 16:30:50 +0200 Subject: [PATCH 34/58] feat(squash): move mksquashfs to 99squash/modules-setup When using 99squash dracut actually builds two separat initrds. The "normal" one, that gets squashed into a squashfs image, and a "minimalistic" one, whose only task is to mount and switch_root to the squashfs image. For that 99squash currently requires a lot of special handling in dracut.sh. Move most of this special handling into 99squash itself. This requires a new approach when building the "minimalistic" initrd. The new approach works the following way 1. During the installation phase install the "normal" initrd into $initdir and the "minimalistic" initrd into $squashdir. 2. Strip the binaries in $initdir. 3. Trigger a special postinstall hook in 99squash that squashes the content of $initdir (excluding $squashdir) into the squashfs image, removes the content of $intidir (excluding $suqashdir) and, moves the content of $squashdir into $initdir. Signed-off-by: Philipp Rudo (cherry picked from commit 7a4dd89ca732329893628b886fe8e78337d896e8) Related: RHEL-43460 --- dracut.sh | 35 ++++-------------- modules.d/99squash/module-setup.sh | 58 +++++++++++++++++++++--------- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/dracut.sh b/dracut.sh index cc6d6f280..68bdf33b0 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1277,6 +1277,7 @@ trap ' trap 'exit 1;' SIGINT readonly initdir="${DRACUT_TMPDIR}/initramfs" +readonly squashdir="$initdir/squash_root" mkdir -p "$initdir" if [[ $early_microcode == yes ]] || { [[ $acpi_override == yes ]] && [[ -d $acpi_table_dir ]]; }; then @@ -1804,7 +1805,8 @@ export initdir dracutbasedir \ host_fs_types host_devs swap_devs sshkey add_fstab \ DRACUT_VERSION \ prefix filesystems drivers \ - hostonly_cmdline loginstall + hostonly_cmdline loginstall \ + squashdir squash_compress mods_to_load="" # check all our modules to see if they should be sourced. @@ -1909,6 +1911,8 @@ if [[ $kernel_only != yes ]]; then fi fi +dracut_module_included "squash" && mkdir -p "$squashdir" + _isize=0 #initramfs size modules_loaded=" " # source our modules. @@ -2255,14 +2259,6 @@ if [[ $kernel_only != yes ]]; then build_ld_cache fi -if dracut_module_included "squash"; then - readonly squash_dir="$initdir/squash/root" - readonly squash_img="$initdir/squash-root.img" - mkdir -p "$squash_dir" - dinfo "*** Install squash loader ***" - DRACUT_SQUASH_POST_INST=1 module_install "squash" -fi - if [[ $do_strip == yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then # stripping files negates (dedup) benefits of using reflink [[ -n $enhanced_cpio ]] && ddebug "strip is enabled alongside cpio reflink" @@ -2282,25 +2278,8 @@ fi if dracut_module_included "squash"; then dinfo "*** Squashing the files inside the initramfs ***" - declare squash_compress_arg - # shellcheck disable=SC2086 - if [[ $squash_compress ]]; then - if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $squash_compress &> /dev/null; then - dwarn "mksquashfs doesn't support compressor '$squash_compress', failing back to default compressor." - else - squash_compress_arg="$squash_compress" - fi - fi - - # shellcheck disable=SC2086 - if ! mksquashfs "$squash_dir" "$squash_img" \ - -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ - -no-progress ${squash_compress_arg:+-comp $squash_compress_arg} 1> /dev/null; then - dfatal "Failed making squash image" - exit 1 - fi - - rm -rf "$squash_dir" + DRACUT_SQUASH_POST_INST=1 module_install "squash" + rm -rf "$squashdir" dinfo "*** Squashing the files inside the initramfs done ***" # Skip initramfs compress diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index dc2e0a205..96d097aff 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -12,26 +12,13 @@ depends() { return 0 } -installpost() { +squash_install() { local _busybox _busybox=$(find_binary busybox) - # Move everything under $initdir except $squash_dir - # itself into squash image - for i in "$initdir"/*; do - [[ $squash_dir == "$i"/* ]] || mv "$i" "$squash_dir"/ - done - # Create mount points for squash loader mkdir -p "$initdir"/squash/ - mkdir -p "$squash_dir"/squash/ - - # Copy dracut spec files out side of the squash image - # so dracut rebuild and lsinitrd can work - for file in "$squash_dir"/usr/lib/dracut/*; do - [[ -f $file ]] || continue - DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#"$squash_dir"}" - done + mkdir -p "$squashdir"/squash/ # Install required modules and binaries for the squash image init script. if [[ $_busybox ]]; then @@ -61,8 +48,47 @@ installpost() { build_ld_cache } +squash_installpost() { + local _img="$squashdir"/squash-root.img + local _comp _file + + # shellcheck disable=SC2086 + if [[ $squash_compress ]]; then + if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $squash_compress &> /dev/null; then + dwarn "mksquashfs doesn't support compressor '$squash_compress', failing back to default compressor." + else + _comp="$squash_compress" + fi + fi + + # shellcheck disable=SC2086 + if ! mksquashfs "$initdir" "$_img" \ + -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ + -no-progress ${_comp:+-comp $_comp} \ + -e "$squashdir" 1> /dev/null; then + dfatal "Failed making squash image" + exit 1 + fi + + # Rescue the dracut spec files so dracut rebuild and lsinitrd can work + for _file in "$initdir"/usr/lib/dracut/*; do + [[ -f $_file ]] || continue + DRACUT_RESOLVE_DEPS=1 dstdir=$squashdir inst "$_file" "${_file#"$initdir"}" + done + + # Remove everything that got squashed into the image + for _file in "$initdir"/*; do + [[ $_file == "$squashdir" ]] && continue + rm -rf "$_file" + done + mv "$squashdir"/* "$initdir" +} + install() { + if [[ $DRACUT_SQUASH_POST_INST ]]; then - installpost + squash_installpost + else + dstdir="$squashdir" squash_install fi } From 1ef53f9d5ea7f74730b27b8016304c58b2d31871 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 23 Jul 2024 16:39:13 +0200 Subject: [PATCH 35/58] feat(squash): split 95squash-squashfs from 99squash 99squash only allows squashing the files using squashfs. In order to make the implementation for different filesystems easier split out the squashfs specific parts into 95squash-squashfs. While at it rename the root image contained in the initrd to squashfs-root.img. This allows tools like lsinitrd to detect the filesystem used later on. Signed-off-by: Philipp Rudo (cherry picked from commit f281606f110be1549cd6b1cd34828653879a5f50) Related: RHEL-43460 --- modules.d/95squash-squashfs/module-setup.sh | 48 ++++++++++++++++++ modules.d/99squash/init-squash.sh | 2 +- modules.d/99squash/module-setup.sh | 54 ++++++++++++--------- 3 files changed, 80 insertions(+), 24 deletions(-) create mode 100755 modules.d/95squash-squashfs/module-setup.sh diff --git a/modules.d/95squash-squashfs/module-setup.sh b/modules.d/95squash-squashfs/module-setup.sh new file mode 100755 index 000000000..839737001 --- /dev/null +++ b/modules.d/95squash-squashfs/module-setup.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +check() { + require_binaries mksquashfs unsquashfs || return 1 + require_kernel_modules squashfs || return 1 + + return 255 +} + +depends() { + echo "squash" + return 0 +} + +squashfs_install() { + hostonly="" instmods "squashfs" +} + +squashfs_installpost() { + local _img="$squashdir/squashfs-root.img" + local _comp + + # shellcheck disable=SC2086 + if [[ $squash_compress ]]; then + if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $squash_compress &> /dev/null; then + dwarn "mksquashfs doesn't support compressor '$squash_compress', failing back to default compressor." + else + _comp="$squash_compress" + fi + fi + + # shellcheck disable=SC2086 + if ! mksquashfs "$initdir" "$_img" \ + -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ + -no-progress ${_comp:+-comp $_comp} \ + -e "$squashdir" 1> /dev/null; then + dfatal "Failed making squash image" + exit 1 + fi +} + +install() { + if [[ $DRACUT_SQUASH_POST_INST ]]; then + squashfs_installpost + else + dstdir="$squashdir" squashfs_install + fi +} diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh index 59769f621..42a9a86fe 100755 --- a/modules.d/99squash/init-squash.sh +++ b/modules.d/99squash/init-squash.sh @@ -21,7 +21,7 @@ modprobe overlay # Mount the squash image mount -t ramfs ramfs /squash mkdir -p /squash/root /squash/overlay/upper /squash/overlay/work -mount -t squashfs -o ro,loop /squash-root.img /squash/root +mount -t squashfs -o ro,loop /squashfs-root.img /squash/root # Setup new root overlay mkdir /newroot diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 96d097aff..015944c2c 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -1,17 +1,42 @@ #!/bin/bash check() { - require_binaries mksquashfs unsquashfs || return 1 - require_kernel_modules squashfs loop overlay || return 1 + require_kernel_modules loop overlay || return 1 return 255 } depends() { - echo "systemd-initrd" + local _handler + + _handler=$(squash_get_handler) || return 1 + + echo "systemd-initrd $_handler" return 0 } +squash_get_handler() { + local _module _handler + + for _module in squash-squashfs; do + if dracut_module_included "$_module"; then + _handler="$_module" + break + fi + done + + if [ -z "$_handler" ]; then + if check_module "squash-squashfs"; then + _handler="squash-squashfs" + else + dfatal "No valid handler for found" + return 1 + fi + fi + + echo "$_handler" +} + squash_install() { local _busybox _busybox=$(find_binary busybox) @@ -36,7 +61,7 @@ squash_install() { [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*" fi - hostonly="" instmods "loop" "squashfs" "overlay" + hostonly="" instmods "loop" "overlay" dracut_kernel_post # Install squash image init script. @@ -49,26 +74,9 @@ squash_install() { } squash_installpost() { - local _img="$squashdir"/squash-root.img - local _comp _file - - # shellcheck disable=SC2086 - if [[ $squash_compress ]]; then - if ! mksquashfs /dev/null "$DRACUT_TMPDIR"/.squash-test.img -no-progress -comp $squash_compress &> /dev/null; then - dwarn "mksquashfs doesn't support compressor '$squash_compress', failing back to default compressor." - else - _comp="$squash_compress" - fi - fi + local _file - # shellcheck disable=SC2086 - if ! mksquashfs "$initdir" "$_img" \ - -no-xattrs -no-exports -noappend -no-recovery -always-use-fragments \ - -no-progress ${_comp:+-comp $_comp} \ - -e "$squashdir" 1> /dev/null; then - dfatal "Failed making squash image" - exit 1 - fi + DRACUT_SQUASH_POST_INST=1 module_install "$(squash_get_handler)" # Rescue the dracut spec files so dracut rebuild and lsinitrd can work for _file in "$initdir"/usr/lib/dracut/*; do From 4e8ea763cb10ab4f3b65e865d2ad03c8a5393e04 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 23 Jul 2024 17:42:33 +0200 Subject: [PATCH 36/58] feat(squash): add module 95squash-erofs Allow squashing the image in 99squash using erofs. Keep squashfs as default to not change existing systems. I.e. only use erofs if the user explicitly include 95squash-erofs or when the prereqs for squashfs are missing. Signed-off-by: Philipp Rudo (cherry picked from commit e185d6ae1cc38af90f741d3d6c677458d69a345f) Resolves: RHEL-43460 --- modules.d/95squash-erofs/module-setup.sh | 45 ++++++++++++++++++++++++ modules.d/99squash/init-squash.sh | 12 +++++-- modules.d/99squash/module-setup.sh | 4 ++- 3 files changed, 58 insertions(+), 3 deletions(-) create mode 100755 modules.d/95squash-erofs/module-setup.sh diff --git a/modules.d/95squash-erofs/module-setup.sh b/modules.d/95squash-erofs/module-setup.sh new file mode 100755 index 000000000..71c2b672b --- /dev/null +++ b/modules.d/95squash-erofs/module-setup.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +check() { + require_binaries mkfs.erofs || return 1 + require_kernel_modules erofs || return 1 + + return 255 +} + +depends() { + echo "squash" + return 0 +} + +erofs_install() { + hostonly="" instmods "erofs" +} + +erofs_installpost() { + local _img="$squashdir/erofs-root.img" + local -a _erofs_args + + _erofs_args+=("--exclude-path=$squashdir") + _erofs_args+=("-E" "fragments") + + if [[ -n $squash_compress ]]; then + if mkfs.erofs "${_erofs_args[@]}" -z "$squash_compress" "$_img" "$initdir" &> /dev/null; then + return + fi + dwarn "mkfs.erofs doesn't support compressor '$squash_compress', failing back to default compressor." + fi + + if ! mkfs.erofs "${_erofs_args[@]}" "$_img" "$initdir" &> /dev/null; then + dfatal "Failed making squash image" + exit 1 + fi +} + +install() { + if [[ $DRACUT_SQUASH_POST_INST ]]; then + erofs_installpost + else + dstdir="$squashdir" erofs_install + fi +} diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash/init-squash.sh index 42a9a86fe..31a39cfd7 100755 --- a/modules.d/99squash/init-squash.sh +++ b/modules.d/99squash/init-squash.sh @@ -13,15 +13,23 @@ grep -q '^devtmpfs /dev devtmpfs' /proc/self/mounts \ grep -q '^tmpfs /run tmpfs' /proc/self/mounts \ || (mkdir -p /run && mount -t tmpfs -o mode=755,noexec,nosuid,strictatime tmpfs /run) +if [ -e /erofs-root.img ]; then + _fs=erofs + _img=erofs-root.img +else + _fs=squashfs + _img=squashfs-root.img +fi + # Load required modules modprobe loop -modprobe squashfs +modprobe "$_fs" modprobe overlay # Mount the squash image mount -t ramfs ramfs /squash mkdir -p /squash/root /squash/overlay/upper /squash/overlay/work -mount -t squashfs -o ro,loop /squashfs-root.img /squash/root +mount -t "$_fs" -o ro,loop /"$_img" /squash/root # Setup new root overlay mkdir /newroot diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 015944c2c..5cbbec639 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -18,7 +18,7 @@ depends() { squash_get_handler() { local _module _handler - for _module in squash-squashfs; do + for _module in squash-squashfs squash-erofs; do if dracut_module_included "$_module"; then _handler="$_module" break @@ -28,6 +28,8 @@ squash_get_handler() { if [ -z "$_handler" ]; then if check_module "squash-squashfs"; then _handler="squash-squashfs" + elif check_module "squash-erofs"; then + _handler="squash-erofs" else dfatal "No valid handler for found" return 1 From 327adc7782fd43f4cf9848f1c24f196c496b6b53 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 23 Jul 2024 18:33:37 +0200 Subject: [PATCH 37/58] feat(lsinitrd): add support for erofs images Add support to handle erofs images in lsinitrd. Unfortunately the erofs tooling is missing some functionality of unsquashfs, esp. the ability to extract single files and list the content of the image. Work around this deficiency by always extracting the full image and emulate the missing functionality as close as possible. While at it also handle the rename of the squashfs image to squashfs-root.img. Signed-off-by: Philipp Rudo (cherry picked from commit 009b4ccc94fe3fcf129dddc5aca4f25b1e1b1862) Resolves: RHEL-43460 --- lsinitrd.sh | 167 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 113 insertions(+), 54 deletions(-) diff --git a/lsinitrd.sh b/lsinitrd.sh index 1329ab70b..952dbc9ff 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -172,10 +172,47 @@ dracutlibdirs() { done } +SQUASH_TMPFILE="" +SQUASH_EXTRACT="$TMPDIR/squash-extract" + +extract_squash_img() { + local _img _tmp + + [[ $SQUASH_TMPDIR == none ]] && return 1 + [[ -s $SQUASH_TMPFILE ]] && return 0 + + # Before dracut 104 the image was named squash-root.img. Keep the old name + # so newer versions of lsinitrd can inspect initrds build with older dracut + # versions. + for _img in squash-root.img squashfs-root.img erofs-root.img; do + _tmp="$TMPDIR/$_img" + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ + $_img > "$_tmp" 2> /dev/null + [[ -s $_tmp ]] || continue + + SQUASH_TMPFILE="$_tmp" + + # fsck.erofs doesn't allow extracting single files or listing the + # content of the image. So always extract the full image. + if [[ $_img == erofs-root.img ]]; then + mkdir -p "$SQUASH_EXTRACT" + fsck.erofs --extract="$SQUASH_EXTRACT/erofs-root" --overwrite "$SQUASH_TMPFILE" 2> /dev/null + ((ret += $?)) + fi + + break + done + + if [[ -z $SQUASH_TMPFILE ]]; then + SQUASH_TMPFILE=none + return 1 + fi + + return 0 +} + extract_files() { - SQUASH_IMG="squash-root.img" - SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" - SQUASH_EXTRACT="$TMPDIR/squash-extract" + local nofileinfo ((${#filenames[@]} == 1)) && nofileinfo=1 for f in "${!filenames[@]}"; do @@ -183,18 +220,24 @@ extract_files() { [[ $nofileinfo ]] || echo "========================================================================" # shellcheck disable=SC2001 [[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g') - $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null - ((ret += $?)) - if [[ -z ${f/#squashfs-root*/} ]]; then - if [[ ! -s $SQUASH_TMPFILE ]]; then - $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ - $SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null - fi - unsquashfs -force -d "$SQUASH_EXTRACT" -no-progress "$SQUASH_TMPFILE" "${f#squashfs-root/}" > /dev/null 2>&1 - ((ret += $?)) - cat "$SQUASH_EXTRACT/${f#squashfs-root/}" 2> /dev/null - rm "$SQUASH_EXTRACT/${f#squashfs-root/}" 2> /dev/null - fi + + case $f in + squashfs-root/*) + extract_squash_img + unsquashfs -force -d "$SQUASH_EXTRACT" -no-progress "$SQUASH_TMPFILE" "${f#squashfs-root/}" &> /dev/null + ((ret += $?)) + cat "$SQUASH_EXTRACT/${f#squashfs-root/}" 2> /dev/null + ;; + erofs-root/*) + extract_squash_img + cat "$SQUASH_EXTRACT/$f" 2> /dev/null + ;; + *) + $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null + ((ret += $?)) + ;; + esac + [[ $nofileinfo ]] || echo "========================================================================" [[ $nofileinfo ]] || echo done @@ -220,66 +263,82 @@ list_files() { } list_squash_content() { - SQUASH_IMG="squash-root.img" - SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" + extract_squash_img || return 0 - $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ - $SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null - if [[ -s $SQUASH_TMPFILE ]]; then - echo "Squashed content ($SQUASH_IMG):" - echo "========================================================================" - unsquashfs -d "squashfs-root" -ll "$SQUASH_TMPFILE" | tail -n +4 - echo "========================================================================" - fi + echo "Squashed content (${SQUASH_TMPFILE##*/}):" + echo "========================================================================" + case $SQUASH_TMPFILE in + */squash-root.img | */squashfs-root.img) + unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4 + ;; + */erofs-root.img) + ( + cd "$SQUASH_EXTRACT" || return 1 + find erofs-root/ -ls + ) + ;; + esac + echo "========================================================================" } list_cmdline() { - # depends on list_squash_content() having run before - SQUASH_IMG="squash-root.img" - SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" - SQUASH_EXTRACT="$TMPDIR/squash-extract" echo "dracut cmdline:" # shellcheck disable=SC2046 $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \ etc/cmdline.d/\*.conf 2> /dev/null ((ret += $?)) - if [[ -s $SQUASH_TMPFILE ]]; then - unsquashfs -force -d "$SQUASH_EXTRACT" -no-progress "$SQUASH_TMPFILE" etc/cmdline.d/\*.conf > /dev/null 2>&1 - ((ret += $?)) - cat "$SQUASH_EXTRACT"/etc/cmdline.d/*.conf 2> /dev/null - rm "$SQUASH_EXTRACT"/etc/cmdline.d/*.conf 2> /dev/null - fi + + extract_squash_img || return 0 + case $SQUASH_TMPFILE in + */squash-root.img | */squashfs-root.img) + unsquashfs -force -d "$SQUASH_EXTRACT" -no-progress "$SQUASH_TMPFILE" etc/cmdline.d/\*.conf &> /dev/null + ((ret += $?)) + cat "$SQUASH_EXTRACT"/etc/cmdline.d/*.conf 2> /dev/null + ;; + */erofs-root.img) + cat "$SQUASH_EXTRACT"/erofs-root/etc/cmdline.d/*.conf 2> /dev/null + ;; + esac + } unpack_files() { - SQUASH_IMG="squash-root.img" - SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh" - if ((${#filenames[@]} > 0)); then for f in "${!filenames[@]}"; do # shellcheck disable=SC2001 [[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g') - $CAT "$image" 2> /dev/null | cpio -id --quiet $verbose "$f" - ((ret += $?)) - if [[ -z ${f/#squashfs-root*/} ]]; then - if [[ ! -s $SQUASH_TMPFILE ]]; then - $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ - $SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null - fi - unsquashfs -force -d "squashfs-root" -no-progress "$SQUASH_TMPFILE" "${f#squashfs-root/}" > /dev/null - ((ret += $?)) - fi + case $f in + squashfs-root/*) + extract_squash_img || continue + unsquashfs -force -d "squashfs-root" -no-progress "$SQUASH_TMPFILE" "${f#squashfs-root/}" > /dev/null + ((ret += $?)) + ;; + erofs-root/*) + extract_squash_img || continue + mkdir -p "${f%/*}" + cp -rf "$SQUASH_EXTRACT/$f" "$f" + ;; + *) + $CAT "$image" 2> /dev/null | cpio -id --quiet $verbose "$f" + ((ret += $?)) + ;; + esac done else $CAT "$image" 2> /dev/null | cpio -id --quiet $verbose ((ret += $?)) - $CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \ - $SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null - if [[ -s $SQUASH_TMPFILE ]]; then - unsquashfs -d "squashfs-root" -no-progress "$SQUASH_TMPFILE" > /dev/null - ((ret += $?)) - fi + + extract_squash_img || return 0 + case $SQUASH_TMPFILE in + */squash-root.img | */squashfs-root.img) + unsquashfs -d "squashfs-root" -no-progress "$SQUASH_TMPFILE" > /dev/null + ((ret += $?)) + ;; + */erofs-root.img) + cp -rf "$SQUASH_EXTRACT/erofs-root" . + ;; + esac fi } From 0d90ae671e130b631383fb481a1f38a175167eff Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 30 Jul 2024 17:24:28 +0200 Subject: [PATCH 38/58] feat(dracut-initramfs-restore): unpack erofs images Follow the example for squashfs images and also unpack erofs images in dracut-initramfs-restore. Signed-off-by: Philipp Rudo (cherry picked from commit b390e194911835e6bd24eeeb0946e374852b8ddc) Resolves: RHEL-43460 --- dracut-initramfs-restore.sh | 10 ++++++++-- modules.d/95squash-erofs/module-setup.sh | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh index cc561b221..015160b76 100755 --- a/dracut-initramfs-restore.sh +++ b/dracut-initramfs-restore.sh @@ -74,12 +74,18 @@ else exit 1 fi -if [[ -d squash ]]; then - if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then +if [[ -f squashfs-root.img ]]; then + if ! unsquashfs -no-xattrs -f -d . squashfs-root.img > /dev/null; then echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2 rm -f -- /run/initramfs/shutdown exit 1 fi +elif [[ -f erofs-root.img ]]; then + if ! fsck.erofs --extract=. --overwrite erofs-root.img > /dev/null; then + echo "Squash module is enabled for this initramfs but failed to unpack erofs-root.img" >&2 + rm -f -- /run/initramfs/shutdown + exit 1 + fi fi if grep -q -w selinux /sys/kernel/security/lsm 2> /dev/null \ diff --git a/modules.d/95squash-erofs/module-setup.sh b/modules.d/95squash-erofs/module-setup.sh index 71c2b672b..d763a9024 100755 --- a/modules.d/95squash-erofs/module-setup.sh +++ b/modules.d/95squash-erofs/module-setup.sh @@ -1,7 +1,7 @@ #!/bin/bash check() { - require_binaries mkfs.erofs || return 1 + require_binaries mkfs.erofs fsck.erofs || return 1 require_kernel_modules erofs || return 1 return 255 From a3ca60929c50f1a1d41cf4567e3a4a8231a92642 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 30 Jul 2024 13:35:17 +0200 Subject: [PATCH 39/58] fix(squash): explicitly create required directories At the moment 99squash relies on dracut-install to create the required directories it later links to. This approach is error prone and will cause problems when switching to use 99busybox later on, which tries to add a link to /usr/sbin that hasn't been created. Thus explicitly create the expected directories before installing the minimal initrd. Signed-off-by: Philipp Rudo (cherry picked from commit dde95b10ff6b28330370fd697350f8bc5da422da) Related: RHEL-43460 --- modules.d/99squash/module-setup.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 5cbbec639..6aa649b7c 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -40,12 +40,15 @@ squash_get_handler() { } squash_install() { - local _busybox + local _busybox _dir _busybox=$(find_binary busybox) - # Create mount points for squash loader - mkdir -p "$initdir"/squash/ - mkdir -p "$squashdir"/squash/ + # Create mount points for squash loader and basic directories + mkdir -p "$initdir"/squash + for _dir in squash usr/bin usr/sbin usr/lib; do + mkdir -p "$squashdir/$_dir" + [[ $_dir == usr/* ]] && ln_r "/$_dir" "${_dir#usr}" + done # Install required modules and binaries for the squash image init script. if [[ $_busybox ]]; then @@ -67,8 +70,6 @@ squash_install() { dracut_kernel_post # Install squash image init script. - ln_r /usr/bin /bin - ln_r /usr/sbin /sbin inst_simple "$moddir"/init-squash.sh /init # make sure that library links are correct and up to date for squash loader From a6e8e41cd1d67bb4ee64b2bf107e98c18bf8afdf Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 30 Jul 2024 13:44:32 +0200 Subject: [PATCH 40/58] fix(squash): use 99busybox instead of installing it manually Make use of 99busybox in 99squash rather than installing it manually. This not only removes duplicate code but allows mixing of busybox with tools from coreutils. This requires a small change in 99busybox to remove the hard coded use of $initdir. Suggested-by: Laszlo Gombos Signed-off-by: Philipp Rudo (cherry picked from commit 395366278f473038badba239f76cac391428b149) Related: RHEL-43460 --- modules.d/05busybox/module-setup.sh | 5 +++++ modules.d/99squash/module-setup.sh | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules.d/05busybox/module-setup.sh b/modules.d/05busybox/module-setup.sh index 86b3761a2..857145c9c 100755 --- a/modules.d/05busybox/module-setup.sh +++ b/modules.d/05busybox/module-setup.sh @@ -15,6 +15,7 @@ depends() { # called by dracut install() { local _i _path _busybox + local _dstdir="${dstdir:-"$initdir"}" local _progs=() _busybox=$(find_binary busybox) inst "$_busybox" /usr/bin/busybox @@ -26,6 +27,10 @@ install() { for _i in "${_progs[@]}"; do _path=$(find_binary "$_i") [ -z "$_path" ] && continue + + # do not remove existing destination files + [ -e "${_dstdir}/$_path" ] && continue + ln_r /usr/bin/busybox "$_path" done } diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 6aa649b7c..56f70774a 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -52,10 +52,7 @@ squash_install() { # Install required modules and binaries for the squash image init script. if [[ $_busybox ]]; then - inst "$_busybox" /usr/bin/busybox - for _i in sh echo mount modprobe mkdir switch_root grep umount; do - ln_r /usr/bin/busybox /usr/bin/$_i - done + module_install "busybox" else DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount From 3b4fe88a4259ec576a41d98b6aaee324a6b48b0f Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 10 Jul 2024 16:30:09 -0700 Subject: [PATCH 41/58] feat(dmdquash-live): add support for using erofs This adds support for rootfs compressed with erofs. Either as a plain erofs image or a LiveOS/rootfs.img ext4 filesystem compressed with erofs. This patch does not make any attempt to change the squashfs directory naming (or variable names) in order to make these changes as small as possible and easy to review. It also does not make any attempt to support the multitude of available options other than what is needed by anaconda-dracut calling this script to setup the boot.iso root filesystem. (which isn't to say it doesn't work, it just hasn't been tested and is outside the scope of this change). (cherry picked commit ca5ae5d3466eec40d118fc96d450478aa6faebb6) Resolves: RHEL-43460 --- modules.d/90dmsquash-live/dmsquash-live-root.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh index 4518852bd..a376185e8 100755 --- a/modules.d/90dmsquash-live/dmsquash-live-root.sh +++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh @@ -97,7 +97,6 @@ det_img_fs() { blkid -s TYPE -u noraid -o value "$1" } -load_fstype squashfs CMDLINE=$(getcmdline) for arg in $CMDLINE; do case $arg in @@ -112,14 +111,15 @@ if [ -f "$livedev" ]; then # check filesystem type and handle accordingly fstype=$(det_img_fs "$livedev") case $fstype in - squashfs) SQUASHED=$livedev ;; - auto) die "cannot mount live image (unknown filesystem type)" ;; + squashfs | erofs) SQUASHED=$livedev ;; + auto) die "cannot mount live image (unknown filesystem type $fstype)" ;; *) FSIMG=$livedev ;; esac load_fstype "$fstype" else livedev_fstype=$(det_fs "$livedev") - if [ "$livedev_fstype" = "squashfs" ]; then + load_fstype "$livedev_fstype" + if [ "$livedev_fstype" = "squashfs" ] || [ "$livedev_fstype" = "erofs" ]; then # no mount needed - we've already got the LiveOS image in $livedev SQUASHED=$livedev elif [ "$livedev_fstype" != "ntfs" ]; then @@ -336,7 +336,7 @@ if [ -e "$SQUASHED" ]; then SQUASHED_LOOPDEV=$(losetup -f) losetup -r "$SQUASHED_LOOPDEV" $SQUASHED mkdir -m 0755 -p /run/initramfs/squashfs - mount -n -t squashfs -o ro "$SQUASHED_LOOPDEV" /run/initramfs/squashfs + mount -n -o ro "$SQUASHED_LOOPDEV" /run/initramfs/squashfs if [ -d /run/initramfs/squashfs/LiveOS ]; then if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then From 819306b94a9dc039b9be8a2aad981146814a95c2 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 7 Aug 2024 16:06:13 +0200 Subject: [PATCH 42/58] build: add erofs-utils into Suggests --- .distro/dracut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index fc5d80907..b96651ad6 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -144,6 +144,7 @@ This package contains tools to assemble the local initrd and host configuration. Summary: dracut module to build an initramfs with most files in a squashfs image Requires: %{name} = %{version}-%{release} Requires: squashfs-tools +Suggests: erofs-utils %description squash This package provides a dracut module to build an initramfs, but store most files From c601f6218ea8de04b6a88521de07c725a457bd1b Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 03:23:06 +0200 Subject: [PATCH 43/58] build: add squash-erofs and squash-squashfs modules --- .distro/dracut.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index b96651ad6..24436d8d9 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -418,6 +418,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %files squash %{dracutlibdir}/modules.d/99squash +%{dracutlibdir}/modules.d/95squash-erofs +%{dracutlibdir}/modules.d/95squash-squashfs %files config-generic %{dracutlibdir}/dracut.conf.d/02-generic-image.conf From 56bf1917de004cd3f9032a68a6cd09d5bd972b04 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 04:46:02 +0200 Subject: [PATCH 44/58] build: sync up with dist-git --- .distro/dracut.spec | 16 ++++++---------- .distro/source-git.yaml | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 24436d8d9..83290a997 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -25,7 +25,7 @@ Source1: https://www.gnu.org/licenses/lgpl-2.1.txt # Please use source-git to work with this spec file: # HowTo: https://packit.dev/source-git/work-with-source-git -# Source-git repository: https://github.com/redhat-plumbers/dracut-fedora/ +# Source-git repository: https://github.com/redhat-plumbers/dracut-rhel10/ BuildRequires: bash BuildRequires: git-core @@ -431,19 +431,15 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %changelog * Tue Jun 04 2024 Pavel Valena - 102-1 - Update to dracut 102. + Resolves: RHEL-43460,RHEL-32237,RHEL-32506,RHEL-43460,RHEL-47145,RHEL-49744,RHEL-53350 + +* Mon Jun 24 2024 Troy Dawson - 101-2 +- Bump release for June 2024 mass rebuild * Thu May 16 2024 Pavel Valena - 101-1 - Update to dracut 101. - -* Fri Apr 26 2024 Adam Williamson - 060-2 -- Backport fix to pull in required libs for systemd (dracut-ng PR #118) -- Backport fix to move hook directory for systemd (dracut-ng PR #194) - -* Wed Mar 20 2024 Pavel Valena - 060-1 -- Update to dracut 060. - -* Mon Feb 12 2024 Pavel Valena - 059-22 - Remove network-legacy module. +- Additional fixes on top of rebase (see patches). * Sat Jan 27 2024 Manuel Fombuena - 059-21 - fix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index 7b2df1327..e6ea015fd 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -6,6 +6,7 @@ patch_generation_ignore_paths: - .distro/ - .packit.yml - .github/ +- test/ patch_generation_patch_id_digits: 1 sync_changelog: true files_to_sync: From 458e2a42d6921cedb67623b68f6e310145f4b129 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 19 Jul 2021 11:27:28 +0200 Subject: [PATCH 45/58] fix(nfs): set correct ownership and permissions for statd directory The directory ownership for the statd directory should be rpcuser:rpcuser. (cherry picked from commit ed5ab5787177f2be8a620a8d2d63a9ad26fbf149 from PR#583) Resolves: RHEL-53361 --- modules.d/95nfs/module-setup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh index abe1ee594..da6549d1d 100755 --- a/modules.d/95nfs/module-setup.sh +++ b/modules.d/95nfs/module-setup.sh @@ -120,8 +120,13 @@ install() { mkdir -m 0755 -p "$initdir/var/lib/nfs" mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs" mkdir -m 0770 -p "$initdir/var/lib/rpcbind" - [ -d "/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" - [ -d "/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" + [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] \ + && mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" \ + && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" \ + && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd" + [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] \ + && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" \ + && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm" # Rather than copy the passwd file in, just set a user for rpcbind # We'll save the state and restart the daemon from the root anyway From 23a7d5d4752dd4273f406cf1729b2d98f39d0aa5 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Sat, 17 Aug 2024 00:39:17 +0200 Subject: [PATCH 46/58] fix(resume): do not include resume if swap is on netdevice Additional fix, restoring previous behavior identical to RHEL-9. rhel-only Resolves: RHEL-53350 --- modules.d/95resume/module-setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh index c0f04a6c1..785f681ae 100755 --- a/modules.d/95resume/module-setup.sh +++ b/modules.d/95resume/module-setup.sh @@ -4,9 +4,6 @@ # shellcheck disable=SC2317 check() { - # Always include resume module - return 0 - swap_on_netdevice() { local _dev for _dev in "${swap_devs[@]}"; do @@ -23,6 +20,9 @@ check() { # hibernation support requested on kernel command line return 0 else + # always include resume module when not on netdevice + return 0 + # resume= not set on kernel command line if [[ -f /sys/power/resume ]]; then if [[ "$(< /sys/power/resume)" == "0:0" ]]; then From 101ee8a01d36d93b23749a67c337a2833f8ce1d3 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Sat, 17 Aug 2024 01:43:50 +0200 Subject: [PATCH 47/58] feat(dracut-init.sh): give --force-add precedence over --omit This gives precedence of force_add_dracutmodules to omit_dracutmodules, as there is not other way to override omit_dracutmodules list, and users would expect it to be overriden from command line. Ref: https://github.com/dracut-ng/dracut-ng/pull/569 This way, `--add` retains it behaviour, and `--force-add` gains additional functionality in non-hostonly mode. The module may still be skipped if the module check returns 1, but it should throw error (as I'd expect for `--force-add`). (cherry picked commit a669346f48cbb3278c51ba5e95b1b91f9bfdee0a from PR#584) Resolves: RHEL-53791 --- dracut-init.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 840c6167b..5d5fc0816 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -960,8 +960,10 @@ check_module() { [[ $2 ]] || mods_checked_as_dep+=" $_mod " if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then - ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!" - return 1 + if [[ " $force_add_dracutmodules " != *\ $_mod\ * ]]; then + ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!" + return 1 + fi fi if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then From afd17820980728f18a5cc96e794d4c56a8694698 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 16 Aug 2024 20:40:15 +0200 Subject: [PATCH 48/58] feat(lsinitrd.sh): look for initrd in /usr/lib/modules/ Introduce new path for lsinitrd.sh to look into: /usr/lib/modules/$kver/initramfs.img Which is valid on all ostree-based systems, and also other image based systems with pre-generated initramfs. Ref: https://issues.redhat.com/browse/RHEL-35890 (cherry picked from commit 22ae6ecaf9ecdb9db3e79aa9a72d527e7436c282) Resolves: RHEL-54650 --- lsinitrd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lsinitrd.sh b/lsinitrd.sh index 952dbc9ff..429cce7e7 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -136,6 +136,8 @@ else image="/lib/modules/${KERNEL_VERSION}/initramfs.img" elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then image="/boot/initramfs-${KERNEL_VERSION}.img" + elif [[ -f /usr/lib/modules/${KERNEL_VERSION}/initramfs.img ]]; then + image="/usr/lib/modules/${KERNEL_VERSION}/initramfs.img" elif [[ $MACHINE_ID ]] \ && mountpoint -q /efi; then image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd" From 833ca2c3832f1939a9a9729ed66c20d2a5fbf1fa Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 19 Aug 2024 09:41:27 +0200 Subject: [PATCH 49/58] feat(fips): include fips module unconditionally rhel-only Resolves: RHEL-39404 --- modules.d/01fips/module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh index 83fcd5645..5ce1f201b 100755 --- a/modules.d/01fips/module-setup.sh +++ b/modules.d/01fips/module-setup.sh @@ -2,7 +2,7 @@ # called by dracut check() { - return 255 + return 0 } # called by dracut From e1ae840425837004bacafe53c53468207aa513e3 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 8 Aug 2024 00:55:03 +0200 Subject: [PATCH 50/58] fix(nfs): include also entries from /usr/lib/{passwd,group} as those paths are used by bootc instead of the /etc ones. (cherry picked from commit 45cdf3c4f24f77f04b264a7747f115d1031b2e67) Resolves: RHEL-53431 --- modules.d/95nfs/module-setup.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh index da6549d1d..df2d0e059 100755 --- a/modules.d/95nfs/module-setup.sh +++ b/modules.d/95nfs/module-setup.sh @@ -130,8 +130,15 @@ install() { # Rather than copy the passwd file in, just set a user for rpcbind # We'll save the state and restart the daemon from the root anyway - grep -E '^nfsnobody:|^rpc:|^rpcuser:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd" - grep -E '^nogroup:|^rpc:|^nobody:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group" + local _confdir + for _confdir in etc usr/lib; do + + grep -sE '^(nfsnobody|_rpc|rpc|rpcuser):' "${dracutsysrootdir}/${_confdir}/passwd" \ + >> "$initdir/${_confdir}/passwd" + + grep -sE '^(nogroup|rpc|nobody):' "${dracutsysrootdir}/${_confdir}/group" \ + >> "$initdir/${_confdir}/group" + done dracut_need_initqueue } From d18bbc304e838ecf3b888ce4d70f1d96d21821f5 Mon Sep 17 00:00:00 2001 From: Daniel McIlvaney Date: Fri, 7 Jun 2024 11:38:54 -0700 Subject: [PATCH 51/58] fix(dracut-functions): avoid awk in get_maj_min() The `get_maj_min()` cache lookup is commonly used across many flows. While `awk` should be available, some highly constrained environments may not have it. A second call to `grep` can provide the same behaviour without adding a dependnecy. Lines in the cache will be of the form "/dev/sda2 8:2". `awk '{print $NF}'` returns the last word of a matching line. Since the initial matching regex is so specific a second call to grep can easily extract the last word. (cherry picked commit ec7efd5701e9a1b24f2e85666d625fb1fe46ce86) Related: RHEL-47145 --- dracut-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-functions.sh b/dracut-functions.sh index 43d905e38..b4d574542 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -243,7 +243,7 @@ get_maj_min() { local _out if [[ $get_maj_min_cache_file ]]; then - _out="$(grep -m1 -oE "^${1//\\/\\\\} \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')" + _out="$(grep -m1 -oE "^${1//\\/\\\\} \S+$" "$get_maj_min_cache_file" | grep -oE "\S+$")" fi if ! [[ "$_out" ]]; then From 13151e1131006c124130ed1e68c9087910f92f61 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 19 Aug 2024 12:48:09 +0200 Subject: [PATCH 52/58] build: protect dist-git files --- .distro/source-git.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.distro/source-git.yaml b/.distro/source-git.yaml index e6ea015fd..fcd25b396 100644 --- a/.distro/source-git.yaml +++ b/.distro/source-git.yaml @@ -16,8 +16,13 @@ files_to_sync: filters: - protect .git* - protect sources + - protect .fmf* + - protect gating.yaml + - protect plans.fmf + - protect ci.fmf - exclude source-git.yaml - exclude .gitignore + sources: - path: dracut-ng-102.tar.gz url: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/102.tar.gz From 7a580a481f8b2d2df60a5e7b9da5c4a11ed9ecbf Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 26 Aug 2024 15:58:54 +0200 Subject: [PATCH 53/58] revert(dracut-init.sh): add module to mods_to_load before checking dependencies Commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load before checking dependencies") introduced a regression. When dracut is in "auto" mode, i.e. '--modules auto' or no --modules is provided, the expected behavior is that all modules that return 0 in their check() function are included. Except for the ones where the dependencies cannot be installed. The commit however, caused those modules to be included without their dependencies. Thus revert the commit. This reverts commit d0f8fde5668cfd7fda1d15824e268b4949b4fd04. Reported-by: Jo Zzsi Signed-off-by: Philipp Rudo (cherry picked from commit bddbb11bbbfc405317a6fbd53bb189b575d46da2) Resolves: RHEL-43460 --- dracut-init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dracut-init.sh b/dracut-init.sh index 5d5fc0816..756a0a756 100755 --- a/dracut-init.sh +++ b/dracut-init.sh @@ -915,9 +915,6 @@ check_mount() { fi fi - [[ " $mods_to_load " == *\ $_mod\ * ]] \ - || mods_to_load+=" $_mod " - for _moddep in $(module_depends "$_mod" "$_moddir"); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ @@ -936,6 +933,9 @@ check_mount() { fi done + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + return 0 } @@ -992,9 +992,6 @@ check_module() { fi fi - [[ " $mods_to_load " == *\ $_mod\ * ]] \ - || mods_to_load+=" $_mod " - for _moddep in $(module_depends "$_mod" "$_moddir"); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ @@ -1013,6 +1010,9 @@ check_module() { fi done + [[ " $mods_to_load " == *\ $_mod\ * ]] \ + || mods_to_load+=" $_mod " + return 0 } From 7e1598536003caf9c6b68e9a4eaf3cef8bfcfeb9 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 26 Aug 2024 15:23:41 +0200 Subject: [PATCH 54/58] fix(squash): remove cyclic dependency With commit d0f8fde5 ("fix(dracut-init.sh): add module to mods_to_load before checking dependencies") reverted 99squash can no longer rely on dracut_module_included working as expected in its check() and depends() function. Solve this problem by breaking up the cyclic dependency between 99squash and 95squash-{squashfs,erofs} as the commit was originally introduced to allow this cyclic dependency. This requires to move all code shared by 95squash-{squashfs,erofs} from 99squash to a new 99squash-lib module and update the dependencies accordingly. In addition update the checks in dracut.sh to check for 99squash-lib as 99squash is no longer guaranteed to be included. Finally make sure that 99squash-lib isn't included without a back end. While at it improve and align the error messages in 99squash and 99squash-lib. Signed-off-by: Philipp Rudo (cherry picked from commit d5783635950e38cccf334e7163db79f280650fa2) Resolves: RHEL-43460 --- dracut.sh | 6 +- modules.d/95squash-erofs/module-setup.sh | 2 +- modules.d/95squash-squashfs/module-setup.sh | 2 +- .../{99squash => 99squash-lib}/init-squash.sh | 0 modules.d/99squash-lib/module-setup.sh | 101 ++++++++++++++++++ modules.d/99squash/module-setup.sh | 80 +------------- 6 files changed, 110 insertions(+), 81 deletions(-) rename modules.d/{99squash => 99squash-lib}/init-squash.sh (100%) create mode 100755 modules.d/99squash-lib/module-setup.sh diff --git a/dracut.sh b/dracut.sh index 68bdf33b0..71568fe0b 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1911,7 +1911,7 @@ if [[ $kernel_only != yes ]]; then fi fi -dracut_module_included "squash" && mkdir -p "$squashdir" +dracut_module_included "squash-lib" && mkdir -p "$squashdir" _isize=0 #initramfs size modules_loaded=" " @@ -2276,9 +2276,9 @@ if [[ $do_strip == yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then dinfo "*** Stripping files done ***" fi -if dracut_module_included "squash"; then +if dracut_module_included "squash-lib"; then dinfo "*** Squashing the files inside the initramfs ***" - DRACUT_SQUASH_POST_INST=1 module_install "squash" + DRACUT_SQUASH_POST_INST=1 module_install "squash-lib" rm -rf "$squashdir" dinfo "*** Squashing the files inside the initramfs done ***" diff --git a/modules.d/95squash-erofs/module-setup.sh b/modules.d/95squash-erofs/module-setup.sh index d763a9024..a6e7ad0b5 100755 --- a/modules.d/95squash-erofs/module-setup.sh +++ b/modules.d/95squash-erofs/module-setup.sh @@ -8,7 +8,7 @@ check() { } depends() { - echo "squash" + echo "squash-lib" return 0 } diff --git a/modules.d/95squash-squashfs/module-setup.sh b/modules.d/95squash-squashfs/module-setup.sh index 839737001..d15586da0 100755 --- a/modules.d/95squash-squashfs/module-setup.sh +++ b/modules.d/95squash-squashfs/module-setup.sh @@ -8,7 +8,7 @@ check() { } depends() { - echo "squash" + echo "squash-lib" return 0 } diff --git a/modules.d/99squash/init-squash.sh b/modules.d/99squash-lib/init-squash.sh similarity index 100% rename from modules.d/99squash/init-squash.sh rename to modules.d/99squash-lib/init-squash.sh diff --git a/modules.d/99squash-lib/module-setup.sh b/modules.d/99squash-lib/module-setup.sh new file mode 100755 index 000000000..6a0b6f851 --- /dev/null +++ b/modules.d/99squash-lib/module-setup.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +check() { + require_kernel_modules loop overlay || return 1 + + return 255 +} + +depends() { + echo "systemd-initrd" + + return 0 +} + +squash_get_handler() { + local _module _handler + local -a _modules=(squash-squashfs squash-erofs) + + for _module in "${_modules[@]}"; do + if dracut_module_included "$_module"; then + _handler="$_module" + break + fi + done + + if [[ -z $_handler ]]; then + dfatal "Cannot include squash-lib directly. It requires one of: ${_modules[*]}" + return 1 + fi + + echo "$_handler" +} + +squash_install() { + local _busybox _dir + + # verify that there is a valid handler before doing anything + squash_get_handler > /dev/null || return 1 + + _busybox=$(find_binary busybox) + + # Create mount points for squash loader and basic directories + mkdir -p "$initdir"/squash + for _dir in squash usr/bin usr/sbin usr/lib; do + mkdir -p "$squashdir/$_dir" + [[ $_dir == usr/* ]] && ln_r "/$_dir" "${_dir#usr}" + done + + # Install required modules and binaries for the squash image init script. + if [[ $_busybox ]]; then + module_install "busybox" + else + DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount + + # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so + inst_libdir_file -o "libgcc_s.so*" + + # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled + [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*" + fi + + hostonly="" instmods "loop" "overlay" + dracut_kernel_post + + # Install squash image init script. + inst_simple "$moddir"/init-squash.sh /init + + # make sure that library links are correct and up to date for squash loader + build_ld_cache +} + +squash_installpost() { + local _file _handler + + _handler=$(squash_get_handler) + [[ -n $_handler ]] || return 1 + + DRACUT_SQUASH_POST_INST=1 module_install "$_handler" + + # Rescue the dracut spec files so dracut rebuild and lsinitrd can work + for _file in "$initdir"/usr/lib/dracut/*; do + [[ -f $_file ]] || continue + DRACUT_RESOLVE_DEPS=1 dstdir=$squashdir inst "$_file" "${_file#"$initdir"}" + done + + # Remove everything that got squashed into the image + for _file in "$initdir"/*; do + [[ $_file == "$squashdir" ]] && continue + rm -rf "$_file" + done + mv "$squashdir"/* "$initdir" +} + +install() { + + if [[ $DRACUT_SQUASH_POST_INST ]]; then + squash_installpost + else + dstdir="$squashdir" squash_install + fi +} diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 56f70774a..c48ba2c5a 100755 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -1,102 +1,30 @@ #!/bin/bash check() { - require_kernel_modules loop overlay || return 1 - return 255 } depends() { - local _handler - - _handler=$(squash_get_handler) || return 1 - - echo "systemd-initrd $_handler" - return 0 -} - -squash_get_handler() { local _module _handler + local -a _modules=(squash-squashfs squash-erofs) - for _module in squash-squashfs squash-erofs; do + for _module in "${_modules[@]}"; do if dracut_module_included "$_module"; then _handler="$_module" break fi done - if [ -z "$_handler" ]; then + if [[ -z $_handler ]]; then if check_module "squash-squashfs"; then _handler="squash-squashfs" elif check_module "squash-erofs"; then _handler="squash-erofs" else - dfatal "No valid handler for found" + dfatal "Cannot find valid handler for squash. It requires one of: ${_modules[*]}" return 1 fi fi echo "$_handler" } - -squash_install() { - local _busybox _dir - _busybox=$(find_binary busybox) - - # Create mount points for squash loader and basic directories - mkdir -p "$initdir"/squash - for _dir in squash usr/bin usr/sbin usr/lib; do - mkdir -p "$squashdir/$_dir" - [[ $_dir == usr/* ]] && ln_r "/$_dir" "${_dir#usr}" - done - - # Install required modules and binaries for the squash image init script. - if [[ $_busybox ]]; then - module_install "busybox" - else - DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount - - # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so - inst_libdir_file -o "libgcc_s.so*" - - # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled - [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*" - fi - - hostonly="" instmods "loop" "overlay" - dracut_kernel_post - - # Install squash image init script. - inst_simple "$moddir"/init-squash.sh /init - - # make sure that library links are correct and up to date for squash loader - build_ld_cache -} - -squash_installpost() { - local _file - - DRACUT_SQUASH_POST_INST=1 module_install "$(squash_get_handler)" - - # Rescue the dracut spec files so dracut rebuild and lsinitrd can work - for _file in "$initdir"/usr/lib/dracut/*; do - [[ -f $_file ]] || continue - DRACUT_RESOLVE_DEPS=1 dstdir=$squashdir inst "$_file" "${_file#"$initdir"}" - done - - # Remove everything that got squashed into the image - for _file in "$initdir"/*; do - [[ $_file == "$squashdir" ]] && continue - rm -rf "$_file" - done - mv "$squashdir"/* "$initdir" -} - -install() { - - if [[ $DRACUT_SQUASH_POST_INST ]]; then - squash_installpost - else - dstdir="$squashdir" squash_install - fi -} From 8fe64408bd8349e28b7257f93880527a93c63fa2 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Tue, 27 Aug 2024 12:14:40 +0200 Subject: [PATCH 55/58] fix(dracut.sh): exit when installing the squash loader fails The postinstall phase in 99squash-lib can fail, e.g. when 99squash-lib is added without one of the required back ends. Usually this isn't fatal and simply results in a "normal" initrd, i.e. one without squashed image, being created. Nevertheless, a user needs to explicitly add one of the required modules for the code to be triggered. So it is better to fail with an error rather than giving the user something he didn't ask for. Signed-off-by: Philipp Rudo (cherry picked from commit 8909d892a7a055ae95be45416e6fbf1b833ff426) Resolves: RHEL-43460 --- dracut.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut.sh b/dracut.sh index 71568fe0b..3d73fe433 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2278,7 +2278,7 @@ fi if dracut_module_included "squash-lib"; then dinfo "*** Squashing the files inside the initramfs ***" - DRACUT_SQUASH_POST_INST=1 module_install "squash-lib" + DRACUT_SQUASH_POST_INST=1 module_install "squash-lib" || exit 1 rm -rf "$squashdir" dinfo "*** Squashing the files inside the initramfs done ***" From 85235ab58df8343a1a0314333b360648a5d0f452 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 26 Aug 2024 15:29:01 +0200 Subject: [PATCH 56/58] fix(squash-lib): harden against empty $initdir The postinstall phase of 99squash-lib has the potential to delete the whole rootfs if $initdir is empty. This should(tm) never happen. Nevertheless as the consequences are so devastating it is better to double check. Signed-off-by: Philipp Rudo (cherry picked from commit 6b089c70761c81a7b82a1bfba5f2c1faef7e972f) Resolves: RHEL-43460 --- modules.d/99squash-lib/module-setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules.d/99squash-lib/module-setup.sh b/modules.d/99squash-lib/module-setup.sh index 6a0b6f851..be3d3dc04 100755 --- a/modules.d/99squash-lib/module-setup.sh +++ b/modules.d/99squash-lib/module-setup.sh @@ -72,6 +72,14 @@ squash_install() { squash_installpost() { local _file _handler + # this shouldn't happen but... + # ...better safe than deleting your rootfs + if [[ -z $initdir ]]; then + #shellcheck disable=SC2016 + dfatal '$initdir not set. Something went terribly wrong.' + exit 1 + fi + _handler=$(squash_get_handler) [[ -n $_handler ]] || return 1 From fa245cea3b5f03d24777e9cbf6f295977541565c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 28 Aug 2024 17:38:25 +0200 Subject: [PATCH 57/58] build: add squash-lib module --- .distro/dracut.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/.distro/dracut.spec b/.distro/dracut.spec index 83290a997..364010e93 100644 --- a/.distro/dracut.spec +++ b/.distro/dracut.spec @@ -418,6 +418,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %files squash %{dracutlibdir}/modules.d/99squash +%{dracutlibdir}/modules.d/99squash-lib %{dracutlibdir}/modules.d/95squash-erofs %{dracutlibdir}/modules.d/95squash-squashfs From f0d16991cfd3336c030a445fde4e61b976c82b27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 03:10:37 +0000 Subject: [PATCH 58/58] chore(deps): bump luizm/action-sh-checker from 0.8.0 to 0.9.0 Bumps [luizm/action-sh-checker](https://github.com/luizm/action-sh-checker) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/luizm/action-sh-checker/releases) - [Commits](https://github.com/luizm/action-sh-checker/compare/v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: luizm/action-sh-checker dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 16dac6c8d..283de6c18 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - name: shfmt - uses: luizm/action-sh-checker@v0.8.0 + uses: luizm/action-sh-checker@v0.9.0 env: SHFMT_OPTS: -s # arguments to shfmt. with: