diff --git a/distro/debian/debian.go b/distro/debian/debian.go index 0ce1f4d..92fb9c7 100644 --- a/distro/debian/debian.go +++ b/distro/debian/debian.go @@ -379,6 +379,8 @@ func (d Debian) Kernels() (kernels []distro.KernelInfo, err error) { ModulesPath: modules, RootFS: rootfs, + + Package: pkgname, } kernels = append(kernels, ki) diff --git a/distro/kernel.go b/distro/kernel.go index 5008bd8..c5d1130 100644 --- a/distro/kernel.go +++ b/distro/kernel.go @@ -29,4 +29,7 @@ type KernelInfo struct { // Debug symbols VmlinuxPath string + + // Package name, not mandatory (yet) + Package string } diff --git a/kernel.go b/kernel.go index d4df43e..9846f44 100644 --- a/kernel.go +++ b/kernel.go @@ -86,7 +86,14 @@ func (cmd *KernelCmd) GenKernel(km config.Target, pkg string, max *int) { reinstall := false for _, kinfo := range cmd.kcfg.Kernels { - if strings.Contains(pkg, kinfo.KernelVersion) { + var found bool + if kinfo.Distro.ID == distro.Debian { // FIXME + found = pkg == kinfo.Package + } else { + found = strings.Contains(pkg, kinfo.KernelVersion) + } + + if found { if !cmd.Force { flog.Info().Msg("already installed") return