airgap/Makefile

51 lines
1.2 KiB
Makefile

VERSION := $(shell git tag --points-at HEAD)
GIT_REF := $(shell git log -1 --format=%H)
GIT_AUTHOR := $(shell git log -1 --format=%an)
GIT_KEY := $(shell git log -1 --format=%GP)
GIT_TIMESTAMP := $(shell git log -1 --format=%cd --date=iso)
.DEFAULT_GOAL :=
.PHONY: default
default: \
out/airgap.iso
.PHONY: vm
vm: vm-bios
.PHONY: vm-bios
vm-bios: out/airgap.iso
qemu-system-x86_64 \
-m 4G \
-machine pc \
-serial stdio \
-usb \
-device sdhci-pci \
-device sd-card,drive=external \
-drive id=external,if=none,format=raw,file=out/sdcard.img \
-cdrom "out/airgap.iso"
.PHONY: vm-efi
vm-efi: out/airgap.iso
qemu-system-x86_64 \
-m 4G \
-machine pc \
-serial stdio \
-bios /usr/share/ovmf/OVMF.fd \
-usb \
-device sdhci-pci \
-device sd-card,drive=external \
-drive id=external,if=none,format=raw,file=out/sdcard.img \
-cdrom "out/airgap.iso"
out/airgap.iso: Containerfile $(shell git ls-files rootfs)
docker build \
--progress=plain \
--output type=local,dest=out \
--build-arg VERSION="$(or $(VERSION),"development")" \
--build-arg GIT_REF="$(GIT_REF)" \
--build-arg GIT_AUTHOR="$(GIT_AUTHOR)" \
--build-arg GIT_KEY="$(GIT_KEY)" \
--build-arg GIT_TIMESTAMP="$(GIT_TIMESTAMP)" \
-f Containerfile \
.