From patchwork Tue Mar 24 22:18:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 137 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=1774390776; bh=Lh1czoOP4b0vCn5CLfwBolBC+zccposZVVK1xUEm/f0=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Sim36vLH/sLMEF3KDlGqtfuK4c62Y09PnGo72Lz65geGsDsejz+tUAHIPXCfFc//L C1KdPe4yftdos+Rfdr+5XOHVMQZe0MX2NqzhUzUNa01Th0HWNCYqSLKfhRx82uBhR7 VyU74GG3ziSQYMENzUBoIMfLOHmV5EZNSVIlMiNbA3ltAz/jl/wJsID6ZoZb//IkDQ gYlwrTuQw3iOEJROo23NznFL+8STbQ4raZV/XhAXfLraSz9sJwNQXSbsjogfJy2DBc VauIUrmLOiPGSG/JHwdq8H2jH8USDwCu2huOdN2ihZlNpaD6ZMwbf9DkWXkAa0O/i3 pdsx0oCKYXC+g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6BFC66A1DD for ; Tue, 24 Mar 2026 16:19:36 -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 32HaFrg5tezW for ; Tue, 24 Mar 2026 16:19:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390776; bh=Lh1czoOP4b0vCn5CLfwBolBC+zccposZVVK1xUEm/f0=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=Sim36vLH/sLMEF3KDlGqtfuK4c62Y09PnGo72Lz65geGsDsejz+tUAHIPXCfFc//L C1KdPe4yftdos+Rfdr+5XOHVMQZe0MX2NqzhUzUNa01Th0HWNCYqSLKfhRx82uBhR7 VyU74GG3ziSQYMENzUBoIMfLOHmV5EZNSVIlMiNbA3ltAz/jl/wJsID6ZoZb//IkDQ gYlwrTuQw3iOEJROo23NznFL+8STbQ4raZV/XhAXfLraSz9sJwNQXSbsjogfJy2DBc VauIUrmLOiPGSG/JHwdq8H2jH8USDwCu2huOdN2ihZlNpaD6ZMwbf9DkWXkAa0O/i3 pdsx0oCKYXC+g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 50B9F6A238 for ; Tue, 24 Mar 2026 16:19:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390773; bh=U6zVmSK5z8gTTq7aY820tuxtI85CfVMncSQAE6qeTXY=; h=From:To:Cc:Subject:Date:From; b=FUSxpneXOuXKdr+VwS1cCqV6vdJonuSvwtIDbEvOZO58bwldesYTROUvMfbBMVn0E uXqZidy1ap9oeULjq6VfLFNfrC4E7pkZmcZ36o2bp/mQdGCB1gW2ljtr1A09cnVFV3 RXIl64DJGEy4TAh+DdDoOlIP3MhuT11J6osDhVjll8pG7Tb0mZfn9b4sQhsKsdEPKo x53Zx/HLQXoGkJN7OL/5DVLq3XTvIpXFa9eIc99RTo7xCg6272OZ8ajpGolTEqiNF9 1MQI8zNDXgE1yLrbN78AGZVBip59qDfm8fFGWe6ATf/ZhgFvJSiue2J0TKN23B/wQO JqM2v4unUO3pg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F7DA6A1FD; Tue, 24 Mar 2026 16:19:33 -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 TPxLewSdmkJ0; Tue, 24 Mar 2026 16:19:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774390773; bh=DQcrijiWJ8KEw9nlQlm+U2XUOBhPlaEL6gBuul3Li70=; h=From:To:Cc:Subject:Date:From; b=q9jKvd3ysXJxzBishMxOuXEWvIMAKB4R9Yh/RFly2Bn1K4AVDhAgPyZgM0Ore/KTi ursqxjJgKs27Z7wvWMbsjjLl8SuHs4aDBxJX1yUsl1MCpljeiSv5LXl6MnGHA33GcF luYrQZnBmOaVbcxchtuJj+SouuVo5/zeeHI1tQM2mwET5ryrhtbpf5rtkNld3HzG+0 SCYNHNj3KPfL/BwXuzaS8r16Cmm4Ui83LDgzq7wtnTpCF2iM7/iXsTfkQvMjsinaxQ VQbK/LTreENt3RlNxhH3cjkvK9iN6Aj3PoFIzpQkAx4BNYD5U8rWmFoZVKqWomqz4o PHi0QXsuEa0yg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 145836A1DD; Tue, 24 Mar 2026 16:19:33 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 24 Mar 2026 16:18:54 -0600 Message-ID: <20260324221911.3678307-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: J5YUJUKGMXTMYWS3ZBBS3CDMIWHMJGZR X-Message-ID-Hash: J5YUJUKGMXTMYWS3ZBBS3CDMIWHMJGZR 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 00/12] bootstd: Support multiple bootflows per partition 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 Bootflow scanning currently assumes that each partition contributes at most one bootflow per bootmeth. In practice, formats like extlinux can define multiple labels in a single configuration file, each pointing to a different kernel. Similarly, BLS installations can have multiple .conf files in loader/entries/. This series adds multi-entry support to the bootflow iterator, building on the infrastructure from the prior series. A new BOOTMETHF_MULTI flag allows a bootmeth to declare that it can produce multiple bootflows from a single partition. The iterator tries incrementing a sub-entry index before advancing to the next bootmeth, with the entry passed to read_bootflow() via bflow->entry. Both extlinux and BLS bootmeths set BOOTMETHF_MULTI. The extlinux bootmeth uses parse_pxefile() with pxe_process_includes() to handle include directives during scanning, caching the result in the alist for reuse at boot time. A new pxe_boot_entry() function boots a specific label by index. The BLS bootmeth scans loader/entries/ for multiple .conf files. Bootflow info displays the entry number and name (extlinux label or BLS title) so users can distinguish entries from the same partition. Simon Glass (12): extlinux: Use pxe_parse() to extract bootflow info bootstd: Add BOOTMETHF_MULTI for multi-entry bootmeths extlinux: Enable multi-entry bootflow scanning test: bootstd: Add test for multi-entry bootflow scanning bls: Enable multi-entry bootflow scanning pxe: Add pxe_boot_entry() to boot a specific label by index doc: Update bootflow docs for encryption bootstd: Show entry number in bootflow info bootstd: Show entry name in bootflow info bootstd: Show entry column in bootflow list extlinux: Process and cache parsed config during scanning doc: bootstd: Document multi-entry bootflow scanning boot/bootdev-uclass.c | 1 + boot/bootflow.c | 33 +++++- boot/bootmeth_bls.c | 117 +++++++++++++++++++-- boot/bootmeth_extlinux.c | 140 ++++++++++++++++++------- boot/ext_pxe_common.c | 27 ++++- boot/pxe_utils.c | 40 +++++++ cmd/bootflow.c | 15 ++- doc/board/emulation/qemu-arm.rst | 4 +- doc/board/emulation/qemu-x86.rst | 4 +- doc/board/samsung/e850-96.rst | 6 +- doc/develop/bootstd/bls.rst | 4 + doc/develop/bootstd/extlinux.rst | 12 ++- doc/develop/bootstd/overview.rst | 37 ++++--- doc/usage/cmd/bootflow.rst | 122 ++++++++++++--------- doc/usage/cmd/bootstd.rst | 14 +-- doc/usage/cmd/history.rst | 8 +- include/bootflow.h | 9 ++ include/bootmeth.h | 5 + include/pxe_utils.h | 14 +++ test/boot/bootctl/bootctl.c | 8 ++ test/boot/bootdev.c | 13 ++- test/boot/bootflow.c | 175 +++++++++++++++++++++++++------ test/py/img/bls.py | 24 +++-- test/py/img/common.py | 11 +- test/py/img/ubuntu.py | 9 +- 25 files changed, 662 insertions(+), 190 deletions(-)