]> git.madduck.net Git - code/vinst.git/blob - preseed/buster/commands/late_commands.d/enable_serial_console

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

change to buster
[code/vinst.git] / preseed / buster / commands / late_commands.d / enable_serial_console
1 #!/bin/sh
2 echo "Enabling the serial console..."
3 if [ -f /etc/default/grub ]; then
4   #683124/#769406 requires the cmdline patch, and #444026 is for GRUB_TERMINAL:
5   sed -i -e '/^GRUB_CMDLINE_LINUX=/s/"$/ console=tty0 console=ttyS0,115200n8&/' \
6         -e '/^GRUB_CMDLINE_LINUX=/s/=" /="/' \
7         -e '/^GRUB_TERMINAL=/s/serial/"& console"/' \
8         /etc/default/grub
9   update-grub
10 fi
11 if [ -f /etc/inittab ]; then
12   sed -i '/ttyS0/s/^#//;/ttyS0/s/9600 vt100/115200 linux/' /etc/inittab
13 else
14   echo "Not setting up a TTY on the serial port, presumably systemd will..."
15 fi