From 1761e14d6d45cf9656bd7f7d8c5e1e2a09901938 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera Date: Wed, 13 Nov 2024 19:45:29 +0800 Subject: [PATCH] os/mac/diagnostic: fix OpenCore check Taken from Neofetch[^1]. Fixes #18763. [^1]: https://github.com/dylanaraps/neofetch/blob/ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f/neofetch#L1260-L1261 --- Library/Homebrew/extend/os/mac/diagnostic.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index c13c5b5956eb3..56a39c77a4116 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -129,11 +129,10 @@ 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.arm? + + loaded_kexts = Utils.safe_popen_read("/usr/bin/kmutil", "showloaded") + return if loaded_kexts.exclude?("FakeSMC") && loaded_kexts.exclude?("VirtualSMC") <<~EOS You have installed macOS using OpenCore Legacy Patcher.