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:
parent
de38413966
commit
989c903efb
5
features.in/tty/README
Normal file
5
features.in/tty/README
Normal file
@ -0,0 +1,5 @@
|
||||
Эта фича занимается терминалами ввода-вывода, в первую очередь
|
||||
COM-портами (serial console).
|
||||
|
||||
Следует заметить, что systemd занимается развешиванием agetty
|
||||
самостоятельно.
|
9
features.in/tty/config.mk
Normal file
9
features.in/tty/config.mk
Normal 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)
|
18
features.in/tty/rootfs/image-scripts.d/50-serial
Executable file
18
features.in/tty/rootfs/image-scripts.d/50-serial
Executable 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
|
Loading…
Reference in New Issue
Block a user