summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_ui_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/vboot_ui_common.c')
-rw-r--r--firmware/lib/vboot_ui_common.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/firmware/lib/vboot_ui_common.c b/firmware/lib/vboot_ui_common.c
index df1615d1..af9c4951 100644
--- a/firmware/lib/vboot_ui_common.c
+++ b/firmware/lib/vboot_ui_common.c
@@ -14,7 +14,7 @@
#include "vboot_api.h"
#include "vboot_ui_common.h"
-/* Two short beeps to notify the user that attempted action was disallowed. */
+/* One or two beeps to notify that attempted action was disallowed. */
void vb2_error_beep(enum vb2_beep_type beep)
{
switch (beep) {
@@ -30,13 +30,29 @@ void vb2_error_beep(enum vb2_beep_type beep)
}
}
+void vb2_error_notify(const char *print_msg,
+ const char *log_msg,
+ enum vb2_beep_type beep)
+{
+ if (print_msg)
+ VbExDisplayDebugInfo(print_msg);
+ if (!log_msg)
+ log_msg = print_msg;
+ if (log_msg)
+ VB2_DEBUG(log_msg);
+ vb2_error_beep(beep);
+}
+
void vb2_run_altfw(int altfw_num)
{
- if (RollbackKernelLock(0))
- VB2_DEBUG("Error locking kernel versions on legacy boot.\n");
- else
+ if (RollbackKernelLock(0)) {
+ vb2_error_notify("Error locking kernel versions on legacy "
+ "boot.\n", NULL, VB_BEEP_FAILED);
+ } else {
VbExLegacy(altfw_num); /* will not return if found */
- vb2_error_beep(VB_BEEP_FAILED);
+ vb2_error_notify("Legacy boot failed. Missing BIOS?\n", NULL,
+ VB_BEEP_FAILED);
+ }
}
void vb2_error_no_altfw(void)