[configs/releng] Fixed and improved serial console support.
Current implementation fails if console=ttyS0 (without more options). Tested with: console=ttyS0 console=ttyS0,9600 console=ttyS0,38400 console=ttyS0,9600n8 console=ttyS0,38400n8r Closing FS#16232 Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
This commit is contained in:
parent
b6df75e79c
commit
708ba38c20
@ -16,20 +16,24 @@ do_locale_gen ()
|
|||||||
# start agetty on it too.
|
# start agetty on it too.
|
||||||
do_special_console()
|
do_special_console()
|
||||||
{
|
{
|
||||||
cmdline_console="$(kernel_cmdline console)"
|
local cmdline_console
|
||||||
[ $? -ne 0 ] && return
|
if cmdline_console=$(kernel_cmdline console); then
|
||||||
|
|
||||||
dev="${cmdline_console%%,*}"
|
|
||||||
args="${cmdline_console##*,}"
|
|
||||||
baud="${args%%[neo]*}" && baud="${baud:-"9600"}"
|
|
||||||
[ "x${args}" != "x${args%%r}" ] && rts="-h"
|
|
||||||
|
|
||||||
|
|
||||||
stat_busy "Starting agetty on console: ${cmdline_console}"
|
stat_busy "Starting agetty on console: ${cmdline_console}"
|
||||||
echo "${dev}" >> /etc/securetty
|
local port options baud rts
|
||||||
echo "z0:2345:respawn:/sbin/agetty ${rts} ${baud} ${dev} linux" >> /etc/inittab
|
port=${cmdline_console%%,*}
|
||||||
|
options=${cmdline_console#${port}}
|
||||||
|
options=${options#,}
|
||||||
|
baud=${options%%[neo]*}
|
||||||
|
[[ ${options} =~ r$ ]] && rts="-h"
|
||||||
|
if ! grep -q "^${port}" /etc/securetty; then
|
||||||
|
echo ${port} >> /etc/securetty
|
||||||
|
fi
|
||||||
|
if ! grep -q "^z0:" /etc/inittab; then
|
||||||
|
echo "z0:2345:respawn:/sbin/agetty -8 -s ${rts} ${baud:-9600} ${port} linux" >> /etc/inittab
|
||||||
|
fi
|
||||||
/sbin/telinit q
|
/sbin/telinit q
|
||||||
stat_done
|
stat_done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
Loading…
Reference in New Issue
Block a user