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/include/ipxe/init.h | 1 + src/include/ipxe/script.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/include/ipxe/script.h (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/init.h b/src/include/ipxe/init.h index 954cda453..19c5925bf 100644 --- a/src/include/ipxe/init.h +++ b/src/include/ipxe/init.h @@ -29,6 +29,7 @@ struct init_fn { #define INIT_SERIAL 02 /**< Serial driver initialisation */ #define INIT_CONSOLE 03 /**< Console initialisation */ #define INIT_NORMAL 04 /**< Normal initialisation */ +#define INIT_LATE 05 /**< Late initialisation */ /** @} */ diff --git a/src/include/ipxe/script.h b/src/include/ipxe/script.h new file mode 100644 index 000000000..33420dae4 --- /dev/null +++ b/src/include/ipxe/script.h @@ -0,0 +1,16 @@ +#ifndef _IPXE_SCRIPT_H +#define _IPXE_SCRIPT_H + +/** @file + * + * iPXE scripts + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include + +extern struct image_type script_image_type __image_type ( PROBE_NORMAL ); + +#endif /* _IPXE_SCRIPT_H */ -- cgit v1.2.3-55-g7522