From patchwork Mon Dec 8 02:32:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 835 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161184; bh=PweDwYTaoI+AiJ+KrQskqhC+auIeIagjdcmeDJ/BoY4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lo1HKyVsDMh016YeUY1J5m7Zu6GRrFHv7nSUpTAAvTdi+ksyL0NfFqWqEuMqQvBBk kW/42r6Ln0kYqn6e7DenNfWsXRXDhWq/izlRJE5FDHKdQNt3ClQpNGCkjR18x56HK6 RgJooz/snvaAGJ7BXuoq5WCVnLlbNDCwAorFZ8mXVYeB/uwajbJestmDpQ0L7CnVqf 6Y2wPw563uwl8BmoQvkTZOo1dYt8TS34AY5oQ+UWeagZdxRWTotkHLlvqltQ8PhK2n Pd1ikV0HOJGDqlV8zrl77qgaURhqOHpmVmx6IGj42E2GlB2vwDb3lH4hqg5n4X8B1e syFIbi3lwh4cA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5923C688FC for ; Sun, 7 Dec 2025 19:33:04 -0700 (MST) 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 SlhUfaMKrCsD for ; Sun, 7 Dec 2025 19:33:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161184; bh=PweDwYTaoI+AiJ+KrQskqhC+auIeIagjdcmeDJ/BoY4=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lo1HKyVsDMh016YeUY1J5m7Zu6GRrFHv7nSUpTAAvTdi+ksyL0NfFqWqEuMqQvBBk kW/42r6Ln0kYqn6e7DenNfWsXRXDhWq/izlRJE5FDHKdQNt3ClQpNGCkjR18x56HK6 RgJooz/snvaAGJ7BXuoq5WCVnLlbNDCwAorFZ8mXVYeB/uwajbJestmDpQ0L7CnVqf 6Y2wPw563uwl8BmoQvkTZOo1dYt8TS34AY5oQ+UWeagZdxRWTotkHLlvqltQ8PhK2n Pd1ikV0HOJGDqlV8zrl77qgaURhqOHpmVmx6IGj42E2GlB2vwDb3lH4hqg5n4X8B1e syFIbi3lwh4cA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0DF3968923 for ; Sun, 7 Dec 2025 19:33:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161179; bh=++10PWR9MJE8JDHEhJ+ZZTPF1wY0m/yfmHxsyUORar0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oeE/W589q2p4Xev/vs91UdIVdDvTtgVsh9ujUZda5Diz6Ou2Yt2tAj/Z9hTU/fFid /IEkL1P+09YkS7JwT5uf8huQcnTB1T2jvQVp6K/C9L+dTYRgZAyW44z9ktRE2Cu3zY jHcwwWL9YFau85dCIqzhB1hr0a9hQFUM4+ZpB5OsIFK8BAm2mq+WdUmn8hxhrzEZbf JeXJESqo6zI4LUanqt1rSjnbUxkK0rHQ2XW+TNKhYbNW+/O3Ll28JaJIZ/FOBYUNG2 DDTTggBHPsGiVusSjrj4YDz4zUaaAYOZ6fyza1KKBQjH01C/OM0QYfkY2TD7ck5lQj TmId92BZ54b6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF032689C7; Sun, 7 Dec 2025 19:32:59 -0700 (MST) 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 10026) with ESMTP id 0YaRsyzzFjII; Sun, 7 Dec 2025 19:32:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161169; bh=wAIVWi6/FPa/UfoCjQcFLyB045+aPWtyNnC6UNrQuCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=loHuOeT+PJZu3rhwMSHRe8+7uivBq23RbJYiyaLU7QOBFwfRCs0ZQC5wN23p0HHaD qxKgWScWphNR+JyD3ukv3RLdIDyVnyiFIYS/PSs65v9YA+4OSDgn/F4fLvg30tLdNi TQ8OdC/nDcLO+T2d3hpBnwaMyIxK+p+lC1NvgXhAtkZ2l3ISF7wG7lip+oPougO7W+ ZplamT0Zyu1GQxuLYFrEuC7JkpuevQNN9uHNP9MYAEdcU86rQHxMX9CZ/E517dL06A x4uAEyP3s2us24ewkwW5yHygpWMoBRuoLZJvA7qaQEstiClh6k25rM37Q7OqZa0oYq qwujh7DcbLs1Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 207726883E; Sun, 7 Dec 2025 19:32:49 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:05 -0700 Message-ID: <20251208023229.3929910-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: I356HJWZ3HHNV6FPNRFLNJSJTNYC5HEG X-Message-ID-Hash: I356HJWZ3HHNV6FPNRFLNJSJTNYC5HEG X-MailFrom: sjg@u-boot.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 02/19] bootctl: Drop unnecessary calls to calculate dimensions List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Since scene_calc_dims() is done by scene_arrange(), we don't need to do an explicit call to scene_calc_dims() first. Drop it from both UIs. Signed-off-by: Simon Glass --- boot/bootctl/multi_ui.c | 9 --------- boot/bootctl/simple_ui.c | 4 ---- 2 files changed, 13 deletions(-) diff --git a/boot/bootctl/multi_ui.c b/boot/bootctl/multi_ui.c index adf48808c0f..975f9a1b91c 100644 --- a/boot/bootctl/multi_ui.c +++ b/boot/bootctl/multi_ui.c @@ -426,10 +426,6 @@ static int multiboot_ui_add(struct udevice *dev, struct osinfo *info) multiboot_set_item_props(scn, seq, &info->bflow); - ret = expo_calc_dims(upriv->expo); - if (ret) - return log_msg_ret("ecd", ret); - if (lpriv->default_os && !strcmp(lpriv->default_os, info->bflow.os_name)) scene_menu_select_item(scn, OBJ_MENU, ITEM + seq); @@ -498,11 +494,6 @@ static int multiboot_ui_switch_layout(struct udevice *dev) return log_msg_ret("props", ret); } - /* Calculate dimensions then re-arrange */ - ret = expo_calc_dims(upriv->expo); - if (ret) - return log_msg_ret("ecd", ret); - ret = scene_arrange(scn); if (ret) return log_msg_ret("arr", ret); diff --git a/boot/bootctl/simple_ui.c b/boot/bootctl/simple_ui.c index 7fb59c8b8c3..58860138a33 100644 --- a/boot/bootctl/simple_ui.c +++ b/boot/bootctl/simple_ui.c @@ -156,10 +156,6 @@ static int simple_ui_add(struct udevice *dev, struct osinfo *info) if (ret) return log_msg_ret("asn", ret); - ret = expo_calc_dims(upriv->expo); - if (ret) - return log_msg_ret("ecd", ret); - if (lpriv->default_os && !strcmp(lpriv->default_os, info->bflow.os_name)) scene_menu_select_item(scn, OBJ_MENU, ITEM + seq); From patchwork Mon Dec 8 02:32:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 836 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161187; bh=jcy/EW9OlvEpnFIP1ea/YkI09O2Gi65g4QMimyb8h80=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nf61s/B3lISM8uFhyUHulSSqpyB+wzFw2pY4pIS6t1i22hVEyVA42uGrrGeDeFZx9 WkQR6ejXWhkpf8a2YPIoroLmpl7YaS8XNTziYCThVWKRsxYm8VGwIDNV6hlFJWJjBs mREwa/Z6EAXeB45rZbrhKWrZwyqFlME4YrKkxdpRFwnJyko0Zjzz5AiHq9QSi2rfwS T2PFV8sbt7WTZUf/dRwIG7+SnqUVsE+7eEL4dzYDdwRfBwPOwJOJdYxmeEZjLrOZYC XvhmUQd9yID4GGvb0MWcTjD9cmaQAwfBrnyhu0rnsTW8APW5rQdneOYoOBdFpKY4aU njFs25RwcxLhA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 771D5689C1 for ; Sun, 7 Dec 2025 19:33:07 -0700 (MST) 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 t_cpx6-VtpCk for ; Sun, 7 Dec 2025 19:33:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161187; bh=jcy/EW9OlvEpnFIP1ea/YkI09O2Gi65g4QMimyb8h80=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nf61s/B3lISM8uFhyUHulSSqpyB+wzFw2pY4pIS6t1i22hVEyVA42uGrrGeDeFZx9 WkQR6ejXWhkpf8a2YPIoroLmpl7YaS8XNTziYCThVWKRsxYm8VGwIDNV6hlFJWJjBs mREwa/Z6EAXeB45rZbrhKWrZwyqFlME4YrKkxdpRFwnJyko0Zjzz5AiHq9QSi2rfwS T2PFV8sbt7WTZUf/dRwIG7+SnqUVsE+7eEL4dzYDdwRfBwPOwJOJdYxmeEZjLrOZYC XvhmUQd9yID4GGvb0MWcTjD9cmaQAwfBrnyhu0rnsTW8APW5rQdneOYoOBdFpKY4aU njFs25RwcxLhA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 65FB268923 for ; Sun, 7 Dec 2025 19:33:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161184; bh=58nk296weUYGOni8grgCkWdHCQLlhJCHYnQOH2Q86lQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cM7WoGsKDpGhJfnBOX/rxwMUjxkVo1V1loJKgL/j7vtdN3jHCSlVE27Fr9D3THmuk pI0NuiNgdUevuRZOZaC9WQXAEKwkN8RHWvP5OLWzwL9AMJB8l/5uZJx+33dXXPasG/ pewI4JRfGGYG4gjz8GeBskcwoR7mhnz1oMcaYaRWN58rCsMSXRBcsud7ZD1+YFQ3RE ggRq7IBicUft2adKudqbeR+59SVCuTZM+pZXzpVcGPaT33I9xD8Ux0CIulxBpeUoqy iT6uHV36DjqcItZeHzWsCMLrJSyaBZhbCDpZ5PQJtQNXMVw1iRCCyzkpMbINRVJpa0 TdY2GmUgKj77w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DC7C36883E; Sun, 7 Dec 2025 19:33:04 -0700 (MST) 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 10026) with ESMTP id o-v4g9SI6TVr; Sun, 7 Dec 2025 19:33:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161180; bh=mQCc1vTPsGe73Cq4cbhQ/eKeQmn0VjQOC7VHf39uUkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U6A70i/n4xI9evj012Kh5q1DCBU4/d4Na4QE5j9ylNQc7ORjdHugNQ90Oh8yljpU2 piM0t/h0HlXJ38NEzsHrRX3Z459+P2/aZio85RByZEYgRrXzTsiVn9rTNypiyhVmH1 IAKOHJszx7EokaUux2JfR2Lx/88+nTqn1ybfLHcAKqt8rtv8nZz2EWOrZedcBbuz00 5v2vBDVq6+zF3N5ygSBxj1kOzh/+wKqa73ehvTD9bKGVqsHkajkqCTf7AXkszAU0ip d8zpTaka8kiw22z6N6o7N+vK4qZtoPGkIOHhPtpsX7C35NUNguuDfAhHUAxvTC/Mue PN6lpx8HYDXTQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7D7B0689CF; Sun, 7 Dec 2025 19:33:00 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:06 -0700 Message-ID: <20251208023229.3929910-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z55BUUF2ECXR6D3UTCSKVYXIV5C6WN67 X-Message-ID-Hash: Z55BUUF2ECXR6D3UTCSKVYXIV5C6WN67 X-MailFrom: sjg@u-boot.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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/19] bootctl: Set the password flag on the passphrase edit text List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The SCENEOF_PASSWORD flag is set on the textline object, but the rendering code checks the flag on the text object being rendered. Set the flag on the edit text object so the passphrase renders as asterisks instead of showing the actual characters. Mark the textline object as hidden while we are here, so it disappears when switching to the simple bootmenu. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 01af30c6627..1b740c8d16b 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -45,6 +45,7 @@ static int bootflow_menu_set_item_props(struct scene *scn, scene_obj_set_hide(scn, ITEM_VERIFIED + i, true); ret |= scene_obj_set_hide(scn, ITEM_KEY + i, false); scene_obj_set_hide(scn, ITEM_LOCKED + i, true); + scene_obj_set_hide(scn, ITEM_PASS + i, true); scene_obj_set_hide(scn, ITEM_PASS_LABEL + i, true); scene_obj_set_hide(scn, ITEM_PASS_EDIT + i, true); if (ret) @@ -233,6 +234,7 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, { struct menu_priv *priv = exp->priv; struct scene_obj_textline *tline; + struct scene_obj_txt *txt; char str[2], *key; struct scene *scn; uint preview_id; @@ -308,10 +310,11 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, snprintf(name, sizeof(name), "item%d.pass.edit", seq); ret = scene_txt_str(scn, name, ITEM_PASS_EDIT + seq, 0, - abuf_data(&tline->buf), NULL); + abuf_data(&tline->buf), &txt); if (ret < 0) return log_msg_ret("ite", -EINVAL); tline->edit_id = ret; + txt->obj.flags |= SCENEOF_PASSWORD; /* Create message text (hidden by default) for success/error feedback */ snprintf(name, sizeof(name), "item%d.pass_msg", seq); From patchwork Mon Dec 8 02:32:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 837 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161192; bh=13ILlBRQKLbAsNBJG8WD15iU1ZeCkQCMxMTRMOGM0mg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cHFkCNLo0f8qrtQ0fqG3CUG32g0Xzks/r8m3a6b2kfonWyCa6Pblnbkew0kZ8fwJS +TNbFgF9GUv+nkAKX2GXXj6kVgBux+1QlWoa2WPf5xqC4Wvxe+/keaG5oPMpSkMlNh UKm8O++f4PxPZcN46qjmEu/ytTHqkR2Dnr6HP6KRftYkmoRhVssyuh8tUspXbWNLm7 9tQtQGTskSs19eaNB/4lzI6BRdYkY2OFDNjm8v1+Bmp9Q5xEcwIVskocrbZ94RuQth H5VIsCMTK3Jb662CbGAmcme6gcoyXKpAkVftqz6xPuEtOo6nCGb8hSQ4XERxUug6hT 1H7rXYx8SSsMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0EFC4689C4 for ; Sun, 7 Dec 2025 19:33:12 -0700 (MST) 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 gmHxq8EBWI-T for ; Sun, 7 Dec 2025 19:33:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161191; bh=13ILlBRQKLbAsNBJG8WD15iU1ZeCkQCMxMTRMOGM0mg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cJOs3+Rjcn8omyfeKzOjDEAZAHygr2g+M8AH/BVq93GsXalQN8lKbBoCRxUmqmrwz +o1k6TvJo6D8POeIO/0lX7se7M7Ve0cr3ae8UgdqhbrIU4UaSZQTjahyPFOCBYaVR4 d4Ai00Uw0PkUKg0gn5C/XnMnYVH3nmUbWYKnJWF0k/mTlr08t2gV505aPCIi/Ms0PW sGTYPCgINjveW9YT09UGtvO4oXpsjiXtnl20qaox8WLl2bvmymBSMNAzA2p5+l2Sea ukSYUK1kV66cMouB/GEAuFmvooG800bHgru3095zFwCbw8uSq5EuwhlJ4DB9g32q9t dYsFqxmzQgEWg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F38056894D for ; Sun, 7 Dec 2025 19:33:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161189; bh=o0WztULT9K+8PiMu7ugHqzCzrMRozBrr4Fw1xhaDihw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVprBP0ehHm//zAEtEzhHsInTLbMNz6NV1FgoJyqxbCQDmn3mnt5W6mHpOGHKSL0S zZy2q3YVrudt0WK97Ar1lOjyUiDXzRI/sfb3jD8TFVKgPDCdWud77dx+jfzo3qxl/A Fd922qawlLgdGS9LsRPen/64UmdlbIwqKhCW9RDcDMbcohRupnW9qOuyklNZVNUUec lYsRrrTr9sWMWbfSGa0RVG1PXc7eMre1k3jJb5ypB60ZSg1t+9rPbWLF1gtgE/14kB iwA6yZ4PYjUFWxTpMsXJjP7YiJRn3bQd5hTJABlltp/Vw1Lv2Br0jA8JFSlkwxHses w9Aaicrb9GMHA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E22046894D; Sun, 7 Dec 2025 19:33:09 -0700 (MST) 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 10026) with ESMTP id B9rWBtuXbfP4; Sun, 7 Dec 2025 19:33:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161185; bh=pg/nXYSUAH8S0pjave4XS5fyQyc9cNhKdURtyS8mId8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F+Nb+TM7ahUNASQccSMsR/oebdTpSdWEugC3FqH1WVleZGC8gMknPDmFAnKAZsrRy KK4DZphjS8dwQYplh7ve/eRa55BJfxnn5UsYcgicMeR2gbzL0UuOTeFQRp2CJ1XL2G MoKPIVPHMi9tuDRuZGZ0AlRfm7Kdje2Dmh0lijIcggimnkFrDdtSumfbAFeYuMAjjm kA7DA2eb+9oDLz9tH37sVmYR++AlsqavL2zG4VxOf2+hKC6ryft94xfMPEDGFjQNqh /2nTJqm+eEggeDelP54NQTNse5Oow9vFAPsiUKerqwaoWv3cdu9+H0RgoY6TFMkqo0 mJiHOUTm8AIuQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2FB60688F0; Sun, 7 Dec 2025 19:33:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:07 -0700 Message-ID: <20251208023229.3929910-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YI2XF3B2BO5IY4RMYMK5IJ5FAGYWLP6V X-Message-ID-Hash: YI2XF3B2BO5IY4RMYMK5IJ5FAGYWLP6V X-MailFrom: sjg@u-boot.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 04/19] video: Add a lock image List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add an image which represents a locked disk. Signed-off-by: Simon Glass --- drivers/video/images/Makefile | 1 + drivers/video/images/lock.bmp | Bin 0 -> 2454 bytes test/dm/video.c | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 drivers/video/images/lock.bmp index a2c654831b9..6029fa3d5cc 100644 diff --git a/drivers/video/images/Makefile b/drivers/video/images/Makefile index 8e719691880..31fffc4f66a 100644 --- a/drivers/video/images/Makefile +++ b/drivers/video/images/Makefile @@ -15,3 +15,4 @@ obj-$(CONFIG_BOOTCTL) += canonical.o obj-$(CONFIG_BOOTCTL) += tick.o obj-$(CONFIG_BOOTCTL) += multipass.o settings.o obj-$(CONFIG_BOOTCTL) += help.o +obj-$(CONFIG_BOOTCTL) += lock.o diff --git a/drivers/video/images/lock.bmp b/drivers/video/images/lock.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8e9bd3a06ead93cb9ea26a52cad0272b38ad9f2d GIT binary patch literal 2454 zcmd5;YfO_@7=FQRI&3N0();E6+J3!KsKptg(;*U^8)OCR1yHmXiVRw6OGOY7wFN<2 zn6NQnBA`{~bC#3Jb98+^L61L1LU#=+Nzj z3;GTE{h8V}jj}}{ZIkueBpjr~DI;A<%A;0n(WqLo=LL@p{tzdE?z`Pr zGc$S&`jA$=U#;rWsDnCfFhdj2X=4`5(sj?v>M>;X8uWdOa!zE=>+9{hmZ-DWe@U&_ zrPCfzQa(zyLndvOOL0jJB;l13^)k{!5^hrBL5!wW`Y7qv4*%zgI&HfyA~93jtDssb zd9#Arrc^X3s7AG7D*`3eq)|0%)vY@1uFMSoE7|?%A|+90_l}RG5{F9J9{sM95Z6e= zc8SO)5?Dk+i&$vJF^X+sQKgLZiiMR(Nz~c7{kTYI(`?M)**Zkb$KFBV!wg7th}DW7NJaf|s}BbW0Q zk89*{ih10X0^VvNzf>Z!b2+A#ro)LkOC&_`MOvC_&YTPu zQ_p72=dg2l+*g^*`Au5}5_Qg;xz^QrA<%K|gZ@w5u3#{5yr=7Ahkw}bi&(oq6x??r zu=l9P(|d5>vq0zhK-MS|dv$HWiXy&9iq`7iHw`f^b>+&Hy3HQFAsaV1 zGlfoP%;5^eix%g$?(Y2R>W#SK=emQ#q20bcexI+ctqm{n(&fv~rTl*i0FsAltq#u% zxd0Aly}M+29z=Oxa+-GHP>^tvvhm6)G4Lbp|V ztN=*_R^?hEXb+`D>Cw-4jf>P@*#2uSc7fiY(4gD zLo}2`%L91vyKwj+1u(M*;Bj|2{O52u{CEUl#<%!VaZd2-h5&NLG2T59lOF X-Patchwork-Id: 838 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161196; bh=RalYA4LGaIN+SW5cJAxpiDKOvaa4PQKXm5xDOtbqufc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Qgyac9AHsmWvA0wT3Mrvwt9CrGioQGUpDVl/uNe5B/jrhoAwp+tqw67A2eMmNuk3x gab1iaqFN8TLgh1cUIcijILi12pY9wex3uSKi1wWZ5h+i8O47ifTAvGg4FBTcvtXK5 PD3stjBVflbXRIsvaJ2WPhQxW5U0dqchYx+pPfbaDexPUumzxURBlHucRgeyXxTzpn MzPs51x2wNM7UNSIPSAlBj1g5z4r3UyhS2YF/CrMSKYcHqAqGMilrzvmcQ/xCM51TO +NNChWWTTf4P2bTJedIE8SPxXyV5ChfKAI56W5WxhXRCbmrU9wu3ncl8fjA6/1Kzzr KGqfW1sS7zIQA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 78EDF689C2 for ; Sun, 7 Dec 2025 19:33:16 -0700 (MST) 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 1voSwrPTbtgc for ; Sun, 7 Dec 2025 19:33:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161196; bh=RalYA4LGaIN+SW5cJAxpiDKOvaa4PQKXm5xDOtbqufc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Qgyac9AHsmWvA0wT3Mrvwt9CrGioQGUpDVl/uNe5B/jrhoAwp+tqw67A2eMmNuk3x gab1iaqFN8TLgh1cUIcijILi12pY9wex3uSKi1wWZ5h+i8O47ifTAvGg4FBTcvtXK5 PD3stjBVflbXRIsvaJ2WPhQxW5U0dqchYx+pPfbaDexPUumzxURBlHucRgeyXxTzpn MzPs51x2wNM7UNSIPSAlBj1g5z4r3UyhS2YF/CrMSKYcHqAqGMilrzvmcQ/xCM51TO +NNChWWTTf4P2bTJedIE8SPxXyV5ChfKAI56W5WxhXRCbmrU9wu3ncl8fjA6/1Kzzr KGqfW1sS7zIQA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 67FAE68930 for ; Sun, 7 Dec 2025 19:33:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161194; bh=Lw8MMrd/4MHcDsVSakcQ9zLvtg9k0n1YIftw0XvrSGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HbWSZTlk3ZycnUP/0Wp5Ox2a1XC132ch4VFWvjTPKAkDUA6zMw0g/IDnKuJY1gVRV mEv8P5Bvp2VSjLja4Cvh0BS9fwr98jXDRKoisD2QZh06+OxhYY8VtajFA3oDRlBgRY cNTEztML86B/wX42D8NltCNmFdDIKyclBVEyFJhyXTNXzgtrd0TLj4QWnwoGnisE3v hBJgd2b6Z+BoNzzFITG2lL9XcN/Rz2c0b1//sdBK4kPvxTefXbeO340E4K6LVw8cQC 2mgabr/ZXZHvGOkvANNzEr8e7dzUeIXkvAIXByR73049ME1bHEU3Gl7DWYNsUkUNg2 eGFgTaSqv6UNw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6A87B688FC; Sun, 7 Dec 2025 19:33:14 -0700 (MST) 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 10026) with ESMTP id hL4EsQ-rleVc; Sun, 7 Dec 2025 19:33:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161190; bh=GUu+WVQzQAp1nO3myWyKXwkWNm+6qxOez1/3nJCwnQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=befDFVLk83UlubgbZu1uCLx9E/ou9GzfWgjZ+oy4G397s9sFo0qsqVq1kzYU1zJ3o LTsiGzTSImBN4HVtae7BOUx/R4c4SwkBuruFLdrswYXclmZ7mHpQty3/syq//7g0mU cyxYbaI05Ia9tav6v3PgnWnQgQKLMuQhy96XScEN2C90k3PTV/7OB22Kguym/cKAs4 6VBR4SAze0LzOxk+4bO6y+wkF+5GC2FDf+34Gx7Guthhi+JaZ+xxeAEvUcNpS9IH7t eJFCb6U9k7e64I0ZjHzv0x3gjQxTeggLbHUgH8jxDA26re3g/fKULaLSkg3uyDaIp3 GycGEHvG8vphw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CC25668900; Sun, 7 Dec 2025 19:33:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:08 -0700 Message-ID: <20251208023229.3929910-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZOHW6QMGOKTA7COQ735Y5K4WZBGCYADS X-Message-ID-Hash: ZOHW6QMGOKTA7COQ735Y5K4WZBGCYADS X-MailFrom: sjg@u-boot.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 05/19] bootctl: Bring in another image List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add an image for the Canonical logo, so we can see how the screen layout looks. Signed-off-by: Simon Glass --- boot/bootctl/canonical.bmp | Bin 0 -> 41634 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 boot/bootctl/canonical.bmp diff --git a/boot/bootctl/canonical.bmp b/boot/bootctl/canonical.bmp new file mode 100644 index 0000000000000000000000000000000000000000..2e1eca267b044ce2d44a846c1a94889845839a66 GIT binary patch literal 41634 zcmeHP`;T2!8Lj*k{-!*lXv8Rqh_4VaAS4h2wp0`pjL1{OB7_ty2}U$g8-fsHLt;dK zXo%XVL84+2LI6d4fJTCr019#5%yg#n?9_F;$Hkg&KkmN!^vn#WdookjUf=q@{WvS< zb@%1;bML)()8U^}@b8KE`xpLB!`~Y=y%GOz+H?)#=N;qz4iot2&6|hT{`XCrhYr=B zx&o0ESbIaF$Lh(*(WrE91*#{j4>sBgR8MZSBT~mxJy|`l(N>^(a-$uQI-csu>Vb{6 z0m|6;LDULP-;3bD;VB1DKo&xT+?X$W-tq+ zDq|Y*Wu83wvm@u;ICkpgBS=4P%g}XqPX6lmb5Hzz;hta2eBjE_zBLDZ7o;=li#av3 z6zRlRmhwJkO+Vxq3SuB9F{UwH7#VvsJew3Gz(8VGhbaW6KKU5v>mLe^-7<9XS0{e_ z(CpCoK~!5@I`ok*jvjx(&@UgK)8hLNEPwpwab^WUz9-Fea+(}Wj+h!|0gwbx-p5q> zAybD+AN0))3P`db83$s#iBc8>1BqRQ*f3b%2>fQyGd_9A*Cw9(_oAl5ijZyp-jtFK zzcjRT!q(KsLz$lBEEM?NX%yHA3`t(oRg=T3#`Ka1u@`E{5HLi*5CF*_pwdKRJY)!@bul*31Eni8UDswz(=7MIh zBPCU%>8ep2)5Lhqb(l&MBJY5Sn%tm9D+JR?Qc1?tkMY5NjTlYVPwOc&703gaP^@Vj zXqxZ*%9MgI>!%LUx!K!kpxgah-2ay?-!xcgn~Rt0HcpJGgBxtbz;1cY16oc z&EGt^@`mT&@}UcMq#jt1f_qE6qTF%M6i%D2!cTs;@>ukP2M(|%LB1z-r~_dxg#*D{ z)u}pv$5%<$X-0hDZV^AH&qEfMnky zRBAeKkPnh3(Qh&<2bgrG7(UUA8SIqHM&5V%NbDgcmPH;XOm>PJOY#m>PjYbpf=7)c zfQk)H$QaU;AgO{FW@2ApDo}6uMANth&8<7epM7!V^*HV%({FYBbjRSKdw62y;phAJ z+sk*RClkZY4{=S>Knto;c^^}$A(8;f$1wFOAekp%29@zLM4^rX(6>jMDZG^vd76cA8J27n}h@k!e${0*t3-jXI1MK?N6a?8k8FPw!hay{wlf&D6MD z02+$%ssWD4V!TOr&6qgGn<5DrLz+SoK>6mFl})J_Z)Dn3x8Q<{ofW~K4`%H4(Ne&> zezxLC+zFUa^&}UWhs>BH#xv1@gp46gAqk*-bIi)7RE#$=ZK_*vGMrynb>XHG&pWEj z!Mh(k;L;y`y7vlQf4l8T%$f%xedrUiM2H6^-4QFOKAmEe`Azl(V6qr8e4?pV0eBdk_fRE)ub!NybD@F) zjp|Yms{ok1g0vrg00JXMcI@(Z9~)gGD@X z|M|IvPux1NAyMSpyQf{JDB`xGYe#GBNiIte_=^*iB}l)5V-hJQdD_*Zlhdni zL7~6-@GiBWA<^SNp2Vd3&Y}u7>RN$hkP+cTt(w#R~8^=8smb;^T{Mo6wIMaX!R{*Jo}UQ{^k8;rHx`Z!Z>j5>x9t zsT@t;B2{o?SKx?y65hk+$?++>l^mx*T-iT%Q*XBZ2EWxfvHxJ=u|3n1=!-MT2Rg!|7MtZ- z$93RH^2ZSKq0i$*<%3Vo@l80o_{R&2_=p_O*Zzt0hPzWcf%84-Cc=5;fc&|4SZNk& z9cRjs|$bEn3`B#>%-f1`Snwo=p z(oKi6i-G)EcV20hXdUOvk>roTxTQ(+trrfz>}8(JpHx+11q#g2#<~>@qlpQN zbE_xYIQkp2X7%L8JT6D`sH!KA=A+-4xffr5n{#lC8iSUuSp|FkiYCe|v>t)6V- sP X-Patchwork-Id: 839 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161202; bh=uO/BhDZkCf7PBcdGTYxiPWX//6o8Cw1l2GN4pw/6hN0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mvDpAKbxDIrfO5WIfXyd997UagGVtTDCniPwU9TW1hm0qCSon+lbLGajBJPYeDsvy tCNvMubO6C2eZB+o/vAYrX7q8KRUGaDgMY7y0lTNqk5UYPZ74SqeE+Xkwy7z3e35ZW RmAAxd16q2aW+lsBgWREPR5UgMzgYDv31YTlnmuIBiPr2kNWgZNiT++zZ5PfVknTJG LnM3ZS1080JRtGPSzizuUTz78QM29kG1rqkg+CLJ660aP3alSXuztJXkq42KAccu0A qqP2FWPA+A0tp6LNej7gZ3JULXS1ilIH8TvdzHA3o/nUQ42rNgs9W41JGgidQplA5Z uSLAWEoyhdPQg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3ED76689C2 for ; Sun, 7 Dec 2025 19:33:22 -0700 (MST) 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 o4b4almXZICp for ; Sun, 7 Dec 2025 19:33:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161202; bh=uO/BhDZkCf7PBcdGTYxiPWX//6o8Cw1l2GN4pw/6hN0=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mvDpAKbxDIrfO5WIfXyd997UagGVtTDCniPwU9TW1hm0qCSon+lbLGajBJPYeDsvy tCNvMubO6C2eZB+o/vAYrX7q8KRUGaDgMY7y0lTNqk5UYPZ74SqeE+Xkwy7z3e35ZW RmAAxd16q2aW+lsBgWREPR5UgMzgYDv31YTlnmuIBiPr2kNWgZNiT++zZ5PfVknTJG LnM3ZS1080JRtGPSzizuUTz78QM29kG1rqkg+CLJ660aP3alSXuztJXkq42KAccu0A qqP2FWPA+A0tp6LNej7gZ3JULXS1ilIH8TvdzHA3o/nUQ42rNgs9W41JGgidQplA5Z uSLAWEoyhdPQg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2A0A568930 for ; Sun, 7 Dec 2025 19:33:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161198; bh=C+T+AIW8kgnZ6xfgWaFHu4lqEHKlhijKuk1nCYFwXZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ur270JyZF8vcZPLq1vSuJSZvZ042Xtak8i0qECRUEkDb2cWPzN960bUTg3X8cROue LBPHAe/sx1eJOfW5EcLX2lSjW/ILOe3VTe4RwAr6LRkS3fBhpUPNU1lho/fiEeHSGq Xd1FSRX1Cl8I1+aBbQzY9tN4qibkqFZqVHJgJvcZSVtY7q2WcXxXlWhreWxLnN/6zY ZccLQWonNDUr3H8XznJSc1QJ1d+Ho8N8CFtqJqGP9X63Ra5pcH4/HjxnVHlgXdT5tO JPjIO1HxcR78SvBqLHYBKkFmXWZWtcRK2iFeKMl7TQcsqPiyOUq0/YCRHTghjtMiP6 jFg0VWdGHXdwQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DE42F6883E; Sun, 7 Dec 2025 19:33:18 -0700 (MST) 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 10026) with ESMTP id ICo-icpqkqMO; Sun, 7 Dec 2025 19:33:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161194; bh=nQmlmvfAJXSf5ZY34prD/XoAjYsve8wb9GEGjsAURo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CFuD/t8h/wPPwtKLa5oY+jfo+VqPiwqYA/+evhyEg8TsO28sRtjnzKxdBOV3CleCl reFcQR6bbg9u0MwnAIMuEs+TkKM7cnpLgt+uabteZ93zKtBxDiwPn1IKKOYP2cvgby 3asPpwjgAzSxITuuXZxZ6Dnd4QVbfKcm7vqbyj3hpBn8dMfK+gt1VLIZ1Pvg0Zu6bj iLBCXo02WAYRNLL8YWlmiw/MLUgHMBWfkFfpmSfCASpNPSpTFvdGsfpKtK2SCDCW2q IacTH8oNHeXEP+RzmaEFXtcsYnLhiUL7XIsy2CpZ1E9BTBC3j1L4KFBXnuwJSoRzFY eMo2ixh/pzo5Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 845CA68900; Sun, 7 Dec 2025 19:33:14 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:09 -0700 Message-ID: <20251208023229.3929910-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Z6QZYGQQMPZLXFK5UFPWV5HPQEPDPU2L X-Message-ID-Hash: Z6QZYGQQMPZLXFK5UFPWV5HPQEPDPU2L X-MailFrom: sjg@u-boot.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 06/19] bootctl: Allow switching between logos List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The bootctl tests are currently disabled due to some image incompatibilities: the multi UI uses one image and the simple UI uses a different one. Update the logic to switch between these logos when the layout changes. For now, use the U-Boot logo in both cases. Signed-off-by: Simon Glass --- boot/bootctl/multi_ui.c | 4 ++++ boot/bootctl/simple_ui.c | 7 +++++-- boot/bootflow_menu.c | 11 ++++++++++- include/bootctl.dtsi | 3 +++ test/boot/bootctl/bootctl.c | 4 ++-- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/boot/bootctl/multi_ui.c b/boot/bootctl/multi_ui.c index 975f9a1b91c..f663bcdac61 100644 --- a/boot/bootctl/multi_ui.c +++ b/boot/bootctl/multi_ui.c @@ -215,6 +215,10 @@ static int multiboot_ui_set_props(struct udevice *dev, struct scene *scn, scene_obj_set_hide(scn, OBJ_AUTOBOOT, !lpriv->opt_autoboot); if (upriv->logo) { + ret = scene_img_set_data(scn, OBJ_U_BOOT_LOGO, upriv->logo, + upriv->logo_size); + if (ret) + return log_msg_ret("log", ret); ret = scene_obj_set_pos(scn, OBJ_U_BOOT_LOGO, 1045, 10); if (ret) return log_msg_ret("lop", ret); diff --git a/boot/bootctl/simple_ui.c b/boot/bootctl/simple_ui.c index 58860138a33..34f46f04838 100644 --- a/boot/bootctl/simple_ui.c +++ b/boot/bootctl/simple_ui.c @@ -92,8 +92,11 @@ static int simple_ui_show(struct udevice *dev) abuf_printf(buf, "Boot control"); if (upriv->logo) { - ret = scene_img_set_data(scn, OBJ_U_BOOT_LOGO, - upriv->logo, upriv->logo_size); + const void *logo; + int size; + + logo = video_get_u_boot_logo(&size); + ret = scene_img_set_data(scn, OBJ_U_BOOT_LOGO, logo, size); if (ret) return log_msg_ret("log", ret); ret = scene_obj_set_pos(scn, OBJ_U_BOOT_LOGO, 1135, 10); diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 1b740c8d16b..909694f6e7b 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -80,9 +80,18 @@ int bootflow_menu_set_props(struct expo *exp, struct scene *scn, bool has_logo, 1366, 60); ret |= scene_obj_set_halign(scn, OBJ_MENU_TITLE, SCENEOA_CENTRE); - if (has_logo) + if (has_logo) { + const void *logo; + int size; + ret |= scene_obj_set_pos(scn, OBJ_U_BOOT_LOGO, 1165, 100); + logo = video_get_u_boot_logo(&size); + ret |= scene_img_set_data(scn, OBJ_U_BOOT_LOGO, logo, size); + if (ret) + return log_msg_ret("log", ret); + } + ret |= scene_obj_set_bbox(scn, OBJ_PROMPT1A, 0, 590, 1366, 590 + 40); ret |= scene_obj_set_bbox(scn, OBJ_PROMPT1B, 0, 620, diff --git a/include/bootctl.dtsi b/include/bootctl.dtsi index 05032a924e1..4070fa32c5f 100644 --- a/include/bootctl.dtsi +++ b/include/bootctl.dtsi @@ -120,6 +120,9 @@ "bootctl,ui"; graphical = "if-available"; textual = "if-available"; +#ifdef CANONICAL_LOGO + logo = /incbin/("/home/sglass/u/boot/bootctl/canonical.bmp"); +#endif }; ui-simple { diff --git a/test/boot/bootctl/bootctl.c b/test/boot/bootctl/bootctl.c index ab9aa28a668..532a73d6336 100644 --- a/test/boot/bootctl/bootctl.c +++ b/test/boot/bootctl/bootctl.c @@ -396,7 +396,7 @@ static int check_multiboot_ui(struct unit_test_state *uts, ut_assertok(bc_ui_add(ui_dev, &info[0])); ut_assertok(bc_ui_add(ui_dev, &info[1])); ut_assertok(bc_ui_render(ui_dev)); - ut_asserteq(16645, video_compress_fb(uts, vid_dev, false)); + ut_asserteq(13702, video_compress_fb(uts, vid_dev, false)); /* dump after render - buf2 is golden for multiboot_ui */ uc_priv = dev_get_uclass_priv(ui_dev); @@ -435,7 +435,7 @@ static int check_multiboot_ui(struct unit_test_state *uts, /* switch back to multiboot UI style and check against buf2 */ ut_assertok(bc_ui_switch_layout(ui_dev)); ut_assertok(bc_ui_render(ui_dev)); - ut_asserteq(16645, video_compress_fb(uts, vid_dev, false)); + ut_asserteq(13702, video_compress_fb(uts, vid_dev, false)); /* dump after switch back to multiboot - buf4 should match buf2 */ ut_assertok(membuf_new(&buf4, 4096)); From patchwork Mon Dec 8 02:32:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 840 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161205; bh=GnjBrIChJOERqSSgd/u+AxKRZwSlqC2Ge3lXmly+u+U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wxOefq0fzG7bOw8/6ZKaAN2XGa50dmvFZv4ueZvl8urvtetsA/AyU0jXBkJxghN+f o/z7F7eluIj34/cxTP1Sc6yqEvaqbKyqZ0+Y4mqiss/zyvMhgXIUCt/swX2ngCOqFh rhniPRdo5VywUa6zQtVv2GiRXRAZVt77leDcGCJsYdJ1XhK88529qSxTJTwrmtKPki TKPRj3qDiM1xtwWWmmvsLqTQea0OgTy43Ca1myLhfxd9voguc/Qe7kcYsumgLLFiJf lNZD0h7n1ZPPBLYuarEYP8kL3hv/j56ruUb8jIe+MerMmtz6tDE5k+JUkEQ07YpXJE DU5uplMbxxPSw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABE39689C7 for ; Sun, 7 Dec 2025 19:33:25 -0700 (MST) 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 viVKqs4JPWGD for ; Sun, 7 Dec 2025 19:33:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161205; bh=GnjBrIChJOERqSSgd/u+AxKRZwSlqC2Ge3lXmly+u+U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=wxOefq0fzG7bOw8/6ZKaAN2XGa50dmvFZv4ueZvl8urvtetsA/AyU0jXBkJxghN+f o/z7F7eluIj34/cxTP1Sc6yqEvaqbKyqZ0+Y4mqiss/zyvMhgXIUCt/swX2ngCOqFh rhniPRdo5VywUa6zQtVv2GiRXRAZVt77leDcGCJsYdJ1XhK88529qSxTJTwrmtKPki TKPRj3qDiM1xtwWWmmvsLqTQea0OgTy43Ca1myLhfxd9voguc/Qe7kcYsumgLLFiJf lNZD0h7n1ZPPBLYuarEYP8kL3hv/j56ruUb8jIe+MerMmtz6tDE5k+JUkEQ07YpXJE DU5uplMbxxPSw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9C3CB689C2 for ; Sun, 7 Dec 2025 19:33:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161204; bh=eFEEA+tkc4lEZQHUI2bV+JVX7Q9Id117CoExaaxI7zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rClOcjlo9r49SxkG5SX0HpKkiFhN+0rJsoAQRQBevwraLKgTa0TXLxbMvzhprLbYy 6WZlAX+lPrxISQGn3YBboYVUbLFZ54WhztV7emfn+xcsPfvdoRlJ4BdrA2GyXxhPbt Tk0ZNKDiscYMMtv4tDrfKlRAimitvYmolPAjzVYiiWJR2tdi0zQ6i3dn0xfUi1HpfO 7VFt2HjGSjaLrF7AdpKfpN73FMEO1sy0AECF3AYX/P3WZmsUtirD341rO+p6bszGp0 2E4vf4KYNUz+Xg0iIWoWwdmIu6o56RUnYx5wocDAlaC0pytDdD7xDJkao7D8EkLXMG OYbhimS/wVCTA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 999936894D; Sun, 7 Dec 2025 19:33:24 -0700 (MST) 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 10026) with ESMTP id HX9t4bASvcfl; Sun, 7 Dec 2025 19:33:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161199; bh=/8IkOUgWKBRtC/LnGWAMtBNLFEgLgyayQd+1POfJ58s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Si74j7jcJjJHhWYSLiq2QZZv8S8HV7izN4YJ1t/Qn7Os3FxO3hCcDXpDD9FPNEOZu u/gn6f5iHROp4gzBbJIpY/AbDgAjEwNX68SBRaNjNUJmDjX8mGSjk/oNnPJNiI2t4w SMa3EYPgq6hq12sXIlMFKaszKmORQ9Wcsuogyb7fole/l8hpLwL0m4BRZ7eks1A7r0 WXTEISj3nfkHvFRWQXJqfTfw/RwrpY1YC8HxpIFC/Y2MnawNfjuwSoQ1Cg4/9/QXl0 bY6VgUuWyvnqWs2hT9ggM8UVTftNZk4JBJpjLJJLTxf2g6fADPjV6N12b/GonaHCyf m4N5LsZEUyHRw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 323C068900; Sun, 7 Dec 2025 19:33:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:10 -0700 Message-ID: <20251208023229.3929910-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DYVIHIRDHJV3BM7PKW5TQ4GR222TYSH2 X-Message-ID-Hash: DYVIHIRDHJV3BM7PKW5TQ4GR222TYSH2 X-MailFrom: sjg@u-boot.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 07/19] bootctl: Show a lock symbol for locked disks List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When an OS is using disk encryption, show a lock symbol next to it. Signed-off-by: Simon Glass --- boot/bootctl/multi_ui.c | 8 ++++++++ test/boot/bootctl/bootctl.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/boot/bootctl/multi_ui.c b/boot/bootctl/multi_ui.c index f663bcdac61..11e5a46c911 100644 --- a/boot/bootctl/multi_ui.c +++ b/boot/bootctl/multi_ui.c @@ -140,11 +140,15 @@ static int multiboot_set_item_props(struct scene *scn, int i, IMAGES_Y + 5); scene_obj_set_pos(scn, ITEM_VERIFIED + i, x + BOX_MARGIN + 40 + 32, IMAGES_Y + 80 + 21); + scene_obj_set_pos(scn, ITEM_LOCKED + i, + x + BOX_W - BOX_MARGIN - 24, IMAGES_Y + BOX_MARGIN); ret |= scene_obj_set_hide(scn, ITEM_PREVIEW + i, false); ret |= scene_obj_set_hide(scn, ITEM_BOX + i, false); ret |= scene_obj_set_hide(scn, ITEM_VERSION_NAME + i, false); ret |= scene_obj_set_hide(scn, ITEM_VERIFIED + i, false); + ret |= scene_obj_set_hide(scn, ITEM_LOCKED + i, + !(bflow->flags & BOOTFLOWF_ENCRYPTED)); /* Hide key in multiboot mode (not used with mouse) */ ret |= scene_obj_set_hide(scn, ITEM_KEY + i, true); @@ -422,6 +426,10 @@ static int multiboot_ui_add(struct udevice *dev, struct osinfo *info) logo = video_image_getptr(tick); ret |= scene_img(scn, "verified", ITEM_VERIFIED + seq, logo, NULL); + + logo = video_image_getptr(lock); + ret |= scene_img(scn, "locked", ITEM_LOCKED + seq, logo, + NULL); } ret = bootstd_get_priv(&std); diff --git a/test/boot/bootctl/bootctl.c b/test/boot/bootctl/bootctl.c index 532a73d6336..ff1a9722fe3 100644 --- a/test/boot/bootctl/bootctl.c +++ b/test/boot/bootctl/bootctl.c @@ -396,7 +396,7 @@ static int check_multiboot_ui(struct unit_test_state *uts, ut_assertok(bc_ui_add(ui_dev, &info[0])); ut_assertok(bc_ui_add(ui_dev, &info[1])); ut_assertok(bc_ui_render(ui_dev)); - ut_asserteq(13702, video_compress_fb(uts, vid_dev, false)); + ut_asserteq(17279, video_compress_fb(uts, vid_dev, false)); /* dump after render - buf2 is golden for multiboot_ui */ uc_priv = dev_get_uclass_priv(ui_dev); @@ -435,7 +435,7 @@ static int check_multiboot_ui(struct unit_test_state *uts, /* switch back to multiboot UI style and check against buf2 */ ut_assertok(bc_ui_switch_layout(ui_dev)); ut_assertok(bc_ui_render(ui_dev)); - ut_asserteq(13702, video_compress_fb(uts, vid_dev, false)); + ut_asserteq(17279, video_compress_fb(uts, vid_dev, false)); /* dump after switch back to multiboot - buf4 should match buf2 */ ut_assertok(membuf_new(&buf4, 4096)); From patchwork Mon Dec 8 02:32:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 841 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161208; bh=YCH99rfyMB4zBONnM46Zat5ogYXXY0FafgddfJ3QTBo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Am5MOdyrUzR1rD1Bgc5EOlVFpZKJrFuXlVe7WmQ4wGDYN+7pnAXA7bgBmsMQ1GbaQ X5c5EoKSOpyGaqKnXG2u91V2XTDIhacNZX/inVba5ky2rC3/3lXW6Nym4tIZLO0v0Q q5tjfHlL2UPZk4pNEgPNOB/A2BzQqwVsE5QR4dtFPRHlyS3Sax4UeXjTcJZmrU7e8G g7yPdecuPwZoWKLp+/NmUcVQTridVUQHNnWVTrEP97xt/i+eftU26xBjYc6LOUZeLa XTJKzXQoQRTlUnYNXMpqs1i0AFoZqFgYoK5AQLGevK2GfZKHDLvVzRoLmODCKYvefF dk6MAGiUYgbqg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 103F0689D7 for ; Sun, 7 Dec 2025 19:33:28 -0700 (MST) 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 CDnIV4VKiEVy for ; Sun, 7 Dec 2025 19:33:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161207; bh=YCH99rfyMB4zBONnM46Zat5ogYXXY0FafgddfJ3QTBo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fJizZfSB7j4BqAdS0Qu7Vd2YWEQ5973bhnwJkxJFfMzCaXNHU6140sU+NMp7hNugs srWvf3o6AkgHY6lHFwyPd0r3fi2/zNMEeGnSIjquF7eDYgpCJNf+BEd8fZXQBM1z9U rhBsoTm6DPhFwbtC0iPrq+KU2K4OY0WpWiqFIlYY7TdaMhg7GBh8S66/6oRffFDSgw PI+9c6hGg7eHUjsyuBUlfCjgvvL0xaqVYBs1g8RdXURERcLJ2AgaO2xG9YDROkyg6g paru50uv+DKRQrIAlrm0/Wht466hgIk8pXqaTkqhFBbR+/F486owRpp9jh51WLMTBN yWe83wlNiY34g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19139689C2 for ; Sun, 7 Dec 2025 19:33:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161205; bh=lMC/LmacwzyOSjNeKJPbJUwn9B0vcM1Go8htzaqS6as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HxpchNMkQWdgc3gly5247gYO9T2Tw0wTSo0+ab4LfKiq9/BoLxFXUJIi6A4+Ved8l Rwt6a74qQ4JguypLVaIZcQjrEtsq64UM6IxkMPisKbyer8WIi2YnluK7/UUY+zv+hK oZj0uEjiijdBeQ+4PXutibn39410M8iFp+XyQsLHVfSSWR9MndwZ0wOn6PLZyVwsOr VeRCI5dKYQFiJurA7brsMOt81xVB3DMggFhPQX8FP5EIuwQLlQODMWjofwTJQNC8Cj ElxZ9aMs2AGJnF4he4o5gYCGYLQzupOFif9LcXcl1jJ8Q124NGGEze7BjiRuAYTEfV mbEsTqFz7e1vA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C4C96689D3; Sun, 7 Dec 2025 19:33:25 -0700 (MST) 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 10026) with ESMTP id 40J9yANOkNW7; Sun, 7 Dec 2025 19:33:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161204; bh=AI8+cqb9kI/gKG2J4sxsKDm7w1kVQ5Pfqmda2PYtucU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ohIPrzH9SaEktDEpvi2Au7ICwI/1P6to8K79N5AixUzugInfITqHBpblm0zqNBD/P sirVg8hKwDy9KTAtkDN94bVkgb8u01Y9d0/sotAB5ue6RxuvIM9ueuZx5M4Fg023B7 x/iYqmmoOG9K74vfIPUOKavxGGC0VMjo5d8ZILSDtWUo58ph/j0t9RAnS2sTPqtKOi dfC4s9+u2BJe6VjGakIZ4DyywAqOJgLaKwCdeoAeSG9BiZAtfen6o6vLffbc+3wxE4 x/CglAGxhJr7CIeE8dCkghgw6hBQiaD+KlSLbgJov/nxR1Epr1v70Ren2hH3tUFR5W uq/F8gsLVahWQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C2E3B688F0; Sun, 7 Dec 2025 19:33:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:11 -0700 Message-ID: <20251208023229.3929910-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YMDPVGDC2DFFC3RPG3IFKE46GIHDLKPS X-Message-ID-Hash: YMDPVGDC2DFFC3RPG3IFKE46GIHDLKPS X-MailFrom: sjg@u-boot.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 08/19] bootctl: Provide passphrase and message objects in the expo List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Set up a textline object to allow the user to enter a passphrase and a text object to display messages for the user. Signed-off-by: Simon Glass --- boot/bootctl/multi_ui.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/boot/bootctl/multi_ui.c b/boot/bootctl/multi_ui.c index 11e5a46c911..f4f0bd281fe 100644 --- a/boot/bootctl/multi_ui.c +++ b/boot/bootctl/multi_ui.c @@ -143,12 +143,21 @@ static int multiboot_set_item_props(struct scene *scn, int i, scene_obj_set_pos(scn, ITEM_LOCKED + i, x + BOX_W - BOX_MARGIN - 24, IMAGES_Y + BOX_MARGIN); + /* Position passphrase textline at bottom of box, hidden by default */ + scene_obj_set_pos(scn, ITEM_PASS + i, x + BOX_MARGIN, + IMAGES_Y + BOX_H - 60); + + /* Position message below passphrase, hidden by default */ + scene_obj_set_pos(scn, ITEM_PASS_MSG + i, x + BOX_MARGIN, + IMAGES_Y + BOX_H - 35); + ret |= scene_obj_set_hide(scn, ITEM_PREVIEW + i, false); ret |= scene_obj_set_hide(scn, ITEM_BOX + i, false); ret |= scene_obj_set_hide(scn, ITEM_VERSION_NAME + i, false); ret |= scene_obj_set_hide(scn, ITEM_VERIFIED + i, false); ret |= scene_obj_set_hide(scn, ITEM_LOCKED + i, !(bflow->flags & BOOTFLOWF_ENCRYPTED)); + ret |= scene_obj_set_hide(scn, ITEM_PASS + i, false); /* Hide key in multiboot mode (not used with mouse) */ ret |= scene_obj_set_hide(scn, ITEM_KEY + i, true); @@ -216,6 +225,10 @@ static int multiboot_ui_set_props(struct udevice *dev, struct scene *scn, scene_obj_set_pos(scn, OBJ_PROMPT2, MAIN_X, 180); scene_obj_set_halign(scn, OBJ_PROMPT2, SCENEOA_LEFT); + /* Position passphrase input at bottom and hide by default */ + scene_obj_set_pos(scn, ITEM_PASS, MAIN_X, 750); + scene_obj_set_hide(scn, ITEM_PASS, true); + scene_obj_set_hide(scn, OBJ_AUTOBOOT, !lpriv->opt_autoboot); if (upriv->logo) { From patchwork Mon Dec 8 02:32:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 842 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161211; bh=IU/PLJWwtPaNdLZkZo9LY1/ES8w7dRBSrjfgPpmokqc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=R9D+ad0Q82K3ybPezm5FNdI16YmZU2BMN2l5iRK8qxSKJujfmNKkVMVORXNbduVxq YSgo6KAHkDrgfJx3KnOiu8daGm8vhxx7s5eOxJP03CGrxeKrPWWfODCRE64eWQIbfC iOjSOHioA9mZojU5uA2W1nTkrJugWzw+XxzOPwhW7Do4rp/Qb63e47QxM7REQmqyrC RoTrUainVgfBArw+hUH9CYmwRSOT1x1UJdcCYxSqDvVfrLwexR2evsBt1rKUgkhykV zXUAdin2Ftf/DZwtYhwncboyWLyNuuBLgAKjYtfs/eGZQNKFaOpOXO3VHFtGlXI5a8 gkJ8qBfaJGF6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EBF79689C2 for ; Sun, 7 Dec 2025 19:33:31 -0700 (MST) 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 Jntd1TbW4A8i for ; Sun, 7 Dec 2025 19:33:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161211; bh=IU/PLJWwtPaNdLZkZo9LY1/ES8w7dRBSrjfgPpmokqc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=R9D+ad0Q82K3ybPezm5FNdI16YmZU2BMN2l5iRK8qxSKJujfmNKkVMVORXNbduVxq YSgo6KAHkDrgfJx3KnOiu8daGm8vhxx7s5eOxJP03CGrxeKrPWWfODCRE64eWQIbfC iOjSOHioA9mZojU5uA2W1nTkrJugWzw+XxzOPwhW7Do4rp/Qb63e47QxM7REQmqyrC RoTrUainVgfBArw+hUH9CYmwRSOT1x1UJdcCYxSqDvVfrLwexR2evsBt1rKUgkhykV zXUAdin2Ftf/DZwtYhwncboyWLyNuuBLgAKjYtfs/eGZQNKFaOpOXO3VHFtGlXI5a8 gkJ8qBfaJGF6A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D9CE268900 for ; Sun, 7 Dec 2025 19:33:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161210; bh=eXFefSYzCRlbHDTqA9qnVhPKY+fGbCpfQzwgbYZk1jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8HQJQcTQeY9FllCXRMyWHt4if8IbMEbDg/Wcs0keDbui9IUniJXLNI4ouQtddTVA KXuhfYeROzMd0GTTTs5JKq45PklOjAItZ7PCV3fBkYc1Nz5cB3NREv23PtTlc+7RXH qOW2+SZrzM+3iOzAGxWK/vBst2PAHnPP4yYYktyI3u6bltUsRVfTHVYEY0Qj9LWwmm wKSA/uPF+LTmkLfNJ9FY8E5K2WHWjYMiBahWBBrZ1LLQjf8WYDE69pkKiID7hsHcRM MOnPiyj1yuWA96ZyU9uuP8Vv2XSkXZ4YMS3QuRGT8Kfa24JWTmbmVZmoRkeVnyPDhm lMOjME1TPs9sA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F0266883E; Sun, 7 Dec 2025 19:33:30 -0700 (MST) 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 10026) with ESMTP id HtyM4pvDW3-g; Sun, 7 Dec 2025 19:33:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161206; bh=M3pvqGC0q27TbS41vEqMDrejTmWbZLS+RU3mvboq0w4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Add3QL8VjcqZRdY9kQ+axhAwzMyMUoZKNSGh5NA7+SvrJSkNTtF1UcKRL5NotFhhv Lwi/ttGpGt6cLYbZUJNjXY1hv3bYBqi2oifzLPmlrcFBvzVHxDjdccvuNYVHYiw6iw 40nGu3lD40Uf+UIfF05T+E2KF/Ed1KkXXIDrxV4vmOGpcb1/Ge48Yfc3n3xuVvuaXa vKK4mrSZXPCy8QGp0J8WfcQJ8ds7pyJhU+vjrtCdLvUIckREX9/c4ZolKkZ7hGYH2o /oW6FCtfimMl0LAfstHDi8g7SzNvIDIC6tA9CgEwNXBLdHLX8Hfo9zD6yjOkaVHkTT DObr+z/4fRlxw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 14BD668900; Sun, 7 Dec 2025 19:33:26 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:12 -0700 Message-ID: <20251208023229.3929910-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: EQUKZ7HDYOOFG5I6PRHTNDLFAAFH52TV X-Message-ID-Hash: EQUKZ7HDYOOFG5I6PRHTNDLFAAFH52TV X-MailFrom: sjg@u-boot.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 09/19] bootctl: Enhance the UI to support a TKey List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When unlocking an encrypted disk with a TKey we need a few more UI operations: - allow the password-entry textline to be shown/hidden - allow showing instructions to the user, as well as unlock result - obtain the password entered by the user Add these to the API and implement them in the multi UI. Signed-off-by: Simon Glass --- boot/bootctl/multi_ui.c | 84 +++++++++++++++++++++++++++++++++++++++++ boot/bootctl/util.c | 60 +++++++++++++++++++++++++++++ include/bootctl/ui.h | 80 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/boot/bootctl/multi_ui.c b/boot/bootctl/multi_ui.c index f4f0bd281fe..5145e4357cb 100644 --- a/boot/bootctl/multi_ui.c +++ b/boot/bootctl/multi_ui.c @@ -577,6 +577,86 @@ static int multiboot_ui_of_to_plat(struct udevice *dev) return 0; } +static int multiboot_ui_show_pass(struct udevice *dev, int seq, bool show) +{ + struct bc_ui_priv *upriv = dev_get_uclass_priv(dev); + struct scene *scn = upriv->scn; + int ret; + + scene_obj_set_hide(scn, ITEM_PASS + seq, !show); + scene_obj_set_hide(scn, ITEM_PASS_LABEL + seq, !show); + scene_obj_set_hide(scn, ITEM_PASS_EDIT + seq, !show); + + if (show) { + struct scene_obj_textline *tline; + char *buf; + + /* Clear the passphrase buffer for retry */ + tline = scene_obj_find(scn, ITEM_PASS + seq, + SCENEOBJT_TEXTLINE); + if (!tline) + return log_msg_ret("tln", -ENOENT); + buf = abuf_data(&tline->buf); + *buf = '\0'; + + /* Set highlight and open the textline for editing */ + scene_set_highlight_id(scn, ITEM_PASS + seq); + ret = scene_set_open(scn, ITEM_PASS + seq, true); + if (ret) + return log_msg_ret("sop", ret); + } else { + /* Close the textline */ + ret = scene_set_open(scn, ITEM_PASS + seq, false); + if (ret) + return log_msg_ret("sop", ret); + } + + return 0; +} + +static int multiboot_ui_get_pass(struct udevice *dev, int seq, + const char **passp) +{ + struct bc_ui_priv *upriv = dev_get_uclass_priv(dev); + struct scene *scn = upriv->scn; + struct scene_obj_textline *tline; + + tline = scene_obj_find(scn, ITEM_PASS + seq, SCENEOBJT_TEXTLINE); + if (!tline) + return log_msg_ret("tln", -ENOENT); + + *passp = abuf_data(&tline->buf); + + return 0; +} + +static int multiboot_ui_show_pass_msg(struct udevice *dev, int seq, bool show) +{ + struct bc_ui_priv *upriv = dev_get_uclass_priv(dev); + struct scene *scn = upriv->scn; + + scene_obj_set_hide(scn, ITEM_PASS_MSG + seq, !show); + + return 0; +} + +static int multiboot_ui_set_pass_msg(struct udevice *dev, int seq, + const char *msg) +{ + struct bc_ui_priv *upriv = dev_get_uclass_priv(dev); + struct expo *exp = upriv->expo; + struct abuf *buf; + int ret; + + ret = expo_edit_str(exp, STR_PASS_MSG + seq, NULL, &buf); + if (ret) + return log_msg_ret("spm", ret); + + abuf_set(buf, (void *)msg, strlen(msg) + 1); + + return 0; +} + static struct bc_ui_ops ops = { .print = multiboot_ui_print, .show = multiboot_ui_show, @@ -584,6 +664,10 @@ static struct bc_ui_ops ops = { .render = multiboot_ui_render, .poll = multiboot_ui_poll, .switch_layout = multiboot_ui_switch_layout, + .show_pass = multiboot_ui_show_pass, + .get_pass = multiboot_ui_get_pass, + .show_pass_msg = multiboot_ui_show_pass_msg, + .set_pass_msg = multiboot_ui_set_pass_msg, }; static const struct udevice_id multiboot_ui_ids[] = { diff --git a/boot/bootctl/util.c b/boot/bootctl/util.c index 48912c67f21..790489ca937 100644 --- a/boot/bootctl/util.c +++ b/boot/bootctl/util.c @@ -110,6 +110,66 @@ int bc_ui_switch_layout(struct udevice *dev) return 0; } +int bc_ui_show_pass(struct udevice *dev, int seq, bool show) +{ + struct bc_ui_ops *ops = bc_ui_get_ops(dev); + int ret; + + if (!ops->show_pass) + return -ENOSYS; + + ret = ops->show_pass(dev, seq, show); + if (ret) + return log_msg_ret("bsp", ret); + + return 0; +} + +int bc_ui_get_pass(struct udevice *dev, int seq, const char **passp) +{ + struct bc_ui_ops *ops = bc_ui_get_ops(dev); + int ret; + + if (!ops->get_pass) + return -ENOSYS; + + ret = ops->get_pass(dev, seq, passp); + if (ret) + return log_msg_ret("bgp", ret); + + return 0; +} + +int bc_ui_show_pass_msg(struct udevice *dev, int seq, bool show) +{ + struct bc_ui_ops *ops = bc_ui_get_ops(dev); + int ret; + + if (!ops->show_pass_msg) + return -ENOSYS; + + ret = ops->show_pass_msg(dev, seq, show); + if (ret) + return log_msg_ret("bse", ret); + + return 0; +} + +int bc_ui_set_pass_msg(struct udevice *dev, int seq, const char *msg) +{ + struct bc_ui_ops *ops = bc_ui_get_ops(dev); + int ret; + + if (!ops->set_pass_msg) + return -ENOSYS; + + ret = ops->set_pass_msg(dev, seq, msg); + if (ret) + return log_msg_ret("bsm", ret); + + return 0; +} + void bc_oslist_setup_iter(struct oslist_iter *iter) { memset(iter, '\0', sizeof(struct oslist_iter)); diff --git a/include/bootctl/ui.h b/include/bootctl/ui.h index 4f8e08a00c2..5e592e3dce2 100644 --- a/include/bootctl/ui.h +++ b/include/bootctl/ui.h @@ -99,6 +99,46 @@ struct bc_ui_ops { * Return 0 if OK, -ve on error */ int (*switch_layout)(struct udevice *dev); + + /** + * show_pass() - Show or hide the passphrase input field + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @show: true to show the pass field, false to hide it + * Return 0 if OK, -ve on error + */ + int (*show_pass)(struct udevice *dev, int seq, bool show); + + /** + * get_pass() - Get the passphrase entered by the user + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @passp: Returns pointer to the passphrase string + * Return 0 if OK, -ve on error + */ + int (*get_pass)(struct udevice *dev, int seq, const char **passp); + + /** + * show_pass_msg() - Show or hide the pass message + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @show: true to show the message, false to hide it + * Return 0 if OK, -ve on error + */ + int (*show_pass_msg)(struct udevice *dev, int seq, bool show); + + /** + * set_pass_msg() - Set the pass message text + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @msg: Message text to display + * Return 0 if OK, -ve on error + */ + int (*set_pass_msg)(struct udevice *dev, int seq, const char *msg); }; #define bc_ui_get_ops(dev) ((struct bc_ui_ops *)(dev)->driver->ops) @@ -148,4 +188,44 @@ int bc_ui_poll(struct udevice *dev, int *seqp, bool *selectedp); */ int bc_ui_switch_layout(struct udevice *dev); +/** + * bc_ui_show_pass() - Show or hide the pass input field + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @show: true to show the pass field, false to hide it + * Return 0 if OK, -ve on error + */ +int bc_ui_show_pass(struct udevice *dev, int seq, bool show); + +/** + * bc_ui_get_pass() - Get the pass entered by the user + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @passp: Returns pointer to the pass string + * Return 0 if OK, -ve on error + */ +int bc_ui_get_pass(struct udevice *dev, int seq, const char **passp); + +/** + * bc_ui_show_pass_msg() - Show or hide the pass message + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @show: true to show the message, false to hide it + * Return 0 if OK, -ve on error + */ +int bc_ui_show_pass_msg(struct udevice *dev, int seq, bool show); + +/** + * bc_ui_set_pass_msg() - Set the pass message text + * + * @dev: Display device + * @seq: Sequence number of the bootflow item + * @msg: Message text to display + * Return 0 if OK, -ve on error + */ +int bc_ui_set_pass_msg(struct udevice *dev, int seq, const char *msg); + #endif From patchwork Mon Dec 8 02:32:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 843 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161216; bh=LN2JG0I1a1bFJOs3nU5sH24ra8pIc5zJf45gEA1jwtE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZRZ8RFxzlG/HA8MtlYMhSTeFIUOooQjzVL81m3RKXDXlU1cCWRBRf6p+ZrzAZvAw1 HaVJ8IgpkE3ckc8zv2h1yh8GCAzEDJCbJUVc+YnS9aI0YhOr0g1azEkHyarjdy0Lkx +qla5HsMbv9sxq9SvSqve3FvmyAiQcF8J6HqSAY+DcBJJeHcJXF/VROdbaYd/ZgvRo 206lu6IOnmYTh+vWxvRGJbIE1LdBb2lpdNcGlx1ZnYN1VuiR/Svx0Qde0fxFjUCUu6 5YzgubwsZmm4rYMbkxPeObZUVOmk0LPSZk8uqz5vePFBnm8ecXPiwWkJWPXVMy1qih l+6qyEVHwZbkw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C3B3689C2 for ; Sun, 7 Dec 2025 19:33:36 -0700 (MST) 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 gPCNtPwb8NK8 for ; Sun, 7 Dec 2025 19:33:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161216; bh=LN2JG0I1a1bFJOs3nU5sH24ra8pIc5zJf45gEA1jwtE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZRZ8RFxzlG/HA8MtlYMhSTeFIUOooQjzVL81m3RKXDXlU1cCWRBRf6p+ZrzAZvAw1 HaVJ8IgpkE3ckc8zv2h1yh8GCAzEDJCbJUVc+YnS9aI0YhOr0g1azEkHyarjdy0Lkx +qla5HsMbv9sxq9SvSqve3FvmyAiQcF8J6HqSAY+DcBJJeHcJXF/VROdbaYd/ZgvRo 206lu6IOnmYTh+vWxvRGJbIE1LdBb2lpdNcGlx1ZnYN1VuiR/Svx0Qde0fxFjUCUu6 5YzgubwsZmm4rYMbkxPeObZUVOmk0LPSZk8uqz5vePFBnm8ecXPiwWkJWPXVMy1qih l+6qyEVHwZbkw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C47968900 for ; Sun, 7 Dec 2025 19:33:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161214; bh=u/rPLyEnxcJyCg2ySnWQuBAZ7H+pK17cpJu77bgg5z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKlb3wZXyUzUKnJw0KtpqFZQnqf90ow6Abb0ORkJgxhn6lcMQ1xiuI50LJoAkwqrx JDfb/XqLEjnJuO48BwxUypOQGho2ePTXt9feUdKuwnaTsmXhgANRmtatdwSkPuqeOC zVmkyM0XwG0qL0cscDPJLhZKO21KVRU3sBLLR0IQYce7/HuA7akdHaCgHRWMqDOva2 h4+z34q5anp38TI+/pE32upB4pBPfVcsZSuT9YcrhNVBTDdQRukBo689ODMlM8+OC7 8iqGE7pWtUpmBE3qi4IQMKl2OI6LR00KLdR4tvm3VTL2Rd7CGOatSNvJn3pwNB7dpa HzZDLnY/j9P1w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E6BAF6883E; Sun, 7 Dec 2025 19:33:34 -0700 (MST) 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 10026) with ESMTP id sypeI2malIrl; Sun, 7 Dec 2025 19:33:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161210; bh=EMtDr5zJs4UON815TAM1Fah6BT6mbz428hlON59RMvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErXtNTe5bvg/JoJuJHCojNIMu7olNKjg3RYw9ivIdERfessrg412bzvLDsFX1/IL6 RLLNcHFaP3mi5GTfhzvmpNdNM4CDG3DcgrBK2h/JZQX7lFg5PrXP+jisV3UoZ9hbB0 XirNpLfMyeOvSBfds0tjw7Ypf0BOXFQnjAjdJOpIU7z3OurjGq1As+dzy86SJNq+sC h2BQmCyv+ka63BUmn5d2ZNW/MtxiaEDP+mSQrkdPBJe70du/0d6BDkAKTWyvZTzeOK os+T61twdAJ9agxYWH0GQWiMDSGMmzM9mExPQb7S4jmsG0EC5i+x6cuD91pYa/kuyr dtppK0pT1laCw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A47CD688F0; Sun, 7 Dec 2025 19:33:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:13 -0700 Message-ID: <20251208023229.3929910-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VHYOB37PZ25FR2NVNLHDU6K5MY27DGOJ X-Message-ID-Hash: VHYOB37PZ25FR2NVNLHDU6K5MY27DGOJ X-MailFrom: sjg@u-boot.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/19] bootctl: Provide an extra poll between select and booting List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Selecting an OS may cause the UI to change, so give it a chance to show those changes before booting. Signed-off-by: Simon Glass --- boot/bootctl/logic.c | 14 ++++++++++++++ include/bootctl/logic.h | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/boot/bootctl/logic.c b/boot/bootctl/logic.c index e2ec2c679ec..d3ee7b2fa6c 100644 --- a/boot/bootctl/logic.c +++ b/boot/bootctl/logic.c @@ -242,8 +242,22 @@ static int logic_poll(struct udevice *dev) struct osinfo *os; os = alist_getw(&priv->osinfo, seq, struct osinfo); + if (!os) + return log_msg_ret("gos", -ENOENT); + priv->ready_to_boot = false; + priv->selected_seq = seq; + } + + if (priv->ready_to_boot) { + struct osinfo *os; + + seq = priv->selected_seq; + os = alist_getw(&priv->osinfo, seq, struct osinfo); + if (!os) + return log_msg_ret("gbo", -ENOENT); log_info("Selected %d: %s\n", seq, os->bflow.os_name); + priv->ready_to_boot = false; /* * try to read the images first; some methods don't support * this diff --git a/include/bootctl/logic.h b/include/bootctl/logic.h index 1aefac29128..a1de68235ac 100644 --- a/include/bootctl/logic.h +++ b/include/bootctl/logic.h @@ -37,10 +37,10 @@ struct udevice; * @default_os: name of the default OS to boot * @osinfo: List of OSes to show * @refresh: true if we need to refresh the UI because something has changed + * @selected_seq: sequence number of OS waiting for passphrase, or -1 if none + * @ready_to_boot: true if success message shown, ready to boot on next poll * * @iter: oslist iterator, used to find new OSes - * @selected: index of selected OS in osinfo alist, or -1 if none has been - * selected yet * @meas: TPM-measurement device * @oslist: provides OSes to boot; we iterate through each osinfo driver to find * all OSes @@ -68,6 +68,8 @@ struct logic_priv { const char *default_os; struct alist osinfo; bool refresh; + int selected_seq; + bool ready_to_boot; struct oslist_iter iter; struct udevice *meas; From patchwork Mon Dec 8 02:32:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 844 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161220; bh=HpXT3ToCbRYnDp2mxGIahIRNB8Xwp3tdCGiq0sCIxac=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=v8frXqWfT/11u9sggfE66rg/nvFMKdZOm8875997l5giKTXX+c8/tfnYQAkPUhjXq f+rm1fin0vJ7jf8D+fltyknzPWl6N/PhI90B+tktBgqzxc4G7XRcuuVjsQ909agLGC fYbVu9m0jJYHHkXd0IfwbTt3pY2sMWSl45QQlcKwgfHtYD2c/ApTgZBzQ6DVAZ4uKx Np/RAg4oRSkv9hIksfBIZrfeI2kDK38fNCioFBD8xXQecH+NCchgVrmg7lT4OiiWc+ Fi//W0cihrpih5FLLPnqDjzPCWpckFH5cjHpBYUuzcUqspYeLkla+1i5d1VmjGL2tl A7HQDS6J1Yh6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D50CB689C5 for ; Sun, 7 Dec 2025 19:33:40 -0700 (MST) 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 hgHplvdTdIcN for ; Sun, 7 Dec 2025 19:33:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161220; bh=HpXT3ToCbRYnDp2mxGIahIRNB8Xwp3tdCGiq0sCIxac=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=v8frXqWfT/11u9sggfE66rg/nvFMKdZOm8875997l5giKTXX+c8/tfnYQAkPUhjXq f+rm1fin0vJ7jf8D+fltyknzPWl6N/PhI90B+tktBgqzxc4G7XRcuuVjsQ909agLGC fYbVu9m0jJYHHkXd0IfwbTt3pY2sMWSl45QQlcKwgfHtYD2c/ApTgZBzQ6DVAZ4uKx Np/RAg4oRSkv9hIksfBIZrfeI2kDK38fNCioFBD8xXQecH+NCchgVrmg7lT4OiiWc+ Fi//W0cihrpih5FLLPnqDjzPCWpckFH5cjHpBYUuzcUqspYeLkla+1i5d1VmjGL2tl A7HQDS6J1Yh6A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE4016894D for ; Sun, 7 Dec 2025 19:33:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161219; bh=Z3pIWbr6avFmarzp61PijrmRhnwFTE5SMlrs0hQ10dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kt9viPr5OWvIZ2GQhM7I0sPaC8FXbaB/SKWP0R828CiPmoZ8dd/6zE50Gti7fsdGF I2JCqNEy9IjECmZNJBYZe8c+C4iJLF7eGQT4DSQQ5D4V8WF7WkzL7ug6KboDbocazO woREoRzWrVoAcTQC6+dDssjH1nOUtZy1jAWqmOzHXcs5cuICWVQ/jJiL3jXdODCbzx iwW0m5wyvHNs9scQ3TA+yqp/473Cp/sdymnwNNrwHgS/gLYuRruZw3zgUGkzNAVXlx X+BVyUiOpNBlN4NQQkFK9WzC9M9jJKjlC05/8//lZWKNJwRPlBu5COO18BToi/lRNi reRMAuWI2SqSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 809EA68930; Sun, 7 Dec 2025 19:33:39 -0700 (MST) 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 10026) with ESMTP id 9rG6kErirj8n; Sun, 7 Dec 2025 19:33:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161215; bh=qZzkPMZmH16wRYtc9b14Z836d4ULLUuJd5EmGsYil+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZF6jcHAwH6d25qRmtgdBI9Ki0v/qI5htyNLSwAf5dS4bHUY+Sd27T9wCnM2QDZKMC ppze+6gHATR0JbWB0KFtva5CVKUead6Hw3Sa+rFALt27/WqM20FUXGLXq5xqGY5bdK +C+O1p+ct+fp4OBrUGTbglnKrs+WdTO9BOhU63taGikJuumDMRfcn2upAQF0yluQ5E FcqGorfEXwVd9wGKed7bZoSEwQ21Mvtpeikt5ptdaWLPuAmV3zZP1mSc4MHOauCK7y 3HOsVTN1PqEOpo+5pjHQe6KhB4ikKjxo3kIjXNq9Q027oPQfddKGJvaDNn+Ahp3Sop 6KCC7G7qwVF+w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3A5DD688F0; Sun, 7 Dec 2025 19:33:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:14 -0700 Message-ID: <20251208023229.3929910-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: Y6TG5M2UTN5HAA7ZOYV7RGBBCMFD6P72 X-Message-ID-Hash: Y6TG5M2UTN5HAA7ZOYV7RGBBCMFD6P72 X-MailFrom: sjg@u-boot.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 11/19] bootctl: Clean up some unwanted debugging in the logic List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Tidy up the code style for checking the result of read_images() and drop some commented-out debug lines. Also fix a shadowed variable while we are here. Signed-off-by: Simon Glass --- boot/bootctl/logic.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/boot/bootctl/logic.c b/boot/bootctl/logic.c index d3ee7b2fa6c..be00c965b66 100644 --- a/boot/bootctl/logic.c +++ b/boot/bootctl/logic.c @@ -74,8 +74,6 @@ static int logic_start(struct udevice *dev) int ret; if (priv->opt_persist_state) { - int ret; - /* read in our state */ ret = bc_state_load(priv->state); if (ret) @@ -263,17 +261,12 @@ static int logic_poll(struct udevice *dev) * this */ ret = read_images(dev, os); - if (ret && ret != -ENOSYS) { - if (ret) - return log_msg_ret("lri", ret); - } + if (ret && ret != -ENOSYS) + return log_msg_ret("lri", ret); ret = prepare_for_boot(dev, os); if (ret) return log_msg_ret("lpb", ret); - /* debugging */ - // return -ESHUTDOWN; - /* boot OS */ ret = bootflow_boot(&os->bflow); if (ret) From patchwork Mon Dec 8 02:32:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 845 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161227; bh=4mSRSRHB3vEkXInPLlsZTLx6S6jqncEtc1QNNYeRDTE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WsJcbt3uEgPaSQuaOeMAB6RgHNV47qqXSmZ7BBruTgzGIbYzIJ+Azi845gRuK+tgE 5ZWWIz7/32WoeYEO5sjQ4Yk9IXQLKvUun2mhF2z+Lkn9/4QgC5VBrKLSLej1CDMjM4 WwHewtE7do+qDP5//9vEHMkH7ITUJfvkcEqOvPYVZraiWRloaF0gtSa6Tc0cXPBIfx PbMlc1+AZY3hNGz056cxbVOkpqD8Utn0gAgYPuHXjyhxdlrTEev8PesaAlN6uU/+6r ixD4cYqEyMHhLEo+spM2Hbi5txqHjCOsimnsicb9dj2RI8MHRSKdRGvB3kwFljvpVe GpbN0mTyxJ/MQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54AFF689C7 for ; Sun, 7 Dec 2025 19:33:47 -0700 (MST) 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 s_iIvPKDiYjX for ; Sun, 7 Dec 2025 19:33:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161227; bh=4mSRSRHB3vEkXInPLlsZTLx6S6jqncEtc1QNNYeRDTE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WsJcbt3uEgPaSQuaOeMAB6RgHNV47qqXSmZ7BBruTgzGIbYzIJ+Azi845gRuK+tgE 5ZWWIz7/32WoeYEO5sjQ4Yk9IXQLKvUun2mhF2z+Lkn9/4QgC5VBrKLSLej1CDMjM4 WwHewtE7do+qDP5//9vEHMkH7ITUJfvkcEqOvPYVZraiWRloaF0gtSa6Tc0cXPBIfx PbMlc1+AZY3hNGz056cxbVOkpqD8Utn0gAgYPuHXjyhxdlrTEev8PesaAlN6uU/+6r ixD4cYqEyMHhLEo+spM2Hbi5txqHjCOsimnsicb9dj2RI8MHRSKdRGvB3kwFljvpVe GpbN0mTyxJ/MQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C7B06894D for ; Sun, 7 Dec 2025 19:33:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161225; bh=hn5YsO3mwOgRzHyA14CpdFOYhsTmSo2i71AQTQVaIk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8R77KJEpQHjfSbaBIuojaXjHMZFGFAvfIscsHnh3ReIHNNNYLOGThCpfvxqTZZhK bn51PptSof3bxFIkz+lc/25uW169il9EZs/WDtJe1T3/56oYJZsPMKl2k31wRF0xIH ztguGF+HRYJs6p1tkY9R2JQX5L4GNo8QfuAXEeB36OUZN9XIuvdcO8KuCn6xmt5+Pd EfrVjz2+hTvGbp0pYkdAMzboCATFYcAuXWDQn98gk526S/WDgcosi3fQ02fUHRsmOM JpfO3PrsUiWlV7+BCE/zBHkUMpfvzOTwGbLwalCJvy+CdyUFHZZ9k60GJQK5OPa/E/ UqOIkSw2PuAzw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5386E6883E; Sun, 7 Dec 2025 19:33:45 -0700 (MST) 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 10026) with ESMTP id hb0_0zseWNvo; Sun, 7 Dec 2025 19:33:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161220; bh=McphZKzFLzWz/oouDv/9z/PiPN9u6tuWIdnWqQNZB40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4dOADiktf5477gYaDJK6JHQkwcepYfM6KhjjLiCXQZBXiSc3pHdbft1+RKi49+1n 5M9tz3p5h9Wj3d4VJZC32ehPKGf/72Taw4vY5KD4mD6q+FCVJnbx9P35XqMZk+ICHi sB/zlCJ1QrAooSAAMtlmsYwZNw7UmOWpZP9kAYXFzFWZja2gipxZr6vc/mnkDEJar7 6SMbhjCQmAuIXnVYejpOz5RAFKb/eJRoia8ZPKa/z8R4sG7u5xBvE/Zo/cUIW8EOF9 PqamE+GG4AmnMhDzajAMAjuOs5pqjyZqU662rPCZhTyDilyZ+Qlo7LYxtr1GGKyEly QDdCgZdlxlhrA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C191E688F0; Sun, 7 Dec 2025 19:33:39 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:15 -0700 Message-ID: <20251208023229.3929910-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 76XKBISKRE5T3KXV7N3DDGAFELAVVUXS X-Message-ID-Hash: 76XKBISKRE5T3KXV7N3DDGAFELAVVUXS X-MailFrom: sjg@u-boot.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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/19] bootctl: Add the logic for disk unlock using a TKey List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The unlock process is quite different with a TKey, since we need to load the signing app with the user's passphrase as the USS. If the TKey is not already in firmware mode we must prompt the user to remove and re-insert it. The easiest way to implement this is via a state machine. Add the required logic: - detect key presence and absence - prompt for removal and insertion - send the app, while keeping the UI responsive - unlock the disk once the TKey provides a key - report success or failure to the user Ensure that the logic is only used if CONFIG_TKEY and CONFIG_LUKS are both enabled. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/bootctl/logic.c | 670 +++++++++++++++++++++++++++++++++++++++- include/bootctl/logic.h | 52 ++++ 2 files changed, 721 insertions(+), 1 deletion(-) diff --git a/boot/bootctl/logic.c b/boot/bootctl/logic.c index be00c965b66..96cc270ae2c 100644 --- a/boot/bootctl/logic.c +++ b/boot/bootctl/logic.c @@ -10,8 +10,12 @@ #include #include +#include #include +#include +#include #include +#include #include #include #include @@ -20,9 +24,12 @@ #include #include #include +#include +#include enum { - COUNTDOWN_INTERVAL_MS = 1000, /* inteval between autoboot updates */ + COUNTDOWN_INTERVAL_MS = 1000, /* interval between autoboot updates */ + ERROR_TIMEOUT_MS = 5000, /* timeout for error message display */ }; static int logic_prepare(struct udevice *dev) @@ -64,6 +71,17 @@ static int logic_prepare(struct udevice *dev) return log_msg_ret("blo", ret); } + /* Find TKey device if enabled (test can override this) */ + if (priv->opt_tkey) { + ret = uclass_find_first_device(UCLASS_TKEY, &priv->tkey); + if (ret || !priv->tkey) { + log_debug("TKey not found at startup\n"); + } else { + log_debug("TKey '%s'\n", priv->tkey->name); + /* Device found but not probed yet - not present */ + priv->tkey_present = false; + } + } return 0; } @@ -181,6 +199,615 @@ static int read_images(struct udevice *dev, struct osinfo *osinfo) return 0; } +/** + * show_unlock_error() - Display error message and update UI state + * + * Helper function to show an error message, display error state, + * and hide the pass prompt. + * + * @priv: Logic private data + * @seq: Sequence number of the selected OS + * @msg: Error message to display + * Return: 0 if OK, -ve on error + */ +static int show_unlock_error(struct logic_priv *priv, int seq, const char *msg) +{ + int ret; + + ret = bc_ui_set_pass_msg(priv->ui, seq, msg); + if (ret && ret != -ENOSYS) + return log_msg_ret("sem", ret); + ret = bc_ui_show_pass_msg(priv->ui, seq, true); + if (ret && ret != -ENOSYS) + return log_msg_ret("see", ret); + ret = bc_ui_show_pass(priv->ui, seq, false); + if (ret) + return log_msg_ret("hsp", ret); + + return 0; +} + +/** + * start_tkey_load() - Start TKey app loading + * + * Starts the app loading process. Expects TKey device to be already probed + * and present. + * + * @dev: Logic device + * @pass: User passphrase to use as USS + * Return: 0 on success or if needs replug (state set appropriately), + * -ve on error + */ +static int start_tkey_load(struct udevice *dev, const char *pass) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + ret = tkey_load_start(&priv->tkey_load_ctx, priv->tkey, + (const u8 *)__signer_1_0_0_begin, + TKEY_SIGNER_SIZE, (const u8 *)pass, strlen(pass)); + if (ret) + return ret; + log_debug("Started TKey app loading (%zx bytes)\n", TKEY_SIGNER_SIZE); + + return 0; +} + +/** + * derive_tkey_disk_key() - Derive disk encryption key from TKey public key + * + * Gets the public key from the TKey and derives the disk encryption key + * using SHA256. Must match the Python tkey-fde-key.py implementation. + * + * @dev: Logic device + * Return: 0 on success, -ve on error + */ +static int derive_tkey_disk_key(struct udevice *dev) +{ + struct logic_priv *priv = dev_get_priv(dev); + u8 pubkey[TKEY_PUBKEY_SIZE]; + char pubkey_hex[TKEY_PUBKEY_SIZE * 2 + 1]; + sha256_context ctx; + int ret; + + /* Get public key from the loaded app */ + ret = tkey_get_pubkey(priv->tkey, pubkey); + if (ret) { + log_warning("Failed to get TKey public key (err=%dE)\n", ret); + return ret; + } + + /* + * Derive disk encryption key from public key using SHA256 + * Must match Python tkey-fde-key.py implementation which does: + * hashlib.sha256(pubkey.encode()).digest() + * + * This converts the binary public key to hex string, + * then hashes the string bytes. + */ + bin2hex(pubkey_hex, pubkey, TKEY_PUBKEY_SIZE); + + sha256_starts(&ctx); + sha256_update(&ctx, (const u8 *)pubkey_hex, TKEY_PUBKEY_SIZE * 2); + sha256_finish(&ctx, priv->tkey_disk_key); + + log_info("TKey disk key derived successfully\n"); + + return 0; +} + +/** + * perform_tkey_unlock() - Perform TKey-based LUKS unlock + * + * This function performs LUKS unlock using the TKey-derived key as binary + * passphrase material. Expects TKey to be already loaded and key derived. + * + * @dev: Logic device + * @os: OS information containing the encrypted bootflow + * @seq: Sequence number of the selected OS + * @master_key: Buffer to store the unlocked master key + * @key_size: Pointer to key size (input: buffer size, output: actual size) + * Return: 0 if unlock succeeded, -ENOENT if there is no encrypted partition, + * other -ve on other error + */ +static int perform_tkey_unlock(struct udevice *dev, struct osinfo *os, int seq, + u8 *master_key, u32 *key_sizep) +{ + struct logic_priv *priv = dev_get_priv(dev); + struct disk_partition pinfo; + int ret; + + /* TKey key should already be derived at this point */ + assert(priv->ustate == UNS_TKEY_UNLOCK); + + /* Get partition info for the encrypted partition (next after boot) */ + ret = part_get_info(dev_get_uclass_plat(os->bflow.blk), + os->bflow.part + 1, &pinfo); + if (ret) { + log_warning("Failed to get partition info (err=%dE)\n", ret); + return -ENOENT; + } + + /* + * Use TKey-derived key as binary passphrase input to LUKS KDF + * The key is treated as binary passphrase material that will be + * processed by PBKDF2/Argon2 just like a text passphrase would be. + * This matches how cryptsetup --key-file works. + */ + log_info("Using LUKS1 unlock with binary passphrase\n"); + ret = luks_unlock(os->bflow.blk, &pinfo, priv->tkey_disk_key, + TKEY_DISK_KEY_SIZE, true, master_key, key_sizep); + if (ret) + return log_msg_ret("htu", ret); + + return 0; +} + +/** + * handle_idle() - Set up the passphrase prompt UI + * + * This handles the UNS_IDLE state, showing the passphrase prompt and + * transitioning to UNS_WAITING_PASS. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on success, -ve on error + */ +static int handle_idle(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + /* show passphrase prompt and hide any error */ + ret = bc_ui_show_pass_msg(priv->ui, seq, false); + if (ret && ret != -ENOSYS) + return log_msg_ret("hse", ret); + ret = bc_ui_show_pass(priv->ui, seq, true); + if (ret) + return log_msg_ret("lsp", ret); + priv->ustate = UNS_WAITING_PASS; + priv->selected_seq = seq; + priv->refresh = true; + + return 0; +} + +/** + * handle_waiting_pass() - Handle waiting for passphrase entry + * + * This handles the UNS_WAITING_PASS state, getting the passphrase and + * showing the "Unlocking..." message, then transitioning to either + * UNS_UNLOCK_NORMAL or UNS_TKEY_START based on configuration. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on success, -ve on error + */ +static int handle_waiting_pass(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + const char *pass; + int ret; + + /* Get pass and show "Unlocking..." message */ + ret = bc_ui_get_pass(priv->ui, seq, &pass); + if (ret) { + log_warning("Failed to get pass (err=%dE)\n", ret); + priv->ustate = UNS_IDLE; + return -EAGAIN; /* Return to menu */ + } + + /* Show "Unlocking..." message */ + ret = bc_ui_set_pass_msg(priv->ui, seq, "Unlocking..."); + if (ret && ret != -ENOSYS) + return log_msg_ret("spu", ret); + ret = bc_ui_show_pass_msg(priv->ui, seq, true); + if (ret && ret != -ENOSYS) + return log_msg_ret("ssu", ret); + ret = bc_ui_show_pass(priv->ui, seq, false); + if (ret) + return log_msg_ret("hsp", ret); + + /* Select unlock path based on TKey option */ + if (priv->opt_tkey) + priv->ustate = UNS_TKEY_START; + else + priv->ustate = UNS_UNLOCK_NORMAL; + priv->refresh = true; + + return 0; +} + +/** + * handle_unlock_normal() - Perform normal LUKS unlock with direct passphrase + * + * This handles the UNS_UNLOCK_NORMAL state, performing LUKS unlock + * with direct passphrase. + * + * @dev: Logic device + * @os: OS information + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_unlock_normal(struct udevice *dev, struct osinfo *os, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + struct disk_partition pinfo; + u8 master_key[128]; + u32 key_size = sizeof(master_key); + const char *pass; + int ret; + + /* Get pass for direct LUKS unlock */ + ret = bc_ui_get_pass(priv->ui, seq, &pass); + if (ret) { + log_warning("Failed to get pass (err=%dE)\n", ret); + priv->ustate = UNS_IDLE; + return 0; + } + + /* Get partition info for the encrypted partition (next after boot) */ + ret = part_get_info(dev_get_uclass_plat(os->bflow.blk), + os->bflow.part + 1, &pinfo); + if (ret) { + log_warning("Failed to get partition info (err=%dE)\n", ret); + priv->ustate = UNS_IDLE; + return 0; + } + + /* Try to unlock with the pass */ + ret = luks_unlock(os->bflow.blk, &pinfo, (const u8 *)pass, strlen(pass), + false, master_key, &key_size); + + /* Store result and transition to result handling state */ + priv->unlock_result = ret; + priv->ustate = UNS_UNLOCK_RESULT; + priv->refresh = true; + + return 0; +} + +/** + * handle_tkey_wait_remove() - Handle TKey removal wait state + * + * This handles the UNS_TKEY_WAIT_REMOVE state, waiting for TKey to be + * physically removed and then transitioning to UNS_TKEY_WAIT_INSERT. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_wait_remove(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + /* Check if TKey is still present by checking app mode */ + ret = tkey_in_app_mode(priv->tkey); + if (ret < 0) { + /* TKey removed (error accessing device) */ + log_debug("TKey removed, cleaning up device\n"); + device_remove(priv->tkey, DM_REMOVE_NORMAL); + priv->tkey_present = false; + log_debug("TKey removed, ready for next attempt\n"); + + /* Show replug message */ + ret = show_unlock_error(priv, seq, "Please insert TKey"); + if (ret) + return log_msg_ret("rpe", ret); + priv->refresh = true; + priv->ustate = UNS_TKEY_WAIT_INSERT; + + return 0; + } + + return 0; +} + +/** + * handle_tkey_start() - Handle TKey unlock start + * + * Checks if TKey device is available and transitions to wait for insert state. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_start(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + + /* Check if TKey device is available */ + if (!priv->tkey) { + log_err("TKey device not found\n"); + show_unlock_error(priv, seq, "TKey not found"); + return -ENODEV; + } + priv->ustate = UNS_TKEY_WAIT_INSERT; + + return 0; +} + +/** + * handle_tkey_wait_insert() - Handle TKey insertion wait state + * + * This handles the UNS_TKEY_WAIT_INSERT state, probing for TKey device + * and transitioning to UNS_TKEY_INSERTED when found. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: -EAGAIN to continue waiting or transition to next state + */ +static int handle_tkey_wait_insert(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + log_debug("Probing TKey device\n"); + ret = device_probe(priv->tkey); + if (ret) { + /* Probe failed - device not yet inserted */ + log_debug("TKey not inserted yet, waiting\n"); + priv->ustate = UNS_TKEY_WAIT_INSERT; + return 0; + } + /* Probe succeeded - device is present */ + log_debug("TKey probed successfully\n"); + priv->tkey_present = true; + priv->ustate = UNS_TKEY_INSERTED; + + return 0; +} + +/** + * handle_tkey_inserted() - Handle TKey inserted state + * + * This handles the UNS_TKEY_INSERTED state, starting the TKey app loading + * process with the user's passphrase. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_inserted(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + const char *pass; + int ret; + + /* Get passphrase for TKey derivation */ + ret = bc_ui_get_pass(priv->ui, seq, &pass); + if (ret) { + log_warning("Failed to get pass (err=%dE)\n", ret); + priv->ustate = UNS_IDLE; + return 0; /* Return to menu */ + } + + /* Start loading TKey app with USS */ + ret = start_tkey_load(dev, pass); + if (ret == -ENOTSUPP) { + /* TKey in app mode, needs to be replugged */ + log_debug("TKey not in firmware mode, needs replug\n"); + priv->ustate = UNS_TKEY_WAIT_REMOVE; + + /* Show replug message */ + ret = show_unlock_error(priv, seq, "Please remove TKey"); + if (ret) + return log_msg_ret("rpe", ret); + priv->refresh = true; + return 0; + } else if (ret) { + log_warning("Failed to start TKey app load (err=%dE)\n", ret); + return ret; + } + + priv->ustate = UNS_TKEY_LOADING; + + return 0; +} + +/** + * handle_tkey_loading() - Handle TKey app loading state + * + * This handles the UNS_TKEY_LOADING state, sending blocks of the TKey app + * and transitioning to UNS_TKEY_READY when complete. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_loading(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + /* Send 1 block per poll to keep the UI responsive */ + ret = tkey_load_next(&priv->tkey_load_ctx, 1); + if (ret == -EAGAIN) { + char msg[64]; + int percent; + + /* More blocks to send */ + log_debug("TKey loading: %u/%u bytes\n", + priv->tkey_load_ctx.offset, + priv->tkey_load_ctx.app_size); + + /* Show loading progress - round up so 100% will show */ + percent = ((priv->tkey_load_ctx.offset + 1) * 100 + + priv->tkey_load_ctx.app_size - 1) / + priv->tkey_load_ctx.app_size; + if (percent > 100) + percent = 100; + snprintf(msg, sizeof(msg), "Preparing TKey... %d%%", percent); + bc_ui_set_pass_msg(priv->ui, seq, msg); + priv->refresh = true; + return 0; + } + + if (ret) { + log_warning("Failed to load TKey app (err=%dE)\n", ret); + priv->ustate = UNS_TKEY_START; + return ret; + } + + /* Loading complete, now derive disk key */ + log_info("TKey app loaded successfully, deriving disk key\n"); + priv->ustate = UNS_TKEY_READY; + + return 0; +} + +/** + * handle_tkey_ready() - Handle TKey ready state + * + * This handles the UNS_TKEY_READY state, deriving the disk encryption key + * from the TKey public key and transitioning to IN_PROGRESS state. + * + * @dev: Logic device + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_ready(struct udevice *dev, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + int ret; + + /* Derive disk encryption key from TKey public key */ + ret = derive_tkey_disk_key(dev); + if (ret) + return ret; + bc_ui_set_pass_msg(priv->ui, seq, "Unlocking..."); + priv->refresh = true; + + /* Key derived, start unlock */ + priv->ustate = UNS_TKEY_UNLOCK; + + return 0; +} + +/** + * handle_tkey_unlock() - Handle TKey-based LUKS unlock state + * + * This handles the UNS_TKEY_UNLOCK state, performing LUKS unlock with + * TKey-derived key and transitioning to UNS_UNLOCK_RESULT. + * + * @dev: Logic device + * @os: OS information + * @seq: Sequence number of the selected OS + * Return: 0 on normal operation, -ve on error + */ +static int handle_tkey_unlock(struct udevice *dev, struct osinfo *os, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + u8 master_key[128]; + u32 key_size = sizeof(master_key); + int ret; + + ret = perform_tkey_unlock(dev, os, seq, master_key, &key_size); + + /* Store result and transition to result handling state */ + priv->unlock_result = ret; + priv->ustate = UNS_UNLOCK_RESULT; + priv->refresh = true; + + return 0; +} + +/** + * handle_unlock_result() - Handle the result of unlock operation + * + * Processes unlock result, showing either error or success message. + * On error, shows "Incorrect passphrase" and transitions to UNS_BAD_PASS. + * On success, shows "Unlock successful" and transitions to UNS_OK. + * + * @priv: Logic private data + * @seq: Sequence number of the selected OS + * @unlock_ret: Return value from unlock operation + * Return: -EAGAIN always (to wait for next poll) + */ +static int handle_unlock_result(struct logic_priv *priv, int seq, + int unlock_ret) +{ + int ret; + + if (unlock_ret) { + log_warning("Failed to unlock LUKS partition (err=%dE)\n", + unlock_ret); + + /* Set and show error message, hide pass prompt */ + ret = show_unlock_error(priv, seq, "Incorrect passphrase"); + if (ret) + return log_msg_ret("ipe", ret); + /* Display error for 5 seconds before allowing retry */ + priv->time_error = get_timer(0); + priv->ustate = UNS_BAD_PASS; + priv->refresh = true; + return 0; + } + + log_info("LUKS partition unlocked successfully\n"); + /* Set and show success message briefly, hide pass prompt */ + ret = show_unlock_error(priv, seq, "Unlock successful"); + if (ret) + return log_msg_ret("suc", ret); + /* Show success message for one poll cycle, then boot */ + priv->ustate = UNS_OK; + priv->refresh = true; + /* TODO: Create blkmap device for decrypted access */ + + return 0; +} + +static int handle_encrypted_tkey(struct udevice *dev, struct osinfo *os, + int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + + if (!IS_ENABLED(CONFIG_TKEY)) + return -ENOSYS; + + switch (priv->ustate) { + case UNS_TKEY_WAIT_REMOVE: + return handle_tkey_wait_remove(dev, seq); + case UNS_TKEY_START: + return handle_tkey_start(dev, seq); + case UNS_TKEY_WAIT_INSERT: + return handle_tkey_wait_insert(dev, seq); + case UNS_TKEY_INSERTED: + return handle_tkey_inserted(dev, seq); + case UNS_TKEY_LOADING: + return handle_tkey_loading(dev, seq); + case UNS_TKEY_READY: + return handle_tkey_ready(dev, seq); + case UNS_TKEY_UNLOCK: + return handle_tkey_unlock(dev, os, seq); + default: + return -EINVAL; + } +} + +static int handle_encrypted(struct udevice *dev, struct osinfo *os, int seq) +{ + struct logic_priv *priv = dev_get_priv(dev); + + switch (priv->ustate) { + case UNS_IDLE: + return handle_idle(dev, seq); + case UNS_WAITING_PASS: + return handle_waiting_pass(dev, seq); + case UNS_UNLOCK_NORMAL: + return handle_unlock_normal(dev, os, seq); + case UNS_BAD_PASS: + case UNS_OK: + /* These states shouldn't reach here in normal flow */ + return -EINVAL; + case UNS_UNLOCK_RESULT: + return handle_unlock_result(priv, seq, priv->unlock_result); + default: + return handle_encrypted_tkey(dev, os, seq); + } +} + static int logic_poll(struct udevice *dev) { struct logic_priv *priv = dev_get_priv(dev); @@ -207,6 +834,26 @@ static int logic_poll(struct udevice *dev) } } + /* if unlock succeeded - show a message and boot on the next poll */ + if (priv->ustate == UNS_OK) { + /* Success message is set, prepare to boot after rendering */ + priv->ustate = UNS_IDLE; + priv->ready_to_boot = true; + priv->refresh = true; + } + + /* Check if error message display timeout has expired */ + if (priv->ustate == UNS_BAD_PASS && priv->time_error && + get_timer(priv->time_error) > ERROR_TIMEOUT_MS) { + /* Hide error message and allow retry */ + ret = bc_ui_show_pass_msg(priv->ui, priv->selected_seq, false); + if (ret && ret != -ENOSYS) + return log_msg_ret("hse", ret); + priv->time_error = 0; + priv->ustate = UNS_IDLE; + priv->refresh = true; + } + if (priv->autoboot_active && get_timer(priv->start_time) > priv->next_countdown) { ulong secs = get_timer(priv->start_time) / 1000; @@ -230,18 +877,38 @@ static int logic_poll(struct udevice *dev) else if (ret) priv->refresh = true; + /* Ignore menu selection while displaying error message */ + if (selected && priv->ustate == UNS_BAD_PASS) + selected = false; + if (!selected && priv->autoboot_active && !priv->autoboot_remain_s && seq >= 0) { log_info("Selecting %d due to timeout\n", seq); selected = true; } + /* If ready to unlock, trigger selection to continue unlock process */ + if (!selected && priv->ustate != UNS_WAITING_PASS && + priv->ustate != UNS_IDLE && priv->ustate != UNS_BAD_PASS) { + seq = priv->selected_seq; + selected = true; + log_debug("Continuing unlock for seq %d\n", seq); + } + if (selected) { struct osinfo *os; os = alist_getw(&priv->osinfo, seq, struct osinfo); if (!os) return log_msg_ret("gos", -ENOENT); + + /* If encrypted, handle pass entry and unlock */ + if (IS_ENABLED(CONFIG_LUKS) && + (os->bflow.flags & BOOTFLOWF_ENCRYPTED)) { + ret = handle_encrypted(dev, os, seq); + if (ret) + return ret; + } priv->ready_to_boot = false; priv->selected_seq = seq; } @@ -294,6 +961,7 @@ static int logic_of_to_plat(struct udevice *dev) priv->opt_autoboot = ofnode_read_bool(node, "autoboot"); priv->opt_measure = ofnode_read_bool(node, "measure"); priv->opt_slow_refresh = ofnode_read_bool(node, "slow-refresh"); + priv->opt_tkey = ofnode_read_bool(node, "tkey"); return 0; } diff --git a/include/bootctl/logic.h b/include/bootctl/logic.h index a1de68235ac..62a0223d080 100644 --- a/include/bootctl/logic.h +++ b/include/bootctl/logic.h @@ -10,9 +10,43 @@ #define __bootctl_logic_h #include +#include struct udevice; +/** + * enum unlock_state - State of the disk unlock process + * + * @UNS_IDLE: No unlock in progress + * @UNS_WAITING_PASS: Waiting for user to enter passphrase + * @UNS_UNLOCK_NORMAL: Unlocking with direct passphrase + * @UNS_TKEY_START: Unlocking with TKey + * @UNS_TKEY_WAIT_REMOVE: Waiting for TKey to be removed (after wrong passphrase) + * @UNS_TKEY_WAIT_INSERT: Waiting for TKey to be inserted (after removal) + * @UNS_TKEY_INSERTED: TKey inserted, starting app load + * @UNS_TKEY_LOADING: Loading TKey app + * @UNS_TKEY_READY: TKey key derived, ready to unlock + * @UNS_TKEY_UNLOCK: Unlocking LUKS partition + * @UNS_UNLOCK_RESULT: Processing unlock result (success or failure) + * @UNS_BAD_PASS: Unlock failed, showing error message + * @UNS_OK: Unlock succeeded, showing success message + */ +enum unlock_state { + UNS_IDLE, + UNS_WAITING_PASS, + UNS_UNLOCK_NORMAL, + UNS_TKEY_START, + UNS_TKEY_WAIT_REMOVE, + UNS_TKEY_WAIT_INSERT, + UNS_TKEY_INSERTED, + UNS_TKEY_LOADING, + UNS_TKEY_READY, + UNS_TKEY_UNLOCK, + UNS_UNLOCK_RESULT, + UNS_BAD_PASS, + UNS_OK, +}; + /** * struct logic_priv - Information maintained by the boot logic as it works * @@ -27,6 +61,7 @@ struct udevice; * @opt_autoboot: true to autoboot the default OS after a timeout * @opt_measure: true to measure loaded images, etc. * @opt_slow_refresh: refresh the UI only when needed + * @opt_tkey: true to use TKey for unlocking encrypted volumes * * @state_loaded: true if the state information has been loaded * @scanning: true if scanning for new OSes @@ -40,6 +75,14 @@ struct udevice; * @selected_seq: sequence number of OS waiting for passphrase, or -1 if none * @ready_to_boot: true if success message shown, ready to boot on next poll * + * @tkey: TKey device (pointer never changes once set) + * @tkey_present: true if TKey is physically present and accessible + * @tkey_load_ctx: TKey app loading context for iterative loading + * @tkey_disk_key: Buffer to store derived disk key from TKey + * @ustate: Current state of the disk unlock process + * @unlock_result: Result of disk unlock (0 = OK, -ve on error) + * @time_error: monotonic time when error message display started + * * @iter: oslist iterator, used to find new OSes * @meas: TPM-measurement device * @oslist: provides OSes to boot; we iterate through each osinfo driver to find @@ -57,6 +100,7 @@ struct logic_priv { bool opt_autoboot; bool opt_measure; bool opt_slow_refresh; + bool opt_tkey; bool state_loaded; bool state_saved; @@ -71,6 +115,14 @@ struct logic_priv { int selected_seq; bool ready_to_boot; + struct udevice *tkey; + bool tkey_present; + struct tkey_load_ctx tkey_load_ctx; + u8 tkey_disk_key[TKEY_DISK_KEY_SIZE]; + enum unlock_state ustate; + int unlock_result; + ulong time_error; + struct oslist_iter iter; struct udevice *meas; struct udevice *oslist; From patchwork Mon Dec 8 02:32:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 846 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161232; bh=AwH19UOWyMpfc4u6d0N31J6vtTSymGPOkqJqRVigfTk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=RektKiBkiBsY0EXhOAkB1HbDnBKJg7SmBRnMuYQYVEl6U472Uw17ROXQo5QoOgfPb dEhwDKJpCLK+4b8hi8ohaNf66itnpzQSU4Ruky7OrRDzQrkLdB6QStnF1X1/de78os mzL93GjEchAXP2XCKnqtT7VOv9A4zXKSHKqb9yxnlpP9DWwQNoVQ3nxYF2I9IFRR26 /i8q965tWUzYV5CKAEVYvuJ9DU4Q7vgwTJ747MxtR0P5HaQ0WpDh30MvqdJpryvgmR rx/+h3a3/g0tQZneAE3chAE6lMx1t5j7/XroDkp9IAcX8A2cFhJBjtz5+YU2z3bgNh db/pqcwqMemdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0FE2E689D0 for ; Sun, 7 Dec 2025 19:33:52 -0700 (MST) 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 GjP6fO6tK2bV for ; Sun, 7 Dec 2025 19:33:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161231; bh=AwH19UOWyMpfc4u6d0N31J6vtTSymGPOkqJqRVigfTk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cbTLCjLyvjiMyb/bUM0IqCWyiv113HZdoqWWSMH+Xun6yuTJnQz4sMAvldTtdFyX3 AeODejbtzxUcxDR2gdDyyijbMRswfyvGG7ts+t5029qjqwXrQZVAp/EKvcJVGTC4jZ oYoIm4DDiBi1oBFyzIwJSToajSgnipyFZ0ukSVB40pBXvc+I+2Y+2BwLvsCb0NO8lh HAvGVUhNUTKA/976qskPI5um1l9FQ9CDHzI1jc9MByJrTl7Vg8QDRXEZnMyjfTK0rk GhRVZ7s/7R3/rIoSoRJ8BaLrb5ciOSU8t1jerK2VSIUHnb3uLvlvCfdYWVBsBIhn0I usLiZs9OgogoA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F203C688FC for ; Sun, 7 Dec 2025 19:33:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161229; bh=UKI1WuAgTH5v/cHhiBo0Sm5hFU7KLAZ+9AYqbjQr5jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GaM+OG5lAY04qt1SmRprHU8iA6duYt4IkIKRJObRJDGwm6+Lp/9DWE/V1pORvVFjr helKxWN+NONpnED3vZ2a3nD7coCcGp9XcUg2okG9qXX+8OWoIc8+tPY0B+E9XtPHel RRAAqEpdA66rSzFrY5xle7OnL0ZHl26BzzfMOfSQk1cagLx/nneBJSIVcdAvmJzRer Ylzx9wcmeG0t98M7kQxA9wUk311MXTi19P88IMfeDkZQ9XFatE6tUyJ4z/asi9z120 u2ayyLHQWEx4yUUfs+grkK4fLX3RSkTsuuRAo821lsSXKlDrR6rymDR78S1I73lZTa TxlYzeJBGkd4w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E62D1689C7; Sun, 7 Dec 2025 19:33:49 -0700 (MST) 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 10026) with ESMTP id YebWM3HCxKQn; Sun, 7 Dec 2025 19:33:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161224; bh=u4yCX4LPMO1si5HymWVZYMOUJYs1AQfdsZl00NR7YIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lyl1vZya2Ah6lNFkOTQeZiS36xksN4IvFk+hzPnxioleSuMvsJ9dlOALd3kixsUld UdFmR/l5FXom31/VERPQvn7q2/sA+qsX1+BdhSJ/VJmWarNjEaUyKV4NOgQKFXVIPY KQyh7ISRv0u5nsTdB41KTINmXzqkkI0SvbrS55c/iWADCGam3SKz44XBiX3qy41BY8 O6UYIoja7bho7tpk9333ZF89tjzWa5c7oPv9KF1nDbW9qwTdLsuxoOSyi97ivDG/yu tXilymsQ0AjyNglZe7VLz95dRZxupc8koBcg23vBrntkpLxPhbVWwUBtmle1QXVBym 0BYEGq0zRWnXQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B1641688FC; Sun, 7 Dec 2025 19:33:44 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:16 -0700 Message-ID: <20251208023229.3929910-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WMYK6ZJJNI6NYPVXI4AFUWJJWH5DLTUS X-Message-ID-Hash: WMYK6ZJJNI6NYPVXI4AFUWJJWH5DLTUS X-MailFrom: sjg@u-boot.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/19] bootctl: Fix up the header-inclusion order in the test List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The bootctl headers should before the test headers. Fix this. Signed-off-by: Simon Glass --- test/boot/bootctl/bootctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/boot/bootctl/bootctl.c b/test/boot/bootctl/bootctl.c index ff1a9722fe3..6c12cf708e0 100644 --- a/test/boot/bootctl/bootctl.c +++ b/test/boot/bootctl/bootctl.c @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include "bootctl_common.h" #include #include @@ -26,6 +24,8 @@ #include #include #include +#include +#include #include "../bootstd_common.h" /* test that expected devices are available and can be probed */ From patchwork Mon Dec 8 02:32:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 847 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161236; bh=8gH06nNu6iEu9wKH9/rM1AOvcnEp4qvkZGidGdF1QSQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KFKYXuVGS7O+r82jzX286FtVCebzkytzHjR+m4F8WPlwOhNBnujsZ8mtfLKTa5yTk YDwtuvKh2AT1Y3c30V0aHni48YGFIqvV4mSSm66fb0xKU397It+Bp4U9CEaGK9k49x m1p4McAxLUYLYXJ9db9CT50S8yK/ScilLseyHI+HVooYlfRv4Z6Xj/RQO4TYEa7+fD 6o2/ylleIbKc4bBPkjRORXSsQX8Uq4WFH418LDB83duFLX2OB5aOixd/NsPnwN4ap7 buhEjDlqqwwrLqbjl1f7ZQrbCpjP5yfYQM8gYW/KE9tb+YdVrnmZ0Y+Hrq9kC7xmaU 3yxWO82LZqUEQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7D156689D3 for ; Sun, 7 Dec 2025 19:33:56 -0700 (MST) 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 tyirTObK20GE for ; Sun, 7 Dec 2025 19:33:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161236; bh=8gH06nNu6iEu9wKH9/rM1AOvcnEp4qvkZGidGdF1QSQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=KFKYXuVGS7O+r82jzX286FtVCebzkytzHjR+m4F8WPlwOhNBnujsZ8mtfLKTa5yTk YDwtuvKh2AT1Y3c30V0aHni48YGFIqvV4mSSm66fb0xKU397It+Bp4U9CEaGK9k49x m1p4McAxLUYLYXJ9db9CT50S8yK/ScilLseyHI+HVooYlfRv4Z6Xj/RQO4TYEa7+fD 6o2/ylleIbKc4bBPkjRORXSsQX8Uq4WFH418LDB83duFLX2OB5aOixd/NsPnwN4ap7 buhEjDlqqwwrLqbjl1f7ZQrbCpjP5yfYQM8gYW/KE9tb+YdVrnmZ0Y+Hrq9kC7xmaU 3yxWO82LZqUEQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6D94D689C7 for ; Sun, 7 Dec 2025 19:33:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161234; bh=mJXpLPZKQ95qZAxLNyx5J/ozHiz1Jm+KHgQvBNUBwow=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MpmoGAUxiewHs2yAO4Kw6+Ci7yxgSYr+OJMmDhyS5+yJlySoET1gdU8CRYatSJBRQ 1lf3z8JYoUTv/yWNAGg5pt6iRHvy068bqW1HMeIaTKdCDfDYFE3i+N4vuyQioy99eO 5YaVEBOSjlBUZrHwX7iRA+LxW3nmD/GGFI32N0Ss4l8u04kqcUW0BtmwqR+ZBfmsSc sB/1vvUojhGdVrb0Nl/HEN5ebs8SfD1uwfRiRvwKp5sciYm1xDC0f7EHhpjKyjUGA5 7mUuV6FxFq26QY+9CGh2MSNszI9XQqOV6l4ga0diuaKJwTciAej7lBfg6OKnpvr5wM pJCzgNIc9cJIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6DED768930; Sun, 7 Dec 2025 19:33:54 -0700 (MST) 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 10026) with ESMTP id cm-5QFobKU1n; Sun, 7 Dec 2025 19:33:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161229; bh=jP1RQKliySvR/6MUlQ8Obp77TQnbb/xCS/eVyaJYDDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wDSLVvxMXaKcsImWf6t8H195EA/mFTRgj1eg2S6P3ydX97ZvNArzC1lkHRxwWe2Xs ffj/o+PFz0oYjwzVWIwdPq+kE0ppr7ZnsEWyrSkzqt/36v2noaRyddRgCRYTheeB53 Auc9CL00DqsFjZ5cjjbyMU1mOPvw150Ujx0sahf3MixPeiPEs3D7o2/3KoFsQyvLpM wxJN3avD+1xIlTg80vrcYo+KNRxiboPTXpEDnpqaFpAE8GrOQpUcKQDZH2jAhEFo+0 cNE9JNI9d0QZ4VKq6ZdwNlOXwNTuzbjg++gR9mDALe89ApPYU2Li1wy/J2cuvfmpmr ZCvx5yKik85Bw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3BF31688F0; Sun, 7 Dec 2025 19:33:49 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:17 -0700 Message-ID: <20251208023229.3929910-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CNI5RH6YRO6IICCBZUMZPDADVWBADAJ7 X-Message-ID-Hash: CNI5RH6YRO6IICCBZUMZPDADVWBADAJ7 X-MailFrom: sjg@u-boot.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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/19] tkey: Correct handling of the USS List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The position of the USS in the load-app header is incorrect. Fix it in the driver and the emulator, so it matches the tkey-sign program. Co-developed-by: Claude Signed-off-by: Simon Glass --- drivers/misc/tkey-uclass.c | 16 ++++++++-------- drivers/misc/tkey_emul.c | 9 +++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/misc/tkey-uclass.c b/drivers/misc/tkey-uclass.c index fad5ffd6534..c0c3bd5a6d3 100644 --- a/drivers/misc/tkey-uclass.c +++ b/drivers/misc/tkey-uclass.c @@ -470,12 +470,12 @@ static int tkey_load_app_header(struct udevice *dev, int app_size, return ret; } - /* USS present flag */ - cmd_frame.data[5] = 1; - /* Copy USS hash (32 bytes) */ - memcpy(&cmd_frame.data[6], uss_hash, 32); + log_debug("USS hash: %*ph\n", 32, uss_hash); + + /* Copy USS hash (32 bytes) starting at data[5] */ + memcpy(&cmd_frame.data[5], uss_hash, 32); /* Pad remaining bytes with zeros */ - memset(&cmd_frame.data[38], '\0', 128 - 38); + memset(&cmd_frame.data[37], '\0', 128 - 37); log_debug("USS hash included in app header\n"); } else { @@ -657,9 +657,9 @@ int tkey_get_pubkey(struct udevice *dev, void *pubkey) return -EIO; } - /* Extract public key (32 bytes) from response */ - if (ret >= TKEY_FRAME_HEADER_SIZE + TKEY_PUBKEY_SIZE) { - memcpy(pubkey, rsp_frame.data, TKEY_PUBKEY_SIZE); + /* Extract public key (32 bytes) from response, skip response code byte */ + if (ret >= TKEY_FRAME_HEADER_SIZE + 1 + TKEY_PUBKEY_SIZE) { + memcpy(pubkey, rsp_frame.data + 1, TKEY_PUBKEY_SIZE); log_debug("Public key retrieved successfully\n"); return 0; } diff --git a/drivers/misc/tkey_emul.c b/drivers/misc/tkey_emul.c index 403e6e819b9..f67e28bd071 100644 --- a/drivers/misc/tkey_emul.c +++ b/drivers/misc/tkey_emul.c @@ -182,8 +182,13 @@ static int handle_firmware_cmd(struct udevice *dev, u8 cmd, const u8 *data) static int handle_app_get_pubkey(struct tkey_emul_priv *priv) { - memcpy(priv->resp, priv->pubkey, 32); - priv->resp_len = 32; + /* + * Response format: 1-byte response code (0x02) + 32-byte pubkey + * tkey_get_pubkey() expects this format and skips the response code + */ + priv->resp[0] = 0x02; /* Response code for GET_PUBKEY */ + memcpy(priv->resp + 1, priv->pubkey, 32); + priv->resp_len = 33; log_debug("GET_PUBKEY\n"); return 0; From patchwork Mon Dec 8 02:32:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 848 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161240; bh=QhX9+GvLZ4KEYhd2lx4baCvMcN8N+ada6axkIcPPqCQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VGGOji14NjVLQwpz8kuoz5xL5iS/wGpCOouBgdpO13tjer0yfbnJ5kZIUGp1NnSKR DAhwPFN28bevB+dL2tGJcGtcsLQubFZviuslyaAy+T826NXykH4EysuzowZgKBvhfg irSz11CAAJlfYqBBmT70VUyfw2enSTtueQowqMu0scwrRnmkBRowcx9B87GMSLFe4w N4kNITWYXyakNwc05oEO+CxWvKG4NMP4eWsNNG/9xxBJlKB7oeR/k/XgGBfYmonEGR RG4qJuCCDETkEFeg+qz2WOUs7eFcaLIHVXgQeQhb0afeKL0WJuiGuvg26BSxF/CgmX 5OTf9EuTIlaEg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DC32F689D0 for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) 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 SxqCQDymyubR for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161240; bh=QhX9+GvLZ4KEYhd2lx4baCvMcN8N+ada6axkIcPPqCQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VGGOji14NjVLQwpz8kuoz5xL5iS/wGpCOouBgdpO13tjer0yfbnJ5kZIUGp1NnSKR DAhwPFN28bevB+dL2tGJcGtcsLQubFZviuslyaAy+T826NXykH4EysuzowZgKBvhfg irSz11CAAJlfYqBBmT70VUyfw2enSTtueQowqMu0scwrRnmkBRowcx9B87GMSLFe4w N4kNITWYXyakNwc05oEO+CxWvKG4NMP4eWsNNG/9xxBJlKB7oeR/k/XgGBfYmonEGR RG4qJuCCDETkEFeg+qz2WOUs7eFcaLIHVXgQeQhb0afeKL0WJuiGuvg26BSxF/CgmX 5OTf9EuTIlaEg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC56768900 for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161238; bh=BKkHAzXt1oSfNL0lXugh7DSntmcI/6cb6gIfIGP9lLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwsiyD9GVKiyf7D82Xa85zDjkHwK2l4c42EVDBDKwEnM0fpxwe8tSzUF/t0J9lQdF eyJYdilsTR0EVu/CLZXq1SjgkwbirXTrOTlXhAaM6EFGr5eYqHQEPhLZjznVE36/FJ GnAi+iQheCGgfaVFyGUNAU7LERzoe5+Gj9RWUiv3IOmffnaZEKvv/YMYDDGNHDAPBC f7w0Yy+Ryk5t5x1k9AgcerGJ9gjXvk+aGEUbIsRE8UFQD9Cu8mCLw75XhuR/7jPemK S+mUJ6msu4YyeAaO+vsOC6lno2mv5oGgMTb7U9dLasagGcVL7DI9P5eIIPepH4n7OK 8YFq2e/BJ+tbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D03EA68930; Sun, 7 Dec 2025 19:33:58 -0700 (MST) 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 10026) with ESMTP id b51XRgzK67Pl; Sun, 7 Dec 2025 19:33:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161234; bh=Xvv0cPGIqp+iiq44jhlhFJpnRZ5/TaqCaAgLL6yM/68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkJv1Rh7AbzYfuJdJCOIkiQPa7vUdFvpFTsrd5qFfkCPv4zmWgqWGjo92V75L96rp shqVdb9fK360bdmij8O1TKYjifc0wQhTEZiR9qOqsB2OlIItVCCoyRyExsq6EBXtFf CdxNMMADcN2bV0jARl3f6nSbyEhn8KuQLwIsWOMxZJKRY62Vdobs+BsF/kpfDsUHHN JYdqkflQSPJ0vrycI4WEPC4E1JRNqS8+XpOKYgln8NHhDYsY7thOwahwaAa4XwafIg EpCFbWT4JCkrMUSjKNHPOPd4PJ2Nh44PgYk601eZ0HYfZVa+x1A86OGniNUADSp/7L /hktZ3wxzFhHw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D5A3568900; Sun, 7 Dec 2025 19:33:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:18 -0700 Message-ID: <20251208023229.3929910-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WA5NVTH2COMTS7HA2VOX37MT4TCYWFKM X-Message-ID-Hash: WA5NVTH2COMTS7HA2VOX37MT4TCYWFKM X-MailFrom: sjg@u-boot.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 15/19] tkey: Allow using the selected TKey from luks List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Export the function which sets the current TKey so that the luks command can work with 'tkey connect'. Signed-off-by: Simon Glass --- cmd/tkey.c | 2 +- include/tkey.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/tkey.c b/cmd/tkey.c index 3a31712990a..a1a382bac0c 100644 --- a/cmd/tkey.c +++ b/cmd/tkey.c @@ -22,7 +22,7 @@ /* Static device pointer set by tkey connect command */ static struct udevice *tkey_dev; -static struct udevice *tkey_get_device(void) +struct udevice *tkey_get_device(void) { struct udevice *dev; int ret; diff --git a/include/tkey.h b/include/tkey.h index e610d91140c..418b6aca7d2 100644 --- a/include/tkey.h +++ b/include/tkey.h @@ -327,4 +327,11 @@ int tkey_emul_set_app_mode_for_test(struct udevice *dev, bool app_mode); */ int tkey_emul_set_connected_for_test(struct udevice *dev, bool connected); +/** + * tkey_get_device() - Get the current TKey device + * + * Return: Pointer to TKey device, or NULL if not found + */ +struct udevice *tkey_get_device(void); + #endif /* _TKEY_UCLASS_H */ From patchwork Mon Dec 8 02:32:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 849 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161244; bh=rh/fYoA1w+is03j2FOnggPqmYqyhzTtIC5hEHDKASgE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bp1IE5h95BEMILzh9F9RoaQFlCC/JBwTXwmBXxaQlKTzM+gLFWtV4TZOPiJ9U5+cx jl2gt5gotWhWyNK3NGfKIMzpcQUj7tLydh5W1oaiVccKgw3ZvE1ke3Mgw7aNkN9bgV xDP0X90oTqk/VfM4KXxv7/7tCaJ644VJauViT89CM0L/faQ9HBttG4FZRv6Sqb9NtQ Msn3L1tCyZ2qMejyexvd66Czsb3YbJsaNFRxC/YbUiT/2eMn26+qGM9sEvO2O4LYdz qjNTQawfLMu4L7NgUCOD10RBJfR9vhJe0So8rni1Od0w0hbHDHLp828YDvvrrXYxuq d5YtesYq+5oZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54737689D0 for ; Sun, 7 Dec 2025 19:34:04 -0700 (MST) 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 PSJ_wbA-a8PI for ; Sun, 7 Dec 2025 19:34:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161244; bh=rh/fYoA1w+is03j2FOnggPqmYqyhzTtIC5hEHDKASgE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bp1IE5h95BEMILzh9F9RoaQFlCC/JBwTXwmBXxaQlKTzM+gLFWtV4TZOPiJ9U5+cx jl2gt5gotWhWyNK3NGfKIMzpcQUj7tLydh5W1oaiVccKgw3ZvE1ke3Mgw7aNkN9bgV xDP0X90oTqk/VfM4KXxv7/7tCaJ644VJauViT89CM0L/faQ9HBttG4FZRv6Sqb9NtQ Msn3L1tCyZ2qMejyexvd66Czsb3YbJsaNFRxC/YbUiT/2eMn26+qGM9sEvO2O4LYdz qjNTQawfLMu4L7NgUCOD10RBJfR9vhJe0So8rni1Od0w0hbHDHLp828YDvvrrXYxuq d5YtesYq+5oZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 43B1F68900 for ; Sun, 7 Dec 2025 19:34:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161243; bh=U7e5qEjdPElL3FhzaNJ1rMUEVUBHNThGob/QMn/9hMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rs7jtgUoOb4Vv5o4zoEpqqiZdr7M4NugXD4EE6UWnEH+eDHodVpxqoxIetzvL1ptT 4p+o80uUBP58osxxUAfEmO7nLxFDi3BGSSUYffjuq2hiLhPLdf3QHNg8oUWNftQ+NB fGjCk5fCulRbczCpz1A9E6sMj07KfYef3CQ+651VM+mqObhi/xJ4aPR4Tim5Ck66nD YDNx+rFLIe4H0zPUWV6ZbURCSJ7XK8yP9CLdwCPqTzSjZXVuaswycj942SbcY2JPJ/ jUvSP8RSsz4kPtJUOmDfArF9bsoXCO7s8MxLPkYhv+G4CiTouszKVZQcI0dfh2hGGI t3R2bYiGzno/g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 453E4689D0; Sun, 7 Dec 2025 19:34:03 -0700 (MST) 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 10026) with ESMTP id rDZfaRfv2nm6; Sun, 7 Dec 2025 19:34:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161238; bh=1sFld6fiW3imuDnpL1Pcb2Cg7kVAdbkx1jeUgGwGT3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CECvU5mbvWQxchbPeZZEXuO+AHbm7XuSzlfgsewuvykNexfk8N3KB8j8xe32zjqwk JoHWiCQhidXmf+HDKftC5E6vhw5u2KGs4BU/kkfnT4Y3tRqMS86PUA/sitIP3LCO7a gtY3jozpLlp1d5HNB8CEjblY2AlymQzaGImS+pvLczG0jpZFJYUyZMq14tLly6OYuT fYwkOuEHgnQmdejqyYrgj1mHrKRDbYydqGNlZpyHEwhGaWw3ATtfUrxHEqACRPanbg htLOCRix2d5E/SkI3X9IV3n3WE+DrOmVorIUyQklsR5PvRv4OCFOJcjXEPRUXYWbDH DbqGonsaJYxIQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5D4B66883E; Sun, 7 Dec 2025 19:33:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:19 -0700 Message-ID: <20251208023229.3929910-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VP5LUC2CXSJFMODMK7SDPU2TDXONPJ6J X-Message-ID-Hash: VP5LUC2CXSJFMODMK7SDPU2TDXONPJ6J X-MailFrom: sjg@u-boot.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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/19] luks: Add -p flag for pre-derived master key List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a -p flag to the luks unlock command that allows passing a hex-encoded pre-derived master key, skipping the KDF step. This is useful when the master key has been derived externally, such as from a hardware security module. Adjust the normal flow (without -p) to use a key derived on the TKey output. While that works OK with LUKS1, the 32-byte value is not long enough to work with LUKS2. Update the documentation to describe the new flag. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/luks.c | 42 +++++++++++++++++++++++++++++++----------- doc/usage/cmd/luks.rst | 18 ++++++++++++++++-- 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/cmd/luks.c b/cmd/luks.c index ec4d400b44e..31805ffa5ad 100644 --- a/cmd/luks.c +++ b/cmd/luks.c @@ -85,10 +85,10 @@ static int unlock_with_tkey(struct blk_desc *dev_desc, printf("Using TKey for disk encryption key\n"); /* Find TKey device */ - ret = uclass_first_device_err(UCLASS_TKEY, &tkey_dev); - if (ret) { - printf("Failed to find TKey device (err %dE)\n", ret); - return ret; + tkey_dev = tkey_get_device(); + if (!tkey_dev) { + printf("Failed to find TKey device\n"); + return -ENOENT; } /* Derive disk key using TKey with passphrase as USS */ @@ -113,7 +113,7 @@ static int unlock_with_tkey(struct blk_desc *dev_desc, TKEY_DISK_KEY_SIZE, false); ret = luks_unlock(dev_desc->bdev, info, tkey_disk_key, - TKEY_DISK_KEY_SIZE, true, master_key, key_size); + TKEY_DISK_KEY_SIZE, false, master_key, key_size); /* Wipe TKey disk key */ memset(tkey_disk_key, '\0', sizeof(tkey_disk_key)); @@ -129,14 +129,21 @@ static int do_luks_unlock(struct cmd_tbl *cmdtp, int flag, int argc, struct udevice *blkmap_dev; const char *passphrase = NULL; bool use_tkey = false; + bool pre_derived = false; int part, ret, version; u8 master_key[128]; char label[64]; u32 key_size; - /* Check for -t flag */ - if (!strcmp(argv[1], "-t")) { - use_tkey = true; + /* Check for flags */ + while (argc > 1 && argv[1][0] == '-') { + if (!strcmp(argv[1], "-t")) { + use_tkey = true; + } else if (!strcmp(argv[1], "-p")) { + pre_derived = true; + } else { + return CMD_RET_USAGE; + } argc--; argv++; } @@ -165,9 +172,21 @@ static int do_luks_unlock(struct cmd_tbl *cmdtp, int flag, int argc, if (use_tkey) { ret = unlock_with_tkey(dev_desc, &info, passphrase, master_key, &key_size); + } else if (pre_derived) { + /* Pre-derived key: passphrase is hex-encoded master key */ + u8 key_buf[64]; + size_t key_len = strlen(passphrase) / 2; + + if (key_len > sizeof(key_buf) || hex2bin(key_buf, passphrase, + key_len)) { + printf("Invalid hex key\n"); + return CMD_RET_FAILURE; + } + ret = luks_unlock(dev_desc->bdev, &info, key_buf, key_len, + true, master_key, &key_size); } else { /* Unlock with passphrase */ - ret = luks_unlock(dev_desc->bdev, &info,(const u8 *)passphrase, + ret = luks_unlock(dev_desc->bdev, &info, (const u8 *)passphrase, strlen(passphrase), false, master_key, &key_size); } @@ -202,8 +221,9 @@ cleanup: static char luks_help_text[] = "detect - detect if partition is LUKS encrypted\n" "luks info - show LUKS header information\n" - "luks unlock [-t] - unlock LUKS partition\n" - " -t: Use TKey hardware security token with passphrase as USS\n"; + "luks unlock [-t] [-p] - unlock LUKS partition\n" + " -t: Use TKey hardware security token with passphrase as USS\n" + " -p: Treat passphrase as hex-encoded pre-derived master key (skip KDF)\n"; U_BOOT_CMD_WITH_SUBCMDS(luks, "LUKS (Linux Unified Key Setup) operations", luks_help_text, diff --git a/doc/usage/cmd/luks.rst b/doc/usage/cmd/luks.rst index ccf915f5844..1a9cba875ce 100644 --- a/doc/usage/cmd/luks.rst +++ b/doc/usage/cmd/luks.rst @@ -13,7 +13,7 @@ Synopsis luks detect luks info - luks unlock [-t] + luks unlock [-t] [-p] Description ----------- @@ -97,7 +97,8 @@ This command: - **Without -t**: Uses PBKDF2 or Argon2id with the provided passphrase - **With -t**: Uses TKey hardware token with passphrase as USS (User-Supplied - Secret) to derive a disk encryption key + Secret) to derive a disk encryption key. You can use 'tkey connect' to + select which TKey to use, otherwise it uses the first one it finds. 4. Attempts to unlock each active key slot 5. Verifies the master key against the stored digest @@ -128,6 +129,12 @@ be used to access files on the unlocked partition. passphrase is used as the USS (User-Supplied Secret) to derive a disk encryption key from the TKey's public key. +-p + Optional flag to treat the passphrase as a hex-encoded pre-derived master + key, skipping the KDF (Key Derivation Function) step. This is useful when + the master key has already been derived externally, such as from a hardware + security module or other key management system. + interface The storage interface type (e.g., mmc, usb, scsi) @@ -250,6 +257,13 @@ Unlock using TKey hardware token:: Successfully unlocked with key slot 0! Unlocked LUKS partition as blkmap device 'luks-mmc-0:2' +Unlock using a pre-derived master key (hex-encoded):: + + => luks unlock -p mmc 0:2 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef + Unlocking LUKS2 partition... + Successfully unlocked with key slot 0! + Unlocked LUKS partition as blkmap device 'luks-mmc-0:2' + Configuration ------------- From patchwork Mon Dec 8 02:32:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 850 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161249; bh=gJn2HtMCl1sWeTHdqMCKp0p1hodFYWZs7t7V4BS+meQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JdR8kNGDVgLv4mPDyQGa2uyuPpTaxZXvjhQXP/GC2vIYA33ygZeXr+xZkOPoTDnij skrn8ICdzZ60KJ1kx5jORW0KeEk9B98gUBvdCiWK3DuTVb4OqPSSzxuoBCsTkVwWs0 JNqLZsZDpVa/sloinZT6Zyj8cCCQLLVh6b+wqnG1Q8SvMe84d7einbq4l8lNfQkHp7 9pgGHShSupjco6XEBiPoaCCC+xZhul4b8TC+LvnpHTeZnTJ92aCA29uaWcSwuJO70g RDi85ZNXagmrEteisYxBTe6Oy90H1dOdB/wwSJ3kjlzhaEsSWguu2EBtoFOFBTMNL0 8ATOdqITnrdgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2C27A689CB for ; Sun, 7 Dec 2025 19:34:09 -0700 (MST) 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 xUIBTgXDANHZ for ; Sun, 7 Dec 2025 19:34:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161249; bh=gJn2HtMCl1sWeTHdqMCKp0p1hodFYWZs7t7V4BS+meQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=JdR8kNGDVgLv4mPDyQGa2uyuPpTaxZXvjhQXP/GC2vIYA33ygZeXr+xZkOPoTDnij skrn8ICdzZ60KJ1kx5jORW0KeEk9B98gUBvdCiWK3DuTVb4OqPSSzxuoBCsTkVwWs0 JNqLZsZDpVa/sloinZT6Zyj8cCCQLLVh6b+wqnG1Q8SvMe84d7einbq4l8lNfQkHp7 9pgGHShSupjco6XEBiPoaCCC+xZhul4b8TC+LvnpHTeZnTJ92aCA29uaWcSwuJO70g RDi85ZNXagmrEteisYxBTe6Oy90H1dOdB/wwSJ3kjlzhaEsSWguu2EBtoFOFBTMNL0 8ATOdqITnrdgg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18C03689BD for ; Sun, 7 Dec 2025 19:34:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161247; bh=Daf1vv6/Jf+ZpFbkuXp/VHxuzsaJCmx6sbR9Yb2yy2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xloxc0i4f2JhJvqGbJjSI3YidWeNBGkjls1Ye+F3iD1DljSmIsED0OQIl8xS7ffPt T1KyEkS/k9VRPMC63pVDIpkAKuSuD26C3ewWVppVuiO1jRL4lX0VmaovilWE5OT6qs 6ZNGI04qrlqYDAjpOmIMAgRQbZIZwNMrCedF7t1t6R8st8Ao4COsTFBornkfw0KYeV vnRRwZyT0P3fWu56W4LLo0HpFrun49ORyfPavMlJiLkvIOMn7TNE+qXxO/SkXk1aK8 vTZokjmJWPj1C9AvZgpmb8FZbUgd2HORHRbk7U2F8UbxpVMnlxJXmbdbGDX4n1HrWi 18DRKiR11mn7Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3B03B6883E; Sun, 7 Dec 2025 19:34:07 -0700 (MST) 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 10026) with ESMTP id 5A6iF6LfAoPB; Sun, 7 Dec 2025 19:34:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161243; bh=78WkXsif2Sos6vQZ7B61LztFOJspAN4EHOVKRZrTlQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CZx61fgrSlfrip25dElLRl3VQhIfHBMZzP35qo7lOu9+cPAVvgv+VTgdQ1ej+hCkN KkEDRQEPJt0rf0KDXC7RNM8M83dR4uCLS7bKi28rpEcnBCsyGIONjP+1+zarunJNEA 6mVIl1Gx63RN/iMQqNy8xRc/5yk4VK7O3deN+I8ltdFDIvB9iJLuayLRtP26J/vs25 8NJZQ08jfW4UyEfj1WkPOtTZRT+dXZYMf58mh/xYf4dORmT7y0yOlcgXLNT/OpxqEz wV2W+r42LNoZDfyX0orONsaRJkp+WT7MAExcSAacRRBylhtKPTShEpUKOT5onRaGd3 ouvv8sepSQpLA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 02524688F0; Sun, 7 Dec 2025 19:34:02 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:20 -0700 Message-ID: <20251208023229.3929910-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6N2ZL6PMUHKJIGTHBB43MMPOVRTBSRDG X-Message-ID-Hash: 6N2ZL6PMUHKJIGTHBB43MMPOVRTBSRDG X-MailFrom: sjg@u-boot.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 17/19] bootctl: Allow unlocking LUKS2 partitions List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Switch away from a pre-derived key so that LUKS2 partitions can be unlocked. Update the ulock message to be more generic. Signed-off-by: Simon Glass --- boot/bootctl/logic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/bootctl/logic.c b/boot/bootctl/logic.c index 96cc270ae2c..2ed106628e7 100644 --- a/boot/bootctl/logic.c +++ b/boot/bootctl/logic.c @@ -334,9 +334,9 @@ static int perform_tkey_unlock(struct udevice *dev, struct osinfo *os, int seq, * processed by PBKDF2/Argon2 just like a text passphrase would be. * This matches how cryptsetup --key-file works. */ - log_info("Using LUKS1 unlock with binary passphrase\n"); + log_info("Using LUKS unlock with binary passphrase\n"); ret = luks_unlock(os->bflow.blk, &pinfo, priv->tkey_disk_key, - TKEY_DISK_KEY_SIZE, true, master_key, key_sizep); + TKEY_DISK_KEY_SIZE, false, master_key, key_sizep); if (ret) return log_msg_ret("htu", ret); From patchwork Mon Dec 8 02:32:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 851 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161253; bh=teGnK32x409CIbOpEWFp6f2ZpjmBQ9/iQ188usw15hk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=aH8n3BtNCh7Ljd0dyGMZmDk58Juy+uVGYzlh/zfe3crksA0SXRlaauMd4jQn7I+AJ NPaOOJPBnmDjSH8bIvXvjxhJBEN0hGKEw4AmbsFD1hwJQ+zFazpF2GMGBWnJOAJ6p+ FDAfLb7L9aQe5gOAzB4I65pTkvvsuNNQsW2Ge/jF/AzsuPydZO1ozlDvViSpzuOAFf OqECws8uI08FZ9KiPVUbzY2RDm8BwkRnRYmvlyzdwb6c9gSPzpZl7H5xJ9iOFWa74C dwkLk7GhdU0UoXXOgz6DkoPz5qytodllqjIE7z3THZFsn7JAAIq3FSFgZE7odmaXRw XPD3R5YXB18Pg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B7F51689D7 for ; Sun, 7 Dec 2025 19:34:13 -0700 (MST) 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 jvt5tPfnHHsi for ; Sun, 7 Dec 2025 19:34:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161253; bh=teGnK32x409CIbOpEWFp6f2ZpjmBQ9/iQ188usw15hk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=aH8n3BtNCh7Ljd0dyGMZmDk58Juy+uVGYzlh/zfe3crksA0SXRlaauMd4jQn7I+AJ NPaOOJPBnmDjSH8bIvXvjxhJBEN0hGKEw4AmbsFD1hwJQ+zFazpF2GMGBWnJOAJ6p+ FDAfLb7L9aQe5gOAzB4I65pTkvvsuNNQsW2Ge/jF/AzsuPydZO1ozlDvViSpzuOAFf OqECws8uI08FZ9KiPVUbzY2RDm8BwkRnRYmvlyzdwb6c9gSPzpZl7H5xJ9iOFWa74C dwkLk7GhdU0UoXXOgz6DkoPz5qytodllqjIE7z3THZFsn7JAAIq3FSFgZE7odmaXRw XPD3R5YXB18Pg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A60D8688FC for ; Sun, 7 Dec 2025 19:34:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161251; bh=dAz/hPoBHTy6dfi84cYxcx0P1ZDxbZZd2tbiHVhtRww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jlWX3C/N8UnmON5tW97bPvBoGd5XmnWLfuvZ961d5AD1fl61h0dhhUTNj8h10AIgr 6yQ+3h4rL8frzelzVvuxWDOGZNRe5YakN0FjXz7LoEdWWiEz30DnvoDdorAUre1RKb VPfQjuGfz7jFwwCEVp+njB6/ILhPW3x8x4Wx9DSVM7Ekgd3IkcN+MR0ZHdqzq0BpP1 6XDYPjeZyELEyFp3GYI/wRvDwSP+6ajRpq2A3cuukG5XcckHeTxgv4jFP1HEXIYe08 bOHPoj8UAhEEN1WsRp/m+2IZ2vbF1BAV9mqAg8Rjajgq5TucCs8h2pe6wwcoBeGbfw JrTjwOYq2ZVNQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C94C6688FC; Sun, 7 Dec 2025 19:34:11 -0700 (MST) 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 10026) with ESMTP id dJWeJVu8vBAa; Sun, 7 Dec 2025 19:34:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161247; bh=RsFBgOQJO4hklJ1CUSw1ypzZv36KEA1iLHI/sSz2Rv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSD20aRfjy1XYjeRrFU4zSfbkSUESLUfey1Vnx8Uh0kP9iJmM/rd2vs5lIUrQkc/1 bTFaU06tl6bbF8rN0Yj5uazIqmFJDyI+glo33aKfpzkuhtq6ITlot/g+1D0V5OR8Om uDtkVd29p4Fikx1eo+TNlqBBO4w3PasqAjQaFrFHF+UQSWSwImu7xq/1fci7PUSCY4 Pk9BLwGBjaCJCLsrMaZSzF7CPIYBYt7Oe1flHy6iFYXfki5U+SEuh+fdwGXzJNQhEv tcLx8bbaB8IA6OwBHhipIG0mnQb7uV33fau33DxQ9On29dryVxTo6CvI/nZCGW2Qgm T9Gz1XKSDah3w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7E960688F0; Sun, 7 Dec 2025 19:34:07 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:21 -0700 Message-ID: <20251208023229.3929910-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XBM233D3KQO46JPOAWKBEVCM6YT5DDHU X-Message-ID-Hash: XBM233D3KQO46JPOAWKBEVCM6YT5DDHU X-MailFrom: sjg@u-boot.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 18/19] bootctl: Add a TKey for testing List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Update the bootctl settings to use a TKey with sandbox. Signed-off-by: Simon Glass --- include/bootctl.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/bootctl.dtsi b/include/bootctl.dtsi index 4070fa32c5f..36e2be04be9 100644 --- a/include/bootctl.dtsi +++ b/include/bootctl.dtsi @@ -31,6 +31,11 @@ measure; #endif + /* use TKey for unlocking encrypted volumes */ +#ifdef CONFIG_SANDBOX + tkey; +#endif + /* restrict labels to boot (separated by space) */ #ifdef CONFIG_QEMU labels = "virtio"; From patchwork Mon Dec 8 02:32:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 852 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161258; bh=con5KE2j8IgUUKrKxtLwpLLu/QxFPn/4kDSwJWlcnyc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bFHUiqfegabtniX+TXmZHsCiyPvKyPCGKzDlI0vTNMeu9xz4m+hbnWrs9JdHfsEXm 1Owx5uyxwPwYXUosCBXFe8NDJohUAiVxrMXLFv1+QSc5Qgo4vs65m2Y4orbjvPSFEN /cIpEOU0RDUO/akWEXA+jGhEzsINvnR1d/l9Sek8wfzeORrSqcDSHpSCuaJ56gorgz YtCVOg8bl+sq9BQfOXoJfTx2pRiyHoNBqzS2ain9mvdtJylWRo6yNzcY6L99f741ob E6duz1WR6zASfyR6cDR4Ll2a2CI2zdC6rsSrea0hfJfv2yKbWO717LPoBKytVtfSRk HKKo8q/3iSjAQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 371B4689B4 for ; Sun, 7 Dec 2025 19:34:18 -0700 (MST) 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 qDUbMeYJ4xXg for ; Sun, 7 Dec 2025 19:34:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161258; bh=con5KE2j8IgUUKrKxtLwpLLu/QxFPn/4kDSwJWlcnyc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bFHUiqfegabtniX+TXmZHsCiyPvKyPCGKzDlI0vTNMeu9xz4m+hbnWrs9JdHfsEXm 1Owx5uyxwPwYXUosCBXFe8NDJohUAiVxrMXLFv1+QSc5Qgo4vs65m2Y4orbjvPSFEN /cIpEOU0RDUO/akWEXA+jGhEzsINvnR1d/l9Sek8wfzeORrSqcDSHpSCuaJ56gorgz YtCVOg8bl+sq9BQfOXoJfTx2pRiyHoNBqzS2ain9mvdtJylWRo6yNzcY6L99f741ob E6duz1WR6zASfyR6cDR4Ll2a2CI2zdC6rsSrea0hfJfv2yKbWO717LPoBKytVtfSRk HKKo8q/3iSjAQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 250D6688F0 for ; Sun, 7 Dec 2025 19:34:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161256; bh=IQZxk16tX3/QFb7WVWy5uorRySmcyoYZWTigcIVPTz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RN/O8NzyOx8oemOlC1EUSiXScFKEN482tfGhnS1RQBf/2n9z4fb4xsUTEPtakvaDR d83lQsxYj+td5opoAOC6OHBRt+E+/iGalL80rg2OCe0NaYNnLQnc0EqDbFtRa7p+X9 ovVIFrOAjggYYOGNur2ncGsRR4J7l5LhUgBw4fuYc6jrfHSwsKBQlvZaW/wOKH0Ogs ln7NxA01/D0p1UDoTXJFIa+2OJ2oY/sadYIz1Ho40vwLOGZnRia7poLeH6v7Mjcrod TMmm6G3gtJYi0dP/7r10XaQk0RS3dllsWE6RjmFvPlAJcJ5hKp5oCm7x/q/JKeh0zn mQsq+U2UCo2VQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56D846883E; Sun, 7 Dec 2025 19:34:16 -0700 (MST) 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 10026) with ESMTP id QR62nuSeoh75; Sun, 7 Dec 2025 19:34:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161252; bh=+nw8p4lABHZbzOrzMvjC63qNkN4wyb3i3MFCHC0pnqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WtTmoN3ZH9hq2ksu5es1js9xwTKNRK04Zk1SGuVBP8DXpmK1aOgaBI0buz0ekTE0m wmO3f6+81AP6x6C4skU45KKGPtRFQeAkuCnj2VHVuHTb7KQrkM8zuZ5oSQT1FBtLD9 5rj6C5Pf76puu6fz+auTaM19q+oPtHOof0h8mNTBoj8d3v3EqzgKQAuPQ+zuliezZm 1qqLPk/044znGqYPG5GeCNMZSSvCodMJjUvNvOTto6KJumIOci3Aubpou/um/3ZHCX PUu0/fCcJD0pR0U+VohXKyiSeMuQYlVMerrNHtdMgRJ3A1zPnbzk1jtoSuZNBocrkw +3Q73qD+b5w/w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 18FD3688F0; Sun, 7 Dec 2025 19:34:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:22 -0700 Message-ID: <20251208023229.3929910-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 34HHC4Y2DVKPJWAOLE6FACAQPUAFFKNF X-Message-ID-Hash: 34HHC4Y2DVKPJWAOLE6FACAQPUAFFKNF X-MailFrom: sjg@u-boot.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 19/19] bootctl: Enable the tests List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Enable the bootctl tests (only for the sandbox board) so we can keep this functionality working. Signed-off-by: Simon Glass --- configs/sandbox_defconfig | 1 + test/Kconfig | 1 - test/boot/Makefile | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 55f8ddcc952..44185ccb7eb 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -371,5 +371,6 @@ CONFIG_ARGON2=y CONFIG_BACKTRACE=y CONFIG_TEST_FDTDEC=y CONFIG_UNIT_TEST=y +CONFIG_UT_BOOTCTL=y CONFIG_UT_TIME=y CONFIG_UT_DM=y diff --git a/test/Kconfig b/test/Kconfig index 27847250132..96723940bac 100644 --- a/test/Kconfig +++ b/test/Kconfig @@ -77,7 +77,6 @@ endif # UT_LIB config UT_BOOTCTL bool "Unit tests for boot schema" depends on BOOTSTD && SANDBOX - default y config UT_BOOTSTD bool "Unit tests for standard boot" diff --git a/test/boot/Makefile b/test/boot/Makefile index 70e15bf63fa..21f533cdc4c 100644 --- a/test/boot/Makefile +++ b/test/boot/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_BLK_LUKS) += luks.o obj-$(CONFIG_EXPO) += expo.o expo_common.o obj-$(CONFIG_CEDIT) += cedit.o expo_common.o +obj-$(CONFIG_UT_BOOTCTL) += bootctl/ endif ifdef CONFIG_SANDBOX