%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 pkgconfig Summary: Next generation initrd image generator Name: dracut Version: 057 Release: %mkrel 7.1 Group: System/Base # The entire source code is GPLv2+ # except install/* which is LGPLv2+ # except util/* which is GPLv2 License: GPLv2+ and LGPLv2+ and GPLv2 URL: https://dracut.wiki.kernel.org/ # Source can be generated by # https://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz Source0: https://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz Source1: logo.png Source2: https://gitweb.mageia.org/software/mageia-dracut-conf/snapshot/mageia-dracut-conf-6dbd4762fffd7620cf7507fdd76476bf09ccd846.tar.gz # Upstream Cherry picks # Never auto-enable bluetooth module (but it can be manually included # for debugging) - workaround for RHBZ #1964879 / upstream #1521, to # be removed when that is properly fixed Patch0: 0001-Never-enable-the-bluetooth-module-by-default-1521.patch # Suppress error messages when pivoting back to the initramfs (upstream #1925) Patch1: 0002-fix-dracut-initramfs-restore.sh-hide-unpack-errors.patch # fix(i18n): add required includes for keymaps (upstream #1856, mga#31081) Patch2: 0003-fix-i18n-add-required-includes-for-keymaps.patch # Mageia Patches # D=050; git rebase $D; git format-patch --start-number 0500 $D; Patch0501: 0501-Plymouth-customisations-for-Mageia.patch Patch0502: 0502-Use-the-Mageia-naming-for-initrd-files.patch Patch0503: 0503-Handle-upgrades-better.patch Patch0504: 0504-network-Include-70-persistent-net.rules-in-the-netwo.patch Patch0505: 0505-lvm-Ensure-LVM-is-initialised-in-non-hostonly-mode.patch Patch0506: 0506-rootfs-block-Support-lilo-style-device-numbers.patch Patch0507: 0507-i18n-Run-console_init-prior-to-udev-startup.patch Patch0508: 0508-mageia-Add-a-convertfs-hacks-for-packaging-quirks.patch Patch0509: 0509-dracut-init.sh-Make-sure-to-install-full-path-PROGRA.patch Patch0510: 0510-Support-the-simple-upgrade-preparation-API-mga-9744.patch Patch0512: 0512-mgainstaller-Add-a-module-used-to-generate-the-Magei.patch # reported upstream: https://github.com/dracutdevs/dracut/issues/483 Patch0516: 0516-dracut-046-shutdown-fix-early-exit-in-umount-loop.patch # reported upstream: https://github.com/dracutdevs/dracut/issues/481 Patch0517: 0517-Fix-the-pivot-back-to-the-initramfs-on-system-shutdo.patch # fix mga#26726 Patch0518: 0518-Revert-Use-udev-rules-to-create-dmraid-dev-mapper-de.patch # fix mga#28528. This is a reworked version of upstream PR #2160, which doesn't # actually fix the bug (see my comments there). The buggy PR has been merged, so # if it hasn't been fixed before dracut-058 is released, this patch will need to # be rebased, not dropped. Patch0520: 0520-also-consider-resume-in-cmdline-as-enabling-hibernation.patch Patch0600: fix-drakx-with-busybox.patch Patch0601: fix-early-microcode-with-kernels-6.6+.patch Requires(pre): filesystem Requires: udev Requires: util-linux Requires: kmod Requires: e2fsprogs Requires: cpio Requires: coreutils Requires: findutils Requires: grep Requires: mktemp Requires: bash Requires: dash Requires: kbd Requires: tar Requires: gzip Requires: bzip2 Requires: file Requires: kmod Requires: bridge-utils Requires: initscripts Recommends: plymouth Requires: bootloader-utils Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 # (cg) Replace mkinitrd and nuke all it's sub-packages Provides: mkinitrd = 6.0.93-32 Obsoletes: mkinitrd < 6.0.93-32 # plymouth-populate-initrd in old plymouth-scripts packages fails to find # dracut-functions Conflicts: plymouth-scripts < 0.8.4-0.20111214.2 Conflicts: bootsplash < 3.3.9-1 BuildRequires: git-core BuildRequires: kmod-devel >= 23 BuildRequires: systemd-devel BuildRequires: bash-completion BuildRequires: pkgconfig %if %{with doc} BuildRequires: asciidoc BuildRequires: docbook-dtd45-xml BuildRequires: docbook-style-xsl BuildRequires: xsltproc %endif BuildRequires: dash BuildRequires: bash BuildRequires: git %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. %prep %autosetup -a2 -p1 -S git # (cg) We don't want backup file find -name '*.orig' -delete cp -r mageia-dracut-conf*/* ./ %build export CFLAGS="%{optflags}" %configure --libdir=%{_prefix}/lib \ %if %{without doc} --disable-documentation \ %endif ${NULL} %make_build %install %make_install \ sbindir=/sbin \ sysconfdir=%{_sysconfdir} \ systemdsystemunitdir=%{_unitdir} \ mandir=%{_mandir} install -m 644 dracut.conf.d/50-%{_real_vendor}.conf %{buildroot}%{_sysconfdir}/dracut.conf.d install -m 755 -d %{buildroot}%{_datadir}/dracut install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/dracut/logo.png install -m 755 -d %{buildroot}%{_prefix}/lib/systemd/system-shutdown # bluca remove patch backup files find %{buildroot} -name \*.\*.orig -exec rm {} \; # fix permission of module files chmod +x %{buildroot}%{_prefix}/lib/dracut/modules.d/*/*.sh mkdir -p %{buildroot}/boot/dracut mkdir -p %{buildroot}%{_var}/lib/dracut/overlay # (cg) For now provide compatibility symlinks in %_sbindir as this was the old # location for mkinitrd and some tools may hard-code the path mkdir -p %{buildroot}%{_sbindir} ln -sf dracut %{buildroot}%{_bindir}/mkinitrd ln -sf %{_bindir}/mkinitrd %{buildroot}%{_sbindir}/mkinitrd ln -sf dracut.8%{_extension} %{buildroot}%{_mandir}/man8/mkinitrd.8%{_extension} %files %doc README.md AUTHORS NEWS.md dracut.html %dir /boot/dracut %dir %{_datadir}/dracut %dir %{_var}/lib/dracut %dir %{_var}/lib/dracut/overlay %dir %{_prefix}/lib/dracut %config(noreplace) %{_sysconfdir}/dracut.conf %{_datadir}/pkgconfig/dracut.pc %dir %{_sysconfdir}/dracut.conf.d %ghost %attr(644,root,root) %config(noreplace) %{_sysconfdir}/dracut.conf.d/51-mageia-resume.conf %{_sysconfdir}/dracut.conf.d/50-%{_real_vendor}.conf %{_bindir}/dracut %{_bindir}/dracut-catimages %{_bindir}/lsinitrd %{_bindir}/mkinitrd %{_sbindir}/mkinitrd %{_prefix}/lib/dracut/dracut-functions.sh %{_prefix}/lib/dracut/dracut-init.sh %{_prefix}/lib/dracut/dracut-functions %{_prefix}/lib/dracut/dracut-initramfs-restore %{_prefix}/lib/dracut/dracut-install %{_prefix}/lib/dracut/dracut-util %{_prefix}/lib/dracut/dracut-version.sh %{_prefix}/lib/dracut/modules.d %{_prefix}/lib/dracut/dracut-logger.sh %{_prefix}/lib/dracut/skipcpio %{_prefix}/lib/kernel/install.d/50-dracut.install %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %{_unitdir}/*.service %{_unitdir}/*/*.service %{_datadir}/bash-completion/completions/dracut %{_datadir}/bash-completion/completions/lsinitrd %{_datadir}/dracut/logo.png %if %{with doc} %{_mandir}/man1/lsinitrd*.1* %{_mandir}/man8/dracut*.8* %{_mandir}/man8/mkinitrd*.8* %{_mandir}/man7/dracut.bootup.7* %{_mandir}/man7/dracut.cmdline.7* %{_mandir}/man7/dracut.kernel.7* %{_mandir}/man7/dracut.modules.7* %{_mandir}/man5/dracut.conf.5* %endif