1
0

Store the default kernel modules

This commit is contained in:
dump_stack() 2023-02-15 10:52:36 +00:00
parent 3ec919abc1
commit 668bc1e391
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
2 changed files with 17 additions and 6 deletions

View File

@ -250,9 +250,11 @@ type KernelInfo struct {
ContainerName string
// Runtime information
KernelPath string
InitrdPath string
RootFS string
KernelPath string
InitrdPath string
ModulesPath string
RootFS string
// Debug symbols
VmlinuxPath string

View File

@ -482,6 +482,13 @@ func copyKernels(name string) (err error) {
return
}
cmd = exec.Command("docker", "cp", containerID+":/lib/modules", target)
rawOutput, err = cmd.CombinedOutput()
if err != nil {
log.Println(string(rawOutput))
return
}
return
}
@ -658,9 +665,11 @@ func genDockerKernels(dii dockerImageInfo, newkcfg *config.KernelConfig,
KernelRelease: k,
ContainerName: name,
KernelPath: kernelsBase + genKernelPath(files, k),
InitrdPath: kernelsBase + genInitrdPath(files, k),
RootFS: rootfs,
KernelPath: kernelsBase + genKernelPath(files, k),
InitrdPath: kernelsBase + genInitrdPath(files, k),
ModulesPath: kernelsBase + "modules/" + k,
RootFS: rootfs,
}
newkcfg.Kernels = append(newkcfg.Kernels, ki)
}