X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=cc48747331dc6f3c6d161583499f5ca2d9ce5524;hp=489ecd7364fb7bd8582af14b9ba777098c0c688f;hb=dc96fc7df262a0b72ece710dcfc9ffab1c952dec;hpb=a2441c75956929293359888a4169114267a5fdbf diff --git a/discover/device-handler.c b/discover/device-handler.c index 489ecd7..cc48747 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -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; @@ -1175,13 +1177,17 @@ void device_handler_process_url(struct device_handler *handler, } pb_url = pb_url_parse(event, event->params->value); - if (!pb_url || !pb_url->host) { + if (!pb_url || (pb_url->scheme != pb_url_file && !pb_url->host)) { status->message = talloc_asprintf(handler, _("Invalid config URL!")); goto msg; } - event->device = device_from_addr(event, pb_url); + if (pb_url->scheme == pb_url_file) + event->device = talloc_asprintf(event, "local"); + else + event->device = device_from_addr(event, pb_url); + if (!event->device) { status->message = talloc_asprintf(status, _("Unable to route to host %s"), @@ -1190,6 +1196,8 @@ void device_handler_process_url(struct device_handler *handler, } dev = discover_device_create(handler, event->device); + if (pb_url->scheme == pb_url_file) + dev->device->type = DEVICE_TYPE_ANY; ctx = device_handler_discover_context_create(handler, dev); ctx->event = event;