X-Git-Url: https://git.madduck.net/code/vinst.git/blobdiff_plain/56ebc8501fd24ca8a2d1c7ecb224d7e667a26b86..fae448a5aa16aa50bbc5cf0fafd692d487754d18:/preseed/buster/commands/late_commands.d/enable_serial_console diff --git a/preseed/buster/commands/late_commands.d/enable_serial_console b/preseed/buster/commands/late_commands.d/enable_serial_console new file mode 100755 index 0000000..47768c0 --- /dev/null +++ b/preseed/buster/commands/late_commands.d/enable_serial_console @@ -0,0 +1,15 @@ +#!/bin/sh +echo "Enabling the serial console..." +if [ -f /etc/default/grub ]; then + #683124/#769406 requires the cmdline patch, and #444026 is for GRUB_TERMINAL: + sed -i -e '/^GRUB_CMDLINE_LINUX=/s/"$/ console=tty0 console=ttyS0,115200n8&/' \ + -e '/^GRUB_CMDLINE_LINUX=/s/=" /="/' \ + -e '/^GRUB_TERMINAL=/s/serial/"& console"/' \ + /etc/default/grub + update-grub +fi +if [ -f /etc/inittab ]; then + sed -i '/ttyS0/s/^#//;/ttyS0/s/9600 vt100/115200 linux/' /etc/inittab +else + echo "Not setting up a TTY on the serial port, presumably systemd will..." +fi