# Shell snippet: copy an OpenCore ESP (makeOpenCore output) into the EFI System # Partition of a macOS qcow2 so the image boots standalone with plain OVMF. # libguestfs follows qcow2 backing chains and writes into the top overlay. { pkgs, lib, ... }: { esp, image }: '' echo "=== vmix: installing OpenCore into the ESP of ${image} ===" ESP_DEV=$(guestfish --ro -a ${image} run : list-filesystems | awk -F': ' '$2 == "vfat" {print $1; exit}') [ -n "$ESP_DEV" ] || { echo "vmix: no FAT EFI partition found in ${image}"; guestfish --ro -a ${image} run : list-filesystems; exit 1; } guestfish -a ${image} -m "$ESP_DEV" <