[PATCH v2] scripts: kconfig: merge_config.sh: keep temp file in the output dir

Gustavo Luiz Duarte <[email protected]> Fri, 10 Jul 2026 07:03:33 -0700
Newsgroups gmane.linux.kernel,gmane.linux.kbuild.devel
Message-ID <[email protected]>
merge_config.sh currently creates a temporary file in the current
directory. Create it under $OUTPUT instead, which allows running the
script against a read-only source tree.

The default behavior is unchanged: $OUTPUT is "." so the file stays in
the cwd.

Reviewed-by: Breno Leitao <[email protected]>
Signed-off-by: Gustavo Luiz Duarte <[email protected]>
---
- Link to v1: https://lore.kernel.org/r/[email protected]
---
 scripts/kconfig/merge_config.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index f08e0863b7128..ec242e03f509f 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -122,7 +122,7 @@ fi
 
 MERGE_LIST=$*
 
-TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
+TMP_FILE=$(mktemp --tmpdir="$OUTPUT" .tmp.config.XXXXXXXXXX)
 
 echo "Using $INITFILE as base"
 

---
base-commit: 0e35b9b6ec0ffcc5e23cbdec09f5c622ad532b53
change-id: 20260708-merge_config_output-d90c161a923c

Best regards,
-- 
Gustavo Luiz Duarte <[email protected]>