init: Introduce switchroot command

This sets PATH, LD_LIBRARY_PATH and runs init scripts for the new root.
In the future this could replace the entire set of services that should
run, restarting any services for which a newer executable is available
in the new root and stopping any services which don't exist in the new
root. This behavior could also be useful for soft-reboots in the future
to handle updates without rebooting the entire system.
This commit is contained in:
bjorn3
2026-02-19 20:18:07 +01:00
parent a5168828ad
commit 0227c0677c
5 changed files with 45 additions and 44 deletions
+1
View File
@@ -100,6 +100,7 @@ pub fn main() -> ! {
.filter(|var| !var.starts_with(b"INITFS_"))
.collect::<Vec<_>>()
};
envs.push(b"RUST_BACKTRACE=1");
//envs.push(b"LD_DEBUG=all");
envs.push(b"LD_LIBRARY_PATH=/scheme/initfs/lib");