mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Migrate macOS to OpenCore bootloader
This commit is contained in:
		
							parent
							
								
									e8124ab1eb
								
							
						
					
					
						commit
						5ed1904f64
					
				
					 1 changed files with 8 additions and 7 deletions
				
			
		
							
								
								
									
										15
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -6,6 +6,7 @@ function web_get() { | ||||||
|   local FILE="" |   local FILE="" | ||||||
|   FILE="${URL##*/}" |   FILE="${URL##*/}" | ||||||
|   if [ ! -e "${VMDIR}/${FILE}" ]; then |   if [ ! -e "${VMDIR}/${FILE}" ]; then | ||||||
|  |     mkdir -p "${VMDIR}" 2>/dev/null | ||||||
|     if ! wget -q -c "${URL}" -O "${VMDIR}/${FILE}"; then |     if ! wget -q -c "${URL}" -O "${VMDIR}/${FILE}"; then | ||||||
|       echo "ERROR! Failed to download ${URL}" |       echo "ERROR! Failed to download ${URL}" | ||||||
|       exit 1 |       exit 1 | ||||||
|  | @ -164,9 +165,9 @@ function vm_boot() { | ||||||
|   if [ "${boot}" == "efi" ] || [ "${boot}" == "uefi" ]; then |   if [ "${boot}" == "efi" ] || [ "${boot}" == "uefi" ]; then | ||||||
|     if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ] ; then |     if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ] ; then | ||||||
|       if [ "${guest_os}" == "macos" ]; then |       if [ "${guest_os}" == "macos" ]; then | ||||||
|         web_get "https://github.com/foxlet/macOS-Simple-KVM/raw/master/ESP.qcow2" |         web_get "https://github.com/kholia/OSX-KVM/raw/master/OpenCore-Catalina/OpenCore.qcow2" | ||||||
|         web_get "https://github.com/foxlet/macOS-Simple-KVM/raw/master/firmware/OVMF_CODE.fd" |         web_get "https://github.com/kholia/OSX-KVM/raw/master/OVMF_CODE.fd" | ||||||
|         web_get "https://github.com/foxlet/macOS-Simple-KVM/raw/master/firmware/OVMF_VARS-1024x768.fd" |         web_get "https://github.com/kholia/OSX-KVM/raw/master/OVMF_VARS-1024x768.fd" | ||||||
|         local EFI_CODE="${VMDIR}/OVMF_CODE.fd" |         local EFI_CODE="${VMDIR}/OVMF_CODE.fd" | ||||||
|         local EFI_VARS="${VMDIR}/OVMF_VARS-1024x768.fd" |         local EFI_VARS="${VMDIR}/OVMF_VARS-1024x768.fd" | ||||||
|       else |       else | ||||||
|  | @ -440,15 +441,15 @@ function vm_boot() { | ||||||
|   if [ "${guest_os}" == "macos" ]; then |   if [ "${guest_os}" == "macos" ]; then | ||||||
|     DISKS="-drive if=pflash,format=raw,readonly=on,file=${EFI_CODE} |     DISKS="-drive if=pflash,format=raw,readonly=on,file=${EFI_CODE} | ||||||
|     -drive if=pflash,format=raw,file=${EFI_VARS} |     -drive if=pflash,format=raw,file=${EFI_VARS} | ||||||
|     -drive id=ESP,cache=directsync,aio=native,if=none,format=qcow2,file=${VMDIR}/ESP.qcow2" |     -drive id=OpenCore,if=none,snapshot=on,format=qcow2,file=${VMDIR}/OpenCore.qcow2 | ||||||
|  |     -device virtio-blk-pci,drive=OpenCore,scsi=off" | ||||||
|     if [ -n "${img}" ]; then |     if [ -n "${img}" ]; then | ||||||
|       DISKS="${DISKS} |       DISKS="${DISKS} | ||||||
|       -drive id=InstallMedia,cache=directsync,aio=native,if=none,format=raw,readonly=on,file=${img} |       -drive id=InstallMedia,if=none,format=raw,readonly=on,file=${img} | ||||||
|       -device virtio-blk-pci,drive=InstallMedia,scsi=off" |       -device virtio-blk-pci,drive=InstallMedia,scsi=off" | ||||||
|     fi |     fi | ||||||
|     DISKS="${DISKS} |     DISKS="${DISKS} | ||||||
|     -device virtio-blk-pci,drive=ESP,scsi=off |     -drive id=SystemDisk,if=none,format=qcow2,file=${disk_img} ${STATUS_QUO} | ||||||
|     -drive id=SystemDisk,cache=directsync,aio=native,if=none,format=qcow2,file=${disk_img} ${STATUS_QUO} |  | ||||||
|     -device virtio-blk-pci,drive=SystemDisk,scsi=off" |     -device virtio-blk-pci,drive=SystemDisk,scsi=off" | ||||||
|     NET_DEVICE="vmxnet3" |     NET_DEVICE="vmxnet3" | ||||||
|     # UNTESTED! USB2 passthrough since USB3 isn't(?) supported in macOS VMs |     # UNTESTED! USB2 passthrough since USB3 isn't(?) supported in macOS VMs | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue