summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-02-28 13:37:39 -0800
committerStefan Reinauer <reinauer@chromium.org>2012-02-28 14:32:14 -0800
commit888f8d2d3519c768e30125c8de080f2bf2413823 (patch)
tree32a2dffe8eb0139eede3848e21d2cd5b94919e82
parente9173303e7f06c8ceefc8134b6bbfe5257704017 (diff)
Print firmware version in tab screen
In bug reports with screen shots of the firmware screens with tab pressed, it would be extremely useful to see the version of the currently running firmware and the read-only firmware, so output this information. BUG=none TEST=press TAB at dev screen, see firmware versions printed on the screen. Signed-off-by: Stefan Reinauer <reinauer@google.com> Change-Id: If91d4b1da8a7f69ff797b0b00c507248139601cd Reviewed-on: https://gerrit.chromium.org/gerrit/17002 Tested-by: Stefan Reinauer <reinauer@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--lib/vbexport/display.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/vbexport/display.c b/lib/vbexport/display.c
index 2de65cd38f..5318967036 100644
--- a/lib/vbexport/display.c
+++ b/lib/vbexport/display.c
@@ -18,6 +18,8 @@
#define HAVE_DISPLAY
#endif
#include <chromeos/common.h>
+#include <chromeos/crossystem_data.h>
+#include <chromeos/fdt_decode.h>
#include <lzma/LzmaTypes.h>
#include <lzma/LzmaDec.h>
#include <lzma/LzmaTools.h>
@@ -187,8 +189,26 @@ VbError_t VbExDisplayImage(uint32_t x, uint32_t y,
VbError_t VbExDisplayDebugInfo(const char *info_str)
{
#ifdef HAVE_DISPLAY
+ crossystem_data_t *cdata;
+ size_t size;
+
display_callbacks_.dc_position_cursor(0, 0);
display_callbacks_.dc_puts(info_str);
+
+
+ cdata = fdt_decode_chromeos_alloc_region(gd->blob, "cros-system-data",
+ &size);
+ if (!cdata) {
+ VBDEBUG("cros-system-data missing "
+ "from fdt, or malloc failed\n");
+ return VBERROR_UNKNOWN;
+ }
+
+ display_callbacks_.dc_puts("read-only firmware id: ");
+ display_callbacks_.dc_puts((char *)cdata->readonly_firmware_id);
+ display_callbacks_.dc_puts("\nactive firmware id: ");
+ display_callbacks_.dc_puts((char *)cdata->firmware_id);
+ display_callbacks_.dc_puts("\n");
#endif
return VBERROR_SUCCESS;
}