From a6870a617fb587b2ee48aed5a86a275c195ad1df Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 19 Dec 2025 16:22:24 +0800 Subject: [PATCH] add a confirmation argument to erasing the disk --- bao1x-boot/boot1/src/repl.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bao1x-boot/boot1/src/repl.rs b/bao1x-boot/boot1/src/repl.rs index 002189865..8de0130b8 100644 --- a/bao1x-boot/boot1/src/repl.rs +++ b/bao1x-boot/boot1/src/repl.rs @@ -459,6 +459,12 @@ impl Repl { } }, "baosec-init" => { + if !matches!(args.as_slice(), [s] if s == "confirm") { + return Err(Error::help( + "Usage: 'baosec-init confirm'. WARNING: erases external storage!", + )); + } + // this routine is used to initialize baosec products - sets the board type and // erases the off-chip FLASH use bao1x_api::{baosec::PDDB_LEN, baosec::PDDB_ORIGIN};