ui/ncurses: Allow booting custom boot options
authorJeremy Kerr <jk@ozlabs.org>
Thu, 10 Oct 2013 08:00:17 +0000 (16:00 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 10 Oct 2013 08:08:54 +0000 (16:08 +0800)
Currently, we can't boot user-created boot options, as they have no
option ID associated. This change removes the check for option ID.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/discover-client.c
ui/ncurses/nc-cui.c

index 90cd3b419101c051e35f5da1539eb975673c22ee..fea8c573c7d18516657dca663c94525164a1ccda 100644 (file)
@@ -264,8 +264,7 @@ static void create_boot_command(struct boot_command *command,
                const struct boot_option *boot_option,
                const struct pb_boot_data *data)
 {
-
-       command->option_id = boot_option->id;
+       command->option_id = boot_option ? boot_option->id : NULL;
        command->boot_image_file = data->image;
        command->initrd_file = data->initrd;
        command->dtb_file = data->dtb;
index 85558481b52956a2005e1017a0f0456649aae3ad..33a9f73e81b966f50e2a11a1793edb94be3c3793 100644 (file)
@@ -113,10 +113,6 @@ static int cui_boot(struct pmenu_item *item)
        assert(cui->current == &cui->main->scr);
 
        pb_log("%s: %s\n", __func__, cod->name);
-       if (!cod->opt) {
-               pb_log("%s: missing opt?\n", __func__);
-               return -1;
-       }
 
        nc_scr_status_printf(cui->current, "Booting %s...", cod->name);