From c5584a08038270c4bd456aeb8cc9d2f6169505b8 Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Wed, 2 Sep 2026 15:09:46 +0200 Subject: [PATCH] generate-defconfig: handle missing trailing newline merge_config.sh appends each file with cat, which inserts nothing between files. A file that does not end with a newline therefore sticks its last line to the first line of the next. Like: BR2_PACKAGE_FOO=yBR2_ROOTFS_OVERLAY="..." Kconfig cannot parse that, so both settings are silently dropped and the generated defconfig keeps the base value instead. This commit concatenate the fragments with awk. This terminates every line, so the result no longer depends on how the input files ends. Signed-off-by: Richard Alpe --- utils/generate-defconfig.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/generate-defconfig.sh b/utils/generate-defconfig.sh index 4cdd7a59c..ecec2af7b 100755 --- a/utils/generate-defconfig.sh +++ b/utils/generate-defconfig.sh @@ -79,7 +79,11 @@ for change in $changes; do done TMPDIR=`mktemp -d` -$MERGE_CONFIG -O "$TMPDIR" "$base" "$changes" + +# Concatenate the changes with awk. This terminates every line, so a file +# without a trailing newline won't glue its last line to the next file's first. +awk '{print}' $changes > "$TMPDIR/changes.conf" +$MERGE_CONFIG -O "$TMPDIR" "$base" "$TMPDIR/changes.conf" O="$TMPDIR" make savedefconfig mv "$TMPDIR"/defconfig "$output"