Fastboot: Add new TEXT message to protocol to handle long lines.
Trusty Benchmarks need to be evaluated in ABL which is much more
controlled than linux. However fastboot prints evry atomic message from
trusty/abl on its own line starting with "(bootloader)"
Bug: 263454481
Test: - "fastboot oem trusty runtest trusty.hwrng.bench"
Change-Id: I99847a8cc54457c8ec809e219736325dce0ac891
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 0c8747c..a30b10c 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -251,6 +251,10 @@
fprintf(stderr, "(bootloader) %s\n", info.c_str());
}
+static void TextMessage(const std::string& text) {
+ fprintf(stderr, "%s", text.c_str());
+}
+
bool ReadFileToVector(const std::string& file, std::vector<char>* out) {
out->clear();
@@ -2303,7 +2307,9 @@
.prolog = Status,
.epilog = Epilog,
.info = InfoMessage,
+ .text = TextMessage,
};
+
fastboot::FastBootDriver fastboot_driver(transport, driver_callbacks, false);
fb = &fastboot_driver;