EDK2 firmware files are large and very sparse ROM images.
The set currently borders 200M.

AFAIK, QEMU can't load compressed raw firmware files.
So add the possibility to drop EDK2 in case it's unused.

Signed-off-by: Christian Melki <[email protected]>
---
 rules/qemu.in   | 8 ++++++++
 rules/qemu.make | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/rules/qemu.in b/rules/qemu.in
index eb689a188..30f1cc2f5 100644
--- a/rules/qemu.in
+++ b/rules/qemu.in
@@ -62,6 +62,14 @@ config QEMU_TOOLS
        help
          Say y here to include tools.
 
+config QEMU_EDK2_FIRMWARE
+       bool
+       prompt "Enable edk2 firmware"
+       default y
+       help
+         Say n here to drop the edk2 (UEFI) firmware files.
+         They can be substantial in size (> 100M).
+
 config QEMU_SYS
        bool
        prompt "system emulation"
diff --git a/rules/qemu.make b/rules/qemu.make
index beaf1759c..fad87903f 100644
--- a/rules/qemu.make
+++ b/rules/qemu.make
@@ -235,11 +235,13 @@ ifneq ($(filter i386 x86_64,$(QEMU_TARGETS)),)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/bios-256k.bin)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/bios-microvm.bin)
        @$(call install_copy, qemu, 0, 0, 0644, -, /usr/share/qemu/bios.bin)
+ifdef PTXCONF_QEMU_EDK2_FIRMWARE
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-i386-code.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-i386-secure-code.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-i386-vars.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-x86_64-code.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-x86_64-secure-code.fd)
+endif
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/linuxboot.bin)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/linuxboot_dma.bin)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/pxe-e1000.rom)
@@ -257,9 +259,11 @@ ifneq ($(filter i386 x86_64,$(QEMU_TARGETS)),)
 endif
 
 ifneq ($(filter arm aarch64,$(QEMU_TARGETS)),)
+ifdef PTXCONF_QEMU_EDK2_FIRMWARE
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-aarch64-code.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-arm-code.fd)
        @$(call install_copy, qemu, 0, 0, 0644, -, 
/usr/share/qemu/edk2-arm-vars.fd)
+endif
        @$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware, *arm*,)
        @$(call install_glob, qemu, 0, 0, -, /usr/share/qemu/firmware, 
*aarch64*,)
 endif
-- 
2.30.2


_______________________________________________
ptxdist mailing list
[email protected]
To unsubscribe, send a mail with subject "unsubscribe" to 
[email protected]

Reply via email to