diff options
| author | Michael Brown | 2009-02-24 06:51:21 +0100 |
|---|---|---|
| committer | Michael Brown | 2009-02-24 06:57:56 +0100 |
| commit | 4f3bab1a55359a2623e098a6ed61e8d82145af77 (patch) | |
| tree | 9f12c983dd2846d5b5f2d0598d928db9add7c51b /src/include | |
| parent | [image] Added "chain" command to fetch, load, and execute image (diff) | |
| download | ipxe-4f3bab1a55359a2623e098a6ed61e8d82145af77.tar.gz ipxe-4f3bab1a55359a2623e098a6ed61e8d82145af77.tar.xz ipxe-4f3bab1a55359a2623e098a6ed61e8d82145af77.zip | |
[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.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/image.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/gpxe/image.h b/src/include/gpxe/image.h index f8b1482ee..b953e1509 100644 --- a/src/include/gpxe/image.h +++ b/src/include/gpxe/image.h @@ -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 ); |
