Last active
February 13, 2018 23:51
-
-
Save joestringer/55f82d4c96396a648ee0cc5dc2699bde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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