func generateMap() (map[string]string, error) {
	return elfMap(moduleRoot)
}
Open every single kernel module under the kernel module directory
(/lib/modules/$(uname -r)/), and parse the ELF headers to extract the
module name.
package modprobe
import (
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"debug/elf"
	"golang.org/x/sys/unix"
)
var (
	moduleRoot = getModuleRoot()
)
func getModuleRoot() string {
	uname := unix.Utsname{}
	if err := unix.Uname(&uname); err != nil {
		panic(err)
	}
	i := 0
	for ; uname.Release[i] != 0; i++ {
	}
	return filepath.Join(
		"/lib/modules",
		string(uname.Release[:i]),
	)
}
func modulePath(path string) string {
	return filepath.Join(moduleRoot, path)
}
func ResolveName(name string) (string, error) {
	paths, err := generateMap()
	if err != nil {
		return "", err
	}
	fsPath := paths[name]
	if !strings.HasPrefix(fsPath, moduleRoot) {
		return "", fmt.Errorf("Module isn't in the module directory")
	}
	return fsPath, nil
}