[PATCH 3/3] [testing] add a kernel-unified-virt sub-RPM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Daniel P. Berrangé <berrange@xxxxxxxxxx>

This sub package contains a unified kernel/initrd/cmdline
image as an EFI binary, targetting booting of virtual
machines.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 kernel.spec | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/kernel.spec b/kernel.spec
index 197846f4f834..a7129a9b98c5 100755
--- a/kernel.spec
+++ b/kernel.spec
@@ -88,6 +88,12 @@ Summary: The Linux kernel
 %global zipmodules 1
 %endif
 
+%ifarch x86_64
+%global efiunified 1
+%else
+%global efiunified 0
+%endif
+
 %if %{zipmodules}
 %global zipsed -e 's/\.ko$/\.ko.xz/'
 # for parallel xz processes, replace with 1 to go back to single process
@@ -690,6 +696,14 @@ BuildRequires: llvm
 BuildRequires: lld
 %endif
 
+%if %{efiunified}
+BuildRequires: dracut
+# For dracut UEFI unified binaries
+BuildRequires: binutils
+# For the initrd
+BuildRequires: lvm2
+%endif
+
 # Because this is the kernel, it's hard to get a single upstream URL
 # to represent the base without needing to do a bunch of patching. This
 # tarball is generated from a src-git tree. If you want to see the
@@ -1300,6 +1314,11 @@ Requires: kernel-core-uname-r = %{KVERREL}\
 %package %{?1:%{1}-}initrd-virt\
 Summary: %{variant_summary} initrd for VMs\
 Provides: installonlypkg(kernel)\
+%if %{efiunified}\
+%package %{?1:%{1}-}unified-virt\
+Summary: %{variant_summary} unified kernel/initrd for VMs\
+Provides: installonlypkg(kernel)\
+%endif\
 %{nil}
 
 #
@@ -1374,6 +1393,14 @@ Prebuilt debug kernel initrd for VMs.
 %description initrd-virt
 Prebuilt default kernel initrd for VMs.
 
+%if %{efiunified}
+%description debug-unified-virt
+Prebuilt debug unified kernel/initrd for VMs.
+
+%description unified-virt
+Prebuilt default unified kernel/initrd for VMs.
+%endif
+
 %if %{with_ipaclones}
 %kernel_ipaclones_package
 %endif
@@ -2150,6 +2177,19 @@ BuildKernel() {
            lib/modules/$KernelVer/initrd
     lsinitrd lib/modules/$KernelVer/initrd
 
+%if %{efiunified}
+    # pre-generate unified kernel/initrd
+    dracut --conf=%{SOURCE86} \
+           --confdir=$(mktemp -d) \
+           --verbose \
+           --uefi \
+           --kernel-image `pwd`/lib/modules/$KernelVer/vmlinuz \
+           --kernel-cmdline 'console=ttyS0 console=tty0' \
+           --kver "$KernelVer" \
+           --kmoddir lib/modules/$KernelVer \
+           lib/modules/$KernelVer/vmlinuz.efi
+%endif
+
     remove_depmod_files
 
     # Go back and find all of the various directories in the tree.  We use this
@@ -3122,6 +3162,10 @@ fi
 %endif\
 %{expand:%%files %{?3:%{3}-}initrd-virt}\
 /lib/modules/%{KVERREL}%{?3:+%{3}}/initrd\
+%if %{efiunified}\
+%{expand:%%files %{?3:%{3}-}unified-virt}\
+/lib/modules/%{KVERREL}%{?3:+%{3}}/%{?-k:%{-k*}}%{!?-k:vmlinuz.efi}\
+%endif\
 %if %{?3:1} %{!?3:0}\
 %{expand:%%files %{3}}\
 %endif\
-- 
2.37.2
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux