From nobody Mon Sep 16 19:08:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1721410969204742.6744318163072; Fri, 19 Jul 2024 10:42:49 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 74D7FEC957; Fri, 19 Jul 2024 17:42:43 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 54BD0EC819 for ; Fri, 19 Jul 2024 17:42:26 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-318-nLdf6sUIOP2ySqfDUhbtYw-1; Fri, 19 Jul 2024 13:42:23 -0400 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D8E4E1955D44 for ; Fri, 19 Jul 2024 17:42:22 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AAEB21956046 for ; Fri, 19 Jul 2024 17:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721410945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7VC4KdjEmx44SLS8K4JqlS1CA+FtSOenOZsfc1mnTB8=; b=E09zoAcmLzC+wRsXKspqclcqjdkMoLW+NfOIyOYJesVnFIFCRo6N0Ojm3WX6Js1W5HHUJp VyhiErvLgm5DpLFD8tMsS9XAAec665hznjizzxFZNxt3h8b/j4kieUf0KUPmyvjDkg11AH z/y9FQXp+KEuBuhPWJdfaxJVpcew1lQ= X-MC-Unique: nLdf6sUIOP2ySqfDUhbtYw-1 From: Timothy Redaelli To: seabios@seabios.org Date: Fri, 19 Jul 2024 19:42:14 +0200 Message-ID: <09e461b25dc49079cfbd230195ede1a56bf420eb.1721410934.git.tredaelli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: MENPV6DDRLZIKDX6EBTUQ45P4J2FDDUP X-Message-ID-Hash: MENPV6DDRLZIKDX6EBTUQ45P4J2FDDUP X-MailFrom: tredaelli@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH] boot: Add an option to always show boot menu List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: / X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1721410970777116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Always show boot menu when show-boot-menu is set to 3. A good use case for that is when you want to use SeaBIOS as secondary paylo= ad on Coreboot (for example, for GRUB2) and you need it only to boot from USB stick or stuff like that. Signed-off-by: Timothy Redaelli --- docs/Runtime_config.md | 2 +- src/boot.c | 33 ++++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/Runtime_config.md b/docs/Runtime_config.md index 5795382b..89c01f90 100644 --- a/docs/Runtime_config.md +++ b/docs/Runtime_config.md @@ -173,7 +173,7 @@ There are several additional configuration options avai= lable in the =20 | Filename | Description |---------------------|--------------------------------------------------- -| show-boot-menu | Controls the display of the boot menu. Valid value= s are 0: Disable the boot menu, 1: Display boot menu unconditionally, 2: Sk= ip boot menu if only one device is present. The default is 1. +| show-boot-menu | Controls the display of the boot menu. Valid value= s are 0: Disable the boot menu, 1: Display boot menu unconditionally, 2: Sk= ip boot menu if only one device is present, 3: Always display boot menu wit= hout requiring a key press. The default is 1. | boot-menu-message | Customize the text boot menu message. Normally, wh= en in text mode SeaBIOS will report the string "\\nPress ESC for boot menu.= \\n\\n". This field allows the string to be changed. (This is a string fiel= d, and is added as a file containing the raw string.) | boot-menu-key | Controls which key activates the boot menu. The va= lue stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this f= ield is set, be sure to also customize the **boot-menu-message** field abov= e. | boot-menu-wait | Amount of time (in milliseconds) to wait at the bo= ot menu prompt before selecting the default boot. diff --git a/src/boot.c b/src/boot.c index 1effd802..cab41f62 100644 --- a/src/boot.c +++ b/src/boot.c @@ -708,21 +708,24 @@ interactive_bootmenu(void) return; } =20 - while (get_keystroke(0) >=3D 0) - ; - - char *bootmsg =3D romfile_loadfile("etc/boot-menu-message", NULL); - int menukey =3D romfile_loadint("etc/boot-menu-key", 1); - printf("%s", bootmsg ?: "\nPress ESC for boot menu.\n\n"); - free(bootmsg); - - u32 menutime =3D romfile_loadint("etc/boot-menu-wait", DEFAULT_BOOTMEN= U_WAIT); - enable_bootsplash(); - int scan_code =3D get_keystroke(menutime); - disable_bootsplash(); - if (scan_code !=3D menukey) - return; - + int menukey =3D 0, scan_code; + // wait for keypress + if (show_boot_menu !=3D 3) { + while (get_keystroke(0) >=3D 0) + ; + + char *bootmsg =3D romfile_loadfile("etc/boot-menu-message", NULL); + menukey =3D romfile_loadint("etc/boot-menu-key", 1); + printf("%s", bootmsg ?: "\nPress ESC for boot menu.\n\n"); + free(bootmsg); + + u32 menutime =3D romfile_loadint("etc/boot-menu-wait", DEFAULT_BOO= TMENU_WAIT); + enable_bootsplash(); + scan_code =3D get_keystroke(menutime); + disable_bootsplash(); + if (scan_code !=3D menukey) + return; + } while (get_keystroke(0) >=3D 0) ; =20 --=20 2.45.2 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org