mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[image] Allow for zero embedded images
Having a default script containing #!gpxe autoboot can cause problems when entering commands to load and start a kernel manually; the default script image will still be present when the kernel is started and so will be treated as an initrd. It is possible to work around this by typing "imgfree" before any other commands, but this is counter-intuitive. Fix by allowing the embedded image list to be empty (in which case we just call autoboot()), and making this the default. Reported by alkisg@gmail.com.
This commit is contained in:
@@ -133,6 +133,15 @@ extern struct list_head images;
|
||||
#define for_each_image( image ) \
|
||||
list_for_each_entry ( (image), &images, list )
|
||||
|
||||
/**
|
||||
* Test for existence of images
|
||||
*
|
||||
* @ret existence Some images exist
|
||||
*/
|
||||
static inline int have_images ( void ) {
|
||||
return ( ! list_empty ( &images ) );
|
||||
}
|
||||
|
||||
extern struct image * alloc_image ( void );
|
||||
extern int image_set_uri ( struct image *image, struct uri *uri );
|
||||
extern int image_set_cmdline ( struct image *image, const char *cmdline );
|
||||
|
||||
Reference in New Issue
Block a user