From 748810c3e152387a578058775bf4bb296818b85c Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 7 Aug 2026 03:15:55 +0000 Subject: [PATCH 08/38] kmod (Apple): stub out kext detection before 10.7 KextManagerCopyLoadedKextInfo isn't available on older SDKs; report modules as loaded rather than erroring on those targets. Ported from https://github.com/macos-powerpc/powerpc-ports/blob/main/sysutils/fastfetch/files/0012-Misc-fixes-for-legacy-systems.patch --- src/common/impl/kmod_apple.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/impl/kmod_apple.c b/src/common/impl/kmod_apple.c index 3f1395f5c..24f2977b9 100644 --- a/src/common/impl/kmod_apple.c +++ b/src/common/impl/kmod_apple.c @@ -2,7 +2,10 @@ #include "common/apple/cf_helpers.h" #include #include +#include +// KextManagerCopyLoadedKextInfo available in 10.7+ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 bool ffKmodLoaded(const char* modName) { FF_CFTYPE_AUTO_RELEASE CFStringRef name = CFStringCreateWithCString(kCFAllocatorDefault, modName, kCFStringEncodingUTF8); FF_CFTYPE_AUTO_RELEASE CFArrayRef identifiers = CFArrayCreate(kCFAllocatorDefault, (const void**) &name, 1, &kCFTypeArrayCallBacks); @@ -10,3 +13,8 @@ bool ffKmodLoaded(const char* modName) { FF_CFTYPE_AUTO_RELEASE CFDictionaryRef kextInfo = KextManagerCopyLoadedKextInfo(identifiers, keys); return CFDictionaryContainsKey(kextInfo, name); } +#else // MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +bool ffKmodLoaded([[maybe_unused]] const char* modName) { + return true; // Don't generate kernel module related errors +} +#endif // MAC_OS_X_VERSION_MIN_REQUIRED -- 2.43.0