initial tty feature

This one only cares for serial console(s) in sysvinit case now
but might end up controlling the number of gettys for ve/vm, etc.
This commit is contained in:
Michael Shigorin 2013-08-09 15:08:28 +00:00
parent de38413966
commit 989c903efb
3 changed files with 32 additions and 0 deletions

5
features.in/tty/README Normal file
View File

@ -0,0 +1,5 @@
Эта фича занимается терминалами ввода-вывода, в первую очередь
COM-портами (serial console).
Следует заметить, что systemd занимается развешиванием agetty
самостоятельно.

View File

@ -0,0 +1,9 @@
use/tty:
@$(call add_feature)
@$(call xport,TTY_DEV)
@$(call xport,TTY_RATE)
use/tty/S0: use/tty
@$(call add,THE_PACKAGES,agetty)
@$(call add,TTY_DEV,ttyS0)
@$(call set,TTY_RATE,115200)

View File

@ -0,0 +1,18 @@
#!/bin/sh
# setup serial console access
BIN=/sbin/agetty
CFG=/etc/inittab
SEC=/etc/securetty
[ -n "$GLOBAL_TTY_DEV" -a -n "$GLOBAL_TTY_RATE" ] || exit 0
[ -s "$CFG" -a -x "$BIN" ] || exit 0
if ! grep -q "$BIN" "$CFG"; then
n=0
for t in $GLOBAL_TTY_DEV; do
grep -q "$t" "$SEC" || echo "$t" >> "$SEC"
echo "T$n:345:respawn:$BIN -L $t $GLOBAL_TTY_RATE vt100" >> $CFG
n=$(($n+1))
done
fi