]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
discover/grub: Use different paths to search for the BLS directory
[petitboot] / discover / device-handler.c
index 82230154ba77d9a314f50d3a41fe184837197d40..aa61bd25ae92eb7fc28d0b0bc8e3177fb368f9b4 100644 (file)
@@ -1,4 +1,5 @@
 #include <assert.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <stdbool.h>
 #include <unistd.h>
@@ -450,6 +451,9 @@ void device_handler_reinit(struct device_handler *handler)
                discover_server_notify_config(handler->server, config);
        }
 
+       /* Force rediscovery on SCSI devices */
+       process_run_simple(handler, pb_system_apps.scsi_rescan, NULL);
+
        device_handler_reinit_sources(handler);
 }
 
@@ -653,7 +657,7 @@ void device_handler_status_download(struct device_handler *handler,
                        unit++;
                }
                update = talloc_asprintf(handler,
-                               _("%u %s downloading: %.0f%% - %lu%cB"),
+                               _("%u %s downloading: %.0f%% - %" PRIu64 "%cB"),
                                handler->n_progress,
                                ngettext("item", "items", handler->n_progress),
                                (current / total) * 100, current_converted,
@@ -831,6 +835,9 @@ static enum default_priority default_option_priority(
                int boot_match = autoboot_option_priority(config, opt);
                if (boot_match > 0)
                        return boot_match;
+       } else {
+               /* If there is no specific boot order, boot any device */
+               return DEFAULT_PRIORITY_LOCAL_FIRST;
        }
 
        /* If the option didn't match any entry in the array, it is disabled */
@@ -1556,8 +1563,7 @@ void device_handler_add_plugin_option(struct device_handler *handler,
                tmp = handler->plugins[i];
                /* If both id and version match, ignore */
                if (strncmp(opt->id, tmp->id, strlen(opt->id)) == 0 &&
-                               strncmp(opt->version, tmp->version,
-                                       strlen(opt->version) == 0)) {
+                               strcmp(opt->version, tmp->version) == 0) {
                        pb_log("discover: Plugin '%s' already exists, ignoring\n",
                                        opt->id);
                        return;