From patchwork Tue Oct 14 11:12:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 597 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=Icn/fUYT; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 02FBB6814F for ; Tue, 14 Oct 2025 05:13:58 -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 R_FSHIMUKdWm for ; Tue, 14 Oct 2025 05:13:57 -0600 (MDT) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 44D3768146 for ; Tue, 14 Oct 2025 05:13:56 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A98B36814D 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 60ncQRGRPI1f for ; Tue, 14 Oct 2025 05:13:52 -0600 (MDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.170; helo=mail-il1-f170.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by mail.u-boot.org (Postfix) with ESMTPS id DE25468143 for ; Tue, 14 Oct 2025 05:13:50 -0600 (MDT) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-42f9f5a9992so33877875ab.2 for ; Tue, 14 Oct 2025 04:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760440430; x=1761045230; 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=g6AUsZ9yBb3k2sGL0hOy+0NxPU/cXV09Z63e3XRI5hE=; b=Icn/fUYT0+r2KtzUMknD19gufh7A6Og5dqskiedRPm4Z5B6RIaM7AgGDCOq/pB4MVz rfDaIYYB9qtDz5lI0umVHs32kyEKR4284U129g/d7zz6YrWfyPTQjY13Dz+C3KB9CUA1 rMDiuuN8bHrQ9kXgvXlf8LAeCbFVpm814SlbQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760440430; x=1761045230; 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=g6AUsZ9yBb3k2sGL0hOy+0NxPU/cXV09Z63e3XRI5hE=; b=nehWDdgti6J9f5wnwxGkXZIGRcWHqnN1sYjH/Vhw0Nr5EXn3mpPXYxYFK7I/aOK3kF dBnp7IjRqdqbqMYuiMs9VT/ugxADE5f58XUUETb4J2hdX1GNke+xPb5RcxOz3CTGHPaW kJYvXqA7Vrk+uEdNbeIgMylskgFbJ1Rkvq15zNyMEA2YhlajMCcEyBphgUi65/dQnmOY K/OU9O3t+Prc0EvrgBMO8YqveKvj/7iYnOT3omtefScTxrvCwAsIX2KUT3HEAXIbiLdd HKK2qrIcZfFb1kV7kk0VTCZroY077mfrx6Z4719+iNFH6gqreM2iGGC7/icBqA8pDQ9W 7/WQ== X-Gm-Message-State: AOJu0Yy5+3IIJBWa6G6sOCerguq6YHWakts4WDln3xHsKhZEwA+bmGCE StX2fAgpHySAZLwXIYhA0brfovXB238cSClkXJYRSv8TH64d1fhCCo4QzNptu8kLLBnkhwM2Gx/ 0DbxxLozxDmE= X-Gm-Gg: ASbGncthTUQd+yAa711sF9WL+WvUjAKhp/wBE1lxVxSVXItRdxeQ5YnL7xGpXbmfFER z3yNzJUS5RRYsSksKZV9D7GOwUbT8o7E3BbrpYvrOvKHCwmBcvPlKba35FYbWAPf0EcgPa2+oPY lMarSGGcR+/e1dfeyirZgAgjpu/YB0H1djPY95jauhJyNJkuMv6aZw+lA0RFVU6pLaiWr6hfwwc hToxLjoHwDBCFZe92i1Z8IIf4Wvx3URt5BFIqPM2wdqAMtnnkHa95Nq7ljYEgH5hb0wuCgm25EV TRImUwR7bYhC4nXgAbHoZntCvOgIFpmte67+X3H6AM6B27xrl9qqtR5W+mr5YJV5w3W6ZLHe2F2 LTae0vomk69lXXRALjfH8wwWR3uhQx/M96OQ= X-Google-Smtp-Source: AGHT+IFV6FZ/qQOeWOyR8R92Jcdc5VJ+TJAkjOy7kn5tla7BXglW3Z78RyIJs9yU0VCLUFvD25J3jQ== X-Received: by 2002:a92:cd8c:0:b0:42f:989d:ae59 with SMTP id e9e14a558f8ab-42f989daf5emr181024545ab.28.1760440429612; Tue, 14 Oct 2025 04:13:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 04:13:48 -0700 (PDT) From: Simon Glass To: U-Boot Concept Date: Tue, 14 Oct 2025 05:12:50 -0600 Message-ID: <20251014111301.1059317-14-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: RNEXUNORAHITAUHLG5J7AJ2LLUWSPCDD X-Message-ID-Hash: RNEXUNORAHITAUHLG5J7AJ2LLUWSPCDD 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 13/16] boot: Move text for desc and label items to after setup List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use the bootflow_menu_set_item_props() to set the text in these items, since it can be presented differently depending on the layout. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 057ebee01a1..5f559e2220c 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -35,6 +35,8 @@ struct menu_priv { static int bootflow_menu_set_item_props(struct scene *scn, int i, const struct bootflow *bflow) { + struct expo *exp = scn->expo; + struct abuf *buf; int ret; scene_obj_set_hide(scn, ITEM_PREVIEW + i, true); @@ -45,6 +47,15 @@ static int bootflow_menu_set_item_props(struct scene *scn, if (ret) return log_msg_ret("msp", ret); + ret = expo_edit_str(exp, STR_DESC + i, NULL, &buf); + if (ret) + return log_msg_ret("msr", ret); + abuf_printf(buf, "%s", bflow->os_name ? bflow->os_name : bflow->name); + + ret = expo_edit_str(exp, STR_LABEL + i, NULL, &buf); + if (!ret) + abuf_printf(buf, "%s", bootflow_guess_label(bflow)); + return 0; } @@ -190,9 +201,8 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, struct scene **scnp) { struct menu_priv *priv = exp->priv; - char str[2], *label, *key; + char str[2], *key; struct scene *scn; - const char *name; uint preview_id; uint scene_id; bool add_gap; @@ -210,14 +220,6 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, if (!key) return log_msg_ret("key", -ENOMEM); - name = bootflow_guess_label(bflow); - label = strdup(name); - - if (!label) { - free(key); - return log_msg_ret("nam", -ENOMEM); - } - add_gap = priv->last_bootdev != bflow->dev; /* disable this gap for now, since it looks a little ugly */ @@ -226,10 +228,9 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, ret = expo_str(exp, "prompt", STR_POINTER, ">"); ret |= scene_txt_str(scn, "label", ITEM_LABEL + seq, - STR_LABEL + seq, label, NULL); + STR_LABEL + seq, "", NULL); ret |= scene_txt_str(scn, "desc", ITEM_DESC + seq, STR_DESC + seq, - bflow->os_name ? bflow->os_name : - bflow->name, NULL); + "", NULL); ret |= scene_txt_str(scn, "key", ITEM_KEY + seq, STR_KEY + seq, key, NULL); ret |= scene_box(scn, "item-box", ITEM_BOX + seq, 1, false, NULL);