1
0

fix: handle existing debian kernels correctly

This commit is contained in:
dump_stack() 2023-05-14 22:16:32 +00:00
parent b2383ba442
commit e0b63aee1a
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -329,7 +329,16 @@ func installKernel(sk config.KernelMask, pkgname string, force, headers bool) (e
return return
} }
moddirs, err := ioutil.ReadDir(c.Volumes.LibModules) searchdir := c.Volumes.LibModules
if sk.DistroType == config.Debian {
// Debian has different kernels (package version) by the
// same name (ABI), so we need to separate /boot
c.Volumes = debian.ContainerVolumes(sk.DockerName(), pkgname)
searchdir = config.Dir("volumes", sk.DockerName())
}
moddirs, err := ioutil.ReadDir(searchdir)
if err != nil { if err != nil {
return return
} }
@ -401,16 +410,6 @@ func installKernel(sk config.KernelMask, pkgname string, force, headers bool) (e
return return
} }
// Debian has different kernels (package version) by the
// same name (ABI), so we need to separate /boot
volumes.LibModules = config.Dir("volumes", sk.DockerName(),
pkgname, "/lib/modules")
volumes.UsrSrc = config.Dir("volumes", sk.DockerName(),
pkgname, "/usr/src")
volumes.Boot = config.Dir("volumes", sk.DockerName(),
pkgname, "/boot")
pkgs := []snapshot.Package{dk.Image} pkgs := []snapshot.Package{dk.Image}
if headers { if headers {
pkgs = append(pkgs, dk.Headers...) pkgs = append(pkgs, dk.Headers...)