mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-09 06:30:10 +01:00
Host (Linux): detect serial number for Asahi Linux
This commit is contained in:
@@ -31,23 +31,24 @@ bool ffIsSmbiosValueSet(FFstrbuf* value)
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
void ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer)
|
||||
bool ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer)
|
||||
{
|
||||
if (ffReadFileBuffer(devicesPath, buffer))
|
||||
{
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
if(ffIsSmbiosValueSet(buffer))
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ffReadFileBuffer(classPath, buffer))
|
||||
{
|
||||
ffStrbufTrimRightSpace(buffer);
|
||||
if(ffIsSmbiosValueSet(buffer))
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
ffStrbufClear(buffer);
|
||||
return false;
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
@@ -13,7 +13,7 @@ static inline void ffCleanUpSmbiosValue(FFstrbuf* value)
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
void ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer);
|
||||
bool ffGetSmbiosValue(const char* devicesPath, const char* classPath, FFstrbuf* buffer);
|
||||
#elif defined(_WIN32)
|
||||
// https://github.com/KunYi/DumpSMBIOS
|
||||
// https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.pdf
|
||||
|
||||
Reference in New Issue
Block a user