]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kconfig: merge_config: use an empty file as initfile
authorDaniel Gomez <da.gomez@samsung.com>
Fri, 28 Mar 2025 14:28:37 +0000 (14:28 +0000)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 5 Apr 2025 21:22:01 +0000 (06:22 +0900)
The scripts/kconfig/merge_config.sh script requires an existing
$INITFILE (or the $1 argument) as a base file for merging Kconfig
fragments. However, an empty $INITFILE can serve as an initial starting
point, later referenced by the KCONFIG_ALLCONFIG Makefile variable
if -m is not used. This variable can point to any configuration file
containing preset config symbols (the merged output) as stated in
Documentation/kbuild/kconfig.rst. When -m is used $INITFILE will
contain just the merge output requiring the user to run make (i.e.
KCONFIG_ALLCONFIG=<$INITFILE> make <allnoconfig/alldefconfig> or make
olddefconfig).

Instead of failing when `$INITFILE` is missing, create an empty file and
use it as the starting point for merges.

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kconfig/merge_config.sh

index 0b7952471c18f6882b8978f839f3170bb41fb01f..79c09b378be8163774962744e19ba44bfc61a2f7 100755 (executable)
@@ -112,8 +112,8 @@ INITFILE=$1
 shift;
 
 if [ ! -r "$INITFILE" ]; then
-       echo "The base file '$INITFILE' does not exist.  Exit." >&2
-       exit 1
+       echo "The base file '$INITFILE' does not exist. Creating one..." >&2
+       touch "$INITFILE"
 fi
 
 MERGE_LIST=$*