[U-Boot] [PATCH] cmd: pxe: execute the cls command only when supported

Patrick Delaunay patrick.delaunay at st.com
Tue Dec 3 09:38:35 CET 2019


Execute the command cls (for clear screen), when the "menu background"
keyword is present in extlinux.conf file, only if the command is supported.

This patch avoid the warning "Unknown command 'cls'"
with "menu background" in extlinux.conf when CONFIG_CMD_BMP is activated
and CONFIG_CMD_CLS not activated (default for CONFIG_DM_VIDEO).

Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

 cmd/pxe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/pxe.c b/cmd/pxe.c
index 2059975446..b62cb79b3a 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -1592,7 +1592,8 @@ static void handle_pxe_menu(cmd_tbl_t *cmdtp, struct pxe_menu *cfg)
 	/* display BMP if available */
 	if (cfg->bmp) {
 		if (get_relfile(cmdtp, cfg->bmp, load_addr)) {
-			run_command("cls", 0);
+			if (CONFIG_IS_ENABLED(CMD_CLS))
+				run_command("cls", 0);
 			bmp_display(load_addr,
 				    BMP_ALIGN_CENTER, BMP_ALIGN_CENTER);
 		} else {
-- 
2.17.1



More information about the U-Boot mailing list