Skip to content

Commit

Permalink
Merge pull request #18765 from Homebrew/opencore-fix
Browse files Browse the repository at this point in the history
os/mac/diagnostic: fix OpenCore check
  • Loading branch information
ZhongRuoyu authored Nov 13, 2024
2 parents b421c2f + a525ce0 commit 69fd4a6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,20 @@ def check_for_unsupported_macos
end

def check_for_opencore
has_opencore =
File.exist?("/Library/PrivilegedHelperTools/com.dortania.opencore-legacy-patcher.privileged-helper")
has_opencore ||= File.exist?("/Library/Application Support/Dortania/OpenCore-Patcher.app")
has_opencore ||= MacOS.pkgutil_info("com.dortania.opencore-legacy-patcher").present?
return unless has_opencore
return if ::Hardware::CPU.physical_cpu_arm64?
return if ENV["CI"]

# https://dortania.github.io/OpenCore-Legacy-Patcher/UPDATE.html#checking-oclp-and-opencore-versions
begin
opencore_version = Utils.safe_popen_read("/usr/sbin/nvram",
"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version").split[1]
return if opencore_version.blank?
rescue ErrorDuringExecution
return
end

<<~EOS
You have installed macOS using OpenCore Legacy Patcher.
You have booted macOS using OpenCore Legacy Patcher.
We do not provide support for this configuration.
#{please_create_pull_requests}
EOS
Expand Down

0 comments on commit 69fd4a6

Please sign in to comment.