From patchwork Fri Jan 9 01:53:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1374 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=1767923669; bh=qOOQSI0+48ajW0XqKAqm0+avRy04ZfJ17swSgA211jM=; 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=BZS6ezb0T5zXnfsjAF/VAea1nfiQIg237X56lNISS4Z4uZwlegqR9Nuif5ssMIDz2 GLA0sHh4vRd/xQaWEpqYPhc0fZbYBMvyN7dOcYRk3AdsVB0LRfniGbvbDmTiC7JNrU lGsJzSADTsxLHnyrHLWLf3HtOdj7FcV+2WwHw3mQS201rOFSbaq54M2Xu+AUPEATXP uQ9b4KEt3QQApf8BmQCrFRDVsbY8xw3Bdm1PFxC/PsjUqYTeSZeo0h8MH0pl8VH2su Y5btx3SEPkumYsnunHSWF3N18etxssObTVXgveZ6Ex0NQ6VLUPGfvrd6uehVHb1PSK m0BgTJftLjL8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 93BB9691E7 for ; Thu, 8 Jan 2026 18:54:29 -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 LIYuq-f18ZZ1 for ; Thu, 8 Jan 2026 18:54:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923669; bh=qOOQSI0+48ajW0XqKAqm0+avRy04ZfJ17swSgA211jM=; 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=BZS6ezb0T5zXnfsjAF/VAea1nfiQIg237X56lNISS4Z4uZwlegqR9Nuif5ssMIDz2 GLA0sHh4vRd/xQaWEpqYPhc0fZbYBMvyN7dOcYRk3AdsVB0LRfniGbvbDmTiC7JNrU lGsJzSADTsxLHnyrHLWLf3HtOdj7FcV+2WwHw3mQS201rOFSbaq54M2Xu+AUPEATXP uQ9b4KEt3QQApf8BmQCrFRDVsbY8xw3Bdm1PFxC/PsjUqYTeSZeo0h8MH0pl8VH2su Y5btx3SEPkumYsnunHSWF3N18etxssObTVXgveZ6Ex0NQ6VLUPGfvrd6uehVHb1PSK m0BgTJftLjL8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7410969130 for ; Thu, 8 Jan 2026 18:54:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923668; bh=vo8lAo2R4BWnLWri90DL+I8fAO5i4on2vUJwhdZMp04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2ZPSyYflSUTc3piVWAvJSKuNgeUDrUumMdql/DuA33H10MEX8zY9FeLq3e3TXH10 YRkClb1nQoaR+5wLDwANA44FVYLIjVReJ3bQ7B2vWz1qzZhKTYlNHvtB4Ye0K1ssTJ TnjVTQLdY11LpA5bb7a9cWV4qFH/8zthfNlZLgWamAEYoSWKBmW0d/aNcio/9mcIxU WuwA/Juql1r3PDK4rQ6dUkSgzo6BhEpZFxBRX+bpLz3lzs0CWKKMsaI007N5QpDtda OK8QFdqv8D+uyJE2JKW8/Ld23xrMcegtLhGvU503S5NksjZfONsAKy6uj96r5ywwxb 5tR1fZcugdMYA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A8F0B691E6; Thu, 8 Jan 2026 18:54:28 -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 0ndP11R_P3bS; Thu, 8 Jan 2026 18:54:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767923664; bh=ZNnfPDImU4D8I1Q4dj7QS6vtYVvfxA0yHZvyVw9rzS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uwA2JcbQhBxlovBl3zMToFaRFv/Bpx38aTpe0OyNYmnHFbBTVGsFFM4dLYXkY+S/M 1HTpmyPTwiAwP77YOurB293s3WQoAT75oKqpZWvChqGMIxq145QjmB021MQ8JP03Xy 1KEAeVEfmeBp0NGVRSrXGr2EG+tZ3EoF5eRDXGllA5ZI2IPcRbQ4YNnvTIxQ6MXY3J BTH5oeq4crg1HEzv73xyv1ZV5CKrfUL+pMyM0oNwtEgVNg3yD35WQnSEkNpP1CALGE 1xQMntZaXux+eqbyYwNRvwRhmYpUihlS6Dge81aA2cmBsZ43Xoaz5QcKgm4RikNbsY H9xDzXVymO4gg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6019E6912D; Thu, 8 Jan 2026 18:54:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 8 Jan 2026 18:53:13 -0700 Message-ID: <20260109015323.3411528-13-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: JTUCNABBBN4IGA4RVZB7NOPGT5IT6JHI X-Message-ID-Hash: JTUCNABBBN4IGA4RVZB7NOPGT5IT6JHI 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 12/16] boot: pxe: Add a pxe_timeout env variable for menu timeout 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 PXE menu timeout is configured in extlinux.conf, but tests need a way to override it to avoid long delays. Add a pxe_timeout environment variable that, when set, overrides the configured timeout value. The test uses pxe_timeout=1 to reduce the menu wait from 5 seconds to 1 second. Ideally the test would be instant, but this is good enough for now. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_utils.c | 5 ++++- test/boot/pxe.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index ba1f7c41512..fbe4a111453 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -929,11 +929,14 @@ static struct menu *pxe_menu_to_menu(struct pxe_menu *cfg) int i = 1; char *default_num = NULL; char *override_num = NULL; + int timeout; + + timeout = env_get_ulong("pxe_timeout", 10, DIV_ROUND_UP(cfg->timeout, 10)); /* * Create a menu and add items for all the labels. */ - m = menu_create(cfg->title, DIV_ROUND_UP(cfg->timeout, 10), + m = menu_create(cfg->title, timeout, cfg->prompt, NULL, label_print, NULL, NULL, NULL); if (!m) return NULL; diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 8c526e1ba59..36e1f5519f4 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -276,6 +276,7 @@ static int pxe_test_sysboot_norun(struct unit_test_state *uts) ut_assertok(env_set_hex("fdt_addr_r", PXE_FDT_ADDR)); ut_assertok(env_set_hex("fdtoverlay_addr_r", PXE_OVERLAY_ADDR)); ut_assertok(env_set("bootfile", cfg_path)); + ut_assertok(env_set("pxe_timeout", "1")); /* * Run sysboot - it will try all labels and return 0 after failing