rpm: include kernel headers in modules.img for VM

Distributing kernel-devel built for dom0 to VMs is major PITA, including
problems like copying between different build environments, inability to
install it in Debian etc.
Lets include kernel headers there by default, without any additional
package needed.

Fixes QubesOS/qubes-issues#2692
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-02 21:44:11 +02:00
parent 268a2dd0ec
commit 77f8e8ef6d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 5 additions and 11 deletions

View File

@ -1,14 +1,3 @@
ifeq ($(PACKAGE_SET),dom0)
RPM_SPEC_FILES := kernel.spec
else ifeq ($(PACKAGE_SET),vm)
ifdef UPDATE_REPO
# If DIST_DOM0 defined, copy kernel-devel from there
ifneq ($(DIST_DOM0),)
# Include kernel-devel packages in VM repo - dummy spec file
RPM_SPEC_FILES := kernel-devel.spec
OUTPUT_DIR = pkgs/$(DIST_DOM0)
endif
endif
endif

View File

@ -358,6 +358,11 @@ cp -a %buildroot/lib/modules/%kernelrelease %buildroot%vm_install_dir/modules/
mkdir -p %buildroot%vm_install_dir/modules/firmware
cp -a %buildroot/lib/firmware/%kernelrelease %buildroot%vm_install_dir/modules/firmware/
# Include kernel headers for Qubes VM in "/lib/modules" - so kernel-devel
# package will be unnecessary there, regardless of distribution
rm -f %buildroot%vm_install_dir/modules/%kernelrelease/build
cp -a %buildroot/%src_install_dir %buildroot%vm_install_dir/modules/%kernelrelease/build
# remove files that will be auto generated by depmod at rpm -i time
for i in alias alias.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap
do