Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/mac/diagnostic: fix OpenCore check #18765

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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",

Check warning on line 137 in Library/Homebrew/extend/os/mac/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/extend/os/mac/diagnostic.rb#L137

Added line #L137 was not covered by tests
"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version").split[1]
return if opencore_version.blank?
rescue ErrorDuringExecution
return

Check warning on line 141 in Library/Homebrew/extend/os/mac/diagnostic.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/extend/os/mac/diagnostic.rb#L141

Added line #L141 was not covered by tests
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
Loading