Create macOS VMs with OpenCore embedded in the EFI partition of disk.qcow2
instead of using a separate OpenCore.qcow2 file. This simplifies VM management
by reducing from two disk images to one.
Implementation:
- Add create_macos_disk_with_opencore() using mtools/sgdisk for cross-platform
EFI partition creation without mounting or root privileges
- Add download_opencore() to extract OpenCore files from OSX-KVM image
- Use LC_ALL='' with mcopy to prevent FAT directory name mangling
- Adjust disk size threshold for macOS integrated mode (1GB vs 1.5MB)
Backwards compatibility:
- If OpenCore.qcow2 exists, use legacy two-disk boot method
- If mtools/sgdisk unavailable, fall back to legacy method automatically
New dependencies: mtools, gptfdisk (added to devshell.nix and package.nix)
Closes#1720
Nix's qemu_full bundles EDK2 firmware with different filenames than
quickemu expects. Add darwin-specific sed patterns to:
- Set SHARE_PATH to qemu_full's share directory
- Prepend correct firmware paths (edk2-x86_64-code.fd, edk2-i386-vars.fd)
to the ovmfs search array
- Refresh flake.nix inputs and pins to align with current upstream
- Update devshell.nix to use revised development environment packages
- Adjust package.nix to match dependency and tooling changes from the
flake update
- Keep reproducible builds and developer tooling current
Signed-off-by: Martin Wimpress <martin@wimpress.org>