diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-05-21 13:32:11 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-06-24 12:52:49 +0800 |
commit | b3539f1cf27f0cd1ddf26ec92d9ea4e6c0df7ea5 (patch) | |
tree | 0890598527cf759968cee8d364319029f2d03285 /discover/boot.c | |
parent | 658d9e98eec02f92e3cf263a1bb27beb3d395b2f (diff) | |
download | petitboot-b3539f1cf27f0cd1ddf26ec92d9ea4e6c0df7ea5.zip petitboot-b3539f1cf27f0cd1ddf26ec92d9ea4e6c0df7ea5.tar.gz |
discover/boot: Allow null boot command
If we're booting from a default option, we don't have a boot command.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/boot.c')
-rw-r--r-- | discover/boot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/discover/boot.c b/discover/boot.c index 29aefa9..5ca69b9 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -140,7 +140,7 @@ int boot(void *ctx, struct discover_boot_option *opt, struct boot_command *cmd, initrd = NULL; args = NULL; - if (cmd->boot_image_file) { + if (cmd && cmd->boot_image_file) { image = pb_url_parse(opt, cmd->boot_image_file); } else if (opt && opt->boot_image) { image = opt->boot_image->url; @@ -149,13 +149,13 @@ int boot(void *ctx, struct discover_boot_option *opt, struct boot_command *cmd, return -1; } - if (cmd->initrd_file) { + if (cmd && cmd->initrd_file) { initrd = pb_url_parse(opt, cmd->initrd_file); } else if (opt && opt->initrd) { initrd = opt->initrd->url; } - if (cmd->boot_args) { + if (cmd && cmd->boot_args) { args = talloc_strdup(ctx, cmd->boot_args); } else if (opt && opt->option->boot_args) { args = talloc_strdup(ctx, opt->option->boot_args); |