From 4ee948ea41020b80b773509890f6631fd4960004 Mon Sep 17 00:00:00 2001 From: namilsk Date: Wed, 31 Dec 2025 23:09:33 +0300 Subject: Added logs annotation to `README.md` --- init/src/main.rs | 2 +- init/src/mounts/fstab.rs | 13 +++++++------ init/src/mounts/mod.rs | 4 ++-- init/src/mounts/rescue.rs | 2 +- init/src/pid_one.rs | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) (limited to 'init') diff --git a/init/src/main.rs b/init/src/main.rs index bfcef87..1138ccf 100644 --- a/init/src/main.rs +++ b/init/src/main.rs @@ -5,6 +5,6 @@ use crate::pid_one::check_pid; fn main() -> Result<(), Box> { println!("Initializing your system."); - check_pid().expect("Runned not as PID 1."); + check_pid().expect("\x1b[31m * \x1b[0m Runned not as first process. init/src/pid_one.rs:8:8"); Ok(()) } diff --git a/init/src/mounts/fstab.rs b/init/src/mounts/fstab.rs index 4c43eac..0765cfd 100644 --- a/init/src/mounts/fstab.rs +++ b/init/src/mounts/fstab.rs @@ -47,9 +47,6 @@ fn parse_mount_options( Ok((flags, data)) } - - - pub fn mount_from_fstab(entries: &[FstabEntry]) -> Result<(), Box> { for entry in entries { if entry.fstype == "swap" { @@ -62,7 +59,7 @@ pub fn mount_from_fstab(entries: &[FstabEntry]) -> Result<(), Box Result<(), Box Result<(), Box> { ) .into()); } - println!("\x1b[32m * \x1b[0m Mounting {}...", target ); + println!("\x1b[32m * \x1b[0m Mounting {}...", target); } } diff --git a/init/src/pid_one.rs b/init/src/pid_one.rs index 84cca47..e4034ad 100644 --- a/init/src/pid_one.rs +++ b/init/src/pid_one.rs @@ -5,6 +5,6 @@ pub fn check_pid() -> Result<(), Box> { match pid { 1 => Ok(()), - _ => Err("Runned not as first process.".into()), + _ => Err(format!("Current PID: {}", pid).into()), } } -- cgit v1.2.3