--- recepies/amt/serial-console.sh 2009/08/24 18:41:39 134 +++ recepies/amt/serial-console.sh 2009/08/25 17:48:56 135 @@ -2,11 +2,11 @@ # add AMT serial console to inittab -ttyS=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(ttyS[0-9]\).*$/\1/'` +ttyS=`dmesg | grep ttyS | grep 0x | tail -1 | sed 's/^.*\(ttyS[0-9]\).*$/\1/'` test -z "$ttyS" && echo "Can't find serial port in dmesg output" && exit -if ! grep ttyS1 /etc/inittab | grep -v ^# ; then +if ! grep $ttyS /etc/inittab | grep -v ^# ; then echo "Am:2345:respawn:/sbin/getty $ttyS 115200 vt100-nav" >> /etc/inittab init q fi @@ -16,6 +16,8 @@ grub=/boot/grub/menu.lst tmp=/tmp/menu.lst +test -f $grub || exit + if ! grep '^# kopt=' $grub | grep console= ; then cat $grub | sed "s/^\(# kopt=.*\)$/\1 console=$ttyS,115200 console=tty0/" > $tmp else