[ipxe-devel] [PATCH v2] ipxe: Allow config option to disable banner at ROM init
Alex Williamson
alex.williamson at redhat.com
Tue Feb 25 23:33:08 UTC 2014
iPXE currently prints the "Press Ctrl-B to configure" banner twice,
once when the ROM is first called for initialization and again when we
attempt to boot from the ROM. The problem this introduces is that it
slows boot, especially when the NIC is not the primary boot device.
Tools like libguestfs make use of QEMU VMs for performing maintenance
on disk images and may make use of NICs in the VM for network support.
If iPXE introduces a static init-time delay, that directly translates
to increased runtime for the tools. We do however still want to allow
iPXE interaction at the point where we try to boot from the NIC. This
change allows downstream distributions to modify or disable either
timeout for their particular needs.
Signed-off-by: Alex Williamson <alex.williamson at redhat.com>
---
v2: Allow independent configuration of each banner timeout.
Michael, if I haven't captured your suggestion from IRC, feel free
to tweak to your liking or I can give it another shot. Thanks.
src/arch/i386/prefix/romprefix.S | 6 +++---
src/config/general.h | 11 ++++++++---
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
index 091673d..b9636d2 100644
--- a/src/arch/i386/prefix/romprefix.S
+++ b/src/arch/i386/prefix/romprefix.S
@@ -25,12 +25,12 @@ FILE_LICENCE ( GPL2_OR_LATER )
( PMM_HANDLE_BASE | 0x00002000 )
#define PCI_FUNC_MASK 0x07
-/* ROM banner timeout. Based on the configurable BANNER_TIMEOUT in
+/* ROM banner timeout. Based on the configurable ROM_BANNER_TIMEOUT in
* config.h, but converted to a number of (18Hz) timer ticks, and
* doubled to allow for BIOSes that switch video modes immediately
* beforehand, so rendering the message almost invisible to the user.
*/
-#define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
+#define __ROM_BANNER_TIMEOUT ( 2 * ( 18 * ROM_BANNER_TIMEOUT ) / 10 )
/* Allow payload to be excluded from ROM size
*/
@@ -791,7 +791,7 @@ wait_for_key:
int $0x16
jmp 1b
2: /* Wait for a key press */
- movw $ROM_BANNER_TIMEOUT, %cx
+ movw $__ROM_BANNER_TIMEOUT, %cx
3: decw %cx
js 99f /* Exit with ZF clear */
/* Wait for timer tick to be updated */
diff --git a/src/config/general.h b/src/config/general.h
index 0b45edf..1024aa0 100644
--- a/src/config/general.h
+++ b/src/config/general.h
@@ -28,11 +28,16 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define PRODUCT_SHORT_NAME "iPXE"
/*
- * Timer configuration
+ * Banner timeout configuration
*
+ * This controls the timeout for the "Press Ctrl-B" prompt. The value is
+ * specified in tenths of a second for which the shell banner should appear.
+ * A value of 0 disables the banner. ROM_BANNER_TIMEOUT controls the early
+ * initialization vector prompt while BANNER_TIMEOUT is used from the main
+ * iPXE execution. These are the same by default.
*/
-#define BANNER_TIMEOUT 20 /* Tenths of a second for which the shell
- banner should appear */
+#define BANNER_TIMEOUT 20
+#define ROM_BANNER_TIMEOUT BANNER_TIMEOUT
/*
* Network protocols
More information about the ipxe-devel
mailing list