init: change init tty

This commit is contained in:
Mark Poliakov 2023-11-06 10:38:38 +02:00
parent 4225806394
commit 17cf067d10
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,3 @@
init:1:wait:/sbin/rc default
user:1:once:/sbin/login /dev/ttyS0
user:1:once:/sbin/login /dev/tty0

View File

@ -26,8 +26,9 @@ fn login_readline<R: BufRead + AsRawFd>(
reader.read_line(buf)
}
fn login_as(_username: &str, _password: &str) -> Result<(), std::io::Error> {
fn login_as(username: &str, _password: &str) -> Result<(), std::io::Error> {
let mut shell = Command::new("/bin/sh").spawn()?;
println!("Hello {:?}", username);
shell.wait()?;
Ok(())
}
@ -37,7 +38,7 @@ fn login_attempt(erase: bool) -> Result<(), std::io::Error> {
let mut stdout = stdout();
if erase {
print!("\x1b[0;0H\x1b[2J");
print!("\x1b[1;1f\x1b[2J");
stdout.flush().ok();
}