Created
January 12, 2021 17:25
-
-
Save jedahan/1fc9c91bc9ed6cb76fbf145bf7a37cf3 to your computer and use it in GitHub Desktop.
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
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