Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
VERSION=20.10
ISO=ubuntu-$(VERSION)-desktop-amd64.iso
MOUNTPOINT=/Volumes/Ubuntu
DATA ?= ./data
IMAGE ?= $(DATA)/$(ISO)
KERNEL ?= $(DATA)/vmlinuz
INITRD ?= $(DATA)/initrd
vftool ?= ./vftool/build/vftool
.PHONY: run select
all: run
$(IMAGE):
curl -s https://releases.ubuntu.com/$(VERSION)/$(ISO) -o $(IMAGE)
$(INITRD): $(MOUNTPOINT)/casper
cp $(MOUNTPOINT)/casper/initrd $(DATA)/
$(KERNEL): $(MOUNTPOINT)/casper
cp $(MOUNTPOINT)/casper/vmlinuz $(DATA)/
build/Release/podracer:
xcodebuild
select:
xcode-select --switch /Applications/XCode.app
run: $(vftool) $(IMAGE) $(KERNEL) $(INITRD)
$(vftool) \
-k $(KERNEL) \
-i $(INITRD) \
-d $(IMAGE) \
-m 4096
-a "console=hvc0 root=/dev/vda1"
$(MOUNTPOINT):
sudo mkdir -p $(MOUNTPOINT)
$(MOUNTPOINT)/casper: $(MOUNTPOINT) $(IMAGE)
$(eval DISK := $(shell sudo hdiutil attach -nomount $(IMAGE) | 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