diff options
-rw-r--r-- | assemble_vintf.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/assemble_vintf.cpp b/assemble_vintf.cpp index 8b7e609..cbfc368 100644 --- a/assemble_vintf.cpp +++ b/assemble_vintf.cpp | |||
@@ -92,6 +92,19 @@ public: | |||
92 | return true; | 92 | return true; |
93 | } | 93 | } |
94 | 94 | ||
95 | static bool parseFilesForKernelConfigs(const std::string& path, std::vector<KernelConfig>* out) { | ||
96 | bool ret = true; | ||
97 | char *pathIter; | ||
98 | char *modPath = new char[path.length() + 1]; | ||
99 | strcpy(modPath, path.c_str()); | ||
100 | pathIter = strtok(modPath, ":"); | ||
101 | while (ret && pathIter != NULL) { | ||
102 | ret &= parseFileForKernelConfigs(pathIter, out); | ||
103 | pathIter = strtok(NULL, ":"); | ||
104 | } | ||
105 | return ret; | ||
106 | } | ||
107 | |||
95 | std::basic_ostream<char>& out() const { | 108 | std::basic_ostream<char>& out() const { |
96 | return mOutFileRef == nullptr ? std::cout : *mOutFileRef; | 109 | return mOutFileRef == nullptr ? std::cout : *mOutFileRef; |
97 | } | 110 | } |
@@ -154,7 +167,7 @@ public: | |||
154 | } | 167 | } |
155 | for (const auto& pair : mKernels) { | 168 | for (const auto& pair : mKernels) { |
156 | std::vector<KernelConfig> configs; | 169 | std::vector<KernelConfig> configs; |
157 | if (!parseFileForKernelConfigs(pair.second, &configs)) { | 170 | if (!parseFilesForKernelConfigs(pair.second, &configs)) { |
158 | return false; | 171 | return false; |
159 | } | 172 | } |
160 | bool added = false; | 173 | bool added = false; |
@@ -338,11 +351,13 @@ void help() { | |||
338 | " message is written to stderr. Return 0.\n" | 351 | " message is written to stderr. Return 0.\n" |
339 | " If the check file is specified but is not compatible, an error\n" | 352 | " If the check file is specified but is not compatible, an error\n" |
340 | " message is written to stderr. Return 1.\n" | 353 | " message is written to stderr. Return 1.\n" |
341 | " --kernel=<version>:<android-base.cfg>\n" | 354 | " --kernel=<version>:<android-base.cfg>[:<android-base-arch.cfg>[...]]\n" |
342 | " Add a kernel entry to framework compatibility matrix.\n" | 355 | " Add a kernel entry to framework compatibility matrix.\n" |
343 | " Ignored for other input format.\n" | 356 | " Ignored for other input format.\n" |
344 | " <version> has format: 3.18\n" | 357 | " <version> has format: 3.18\n" |
345 | " <android-base.cfg> is the location of android-base.cfg\n"; | 358 | " <android-base.cfg> is the location of android-base.cfg\n" |
359 | " <android-base-arch.cfg> is the location of an optional\n" | ||
360 | " arch-specific config fragment, more than one may be specified\n"; | ||
346 | } | 361 | } |
347 | 362 | ||
348 | int main(int argc, char **argv) { | 363 | int main(int argc, char **argv) { |