Browse Source

Makefile: install the edk2 firmware images and their descriptors

Decompress and install the edk2 firmware blobs as part of "make install",
unless blob installation was disabled with configure's "--disable-blobs"
option.

Additionally, decompress the blobs as a pre-requisite for building softmmu
binaries -- this is helpful for both "make check" and other ad-hoc tests
one might want to run in the build directory.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Philippe Mathieu-Daud <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Philippe Mathieu-Daud <philmd@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
master
Laszlo Ersek 3 months ago
parent
commit
26ce90fde5
3 changed files with 30 additions and 1 deletions
  1. 1
    0
      .gitignore
  2. 28
    1
      Makefile
  3. 1
    0
      configure

+ 1
- 0
.gitignore View File

@@ -97,6 +97,7 @@
97 97
 *.gcno
98 98
 *.gcov
99 99
 /pc-bios/bios-pq/status
100
+/pc-bios/edk2-*.fd
100 101
 /pc-bios/vgabios-pq/status
101 102
 /pc-bios/optionrom/linuxboot.asm
102 103
 /pc-bios/optionrom/linuxboot.bin

+ 28
- 1
Makefile View File

@@ -296,6 +296,10 @@ ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile
296 296
 $(KEYCODEMAP_GEN): .git-submodule-status
297 297
 $(KEYCODEMAP_CSV): .git-submodule-status
298 298
 
299
+edk2-decompressed = $(basename $(wildcard pc-bios/edk2-*.fd.bz2))
300
+pc-bios/edk2-%.fd: pc-bios/edk2-%.fd.bz2
301
+	$(call quiet-command,bzip2 -d -c $< > $@,"BUNZIP2",$<)
302
+
299 303
 # Don't try to regenerate Makefile or configure
300 304
 # We don't generate any of them
301 305
 Makefile: ;
@@ -445,6 +449,7 @@ $(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
445 449
 $(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
446 450
 $(SOFTMMU_SUBDIR_RULES): $(io-obj-y)
447 451
 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
452
+$(SOFTMMU_SUBDIR_RULES): $(edk2-decompressed)
448 453
 
449 454
 subdir-%:
450 455
 	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
@@ -633,6 +638,7 @@ clean:
633 638
 		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
634 639
 		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
635 640
 		-exec rm {} +
641
+	rm -f $(edk2-decompressed)
636 642
 	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
637 643
 	rm -f fsdev/*.pod scsi/*.pod
638 644
 	rm -f qemu-img-cmds.h
@@ -723,9 +729,14 @@ spapr-rtas.bin slof.bin skiboot.lid \
723 729
 palcode-clipper \
724 730
 u-boot.e500 u-boot-sam460-20100605.bin \
725 731
 qemu_vga.ndrv \
732
+edk2-licenses.txt \
726 733
 hppa-firmware.img
734
+
735
+DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \
736
+60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json
727 737
 else
728 738
 BLOBS=
739
+DESCS=
729 740
 endif
730 741
 
731 742
 # Note that we manually filter-out the non-Sphinx documentation which
@@ -786,7 +797,8 @@ endif
786 797
 
787 798
 ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
788 799
 
789
-install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir
800
+install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir \
801
+	$(if $(INSTALL_BLOBS),$(edk2-decompressed))
790 802
 ifneq ($(TOOLS),)
791 803
 	$(call install-prog,$(subst qemu-ga,qemu-ga$(EXESUF),$(TOOLS)),$(DESTDIR)$(bindir))
792 804
 endif
@@ -808,6 +820,21 @@ ifneq ($(BLOBS),)
808 820
 	set -e; for x in $(BLOBS); do \
809 821
 		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \
810 822
 	done
823
+endif
824
+ifdef INSTALL_BLOBS
825
+	set -e; for x in $(edk2-decompressed); do \
826
+		$(INSTALL_DATA) $$x "$(DESTDIR)$(qemu_datadir)"; \
827
+	done
828
+endif
829
+ifneq ($(DESCS),)
830
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/firmware"
831
+	set -e; tmpf=$$(mktemp); trap 'rm -f -- "$$tmpf"' EXIT; \
832
+	for x in $(DESCS); do \
833
+		sed -e 's,@DATADIR@,$(DESTDIR)$(qemu_datadir),' \
834
+			"$(SRC_PATH)/pc-bios/descriptors/$$x" > "$$tmpf"; \
835
+		$(INSTALL_DATA) "$$tmpf" \
836
+			"$(DESTDIR)$(qemu_datadir)/firmware/$$x"; \
837
+	done
811 838
 endif
812 839
 	for s in $(ICON_SIZES); do \
813 840
 		mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps"; \

+ 1
- 0
configure View File

@@ -7892,6 +7892,7 @@ for bios_file in \
7892 7892
     $source_path/pc-bios/*.img \
7893 7893
     $source_path/pc-bios/openbios-* \
7894 7894
     $source_path/pc-bios/u-boot.* \
7895
+    $source_path/pc-bios/edk2-*.fd.bz2 \
7895 7896
     $source_path/pc-bios/palcode-*
7896 7897
 do
7897 7898
     LINKS="$LINKS pc-bios/$(basename $bios_file)"

Loading…
Cancel
Save