[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:
Michael Brown
2009-02-24 05:51:21 +00:00
parent 43834f5d25
commit 4f3bab1a55
6 changed files with 32 additions and 20 deletions

View File

@@ -222,13 +222,13 @@ static int kernel_exec ( int argc, char **argv ) {
}
/**
* The "imgauto" command
* The "chain" command
*
* @v argc Argument count
* @v argv Argument list
* @ret rc Exit code
*/
static int imgauto_exec ( int argc, char **argv) {
static int chain_exec ( int argc, char **argv) {
int rc;
if ( ( rc = imgfetch_core_exec ( NULL, IMG_EXEC, argc, argv ) ) != 0 )
@@ -563,8 +563,8 @@ struct command image_commands[] __command = {
.exec = kernel_exec,
},
{
.name = "imgauto",
.exec = imgauto_exec,
.name = "chain",
.exec = chain_exec,
},
{
.name = "imgload",