0005-Blank-screen-before-displaying-device-information-an.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. From 789515e14798cd56eab959ed9f94e384a7e4cbb6 Mon Sep 17 00:00:00 2001
  2. From: Hal Emmerich <hal@halemmerich.com>
  3. Date: Sun, 8 Dec 2019 22:18:46 -0600
  4. Subject: [PATCH] Blank screen before displaying device information and wait
  5. for the user to press a key to return to the developer mode screen
  6. ---
  7. firmware/lib/vboot_display.c | 18 ++++++++----------
  8. firmware/lib/vboot_ui.c | 11 +++++++++++
  9. 2 files changed, 19 insertions(+), 10 deletions(-)
  10. diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
  11. index ea36c1f1..d3d98e25 100644
  12. --- a/firmware/lib/vboot_display.c
  13. +++ b/firmware/lib/vboot_display.c
  14. @@ -271,7 +271,7 @@ const char *RecoveryReasonString(uint8_t code)
  15. return "We have no idea what this means";
  16. }
  17. -#define DEBUG_INFO_SIZE 512
  18. +#define DEBUG_INFO_SIZE 768
  19. VbError_t VbDisplayDebugInfo(struct vb2_context *ctx)
  20. {
  21. @@ -285,14 +285,8 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx)
  22. VbError_t ret;
  23. uint32_t i;
  24. - /* Redisplay current screen to overwrite any previous debug output.
  25. - * Need to use VbDisplayMenu instead of VbDisplayScreen
  26. - * in order to ensure that the selected menu item is
  27. - * highlighted. On a non-detachable screen, this will be a
  28. - * no-op.
  29. - */
  30. - VbDisplayMenu(ctx, disp_current_screen, 1,
  31. - disp_current_index, disp_disabled_idx_mask);
  32. + /* Blank screen*/
  33. + VbDisplayScreen(ctx, VB_SCREEN_BLANK, 1);
  34. /* Add hardware ID */
  35. VbGbbReadHWID(ctx, hwid, sizeof(hwid));
  36. @@ -399,7 +393,11 @@ VbError_t VbDisplayDebugInfo(struct vb2_context *ctx)
  37. }
  38. /* Make sure we finish with a newline */
  39. - used += StrnAppend(buf + used, "\n", DEBUG_INFO_SIZE - used);
  40. + used += StrnAppend(buf + used, "\n\n", DEBUG_INFO_SIZE - used);
  41. +
  42. + used += StrnAppend(buf + used, "Press any key to continue\n\n",
  43. + DEBUG_INFO_SIZE - used);
  44. +
  45. /* TODO: add more interesting data:
  46. * - Information on current disks */
  47. diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
  48. index cc8abba2..832b46f1 100644
  49. --- a/firmware/lib/vboot_ui.c
  50. +++ b/firmware/lib/vboot_ui.c
  51. @@ -322,6 +322,17 @@ developer_mode_screen:
  52. "hold developer mode screen\n"));
  53. hold = 1;
  54. break;
  55. + case 0x09:
  56. + /* Ctrl+I = device information */
  57. + VB2_DEBUG(("VbBootDeveloper() - "
  58. + "device info\n"));
  59. + hold = 1;
  60. + VbDisplayDebugInfo(ctx);
  61. +
  62. + while (!VbExKeyboardRead()) ;
  63. +
  64. + goto developer_mode_screen;
  65. + break;
  66. case 0x0c:
  67. VB2_DEBUG("VbBootDeveloper() - "
  68. "user pressed Ctrl+L; Try legacy boot\n");
  69. --
  70. 2.20.1