Skip to content

Instantly share code, notes, and snippets.

@np422
Created January 13, 2012 13:17
Show Gist options
  • Save np422/1606068 to your computer and use it in GitHub Desktop.
Save np422/1606068 to your computer and use it in GitHub Desktop.
# Serial console for both OS and GRUB
echo "sx:2345:respawn:/sbin/agetty 9600 ttyS1 vt100" >> /etc/inittab
cd /boot/grub
mv grub.conf grub.conf.orig
cat <<EOF >grub.conf
serial --unit=1 --speed=9600
terminal --timeout=10 serial console
default=0
timeout=5
EOF
perl -e 'undef $/;$a=<>;$a =~ /^(title.*)/sm; $b=$1; $b =~ s/rhgb quiet/console=ttyS1,9600/g; print "$b\n";' < grub.conf.orig >>grub.conf
echo "ttyS0" >> /etc/securetty
echo "ttyS1" >> /etc/securetty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment