Set file as login scheme

This commit is contained in:
Jeremy Soller 2016-09-28 10:29:47 -06:00
parent f2dcefc882
commit 9f7bcf0f59
2 changed files with 7 additions and 5 deletions

View file

@ -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 \

View file

@ -11,6 +11,8 @@ pub fn main() {
let sh = args.next().expect("login: no sh provided");
let sh_args: Vec<String> = 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);