From patchwork Sat Jan 10 20:28:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1459 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=1768077022; bh=WGQuKl5IQQwCvcLXKRZhk4mOLtm5/qdwkxwFvmKZpTY=; 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=XWk1Hio8XBjZxvyKp69Gv2zfzytnRyzrF8p1T6rfEQn6H7LqycGXLavk79GXa+RFh HlSEHNkoE+1Osgh9vImiFhoy6oVn0tF1B3Pj/oSN4BnKo183fzI3awzSWdfWuqp70y UPnXxB42+D8pVwR+1yvuVaEuXuU+ekXHs9nJSIbR8WR+abj2KnoTbjJWUqHIPeuEos JbufjMUGJgEcYVws8xTOl1a7mHBtepuOUwysTIu6eRTxIUr7QioDSLM2f62nj64dfJ CRzBBzRcdDAffexzzTERnawfG4AYYND+X5CawGFZjvvyOHfneEdjYElovYjfB1IaM/ NYGaHW/F7dVNA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0CFC169296 for ; Sat, 10 Jan 2026 13:30: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 dyzaWxmmasrl for ; Sat, 10 Jan 2026 13:30:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077021; bh=WGQuKl5IQQwCvcLXKRZhk4mOLtm5/qdwkxwFvmKZpTY=; 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=iAPCDDjKNoIWFjx1frRjqCg96U1iywHbvILrjRZHT7edKdrGLsBjC5pHHihEuoWf1 PrhQQ7Q7fr2Q6qF1XAGsCcOgC+lkc/xtzLFifPruOr9opx5S5UuwxeHDDthe5ar4F1 9/v/uJK+cQUwCnbOeHPAlrZuGfrbi3hS9JjuN9xyMS0BfJgXt34Y4kzl5/ppZLPzg0 bMB8HBRsvNqwWA3SCVidaJBeyMT01jvuMNNhi0Urj2kO0Qq1yzeSUv0k5m/Ri9UY59 3eLyGrmpcMn5t1VabS6M8dvxoGFyEVneI8dv56THtOOp/pc8O8MBmsShQdn3D2x/QX ilnkcBRroU50w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F004F69290 for ; Sat, 10 Jan 2026 13:30:21 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077018; bh=sEspRTVauE+lAgAZAaekWoO8QCmulERJcoOWHNPlE1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NMisHsfZleUxLgVeSCF96Jml+RNRXudlcF+SkvFWkvHlT9C2AVzGSNcGldJiDp0C5 rdY0/Ree4LP/3+AGCZ/NavA2R1IQs6Jo4C40gg222OCmzfBntuz8uWia0W7xtxQNyk PbRCt7Z2qBGvtYe/LOq7eB9WP9c6af4ZCEs7z9f4WmUEajulM8RTNaj9koTcd51MPo qFawrkIDqtkV7yBXbEpIohCXZDlFIlMqBSSzRb4Kt6IwOBksECevf973rR7B9m0mtb TGp/2k9pHLD5x51NK19/cCju/dRcYwWPIYR/BpABgsROWUSjvsynU/0xFEfmeyYf87 DjC6N3rbKBGXA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F184969290; Sat, 10 Jan 2026 13:30: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 5PzH5syvFcQZ; Sat, 10 Jan 2026 13:30:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077014; bh=ApPElY0JidemFAiZGLyAXLWKFysvSq0XETC1Q+vyigA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VpGz2GxuN6szxRTlAOb0rncoWIjJKZxXi7drdCQv6FawCOSfmPxO4PxZnzvwbt+NR YGKXGG7dAIXfPVbWqw/zzHjLA7Mg+ziKkvNGYP+9+sKGS3JDcpFj4GJHe8+KhBD5rd Nwj6NdGrFs4LTZALEp8wmdlX+sg5qqClCWjEHGqfOMls14gv8p1J9k8ybftbq+elqT 8YDx3mYMbdUSahZXYt+Ucmu9cINi0aKM7V4xxJxgL6m9Ce91P6lBtLubt7XEfXZN0Q C+SGmwq/q44ZsqTuwQb9XWkEauNdrvqm3S11n+Vq8ua314wj34xq0u78Gw67d0IiD7 +ebNvVvF9tg/Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D7EC569186; Sat, 10 Jan 2026 13:30:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:28:45 -0700 Message-ID: <20260110202906.187370-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110202906.187370-1-sjg@u-boot.org> References: <20260110202906.187370-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UIYOEF7TH4CK3EMVDU7W2T4HE73ZH5FM X-Message-ID-Hash: UIYOEF7TH4CK3EMVDU7W2T4HE73ZH5FM 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/26] boot: pxe: Add the initrd to the files list when parsing 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 parsing an initrd, add the path to the files list with type PFT_INITRD. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_parse.c | 7 ++++++- test/boot/pxe.c | 20 +++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/boot/pxe_parse.c b/boot/pxe_parse.c index 8bd9d66f486..7dac5c94759 100644 --- a/boot/pxe_parse.c +++ b/boot/pxe_parse.c @@ -616,8 +616,13 @@ static int parse_label(char **c, struct pxe_menu *cfg) break; case T_INITRD: - if (!label->initrd) + if (!label->initrd) { err = parse_sliteral(c, &label->initrd); + if (err < 0) + break; + err = label_add_file(label, label->initrd, + PFT_INITRD); + } break; case T_FDT: if (!label->fdt) diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 6b2d521c8e8..0751228dc99 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -190,13 +190,15 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_asserteq_str("/initrd.img", label->initrd); ut_asserteq_str("/dtb/board.dtb", label->fdt); ut_assertnull(label->fdtdir); - ut_asserteq(3, label->files.count); + ut_asserteq(4, label->files.count); ut_asserteq_str("/vmlinuz", alist_get(&label->files, 0, struct pxe_file)->path); - ut_asserteq_str("/dtb/overlay1.dtbo", + ut_asserteq_str("/initrd.img", alist_get(&label->files, 1, struct pxe_file)->path); - ut_asserteq_str("/dtb/overlay2.dtbo", + ut_asserteq_str("/dtb/overlay1.dtbo", alist_get(&label->files, 2, struct pxe_file)->path); + ut_asserteq_str("/dtb/overlay2.dtbo", + alist_get(&label->files, 3, struct pxe_file)->path); ut_asserteq_str("Booting default Linux kernel", label->say); ut_asserteq(0, label->ipappend); ut_asserteq(0, label->attempted); @@ -304,7 +306,7 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) * environment, and verify overlay files can be loaded. */ label = list_first_entry(&cfg->labels, struct pxe_label, list); - ut_asserteq(3, label->files.count); + ut_asserteq(4, label->files.count); /* Set environment variables for file loading */ ut_assertok(env_set_hex("kernel_addr_r", PXE_KERNEL_ADDR)); @@ -323,15 +325,15 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_asserteq(PXE_KERNEL_ADDR, ctx.kern_addr); ut_asserteq(PXE_FDT_ADDR, ctx.fdt_addr); - /* Verify overlays were loaded to valid addresses (indices 1 and 2) */ - ut_assert(alist_get(&label->files, 1, - struct pxe_file)->addr >= PXE_OVERLAY_ADDR); + /* Verify overlays were loaded to valid addresses (indices 2 and 3) */ ut_assert(alist_get(&label->files, 2, struct pxe_file)->addr >= PXE_OVERLAY_ADDR); + ut_assert(alist_get(&label->files, 3, + struct pxe_file)->addr >= PXE_OVERLAY_ADDR); /* Second overlay should be at a higher address than the first */ - ut_assert(alist_get(&label->files, 2, struct pxe_file)->addr > - alist_get(&label->files, 1, struct pxe_file)->addr); + ut_assert(alist_get(&label->files, 3, struct pxe_file)->addr > + alist_get(&label->files, 2, struct pxe_file)->addr); /* Verify no more console output */ ut_assert_console_end();