Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
 kernel.spec | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/kernel.spec b/kernel.spec
index 3a45243c0442..197846f4f834 100755
--- a/kernel.spec
+++ b/kernel.spec
@@ -817,6 +817,7 @@ Source82: update_scripts.sh
 
 Source84: mod-internal.list
 Source85: mod-partner.list
+Source86: dracut-virt.conf
 
 Source100: rheldup3.x509
 Source101: rhelkpatch1.x509
@@ -1296,6 +1297,9 @@ Requires: kernel-core-uname-r = %{KVERREL}\
 %endif\
 %{expand:%%kernel_debuginfo_package %{?1:%{1}}}\
 %endif\
+%package %{?1:%{1}-}initrd-virt\
+Summary: %{variant_summary} initrd for VMs\
+Provides: installonlypkg(kernel)\
 %{nil}
 
 #
@@ -1364,6 +1368,12 @@ Linux operating system.  The kernel handles the basic 
functions
 of the operating system: memory allocation, process allocation, device
 input and output, etc.
 
+%description debug-initrd-virt
+Prebuilt debug kernel initrd for VMs.
+
+%description initrd-virt
+Prebuilt default kernel initrd for VMs.
+
 %if %{with_ipaclones}
 %kernel_ipaclones_package
 %endif
@@ -2131,6 +2141,15 @@ BuildKernel() {
        touch lib/modules/$KernelVer/modules.builtin
     fi
 
+    # pre-generate initrd
+    dracut --conf=%{SOURCE86} \
+           --confdir=$(mktemp -d) \
+           --verbose \
+           --kver "$KernelVer" \
+           --kmoddir lib/modules/$KernelVer \
+           lib/modules/$KernelVer/initrd
+    lsinitrd lib/modules/$KernelVer/initrd
+
     remove_depmod_files
 
     # Go back and find all of the various directories in the tree.  We use this
@@ -3101,6 +3120,8 @@ fi
 %{expand:%%files -f debuginfo%{?3}.list %{?3:%{3}-}debuginfo}\
 %endif\
 %endif\
+%{expand:%%files %{?3:%{3}-}initrd-virt}\
+/lib/modules/%{KVERREL}%{?3:+%{3}}/initrd\
 %if %{?3:1} %{!?3:0}\
 %{expand:%%files %{3}}\
 %endif\
-- 
2.37.2
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to