Skip to content

Commit

Permalink
OS-7117 deliver uefi-rom.bin for bhyve
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gerdts committed Aug 13, 2018
1 parent acb69d7 commit feefa41
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions uefi-edk2/Makefile
Expand Up @@ -34,8 +34,13 @@ MAKE_ARGS+= AS=$(STRAPPROTO)/usr/gnu/bin/gas \
ARCH= X64
UEFI_TARGET= RELEASE

ROMS= uefi uefi-csm

all: $(VER.64)/$(UNPACK_SENTINEL)
.NOTPARALLEL: $(ROMS) csm16

all: $(ROMS)

basetools: $(VER.64)/$(UNPACK_SENTINEL)
mkdir -p $(VER.64)/Build
ln -sf $(STRAPPROTO)/usr/bin/gcc $(VER.64)/Build/gcc
ln -sf $(STRAPPROTO)/usr/gnu/bin/gld $(VER.64)/Build/ld
Expand All @@ -44,11 +49,30 @@ all: $(VER.64)/$(UNPACK_SENTINEL)
ln -sf $(STRAPPROTO)/usr/gnu/bin/gobjcopy $(VER.64)/Build/objcopy
ln -sf /opt/local/bin/nasm $(VER.64)/Build/nasm
$(MAKE) $(MAKE_ARGS) ARCH=$(ARCH) -C $(VER.64)/BaseTools
bash -c "cd $(VER.64); source edksetup.sh; $(MAKE) $(MAKE_ARGS) ARCH=$(ARCH) -C BhyvePkg/Csm/BhyveCsm16"
bash -c "cd $(VER.64); source edksetup.sh; export ILGCC_BIN=$(PWD)/$(VER.64)/Build/; build -t ILGCC -a $(ARCH) -b $(UEFI_TARGET) -p BhyvePkg/BhyvePkgX64.dsc -DDEBUG_ON_SERIAL_PORT=TRUE -DFD_SIZE_2MB -DCSM_ENABLE=TRUE"
mv $(VER.64)/Build/BhyveX64/RELEASE_ILGCC/FV/BHYVE.fd $(VER.64)/Build/BhyveX64/RELEASE_ILGCC/FV/uefi-csm-rom.bin

csm16:
bash -c "cd $(VER.64); \
source edksetup.sh; \
$(MAKE) $(MAKE_ARGS) ARCH=$(ARCH) -C BhyvePkg/Csm/BhyveCsm16"

uefi-csm: csm16

$(ROMS): basetools
rm -rf $(VER.64)/Build/BhyveX64
bash -c 'cd $(VER.64); \
source edksetup.sh; \
export ILGCC_BIN=$(PWD)/$(VER.64)/Build/; \
[[ $@ == uefi-csm ]] && extra_cflags=-DCSM_ENABLE=TRUE; \
build -t ILGCC -a $(ARCH) -b $(UEFI_TARGET) \
-p BhyvePkg/BhyvePkgX64.dsc \
-DDEBUG_ON_SERIAL_PORT=TRUE -DFD_SIZE_1MB \
$${extra_cflags}'
mv $(VER.64)/Build/BhyveX64/RELEASE_ILGCC/FV/BHYVE.fd \
$(VER.64)/Build/$@-rom.bin

install: all
mkdir -p $(DESTDIR)/usr/share/bhyve
/usr/sbin/install -m 0755 -f $(DESTDIR)/usr/share/bhyve $(VER.64)/Build/BhyveX64/RELEASE_ILGCC/FV/uefi-csm-rom.bin

for rom in $(ROMS); do \
/usr/sbin/install -m 0755 -f $(DESTDIR)/usr/share/bhyve \
$(VER.64)/Build/$$rom-rom.bin; \
done

0 comments on commit feefa41

Please sign in to comment.