feat: add package name, use for debian check if already installed
This commit is contained in:
parent
1a9fdf0917
commit
d7cf88e34f
@ -379,6 +379,8 @@ func (d Debian) Kernels() (kernels []distro.KernelInfo, err error) {
|
|||||||
ModulesPath: modules,
|
ModulesPath: modules,
|
||||||
|
|
||||||
RootFS: rootfs,
|
RootFS: rootfs,
|
||||||
|
|
||||||
|
Package: pkgname,
|
||||||
}
|
}
|
||||||
|
|
||||||
kernels = append(kernels, ki)
|
kernels = append(kernels, ki)
|
||||||
|
@ -29,4 +29,7 @@ type KernelInfo struct {
|
|||||||
|
|
||||||
// Debug symbols
|
// Debug symbols
|
||||||
VmlinuxPath string
|
VmlinuxPath string
|
||||||
|
|
||||||
|
// Package name, not mandatory (yet)
|
||||||
|
Package string
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,14 @@ func (cmd *KernelCmd) GenKernel(km config.Target, pkg string, max *int) {
|
|||||||
|
|
||||||
reinstall := false
|
reinstall := false
|
||||||
for _, kinfo := range cmd.kcfg.Kernels {
|
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 {
|
if !cmd.Force {
|
||||||
flog.Info().Msg("already installed")
|
flog.Info().Msg("already installed")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user