/[sysadmin-cookbook]/recepies/amt/serial-console.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/amt/serial-console.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (show annotations)
Sun May 17 11:58:25 2009 UTC (14 years, 11 months ago) by dpavlin
File MIME type: application/x-sh
File size: 753 byte(s)
add serial console to grup and run update-grub
1 #!/bin/sh -x
2
3 # add AMT serial console to inittab
4
5 ttyS=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(ttyS[0-9]\).*$/\1/'`
6
7 if ! grep ttyS1 /etc/inittab | grep -v ^# ; then
8 echo "Am:2345:respawn:/sbin/getty $ttyS 115200 vt100-nav" >> /etc/inittab
9 init q
10 fi
11
12 ps ax | grep $ttyS | grep -v grep
13
14 grub=/boot/grub/menu.lst
15 tmp=/tmp/menu.lst
16
17 if ! grep '^# kopt=' $grub | grep console= ; then
18 cat $grub | sed "s/^\(# kopt=.*\)$/\1 console=$ttyS,115200/" > $tmp
19 else
20 cat $grub > $tmp
21 fi
22
23
24 if ! grep 'terminal *serial' $grub ; then
25 port=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(0xe[0-9a-f]*\).*$/\1/'`
26 echo "serial --port=$port --speed=115200" >> $tmp
27 echo "terminal serial" >> $tmp
28 fi
29
30 if ! diff -urw $grub $tmp ; then
31 mv $tmp $grub && update-grub
32 fi

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26