os/mac/diagnostic: improve OpenCore check
This is based on [1]. [1]: https://github.com/Homebrew/brew/pull/18765#issuecomment-2474056438
This commit is contained in:
parent
5a2c264d19
commit
d0418add45
@ -130,13 +130,14 @@ module OS
|
||||
|
||||
def check_for_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?
|
||||
oclp_version = Utils.safe_popen_read("/usr/sbin/nvram",
|
||||
"4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oclp-version").split[1]
|
||||
return if opencore_version.blank? || oclp_version.blank?
|
||||
rescue ErrorDuringExecution
|
||||
return
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user