[PATCH] cmd: ufetch: fix compiling with no CONFIG_SYS_CONFIG_NAME

David Lechner dlechner at baylibre.com
Thu Jun 11 23:59:13 CEST 2026


Add some preprocessor guards to avoid a compile error when
CONFIG_SYS_CONFIG_NAME is not defined.

Signed-off-by: David Lechner <dlechner at baylibre.com>
---
 cmd/ufetch.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmd/ufetch.c b/cmd/ufetch.c
index e7b5d773f5e..ff2d1deb24c 100644
--- a/cmd/ufetch.c
+++ b/cmd/ufetch.c
@@ -60,7 +60,9 @@ enum output_lines {
 	FIRST,
 	SECOND,
 	KERNEL,
+#ifdef CONFIG_SYS_CONFIG_NAME
 	SYSINFO,
+#endif
 	HOST,
 	UPTIME,
 	IP,
@@ -125,9 +127,11 @@ static int do_ufetch(struct cmd_tbl *cmdtp, int flag, int argc,
 		case KERNEL:
 			printf("Kernel:" RESET " %s\n", U_BOOT_VERSION);
 			break;
+#ifdef CONFIG_SYS_CONFIG_NAME
 		case SYSINFO:
 			printf("Config:" RESET " %s_defconfig\n", CONFIG_SYS_CONFIG_NAME);
 			break;
+#endif
 		case HOST:
 			model = ofnode_read_string(ofnode_root(), "model");
 			if (model)

---
base-commit: 53e9c41847c24b422ecd21421204d4e6a0c07d76
change-id: 20260611-fix-ufetch-compile-ce0e6e86e3e6

Best regards,
--  
David Lechner <dlechner at baylibre.com>



More information about the U-Boot mailing list