Re: [PATCH] scripts: kconfig: merge_config.sh: create tmp file for awk

From: Nathan Chancellor

Date: Wed Mar 11 2026 - 03:48:24 EST


On Tue, Mar 10, 2026 at 12:51:14PM +0200, Mikko Rapeli wrote:
> From: Nathan Chancellor <nathan@xxxxxxxxxx>
>
> For some reason some awk versions/configurations fail to create
> this output file. Create it in the shell script part before
> providing it to awk.
>
> Reported-by: Andreas Larsson <andreas@xxxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-kbuild/acb36651-449a-43e4-afe2-ba42a435cbb0@xxxxxxxxxxx/
> Fixes: 5fa9b82cbcfc ("scripts: kconfig: merge_config.sh: refactor from shell/sed/grep to awk")
> Tested-by: Andreas Larsson <andreas@xxxxxxxxxxx>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@xxxxxxxxxx>

Even though it is a bigger patch, I think I prefer Daniel's submitted
fix for this issue:

https://lore.kernel.org/20260310-fixes-merge-config-v1-1-beaeeaded6bd@xxxxxxxxxxx/

> ---
> scripts/kconfig/merge_config.sh | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index 735e1de450c6..070ecae87a1c 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -123,6 +123,7 @@ fi
> MERGE_LIST=$*
>
> TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
> +touch "$TMP_FILE.new"
>
> echo "Using $INITFILE as base"
>
> --
> 2.34.1
>