blueprint: add kernel name customization

Blueprints can now be used to specify a kernel as part of the kernel
customizations.  Specifying a kernel adds it to the package list.

If no known kernel is specified (neither in the customizations nor the
package list), the default "kernel" is included automatically.

If kernels are specified in both the package list and the
customizations, both are added (even if they're duplicates).
This commit is contained in:
Achilleas Koutsou 2021-02-01 14:45:26 +01:00 committed by Tom Gundersen
parent a85511c6de
commit b861042032
2 changed files with 9 additions and 0 deletions

View file

@ -103,6 +103,14 @@ func (b *Blueprint) GetPackages() []string {
for _, group := range b.Groups {
packages = append(packages, "@"+group.Name)
}
if kc := b.Customizations.GetKernel(); kc != nil && kc.Name != "" {
kpkg := Package{Name: b.Customizations.Kernel.Name}
packages = append(packages, kpkg.ToNameVersion())
} else { // no Kernel specified; add default
kpkg := Package{Name: "kernel"}
packages = append(packages, kpkg.ToNameVersion())
}
return packages
}

View file

@ -13,6 +13,7 @@ type Customizations struct {
}
type KernelCustomization struct {
Name string `json:"name,omitempty" toml:"name,omitempty"`
Append string `json:"append" toml:"append"`
}