init: change init tty
This commit is contained in:
parent
4225806394
commit
17cf067d10
@ -1,3 +1,3 @@
|
||||
init:1:wait:/sbin/rc default
|
||||
|
||||
user:1:once:/sbin/login /dev/ttyS0
|
||||
user:1:once:/sbin/login /dev/tty0
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user