X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=72dda756ca958e627b4553a9fbc154d51c9640e3;hp=b8e933088b28f5c7eb3aed788287af48ab0df365;hb=08f8488096f397a1babc960bb9939484a3916c66;hpb=f3e72665eb06410c6f7e49e030db92349fbbddbf diff --git a/discover/device-handler.c b/discover/device-handler.c index b8e9330..72dda75 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -935,13 +935,38 @@ static void set_default(struct device_handler *handler, default_timeout(handler); } +static char *autoboot_option_desc(void *ctx, const struct autoboot_option *opt) +{ + const char *type, *val; + + if (opt->boot_type == BOOT_DEVICE_TYPE) { + type = _("device type"); + val = device_type_display_name(opt->type); + } else if (opt->boot_type == BOOT_DEVICE_UUID) { + type = _("device UUID"); + val = opt->uuid; + } else { + type = _("unknown specifier"); + val = NULL; + } + + return talloc_asprintf(ctx, "%s = %s", type, val); +} + void device_handler_apply_temp_autoboot(struct device_handler *handler, struct autoboot_option *opt) { unsigned int i; + char *desc; handler->temp_autoboot = talloc_steal(handler, opt); + desc = autoboot_option_desc(handler, opt); + device_handler_status_info(handler, + _("Applying temporary autoboot override: %s"), + desc); + talloc_free(desc); + if (!handler->autoboot_enabled) return;