From patchwork Tue Oct 14 11:12:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 593 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org Authentication-Results: mail.u-boot.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Nl+9Z8I+; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C3BC46813B for ; Tue, 14 Oct 2025 05:13:52 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 6n1r27FAkoiE for ; Tue, 14 Oct 2025 05:13:52 -0600 (MDT) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3DC9568112 for ; Tue, 14 Oct 2025 05:13:51 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9057F68148 for ; Tue, 14 Oct 2025 05:13:45 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MiqV7OZ9p-qe for ; Tue, 14 Oct 2025 05:13:45 -0600 (MDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.173; helo=mail-il1-f173.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mail.u-boot.org (Postfix) with ESMTPS id 90AB26813F for ; Tue, 14 Oct 2025 05:13:44 -0600 (MDT) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-42f9353c810so21073995ab.0 for ; Tue, 14 Oct 2025 04:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760440423; x=1761045223; darn=u-boot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=igU6Kbeh2O78EqgdfSdpCF0s3uHBXmBjXBfWnNuQYzg=; b=Nl+9Z8I+Htmc8tKzO8NP/6UNeUI9+6Ooo4+h0V3SGKw7BRjO/7jilNoTN2TO1CJLYp oZPLdGCgS2xi8E8gcZndey9W8gU11G53OYR1QPchY+WlIHd5LfTFTDQEmI1E9vlTjERc 1C+ir14blIUvRe08Y2Ly4015uG/6q3JxTjMhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760440423; x=1761045223; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=igU6Kbeh2O78EqgdfSdpCF0s3uHBXmBjXBfWnNuQYzg=; b=jnhCVgXT/3Oo6CyBbuMXULqKPIFIXKOqg7lc5i7LzPvAwYzkJGmVJqjY1oECORgnpM QlOOSAvpiQHqdukxp91Ziu7/7f8509Xg/BEuZTDfO0Uee+5hdfLH3r7oS+Wzd+KgbHQ0 Vy65wPktnCtHeW7g8CuxvLq8ALdocTbr+wnZXAy+VLvZeujU+F9KoOskGVpp4pjYnOnj VspDmJpyT5OYYlhz2TrzDi31TwmDcJgvYj0EEHMf+CkuUXgv2qjosQ4p5yLGoetmrwnC 1Y3eU2R0fZN2wdh+4czp+gcCHk4OoMo7yco+5naFAXWWdSZK3b6h9avdaY/s4RyHjsoa ehLg== X-Gm-Message-State: AOJu0YwVUQ9eu5wg7OIP8RHdU/F+ZXZER5cb+iJIZRU0xqFm2tUtEwBt LfOeppRdEjN5Q0YSvn9Yx99eY2sS4SVYNqC4yTNFJ5pjWnYZKe4OP1EWVbXERu1P7kW0/U0CWUt 8f3VopNRYiZc= X-Gm-Gg: ASbGncvMtqv52E9obGm1UAlcigd7Aq/L82DU12VMOukj6BZtQCkG+NxmK4a/XynTNVq uAIyXm3fMsViuQVUSskW1U/DDLv3sT5+ASKi0UjhM9gJw/7uX3GhT2KJKlKXzJkoMhjj6gmg+Rj GDU0JJWpGgN+f3oZ0zB744c9Z9cAZDGONZNJpaOJqPOPkA2gzdIpL4tpdwgQ2lXyaukoyXsZpIA Lij4xuDsWGflRwpMiM/n7vaLrtBl0bZszuUIRd05NRYci1WscURjQXQpGqTRoXVJhvtpL40BWG6 H06aqiMV2Bu3T8AtEvS96UXwywUeofLl2flCWDrXB8RySh93HmUDTYHE3WfLKAXvXeZ8YH6Nz+L bWmBGP+L2SWAKZQPt5IgHvtvNN4M8DuMv0Em/3wEkR9s9Kw== X-Google-Smtp-Source: AGHT+IGdYwovnbbd01EzYrU4ilNC0AWMDto9bVsrf9iUHnH5FaAb3oGft+mvtRF2ZCallsr6apizPg== X-Received: by 2002:a92:c26e:0:b0:42d:86fb:d871 with SMTP id e9e14a558f8ab-42f873ed35amr212098925ab.21.1760440422770; Tue, 14 Oct 2025 04:13:42 -0700 (PDT) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-430a3869174sm4608785ab.15.2025.10.14.04.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 04:13:41 -0700 (PDT) From: Simon Glass To: U-Boot Concept Date: Tue, 14 Oct 2025 05:12:47 -0600 Message-ID: <20251014111301.1059317-11-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251014111301.1059317-1-sjg@chromium.org> References: <20251014111301.1059317-1-sjg@chromium.org> MIME-Version: 1.0 Message-ID-Hash: G7HW35KAZPCKDTWAOX56XXE2KQLJPEBY X-Message-ID-Hash: G7HW35KAZPCKDTWAOX56XXE2KQLJPEBY X-MailFrom: sjg@chromium.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/16] boot: Move prompt strings into bootflow_menu_set_props() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: These strings are part of the basic menu and may be different for other menus. Rather than setting them up on creation, add them as part of setting the properties of the objects. Provide a way to set the title as well. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 40 ++++++++++++++++++++++++++++++---------- include/bootflow.h | 4 +++- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index b66ab2d3b73..3df15959c0e 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -32,8 +32,10 @@ struct menu_priv { struct udevice *last_bootdev; }; -int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo) +int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo, + const char *title) { + struct abuf *buf; int ret = 0; bool use_font; @@ -69,6 +71,28 @@ int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo) scene_obj_set_hide(scn, OBJ_PROMPT1B, !use_font); scene_obj_set_hide(scn, OBJ_AUTOBOOT, use_font); + /* Set the title and prompt texts */ + ret = expo_edit_str(exp, STR_MENU_TITLE, NULL, &buf); + if (ret) + return log_msg_ret("mss", ret); + abuf_printf(buf, "%s", title); + + ret = expo_edit_str(exp, STR_PROMPT1A, NULL, &buf); + if (!ret) + abuf_printf(buf, "Use the \x18 and \x19 keys to select which " + "entry is highlighted."); + + ret = expo_edit_str(exp, STR_PROMPT1B, NULL, &buf); + if (!ret) + abuf_printf(buf, "Use the UP and DOWN keys to select which " + "entry is highlighted."); + + ret = expo_edit_str(exp, STR_PROMPT2, NULL, &buf); + if (!ret) + abuf_printf(buf, "Press enter to boot the selected OS, 'e' to " + "edit the commands before booting or 'c' for a " + "command-line. ESC to return to previous menu"); + exp->show_highlight = true; return 0; @@ -104,22 +128,18 @@ int bootflow_menu_new(struct expo **expp) ret = scene_menu(scn, "main", OBJ_MENU, &menu); ret |= scene_txt_str(scn, "title", OBJ_MENU_TITLE, STR_MENU_TITLE, - "U-Boot - Boot Menu", NULL); + "", NULL); logo = video_get_u_boot_logo(NULL); if (logo) ret |= scene_img(scn, "ulogo", OBJ_U_BOOT_LOGO, logo, NULL); ret |= scene_txt_str(scn, "prompt1a", OBJ_PROMPT1A, STR_PROMPT1A, - "Use the \x18 and \x19 keys to select which entry is highlighted.", - NULL); + "", NULL); ret |= scene_txt_str(scn, "prompt1b", OBJ_PROMPT1B, STR_PROMPT1B, - "Use the UP and DOWN keys to select which entry is highlighted.", - NULL); + "", NULL); ret |= scene_txt_str(scn, "prompt2", OBJ_PROMPT2, STR_PROMPT2, - "Press enter to boot the selected OS, 'e' to edit the commands " - "before booting or 'c' for a command-line. ESC to return to " - "previous menu", NULL); + "", NULL); ret |= scene_txt_str(scn, "autoboot", OBJ_AUTOBOOT, STR_AUTOBOOT, "The highlighted entry will be executed automatically in %ds.", NULL); @@ -129,7 +149,7 @@ int bootflow_menu_new(struct expo **expp) if (ret < 0) return log_msg_ret("new", -EINVAL); - ret = bootflow_menu_set_props(exp, scn, logo); + ret = bootflow_menu_set_props(exp, scn, logo, "U-Boot - Boot Menu"); if (ret < 0) return log_msg_ret("nep", -EINVAL); diff --git a/include/bootflow.h b/include/bootflow.h index 9ee11b33dbf..3a5c7bce847 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -569,8 +569,10 @@ int bootflow_menu_apply_theme(struct expo *exp, ofnode node); * @exp: Expo to update * @scn: Scene to update * @has_logo: true if a logo should be visible + * @title: Title to use for the boot menu */ -int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo); +int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo, + const char *title); #define BOOTFLOWCL_EMPTY ((void *)1)