summaryrefslogtreecommitdiffstats
path: root/src/usr/pxemenu.c
diff options
context:
space:
mode:
authorMichael Brown2011-01-27 19:48:47 +0100
committerMichael Brown2011-01-27 21:41:27 +0100
commite088892a81e428aa4982b1c97001a1196d91acb7 (patch)
tree252e2ca31404c299be9808869f3b6e8ec96114bf /src/usr/pxemenu.c
parent[init] Remove concept of "shutdown exit flags" (diff)
downloadipxe-e088892a81e428aa4982b1c97001a1196d91acb7.tar.gz
ipxe-e088892a81e428aa4982b1c97001a1196d91acb7.tar.xz
ipxe-e088892a81e428aa4982b1c97001a1196d91acb7.zip
[autoboot] Connect SAN disk during a filename boot, if applicable
For performing installations direct to a SAN target, it can be very useful to hook a SAN disk and then proceed to perform a filename boot. For example, the user may wish to hook the (empty) SAN installation disk and then boot into the OS installer via TFTP. This provides an alternative mechanism to using "keep-san" and relying on the BIOS to fall through to boot from the installation media, which is unreliable on many BIOSes. When a root-path is specified in addition to a boot filename, attempt to hook the root-path as a SAN disk before booting from the specified filename. Since the root-path may be used for non-SAN purposes (e.g. an NFS root mount point), ignore the root-path if it contains a URI scheme that we do not support. Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr/pxemenu.c')
-rw-r--r--src/usr/pxemenu.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c
index bbd7670c..a9ea1f04 100644
--- a/src/usr/pxemenu.c
+++ b/src/usr/pxemenu.c
@@ -31,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/keys.h>
#include <ipxe/timer.h>
#include <ipxe/process.h>
+#include <ipxe/uri.h>
#include <usr/dhcpmgmt.h>
#include <usr/autoboot.h>
@@ -346,8 +347,7 @@ int pxe_menu_boot ( struct net_device *netdev ) {
struct pxe_menu *menu;
unsigned int pxe_type;
struct settings *pxebs_settings;
- struct in_addr next_server;
- char filename[256];
+ struct uri *uri;
int rc;
/* Parse and allocate boot menu */
@@ -372,12 +372,15 @@ int pxe_menu_boot ( struct net_device *netdev ) {
if ( ( rc = pxebs ( netdev, pxe_type ) ) != 0 )
return rc;
- /* Attempt boot */
+ /* Fetch next server and filename */
pxebs_settings = find_settings ( PXEBS_SETTINGS_NAME );
assert ( pxebs_settings );
- fetch_ipv4_setting ( pxebs_settings, &next_server_setting,
- &next_server );
- fetch_string_setting ( pxebs_settings, &filename_setting,
- filename, sizeof ( filename ) );
- return boot_next_server_and_filename ( next_server, filename );
+ uri = fetch_next_server_and_filename ( pxebs_settings );
+ if ( ! uri )
+ return -ENOMEM;
+
+ /* Attempt boot */
+ rc = uriboot ( uri, NULL );
+ uri_put ( uri );
+ return rc;
}