public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-next] kbuild: Respect request to silent output when merging configs
@ 2024-12-03 13:55 Leon Romanovsky
  2024-12-03 13:59 ` Leon Romanovsky
  2024-12-04  8:25 ` Masahiro Yamada
  0 siblings, 2 replies; 8+ messages in thread
From: Leon Romanovsky @ 2024-12-03 13:55 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Leon Romanovsky, linux-kbuild, linux-kernel

From: Leon Romanovsky <leonro@nvidia.com>

Builds with -s option (silent) are supposed to silence all output
which is not an error. It is the case for target builds but not
for configs. These builds generate prints like this:

➜  kernel git:(rdma-next) make -s defconfig debug.config
 Using .config as base
 Merging ./kernel/configs/debug.config
 #
 # merged configuration written to .config (needs make)
 #
 ...
 Value of CONFIG_FUNCTION_TRACER is redefined by fragment ./kernel/configs/debug.config:
 Previous value: # CONFIG_FUNCTION_TRACER is not set
 New value: CONFIG_FUNCTION_TRACER=y
 ----

Let's honor -s option and hide all non-error output.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 scripts/kconfig/Makefile        |  3 ++-
 scripts/kconfig/merge_config.sh | 18 +++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index a0a0be38cbdc..130c3c74b828 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -15,6 +15,7 @@ endif
 
 ifeq ($(quiet),silent_)
 silent := -s
+silent_merge := -q
 endif
 
 export KCONFIG_DEFCONFIG_LIST :=
@@ -107,7 +108,7 @@ config-fragments = $(call configfiles,$@)
 
 %.config: $(obj)/conf
 	$(if $(config-fragments),, $(error $@ fragment does not exists on this architecture))
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m $(KCONFIG_CONFIG) $(config-fragments)
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh $(silent_merge) -m $(KCONFIG_CONFIG) $(config-fragments)
 	$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
 
 PHONY += tinyconfig
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 0b7952471c18..29060fba84b6 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -30,6 +30,7 @@ usage() {
 	echo "  -O    dir to put generated output files.  Consider setting \$KCONFIG_CONFIG instead."
 	echo "  -s    strict mode. Fail if the fragment redefines any value."
 	echo "  -Q    disable warning messages for overridden options."
+	echo "  -q    be quiet."
 	echo
 	echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
 }
@@ -42,6 +43,7 @@ OUTPUT=.
 STRICT=false
 CONFIG_PREFIX=${CONFIG_-CONFIG_}
 WARNOVERRIDE=echo
+QUIET=echo
 
 while true; do
 	case $1 in
@@ -89,6 +91,12 @@ while true; do
 		shift
 		continue
 		;;
+	"-q")
+		WARNOVERRIDE=true
+		QUIET=true
+		shift
+		continue
+		;;
 	*)
 		break
 		;;
@@ -123,7 +131,7 @@ SED_CONFIG_EXP2="s/^# \(${CONFIG_PREFIX}[a-zA-Z0-9_]*\) is not set$/\1/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 MERGE_FILE=$(mktemp ./.merge_tmp.config.XXXXXXXXXX)
 
-echo "Using $INITFILE as base"
+${QUIET} "Using $INITFILE as base"
 
 trap clean_up EXIT
 
@@ -131,7 +139,7 @@ cat $INITFILE > $TMP_FILE
 
 # Merge files, printing warnings on overridden values
 for ORIG_MERGE_FILE in $MERGE_LIST ; do
-	echo "Merging $ORIG_MERGE_FILE"
+	${QUIET} "Merging $ORIG_MERGE_FILE"
 	if [ ! -r "$ORIG_MERGE_FILE" ]; then
 		echo "The merge file '$ORIG_MERGE_FILE' does not exist.  Exit." >&2
 		exit 1
@@ -179,9 +187,9 @@ fi
 
 if [ "$RUNMAKE" = "false" ]; then
 	cp -T -- "$TMP_FILE" "$KCONFIG_CONFIG"
-	echo "#"
-	echo "# merged configuration written to $KCONFIG_CONFIG (needs make)"
-	echo "#"
+	${QUIET} "#"
+	${QUIET} "# merged configuration written to $KCONFIG_CONFIG (needs make)"
+	${QUIET} "#"
 	exit
 fi
 
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-12-09  8:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 13:55 [PATCH rdma-next] kbuild: Respect request to silent output when merging configs Leon Romanovsky
2024-12-03 13:59 ` Leon Romanovsky
2024-12-04  8:25 ` Masahiro Yamada
2024-12-04  8:49   ` Leon Romanovsky
2024-12-08 14:49     ` Masahiro Yamada
2024-12-08 16:35       ` Leon Romanovsky
2024-12-09  5:34         ` Masahiro Yamada
2024-12-09  8:43           ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox