Skip to content

Commit

Permalink
read cmdline for skip_confirmation flag
Browse files Browse the repository at this point in the history
This enables the sdcard to flash an given image without explicit
confirmation of the user.
  • Loading branch information
svenrademakers committed May 22, 2024
1 parent 217a36e commit 4467850
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/bin/sdcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,13 @@ fn main() -> ! {
}),
];

// Ready...
eprintln!("{INSTRUCTIONS}");
let _ = led_tx.send(led::LED_READY);
wait_for_confirmation();
let cmdline = fs::read_to_string("/proc/cmdline").unwrap_or_default();
if !cmdline.contains("skip_confirmation") {
// Ready...
eprintln!("{INSTRUCTIONS}");
let _ = led_tx.send(led::LED_READY);
wait_for_confirmation();
}

// ...go!
howudoin::init(howudoin::consumers::TermLine::default());
Expand Down

0 comments on commit 4467850

Please sign in to comment.