Skip to content

Instantly share code, notes, and snippets.

@jedahan
Created January 12, 2021 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedahan/1fc9c91bc9ed6cb76fbf145bf7a37cf3 to your computer and use it in GitHub Desktop.
Save jedahan/1fc9c91bc9ed6cb76fbf145bf7a37cf3 to your computer and use it in GitHub Desktop.
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 $(ISO) \
-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