summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-06 16:05:46 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-14 11:25:27 +1000
commit4a9727c96f4e7b6e7cc237e737441bfae83a7a80 (patch)
tree0aeac59bdf8071c3332f4981ab88e4fb1d7b69c9
parent8ede209928e7bf7c06a11eee9c51a551193ba8e9 (diff)
downloadtalos-petitboot-4a9727c96f4e7b6e7cc237e737441bfae83a7a80.tar.gz
talos-petitboot-4a9727c96f4e7b6e7cc237e737441bfae83a7a80.zip
discover/device-handler: Ignore options without kernel
All boot options must at least have a boot image; ignore any options that do not before trying to resolve them. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--discover/device-handler.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index cd4e3ac..e230e76 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -1191,6 +1191,14 @@ void device_handler_discover_context_commit(struct device_handler *handler,
list_for_each_entry_safe(&ctx->boot_options, opt, tmp, list) {
list_remove(&opt->list);
+ /* All boot options need at least a kernel image */
+ if (!opt->boot_image || !opt->boot_image->url) {
+ pb_log("boot option %s is missing boot image, ignoring\n",
+ opt->option->id);
+ talloc_free(opt);
+ continue;
+ }
+
if (boot_option_resolve(opt, handler)) {
pb_log("boot option %s is resolved, "
"sending to clients\n",
OpenPOWER on IntegriCloud