# Builds either a recovery image (Monterey-recovery.img) or a full installer (Monterey-full.img) for Monterey. # To build the full installer you must run this on macOS. # The recovery can be built on either macOS or Linux. # For Ubuntu (or similar Linux distribution) you'll need to run this first to get the required packages: # sudo apt install qemu-utils make # For macOS you'll probably need to run xcode-select --install to get the commandline tools MONTEREY_APP=/Applications/Install\ macOS\ Monterey.app LINUX_TOOLS = qemu-img OS := UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) OS = MACOS endif # If this is Linux make sure we have all our build tools available: ifeq ($(OS),) K := $(foreach exec,$(LINUX_TOOLS),\ $(if $(shell which $(exec)),some string,$(error "Missing required $(exec) tool for build"))) endif all: Monterey-recovery.img %.img : %.dmg ln $< $@ || cp $< $@ ifeq ($(OS),MACOS) Monterey-full.dmg : $(MONTEREY_APP) hdiutil create -o "$@" -size 14g -layout GPTSPUD -fs HFS+J hdiutil attach -noverify -mountpoint /Volumes/install_build "$@" sudo "$