X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=95d203920d6f72bf5176c2629e7d2f4aa430a447;hp=f9d2dbf5d53f1450d56c0c201738567cfb9b9166;hb=1513dd5d05f6408a64e19ea18cfaeb0cb8c5fb73;hpb=c12cebabba5c4647f558ef40f8cbc8c6a204593e diff --git a/discover/device-handler.c b/discover/device-handler.c index f9d2dbf..95d2039 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -327,6 +327,8 @@ static int default_timeout(void *arg) return 0; } + handler->timeout_waiter = NULL; + pb_log("Timeout expired, booting default option %s\n", opt->option->id); boot(handler, handler->default_boot_option, NULL, @@ -372,8 +374,14 @@ static void set_default(struct device_handler *handler, cur_prio = default_option_priority( handler->default_boot_option); - if (new_prio >= cur_prio) - return; + if (new_prio < cur_prio) { + handler->default_boot_option = opt; + /* extend the timeout a little, so the user sees some + * indication of the change */ + handler->sec_to_boot += 2; + } + + return; } handler->sec_to_boot = config_get()->autoboot_timeout_sec;