From 888f8d2d3519c768e30125c8de080f2bf2413823 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 28 Feb 2012 13:37:39 -0800 Subject: 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 Change-Id: If91d4b1da8a7f69ff797b0b00c507248139601cd Reviewed-on: https://gerrit.chromium.org/gerrit/17002 Tested-by: Stefan Reinauer Commit-Ready: Stefan Reinauer Reviewed-by: Randall Spangler --- lib/vbexport/display.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 +#include +#include #include #include #include @@ -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; } -- cgit v1.2.3