[RFC PATCH 5/8] discover/device-handler: Read command files if present

Samuel Mendoza-Jonas sam at mendozajonas.com
Tue Dec 18 15:19:50 AEDT 2018


Signed-off-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
---
 discover/device-handler.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/discover/device-handler.c b/discover/device-handler.c
index e75f4123..05d8df11 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -20,6 +20,7 @@
 #include <url/url.h>
 #include <i18n/i18n.h>
 #include <pb-config/pb-config.h>
+#include <rust/rustlibs.h>
 
 #include <sys/sysmacros.h>
 #include <sys/types.h>
@@ -1845,6 +1846,13 @@ void device_handler_add_plugin_option(struct device_handler *handler,
 		}
 	}
 
+	if (opt->command_file) {
+		opt->n_commands = parse_command_file(opt, opt->command_file,
+				&opt->commands);
+		pb_log("Plugin %s included %d command definitions\n",
+				opt->name, opt->n_commands);
+	}
+
 	handler->plugins = talloc_realloc(handler, handler->plugins,
 			struct plugin_option *, handler->n_plugins + 1);
 	if (!handler->plugins) {
-- 
2.20.0



More information about the Petitboot mailing list