1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! FlashKraft TUI — binary entry point
//!
//! This file is intentionally thin. All application logic lives in
//! `lib.rs` and the `tui/` submodules so that examples and integration
//! tests can import from `flashkraft_tui::` without also pulling in the
//! `main` function.
//!
//! ## Privilege model
//!
//! The installed binary carries the **setuid-root** bit:
//!
//! ```text
//! sudo chown root:root /usr/bin/flashkraft-tui
//! sudo chmod u+s /usr/bin/flashkraft-tui
//! ```
//!
//! At startup we capture the **real** (unprivileged) UID via
//! `nix::unistd::getuid()` and store it via
//! `flashkraft_core::flash_helper::set_real_uid`. The flash pipeline then
//! uses it to drop back to the real user immediately after opening the block
//! device file descriptor.
//!
//! No child process is spawned. No pkexec. No polkit policy file needed.
async