summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot2018-01-31 11:25:30 -0600
committerandroid-build-team Robot2018-01-31 11:25:30 -0600
commit3b8ad86ff726eb9cefadab2725458510d3771189 (patch)
tree1230de63816f1f14f02a842063196dce94ffe6b2
parent47eb53deac8f7bf49b917876fa1a217bc2e9b314 (diff)
parent24687463d02c105eb2a834712098e21e2413abb5 (diff)
downloadplatform-system-libvintf-3b8ad86ff726eb9cefadab2725458510d3771189.tar.gz
platform-system-libvintf-3b8ad86ff726eb9cefadab2725458510d3771189.tar.xz
platform-system-libvintf-3b8ad86ff726eb9cefadab2725458510d3771189.zip
Snap for 4577102 from 24687463d02c105eb2a834712098e21e2413abb5 to pi-release
Change-Id: I99b4261dc042c5963b8beb52c679b1b5619d29ec
-rw-r--r--Android.bp1
-rw-r--r--CompatibilityMatrix.cpp16
-rw-r--r--HalManifest.cpp16
-rw-r--r--include/vintf/CompatibilityMatrix.h4
-rw-r--r--include/vintf/HalManifest.h4
-rw-r--r--include/vintf/RuntimeInfo.h2
-rw-r--r--include/vintf/parse_string.h2
-rw-r--r--main.cpp316
-rw-r--r--parse_string.cpp29
9 files changed, 341 insertions, 49 deletions
diff --git a/Android.bp b/Android.bp
index a2f647e..8a11dab 100644
--- a/Android.bp
+++ b/Android.bp
@@ -89,6 +89,7 @@ cc_binary {
89 name: "vintf", 89 name: "vintf",
90 defaults: ["libvintf-defaults"], 90 defaults: ["libvintf-defaults"],
91 shared_libs: [ 91 shared_libs: [
92 "libbase",
92 "libvintf", 93 "libvintf",
93 ], 94 ],
94 srcs: [ 95 srcs: [
diff --git a/CompatibilityMatrix.cpp b/CompatibilityMatrix.cpp
index 00e4d14..7bdc3a9 100644
--- a/CompatibilityMatrix.cpp
+++ b/CompatibilityMatrix.cpp
@@ -313,5 +313,21 @@ CompatibilityMatrix* CompatibilityMatrix::combine(Level deviceLevel,
313 return matrix; 313 return matrix;
314} 314}
315 315
316void CompatibilityMatrix::forEachInstance(
317 const std::function<void(const std::string&, const VersionRange&, const std::string&,
318 const std::string&, bool, bool*)>& f) const {
319 bool stop = false;
320 for (const auto& hal : getHals()) {
321 for (const auto& v : hal.versionRanges) {
322 for (const auto& intf : iterateValues(hal.interfaces)) {
323 for (const auto& instance : intf.instances) {
324 f(hal.name, v, intf.name, instance, hal.optional, &stop);
325 if (stop) break;
326 }
327 }
328 }
329 }
330}
331
316} // namespace vintf 332} // namespace vintf
317} // namespace android 333} // namespace android
diff --git a/HalManifest.cpp b/HalManifest.cpp
index 20ed7eb..2bf5aef 100644
--- a/HalManifest.cpp
+++ b/HalManifest.cpp
@@ -180,6 +180,22 @@ bool HalManifest::hasInstance(const std::string& halName, const Version& version
180 return instances.find(instanceName) != instances.end(); 180 return instances.find(instanceName) != instances.end();
181} 181}
182 182
183void HalManifest::forEachInstance(
184 const std::function<void(const std::string&, const Version&, const std::string&,
185 const std::string&, bool*)>& f) const {
186 bool stop = false;
187 for (const auto& hal : getHals()) {
188 for (const auto& v : hal.versions) {
189 for (const auto& intf : iterateValues(hal.interfaces)) {
190 for (const auto& instance : intf.instances) {
191 f(hal.name, v, intf.name, instance, &stop);
192 if (stop) break;
193 }
194 }
195 }
196 }
197}
198
183using InstancesOfVersion = std::map<std::string /* interface */, 199using InstancesOfVersion = std::map<std::string /* interface */,
184 std::set<std::string /* instance */>>; 200 std::set<std::string /* instance */>>;
185using Instances = std::map<Version, InstancesOfVersion>; 201using Instances = std::map<Version, InstancesOfVersion>;
diff --git a/include/vintf/CompatibilityMatrix.h b/include/vintf/CompatibilityMatrix.h
index 1b35d2d..9fcaffc 100644
--- a/include/vintf/CompatibilityMatrix.h
+++ b/include/vintf/CompatibilityMatrix.h
@@ -58,6 +58,10 @@ struct CompatibilityMatrix : public HalGroup<MatrixHal>, public XmlFileGroup<Mat
58 // (Normally, version ranges do not overlap, and the only match is returned.) 58 // (Normally, version ranges do not overlap, and the only match is returned.)
59 std::string getXmlSchemaPath(const std::string& xmlFileName, const Version& version) const; 59 std::string getXmlSchemaPath(const std::string& xmlFileName, const Version& version) const;
60 60
61 void forEachInstance(
62 const std::function<void(const std::string&, const VersionRange&, const std::string&,
63 const std::string&, bool, bool*)>& f) const;
64
61 private: 65 private:
62 bool add(MatrixHal &&hal); 66 bool add(MatrixHal &&hal);
63 bool add(MatrixKernel &&kernel); 67 bool add(MatrixKernel &&kernel);
diff --git a/include/vintf/HalManifest.h b/include/vintf/HalManifest.h
index 84bd770..76f1567 100644
--- a/include/vintf/HalManifest.h
+++ b/include/vintf/HalManifest.h
@@ -118,6 +118,10 @@ struct HalManifest : public HalGroup<ManifestHal>, public XmlFileGroup<ManifestX
118 // Get metaversion of this manifest. 118 // Get metaversion of this manifest.
119 Version getMetaVersion() const; 119 Version getMetaVersion() const;
120 120
121 void forEachInstance(
122 const std::function<void(const std::string&, const Version&, const std::string&,
123 const std::string&, bool*)>& f) const;
124
121 protected: 125 protected:
122 // Check before add() 126 // Check before add()
123 bool shouldAdd(const ManifestHal& toAdd) const override; 127 bool shouldAdd(const ManifestHal& toAdd) const override;
diff --git a/include/vintf/RuntimeInfo.h b/include/vintf/RuntimeInfo.h
index 68b6929..b7d3c0c 100644
--- a/include/vintf/RuntimeInfo.h
+++ b/include/vintf/RuntimeInfo.h
@@ -95,7 +95,7 @@ struct RuntimeInfo {
95 friend struct RuntimeInfoFetcher; 95 friend struct RuntimeInfoFetcher;
96 friend class VintfObject; 96 friend class VintfObject;
97 friend struct LibVintfTest; 97 friend struct LibVintfTest;
98 friend std::string dump(const RuntimeInfo &ki); 98 friend std::string dump(const RuntimeInfo& ki, bool);
99 99
100 // mKernelVersion = x'.y'.z', minLts = x.y.z, 100 // mKernelVersion = x'.y'.z', minLts = x.y.z,
101 // match if x == x' , y == y' , and z <= z'. 101 // match if x == x' , y == y' , and z <= z'.
diff --git a/include/vintf/parse_string.h b/include/vintf/parse_string.h
index be0c070..07251aa 100644
--- a/include/vintf/parse_string.h
+++ b/include/vintf/parse_string.h
@@ -101,7 +101,7 @@ bool parseKernelConfigTypedValue(const std::string& s, KernelConfigTypedValue* k
101// the XML string. 101// the XML string.
102std::string dump(const HalManifest &vm); 102std::string dump(const HalManifest &vm);
103 103
104std::string dump(const RuntimeInfo &ki); 104std::string dump(const RuntimeInfo& ki, bool verbose = true);
105 105
106} // namespace vintf 106} // namespace vintf
107} // namespace android 107} // namespace android
diff --git a/main.cpp b/main.cpp
index e4b8f6b..111b797 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,55 +14,295 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17#include <iostream> 17#include <getopt.h>
18#include <vintf/parse_xml.h> 18
19#include <vintf/parse_string.h> 19#include <android-base/strings.h>
20#include <vintf/VintfObject.h> 20#include <vintf/VintfObject.h>
21#include <vintf/parse_string.h>
22#include <vintf/parse_xml.h>
23#include <iomanip>
24#include <iostream>
25#include <string>
26#include <vector>
21 27
22// A convenience binary to dump information available through libvintf. 28using namespace ::android::vintf;
23int main(int, char **) {
24 using namespace ::android::vintf;
25 29
26 std::cout << "======== Device HAL Manifest =========" << std::endl; 30static const std::string kColumnSeperator = " ";
27 31
28 std::shared_ptr<const HalManifest> vm = VintfObject::GetDeviceHalManifest(); 32std::string existString(bool value) {
29 if (vm != nullptr) 33 return value ? "GOOD" : "DOES NOT EXIST";
30 std::cout << gHalManifestConverter(*vm); 34}
31 35
32 std::cout << "======== Framework HAL Manifest =========" << std::endl; 36std::string compatibleString(int32_t value) {
37 switch (value) {
38 case COMPATIBLE:
39 return "GOOD";
40 case INCOMPATIBLE:
41 return "INCOMPATIBLE";
42 default:
43 return strerror(-value);
44 }
45}
33 46
34 std::shared_ptr<const HalManifest> fm = VintfObject::GetFrameworkHalManifest(); 47std::string boolCompatString(bool value) {
35 if (fm != nullptr) 48 return compatibleString(value ? COMPATIBLE : INCOMPATIBLE);
36 std::cout << gHalManifestConverter(*fm); 49}
37 50
38 std::cout << "======== Device Compatibility Matrix =========" << std::endl; 51std::string deprecateString(int32_t value) {
52 switch (value) {
53 case NO_DEPRECATED_HALS:
54 return "GOOD";
55 case DEPRECATED:
56 return "DEPRECATED";
57 default:
58 return strerror(-value);
59 }
60}
39 61
40 std::shared_ptr<const CompatibilityMatrix> vcm = VintfObject::GetDeviceCompatibilityMatrix(); 62enum Status : int {
41 if (vcm != nullptr) 63 OK = 0,
42 std::cout << gCompatibilityMatrixConverter(*vcm); 64 USAGE,
65};
43 66
44 std::cout << "======== Framework Compatibility Matrix =========" << std::endl; 67struct ParsedOptions {
68 bool verbose = false;
69};
70
71struct Option {
72 char shortOption = '\0';
73 std::string longOption;
74 std::string help;
75 std::function<Status(ParsedOptions*)> op;
76};
77
78std::string getShortOptions(const std::vector<Option>& options) {
79 std::stringstream ret;
80 for (const auto& e : options)
81 if (e.shortOption != '\0') ret << e.shortOption;
82 return ret.str();
83}
84
85std::unique_ptr<struct option[]> getLongOptions(const std::vector<Option>& options,
86 int* longOptFlag) {
87 std::unique_ptr<struct option[]> ret{new struct option[options.size() + 1]};
88 int i = 0;
89 for (const auto& e : options) {
90 ret[i].name = e.longOption.c_str();
91 ret[i].has_arg = no_argument;
92 ret[i].flag = longOptFlag;
93 ret[i].val = i;
94
95 i++;
96 }
97 // getopt_long last option has all zeros
98 ret[i].name = NULL;
99 ret[i].has_arg = 0;
100 ret[i].flag = NULL;
101 ret[i].val = 0;
102
103 return ret;
104}
105
106Status parseOptions(int argc, char** argv, const std::vector<Option>& options, ParsedOptions* out) {
107 int longOptFlag;
108 std::unique_ptr<struct option[]> longOptions = getLongOptions(options, &longOptFlag);
109 std::string shortOptions = getShortOptions(options);
110 int optionIndex;
111 for (;;) {
112 int c = getopt_long(argc, argv, shortOptions.c_str(), longOptions.get(), &optionIndex);
113 if (c == -1) {
114 break;
115 }
116 const Option* found = nullptr;
117 for (size_t i = 0; i < options.size(); ++i)
118 if ((c == 0 && longOptFlag == static_cast<int>(i)) ||
119 (c != 0 && c == options[i].shortOption))
120
121 found = &options[i];
122
123 if (found == nullptr) {
124 // see unrecognized options
125 std::cerr << "unrecognized option `" << argv[optind - 1] << "'" << std::endl;
126 return USAGE;
127 }
128
129 Status status = found->op(out);
130 if (status != OK) return status;
131 }
132 if (optind < argc) {
133 // see non option
134 std::cerr << "unrecognized option `" << argv[optind] << "'" << std::endl;
135 return USAGE;
136 }
137 return OK;
138}
139
140void usage(char* me, const std::vector<Option>& options) {
141 std::cerr << me << ": dump VINTF metadata via libvintf." << std::endl;
142 for (const auto& e : options) {
143 if (e.help.empty()) continue;
144 std::cerr << " ";
145 if (e.shortOption != '\0') std::cerr << "-" << e.shortOption;
146 if (e.shortOption != '\0' && !e.longOption.empty()) std::cerr << ", ";
147 if (!e.longOption.empty()) std::cerr << "--" << e.longOption;
148 std::cerr << ": "
149 << android::base::Join(android::base::Split(e.help, "\n"), "\n ")
150 << std::endl;
151 }
152}
153
154// android.hardware.foo@1.0-1::IFoo/default.
155// Note that the format is extended to support a range of versions.
156std::string fqInstanceName(const std::string& package, const VersionRange& range,
157 const std::string& interface, const std::string& instance) {
158 std::stringstream ss;
159 ss << package << "@" << range << "::" << interface << "/" << instance;
160 return ss.str();
161}
162
163struct TableRow {
164 // Whether the HAL version is in device manifest, framework manifest, device compatibility
165 // matrix, framework compatibility matrix, respectively.
166 bool dm = false;
167 bool fm = false;
168 bool dcm = false;
169 bool fcm = false;
170 // If the HAL version is in device / framework compatibility matrix, whether it is required
171 // or not.
172 bool required = false;
173
174 // Return true if:
175 // - not a required HAL version; OR
176 // - required in device matrix and framework manifest;
177 // - required in framework matrix and device manifest.
178 bool meetsReqeuirement() const {
179 if (!required) return true;
180 if (dcm && !fm) return false;
181 if (fcm && !dm) return false;
182 return true;
183 }
184};
185
186std::ostream& operator<<(std::ostream& out, const TableRow& row) {
187 return out << (row.required ? "R" : " ") << (row.meetsReqeuirement() ? " " : "!")
188 << kColumnSeperator << (row.dm ? "DM" : " ") << kColumnSeperator
189 << (row.fm ? "FM" : " ") << kColumnSeperator << (row.fcm ? "FCM" : " ")
190 << kColumnSeperator << (row.dcm ? "DCM" : " ");
191}
192
193using RowMutator = std::function<void(TableRow*)>;
194using Table = std::map<std::string, TableRow>;
195
196// Insert each fqInstanceName foo@x.y::IFoo/instance to the table by inserting the key
197// if it does not exist and setting the corresponding indicator (as specified by "mutate").
198void insert(const HalManifest* manifest, Table* table, const RowMutator& mutate) {
199 if (manifest == nullptr) return;
200 manifest->forEachInstance([&](const auto& package, const auto& version, const auto& interface,
201 const auto& instance, bool* /* stop */) {
202 std::string key = fqInstanceName(package, VersionRange{version.majorVer, version.minorVer},
203 interface, instance);
204 mutate(&(*table)[key]);
205 });
206}
207
208void insert(const CompatibilityMatrix* matrix, Table* table, const RowMutator& mutate) {
209 if (matrix == nullptr) return;
210 matrix->forEachInstance([&](const auto& package, const auto& range, const auto& interface,
211 const auto& instance, bool optional, bool* /* stop */) {
212 bool missed = false;
213 for (auto minorVer = range.minMinor; minorVer <= range.maxMinor; ++minorVer) {
214 std::string key = fqInstanceName(package, VersionRange{range.majorVer, minorVer},
215 interface, instance);
216 auto it = table->find(key);
217 if (it == table->end()) {
218 missed = true;
219 } else {
220 mutate(&it->second);
221 it->second.required = !optional;
222 }
223 }
224 if (missed) {
225 std::string key = fqInstanceName(package, range, interface, instance);
226 mutate(&(*table)[key]);
227 }
228 });
229}
230
231Table generateHalSummary(const HalManifest* vm, const HalManifest* fm,
232 const CompatibilityMatrix* vcm, const CompatibilityMatrix* fcm) {
233 Table table;
234 insert(vm, &table, [](auto* row) { row->dm = true; });
235 insert(fm, &table, [](auto* row) { row->fm = true; });
236 insert(vcm, &table, [](auto* row) { row->dcm = true; });
237 insert(fcm, &table, [](auto* row) { row->fcm = true; });
238
239 return table;
240}
45 241
46 std::shared_ptr<const CompatibilityMatrix> fcm = VintfObject::GetFrameworkCompatibilityMatrix(); 242static const std::vector<Option> gAvailableOptions{
47 if (fcm != nullptr) 243 {'h', "help", "Print help message.", [](auto) { return USAGE; }},
48 std::cout << gCompatibilityMatrixConverter(*fcm); 244 {'v', "verbose", "Dump detailed and raw content, including kernel configurations", [](auto o) {
245 o->verbose = true;
246 return OK;
247 }}};
248// A convenience binary to dump information available through libvintf.
249int main(int argc, char** argv) {
250 ParsedOptions options;
251 Status status = parseOptions(argc, argv, gAvailableOptions, &options);
252 if (status == USAGE) usage(argv[0], gAvailableOptions);
253 if (status != OK) return status;
254
255 auto vm = VintfObject::GetDeviceHalManifest();
256 auto fm = VintfObject::GetFrameworkHalManifest();
257 auto vcm = VintfObject::GetDeviceCompatibilityMatrix();
258 auto fcm = VintfObject::GetFrameworkCompatibilityMatrix();
259 auto ki = VintfObject::GetRuntimeInfo();
260
261 if (!options.verbose) {
262 std::cout << "======== HALs =========" << std::endl
263 << "R: required. (empty): optional or missing from matrices. "
264 << "!: required and not in manifest." << std::endl
265 << "DM: device manifest. FM: framework manifest." << std::endl
266 << "FCM: framework compatibility matrix. DCM: device compatibility matrix."
267 << std::endl
268 << std::endl;
269 auto table = generateHalSummary(vm.get(), fm.get(), vcm.get(), fcm.get());
270
271 for (const auto& pair : table)
272 std::cout << pair.second << kColumnSeperator << pair.first << std::endl;
273
274 std::cout << std::endl;
275 }
276
277 SerializeFlags flags = SerializeFlag::EVERYTHING;
278 if (!options.verbose) {
279 flags |= SerializeFlag::NO_HALS;
280 flags |= SerializeFlag::NO_KERNEL;
281 }
282 std::cout << "======== Device HAL Manifest =========" << std::endl;
283 if (vm != nullptr) std::cout << gHalManifestConverter(*vm, flags);
284 std::cout << "======== Framework HAL Manifest =========" << std::endl;
285 if (fm != nullptr) std::cout << gHalManifestConverter(*fm, flags);
286 std::cout << "======== Device Compatibility Matrix =========" << std::endl;
287 if (vcm != nullptr) std::cout << gCompatibilityMatrixConverter(*vcm, flags);
288 std::cout << "======== Framework Compatibility Matrix =========" << std::endl;
289 if (fcm != nullptr) std::cout << gCompatibilityMatrixConverter(*fcm, flags);
49 290
50 std::cout << "======== Runtime Info =========" << std::endl; 291 std::cout << "======== Runtime Info =========" << std::endl;
292 if (ki != nullptr) std::cout << dump(*ki, options.verbose);
51 293
52 std::shared_ptr<const RuntimeInfo> ki = VintfObject::GetRuntimeInfo();
53 if (ki != nullptr) std::cout << dump(*ki);
54 std::cout << std::endl; 294 std::cout << std::endl;
55 295
56 std::cout << "======== Compatibility check =========" << std::endl; 296 std::cout << "======== Summary =========" << std::endl;
57 std::cout << "Device HAL Manifest? " << (vm != nullptr) << std::endl 297 std::cout << "Device Manifest? " << existString(vm != nullptr) << std::endl
58 << "Device Compatibility Matrix? " << (vcm != nullptr) << std::endl 298 << "Device Matrix? " << existString(vcm != nullptr) << std::endl
59 << "Framework HAL Manifest? " << (fm != nullptr) << std::endl 299 << "Framework Manifest? " << existString(fm != nullptr) << std::endl
60 << "Framework Compatibility Matrix? " << (fcm != nullptr) << std::endl; 300 << "Framework Matrix? " << existString(fcm != nullptr) << std::endl;
61 std::string error; 301 std::string error;
62 if (vm && fcm) { 302 if (vm && fcm) {
63 bool compatible = vm->checkCompatibility(*fcm, &error); 303 bool compatible = vm->checkCompatibility(*fcm, &error);
64 std::cout << "Device HAL Manifest <==> Framework Compatibility Matrix? " 304 std::cout << "Device HAL Manifest <==> Framework Compatibility Matrix? "
65 << compatible; 305 << boolCompatString(compatible);
66 if (!compatible) 306 if (!compatible)
67 std::cout << ", " << error; 307 std::cout << ", " << error;
68 std::cout << std::endl; 308 std::cout << std::endl;
@@ -70,22 +310,32 @@ int main(int, char **) {
70 if (fm && vcm) { 310 if (fm && vcm) {
71 bool compatible = fm->checkCompatibility(*vcm, &error); 311 bool compatible = fm->checkCompatibility(*vcm, &error);
72 std::cout << "Framework HAL Manifest <==> Device Compatibility Matrix? " 312 std::cout << "Framework HAL Manifest <==> Device Compatibility Matrix? "
73 << compatible; 313 << boolCompatString(compatible);
74 if (!compatible) 314 if (!compatible)
75 std::cout << ", " << error; 315 std::cout << ", " << error;
76 std::cout << std::endl; 316 std::cout << std::endl;
77 } 317 }
78 if (ki && fcm) { 318 if (ki && fcm) {
79 bool compatible = ki->checkCompatibility(*fcm, &error); 319 bool compatible = ki->checkCompatibility(*fcm, &error);
80 std::cout << "Runtime info <==> Framework Compatibility Matrix? " << compatible; 320 std::cout << "Runtime info <==> Framework Compatibility Matrix? "
321 << boolCompatString(compatible);
81 if (!compatible) std::cout << ", " << error; 322 if (!compatible) std::cout << ", " << error;
82 std::cout << std::endl; 323 std::cout << std::endl;
83 } 324 }
84 325
85 { 326 {
86 auto compatible = VintfObject::CheckCompatibility({}, &error); 327 auto compatible = VintfObject::CheckCompatibility({}, &error);
87 std::cout << "VintfObject::CheckCompatibility (0 == compatible)? " << compatible; 328 std::cout << "VintfObject::CheckCompatibility? "
329 << compatibleString(compatible);
88 if (compatible != COMPATIBLE) std::cout << ", " << error; 330 if (compatible != COMPATIBLE) std::cout << ", " << error;
89 std::cout << std::endl; 331 std::cout << std::endl;
90 } 332 }
333
334 if (vm && fcm) {
335 auto deprecate = VintfObject::CheckDeprecation(&error);
336 std::cout << "VintfObject::CheckDeprecation (against device manifest)? "
337 << deprecateString(deprecate);
338 if (deprecate != NO_DEPRECATED_HALS) std::cout << ", " << error;
339 std::cout << std::endl;
340 }
91} 341}
diff --git a/parse_string.cpp b/parse_string.cpp
index 6b6e9a0..697a68f 100644
--- a/parse_string.cpp
+++ b/parse_string.cpp
@@ -417,23 +417,24 @@ std::string dump(const HalManifest &vm) {
417 return oss.str(); 417 return oss.str();
418} 418}
419 419
420std::string dump(const RuntimeInfo &ki) { 420std::string dump(const RuntimeInfo& ki, bool verbose) {
421 std::ostringstream oss; 421 std::ostringstream oss;
422 422
423 oss << "kernel = " 423 oss << "kernel = " << ki.osName() << "/" << ki.nodeName() << "/" << ki.osRelease() << "/"
424 << ki.osName() << "/" 424 << ki.osVersion() << "/" << ki.hardwareId() << ";" << ki.mBootAvbVersion << "/"
425 << ki.nodeName() << "/"
426 << ki.osRelease() << "/"
427 << ki.osVersion() << "/"
428 << ki.hardwareId() << ";"
429 << ki.mBootAvbVersion << "/"
430 << ki.mBootVbmetaAvbVersion << ";" 425 << ki.mBootVbmetaAvbVersion << ";"
431 << "kernelSepolicyVersion = " << ki.kernelSepolicyVersion() 426 << "kernelSepolicyVersion = " << ki.kernelSepolicyVersion() << ";";
432 << ";\n\ncpu info:\n" 427
433 << ki.cpuInfo() 428 if (verbose) {
434 << "\n#CONFIG's loaded = " << ki.mKernelConfigs.size() << ";\n"; 429 oss << "\n\ncpu info:\n" << ki.cpuInfo();
435 for (const auto &pair : ki.mKernelConfigs) { 430 }
436 oss << pair.first << "=" << pair.second << "\n"; 431
432 oss << "\n#CONFIG's loaded = " << ki.mKernelConfigs.size() << ";\n";
433
434 if (verbose) {
435 for (const auto& pair : ki.mKernelConfigs) {
436 oss << pair.first << "=" << pair.second << "\n";
437 }
437 } 438 }
438 439
439 return oss.str(); 440 return oss.str();