Refactor build_artifacts.sh and makefile
- Move everything to .data, .vendor, .artifacts and .bin in order to cleanly separate build input and output.
- Sprinkle some subshells on build_artifacts.sh to make it fail more gracefully.
- Fix fetch_third_party.sh check.
- GOBUILD make helper.
- Dockerfile with build dependencies.
Test Plan:
Ran `make clean` and build steps described in README.md, it boots:
{P84}
X-Origin-Diff: phab/D195
GitOrigin-RevId: 4106534c7248931b79e93e2a13153482033cd0d8
diff --git a/scripts/launch.sh b/scripts/launch.sh
index 7170bca..aad121f 100755
--- a/scripts/launch.sh
+++ b/scripts/launch.sh
@@ -1,18 +1,19 @@
#!/bin/sh
-swtpm socket --tpmstate dir=$PWD/vm/tpm --ctrl type=unixio,path=$PWD/vm/tpm/swtpm-sock --tpm2 &
+swtpm socket --tpmstate dir=$PWD/.data/tpm --ctrl type=unixio,path=$PWD/.data/swtpm-sock --tpm2 &
-qemu-system-x86_64 -cpu host -smp sockets=1,cpus=1,cores=2,threads=2,maxcpus=4 -m 1024 -machine q35 -enable-kvm -nographic -nodefaults \
- -drive if=pflash,format=raw,readonly,file=$PWD/third_party/edk2/Build/OvmfX64/RELEASE_GCC5/FV/OVMF_CODE.fd \
- -drive if=pflash,format=raw,snapshot=on,file=$PWD/third_party/edk2/Build/OvmfX64/RELEASE_GCC5/FV/OVMF_VARS.fd \
- -drive if=virtio,format=raw,cache=unsafe,file=$PWD/vm/smalltown.img \
+qemu-system-x86_64 \
+ -cpu host -smp sockets=1,cpus=1,cores=2,threads=2,maxcpus=4 -m 1024 -machine q35 -enable-kvm -nographic -nodefaults \
+ -drive if=pflash,format=raw,readonly,file=$PWD/.artifacts/OVMF_CODE.fd \
+ -drive if=pflash,format=raw,snapshot=on,file=$PWD/.artifacts/OVMF_VARS.fd \
+ -drive if=virtio,format=raw,cache=unsafe,file=$PWD/.data/smalltown.img \
-netdev user,id=net0,hostfwd=tcp::7833-:7833,hostfwd=tcp::7834-:7834 \
-device virtio-net-pci,netdev=net0 \
- -chardev socket,id=chrtpm,path=$PWD/vm/tpm/swtpm-sock \
+ -chardev socket,id=chrtpm,path=$PWD/.data/swtpm-sock \
-tpmdev emulator,id=tpm0,chardev=chrtpm \
-device tpm-tis,tpmdev=tpm0 \
- -debugcon file:vm/debug.log \
+ -debugcon file:.data/debug.log \
-global isa-debugcon.iobase=0x402 \
-device ipmi-bmc-sim,id=ipmi0 \
-device virtio-rng-pci \
- -serial mon:stdio
\ No newline at end of file
+ -serial mon:stdio