1
0
Fork 0

feat: add package name, use for debian check if already installed

timestamps
dump_stack() 2023-05-25 23:00:42 +00:00
parent 1a9fdf0917
commit d7cf88e34f
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
3 changed files with 13 additions and 1 deletions

View File

@ -379,6 +379,8 @@ func (d Debian) Kernels() (kernels []distro.KernelInfo, err error) {
ModulesPath: modules,
RootFS: rootfs,
Package: pkgname,
}
kernels = append(kernels, ki)

View File

@ -29,4 +29,7 @@ type KernelInfo struct {
// Debug symbols
VmlinuxPath string
// Package name, not mandatory (yet)
Package string
}

View File

@ -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