summaryrefslogtreecommitdiff
path: root/libmodprobe/libmodprobe_ext_test.cpp
diff options
context:
space:
mode:
authorSteve Muckle <smuckle@google.com>2019-12-06 17:08:09 -0800
committerSteve Muckle <smuckle@google.com>2019-12-27 13:39:23 -0800
commit373a3cadd7d0d221e1c3e1976a0fb0c6a1c34f9f (patch)
treea90243c25eed12c77d41e35b6360b34be770f36f /libmodprobe/libmodprobe_ext_test.cpp
parentee08c978d2d34b3ddac420f9cbdc6ec65286c1e8 (diff)
libmodprobe: parse kernel command line for module options
Bug: 145808811 Test: atest libmodprobe_tests, verify on flame Change-Id: I0b41b1610fe13ae526d38f029da888f6f0d8a02d
Diffstat (limited to 'libmodprobe/libmodprobe_ext_test.cpp')
-rw-r--r--libmodprobe/libmodprobe_ext_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmodprobe/libmodprobe_ext_test.cpp b/libmodprobe/libmodprobe_ext_test.cpp
index 7d817b1f2..057dea3a0 100644
--- a/libmodprobe/libmodprobe_ext_test.cpp
+++ b/libmodprobe/libmodprobe_ext_test.cpp
@@ -29,6 +29,10 @@
#include "libmodprobe_test.h"
+std::string Modprobe::GetKernelCmdline(void) {
+ return kernel_cmdline;
+}
+
bool Modprobe::Insmod(const std::string& path_name, const std::string& parameters) {
auto deps = GetDependencies(MakeCanonical(path_name));
if (deps.empty()) {
@@ -57,7 +61,7 @@ bool Modprobe::Insmod(const std::string& path_name, const std::string& parameter
bool Modprobe::Rmmod(const std::string& module_name) {
for (auto it = modules_loaded.begin(); it != modules_loaded.end(); it++) {
- if (*it == module_name) {
+ if (*it == module_name || android::base::StartsWith(*it, module_name + " ")) {
modules_loaded.erase(it);
return true;
}