Skip to content

Instantly share code, notes, and snippets.

@joestringer
Last active February 13, 2018 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joestringer/55f82d4c96396a648ee0cc5dc2699bde to your computer and use it in GitHub Desktop.
Save joestringer/55f82d4c96396a648ee0cc5dc2699bde to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Run as root" 2>&1
exit 1
fi
if [ ! -e /etc/init/ttyS0.conf ]; then
cat << EOF > /etc/init/ttyS0.conf
# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]
respawn
exec /sbin/getty -L 115200 ttyS0 vt102
EOF
fi
systemctl start getty@ttyS0
modprobe kgdboc kgdboc=ttyS0,115200
echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment