Skip to content

Instantly share code, notes, and snippets.

@jedahan
Created January 12, 2021 17:27
Show Gist options
  • Save jedahan/06f0ac8e8a978524762d2f1d25e8a289 to your computer and use it in GitHub Desktop.
Save jedahan/06f0ac8e8a978524762d2f1d25e8a289 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 $(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