From patchwork Fri Jan 9 23:11:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1405 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=1768000375; bh=6PR08LlmlY2sqarDXeV2OzhJ7h4jo8uCo+X8YMy07JI=; 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=V9Ndfacq6vPGIsYO5DuwETDbNk0Y3iBxBM6LEZmn6GEUmSA+qUCui2TSmDoTbMXCH GjVdLkJpxgxRFqL2O/q1A4MKVucMwEsrcDsZF38JjYNwqxGpFxdt9+gVDFj4gFNKAc iI+uibN8Af9lPasqeaf8YVpyFCtVultsrmug7zOpL2I2jxU5oI/HQTWSwGWY+R5ywC DY8z6yV/hy5VXWuJj+LYx0P6LhLMwE0d6CLcR16NLTm4nrnt9Srq9h3UUyrVTMvmgD OeapoYcavw2XjywvZypewRryO43GuL/kGHLqQWSBfm8WOu7jqvmSXoLRcSi0AwmtOd O4l1ZLb24yS1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 59ECF6923D for ; Fri, 9 Jan 2026 16:12:55 -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 HKeROvrwQ0zr for ; Fri, 9 Jan 2026 16:12:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000375; bh=6PR08LlmlY2sqarDXeV2OzhJ7h4jo8uCo+X8YMy07JI=; 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=V9Ndfacq6vPGIsYO5DuwETDbNk0Y3iBxBM6LEZmn6GEUmSA+qUCui2TSmDoTbMXCH GjVdLkJpxgxRFqL2O/q1A4MKVucMwEsrcDsZF38JjYNwqxGpFxdt9+gVDFj4gFNKAc iI+uibN8Af9lPasqeaf8YVpyFCtVultsrmug7zOpL2I2jxU5oI/HQTWSwGWY+R5ywC DY8z6yV/hy5VXWuJj+LYx0P6LhLMwE0d6CLcR16NLTm4nrnt9Srq9h3UUyrVTMvmgD OeapoYcavw2XjywvZypewRryO43GuL/kGHLqQWSBfm8WOu7jqvmSXoLRcSi0AwmtOd O4l1ZLb24yS1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4846269235 for ; Fri, 9 Jan 2026 16:12:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000373; bh=hHmSAal+3AATpP8G4SyJLMQdvQoXebHL6Xgk2UIH2lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fUQgAYIab1369BAuCJzZ6KIJ4SR0Vw+dASaO9oy4fhh9zSuRD1kKk12n24mWcxo3f xdarJo7FCNs4x2slTojSzX/N7TBzviehRymGzxVg/YGg4MHzZ2W5Q8UQmZW+gL4wID 0O+aTAJRwyCSBi0IEYvSXrnVMh5Bpgw4wB25XKQWUaDUY0ALHOw+TfxVArkNcztcbC 2UYuZpsFObg1eTy5KlCQBvilt3Vwfv3AwRAsGGTSou+F+zGRCh4sMz8Pp2uvSRH/P9 WqeFooAXqcB8373iXuxN1WAu7I+5NICeMKzCPwGRvZiEMjyldIK5jjCM2r42L26UtJ vdc8RqQNuGAYA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 700DA69218; Fri, 9 Jan 2026 16:12:53 -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 tiN8ojp-B_5n; Fri, 9 Jan 2026 16:12:53 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000369; bh=65Ejht9/oLmxy/Hw6N/XPK8NSglqhxfQ1npxONwzmxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5QCWRNofw6pqjrMBlAoWJXuqsL/Yzcuvc6jkatRcGvXpwPSlEKjVLvrsfzJ6dNqR Eyn7vA0sHwILeZvmJzjUPxhVJHaNmFuhETHzwxfXt4q/AtYG6xwIl0lZQSmNCxIofN zQB23WUG2kiHfL5jgFWTBP+Pa2vqXLoE/HLPk4gU2CI21dnPqHQ044Yf0xjjNI+AF1 r0CiqrHp958PoZMlmI3bUotWCVQ0dpyW6Lnoi0qF9hdxF8PSNa4/RTdidHKFRg9Hrg iElm0ZpNmkzoZRuItBvS8HXDJNxKp5m03ThhRojmnSnb2BGuqcxSp7nEaLzaZ7Vw93 mKbNzdwQwpfiw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0EC1769206; Fri, 9 Jan 2026 16:12:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 16:11:18 -0700 Message-ID: <20260109231151.4056804-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109231151.4056804-1-sjg@u-boot.org> References: <20260109231151.4056804-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: AFRIYMCB7KUKO4FS4MFMIPOVPSUEEIFZ X-Message-ID-Hash: AFRIYMCB7KUKO4FS4MFMIPOVPSUEEIFZ 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 09/32] boot: pxe: Add a flag to suppress file-retrieval messages 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 Add a 'quiet' field to struct pxe_context to allow callers to suppress the "Retrieving file" message when loading files. This is useful when using the parser API to inspect labels without booting, where the message would be noise. Normal boot flows leave quiet as false (the default) so the message is still printed. Parse-only callers can set ctx.quiet = true to suppress it. Update the PXE parser test to use quiet mode. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_utils.c | 3 ++- include/pxe_utils.h | 2 ++ test/boot/pxe.c | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 384293d9f8a..3c48b0ac51b 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -124,7 +124,8 @@ static int get_relfile(struct pxe_context *ctx, const char *file_path, strcat(relfile, file_path); - printf("Retrieving file: %s\n", relfile); + if (!ctx->quiet) + printf("Retrieving file: %s\n", relfile); ret = ctx->getfile(ctx, relfile, addrp, align, type, &size); if (ret < 0) diff --git a/include/pxe_utils.h b/include/pxe_utils.h index ef664f075a0..f910ea9d284 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -120,6 +120,7 @@ typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, * @use_fallback: TRUE : use "fallback" option as default, FALSE : use * "default" option as default * @no_boot: Stop show of actually booting and just return + * @quiet: Suppress "Retrieving file" messages when loading files * @bflow: Bootflow being booted, or NULL if none (must be valid if @no_boot) * @cfg: PXE menu (NULL if not yet probed) * @@ -157,6 +158,7 @@ struct pxe_context { bool use_ipv6; bool use_fallback; bool no_boot; + bool quiet; struct bootflow *bflow; struct pxe_menu *cfg; diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 4c87aafce55..af45c1fbffd 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -160,7 +160,8 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_assertok(pxe_setup_ctx(&ctx, pxe_test_getfile, &info, true, cfg_path, false, false, NULL)); - /* Read the config file into memory */ + /* Read the config file into memory (quiet since we're just parsing) */ + ctx.quiet = true; ret = get_pxe_file(&ctx, cfg_path, addr); ut_asserteq(1, ret); /* get_pxe_file returns 1 on success */ @@ -168,12 +169,11 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) cfg = parse_pxefile(&ctx, addr); ut_assertnonnull(cfg); - /* Verify 'say' keyword printed its message during parsing */ - ut_assert_nextline("Retrieving file: %s", cfg_path); + /* + * Verify 'say' keyword printed its message during parsing (quiet + * suppresses file messages) + */ ut_assert_nextline("Booting default Linux kernel"); - ut_assert_nextline("Retrieving file: /extlinux/extra.conf"); - for (i = 3; i <= 16; i++) - ut_assert_nextline("Retrieving file: /extlinux/nest%d.conf", i); ut_assert_console_end(); /* Verify menu properties */