diff options
author | Subrata Banik <subratabanik@google.com> | 2022-07-17 18:20:24 +0530 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2022-08-02 07:06:52 +0000 |
commit | 8b468400f121f94010d539823fd2df95a367589d (patch) | |
tree | 3ed556e10363e5de3161809038408a65c040a5e7 | |
parent | 2d20b68b6e0bb2ca8c9072261c77beb33762f9c0 (diff) |
util/cbfstool/elogtool: Support logging FW vboot info in elog
List of changes:
1. Add support for new elog event type to log vboot info (type 0xB7).
2. Add support string for fw_slot name, boot status and boot mode.
3. Print fw slot information like FW try count, FW current slot,
previous FW slot, previous FW boot result and boot mode.
BUG=b:215615970
TEST=Able to build and boot google/kano to OS.
localhost # elogtool list
0 | 2022-07-01 11:10:27 | Log area cleared | 4088
1 | 2022-07-01 11:10:27 | Memory Cache Update | Normal | Success
2 | 2022-07-01 11:10:42 | System boot | 360
3 | 2022-07-01 11:10:42 | Power Fail
4 | 2022-07-01 11:10:42 | SUS Power Fail
5 | 2022-07-01 11:10:42 | ACPI Wake | S5
6 | 2022-07-01 11:10:42 | Wake Source | Power Button | 0
7 | 2022-07-01 11:10:42 | Chrome OS Developer Mode
8 | 2022-07-01 11:10:42 | Firmware vboot info |
boot_mode=Developer |
fw_tried=B | fw_try_count=0 |
fw_prev_tried=B | fw_prev_result=Unknown
9 | 2022-07-01 11:11:42 | System boot | 361
10 | 2022-07-01 11:11:42 | System Reset
11 | 2022-07-01 11:11:42 | Firmware vboot info |
boot_mode=Developer |
fw_tried=B | fw_try_count=0 |
fw_prev_tried=B | fw_prev_result=Success
localhost # crossystem recovery_request=1
localhost # elogtool list
41 | 2022-07-13 12:13:48 | Firmware vboot info |
boot_mode=Manual recovery boot |
recovery_reason: 0x1/0 (Recovery requested
from legacy utility) | fw_tried=A |
fw_try_count=0 | fw_prev_tried=A |
fw_prev_result=Unknown
Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I48b5d54723683cef51e416fc6f58da000507fbcc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65562
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | util/cbfstool/eventlog.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/util/cbfstool/eventlog.c b/util/cbfstool/eventlog.c index 120bb40e08..e9a4e8e734 100644 --- a/util/cbfstool/eventlog.c +++ b/util/cbfstool/eventlog.c @@ -158,6 +158,7 @@ static void eventlog_print_type(const struct event_header *event) {ELOG_TYPE_EC_DEVICE_EVENT, "EC Device"}, {ELOG_TYPE_EXTENDED_EVENT, "Extended Event"}, {ELOG_TYPE_CROS_DIAGNOSTICS, "Diagnostics Mode"}, + {ELOG_TYPE_FW_VBOOT_INFO, "Firmware vboot info"}, {ELOG_TYPE_EOL, "End of log"}, }; @@ -623,6 +624,24 @@ static int eventlog_print_data(const struct event_header *event) case ELOG_TYPE_CROS_DIAGNOSTICS: { const uint8_t *type = event_get_data(event); eventlog_printf("%s", val2str(*type, cros_diagnostics_types)); + break; + } + case ELOG_TYPE_FW_VBOOT_INFO: { + const union vb2_fw_boot_info *info = event_get_data(event); + + eventlog_printf("boot_mode=%s", vb2_boot_mode_string(info->boot_mode)); + + if (info->boot_mode == VB2_BOOT_MODE_BROKEN_SCREEN || + info->boot_mode == VB2_BOOT_MODE_MANUAL_RECOVERY) + eventlog_printf("recovery_reason=%#x/%#x (%s)", + info->recovery_reason, info->recovery_subcode, + vb2_get_recovery_reason_string(info->recovery_reason)); + + eventlog_printf("fw_tried=%s", vb2_slot_string(info->slot)); + eventlog_printf("fw_try_count=%d", info->tries); + eventlog_printf("fw_prev_tried=%s", vb2_slot_string(info->prev_slot)); + eventlog_printf("fw_prev_result=%s", vb2_result_string(info->prev_result)); + break; } default: break; |