From ec04d52c7e2880de5c0544608baf1c8becfd175b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 18 Jan 2024 15:09:15 -0700 Subject: [PATCH] Add unset builtin and update config path --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4ddb494549..489bb9200a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,6 +149,11 @@ pub fn run(file: &Path) -> Result<()> { println!("init: failed to set stdio: no argument"); } } + "unset" => { + for arg in args { + env::remove_var(&arg); + } + } _ => { let mut command = Command::new(cmd); for arg in args { @@ -174,8 +179,9 @@ pub fn run(file: &Path) -> Result<()> { } pub fn main() { - if let Err(err) = run(&Path::new("initfs:etc/init.rc")) { - println!("init: failed to run initfs:etc/init.rc: {}", err); + let config = "/scheme/initfs/etc/init.rc"; + if let Err(err) = run(&Path::new(config)) { + println!("init: failed to run {}: {}", config, err); } libredox::call::setrens(0, 0).expect("init: failed to enter null namespace");