diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 9514132..e9f1f8a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use std::io::Write; use std::process::{self, Command, ExitCode}; use std::thread; use std::time::Duration; +use sys_mount::{Mount, Unmount, UnmountFlags}; use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; fn start() -> anyhow::Result<()> { @@ -47,6 +48,12 @@ fn start() -> anyhow::Result<()> { fn main() -> ExitCode { let mut stdout = StandardStream::stdout(ColorChoice::Always); + let _mount = Mount::builder() + .fstype("vfat") + .mount("/dev/disk/by-partuuid/00000000-01", "/boot") + .expect("can't mount boot partition") + .into_unmount_drop(UnmountFlags::DETACH); + if process::id() != 1 { match stdout.set_color(ColorSpec::new().set_fg(Some(Color::Red))) { Ok(_) => match writeln!(&mut stdout, "Must be run as PID 1") { |