2 Commits
2.3.0 ... 2.3.1

Author SHA1 Message Date
Clayton Craft
1a99953aa2 bootdeploy: fallback to vmlinuz* kernels when zboot is set (MR 47)
Some kernel packages (e.g. linux-lts in Alpine) don't ship linux.efi, so
this needs to fallback to "vmlinuz" or else it won't be able to find a
kernel for boot-deploy.
2024-01-29 15:32:25 -08:00
Clayton Craft
e2f4e6254f modules: fix issue with some module extensions being ignored in dirs (MR 46)
There are several valid extensions that kernel modules can have, and the
list I had here was not complete... this meant that mkinitfs would fail
to include modules with extensions like ".ko.gz" when searching
directories.

This makes the check for a "valid" module file name a lot simpler,
allowing any file with ".ko" in the file name. While it's possible for a
non-module file to have ".ko" somewhere in the file name, it seems
unlikely if it's in the kernel modules directory... and this is an OK
compromise for now.
2024-01-29 10:16:28 -08:00
2 changed files with 10 additions and 5 deletions

View File

@@ -95,13 +95,16 @@ func (b *BootDeploy) Run() error {
} }
func getKernelPath(outDir string, zboot bool) ([]string, error) { func getKernelPath(outDir string, zboot bool) ([]string, error) {
kernFile := "vmlinuz*" var kernels []string
if zboot { if zboot {
kernFile = "linux.efi" kernels, _ = filepath.Glob(filepath.Join(outDir, "linux.efi"))
if len(kernels) > 0 {
return kernels, nil
}
// else fallback to vmlinuz* below
} }
var kernels []string kernFile := "vmlinuz*"
kernels, _ = filepath.Glob(filepath.Join(outDir, kernFile)) kernels, _ = filepath.Glob(filepath.Join(outDir, kernFile))
if len(kernels) == 0 { if len(kernels) == 0 {
return nil, errors.New("Unable to find any kernels at " + filepath.Join(outDir, kernFile)) return nil, errors.New("Unable to find any kernels at " + filepath.Join(outDir, kernFile))

View File

@@ -118,7 +118,9 @@ func getModulesInDir(modPath string) (files []string, err error) {
// Unable to walk path // Unable to walk path
return err return err
} }
if filepath.Ext(path) != ".ko" && filepath.Ext(path) != ".xz" { // this assumes module names are in the format <name>.ko[.format],
// where ".format" (e.g. ".gz") is optional.
if !strings.Contains(".ko", path) {
return nil return nil
} }
files = append(files, path) files = append(files, path)