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