%endif
# The entire source code is GPLv2+
-# except install/* which is LGPLv2.1+
-License: GPLv2+ and LGPLv2.1+
+# except install/* which is LGPLv2+
+License: GPLv2+ and LGPLv2+
URL: https://dracut.wiki.kernel.org/
Obsoletes: dracut-kernel < 005
Provides: dracut-kernel = %{version}-%{release}
+Obsoletes: dracut <= 029
+Obsoletes: dracut-norescue
+Provides: dracut-norescue
+
Requires: bash >= 4
Requires: coreutils
Requires: cpio
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
Requires: systemd >= 199
+Requires: procps-ng
Conflicts: grubby < 8.23
%else
Requires: udev > 166
Requires: %{name} = %{version}-%{release}
Requires: iputils
Requires: iproute
+Requires: dhclient
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release}
This package requires everything which is needed to build an
initramfs with dracut, which drops capabilities.
-%package nohostonly
+%package config-generic
Summary: dracut configuration to turn off hostonly image generation
Requires: %{name} = %{version}-%{release}
+Obsoletes: dracut-nohostonly
+Provides: dracut-nohostonly
-%description nohostonly
+%description config-generic
This package provides the configuration to turn off the host specific initramfs
-generation with dracut.
+generation with dracut and generates a generic image by default.
-%package norescue
-Summary: dracut configuration to turn off rescue image generation
+%package config-rescue
+Summary: dracut configuration to turn on rescue image generation
Requires: %{name} = %{version}-%{release}
+Obsoletes: dracut <= 029
-%description norescue
-This package provides the configuration to turn off the rescue initramfs
+%description config-rescue
+This package provides the configuration to turn on the rescue initramfs
generation with dracut.
%package tools
%install
%if 0%{?fedora} || 0%{?rhel}
-rm -rf $RPM_BUILD_ROOT
+rm -rf -- $RPM_BUILD_ROOT
%endif
make %{?_smp_mflags} install \
DESTDIR=$RPM_BUILD_ROOT \
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
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
%endif
%if %{defined _unitdir}
# for systemd, better use systemd-bootchart
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
%endif
# we do not support dash in the initramfs
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
# remove gentoo specific modules
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
%if %{defined _unitdir}
# with systemd IMA and selinux modules do not make sense
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
-rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
+rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
%endif
mkdir -p $RPM_BUILD_ROOT/boot/dracut
%endif
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
-rm $RPM_BUILD_ROOT%{_bindir}/mkinitrd
-rm $RPM_BUILD_ROOT%{_bindir}/lsinitrd
+rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
+rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
-echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-nohostonly.conf
-echo 'dracut_rescue_image="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-norescue.conf
+echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
+echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%endif
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
-install -m 0644 dracut.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/dracut_log
+%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
+> $RPM_BUILD_ROOT/etc/system-fips
+%endif
# create compat symlink
mkdir -p $RPM_BUILD_ROOT/sbin
ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf -- $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%else
%{dracutlibdir}/modules.d/00bootchart
%endif
+%{dracutlibdir}/modules.d/00bash
+%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/80cms
+%{dracutlibdir}/modules.d/90bcache
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/99shutdown
-%config(noreplace) %{_sysconfdir}/logrotate.d/dracut_log
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir}
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
%{_prefix}/lib/kernel/install.d/50-dracut.install
-%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
-%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
%files network
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/01fips
%{dracutlibdir}/dracut.conf.d/40-fips.conf
+%config(missingok) /etc/system-fips
%endif
%files fips-aesni
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
-%files nohostonly
+%files config-generic
%defattr(-,root,root,0755)
-%{dracutlibdir}/dracut.conf.d/02-nohostonly.conf
+%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
-%files norescue
+%files config-rescue
%defattr(-,root,root,0755)
-%{dracutlibdir}/dracut.conf.d/02-norescue.conf
+%{dracutlibdir}/dracut.conf.d/02-rescue.conf
+%if 0%{?fedora} || 0%{?rhel} > 6
+%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
+%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
+%endif
%changelog