From 9a97070da62577e730aaaae4cf657900abb16957 Mon Sep 17 00:00:00 2001 From: Joey Jiao Date: Sun, 2 Jul 2023 12:14:03 +0800 Subject: pkg/host: export ParseModulesText Change-Id: I3119aed5cfe223e24cfc56b27612adaf2a638a99 --- pkg/host/machine_info.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/host/machine_info.go') diff --git a/pkg/host/machine_info.go b/pkg/host/machine_info.go index 3c04becab..779356d4a 100644 --- a/pkg/host/machine_info.go +++ b/pkg/host/machine_info.go @@ -45,9 +45,17 @@ func CollectGlobsInfo(globs map[string]bool) (map[string][]string, error) { return machineGlobsInfo(globs) } +func ParseModulesText(modulesText []byte) ([]KernelModule, error) { + if machineParseModules == nil { + return nil, nil + } + return machineParseModules(modulesText) +} + var machineInfoFuncs []machineInfoFunc var machineModulesInfo func() ([]KernelModule, error) var machineGlobsInfo func(map[string]bool) (map[string][]string, error) +var machineParseModules func([]byte) ([]KernelModule, error) type machineInfoFunc struct { name string -- cgit mrf-deployment