Skip to content

Commit ed89fed

Browse files
committed
qemu: add disgusting hacks for RHEL 8
Red Hat does awful things to their kernel for RHEL 8, such that it doesn't even compile in most configurations. This is utter craziness, and their response to me sending patches to fix this stuff has been to stonewall for months on end and then do nothing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 parent fd7a462 commit ed89fed

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/tests/qemu/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ $(KERNEL_PATH)/.installed: $(KERNEL_TAR)
276276
sed -i '/jmp early_idt_handler$$/a .fill early_idt_handlers + i*9 - ., 1, 0xcc' $(KERNEL_PATH)/arch/x86/kernel/head_{64,32}.S || true
277277
printf 'ifdef CONFIG_X86_64\nLDFLAGS += $$(call ld-option, -z max-page-size=0x200000)\nendif\n' >> $(KERNEL_PATH)/arch/x86/Makefile
278278
sed -i 's/^Elf_Addr per_cpu_load_addr;$$/static \0/' $(KERNEL_PATH)/arch/x86/tools/relocs.c || true
279-
if grep -qr UTS_UBUNTU_RELEASE_ABI $(KERNEL_PATH)/debian/rules.d; then echo 'KBUILD_CFLAGS += -DUTS_UBUNTU_RELEASE_ABI=0' >> $(KERNEL_PATH)/Makefile; fi
279+
if grep -sqr UTS_UBUNTU_RELEASE_ABI $(KERNEL_PATH)/debian/rules.d; then echo 'KBUILD_CFLAGS += -DUTS_UBUNTU_RELEASE_ABI=0' >> $(KERNEL_PATH)/Makefile; fi
280+
if grep -sq 'RHEL_MAJOR = 8' $(KERNEL_PATH)/Makefile.rhelver; then \
281+
sed -i '/#include <asm\//a #include <asm\/acpi.h>/' $(KERNEL_PATH)/arch/x86/kernel/{apic/apic.c,irqinit.c,kvm.c,mpparse.c} && \
282+
sed -i '/#include <asm\//a #include <asm\/numa.h>/' $(KERNEL_PATH)/arch/x86/kernel/setup.c && \
283+
sed -i '/irq_hv_callback_count/d' $(KERNEL_PATH)/arch/x86/kernel/kvm.c && \
284+
sed -i '/do_vmm_communication/d' $(KERNEL_PATH)/arch/x86/entry/entry_64.S \
285+
fi
280286
sed -i "/^if INET\$$/a source \"net/wireguard/Kconfig\"" $(KERNEL_PATH)/net/Kconfig
281287
sed -i "/^obj-\$$(CONFIG_NETFILTER).*+=/a obj-\$$(CONFIG_WIREGUARD) += wireguard/" $(KERNEL_PATH)/net/Makefile
282288
ln -sfT $(shell readlink -f ../..) $(KERNEL_PATH)/net/wireguard

0 commit comments

Comments
 (0)