-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
executable file
·27 lines (25 loc) · 1.01 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/env bash
if [ $(hostname) != "nas" ]; then
echo THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY\!
return 1
fi
export WORKSPACE=$PWD
export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/edk2
source edk2/edksetup.sh
build -a X64 -b RELEASE -t GCC5 -p MosbyPkg.dsc
cp Build/RELEASE_GCC5/X64/Mosby.efi image
# QEMU execution is much faster when '-enable-kvm -cpu host' can be used. However this requires root
if [ "$EUID" -eq 0 ]; then
CPU_OPT="-enable-kvm -cpu host"
else
# EDK2's OpenSSL implementation requires IvyBridge or later to function for RDRAND
CPU_OPT="-cpu IvyBridge"
fi
# DISABLED = SecureBoot=0, SetupMode=0
# SETUP = SecureBoot=0, SetupMode=1
SB_MODE=SETUP
cp OVMF_VARS_4M.secboot.$SB_MODE.fd OVMF_VARS_4M.secboot.fd
export QEMU_CMD="qemu-system-x86_64 $CPU_OPT -m 1024 -M q35 -L . \
-drive if=pflash,format=raw,unit=0,file=OVMF_CODE_4M.secboot.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS_4M.secboot.fd \
-drive format=raw,file=fat:rw:image -nodefaults -nographic -serial stdio -net none"