linuxboot/boards/qemu/Makefile.board

74 lines
1.7 KiB
Makefile
Raw Normal View History

#
# 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
#
#
dxe-size := 0xA00000
merged-size := 0x748000
fv-path := $(BUILD)/rom/0x00084000/9e21fd93-9c72-4c15-8c4b-e77f1db2d792
2018-01-26 22:08:20 +00:00
dxe-path := $(fv-path)/1
dxe-files := $(shell awk \
2018-01-26 22:08:20 +00:00
'/^[0-9A-Fa-f]/ {print "$(dxe-path)/"$$1".ffs"}' \
boards/$(BOARD)/image-files.txt \
)
# since the 0.fv is nested inside another FV, we have to add an
# explicit dependency on the extract target to ensure that it is created
$(fv-path)/0.fv: $(BUILD)/$(BOARD).txt
@true
FVS := \
$(BUILD)/rom/0x00000000.fv \
2018-01-26 22:08:20 +00:00
$(BUILD)/merged.vol \
$(BUILD)/rom/0x007cc000.fv \
2018-01-26 22:08:20 +00:00
$(BUILD)/merged.vol: \
$(fv-path)/0.fv \
$(BUILD)/dxe.vol \
./bin/create-ffs \
--compress \
--type FIRMWARE_VOLUME_IMAGE \
$^ \
| ./bin/create-fv \
--size $(merged-size) \
2018-01-26 22:08:20 +00:00
-o $@
$(BUILD)/dxe.vol: \
$(BUILD)/DxeCore.ffs \
$(dxe-files) \
./dxe/linuxboot.ffs \
2018-01-26 22:08:20 +00:00
$(BUILD)/Linux.ffs \
$(BUILD)/Initrd.ffs \
# We can build a firmware image from edk2
# it is not necessary to provide one
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
# We can also launch a qemu with the LinuxBoot kernel
run: $(BUILD)/linuxboot.rom
-qemu-system-x86_64 \
-machine q35,smm=on \
-global ICH9-LPC.disable_s3=1 \
-global driver=cfi.pflash01,property=secure,value=on \
--serial $(or $(SERIAL),stdio) \
-drive if=pflash,format=raw,unit=0,file=$<
stty sane