diff --git a/SOURCES/ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch b/SOURCES/ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch new file mode 100644 index 0000000..ac155ac --- /dev/null +++ b/SOURCES/ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch @@ -0,0 +1,105 @@ +From 941332209d767a090b8003047fbb798bf8f193d4 Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Tue, 4 Mar 2014 15:42:24 +0100 +Subject: [PATCH 6/7] Allow ROM banner timeout to be configured independently + +RH-Author: Alex Williamson +Message-id: <20140304154224.6292.81292.stgit@bling.home> +Patchwork-id: 58010 +O-Subject: [RHEL7 ipxe PATCH v2 2/3] [romprefix] Allow ROM banner timeout to be configured independently +Bugzilla: 857123 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Richard Jones +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 857123 +Upstream: 27d1b40ee961d0910576a094a71dea1211254776 + +iPXE currently prints a "Press Ctrl-B" banner twice: once when the ROM +is first called for initialisation and again if we attempt to boot +from the ROM. This slows boot, especially when the NIC is not the +primary boot device. Tools such as 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. + +Fix by allowing the ROM banner timeout to be configured independently +of the main banner timeout. + +Signed-off-by: Alex Williamson +Modified-by: Michael Brown +Signed-off-by: Michael Brown +--- + src/arch/i386/prefix/romprefix.S | 10 +++------- + src/config/general.h | 19 +++++++++++++++---- + 2 files changed, 18 insertions(+), 11 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + src/arch/i386/prefix/romprefix.S | 10 +++------- + src/config/general.h | 17 ++++++++++++++--- + 2 files changed, 17 insertions(+), 10 deletions(-) + +diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S +index c75b9b9..d606006 100644 +--- a/src/arch/i386/prefix/romprefix.S ++++ b/src/arch/i386/prefix/romprefix.S +@@ -25,12 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER ) + ( PMM_HANDLE_BASE | 0x00002000 ) + #define PCI_FUNC_MASK 0x07 + +-/* ROM banner timeout. Based on the configurable 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 ) ++/* ROM banner timeout, converted to a number of (18Hz) timer ticks. */ ++#define ROM_BANNER_TIMEOUT_TICKS ( ( 18 * ROM_BANNER_TIMEOUT ) / 10 ) + + /* Allow payload to be excluded from ROM size + */ +@@ -801,7 +797,7 @@ wait_for_key: + int $0x16 + jmp 1b + 2: /* Wait for a key press */ +- movw $ROM_BANNER_TIMEOUT, %cx ++ movw $ROM_BANNER_TIMEOUT_TICKS, %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 9f0bb52..c5c8ea7 100644 +--- a/src/config/general.h ++++ b/src/config/general.h +@@ -28,11 +28,22 @@ FILE_LICENCE ( GPL2_OR_LATER ); + #define PRODUCT_SHORT_NAME "iPXE" + + /* +- * Timer configuration +- * ++ * Banner timeout configuration ++ * ++ * This controls the timeout for the "Press Ctrl-B for the iPXE ++ * command line" banner displayed when iPXE starts up. The value is ++ * specified in tenths of a second for which the banner should appear. ++ * A value of 0 disables the banner. ++ * ++ * ROM_BANNER_TIMEOUT controls the "Press Ctrl-B to configure iPXE" ++ * banner displayed only by ROM builds of iPXE during POST. This ++ * defaults to being twice the length of BANNER_TIMEOUT, to allow for ++ * BIOSes that switch video modes immediately before calling the ++ * initialisation vector, thus rendering the banner almost invisible ++ * to the user. + */ +-#define BANNER_TIMEOUT 20 /* Tenths of a second for which the shell +- banner should appear */ ++#define BANNER_TIMEOUT 20 ++#define ROM_BANNER_TIMEOUT ( 2 * BANNER_TIMEOUT ) + + /* + * Network protocols +-- +1.7.1 + diff --git a/SOURCES/ipxe-Allow-prefix-to-specify-a-PCI-autoboot-device-locati.patch b/SOURCES/ipxe-Allow-prefix-to-specify-a-PCI-autoboot-device-locati.patch new file mode 100644 index 0000000..c393773 --- /dev/null +++ b/SOURCES/ipxe-Allow-prefix-to-specify-a-PCI-autoboot-device-locati.patch @@ -0,0 +1,85 @@ +From 8eaadd87cfe66d11e587c5470fc82472315cc20d Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Mon, 3 Mar 2014 18:47:03 +0100 +Subject: [PATCH 2/7] Allow prefix to specify a PCI autoboot device location + +RH-Author: Alex Williamson +Message-id: <20140303184703.19235.50926.stgit@bling.home> +Patchwork-id: 57977 +O-Subject: [RHEL7 ipxe PATCH 2/4] [prefix] Allow prefix to specify a PCI autoboot device location +Bugzilla: 1031518 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 1031518 +Upstream: 90fc273b2b099df4a2c2ca06e1eaa7508e9734be + +Signed-off-by: Alex Williamson +Modified-by: Michael Brown +Signed-off-by: Michael Brown +--- + src/arch/i386/core/pci_autoboot.c | 44 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + create mode 100644 src/arch/i386/core/pci_autoboot.c + +Signed-off-by: Miroslav Rezanina +--- + src/arch/i386/core/pci_autoboot.c | 44 +++++++++++++++++++++++++++++++++++++ + 1 files changed, 44 insertions(+), 0 deletions(-) + create mode 100644 src/arch/i386/core/pci_autoboot.c + +diff --git a/src/arch/i386/core/pci_autoboot.c b/src/arch/i386/core/pci_autoboot.c +new file mode 100644 +index 0000000..bbb4027 +--- /dev/null ++++ b/src/arch/i386/core/pci_autoboot.c +@@ -0,0 +1,44 @@ ++/* ++ * Copyright (C) 2014 Red Hat Inc. ++ * Alex Williamson ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ * 02110-1301, USA. ++ */ ++ ++FILE_LICENCE ( GPL2_OR_LATER ); ++ ++#include ++#include ++#include ++#include ++#include ++ ++uint16_t __bss16 ( autoboot_busdevfn ); ++#define autoboot_busdevfn __use_data16 ( autoboot_busdevfn ) ++ ++/** ++ * Initialise PCI autoboot device ++ */ ++static void pci_autoboot_init ( void ) { ++ ++ autoboot_device.bus_type = BUS_TYPE_PCI; ++ autoboot_device.location = autoboot_busdevfn; ++} ++ ++/** PCI autoboot device initialisation function */ ++struct init_fn pci_autoboot_init_fn __init_fn ( INIT_NORMAL ) = { ++ .initialise = pci_autoboot_init, ++}; +-- +1.7.1 + diff --git a/SOURCES/ipxe-Customize-ROM-banner-timeout.patch b/SOURCES/ipxe-Customize-ROM-banner-timeout.patch new file mode 100644 index 0000000..596df7b --- /dev/null +++ b/SOURCES/ipxe-Customize-ROM-banner-timeout.patch @@ -0,0 +1,47 @@ +From e53b49d7d8d1b17b1326e37e6e3674e0ceae0cf9 Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Tue, 4 Mar 2014 15:42:30 +0100 +Subject: [PATCH 7/7] Customize ROM banner timeout + +RH-Author: Alex Williamson +Message-id: <20140304154230.6292.69267.stgit@bling.home> +Patchwork-id: 58011 +O-Subject: [RHEL7 ipxe PATCH v2 3/3] [rhel7] Customize ROM banner timeout +Bugzilla: 857123 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Richard Jones +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 857123 +Upstream: N/A (downstream customization) + +Users want some opportunity to interact with the iPXE shell, but +tools like libguestfs want to boot as quickly as possible. Create +a compromise by disabling the interactive banner prompt during ROM +initialization, but retaining it when we actually attempt to boot +from the device. + +Signed-off-by: Alex Williamson +--- + src/config/local/general.h | 2 ++ + 1 file changed, 2 insertions(+) + create mode 100644 src/config/local/general.h + +Signed-off-by: Miroslav Rezanina +--- + src/config/local/general.h | 2 ++ + 1 files changed, 2 insertions(+), 0 deletions(-) + create mode 100644 src/config/local/general.h + +diff --git a/src/config/local/general.h b/src/config/local/general.h +new file mode 100644 +index 0000000..349d435 +--- /dev/null ++++ b/src/config/local/general.h +@@ -0,0 +1,2 @@ ++#undef ROM_BANNER_TIMEOUT ++#define ROM_BANNER_TIMEOUT 0 +-- +1.7.1 + diff --git a/SOURCES/ipxe-Enable-infrastructure-to-specify-an-autoboot-device-.patch b/SOURCES/ipxe-Enable-infrastructure-to-specify-an-autoboot-device-.patch new file mode 100644 index 0000000..8c67d46 --- /dev/null +++ b/SOURCES/ipxe-Enable-infrastructure-to-specify-an-autoboot-device-.patch @@ -0,0 +1,149 @@ +From 13a929c026fe7346be3c9342f10169eab6958015 Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Mon, 3 Mar 2014 18:46:57 +0100 +Subject: [PATCH 1/7] Enable infrastructure to specify an autoboot device location + +RH-Author: Alex Williamson +Message-id: <20140303184657.19235.97871.stgit@bling.home> +Patchwork-id: 57976 +O-Subject: [RHEL7 ipxe PATCH 1/4] [autoboot] Enable infrastructure to specify an autoboot device location +Bugzilla: 1031518 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 1031518 +Upstream: 123bae9d939235a62e67d0cbfc66f3277bd81844 + +iPXE will currently attempt to boot from every network device for +which it has a driver. Where a system has more than one network +device supported by iPXE, this renders BIOS IPL lists ineffective. + +Allow an autoboot device location to be specified. If such a location +is specified, then only devices matching that location will be used as +part of the automatic boot sequence. If no such location is +specified, then all devices will be used. + +Note that this does not affect the "autoboot" command, which will +continue to use all devices. + +Signed-off-by: Alex Williamson +Modified-by: Michael Brown +Signed-off-by: Michael Brown +--- + src/include/usr/autoboot.h | 4 +++- + src/usr/autoboot.c | 43 ++++++++++++++++++++++++++----------------- + 2 files changed, 29 insertions(+), 18 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + src/include/usr/autoboot.h | 4 +++- + src/usr/autoboot.c | 43 ++++++++++++++++++++++++++----------------- + 2 files changed, 29 insertions(+), 18 deletions(-) + +diff --git a/src/include/usr/autoboot.h b/src/include/usr/autoboot.h +index cfa4c41..f562b2b 100644 +--- a/src/include/usr/autoboot.h ++++ b/src/include/usr/autoboot.h +@@ -10,6 +10,7 @@ + FILE_LICENCE ( GPL2_OR_LATER ); + + #include ++#include + struct net_device; + struct uri; + struct settings; +@@ -25,12 +26,13 @@ enum uriboot_flags { + URIBOOT_NO_SAN_BOOT | \ + URIBOOT_NO_SAN_UNHOOK ) + ++extern struct device_description autoboot_device; ++ + extern int uriboot ( struct uri *filename, struct uri *root_path, int drive, + unsigned int flags ); + extern struct uri * + fetch_next_server_and_filename ( struct settings *settings ); + extern int netboot ( struct net_device *netdev ); +-extern int autoboot ( void ); + extern void ipxe ( struct net_device *netdev ); + + extern int pxe_menu_boot ( struct net_device *netdev ); +diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c +index 70f883a..07157cf 100644 +--- a/src/usr/autoboot.c ++++ b/src/usr/autoboot.c +@@ -49,6 +49,9 @@ FILE_LICENCE ( GPL2_OR_LATER ); + * + */ + ++/** Device location of preferred autoboot device */ ++struct device_description autoboot_device; ++ + /* Disambiguate the various error causes */ + #define ENOENT_BOOT __einfo_error ( EINFO_ENOENT_BOOT ) + #define EINFO_ENOENT_BOOT \ +@@ -74,15 +77,6 @@ __weak int pxe_menu_boot ( struct net_device *netdev __unused ) { + } + + /** +- * Identify the boot network device +- * +- * @ret netdev Boot network device +- */ +-static struct net_device * find_boot_netdev ( void ) { +- return NULL; +-} +- +-/** + * Parse next-server and filename into a URI + * + * @v next_server Next-server address +@@ -432,21 +426,36 @@ int netboot ( struct net_device *netdev ) { + } + + /** ++ * Test if network device matches the autoboot device location ++ * ++ * @v netdev Network device ++ * @ret is_autoboot Network device matches the autoboot device location ++ */ ++static int is_autoboot_device ( struct net_device *netdev ) { ++ ++ return ( ( netdev->dev->desc.bus_type == autoboot_device.bus_type ) && ++ ( netdev->dev->desc.location == autoboot_device.location ) ); ++} ++ ++/** + * Boot the system + */ +-int autoboot ( void ) { +- struct net_device *boot_netdev; ++static int autoboot ( void ) { + struct net_device *netdev; + int rc = -ENODEV; + +- /* If we have an identifable boot device, try that first */ +- if ( ( boot_netdev = find_boot_netdev() ) ) +- rc = netboot ( boot_netdev ); +- +- /* If that fails, try booting from any of the other devices */ ++ /* Try booting from each network device. If we have a ++ * specified autoboot device location, then use only devices ++ * matching that location. ++ */ + for_each_netdev ( netdev ) { +- if ( netdev == boot_netdev ) ++ ++ /* Skip any non-matching devices, if applicable */ ++ if ( autoboot_device.bus_type && ++ ( ! is_autoboot_device ( netdev ) ) ) + continue; ++ ++ /* Attempt booting from this device */ + rc = netboot ( netdev ); + } + +-- +1.7.1 + diff --git a/SOURCES/ipxe-Ignore-PCI-autoboot-device-location-if-set-to-00-00..patch b/SOURCES/ipxe-Ignore-PCI-autoboot-device-location-if-set-to-00-00..patch new file mode 100644 index 0000000..e955b7e --- /dev/null +++ b/SOURCES/ipxe-Ignore-PCI-autoboot-device-location-if-set-to-00-00..patch @@ -0,0 +1,60 @@ +From 41604531cac69c5591316df32a45bc102effc2c3 Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Mon, 3 Mar 2014 18:47:15 +0100 +Subject: [PATCH 4/7] Ignore PCI autoboot device location if set to 00:00.0 + +RH-Author: Alex Williamson +Message-id: <20140303184715.19235.4758.stgit@bling.home> +Patchwork-id: 57979 +O-Subject: [RHEL7 ipxe PATCH 4/4] [prefix] Ignore PCI autoboot device location if set to 00:00.0 +Bugzilla: 1031518 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Stefan Hajnoczi + +From: Michael Brown + +Bugzilla: 1031518 +Upstream: ff1e7fc72b138fe66de1452a311b7e871f33e201 + +qemu can load an option ROM which is not associated with a particular +PCI device using the "-option-rom" syntax. Under these circumstances, +we should ignore the PCI bus:dev.fn address that we expect to find in +%ax on entry to the initialisation vector. + +Fix by using the PCI bus:dev.fn address only if it is non-zero. Since +00:00.0 will always be the host bridge, it can never be the address of +a network card. + +Reported-by: Alex Williamson +Signed-off-by: Michael Brown +--- + src/arch/i386/core/pci_autoboot.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + src/arch/i386/core/pci_autoboot.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/arch/i386/core/pci_autoboot.c b/src/arch/i386/core/pci_autoboot.c +index bbb4027..5e6197e 100644 +--- a/src/arch/i386/core/pci_autoboot.c ++++ b/src/arch/i386/core/pci_autoboot.c +@@ -34,8 +34,10 @@ uint16_t __bss16 ( autoboot_busdevfn ); + */ + static void pci_autoboot_init ( void ) { + +- autoboot_device.bus_type = BUS_TYPE_PCI; +- autoboot_device.location = autoboot_busdevfn; ++ if ( autoboot_busdevfn ) { ++ autoboot_device.bus_type = BUS_TYPE_PCI; ++ autoboot_device.location = autoboot_busdevfn; ++ } + } + + /** PCI autoboot device initialisation function */ +-- +1.7.1 + diff --git a/SOURCES/ipxe-Revert-Remove-2-second-startup-wait.patch b/SOURCES/ipxe-Revert-Remove-2-second-startup-wait.patch new file mode 100644 index 0000000..9e036dc --- /dev/null +++ b/SOURCES/ipxe-Revert-Remove-2-second-startup-wait.patch @@ -0,0 +1,51 @@ +From 8113d9275f87a5b962cc6e83060577ed36e4c7ca Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Tue, 4 Mar 2014 15:42:18 +0100 +Subject: [PATCH 5/7] Revert: Remove 2 second startup wait. + +RH-Author: Alex Williamson +Message-id: <20140304154218.6292.69336.stgit@bling.home> +Patchwork-id: 58009 +O-Subject: [RHEL7 ipxe PATCH v2 1/3] [rhel7] Revert: Remove 2 second startup wait. +Bugzilla: 857123 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Richard Jones +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 857123 +Upstream: N/A (downstream customization) + +This reverts RHEL7 bd2e0975ef2213375bf97bcf2b39552e8a1a591a + +Downstream customized the banner timeout to remove it entirely, +allowing users no opportunity for interaction with the iPXE shell. +Remove this in preparation for removing only the banner displayed +during ROM init and keeping the banner displayed prior to autoboot. + +Signed-off-by: Alex Williamson +--- + src/config/general.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Signed-off-by: Miroslav Rezanina +--- + src/config/general.h | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/config/general.h b/src/config/general.h +index c497ed3..9f0bb52 100644 +--- a/src/config/general.h ++++ b/src/config/general.h +@@ -31,7 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); + * Timer configuration + * + */ +-#define BANNER_TIMEOUT 0 /* Tenths of a second for which the shell ++#define BANNER_TIMEOUT 20 /* Tenths of a second for which the shell + banner should appear */ + + /* +-- +1.7.1 + diff --git a/SOURCES/ipxe-Store-boot-bus-dev.fn-address-as-autoboot-device-loc.patch b/SOURCES/ipxe-Store-boot-bus-dev.fn-address-as-autoboot-device-loc.patch new file mode 100644 index 0000000..22297d7 --- /dev/null +++ b/SOURCES/ipxe-Store-boot-bus-dev.fn-address-as-autoboot-device-loc.patch @@ -0,0 +1,67 @@ +From b745ae34559366ccc158f5782cfb81eeb054d62f Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Mon, 3 Mar 2014 18:47:09 +0100 +Subject: [PATCH 3/7] Store boot bus:dev.fn address as autoboot device location + +RH-Author: Alex Williamson +Message-id: <20140303184709.19235.66132.stgit@bling.home> +Patchwork-id: 57978 +O-Subject: [RHEL7 ipxe PATCH 3/4] [romprefix] Store boot bus:dev.fn address as autoboot device location +Bugzilla: 1031518 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Stefan Hajnoczi + +Bugzilla: 1031518 +Upstream: c429bf0aa2428e6d12143285b29cbaf6a82f8d84 + +Per the BIOS Boot Specification, the initialization phase of the ROM +is called with the PFA (PCI Function Address) in the %ax register. +The intention is that the ROM code will store that device address +somewhere and use it for booting from that device when the Boot Entry +Vector (BEV) is called. iPXE does store the PFA, but doesn't use it +to select the boot network device. This renders BIOS IPL lists fairly +ineffective. + +Fix by using the BBS-specified bus:dev.fn address as the autoboot +device location. + +Signed-off-by: Alex Williamson +Modified-by: Michael Brown +Signed-off-by: Michael Brown +--- + src/arch/i386/prefix/romprefix.S | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +Signed-off-by: Miroslav Rezanina +--- + src/arch/i386/prefix/romprefix.S | 12 +++++++++++- + 1 files changed, 11 insertions(+), 1 deletions(-) + +diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S +index 091673d..c75b9b9 100644 +--- a/src/arch/i386/prefix/romprefix.S ++++ b/src/arch/i386/prefix/romprefix.S +@@ -742,7 +742,17 @@ exec: /* Set %ds = %cs */ + pushw $1f + lret + .section ".text16", "awx", @progbits +-1: /* Call main() */ ++1: ++ /* Retrieve PCI bus:dev.fn */ ++ movw init_pci_busdevfn, %cx ++ ++ /* Set up %ds for access to .data16 */ ++ movw %bx, %ds ++ ++ /* Store PCI bus:dev.fn */ ++ movw %cx, autoboot_busdevfn ++ ++ /* Call main() */ + pushl $main + pushw %cs + call prot_call +-- +1.7.1 + diff --git a/SOURCES/ipxe-Use-next-server-from-filename-s-settings-block.patch b/SOURCES/ipxe-Use-next-server-from-filename-s-settings-block.patch new file mode 100644 index 0000000..efbe7eb --- /dev/null +++ b/SOURCES/ipxe-Use-next-server-from-filename-s-settings-block.patch @@ -0,0 +1,101 @@ +From b83eff7520225d393dec4d656bc9cab915495a5c Mon Sep 17 00:00:00 2001 +From: Alex Williamson +Date: Fri, 7 Feb 2014 17:21:17 +0100 +Subject: [PATCH] Use next-server from filename's settings block + +RH-Author: Alex Williamson +Message-id: <20140207172042.26907.16755.stgit@bling.home> +Patchwork-id: 57133 +O-Subject: [RHEL7 ipxe PATCH] [autoboot] Use next-server from filename's settings block +Bugzilla: 1062644 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Miroslav Rezanina + +From: Michael Brown + +Bugzilla: 1062644 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=7015017 +Upstream: 936134ed460618e18cc05d677a442d43d5e739a1 + +Locate the settings block containing the filename, and search only +that settings block for the next-server address. This avoids problems +caused by misconfigured DHCP servers which provide a next-server +address (often defaulting to the DHCP server's own IP address) even +when not providing a filename. + +Originally-implemented-by: Alex Williamson +Signed-off-by: Michael Brown +--- + src/usr/autoboot.c | 39 +++++++++++++++++++++++++-------------- + 1 file changed, 25 insertions(+), 14 deletions(-) + +Signed-off-by: Miroslav Rezanina +--- + src/usr/autoboot.c | 39 +++++++++++++++++++++++++-------------- + 1 files changed, 25 insertions(+), 14 deletions(-) + +diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c +index b2d288e..70f883a 100644 +--- a/src/usr/autoboot.c ++++ b/src/usr/autoboot.c +@@ -251,31 +251,42 @@ static void close_all_netdevs ( void ) { + * @ret uri URI, or NULL on failure + */ + struct uri * fetch_next_server_and_filename ( struct settings *settings ) { +- struct in_addr next_server; +- char buf[256]; ++ struct in_addr next_server = { 0 }; ++ char *raw_filename = NULL; ++ struct uri *uri = NULL; + char *filename; +- struct uri *uri; + +- /* Fetch next-server setting */ +- fetch_ipv4_setting ( settings, &next_server_setting, &next_server ); +- if ( next_server.s_addr ) +- printf ( "Next server: %s\n", inet_ntoa ( next_server ) ); ++ /* Determine settings block containing the filename, if any */ ++ settings = fetch_setting_origin ( settings, &filename_setting ); + +- /* Fetch filename setting */ +- fetch_string_setting ( settings, &filename_setting, +- buf, sizeof ( buf ) ); +- if ( buf[0] ) +- printf ( "Filename: %s\n", buf ); ++ /* If we have a filename, fetch it along with next-server */ ++ if ( settings ) { ++ fetch_ipv4_setting ( settings, &next_server_setting, ++ &next_server ); ++ if ( fetch_string_setting_copy ( settings, &filename_setting, ++ &raw_filename ) < 0 ) ++ goto err_fetch; ++ } + + /* Expand filename setting */ +- filename = expand_settings ( buf ); ++ filename = expand_settings ( raw_filename ? raw_filename : "" ); + if ( ! filename ) +- return NULL; ++ goto err_expand; + + /* Parse next server and filename */ ++ if ( next_server.s_addr ) ++ printf ( "Next server: %s\n", inet_ntoa ( next_server ) ); ++ if ( filename[0] ) ++ printf ( "Filename: %s\n", filename ); + uri = parse_next_server_and_filename ( next_server, filename ); ++ if ( ! uri ) ++ goto err_parse; + ++ err_parse: + free ( filename ); ++ err_expand: ++ free ( raw_filename ); ++ err_fetch: + return uri; + } + +-- +1.7.1 + diff --git a/SPECS/ipxe.spec b/SPECS/ipxe.spec index f7de8ea..5187929 100644 --- a/SPECS/ipxe.spec +++ b/SPECS/ipxe.spec @@ -17,7 +17,7 @@ # # We do cross-compilation for 32->64-bit, but not for other arches # because EDK II does not support big-endian hosts. -%global buildarches %{ix86} x86_64 +%global buildarches x86_64 # debugging firmwares does not goes the same way as a normal program. # moreover, all architectures providing debuginfo for a single noarch @@ -39,7 +39,7 @@ Name: ipxe Version: %{date} -Release: 1.git%{hash}%{?dist} +Release: 5.git%{hash}%{?dist} Summary: A network boot loader Group: System Environment/Base @@ -55,6 +55,22 @@ Patch1: %{name}-banner-timeout.patch # GCC >= 4.8 doesn't like the use of 'ebp' in asm # https://bugzilla.redhat.com/show_bug.cgi?id=914091 Patch2: %{name}-asm.patch +# For bz#1062644 - pxe boot fails if next-server details come from a different dhcp server +Patch3: ipxe-Use-next-server-from-filename-s-settings-block.patch +# For bz#1031518 - iPXE does not honor specified boot device +Patch4: ipxe-Enable-infrastructure-to-specify-an-autoboot-device-.patch +# For bz#1031518 - iPXE does not honor specified boot device +Patch5: ipxe-Allow-prefix-to-specify-a-PCI-autoboot-device-locati.patch +# For bz#1031518 - iPXE does not honor specified boot device +Patch6: ipxe-Store-boot-bus-dev.fn-address-as-autoboot-device-loc.patch +# For bz#1031518 - iPXE does not honor specified boot device +Patch7: ipxe-Ignore-PCI-autoboot-device-location-if-set-to-00-00..patch +# For bz#857123 - Guests never get an iPXE prompt +Patch8: ipxe-Revert-Remove-2-second-startup-wait.patch +# For bz#857123 - Guests never get an iPXE prompt +Patch9: ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch +# For bz#857123 - Guests never get an iPXE prompt +Patch10: ipxe-Customize-ROM-banner-timeout.patch %ifarch %{buildarches} BuildRequires: perl @@ -117,6 +133,14 @@ DNS, HTTP, iSCSI, etc. %setup -q -n %{name}-%{version}-git%{hash} %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 cp -a %{SOURCE1} . %build @@ -149,7 +173,9 @@ cp -a undionly.kpxe ipxe.{iso,usb,dsk,lkrn} %{buildroot}/%{_datadir}/%{name}/ for fmt in %{formats};do for img in *.${fmt};do if [ -e $img ]; then - cp -a $img %{buildroot}/%{_datadir}/%{name}/ + cat $img /dev/zero | dd bs=256k count=1 of=$img.tmp iflag=fullblock + install -D -p -m 0644 $img.tmp %{buildroot}/%{_datadir}/%{name}/$img + rm $img.tmp echo %{_datadir}/%{name}/$img >> ../../${fmt}.list fi done @@ -186,6 +212,31 @@ done %endif %changelog +* Wed Mar 05 2014 Miroslav Rezanina - 20130517-5.gitc4bce43.el7 +- ipxe-Enable-infrastructure-to-specify-an-autoboot-device-.patch [bz#1031518] +- ipxe-Allow-prefix-to-specify-a-PCI-autoboot-device-locati.patch [bz#1031518] +- ipxe-Store-boot-bus-dev.fn-address-as-autoboot-device-loc.patch [bz#1031518] +- ipxe-Ignore-PCI-autoboot-device-location-if-set-to-00-00..patch [bz#1031518] +- ipxe-Revert-Remove-2-second-startup-wait.patch [bz#857123] +- ipxe-Allow-ROM-banner-timeout-to-be-configured-independen.patch [bz#857123] +- ipxe-Customize-ROM-banner-timeout.patch [bz#857123] +- Resolves: bz#1031518 + (iPXE does not honor specified boot device) +- Resolves: bz#857123 + (Guests never get an iPXE prompt) + +* Tue Feb 11 2014 Miroslav Rezanina - 20130517-4.gitc4bce43 +- ipxe-Use-next-server-from-filename-s-settings-block.patch [bz#1062644] +- Resolves: bz#1062644 + (pxe boot fails if next-server details come from a different dhcp server) + +* Thu Jan 15 2014 Miroslav Rezanina - 20130517-3.gitc4bce43 +- pad ROMs to 256k (rhbz #1038630) +- Resolves: rhbz# 1038630 + +* Fri Dec 27 2013 Daniel Mach - 20130517-2.gitc4bce43 +- Mass rebuild 2013-12-27 + * Fri May 17 2013 Daniel P. Berrange - 20130517-1.gitc4bce43 - Update to latest upstream snapshot