summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assemble_vintf.cpp43
1 files changed, 26 insertions, 17 deletions
diff --git a/assemble_vintf.cpp b/assemble_vintf.cpp
index d75e889..febb2d9 100644
--- a/assemble_vintf.cpp
+++ b/assemble_vintf.cpp
@@ -154,6 +154,28 @@ public:
154 return true; 154 return true;
155 } 155 }
156 156
157 bool assembleFrameworkCompatibilityMatrixKernels(CompatibilityMatrix* matrix) {
158 for (const auto& pair : mKernels) {
159 std::vector<KernelConfig> configs;
160 if (!parseFilesForKernelConfigs(pair.second, &configs)) {
161 return false;
162 }
163 bool added = false;
164 for (auto& e : matrix->framework.mKernels) {
165 if (e.minLts() == pair.first) {
166 e.mConfigs.insert(e.mConfigs.end(), configs.begin(), configs.end());
167 added = true;
168 break;
169 }
170 }
171 if (!added) {
172 matrix->framework.mKernels.push_back(
173 MatrixKernel{KernelVersion{pair.first}, std::move(configs)});
174 }
175 }
176 return true;
177 }
178
157 bool assembleCompatibilityMatrix(CompatibilityMatrix* matrix) { 179 bool assembleCompatibilityMatrix(CompatibilityMatrix* matrix) {
158 std::string error; 180 std::string error;
159 181
@@ -166,24 +188,11 @@ public:
166 if (!getFlag("POLICYVERS", &kernelSepolicyVers)) { 188 if (!getFlag("POLICYVERS", &kernelSepolicyVers)) {
167 return false; 189 return false;
168 } 190 }
169 for (const auto& pair : mKernels) { 191
170 std::vector<KernelConfig> configs; 192 if (!assembleFrameworkCompatibilityMatrixKernels(matrix)) {
171 if (!parseFilesForKernelConfigs(pair.second, &configs)) { 193 return false;
172 return false;
173 }
174 bool added = false;
175 for (auto& e : matrix->framework.mKernels) {
176 if (e.minLts() == pair.first) {
177 e.mConfigs.insert(e.mConfigs.end(), configs.begin(), configs.end());
178 added = true;
179 break;
180 }
181 }
182 if (!added) {
183 matrix->framework.mKernels.push_back(
184 MatrixKernel{KernelVersion{pair.first}, std::move(configs)});
185 }
186 } 194 }
195
187 matrix->framework.mSepolicy = 196 matrix->framework.mSepolicy =
188 Sepolicy(kernelSepolicyVers, {{sepolicyVers.majorVer, sepolicyVers.minorVer}}); 197 Sepolicy(kernelSepolicyVers, {{sepolicyVers.majorVer, sepolicyVers.minorVer}});
189 198