summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-09-23 16:27:17 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-09-23 16:29:35 +0800
commite39c5ad541830cecbd331f877ef43ded738a9251 (patch)
tree083176a70cc7a83a0fd5cfc9a8efd46fde610237
parent85d8a6966cbf5c97023c11620cabd8a63b883e07 (diff)
downloadtalos-petitboot-e39c5ad541830cecbd331f877ef43ded738a9251.tar.gz
talos-petitboot-e39c5ad541830cecbd331f877ef43ded738a9251.zip
discover: Don't register multiple boot_timeout waiters
Rather than adding another timeout waiter, just override handler->default_boot_option and extend the timeout a little. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--discover/device-handler.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index f9d2dbf..02ae688 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -372,8 +372,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;
OpenPOWER on IntegriCloud