2018-01-26 16:27:20 +00:00
|
|
|
#
|
|
|
|
# Specific targets and things for the qemu "mainboard"
|
|
|
|
#
|
|
|
|
# The ROM image is generated from the edk2 build in the main directory
|
|
|
|
# as part of the "OVMF" package.
|
|
|
|
#
|
|
|
|
# This pulls that image apart and inserts the Linux kernel and Initrd
|
2018-01-26 22:08:20 +00:00
|
|
|
# The ROM layout is:
|
|
|
|
# 0x000000.fv NVRAM
|
|
|
|
# 0x084000.fv FV (DXE and PEI)
|
|
|
|
# 0.fv PEI
|
|
|
|
# 1.fv DXE
|
|
|
|
# 0x7cc000.fv SEC
|
2018-01-26 16:27:20 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2018-01-26 22:08:20 +00:00
|
|
|
linuxboot-size := 0x800000
|
2018-01-26 16:27:20 +00:00
|
|
|
|
2018-01-26 22:08:20 +00:00
|
|
|
fv-path := boards/$(BOARD)/rom/0x00084000/9e21fd93-9c72-4c15-8c4b-e77f1db2d792
|
|
|
|
dxe-path := $(fv-path)/1
|
2018-01-26 16:27:20 +00:00
|
|
|
|
2018-01-26 22:08:20 +00:00
|
|
|
vendor-files := $(shell awk \
|
|
|
|
'/^[0-9A-Fa-f]/ {print "$(dxe-path)/"$$1".ffs"}' \
|
|
|
|
boards/$(BOARD)/image-files.txt \
|
|
|
|
)
|
|
|
|
|
|
|
|
# All of the output volumes depend on extracting the firmware
|
|
|
|
boards/$(BOARD)/rom/0x00000000.fv \
|
|
|
|
boards/$(BOARD)/rom/0x00084000.fv \
|
|
|
|
boards/$(BOARD)/rom/0x007cc000.fv \
|
|
|
|
: extract.intermediate
|
|
|
|
|
|
|
|
$(BUILD)/linuxboot.rom: \
|
|
|
|
boards/$(BOARD)/rom/0x00000000.fv \
|
|
|
|
$(BUILD)/merged.vol \
|
|
|
|
boards/$(BOARD)/rom/0x007cc000.fv \
|
|
|
|
|
|
|
|
|
|
|
|
$(BUILD)/merged.vol: \
|
|
|
|
$(fv-path)/0.fv \
|
|
|
|
$(BUILD)/dxe.vol \
|
|
|
|
|
|
|
|
./bin/create-ffs \
|
|
|
|
--compress \
|
|
|
|
--type FIRMWARE_VOLUME_IMAGE \
|
|
|
|
$^ \
|
|
|
|
| ./bin/create-fv \
|
|
|
|
--size 0x748000 \
|
|
|
|
-o $@
|
|
|
|
|
|
|
|
|
|
|
|
dxe-size := 0xe00000
|
|
|
|
$(BUILD)/dxe.vol: \
|
|
|
|
$(BUILD)/DxeCore.ffs \
|
|
|
|
$(vendor-files) \
|
|
|
|
$(BUILD)/Linux.ffs \
|
|
|
|
$(BUILD)/Initrd.ffs \
|
|
|
|
|
|
|
|
$(vendor-files): extract.intermediate
|
|
|
|
extract.intermediate: boards/$(BOARD)/$(BOARD).rom
|
|
|
|
( \
|
2018-01-26 16:27:20 +00:00
|
|
|
cd boards/$(BOARD) ; \
|
2018-01-26 22:08:20 +00:00
|
|
|
$(pwd)/bin/extract-firmware \
|
|
|
|
-o rom \
|
|
|
|
| tee $(BOARD).txt ; \
|
|
|
|
) < $^ \
|
|
|
|
|
|
|
|
.INTERMEDIATE: extract.intermediate
|
2018-01-26 16:27:20 +00:00
|
|
|
|
|
|
|
boards/$(BOARD)/$(BOARD).rom: edk2/.git
|
|
|
|
( cd edk2/OvmfPkg ; ./build.sh )
|
|
|
|
cp edk2/Build/OvmfX64/DEBUG_GCC5/FV/OVMF.fd $@
|
2018-01-26 22:08:20 +00:00
|
|
|
|