diff --git a/Dockerfile b/Dockerfile index 1ebdde7..58217af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,29 @@ -FROM scratch +FROM debian:trixie-slim AS builder + +ARG VERSION_OPENCORE="v21" +ARG REPO_OPENCORE="https://github.com/thenickdude/KVM-Opencore" + +ARG DEBCONF_NOWARNINGS="yes" +ARG DEBIAN_FRONTEND="noninteractive" +ARG DEBCONF_NONINTERACTIVE_SEEN="true" + +RUN set -eu && \ + apt-get update && \ + apt-get --no-install-recommends -y install \ + guestfish \ + linux-image-generic && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +COPY --chmod=755 ./src/build.sh /run +COPY --chmod=644 ./config.plist /run + +ADD $REPO_OPENCORE/releases/download/$VERSION_OPENCORE/OpenCore-$VERSION_OPENCORE.iso.gz /tmp/opencore.iso.gz + +RUN gzip -d /tmp/opencore.iso.gz +RUN run/build.sh /tmp/opencore.iso /run/config.plist + +FROM scratch AS runner COPY --from=qemux/qemu-docker:5.11 / / ARG VERSION_ARG="0.0" @@ -18,9 +43,9 @@ RUN set -eu && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY --chmod=755 ./src /run/ +COPY --from=builder /images /images ADD --chmod=755 $REPO_OSX_KVM/$VERSION_OSX_KVM/fetch-macOS-v2.py /run/ -ADD --chmod=755 $REPO_OSX_KVM/$VERSION_OSX_KVM/OpenCore/OpenCore.qcow2 /images/ ADD --chmod=755 \ $REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_CODE.fd \ $REPO_OSX_KVM/$VERSION_OSX_KVM/OVMF_VARS.fd \ diff --git a/config.plist b/config.plist new file mode 100644 index 0000000..97b4e45 --- /dev/null +++ b/config.plist @@ -0,0 +1,1888 @@ + + + + + ACPI + + Add + + + Comment + My custom DSDT + Enabled + + Path + DSDT.aml + + + Comment + My custom SSDT + Enabled + + Path + SSDT-1.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-ALS0.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-AWAC-DISABLE.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-BRG0.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-EC-USBX.aml + + + Comment + Fake EC and USBX Power + Enabled + + Path + SSDT-EC.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-EHCx-DISABLE.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-IMEI.aml + + + Comment + CPU AGPM Plugin=1 + Enabled + + Path + SSDT-PLUG.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-PMC.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-PNLF.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-RTC0-RANGE.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-RTC0.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-SBUS-MCHC.aml + + + Comment + Read the comment in dsl sample + Enabled + + Path + SSDT-UNC.aml + + + Comment + add DTGP method + Enabled + + Path + SSDT-DTGP.aml + + + Comment + USB 2.0 Injection + Enabled + + Path + SSDT-EHCI.aml + + + Delete + + + All + + Comment + Delete CpuPm + Enabled + + OemTableId + Q3B1UG0AAAA= + TableLength + 0 + TableSignature + U1NEVA== + + + All + + Comment + Delete Cpu0Ist + Enabled + + OemTableId + Q3B1MElzdAA= + TableLength + 0 + TableSignature + U1NEVA== + + + Patch + + + Base + + BaseSkip + 0 + Comment + Replace one byte sequence with another + Count + 0 + Enabled + + Find + ESIzRA== + Limit + 0 + Mask + + OemTableId + + Replace + RDMiEQ== + ReplaceMask + + Skip + 0 + TableLength + 0 + TableSignature + + + + Base + \_SB.PCI0.LPCB.HPET + BaseSkip + 0 + Comment + HPET _CRS to XCRS + Count + 1 + Enabled + + Find + X0NSUw== + Limit + 0 + Mask + + OemTableId + + Replace + WENSUw== + ReplaceMask + + Skip + 0 + TableLength + 0 + TableSignature + + + + Quirks + + FadtEnableReset + + NormalizeHeaders + + RebaseRegions + + ResetHwSig + + ResetLogoStatus + + SyncTableIds + + + + Booter + + MmioWhitelist + + Patch + + Quirks + + AllowRelocationBlock + + AvoidRuntimeDefrag + + DevirtualiseMmio + + DisableSingleUser + + DisableVariableWrite + + DiscardHibernateMap + + EnableSafeModeSlide + + EnableWriteUnprotector + + FixupAppleEfiImages + + ForceBooterSignature + + ForceExitBootServices + + ProtectMemoryRegions + + ProtectSecureBoot + + ProtectUefiServices + + ProvideCustomSlide + + ProvideMaxSlide + 0 + RebuildAppleMemoryMap + + ResizeAppleGpuBars + -1 + SetupVirtualMap + + SignalAppleOS + + SyncRuntimePermissions + + + + DeviceProperties + + Add + + PciRoot(0x1)/Pci(0x1F,0x0) + + compatible + pci8086,2916 + device-id + + FikA + + name + pci8086,2916 + + + Delete + + + Kernel + + Add + + + Arch + Any + BundlePath + Lilu.kext + Comment + Patch engine + Enabled + + ExecutablePath + Contents/MacOS/Lilu + MaxKernel + + MinKernel + 8.0.0 + PlistPath + Contents/Info.plist + + + Arch + Any + BundlePath + VirtualSMC.kext + Comment + SMC emulator + Enabled + + ExecutablePath + Contents/MacOS/VirtualSMC + MaxKernel + + MinKernel + 8.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + WhateverGreen.kext + Comment + Video patches + Enabled + + ExecutablePath + Contents/MacOS/WhateverGreen + MaxKernel + + MinKernel + 10.0.0 + PlistPath + Contents/Info.plist + + + Arch + Any + BundlePath + AppleALC.kext + Comment + Audio patches + Enabled + + ExecutablePath + Contents/MacOS/AppleALC + MaxKernel + + MinKernel + 8.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + IntelMausi.kext + Comment + Intel Ethernet LAN + Enabled + + ExecutablePath + Contents/MacOS/IntelMausi + MaxKernel + + MinKernel + 13.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + Legacy_USB3.kext + Comment + XHC ports configuration + Enabled + + ExecutablePath + + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + MCEReporterDisabler.kext + Comment + AppleMCEReporter disabler + Enabled + + ExecutablePath + + MaxKernel + + MinKernel + 19.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + VoodooPS2Controller.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/VoodooPS2Controller + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/VoodooPS2Keyboard + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Mouse.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/VoodooPS2Mouse + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Trackpad.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/VoodooPS2Trackpad + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + VoodooPS2Controller.kext/Contents/PlugIns/VoodooInput.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/VoodooInput + MaxKernel + + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + USBPorts.kext + Comment + + Enabled + + ExecutablePath + + MaxKernel + + MinKernel + + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + AGPMInjector.kext + Comment + + Enabled + + ExecutablePath + + MaxKernel + + MinKernel + + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BrcmFirmwareData.kext + Comment + Bluetooth firmware + Enabled + + ExecutablePath + Contents/MacOS/BrcmFirmwareData + MaxKernel + + MinKernel + + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BrcmNonPatchRAM2.kext + Comment + Bluetooth support for macOS 10.11-10.14 + Enabled + + ExecutablePath + Contents/MacOS/BrcmNonPatchRAM2 + MaxKernel + 18.99.99 + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BrcmPatchRAM2.kext + Comment + Bluetooth support for macOS 10.11-10.14 + Enabled + + ExecutablePath + Contents/MacOS/BrcmPatchRAM2 + MaxKernel + 18.99.99 + MinKernel + 15.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BrcmPatchRAM3.kext + Comment + Bluetooth support for macOS 10.15- + Enabled + + ExecutablePath + Contents/MacOS/BrcmPatchRAM3 + MaxKernel + + MinKernel + 19.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BrcmBluetoothInjector.kext + Comment + Bluetooth support for macOS 10.15-11 + Enabled + + ExecutablePath + + MaxKernel + 20.99.99 + MinKernel + 19.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + BlueToolFixup.kext + Comment + Bluetooth support for macOS 12- + Enabled + + ExecutablePath + Contents/MacOS/BlueToolFixup + MaxKernel + + MinKernel + 21.0.0 + PlistPath + Contents/Info.plist + + + Arch + x86_64 + BundlePath + CryptexFixup.kext + Comment + Support for non-AVX2 CPUs in Ventura/Sonoma + Enabled + + ExecutablePath + Contents/MacOS/CryptexFixup + MaxKernel + 23.99.99 + MinKernel + 22.1.0 + PlistPath + Contents/Info.plist + + + Block + + + Arch + Any + Comment + + Enabled + + Identifier + com.apple.driver.AppleTyMCEDriver + MaxKernel + + MinKernel + + Strategy + Disable + + + Emulate + + Cpuid1Data + + VAYFAAAAAAAAAAAAAAAAAA== + + Cpuid1Mask + + ////AAAAAAAAAAAAAAAAAA== + + DummyPowerManagement + + MaxKernel + + MinKernel + + + Force + + + Arch + Any + BundlePath + System/Library/Extensions/IONetworkingFamily.kext + Comment + + Enabled + + ExecutablePath + Contents/MacOS/IONetworkingFamily + Identifier + com.apple.iokit.IONetworkingFamily + MaxKernel + 13.99.99 + MinKernel + + PlistPath + Contents/Info.plist + + + Patch + + + Arch + x86_64 + Base + + Comment + algrey - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN + Count + 1 + Enabled + + Find + + MduAPQAAAAAGdQA= + + Identifier + kernel + Limit + 0 + Mask + + /////wAAAP///wA= + + MaxKernel + 20.3.99 + MinKernel + 17.0.0 + Replace + + u7xP6njpXQAAAJA= + + ReplaceMask + + + Skip + 0 + + + Arch + x86_64 + Base + + Comment + algrey - thenickdude - cpuid_set_cpufamily - force CPUFAMILY_INTEL_PENRYN (Big Sur 11.3+, Monterey, Ventura, Sonoma) + Count + 1 + Enabled + + Find + + MdKzAYA9AAAAAAZ1 + + Identifier + kernel + Limit + 0 + Mask + + ////////AAAAAP// + + MaxKernel + 23.99.99 + MinKernel + 20.4.0 + Replace + + urxP6nizAJCQkJDr + + ReplaceMask + + + Skip + 0 + + + Arch + x86_64 + Base + _early_random + Comment + SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random) + Count + 1 + Enabled + + Find + AHQjSIs= + Identifier + kernel + Limit + 800 + Mask + + MaxKernel + 21.1.0 + MinKernel + 20.4.0 + Replace + AOsjSIs= + ReplaceMask + + Skip + 0 + + + Arch + x86_64 + Base + _register_and_init_prng + Comment + SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng + Count + 1 + Enabled + + Find + ukgBAAAx9g== + Identifier + kernel + Limit + 256 + Mask + + MaxKernel + 21.1.0 + MinKernel + 20.4.0 + Replace + ukgBAADrBQ== + ReplaceMask + + Skip + 0 + + + Arch + x86_64 + Base + _apfs_filevault_allowed + Comment + Force FileVault on Broken Seal (from OCLP project, for non-AVX2 Ventura/Sonoma) + Count + 0 + Enabled + + Find + + Identifier + com.apple.filesystems.apfs + Limit + 0 + Mask + + MaxKernel + 23.99.99 + MinKernel + 22.1.0 + Replace + uAEAAADD + ReplaceMask + + Skip + 0 + + + Quirks + + AppleCpuPmCfgLock + + AppleXcpmCfgLock + + AppleXcpmExtraMsrs + + AppleXcpmForceBoost + + CustomPciSerialDevice + + CustomSMBIOSGuid + + DisableIoMapper + + DisableIoMapperMapping + + DisableLinkeditJettison + + DisableRtcChecksum + + ExtendBTFeatureFlags + + ExternalDiskIcons + + ForceAquantiaEthernet + + ForceSecureBootScheme + + IncreasePciBarSize + + LapicKernelPanic + + LegacyCommpage + + PanicNoKextDump + + PowerTimeoutKernelPanic + + ProvideCurrentCpuInfo + + SetApfsTrimTimeout + 0 + ThirdPartyDrives + + XhciPortLimit + + + Scheme + + CustomKernel + + FuzzyMatch + + KernelArch + Auto + KernelCache + Auto + + + Misc + + BlessOverride + + Boot + + ConsoleAttributes + 0 + HibernateMode + Auto + HibernateSkipsPicker + + HideAuxiliary + + InstanceIdentifier + + LauncherOption + Disabled + LauncherPath + Default + PickerAttributes + 17 + PickerAudioAssist + + PickerMode + External + PickerVariant + Auto + PollAppleHotKeys + + ShowPicker + + TakeoffDelay + 0 + Timeout + 15 + + Debug + + AppleDebug + + ApplePanic + + DisableWatchDog + + DisplayDelay + 0 + DisplayLevel + 2147483650 + LogModules + * + SysReport + + Target + 3 + + Entries + + Security + + AllowSetDefault + + ApECID + 0 + AuthRestart + + BlacklistAppleUpdate + + DmgLoading + Signed + EnablePassword + + ExposeSensitiveData + 6 + HaltLevel + 2147483648 + PasswordHash + + PasswordSalt + + ScanPolicy + 17761027 + SecureBootModel + Disabled + Vault + Optional + + Serial + + Init + + Override + + + Tools + + + Arguments + + Auxiliary + + Comment + Not signed for security reasons + Enabled + + Flavour + OpenShell:UEFIShell:Shell + FullNvramAccess + + Name + UEFI Shell + Path + Shell.efi + RealPath + + TextMode + + + + Arguments + + Auxiliary + + Comment + Memory testing utility + Enabled + + Flavour + MemTest + FullNvramAccess + + Name + memtest86 + Path + memtest86/BOOTX64.efi + RealPath + + TextMode + + + + Arguments + Shutdown + Auxiliary + + Comment + Perform shutdown + Enabled + + Flavour + Auto + FullNvramAccess + + Name + Shutdown + Path + ResetSystem.efi + RealPath + + TextMode + + + + + NVRAM + + Add + + 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14 + + DefaultBackgroundColor + AAAAAA== + + 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102 + + rtc-blacklist + + + 7C436110-AB2A-4BBB-A880-FE41995C9F82 + + #INFO (prev-lang:kbd) + en:252 (ABC), set 656e3a323532 + ForceDisplayRotationInEFI + 0 + SystemAudioVolume + Rg== + boot-args + -v keepsyms=1 amfi_get_out_of_my_way=1 tlbto_us=0 vti=9 + csr-active-config + Jg8= + prev-lang:kbd + ZW4tVVM6MA== + run-efi-updater + No + + + Delete + + 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14 + + DefaultBackgroundColor + + 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102 + + rtc-blacklist + + 7C436110-AB2A-4BBB-A880-FE41995C9F82 + + boot-args + ForceDisplayRotationInEFI + + + LegacyOverwrite + + LegacySchema + + 7C436110-AB2A-4BBB-A880-FE41995C9F82 + + EFILoginHiDPI + EFIBluetoothDelay + LocationServicesEnabled + SystemAudioVolume + SystemAudioVolumeDB + SystemAudioVolumeSaved + bluetoothActiveControllerInfo + bluetoothInternalControllerInfo + flagstate + fmm-computer-name + fmm-mobileme-token-FMM + fmm-mobileme-token-FMM-BridgeHasAccount + nvda_drv + prev-lang:kbd + backlight-level + BootCampHD + + 8BE4DF61-93CA-11D2-AA0D-00E098032B8C + + Boot0080 + Boot0081 + Boot0082 + BootNext + BootOrder + + + WriteFlash + + + PlatformInfo + + Automatic + + CustomMemory + + Generic + + AdviseFeatures + + MLB + C02119700QXJG36JC + ProcessorType + 0 + ROM + 0022412e3d4a + SpoofVendor + + SystemMemoryStatus + Auto + SystemProductName + iMacPro1,1 + SystemSerialNumber + C02FPBZPHX87 + SystemUUID + 213FA768-A62C-4299-8598-47AA666E436F + + UpdateDataHub + + UpdateNVRAM + + UpdateSMBIOS + + UpdateSMBIOSMode + Create + UseRawUuidEncoding + + + UEFI + + APFS + + EnableJumpstart + + GlobalConnect + + HideVerbose + + JumpstartHotPlug + + MinDate + -1 + MinVersion + -1 + + AppleInput + + AppleEvent + Builtin + CustomDelays + + GraphicsInputMirroring + + KeyInitialDelay + 50 + KeySubsequentDelay + 5 + PointerDwellClickTimeout + 0 + PointerDwellDoubleClickTimeout + 0 + PointerDwellRadius + 0 + PointerPollMask + -1 + PointerPollMax + 80 + PointerPollMin + 10 + PointerSpeedDiv + 1 + PointerSpeedMul + 1 + + Audio + + AudioCodec + 0 + AudioDevice + + AudioOutMask + 1 + AudioSupport + + DisconnectHda + + MaximumGain + -15 + MinimumAssistGain + -30 + MinimumAudibleGain + -55 + PlayChime + Auto + ResetTrafficClass + + SetupDelay + 0 + + ConnectDrivers + + Drivers + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenVariableRuntimeDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenRuntime.efi + + + Arguments + + Comment + HFS+ Driver + Enabled + + LoadEarly + + Path + OpenHfsPlus.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenCanopy.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + AudioDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenPartitionDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenUsbKbDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + UsbMouseDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Ps2KeyboardDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Ps2MouseDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + HiiDatabase.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + NvmExpressDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + XhciDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + ExFatDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + CrScreenshotDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Ext4Dxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + DpcDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + SnpDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + MnpDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + ArpDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Dhcp4Dxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Ip4Dxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + Udp4Dxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + TcpDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + DnsDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + HttpDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + HttpUtilitiesDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + HttpBootDxe.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + OpenLinuxBoot.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + ResetNvramEntry.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + ToggleSipEntry.efi + + + Arguments + + Comment + + Enabled + + LoadEarly + + Path + FirmwareSettingsEntry.efi + + + Input + + KeyFiltering + + KeyForgetThreshold + 5 + KeySupport + + KeySupportMode + Auto + KeySwap + + PointerSupport + + PointerSupportMode + ASUS + TimerResolution + 50000 + + Output + + ClearScreenOnModeSwitch + + ConsoleFont + + ConsoleMode + + DirectGopRendering + + ForceResolution + + GopBurstMode + + GopPassThrough + Disabled + IgnoreTextInGraphics + + InitialMode + Auto + ProvideConsoleGop + + ReconnectGraphicsOnConnect + + ReconnectOnResChange + + ReplaceTabWithSpace + + Resolution + 1920x1080@32 + SanitiseClearScreen + + TextRenderer + BuiltinGraphics + UIScale + 0 + UgaPassThrough + + + ProtocolOverrides + + AppleAudio + + AppleBootPolicy + + AppleDebugLog + + AppleEg2Info + + AppleFramebufferInfo + + AppleImageConversion + + AppleImg4Verification + + AppleKeyMap + + AppleRtcRam + + AppleSecureBoot + + AppleSmcIo + + AppleUserInterfaceTheme + + DataHub + + DeviceProperties + + FirmwareVolume + + HashServices + + OSInfo + + PciIo + + UnicodeCollation + + + Quirks + + ActivateHpetSupport + + DisableSecurityPolicy + + EnableVectorAcceleration + + EnableVmx + + ExitBootServicesDelay + 0 + ForceOcWriteFlash + + ForgeUefiSupport + + IgnoreInvalidFlexRatio + + ReleaseUsbOwnership + + ReloadOptionRoms + + RequestBootVarRouting + + ResizeGpuBars + -1 + ResizeUsePciRbIo + + ShimRetainProtocol + + TscSyncTimeout + 0 + UnblockFsConnect + + + ReservedMemory + + + + diff --git a/readme.md b/readme.md index 56d15bc..77c38bd 100644 --- a/readme.md +++ b/readme.md @@ -63,19 +63,17 @@ kubectl apply -f kubernetes.yml - Select `macOS Base System` using your keyboard to begin the installation. - - Select `Disk Utility` and then select the largest `Apple Inc. VirtIO Block Media` disk. + - Choose `Disk Utility` and then select the largest `Apple Inc. VirtIO Block Media` disk. - - Click `Erase` to format the disk, and give it any recognizable name you like. + - Click the `Erase` button to format the disk, and give it any recognizable name you like. - - Close the window and proceed the installation by clicking `Reinstall macOS`. + - Close the current window and proceed the installation by clicking `Reinstall macOS`. - - When prompted where to install the OS, select the disk you just created. - - - There will be several reboots during the installation, keep selecting `macOS Installer` until it offers the option to select the disk you created. - - - Keep selecting your own disk each reboot from now on. + - When prompted where you want to install macOS, select the disk you just created previously. + + - There will be several reboots, select `macOS Installer` each time until it shows your own disk. - - You will be guided through the installation. Select your region, account name, and other options. + - After all files are copied, select your region, language, and account settings. - Once you see the desktop, your macOS installation is ready for use. @@ -152,7 +150,7 @@ kubectl apply -f kubernetes.yml ## Acknowledgements -Special thanks to [seitenca](https://github.com/seitenca) and [OSX-KVM](https://github.com/kholia/OSX-KVM), this project would not exist without their invaluable work. +Special thanks to [OSX-KVM](https://github.com/kholia/OSX-KVM), [KVM-Opencore](https://github.com/thenickdude/KVM-Opencore) and [seitenca](https://github.com/seitenca), this project would not exist without their invaluable work. ## Stars [![Stars](https://starchart.cc/dockur/macos.svg?variant=adaptive)](https://starchart.cc/dockur/macos) diff --git a/src/boot.sh b/src/boot.sh index 2034a38..a509241 100644 --- a/src/boot.sh +++ b/src/boot.sh @@ -7,7 +7,7 @@ set -Eeuo pipefail BOOT_DESC="" BOOT_OPTS="" BOOT_DRIVE_ID="OpenCoreBoot" -BOOT_DRIVE="/images/OpenCore.qcow2" +BOOT_DRIVE="/images/OpenCore.img" SECURE="off" OVMF="/usr/share/OVMF" @@ -48,8 +48,8 @@ BOOT_OPTS+=" -drive if=pflash,format=raw,readonly=on,file=$OVMF/$ROM" BOOT_OPTS+=" -drive if=pflash,format=raw,file=$OVMF/$VARS" # OpenCoreBoot -DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},scsi=off,bus=pcie.0,addr=0x5,iothread=io2,bootindex=1" -DISK_OPTS+=" -drive file=$BOOT_DRIVE,id=$BOOT_DRIVE_ID,format=qcow2,cache=$DISK_CACHE,aio=$DISK_IO,readonly=on,if=none" +DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},scsi=off,bus=pcie.0,addr=0x5,iothread=io2,bootindex=$BOOT_INDEX" +DISK_OPTS+=" -drive file=$BOOT_DRIVE,id=$BOOT_DRIVE_ID,format=raw,cache=$DISK_CACHE,aio=$DISK_IO,readonly=on,if=none" CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}') CPU_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb" @@ -57,7 +57,7 @@ CPU_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb" if [[ "$CPU_VENDOR" != "GenuineIntel" ]]; then CPU_MODEL="Haswell-noTSX" fi - + USB="nec-usb-xhci,id=xhci" USB+=" -device usb-kbd,bus=xhci.0" USB+=" -global nec-usb-xhci.msi=off" diff --git a/src/build.sh b/src/build.sh new file mode 100644 index 0000000..f57cce1 --- /dev/null +++ b/src/build.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +function msg() { + local txt="$1" + local bold="\x1b[1m" + local normal="\x1b[0m" + echo -e "${bold}### ${txt}${normal}" +} + +function cleanup() { + if test "$GUESTFISH_PID" != ""; then + guestfish --remote -- exit >/dev/null 2>&1 || true + fi +} + +function fish() { + echo "#" "$@" + guestfish --remote -- "$@" || exit 1 +} + +rm -rf /images +msg "Mounting template ISO..." + +trap 'cleanup' EXIT + +export LIBGUESTFS_BACKEND=direct +# shellcheck disable=SC2046 +eval $(guestfish --listen) +if test "$GUESTFISH_PID" = ""; then + echo "ERROR: Starting Guestfish failed!" + exit 1 +fi + +fish add "$1" +fish run +fish mount /dev/sda1 / +fish ls /EFI + +msg "Overriding config..." + +fish copy-in "$2" /EFI/OC/ +fish umount-all + +mkdir -p /images +mv "$1" /images/OpenCore.img + +msg "Finished succesfully!" diff --git a/src/install.sh b/src/install.sh index 421361c..251044e 100644 --- a/src/install.sh +++ b/src/install.sh @@ -59,6 +59,6 @@ if [ "$VERSION" != "$STORED_VERSION" ]; then fi DISK_OPTS="-device virtio-blk-pci,drive=${BASE_IMG_ID},scsi=off,bus=pcie.0,addr=0x6,iothread=io2" -DISK_OPTS+=" -drive file=$BASE_IMG,id=$BASE_IMG_ID,format=dmg,cache=$DISK_CACHE,aio=$DISK_IO,readonly=on,if=none" +DISK_OPTS+=" -drive file=$BASE_IMG,id=$BASE_IMG_ID,format=dmg,cache=unsafe,readonly=on,if=none" return 0