am 5138958c: Merge "Enable property expansion for insmod"
* commit '5138958cb30266e718cd523905037e7e95373271':
Enable property expansion for insmod
diff --git a/init/builtins.cpp b/init/builtins.cpp
index d772383..88d6165 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -58,7 +58,16 @@
static int insmod(const char *filename, char *options)
{
std::string module;
- if (!read_file(filename, &module)) {
+ char filename_val[PROP_VALUE_MAX];
+ int ret;
+
+ ret = expand_props(filename_val, filename, sizeof(filename_val));
+ if (ret) {
+ ERROR("insmod: cannot expand '%s'\n", filename);
+ return -EINVAL;
+ }
+
+ if (!read_file(filename_val, &module)) {
return -1;
}