From b2332d511807b87bd71cf73acaaf48e671d71c9d Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 7 Mar 2011 22:02:07 +0000 Subject: [prefix] Allow iPXE's own command line to be executed as a script Some prefixes (e.g. .lkrn) allow a command line to be passed in to iPXE. At present, this command line is ignored. If a command line is provided, treat it as an embedded script (without an explicit "#!ipxe" magic marker). This allows for patterns of invocation such as title iPXE kernel /boot/ipxe.lkrn dhcp && \ sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage Here GRUB is instructed to load ipxe.lkrn with an embedded script equivalent to #!ipxe dhcp sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage This can be used to effectively vary the embedded script without having to rebuild ipxe.lkrn. Originally-implemented-by: Dave Hansen Signed-off-by: Michael Brown --- src/image/embedded.c | 2 +- src/image/script.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/image') diff --git a/src/image/embedded.c b/src/image/embedded.c index 2ddccfed..6358378f 100644 --- a/src/image/embedded.c +++ b/src/image/embedded.c @@ -86,6 +86,6 @@ static void embedded_init ( void ) { } /** Embedded image initialisation function */ -struct init_fn embedded_init_fn __init_fn ( INIT_NORMAL ) = { +struct init_fn embedded_init_fn __init_fn ( INIT_LATE ) = { .initialise = embedded_init, }; diff --git a/src/image/script.c b/src/image/script.c index b819693d..572eac71 100644 --- a/src/image/script.c +++ b/src/image/script.c @@ -36,6 +36,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include /** Currently running script * -- cgit v1.2.3-55-g7522