aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 0b0ff19..bf254c1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -224,6 +224,11 @@ fn mount_or_halt(part_id: u8, mount_point: &str, fs: &str) -> UnmountDrop<Mount>
}
fn main() -> ExitCode {
+ if process::id() != 1 {
+ log!(Color::Red, "[ ERROR ] must be run as PID 1");
+ halt!();
+ }
+
let _boot_handle = mount_or_halt(1, "/boot", "vfat");
let _data_handle = mount_or_halt(4, "/data", "ext4");
let _proc_handle = Mount::builder()
@@ -239,11 +244,6 @@ fn main() -> ExitCode {
.mount("tmpfs", "/run")
.expect("can't mount /run tmpfs");
- if process::id() != 1 {
- log!(Color::Red, "[ ERROR ] must be run as PID 1");
- halt!();
- }
-
match start() {
Ok(_) => {}
Err(e) => log!(Color::Red, "[ ERROR ] {}", e),