https://github.com/mudler/go-kdetect
golang kernel driver detector
https://github.com/mudler/go-kdetect
Last synced: about 2 months ago
JSON representation
golang kernel driver detector
- Host: GitHub
- URL: https://github.com/mudler/go-kdetect
- Owner: mudler
- License: mit
- Created: 2021-08-02T10:07:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-02T13:02:24.000Z (almost 4 years ago)
- Last Synced: 2024-12-12T08:51:19.360Z (6 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-kdetect
A small and simple library to report kernel modules that are detected in a running system.
It uses [go-udev](github.com/pilebones/go-udev) to detect the system devices and parses the kernel alias file to derive the drivers to load.
## Usage
```golang
package mainimport (
"github.com/mudler/go-kdetect"
"fmt"
)func main() {
drivers, err := kdetect.ProbeKernelModules("/lib/modules/5.11.15-1-default/modules.alias")
if err != nil {
// Handle err
}// drivers is a []string
fmt.Println(drivers)
// [acpi_cpufreq pcc_cpufreq tiny_power_button button ac processor_aggregator int3402_thermal video fjes dell_smo8800 smo8800 int3403_thermal ec battery thermal skl_uncore nouveau pcieport i915 proc_thermal xhci_hcd pcmcia hub hid_generic logitech-djreceiver usbhid hid_logitech_hidpp logitech-hidpp-device usb uvcvideo btusb intel_pch_thermal des_generic i2c_designware idma64 intel-lpss hid-multitouch i2c_hid mei_wdt mei_hdcp mei_me serial sr_mod sd ahci iwlwifi rtsx_pci_sdmmc rtsx_pci int3403 thermal snd_hda_codec_realtek snd_soc_hdac_hdmi snd_hda_codec_hdmi snd_hda_intel dummy ee1004 iTCO_wdt i801_smbus int3402 thermal acpi-wmi mxm_wmi intel_pmc_core intel-hid int3400 thermal tpm_tis acpi-fan intel_wmi_thunderbolt intel-wmi-thunderbolt wmi_bmof wmi-bmof dell_wmi_descriptor dell-wmi-descriptor dell_wmi dell-wmi dell_smbios dell-smbios coretemp dcdbas dell-laptop efi-framebuffer efi_pstore atkbd psmouse i8042 intel_rapl_msr kgdboc pcspkr reg-dummy serial8250 snd-soc-dummy vboxdrv system alarmtimer rtc_cmos i8042 kbd i8042 aux intel_rapl_common processor]}
```