fixed kernel import from container

This commit is contained in:
Christian Goll
2022-01-18 15:34:29 +01:00
parent 72290a3a3d
commit 558f5ef65b

View File

@@ -111,7 +111,7 @@ func ListKernels() ([]string, error) {
func Build(kernelVersion string, kernelName string, root string) (string, error) {
kernelDrivers := path.Join(root, "/lib/modules/"+kernelVersion)
kernelDriversRelative := path.Join("/lib/modules/"+kernelVersion)
kernelDriversRelative := path.Join("/lib/modules/" + kernelVersion)
kernelDestination := KernelImage(kernelName)
driversDestination := KmodsImage(kernelName)
versionDestination := KernelVersion(kernelName)
@@ -133,8 +133,8 @@ func Build(kernelVersion string, kernelName string, root string) (string, error)
return "", fmt.Errorf("failed to create version dest: %s", err)
}
for _, path := range kernelSearchPaths {
testPath := fmt.Sprintf(path, kernelVersion)
for _, searchPath := range kernelSearchPaths {
testPath := fmt.Sprintf(path.Join(root, searchPath), kernelVersion)
wwlog.Printf(wwlog.VERBOSE, "Looking for kernel at: %s\n", testPath)
if util.IsFile(testPath) {
kernelSource = testPath