From patchwork Fri Jan 9 01:53:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1367 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=1767923646; bh=wSB2KNH+ocyH2ilQHjHBbp+lBMFkxx/z2x3cAHgKqT8=; 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=RQqJZlpRwVW1d2Hc46Z+lQlOTFc/SIlR8sNp7ViSnt13kDazRotNyagMY2QlFF4SS Fora7pJ5ck4baAEp5oXALohjPcoqpAiEChr9Cvk8ew0YKBxwh1qKQVxcN0qVEqn58D Dmy/RnfHHhGYrLLPaaB9aFxg8jZoCXwDP7t7cyDCZf9yK7O+pLI0t1Wz+1BejRIHGY dlakWFNLHENGPBNMHIp3y4m28I3omYKx8W5pOFJ3ePTDBPO0HDZ6ShxZMEBk527piH AsEa9LmKaTihLfn5i3JPOfN1n5ETo73foaSWRzimCzj4K+qavISBIMXWklaRaZVy7N BWa4JFitC5oiw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9CA7E69130 for ; Thu, 8 Jan 2026 18:54:06 -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 BVsL2PNXsM_W for ; Thu, 8 Jan 2026 18:54:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923646; bh=wSB2KNH+ocyH2ilQHjHBbp+lBMFkxx/z2x3cAHgKqT8=; 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=RQqJZlpRwVW1d2Hc46Z+lQlOTFc/SIlR8sNp7ViSnt13kDazRotNyagMY2QlFF4SS Fora7pJ5ck4baAEp5oXALohjPcoqpAiEChr9Cvk8ew0YKBxwh1qKQVxcN0qVEqn58D Dmy/RnfHHhGYrLLPaaB9aFxg8jZoCXwDP7t7cyDCZf9yK7O+pLI0t1Wz+1BejRIHGY dlakWFNLHENGPBNMHIp3y4m28I3omYKx8W5pOFJ3ePTDBPO0HDZ6ShxZMEBk527piH AsEa9LmKaTihLfn5i3JPOfN1n5ETo73foaSWRzimCzj4K+qavISBIMXWklaRaZVy7N BWa4JFitC5oiw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AF61691E6 for ; Thu, 8 Jan 2026 18:54:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923643; bh=6pMjrTeG246LGtNKff/o9DKLymezzs50LUyli0y305c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r+GwdtwQpRR1z2sTkxjqUpWQFQh7l69X+4DG+oJIBbJZdfLaFkEdiCkWKFRSl/MqW YNz0NTmtxb3pPKah6Wu42Kb976JykbDKw3WmbVJdJVBaJ3s314HXaZctiG1M8P/SqW mK4l2EciCnzG/y/HS70PexZIOjSgsuR0eKK5rBNRQaJy0qR/L8TSjMVeri1EdA/e70 t3EcB/C82AjrATRuw2GftEAD0/ggpTI4KCF4jrgGDVipVkuRaTxkpy226L+AtvOTT7 jfAOufTuawt8g79VFoAHwU7CP/ulUSphPlixzNZG4IXB8eK9s+Hel1JRwZXJBekpX+ QIwJe/Y6PMHgA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CE6C769130; Thu, 8 Jan 2026 18:54:03 -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 j0o5LLtiG0rM; Thu, 8 Jan 2026 18:54:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923639; bh=kWmA9tzOTJ0qG/cQfxCpfj6MUVeCMsWOoUBY75f/ydY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=puL1wztww52Nrj+EzH4g6XdVCxAFQY3r2UpDS+xOKXysWE/Go5+72zCj2GJoR+UqD msckMsijSFzBl8RRptMByq1l/NwgeTV27RDjvAiUNaIYHHUCH44xyyDoaZ5ujiZnMP uz/S9F1spIorXaty/Tj6/UJTrKWKenJDNeXagM6MxVTGall43Vze+WQTmvapwHI+y1 oayPG7e2GC6pum02TMB9Pgf+4GIOVULaQZYEZDKzWbhEOM86Y6nOqP45ZZtnSk8YHL HM7UaNl3690prf67XmQPQ2xnK5f/W9CdGVNri8mGy1+NOpCQ9MHalMoYzEXLr1/xhO v7Zxh8GAwfUDA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7D95F6912D; Thu, 8 Jan 2026 18:53:59 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 18:53:06 -0700 Message-ID: <20260109015323.3411528-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109015323.3411528-1-sjg@u-boot.org> References: <20260109015323.3411528-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: QSNLBFEDMJ5KJ2ERI5GFERX3JGKT6OJS X-Message-ID-Hash: QSNLBFEDMJ5KJ2ERI5GFERX3JGKT6OJS 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 , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/16] test: pxe: Test include directive 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 Test the 'include' directive which allows one extlinux.conf file to include another. Create an extra.conf file with an additional label and verify it is parsed correctly when included from the main config. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/boot/pxe.c | 20 ++++++++++++++++++++ test/py/tests/test_pxe_parser.py | 16 ++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/test/boot/pxe.c b/test/boot/pxe.c index ef42026e748..45948ab4ef4 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -104,6 +104,7 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) /* Verify 'say' keyword printed its message during parsing */ ut_assert_nextline("Retrieving file: %s", cfg_path); ut_assert_nextline("Booting default Linux kernel"); + ut_assert_nextline("Retrieving file: /extlinux/extra.conf"); /* Verify menu properties */ ut_asserteq_str("Test Boot Menu", cfg->title); @@ -190,6 +191,25 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_asserteq(0, label->localboot_val); ut_asserteq(0, label->kaslrseed); + /* Verify fifth label: included (from include directive) */ + label = list_entry(label->list.next, struct pxe_label, list); + ut_asserteq_str("", label->num); + ut_asserteq_str("included", label->name); + ut_asserteq_str("Included Label", label->menu); + ut_asserteq_str("/boot/included-kernel", label->kernel_label); + ut_asserteq_str("/boot/included-kernel", label->kernel); + ut_assertnull(label->config); + ut_asserteq_str("root=/dev/sdb1", label->append); + ut_assertnull(label->initrd); + ut_assertnull(label->fdt); + ut_assertnull(label->fdtdir); + ut_assertnull(label->fdtoverlays); + ut_asserteq(0, label->ipappend); + ut_asserteq(0, label->attempted); + ut_asserteq(0, label->localboot); + ut_asserteq(0, label->localboot_val); + ut_asserteq(0, label->kaslrseed); + /* Verify no more console output */ ut_assert_console_end(); diff --git a/test/py/tests/test_pxe_parser.py b/test/py/tests/test_pxe_parser.py index 1d51116a97a..b289bf58b11 100644 --- a/test/py/tests/test_pxe_parser.py +++ b/test/py/tests/test_pxe_parser.py @@ -72,8 +72,6 @@ def create_extlinux_conf(srcdir, labels, menu_opts=None): fd.write(f"menu background {menu_opts['background']}\n") if 'say' in menu_opts: fd.write(f"say {menu_opts['say']}\n") - if 'include' in menu_opts: - fd.write(f"include {menu_opts['include']}\n") for label in labels: if label.get('default'): @@ -108,6 +106,10 @@ def create_extlinux_conf(srcdir, labels, menu_opts=None): if 'say' in label: fd.write(f" say {label['say']}\n") + # Write include at the end so included labels come after main labels + if 'include' in menu_opts: + fd.write(f"\ninclude {menu_opts['include']}\n") + return '/extlinux/extlinux.conf' @@ -159,10 +161,20 @@ def pxe_image(u_boot_config): 'fallback': 'rescue', 'ontimeout': 'linux', 'background': '/boot/background.bmp', + 'include': '/extlinux/extra.conf', } cfg_path = create_extlinux_conf(fsh.srcdir, labels, menu_opts) + # Create an included config file with an additional label + extra_path = os.path.join(fsh.srcdir, 'extlinux', 'extra.conf') + with open(extra_path, 'w', encoding='ascii') as fd: + fd.write("# Included configuration\n") + fd.write("label included\n") + fd.write(" menu label Included Label\n") + fd.write(" kernel /boot/included-kernel\n") + fd.write(" append root=/dev/sdb1\n") + # Create the filesystem fsh.mk_fs()