/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 88 by dpavlin, Mon May 18 15:21:22 2009 UTC revision 89 by dpavlin, Tue May 19 17:56:59 2009 UTC
# Line 17  grub=/boot/grub/menu.lst Line 17  grub=/boot/grub/menu.lst
17  tmp=/tmp/menu.lst  tmp=/tmp/menu.lst
18    
19  if ! grep '^# kopt=' $grub | grep console= ; then  if ! grep '^# kopt=' $grub | grep console= ; then
20          cat $grub | sed "s/^\(# kopt=.*\)$/\1 console=tty0 console=$ttyS,115200/" > $tmp          cat $grub | sed "s/^\(# kopt=.*\)$/\1 console=$ttyS,115200 console=tty0/" > $tmp
21  else  else
22          cat $grub > $tmp          cat $grub > $tmp
23  fi  fi
# Line 25  fi Line 25  fi
25    
26  if ! grep 'terminal *serial' $grub ; then  if ! grep 'terminal *serial' $grub ; then
27          port=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(0xe[0-9a-f]*\).*$/\1/'`          port=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(0xe[0-9a-f]*\).*$/\1/'`
28          echo "serial --port=$port --speed=115200" >> $tmp          cat $tmp | sed "s/\(### BEGIN AUTOMAGIC KERNELS LIST\)/serial --port=$port --speed=115200\nterminal serial\n\n\1/" >> $tmp.serial && mv $tmp.serial $tmp || exit
         echo "terminal serial" >> $tmp  
29  fi  fi
30    
31  if ! diff -urw $grub $tmp ; then  if ! diff -urw $grub $tmp ; then

Legend:
Removed from v.88  
changed lines
  Added in v.89

  ViewVC Help
Powered by ViewVC 1.1.26