From 4b9e9d442fb53f3140a1c5486c3e35038245d24a Mon Sep 17 00:00:00 2001 From: AtomicFS Date: Tue, 27 Aug 2024 16:27:23 +0200 Subject: [PATCH] fix(action/linux): defconfig filename - we have discovered that the defconfig filename must end with defconfig Signed-off-by: AtomicFS --- action/recipes/linux.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action/recipes/linux.go b/action/recipes/linux.go index 70f33c3c..6d98b00f 100644 --- a/action/recipes/linux.go +++ b/action/recipes/linux.go @@ -10,6 +10,7 @@ import ( "log/slog" "os" "path/filepath" + "regexp" "runtime" "strings" @@ -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, ) }