mirror of
https://github.com/ipxe/ipxe
synced 2025-12-30 04:28:12 +03:00
[image] Allow multiple embedded images
This patch extends the embedded image feature to allow multiple embedded images instead of just one. gPXE now always boots the first embedded image on startup instead of doing the hardcoded DHCP boot (aka autoboot). Based heavily upon a patch by Stefan Hajnoczi <stefanha@gmail.com>.
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
#include <gpxe/dhcp.h>
|
||||
#include <gpxe/settings.h>
|
||||
#include <gpxe/image.h>
|
||||
#include <gpxe/embedded.h>
|
||||
#include <gpxe/sanboot.h>
|
||||
#include <gpxe/uri.h>
|
||||
#include <usr/ifmgmt.h>
|
||||
@@ -59,30 +58,6 @@ static struct net_device * find_boot_netdev ( void ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Boot embedded image
|
||||
*
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int boot_embedded_image ( void ) {
|
||||
struct image *image;
|
||||
int rc;
|
||||
|
||||
image = embedded_image();
|
||||
if ( !image )
|
||||
return ENOENT;
|
||||
|
||||
if ( ( rc = imgload ( image ) ) != 0 ) {
|
||||
printf ( "Could not load embedded image: %s\n",
|
||||
strerror ( rc ) );
|
||||
} else if ( ( rc = imgexec ( image ) ) != 0 ) {
|
||||
printf ( "Could not boot embedded image: %s\n",
|
||||
strerror ( rc ) );
|
||||
}
|
||||
image_put ( image );
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Boot using next-server and filename
|
||||
*
|
||||
@@ -196,11 +171,6 @@ static int netboot ( struct net_device *netdev ) {
|
||||
return rc;
|
||||
route();
|
||||
|
||||
/* Try to boot an embedded image if we have one */
|
||||
rc = boot_embedded_image ();
|
||||
if ( rc != ENOENT )
|
||||
return rc;
|
||||
|
||||
/* Try PXE menu boot, if applicable */
|
||||
fetch_string_setting ( NULL, &vendor_class_id_setting,
|
||||
buf, sizeof ( buf ) );
|
||||
|
||||
Reference in New Issue
Block a user