summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot2017-08-08 13:15:12 -0500
committerAndroid (Google) Code Review2017-08-08 13:15:12 -0500
commita49459e9e2bbf268a7451585c197eb3a4e6f1aaf (patch)
tree27625d8fdb35ab5a9f6b5326db0cb16c758a24e7
parent41ca2a824cb5ecf101091bc2212812985c3f0034 (diff)
parent9bb6b5610b49fa8f37f87d7fd6a766b6cf6531c4 (diff)
downloadplatform-system-libvintf-a49459e9e2bbf268a7451585c197eb3a4e6f1aaf.tar.gz
platform-system-libvintf-a49459e9e2bbf268a7451585c197eb3a4e6f1aaf.tar.xz
platform-system-libvintf-a49459e9e2bbf268a7451585c197eb3a4e6f1aaf.zip
Merge "accept multiple kernel config fragments per kernel version" into oc-mr1-dev
-rw-r--r--assemble_vintf.cpp21
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
348int main(int argc, char **argv) { 363int main(int argc, char **argv) {