diff options
Diffstat (limited to 'firmware/2lib/2ui.c')
-rw-r--r-- | firmware/2lib/2ui.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/firmware/2lib/2ui.c b/firmware/2lib/2ui.c index 80d0568d..800f06a3 100644 --- a/firmware/2lib/2ui.c +++ b/firmware/2lib/2ui.c @@ -408,12 +408,24 @@ vb2_error_t ui_loop(struct vb2_context *ctx, enum vb2_screen root_screen_id, vb2_error_t vb2_developer_menu(struct vb2_context *ctx) { - return ui_loop(ctx, VB2_SCREEN_DEVELOPER_MODE, developer_action); + enum vb2_screen root_screen_id = VB2_SCREEN_DEVELOPER_MODE; + if (!vb2_dev_boot_allowed(ctx)) { + VB2_DEBUG("WARNING: Dev boot not allowed; forcing to-norm\n"); + root_screen_id = VB2_SCREEN_DEVELOPER_TO_NORM; + } + return ui_loop(ctx, root_screen_id, developer_action); } vb2_error_t developer_action(struct vb2_ui_context *ui) { /* Developer mode keyboard shortcuts */ + if (ui->key == '\t') + return vb2_ui_screen_change(ui, VB2_SCREEN_DEBUG_INFO); + + /* Ignore other shortcuts */ + if (!vb2_dev_boot_allowed(ui->ctx)) + return VB2_REQUEST_UI_CONTINUE; + if (ui->key == VB_KEY_CTRL('S')) return vb2_ui_screen_change(ui, VB2_SCREEN_DEVELOPER_TO_NORM); if (ui->key == VB_KEY_CTRL('U') || @@ -424,8 +436,6 @@ vb2_error_t developer_action(struct vb2_ui_context *ui) return vb2_ui_developer_mode_boot_internal_action(ui); if (ui->key == VB_KEY_CTRL('L')) /* L for aLtfw (formerly Legacy) */ return vb2_ui_developer_mode_boot_altfw_action(ui); - if (ui->key == '\t') - return vb2_ui_screen_change(ui, VB2_SCREEN_DEBUG_INFO); return VB2_REQUEST_UI_CONTINUE; } |