@@ -915,32 +915,21 @@ function configure_bios() {
915915 fi
916916
917917 # Check for OpenCore bootloader
918- # Backwards compatibility: If OpenCore.qcow2 exists, use legacy two-disk boot method
919- # If OpenCore.qcow2 is absent, assume OpenCore is integrated in the main disk
920918 if [ -e " ${VMDIR} /OpenCore.qcow2" ]; then
921919 MAC_BOOTLOADER=" ${VMDIR} /OpenCore.qcow2"
922- MAC_BOOT_MODE=" legacy"
923920 elif [ -e " ${VMDIR} /ESP.qcow2" ]; then
924921 # Backwards compatibility for Clover
925922 MAC_BOOTLOADER=" ${VMDIR} /ESP.qcow2"
926- MAC_BOOT_MODE=" legacy"
927923 else
928- # New method: OpenCore is integrated in the main disk's EFI partition
929- # No separate bootloader file needed
930- MAC_BOOTLOADER=" "
931- MAC_BOOT_MODE=" integrated"
924+ MAC_MISSING=" Bootloader"
932925 fi
933926
934927 if [ -n " ${MAC_MISSING} " ]; then
935928 echo " ERROR! macOS ${MAC_MISSING} was not found."
936929 echo " Use 'quickget' to download the required files."
937930 exit 1
938931 fi
939- if [ " ${MAC_BOOT_MODE} " == " integrated" ]; then
940- BOOT_STATUS=" EFI (macOS), OVMF ($( basename " ${EFI_CODE} " ) ), OpenCore (integrated), SecureBoot (${secureboot} )."
941- else
942- BOOT_STATUS=" EFI (macOS), OVMF ($( basename " ${EFI_CODE} " ) ), SecureBoot (${secureboot} )."
943- fi
932+ BOOT_STATUS=" EFI (macOS), OVMF ($( basename " ${EFI_CODE} " ) ), SecureBoot (${secureboot} )."
944933 elif [[ " ${boot} " == * " efi" * ]]; then
945934 EFI_VARS=" ${VMDIR} /OVMF_VARS.fd"
946935
@@ -1182,15 +1171,7 @@ function configure_storage() {
11821171 # Only check disk image size if preallocation is off
11831172 if [ " ${preallocation} " == " off" ]; then
11841173 DISK_CURR_SIZE=$( ${STAT} -c%s " ${disk_img} " )
1185- # For macOS with integrated OpenCore, the disk is pre-created with an EFI
1186- # partition containing OpenCore (~500MB). Use a higher threshold (1GB) to
1187- # distinguish between "just EFI" and "EFI + installed macOS".
1188- if [ " ${guest_os} " == " macos" ] && [ " ${MAC_BOOT_MODE} " == " integrated" ]; then
1189- DISK_MIN_SIZE_CHECK=$(( 1024 * 1024 * 1024 ))
1190- else
1191- DISK_MIN_SIZE_CHECK=" ${DISK_MIN_SIZE} "
1192- fi
1193- if [ " ${DISK_CURR_SIZE} " -le " ${DISK_MIN_SIZE_CHECK} " ]; then
1174+ if [ " ${DISK_CURR_SIZE} " -le " ${DISK_MIN_SIZE} " ]; then
11941175 echo " Looks unused, booting from ${iso}${img} "
11951176 if [ -z " ${iso} " ] && [ -z " ${img} " ]; then
11961177 echo " ERROR! You haven't specified a .iso or .img image to boot from."
@@ -1608,7 +1589,6 @@ function vm_boot() {
16081589 OS_RELEASE=" Unknown OS"
16091590 MACHINE_TYPE=" ${MACHINE_TYPE:- q35} "
16101591 MAC_BOOTLOADER=" "
1611- MAC_BOOT_MODE=" "
16121592 MAC_MISSING=" "
16131593 MAC_DISK_DEV=" ${MAC_DISK_DEV:- ide-hd,bus=ahci.2} "
16141594 NET_DEVICE=" ${NET_DEVICE:- virtio-net-pci} "
@@ -1973,36 +1953,19 @@ function vm_boot() {
19731953
19741954 if [ " ${guest_os} " == " macos" ]; then
19751955 # shellcheck disable=SC2054
1976- args+=(-device ahci,id=ahci)
1956+ args+=(-device ahci,id=ahci
1957+ -device ide-hd,bus=ahci.0,drive=BootLoader,bootindex=0
1958+ -drive id=BootLoader,if=none,format=qcow2,file=" ${MAC_BOOTLOADER} " )
19771959
1978- if [ -n " ${MAC_BOOTLOADER} " ]; then
1979- # Legacy mode: boot from separate OpenCore.qcow2
1960+ if [ -n " ${img} " ]; then
19801961 # shellcheck disable=SC2054
1981- args+=(-device ide-hd,bus=ahci.0,drive=BootLoader,bootindex=0
1982- -drive id=BootLoader,if=none,format=qcow2,file=" ${MAC_BOOTLOADER} " )
1983-
1984- if [ -n " ${img} " ]; then
1985- # shellcheck disable=SC2054
1986- args+=(-device ide-hd,bus=ahci.1,drive=RecoveryImage
1987- -drive id=RecoveryImage,if=none,format=raw,file=" ${img} " )
1988- fi
1989-
1990- # shellcheck disable=SC2054,SC2206
1991- args+=(-device ${MAC_DISK_DEV} ,drive=SystemDisk
1992- -drive id=SystemDisk,if=none,format=qcow2,file=" ${disk_img} " ,${DRIVE_OPTIMISATIONS} ${STATUS_QUO} )
1993- else
1994- # Integrated mode: OpenCore is in the main disk's EFI partition
1995- # Boot directly from the main disk
1996- # shellcheck disable=SC2054,SC2206
1997- args+=(-device ${MAC_DISK_DEV} ,drive=SystemDisk,bootindex=0
1998- -drive id=SystemDisk,if=none,format=qcow2,file=" ${disk_img} " ,${DRIVE_OPTIMISATIONS} ${STATUS_QUO} )
1999-
2000- if [ -n " ${img} " ]; then
2001- # shellcheck disable=SC2054
2002- args+=(-device ide-hd,bus=ahci.0,drive=RecoveryImage
2003- -drive id=RecoveryImage,if=none,format=raw,file=" ${img} " )
2004- fi
1962+ args+=(-device ide-hd,bus=ahci.1,drive=RecoveryImage
1963+ -drive id=RecoveryImage,if=none,format=raw,file=" ${img} " )
20051964 fi
1965+
1966+ # shellcheck disable=SC2054,SC2206
1967+ args+=(-device ${MAC_DISK_DEV} ,drive=SystemDisk
1968+ -drive id=SystemDisk,if=none,format=qcow2,file=" ${disk_img} " ,${DRIVE_OPTIMISATIONS} ${STATUS_QUO} )
20061969 elif [ " ${guest_os} " == " kolibrios" ]; then
20071970 # shellcheck disable=SC2054,SC2206
20081971 args+=(-device ahci,id=ahci
0 commit comments