From patchwork Tue Apr 21 18:34:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2235 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=1776796574; bh=pYj94UQaU/yYC3KooNFxSS1+EhyVLQiFBAe+HlO5A78=; 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=U+8vgEHnL/G5ijVzChOC4ZJaALUs2HNE/noEVL9gyW+mqUC3WtgNSlgz2pnwEQvA+ XTUTRgCEh6DUmTErMqjQTPmobZmzLR88dqpIREmhgVvHWL6IHOgj5qsBZfpQxo11ru r7JAk/3Dk1hDydVGYhKz+ShQK2U7UKQk7Lw3CkqM= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0668B6A608 for ; Tue, 21 Apr 2026 12:36:14 -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 K2gNjst7emPB for ; Tue, 21 Apr 2026 12:36:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776796573; bh=pYj94UQaU/yYC3KooNFxSS1+EhyVLQiFBAe+HlO5A78=; 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=oxC4lNZesg7ce2Qvm11WJltqZ6Z85xHtYoWhPOpvehwbPadDn3D2VMGtwx+BiRvoN vcDEF9VNuWlk4Q47IYic6GMIU+N2v/xG2ykE8b2TYA1Ow+YXFD3wdY+hyHh6xgX7Yf vNxUPM/3cynppOMuWS5Gy50I6j9mt43Eh7TBc4D0= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EA0B26A619 for ; Tue, 21 Apr 2026 12:36:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776796570; bh=UqF2bbC6Tn5WBVornf5bgPEIbuzVogV17wzS+3R/o5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bb4Q+75MyEpBYaM/SYGbQoYm9KyK+NpET6nMpv2uGek/piAS0MZbvRn5aBQ4J4xK/ 0jPOsiQ37ylh01M2y4EEJ9AMFlCXdzXBP4XWZvFgacU4mrKCXxc6+ePuckuJJtpbCg npU5ijXOjfLz6JdkGXaS5/ouU8C1I9som5KE8ATI= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AF6ED6A603; Tue, 21 Apr 2026 12:36:10 -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 uhT85nsx2uPn; Tue, 21 Apr 2026 12:36:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1776796570; bh=PZed5p9M4q3I7FxuXm0TqD3yWB4Wvute41vcgDa3BGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TftiT5RUY+ovmks5WTCp3Kc7Ufo+CpdHo7O7e4LLGBDSUvuunjFE8ugyVhh2kC1S6 V8vA2k7ucYWTL6qjy5Y4aDmkgUtslGl5imNMCF95xSjgZ2UFzBXyGTVRmhZGxUhhuZ ptQASaPE6Zy/B0MOIboQAEsLuw+QC6M2vDulP5RM= Received: from u-boot.org (unknown [174.51.25.52]) by mail.u-boot.org (Postfix) with ESMTPSA id 3EE886A601; Tue, 21 Apr 2026 12:36:10 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 21 Apr 2026 12:34:49 -0600 Message-ID: <20260421183511.2044469-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260421183511.2044469-1-sjg@u-boot.org> References: <20260421183511.2044469-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3FQ4IPZFEM6QLVHR3VES7Q7HXMMFSM2R X-Message-ID-Hash: 3FQ4IPZFEM6QLVHR3VES7Q7HXMMFSM2R 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/16] bootstd: Also scan BLS target partitions by type 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 Boot Loader Specification says a boot loader should discover Type #1 entries by locating the ESP and XBOOTLDR partitions (or an MBR type 0xea partition) and reading loader/entry*.conf from them. It never mentions the bootable attribute. U-Boot's bootflow iterator currently skips any non-bootable partition once a bootable one has been seen, which means a disk with only an ESP and no 'bootable' flag (e.g. some hybrid media layouts) is not scanned for BLS entries at all. Also call part_is_bls_target() when deciding to skip, so ESP and XBOOTLDR partitions are always tried regardless of the flag. Existing bootable-partition behaviour is unchanged. Signed-off-by: Simon Glass --- boot/bootdev-uclass.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index faed1f3e5df..91d27d1e212 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -167,10 +167,16 @@ int bootdev_find_in_blk(struct udevice *dev, struct udevice *blk, * for filesystems or partition contents on this disk */ - /* if there are bootable partitions, scan only those */ + /* + * If there are bootable partitions, scan only those, plus any Boot + * Loader Specification target partitions (ESP, XBOOTLDR, MBR 0xea) + * which BLS discovery requires regardless of the bootable attribute. + */ } else if ((iter->flags & BOOTFLOWIF_ONLY_BOOTABLE) && iter->first_bootable >= 0 && - (iter->first_bootable ? !info.bootable : iter->part != 1)) { + (iter->first_bootable ? !info.bootable : iter->part != 1) && + !(CONFIG_IS_ENABLED(BOOTMETH_BLS) && + part_is_bls_target(&info))) { log_debug("Skipping non-bootable partition %d\n", iter->part); return log_msg_ret("boot", -EINVAL); } else {