Blame SOURCES/ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch

57753c
From 941332209d767a090b8003047fbb798bf8f193d4 Mon Sep 17 00:00:00 2001
57753c
From: Alex Williamson <alex.williamson@redhat.com>
57753c
Date: Tue, 4 Mar 2014 15:42:24 +0100
57753c
Subject: [PATCH 6/7] Allow ROM banner timeout to be configured independently
57753c
57753c
RH-Author: Alex Williamson <alex.williamson@redhat.com>
57753c
Message-id: <20140304154224.6292.81292.stgit@bling.home>
57753c
Patchwork-id: 58010
57753c
O-Subject: [RHEL7 ipxe PATCH v2 2/3] [romprefix] Allow ROM banner timeout to be configured independently
57753c
Bugzilla: 857123
57753c
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
57753c
RH-Acked-by: Vlad Yasevich <vyasevic@redhat.com>
57753c
RH-Acked-by: Richard Jones <rjones@redhat.com>
57753c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
57753c
57753c
Bugzilla: 857123
57753c
Upstream: 27d1b40ee961d0910576a094a71dea1211254776
57753c
57753c
iPXE currently prints a "Press Ctrl-B" banner twice: once when the ROM
57753c
is first called for initialisation and again if we attempt to boot
57753c
from the ROM.  This slows boot, especially when the NIC is not the
57753c
primary boot device.  Tools such as libguestfs make use of QEMU VMs
57753c
for performing maintenance on disk images and may make use of NICs in
57753c
the VM for network support.  If iPXE introduces a static init-time
57753c
delay, that directly translates to increased runtime for the tools.
57753c
57753c
Fix by allowing the ROM banner timeout to be configured independently
57753c
of the main banner timeout.
57753c
57753c
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
57753c
Modified-by: Michael Brown <mcb30@ipxe.org>
57753c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
57753c
---
57753c
 src/arch/i386/prefix/romprefix.S |   10 +++-------
57753c
 src/config/general.h             |   19 +++++++++++++++----
57753c
 2 files changed, 18 insertions(+), 11 deletions(-)
57753c
57753c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
57753c
---
57753c
 src/arch/i386/prefix/romprefix.S |   10 +++-------
57753c
 src/config/general.h             |   17 ++++++++++++++---
57753c
 2 files changed, 17 insertions(+), 10 deletions(-)
57753c
57753c
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
57753c
index c75b9b9..d606006 100644
57753c
--- a/src/arch/i386/prefix/romprefix.S
57753c
+++ b/src/arch/i386/prefix/romprefix.S
57753c
@@ -25,12 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
57753c
 	( PMM_HANDLE_BASE | 0x00002000 )
57753c
 #define PCI_FUNC_MASK 0x07
57753c
 
57753c
-/* ROM banner timeout.  Based on the configurable BANNER_TIMEOUT in
57753c
- * config.h, but converted to a number of (18Hz) timer ticks, and
57753c
- * doubled to allow for BIOSes that switch video modes immediately
57753c
- * beforehand, so rendering the message almost invisible to the user.
57753c
- */
57753c
-#define ROM_BANNER_TIMEOUT ( 2 * ( 18 * BANNER_TIMEOUT ) / 10 )
57753c
+/* ROM banner timeout, converted to a number of (18Hz) timer ticks. */
57753c
+#define ROM_BANNER_TIMEOUT_TICKS ( ( 18 * ROM_BANNER_TIMEOUT ) / 10 )
57753c
 
57753c
 /* Allow payload to be excluded from ROM size
57753c
  */
57753c
@@ -801,7 +797,7 @@ wait_for_key:
57753c
 	int	$0x16
57753c
 	jmp	1b
57753c
 2:	/* Wait for a key press */
57753c
-	movw	$ROM_BANNER_TIMEOUT, %cx
57753c
+	movw	$ROM_BANNER_TIMEOUT_TICKS, %cx
57753c
 3:	decw	%cx
57753c
 	js	99f		/* Exit with ZF clear */
57753c
 	/* Wait for timer tick to be updated */
57753c
diff --git a/src/config/general.h b/src/config/general.h
57753c
index 9f0bb52..c5c8ea7 100644
57753c
--- a/src/config/general.h
57753c
+++ b/src/config/general.h
57753c
@@ -28,11 +28,22 @@ FILE_LICENCE ( GPL2_OR_LATER );
57753c
 #define PRODUCT_SHORT_NAME "iPXE"
57753c
 
57753c
 /*
57753c
- * Timer configuration
57753c
- *
57753c
+ * Banner timeout configuration
57753c
+ *
57753c
+ * This controls the timeout for the "Press Ctrl-B for the iPXE
57753c
+ * command line" banner displayed when iPXE starts up.  The value is
57753c
+ * specified in tenths of a second for which the banner should appear.
57753c
+ * A value of 0 disables the banner.
57753c
+ *
57753c
+ * ROM_BANNER_TIMEOUT controls the "Press Ctrl-B to configure iPXE"
57753c
+ * banner displayed only by ROM builds of iPXE during POST.  This
57753c
+ * defaults to being twice the length of BANNER_TIMEOUT, to allow for
57753c
+ * BIOSes that switch video modes immediately before calling the
57753c
+ * initialisation vector, thus rendering the banner almost invisible
57753c
+ * to the user.
57753c
  */
57753c
-#define BANNER_TIMEOUT	20	/* Tenths of a second for which the shell
57753c
-				   banner should appear */
57753c
+#define BANNER_TIMEOUT		20
57753c
+#define ROM_BANNER_TIMEOUT	( 2 * BANNER_TIMEOUT )
57753c
 
57753c
 /*
57753c
  * Network protocols
57753c
-- 
57753c
1.7.1
57753c