From 9f7bcf0f5916f6c12de40b3915c69428776ebc14 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 28 Sep 2016 10:29:47 -0600 Subject: [PATCH] Set file as login scheme --- Makefile | 5 +++-- programs/login/src/main.rs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f38b72f..2d96eb8 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ clean: cargo clean --manifest-path programs/login/Cargo.toml cargo clean --manifest-path programs/coreutils/Cargo.toml cargo clean --manifest-path schemes/example/Cargo.toml + cargo clean --manifest-path schemes/redoxfs/Cargo.toml rm -rf initfs/bin rm -rf filesystem/bin rm -rf build @@ -203,8 +204,8 @@ filesystem/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib rm $@.d drivers: \ - initfs/bin/ps2d \ - initfs/bin/vesad + filesystem/bin/ps2d \ + filesystem/bin/vesad coreutils: \ filesystem/bin/cat \ diff --git a/programs/login/src/main.rs b/programs/login/src/main.rs index 1e0ca13..ca273fb 100644 --- a/programs/login/src/main.rs +++ b/programs/login/src/main.rs @@ -11,6 +11,8 @@ pub fn main() { let sh = args.next().expect("login: no sh provided"); let sh_args: Vec = args.collect(); + env::set_current_dir("file:").expect("login: failed to cd to file:"); + let _ = syscall::close(2); let _ = syscall::close(1); let _ = syscall::close(0); @@ -26,9 +28,8 @@ pub fn main() { command.arg(arg); } - command.env("HOME", "initfs:"); - command.env("PWD", "initfs:bin"); - command.env("PATH", "initfs:bin"); + command.env("HOME", "file:home"); + command.env("PATH", "file:bin"); command.env("COLUMNS", "80"); command.env("LINES", "30"); command.env("TTY", &tty);