summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-07-24 15:14:49 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2017-08-15 13:03:28 +1000
commitff54a215f0ce4c25262b24038841b58274cc51d3 (patch)
tree376fd20e3320580b0a9d96eb5ee8344b10213f71
parentf4d947604d0aeecb1ee42ae4d3c9895b65342176 (diff)
downloadtalos-petitboot-ff54a215f0ce4c25262b24038841b58274cc51d3.zip
talos-petitboot-ff54a215f0ce4c25262b24038841b58274cc51d3.tar.gz
discover/device-handler: Scan devices for plugins
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rw-r--r--discover/device-handler.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 3ef48ad..0c0a9a7 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -637,6 +637,21 @@ void device_handler_status_download(struct device_handler *handler,
}
}
+static void device_handler_plugin_scan_device(struct device_handler *handler,
+ struct discover_device *dev)
+{
+ int rc;
+
+ pb_debug("Scanning %s for plugin files\n", dev->device->id);
+
+ rc = process_run_simple(handler, pb_system_apps.pb_plugin,
+ "scan", dev->mount_path,
+ NULL);
+ if (rc)
+ pb_log("Error from pb-plugin scan %s\n",
+ dev->mount_path);
+}
+
void device_handler_status_download_remove(struct device_handler *handler,
struct process_info *procinfo)
{
@@ -1103,6 +1118,9 @@ int device_handler_discover(struct device_handler *handler,
device_handler_discover_context_commit(handler, ctx);
process_boot_option_queue(handler);
+
+ /* Check this device for pb-plugins */
+ device_handler_plugin_scan_device(handler, dev);
out:
talloc_unlink(handler, ctx);
OpenPOWER on IntegriCloud