discover: Perform pre-boot steps when timeout expires
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 13 Apr 2016 05:07:38 +0000 (15:07 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 13 Apr 2016 05:54:07 +0000 (15:54 +1000)
When a default boot timeout expires boot() is called via
default_timeout() rather than device_handler_boot(). default_timeout()
doesn't call platform_pre_boot() beforehand, which means steps such as
clearing a temporary boot device override are skipped.
Add a call to platform_pre_boot() immediately before boot() to ensure
these steps are performed regardless of boot type.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/device-handler.c

index 489ecd7364fb7bd8582af14b9ba777098c0c688f..43b9541aba9187c2198593f88f85cd5699763b60 100644 (file)
@@ -445,6 +445,8 @@ static int default_timeout(void *arg)
 
        pb_log("Timeout expired, booting default option %s\n", opt->option->id);
 
+       platform_pre_boot();
+
        handler->pending_boot = boot(handler, handler->default_boot_option,
                        NULL, handler->dry_run, boot_status, handler);
        handler->pending_boot_is_default = true;