mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 12:30:20 +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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user