Skip to contentSkip to conversation

scripts: kconfig: merge_config.sh: keep temp file in the output dir

PATCH In review Gustavo Luiz Duarte 3 participants 3 messages Jul 10 – Jul 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scripts: kconfig: merge_config.sh: keep temp file in the output dir

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.

---
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 scripts/kconfig/merge_config.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/merge_config.sh +1 -1
index f08e0863b7128..ec242e03f509f 100755
@@ -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,

Signature · 1 line
Gustavo Luiz Duarte <[email protected]>
Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 7 lines · Gustavo Luiz Duarte

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.

Quoted 8 lines

---
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 scripts/kconfig/merge_config.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

maintainer
#2 lore raw
In reply to Gustavo Luiz Duarte
Quoted 8 lines · Gustavo Luiz Duarte

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.

[...]

Applied to kbuild/linux.git (kbuild-next-unstable), thanks!

[1/1] scripts: kconfig: merge_config.sh: keep temp file in the output dir

      https://git.kernel.org/kbuild/c/8d905d34

Please look out for regression or issue reports or other follow up comments, as they may result in the patch/series getting dropped, reverted or modified (e.g. trailers). Patches applied to the kbuild-next-unstable branch are accepted pending wider testing in linux-next and any post-commit review; they will generally be moved to the kbuild-next branch in about a week if no issues are found.

Best regards,

Signature · 1 line
Nicolas