Util: rename KernelMod to Kmod

This commit is contained in:
李通洲
2024-09-27 08:36:38 +08:00
parent 8bbc985d98
commit af067c7c3f
6 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -425,7 +425,7 @@ set(LIBFASTFETCH_SRC
src/util/base64.c
src/util/FFlist.c
src/util/FFstrbuf.c
src/util/kernelMod.c
src/util/kmod.c
src/util/path.c
src/util/platform/FFPlatform.c
src/util/smbiosHelper.c
+2 -2
View File
@@ -1,12 +1,12 @@
#include "tpm.h"
#include "common/sysctl.h"
#include "util/kernelMod.h"
#include "util/kmod.h"
const char* ffDetectTPM(FFTPMResult* result)
{
if (ffSysctlGetString("dev.tpmcrb.0.%desc", &result->description) != NULL)
{
if (!ffKernelModLoaded("tpm")) return "`tpm` kernel module is not loaded";
if (!ffKmodLoaded("tpm")) return "`tpm` kernel module is not loaded";
return "TPM device is not found";
}
+2 -2
View File
@@ -1,7 +1,7 @@
#include "zpool.h"
#ifdef FF_HAVE_LIBZFS
#include "util/kernelMod.h"
#include "util/kmod.h"
#ifdef __sun
#define FF_DISABLE_DLOPEN
@@ -85,7 +85,7 @@ const char* ffDetectZpool(FFlist* result /* list of FFZpoolResult */)
libzfs_handle_t* handle = fflibzfs_init();
if (!handle)
{
if (!ffKernelModLoaded("zfs")) return "`zfs` kernel module is not loaded";
if (!ffKmodLoaded("zfs")) return "`zfs` kernel module is not loaded";
return "libzfs_init() failed";
}
-5
View File
@@ -1,5 +0,0 @@
#pragma once
#include "fastfetch.h"
bool ffKernelModLoaded(const char* modName);
+4 -4
View File
@@ -1,9 +1,9 @@
#include "kernelMod.h"
#include "kmod.h"
#if __linux__
#include "common/io/io.h"
bool ffKernelModLoaded(const char* modName)
bool ffKmodLoaded(const char* modName)
{
static FFstrbuf modules;
if (modules.chars == NULL)
@@ -27,12 +27,12 @@ bool ffKernelModLoaded(const char* modName)
#include <sys/param.h>
#include <sys/module.h>
bool ffKernelModLoaded(const char* modName)
bool ffKmodLoaded(const char* modName)
{
return modfind(modName) >= 0;
}
#else
bool ffKernelModLoaded(FF_MAYBE_UNUSED const char* modName)
bool ffKmodLoaded(FF_MAYBE_UNUSED const char* modName)
{
return true; // Don't generate kernel module related errors
}
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include "fastfetch.h"
bool ffKmodLoaded(const char* modName);