Denys Vlasenko | f5c2f72 | 2009-11-08 00:55:39 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Denys Vlasenko | f5c2f72 | 2009-11-08 00:55:39 +0100 | [diff] [blame] | 3 | user=root |
| 4 | baud=38400 |
| 5 | delay=3 |
| 6 | export TERM=linux |
| 7 | |
| 8 | tty="/dev/${PWD##*/getty_}" |
| 9 | |
| 10 | if ! test -e "$tty"; then |
| 11 | exec env - sleep 32000 |
| 12 | fi |
| 13 | |
| 14 | sleep "$delay" |
| 15 | |
| 16 | chown "$user" "$tty" # - devfs made happy |
| 17 | |
| 18 | exec <"$tty" >"$tty" 2>&1 |
| 19 | # using . in order to be able to set env (TERM etc) in cfg |
| 20 | test -x ./cfg && . ./cfg |
| 21 | |
| 22 | exec \ |
| 23 | env - "TERM=$TERM" PATH="$PATH" LOGIN_PRE_SUID_SCRIPT="$PWD/login.sh" \ |
Denys Vlasenko | f5c2f72 | 2009-11-08 00:55:39 +0100 | [diff] [blame] | 24 | getty "$baud" "$tty" "$TERM" |