libmodprobe: support parameters in LoadWithAliases
Add support to specify module parameters in LoadWithAliases. These
parameters will be appended to any which are specified for the module in
modules.options.
Change-Id: I9aff1656ea397826f815b658b3b52c1892748601
diff --git a/libmodprobe/libmodprobe_ext_test.cpp b/libmodprobe/libmodprobe_ext_test.cpp
index ca1c081..204809f 100644
--- a/libmodprobe/libmodprobe_ext_test.cpp
+++ b/libmodprobe/libmodprobe_ext_test.cpp
@@ -29,7 +29,7 @@
#include "libmodprobe_test.h"
-bool Modprobe::Insmod(const std::string& path_name) {
+bool Modprobe::Insmod(const std::string& path_name, const std::string& parameters) {
auto deps = GetDependencies(MakeCanonical(path_name));
if (deps.empty()) {
return false;
@@ -47,6 +47,10 @@
if (options_iter != module_options_.end()) {
options = " " + options_iter->second;
}
+ if (!parameters.empty()) {
+ options = options + " " + parameters;
+ }
+
modules_loaded.emplace_back(path_name + options);
return true;
}