1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-21 13:58:08 +00:00

feat(core/bootloader_emu): allow explicit bootloader locking from command line

This commit is contained in:
matejcik 2023-09-14 14:55:03 +02:00 committed by Andrew Kozlik
parent c48b606867
commit 21959996bd

View File

@ -7,6 +7,9 @@
#include "flash.h"
#include "model.h"
#include "rust_ui.h"
#ifdef USE_OPTIGA
#include "secret.h"
#endif
#include "emulator.h"
@ -40,9 +43,17 @@ __attribute__((noreturn)) int main(int argc, char **argv) {
(void)ret;
}
if (argc == 2 && argv[1][0] == 's') {
// Run the firmware
stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG;
if (argc == 2) {
if (argv[1][0] == 's') {
// Run the firmware
stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG;
}
#ifdef USE_OPTIGA
else if (argv[1][0] == 'l') {
// write bootloader-lock secret
secret_write_header();
}
#endif
} else if (argc == 4) {
display_init();
display_backlight(180);