From 1e952ab270534db08ec37799eab4f855ebc0b563 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Feb 19 2024 14:03:44 +0000 Subject: Move the kernel-install plugin to a separate mkosi-initrd subpackage - This effectively replaces the standalone mkosi-initrd package. --- diff --git a/mkosi.spec b/mkosi.spec index 90ea838..1e940ad 100644 --- a/mkosi.spec +++ b/mkosi.spec @@ -94,9 +94,17 @@ Mkosi can boot an image via QEMU or systemd-nspawn, or simply start a shell in chroot, burn the image to a device, connect to a running VM via ssh, extract logs and coredumps, and also serve an image over HTTP. -This package also provides a kernel-install plugin which allows mkosi to be used -to build initrds and UKIs. Note that the kernel-install plugin is not enabled -by default and has to be enabled explicitly in /etc/kernel/install.conf. +%package initrd +Summary: Build initrds locally using mkosi +Requires: %{name} = %{version}-%{release} +Requires: (dnf5 or dnf) + +%description initrd +This package provides the plugin for kernel-install to build initrds with +mkosi locally. + +After the package is installed, the plugin can be enabled by writing +'initrd_generator=mkosi-initrd' to '/etc/kernel/install.conf'. %prep %autosetup -p1 @@ -117,7 +125,11 @@ mkdir -p %{buildroot}%{_mandir}/man1 ln -s -t %{buildroot}%{_mandir}/man1/ \ ../../../..%{python3_sitelib}/mkosi/resources/mkosi.1 -install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ kernel-install/50-mkosi.install +# Install the kernel-install plugin +install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ \ + kernel-install/50-mkosi.install +mkdir -p %{buildroot}%{_prefix}/lib/mkosi-initrd +mkdir -p %{buildroot}%{_sysconfdir}/mkosi-initrd %files -f %pyproject_files %license LICENSE @@ -126,6 +138,11 @@ install -Dt %{buildroot}%{_prefix}/lib/kernel/install.d/ kernel-install/50-mkosi %_mandir/man1/mkosi.1* /usr/lib/kernel/install.d/50-mkosi.install +%files initrd +%_prefix/lib/kernel/install.d/50-mkosi.install +%ghost %dir %{_prefix}/lib/mkosi-initrd +%ghost %dir %{_sysconfdir}/mkosi-initrd + %check %if %{with tests} %pytest tests/ -v