feat: generate all kernels if no distro is set
This commit is contained in:
parent
ad3a76320e
commit
10c5fb7ac4
21
kernel.go
21
kernel.go
@ -269,8 +269,8 @@ func (cmd KernelAutogenCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type KernelGenallCmd struct {
|
type KernelGenallCmd struct {
|
||||||
Distro string `required:"" help:"distribution"`
|
Distro string `help:"distribution"`
|
||||||
Ver string `required:"" help:"distro version"`
|
Ver string `help:"distro version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *KernelGenallCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error) {
|
func (cmd *KernelGenallCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error) {
|
||||||
@ -281,14 +281,25 @@ func (cmd *KernelGenallCmd) Run(kernelCmd *KernelCmd, g *Globals) (err error) {
|
|||||||
|
|
||||||
kernel.SetSigintHandler(&kernelCmd.shutdown)
|
kernel.SetSigintHandler(&kernelCmd.shutdown)
|
||||||
|
|
||||||
km := config.Target{
|
for _, dist := range distro.List() {
|
||||||
Distro: distro.Distro{ID: distroType, Release: cmd.Ver},
|
if distroType != distro.None && distroType != dist.ID {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if cmd.Ver != "" && dist.Release != cmd.Ver {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
target := config.Target{
|
||||||
|
Distro: dist,
|
||||||
Kernel: config.Kernel{Regex: ".*"},
|
Kernel: config.Kernel{Regex: ".*"},
|
||||||
}
|
}
|
||||||
err = kernelCmd.Generate(g, km, math.MaxUint32)
|
|
||||||
|
err = kernelCmd.Generate(g, target, math.MaxUint32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return kernelCmd.UpdateConfig()
|
return kernelCmd.UpdateConfig()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user