Skip to content

Commit

Permalink
fix(action/linux): defconfig filename
Browse files Browse the repository at this point in the history
- we have discovered that the defconfig filename must end with defconfig

Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Aug 27, 2024
1 parent 6a4f3d0 commit 4b9e9d4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion action/recipes/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"log/slog"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"

Expand Down Expand Up @@ -102,7 +103,16 @@ func (opts LinuxOpts) buildFirmware(ctx context.Context, client *dagger.Client,
// but defconfigBasename="linux_defconfig" works fine
// Don't know why, just return error and let user deal with it.
return nil, fmt.Errorf(
"filename '%s' specified by defconfig_path must not contain '.defconfig' in the name",
"filename '%s' specified by defconfig_path must not contain '.defconfig'",
defconfigBasename,
)
}
defconfigRegex := regexp.MustCompile(`.*defconfig$`)
if !defconfigRegex.MatchString(defconfigBasename) {
// 'make $defconfigBasename' will fail for Linux kernel if the file
// does not end with 'defconfig'
return nil, fmt.Errorf(
"filename '%s' specified by defconfig_path must end with 'defconfig'",
defconfigBasename,
)
}
Expand Down

0 comments on commit 4b9e9d4

Please sign in to comment.