1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +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 "flash.h"
#include "model.h" #include "model.h"
#include "rust_ui.h" #include "rust_ui.h"
#ifdef USE_OPTIGA
#include "secret.h"
#endif
#include "emulator.h" #include "emulator.h"
@ -40,9 +43,17 @@ __attribute__((noreturn)) int main(int argc, char **argv) {
(void)ret; (void)ret;
} }
if (argc == 2 && argv[1][0] == 's') { if (argc == 2) {
// Run the firmware if (argv[1][0] == 's') {
stay_in_bootloader_flag = STAY_IN_BOOTLOADER_FLAG; // 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) { } else if (argc == 4) {
display_init(); display_init();
display_backlight(180); display_backlight(180);