From 8c55c06fa7c1627cc3870f3c42bff36396c5a810 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 6 May 2026 18:15:57 +0800 Subject: [PATCH] OS (Linux): detects bedrock only on Linux --- src/detection/os/os_linux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index b07bc3a2e..f6223e5ca 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -297,7 +297,7 @@ FF_A_UNUSED static bool detectFedoraVariant(FFOSResult* result) { return false; } -static bool detectBedrock(FFOSResult* os) { +FF_A_UNUSED static bool detectBedrock(FFOSResult* os) { const char* bedrockRestrict = getenv("BEDROCK_RESTRICT"); if (bedrockRestrict && bedrockRestrict[0] == '1') { return false; @@ -305,7 +305,7 @@ static bool detectBedrock(FFOSResult* os) { return parseOsRelease(FASTFETCH_TARGET_DIR_ROOT "/bedrock/strata/bedrock/etc/os-release", os); } -static void detectDeepinEnhancement(FFOSResult* result) { +FF_A_UNUSED static void detectDeepinEnhancement(FFOSResult* result) { if (ffStrbufContainC(&result->prettyName, '(')) { return; } @@ -342,9 +342,11 @@ static void detectOS(FFOSResult* os) { return; #endif +#ifdef __linux__ if (detectBedrock(os)) { return; } +#endif // Refer: https://gist.github.com/natefoo/814c5bf936922dad97ff