>HI all,
>
>I managed to modify the serial console speed in OBP from the default of 9600 
>to 19200 easily enoug
h. I updated the speed in my Lantronix Terminal server also and everything 
works good. I can intera
ct with OBP fine.
>
>Once the kernel boots though the speed of the console drops back to 9600. I 
>can't figure out why, 
or what to do about it. None of the google searches I've done have turned up 
anything but instructi
ons on changing OBP.
>
>Do I need to do something in /etc/ttydefs?
>
>Is 19200 as high as I can go?
>
>This is snv_48 and snv_46 if it matters.

It more complicated than that.

It is not yet well supported, here's the script I use; there's a bug
that says that this is too difficult.

The script allows setting the ttyspeed on terminal type.

On SPARC it will default to reconciliating the OBP, the kernel
and userland.

#!/bin/ksh -p
#
# Setting the console speed in the pertinent files on a Solaris
# system.
#
# All systems:
#       Change console speed line in /etc/ttydefs; let the rest be
#       the same
#
# SPARC
#       - match speed in /kernel/drv/options.conf
#       - max speed 38400
#       - tty select auto
#
# x86
#       - /kernel/drv/options.conf not relevant
#       - no max speed (as fast as hw goes)
#       - tty select through bootenv.rc
#
PATH=/usr/sbin:/usr/bin:/sbin
export PATH

FMRI=svc:/system/console-login

getproparg() {
        val=`svcprop -p $1 $FMRI`
        [ -n "$val" ] && echo $val
}


R=/
term=
while getopts R:t: c
do
        case $c in
        R)      R=$OPTARG;;
        t)      term=$OPTARG;;
        *)      echo "Usage: $0 [-R root] [-t ttytype] [speed]" 1>&2; exit 1;;
        esac
done
shift `expr $OPTIND - 1`

getparm ()
{
        eeprom "$1" | sed -e "s/$1=//"
}

dev=`getparm input-device`

if sparc && [ "$dev" = keyboard ]
then
        case "`prtconf -F 2>/dev/null`" in
        /*) ;;
        *) dev=ttya;;
        esac
fi

case "$dev" in
*available*) dev=keyboard;;
esac

if [ "$dev" = keyboard ]
then
        echo "Graphics console"
        exit 1
fi

mode=`getparm $dev-mode`

speed=`echo $mode | sed -e "s/,.*//"`

echo "Console device is $dev at $speed"
if [ ! -z "$1" ]
then
        speed=$1
        case "$speed" in
        9600|19200|38400|57600|76800|115200);;
        *) echo "unsupported speed" 1>&2 ; exit 1
        esac
        setprom=true
else
        setprom=false
fi

if sparc && [ $speed -gt 38400 ]
then
        echo "Openboot doesn't support speeds in excess of 38400" 1>&2
        exit 1
fi

#
# Unediting old modification files
#
for f in /lib/svc/method/console-login /etc/inittab
do
        if [ -f $R$f ]
        then
                break
        fi
done
perl -p -i -e s/console6/console/ $R$f

if [ -f $R/etc/ttydefs.upgrade ]
then
        mv $R/etc/ttydefs.upgrade $R/etc/ttydefs
        chmod 644 $R/etc/ttydefs
fi
#
# Remove old console 6
#
perl -p -i -e '$_ = "" if /^console[6789]/; s/console6/console/' $R/etc/ttydefs
#
# Install new console speed
#
cline="console:$speed hupcl opost onlcr:$speed::console"
perl -p -i -e "s/^console:.*/$cline/" $R/etc/ttydefs

if sparc
then
        case $speed in
        9600)   x=bd;;
        19200)  x=be;;
        38400)  x=bf;;
        *) echo "Bad SPARC console speed: $speed" 1>&2; exit 1;;
        esac

        perl -p -i -e "s/1805:b[def]/1805:$x/" $R/kernel/drv/options.conf

fi
if [ "$R" = "/" ]
then
        pkill ttymon
fi

if $setprom
then
        eeprom $dev-mode=$speed,8,n,1,-
        echo "Console ($dev) speed set to $speed"
fi

smf=/lib/svc/method/console-login 
if grep -s svccfg $R$smf > /dev/null 2>&1
then
        smf=
        if [ "$R" = "/" -a -n "$term" ]
        then
                svccfg <<EOF
                select system/console-login
                setprop ttymon/terminal_type = "$term"
                exit
EOF
        fi
fi
if [ -n "$term" ]
then
        for f in $smf /etc/inittab
        do
                if [ -f $R$f ]
                then
                        perl -p -i -e "s/-T \\S+/-T $term/" $R$f
                        echo "Setting console terminal type to \"$term\"".
                        break
                fi
        done
else
        if [ ! -n "$smf" ]
        then
                echo "Console terminal type is \"`getproparg 
ttymon/terminal_type`\"".
                
        else
                for f in $smf /etc/inittab
                do
                        if [ -f $R$f ]
                        then
                                term=`perl -n -e 'print "$1\n" if (/-T (\S+)/)' 
$R$f`
                                echo "Console terminal type is \"$term\"".
                                break
                        fi
                done
        fi
fi

rm -f $R/etc/inittab.save $R/etc/ttydefs.save
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to