diff options
-rw-r--r-- | payloads/external/Makefile.inc | 9 | ||||
-rw-r--r-- | payloads/external/iPXE/Kconfig | 26 | ||||
-rw-r--r-- | payloads/external/iPXE/Makefile | 21 |
3 files changed, 53 insertions, 3 deletions
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc index 5edbb81b18..9c34efabeb 100644 --- a/payloads/external/Makefile.inc +++ b/payloads/external/Makefile.inc @@ -229,7 +229,9 @@ endif ifeq ($(CONFIG_BUILD_IPXE),y) PXE_ROM_FILE:=payloads/external/iPXE/ipxe/ipxe.rom endif - +ifeq ($(CONFIG_PXE_ADD_SCRIPT),y) +PXE_CONFIG_SCRIPT:=$(abspath $(patsubst "%",%,$(CONFIG_PXE_SCRIPT))) +endif ifeq ($(CONFIG_CONSOLE_SERIAL)$(CONFIG_DRIVERS_UART_8250IO),yy) IPXE_UART=COM$(call int-add,$(CONFIG_UART_FOR_CONSOLE) 1) endif @@ -244,7 +246,7 @@ cbfs-files-$(CONFIG_PXE_ROM)$(CONFIG_BUILD_IPXE) += pci$(CONFIG_PXE_ROM_ID).rom pci$(CONFIG_PXE_ROM_ID).rom-file := $(PXE_ROM_FILE) pci$(CONFIG_PXE_ROM_ID).rom-type := raw -payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) +payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) $(PXE_CONFIG_SCRIPT) $(MAKE) -C payloads/external/iPXE all \ CROSS_COMPILE="$(CROSS_COMPILE_$(ARCH-ramstage-y))" \ PXE_ROM_PCI_ID=$(PXE_ROM_PCI_ID) \ @@ -253,6 +255,9 @@ payloads/external/iPXE/ipxe/ipxe.rom ipxe: $(DOTCONFIG) CONSOLE_SERIAL=$(IPXE_SERIAL_CONSOLE) \ IPXE_UART=$(IPXE_UART) \ CONFIG_TTYS0_BAUD=$(CONFIG_TTYS0_BAUD) \ + CONFIG_SCRIPT=$(PXE_CONFIG_SCRIPT) \ + CONFIG_HAS_SCRIPT=$(CONFIG_PXE_ADD_SCRIPT) \ + CONFIG_PXE_NO_PROMT=$(CONFIG_PXE_NO_PROMT) \ MFLAGS= MAKEFLAGS= # LinuxBoot diff --git a/payloads/external/iPXE/Kconfig b/payloads/external/iPXE/Kconfig index f99182c908..7cb0d1e249 100644 --- a/payloads/external/iPXE/Kconfig +++ b/payloads/external/iPXE/Kconfig @@ -87,5 +87,31 @@ config PXE_SERIAL_CONSOLE Unselect to let only SeaBIOS handle printing output. +config PXE_NO_PROMT + bool "Do not show prompt to boot from PXE" + default n + depends on BUILD_IPXE + help + Don't wait for the user to press Ctrl-B. + The PXE still can be run as it shows up in SeaBIOS's payload list. + +config PXE_ADD_SCRIPT + bool "Embed an iPXE script for automated provisioning" + depends on BUILD_IPXE + default n + help + Enable to embed a script that is run instead of an iPXE shell. + +config PXE_SCRIPT + string "Embedded iPXE script path and filename" + depends on PXE_ADD_SCRIPT + default "" + help + Path to a script that is embedded into the iPXE binary. + Example: startup.ipxe + + Uses the ipxe script instead showing the prompt: + "Press Ctrl-B to start iPXE..." + endmenu endif diff --git a/payloads/external/iPXE/Makefile b/payloads/external/iPXE/Makefile index 3a0585fc78..0c071fa13b 100644 --- a/payloads/external/iPXE/Makefile +++ b/payloads/external/iPXE/Makefile @@ -54,15 +54,34 @@ ifeq ($(CONSOLE_SERIAL),yy) sed 's|#define\s*COMCONSOLE.*|#define COMCONSOLE $(IPXE_UART)|' "$(project_dir)/src/config/serial.h" > "$(project_dir)/src/config/serial.h.tmp" sed 's|#define\s*COMSPEED.*|#define COMSPEED $(CONFIG_TTYS0_BAUD)|' "$(project_dir)/src/config/serial.h.tmp" > "$(project_dir)/src/config/serial.h" endif +ifneq ($(filter y,$(CONFIG_HAS_SCRIPT) $(CONFIG_PXE_NO_PROMT)),) + cp "$(project_dir)/src/config/general.h" "$(project_dir)/src/config/general.h.cb" +endif +ifeq ($(CONFIG_HAS_SCRIPT),y) + sed 's|//#define\s*IMAGE_SCRIPT.*|#define IMAGE_SCRIPT|' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp" + mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h" +endif +ifeq ($(CONFIG_PXE_NO_PROMT),y) + sed 's|#define\s*BANNER_TIMEOUT.*|#define BANNER_TIMEOUT 0|' "$(project_dir)/src/config/general.h" > "$(project_dir)/src/config/general.h.tmp" + mv "$(project_dir)/src/config/general.h.tmp" "$(project_dir)/src/config/general.h" +endif -build: config +build: config $(CONFIG_SCRIPT) +ifeq ($(CONFIG_HAS_SCRIPT),y) + echo " MAKE $(project_name) $(TAG-y) EMBED=$(CONFIG_SCRIPT)" + $(MAKE) -C $(project_dir)/src bin/$(PXE_ROM_PCI_ID).rom EMBED=$(CONFIG_SCRIPT) +else echo " MAKE $(project_name) $(TAG-y)" $(MAKE) -C $(project_dir)/src bin/$(PXE_ROM_PCI_ID).rom +endif cp $(project_dir)/src/bin/$(PXE_ROM_PCI_ID).rom $(project_dir)/ipxe.rom ifeq ($(CONSOLE_SERIAL),yy) cp "$(project_dir)/src/config/console.h.cb" "$(project_dir)/src/config/console.h" cp "$(project_dir)/src/config/serial.h.cb" "$(project_dir)/src/config/serial.h" endif +ifneq ($(filter y,$(CONFIG_HAS_SCRIPT) $(CONFIG_PXE_NO_PROMT)),) + cp "$(project_dir)/src/config/general.h.cb" "$(project_dir)/src/config/general.h" +endif clean: test -d $(project_dir) && $(MAKE) -C $(project_dir)/src veryclean || exit 0 |