From patchwork Sun Mar 22 23:56:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 136 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=1774223855; bh=0SZQtbq8FwVQy77Oq6Hzl368u9bkMNUhPps+kqk69UY=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=liJs2RpmwclMIG8aqQcHt4jzLuW6NEEGGXBLPdaA/7YWZqqXa0FtFGzmv/2GsAn9e ojPGmxpRh+bYcaeNvuTQLilgu5ImtBUDo5PMxMJCNwoWLbXUpH6rB16BeaXGxWlHD9 GazaNy4ecxhF3FuWMTle1hy23GLSegi7gue+npKuv/iV9RB94s3ae3k8mG9Bh/vi4u 6NQeKM61SdOJRXcCbuRGp/Z0h39NbpsKJ/NP/m10NHN+wRKr9MG5VCd079G/jElQ7u K64eZ9lhW6MGrBYh8LkPoxsL5abYL7vlWDjauINjxbp6gK+o5sq5xYnIVuTEqcmlxZ EaOSiSdXR181Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C72D6A1DC for ; Sun, 22 Mar 2026 17:57:35 -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 STgQM3eOJfrH for ; Sun, 22 Mar 2026 17:57:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223855; bh=0SZQtbq8FwVQy77Oq6Hzl368u9bkMNUhPps+kqk69UY=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=liJs2RpmwclMIG8aqQcHt4jzLuW6NEEGGXBLPdaA/7YWZqqXa0FtFGzmv/2GsAn9e ojPGmxpRh+bYcaeNvuTQLilgu5ImtBUDo5PMxMJCNwoWLbXUpH6rB16BeaXGxWlHD9 GazaNy4ecxhF3FuWMTle1hy23GLSegi7gue+npKuv/iV9RB94s3ae3k8mG9Bh/vi4u 6NQeKM61SdOJRXcCbuRGp/Z0h39NbpsKJ/NP/m10NHN+wRKr9MG5VCd079G/jElQ7u K64eZ9lhW6MGrBYh8LkPoxsL5abYL7vlWDjauINjxbp6gK+o5sq5xYnIVuTEqcmlxZ EaOSiSdXR181Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 59DDD6A1DA for ; Sun, 22 Mar 2026 17:57:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223850; bh=9rb5jA88wOwcG8lmuscdcOVf/81pRtyM2Hu4/x8XiK0=; h=From:To:Cc:Subject:Date:From; b=Q1E0CfMMNTYzxeLnK92fV2liArSFLcoOx4MoZLyHKwm40PSV9wFFdgsRHzg8evnxn 61bFz/5kqyASOjpgCMJJfdOTQ6thclqePuLV2yDREGt8GHyAloELQmFZOsPE3XS6G8 NW6u4ueWau2XzPQGjSwqSy6RPcK4810uhyVuabUw1TPJZHOFudr7ilsETZ1CB+VLMJ m0PTvBOqeeU8bxoFJ4kQZJ3eDBZZzSYQVCiNcPzgfwoTjcDx1QrDjIiGEz1Sirml5U WOU2TuYOL/9ZcGzca6jf36DA0FW2R7dPtG7XJTXbmZzYILNO4fOr6mxTuuySAeLwkh VpLnzm87j4ZWQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7E4466A1D7; Sun, 22 Mar 2026 17:57:30 -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 KF1knEc9EN_h; Sun, 22 Mar 2026 17:57:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223850; bh=sTs3CXv5dw28Dysg4tGaR8VusfIv7Frff1Fjni+qrjg=; h=From:To:Cc:Subject:Date:From; b=GVkNJ68zpB9JC9ND7IxCtQb8/ktB18Tk9s8QczLz6pxrSOIUPPtyDqn15ldLaTK87 Lc2pkj8VG5DAQh+Lu9jxtzQ5hnY0efsFz7cCMuflTXX/AS0Y1UfJMCzT/ma2GjbDLm 7wIDzOHugr3hfen+xn8M8KlDlTJs/edKiAjXnHplY+aV1UCgZiLdbKGfmr95tKE7Mt Yi+udWCsFqmJEbV6mB5WPmZs4ntlYpzi7sRCavw0HL5I5zL/g3GKRJ8Pr3rGq1kFcb Ea7bqRaMWpRu6h/Mr3tsT2ctHaOWdULRq2QyJjUYs2Kn9OkXi29tr6sC2yL4Rx9AyE QSpY7JkKZVNnQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CD5A366F0C; Sun, 22 Mar 2026 17:57:29 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 22 Mar 2026 17:56:58 -0600 Message-ID: <20260322235719.1729267-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: YUHQ33K5SWKEXUADVRJW7TX3G63A2UFK X-Message-ID-Hash: YUHQ33K5SWKEXUADVRJW7TX3G63A2UFK 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/14] bootstd: Infrastructure for multi-entry bootflow support 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 This series prepares the bootstd infrastructure for supporting multiple bootflows from a single partition. Formats like extlinux can define several labels in one configuration file, and BLS installations can have multiple .conf files in loader/entries/ A follow-up series will add the actual multi-entry scanning. In summary: - Fix two iter->err inconsistencies in the bootflow scanning code that would prevent multi-entry iteration from working correctly - Add a free_bootflow() method to bootmeth_ops so bootmeths can properly clean up bflow->bootmeth_priv. Fix memory leaks in the cros, android and rauc drivers - Refactor the extlinux bootmeth to pass the PXE context explicitly and move it from platform data to a new private data struct - Convert the single PXE context to an alist of contexts, indexed by a new bootmeth_id field on the bootflow. This allows multiple parsed configurations to coexist - Add alist_add_placeholder() zeroing and suppress PXE parser warnings during non-interactive parsing Simon Glass (14): mcheck: Increase registry size alist: Zero new entries in alist_add_placeholder() bootstd: Set iter->err before BOOTFLOWIF_ALL early return bootstd: Clear iter->err on successful bootflow check pxe: Allow the parser to suppress warning messages bootstd: Add free_bootflow() method for bootmeths cros: Implement free_bootflow to fix memory leak android: Implement free_bootflow to fix memory leak rauc: Implement free_bootflow to fix memory leak extlinux: Pass pxe_context to extlinux_boot() and extlinux_read_all() extlinux: Move pxe_context to new extlinux_priv struct extlinux: Add remove() to fix pxe_context leak bootstd: Add bootmeth_id to struct bootflow extlinux: Convert pxe_context to an alist with bootmeth_id lookup boot/bootflow.c | 11 ++++-- boot/bootmeth-uclass.c | 10 ++++++ boot/bootmeth_android.c | 9 +++++ boot/bootmeth_cros.c | 9 +++++ boot/bootmeth_extlinux.c | 51 ++++++++++++++++++++++++--- boot/bootmeth_pxe.c | 27 ++++++++++++--- boot/bootmeth_rauc.c | 13 ++++++- boot/ext_pxe_common.c | 54 ++++++++++++++++++++--------- boot/pxe_parse.c | 27 +++++++++------ boot/pxe_utils.c | 1 + boot/vbe_abrec.h | 4 +++ boot/vbe_abrec_os.c | 13 ++++--- common/mcheck_core.inc.h | 2 +- doc/develop/bootstd/overview.rst | 12 ++++++- include/alist.h | 7 ++-- include/bootflow.h | 8 ++++- include/bootmeth.h | 24 +++++++++++++ include/extlinux.h | 59 ++++++++++++++++++++++++++++---- lib/alist.c | 8 ++++- test/boot/bootflow.c | 2 ++ test/lib/alist.c | 10 ++++++ 21 files changed, 299 insertions(+), 62 deletions(-)