From patchwork Tue Mar 24 22:19:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2054 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=1774390794; bh=vbbtr6f7JV3eFOwh+jhIIr/jKncZJi792W2qpzQTlok=; 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=BHV0FWpGLk+di+qzDooDx6S4P/uNw4ySyEgO38uXq6XQZNVSFrOB/pnwyMIfTEZTB PlKVIpE8q/mt1cxAp5NbcWosYVqF0oss7i9TjXmwaT3/Phz+tg/PeqKh0wybGOaeDb bLK888i/v1VUpPOETyBQ0Tj5T0BUNkD4YusAMHDjBJtoxCTRhP3Ldez+QdYGAQRZKC KNKtZjxWNBwa73xSBTUie6ZYJjacgghZXqdwXUn74cteSYnS59EHAGjIXZhkcwagW9 cikM8pBav5iSbqQtTjHvtZrHxPE3JikdaG/R6u4A8mH8g0cJE/pIiXBWkDJqGnrc5V 3u1Jxch8U9mOA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 73F396A24A for ; Tue, 24 Mar 2026 16:19:54 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id l3ZNupDeD2kk for ; Tue, 24 Mar 2026 16:19:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390791; bh=vbbtr6f7JV3eFOwh+jhIIr/jKncZJi792W2qpzQTlok=; 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=sJvsknOsyz6PM/o5JjkRP5XnXSiji3jAotovwjNi6PtvLwfjSftMWwfHMYCou64xT NYGsvUjWImg5Ud9jYv2dSRU0i3tmIIJqaTd8aRdSYqSPCWTrdKA+g9gkafdyJ4m35a 8JayKyTwjPHGIjZ1NPcEsERW2+wFmFfvZItAhzuII+TZfMeIGlhsLe5GT8Tzb7U0P7 PVVH/Nw1YO+oP15Ef3IZ80C0h2l36T1qsWKaHNNjVpr9Sl10rhGcfksRh3ZY9PvZp9 BuUm/ZQ7aDdubcazQaxKANUDd2vudayzLWMEFv4sd6LeU+e4FMSlJVca7AUIMSMv5H FWmUA5RwLVEfA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 910F16A241 for ; Tue, 24 Mar 2026 16:19:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390787; bh=GCfBMBcjjhffW9PfHw/Sx1psrzcCBAi1jDQdTsS6bzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SEUyD1WakSQVM1O9lJ0UUeZKyylRNau25BRNruZBlUrq8FJaFB2v5ujRpg+G6eNwZ eAIRjloN57ZDxlpqhMvfjQEIVgZyv7TKuOy5MQALLb/8XVfGQNsFqiKAGDI4yEfaRL JZyxDVaGiKKzsAs2f0/9Ya8dn+hF1G0MvdPOBHKonit5ztZHr/eDYESzbyZNwh9mcb aHoMQC/8xQMDiAo9+3m9oW8C0848yNmEPR1p4gV9DZOBoVkqA6Ys6TXSFCY4rDvDLJ BqyGt/L3QyIfVGBqZYRG5hFre61FJHGxmldWQY+6BkOXS9989ZjB31SVPkTk3jt/4e JRJMYsKUcL40w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 526A66A1FD; Tue, 24 Mar 2026 16:19:47 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id xpz6AJL3p5SY; Tue, 24 Mar 2026 16:19:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390786; bh=dcMiZSoqYWvQGTxkuLxewZPI6s0+TnTqb2fOgsrpBOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etCYP2yuRXduKQIJXnxdk6ijfn91TqQ5cRnwEIVErf5bNAPamFtv2ynVa24XtVZSU jTBC4BZ6nx+vKO7D2jRbmUwkzNu1aKufo4YXhlgw1WRsYIQdhNEe89y0aT6Urq2nX2 3gClmasvEu/X1jE2UkIO+gaNNl6LTwnabglK4bT2dcJKqTyYbesXyvAOyiI8XRuLJG h/SJUZiveX7Lu7dC6B7hupgxOebS8P2HJpyoiuc9X2LKZ3dDoHrXquSOx6HEXhugjC EwI+4D5LQfV8/yRt6i+bzg+I03gM0J7I8UpzZ/73QovxNr2IXDPu8raIs/EK2OVBFY WGdQ2NVcoSIeA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 527CF6A228; Tue, 24 Mar 2026 16:19:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 24 Mar 2026 16:19:02 -0600 Message-ID: <20260324221911.3678307-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260324221911.3678307-1-sjg@u-boot.org> References: <20260324221911.3678307-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QCFOIYKI4UHQNFEJIIQUBL5JGFU6CLBZ X-Message-ID-Hash: QCFOIYKI4UHQNFEJIIQUBL5JGFU6CLBZ 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/12] bootstd: Show entry number in bootflow info 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 Display the entry index in 'bootflow info' output when the bootmeth supports BOOTMETHF_MULTI This is shown even for entry 0, so that users can see which entry a bootflow represents and distinguish between multiple bootflows from the same partition. Signed-off-by: Simon Glass --- cmd/bootflow.c | 8 ++++++++ doc/usage/cmd/bootflow.rst | 11 +++++++++-- test/boot/bootflow.c | 3 +++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 70eec5919cc..1c40037e6a6 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -371,6 +372,13 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc, printf("Method: %s\n", bflow->method ? bflow->method->name : "(none)"); printf("State: %s\n", bootflow_state_get_name(bflow->state)); printf("Partition: %d\n", bflow->part); + if (bflow->method) { + struct bootmeth_uc_plat *ucp; + + ucp = dev_get_uclass_plat(bflow->method); + if (ucp->flags & BOOTMETHF_MULTI) + printf("Entry: %d\n", bflow->entry); + } /* Show encryption status with LUKS version if applicable */ if (IS_ENABLED(CONFIG_BLK_LUKS)) { diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index 4507303fb3a..3a21e00a47b 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -167,6 +167,7 @@ Type distro Method: extlinux State ready Partition 2 +Entry 0 Encrypted no Subdir (none) Filename /extlinux/extlinux.conf @@ -185,6 +186,12 @@ Device Block dev Name of the block device, if any. Network devices don't have a block device. +Entry + Entry number and name for boot methods that support multiple entries + (``BOOTMETHF_MULTI``). For example, an extlinux config with several + labels shows the entry index and label name. Only shown when + the boot method supports multi-entry. + Encrypted Encryption status. Shows ``LUKSv1`` or ``LUKSv2`` if a LUKS-encrypted partition was detected on the same device, or ``no`` otherwise. Only @@ -344,6 +351,7 @@ displayed and booted:: Method: distro State: ready Partition: 2 + Entry: 0 Encrypted: no Subdir: (none) Filename: extlinux/extlinux.conf @@ -355,8 +363,7 @@ displayed and booted:: FDT: Error: 0 U-Boot> bootflow boot - ** Booting bootflow 'smsc95xx_eth.bootdev.0' - Ignoring unknown command: ui + ** Booting bootflow 'mmc@7e202000.bootdev.part_2' Ignoring malformed menu command: autoboot Ignoring malformed menu command: hidden Ignoring unknown command: totaltimeout diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 2ff203c186c..84d80d9fd10 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -258,6 +258,7 @@ static int bootflow_cmd_info(struct unit_test_state *uts) ut_assert_nextline("Method: extlinux"); ut_assert_nextline("State: ready"); ut_assert_nextline("Partition: 1"); + ut_assert_nextline("Entry: 0"); if (IS_ENABLED(CONFIG_BLK_LUKS)) ut_assert_nextline("Encrypted: no"); ut_assert_nextline("Subdir: (none)"); @@ -1845,6 +1846,7 @@ static int bootflow_cmd_info_encrypted(struct unit_test_state *uts) ut_assert_nextline("Method: extlinux"); ut_assert_nextline("State: ready"); ut_assert_nextline("Partition: 1"); + ut_assert_nextline("Entry: 0"); if (IS_ENABLED(CONFIG_BLK_LUKS)) ut_assert_nextline("Encrypted: LUKSv2"); ut_assert_skip_to_line("Error: 0"); @@ -1890,6 +1892,7 @@ static int bootflow_cmd_bls(struct unit_test_state *uts) ut_assert_nextline("Method: bls"); ut_assert_nextline("State: ready"); ut_assert_nextline("Partition: 1"); + ut_assert_nextline("Entry: 0"); if (IS_ENABLED(CONFIG_BLK_LUKS)) ut_assert_nextline("Encrypted: no"); ut_assert_nextline("Subdir: (none)");