This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARCH ?= arm64 | |
VERSION ?= 20.10 | |
SPIN ?= live-server | |
vftool ?= ./vftool/build/vftool | |
DATA ?= ./data | |
ISO := ubuntu-$(VERSION)-$(SPIN)-$(ARCH).iso | |
MOUNTPOINT := /Volumes/Ubuntu | |
CD := $(DATA)/$(ISO) | |
IMAGE := $(DATA)/disk.img | |
KERNEL := $(DATA)/vmlinuz | |
INITRD := $(DATA)/initrd | |
.PHONY: run select | |
all: run | |
$(IMAGE): | |
dd if=/dev/zero of=$(IMAGE) bs=1024k count=20480 | |
$(CD): | |
curl -s https://releases.ubuntu.com/$(VERSION)/$(ISO) -o $(CD) | |
$(INITRD): $(MOUNTPOINT)/casper | |
cp $(MOUNTPOINT)/casper/initrd $(DATA)/ | |
$(KERNEL): $(KERNEL).gz | |
gunzip $(KERNEL).gz | |
$(KERNEL).gz: $(MOUNTPOINT)/casper | |
cp $(MOUNTPOINT)/casper/vmlinuz $(KERNEL).gz | |
build/Release/podracer: | |
xcodebuild | |
select: | |
xcode-select --switch /Applications/XCode.app | |
run: $(vftool) $(CD) $(IMAGE) $(KERNEL) $(INITRD) | |
$(vftool) \ | |
-k $(KERNEL) \ | |
-i $(INITRD) \ | |
-d $(IMAGE) \ | |
-c $(CD) \ | |
-m 2048 \ | |
-a "console=hvc0 root=/dev/vda2" | |
$(MOUNTPOINT): | |
sudo mkdir -p $(MOUNTPOINT) | |
$(MOUNTPOINT)/casper: $(MOUNTPOINT) $(CD) | |
sudo umount $(MOUNTPOINT) | |
$(eval DISK := $(shell sudo hdiutil attach -nomount $(CD) | head -n1 | cut -d' ' -f1)) | |
sudo mount -t cd9660 $(DISK) $(MOUNTPOINT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment