X-Git-Url: https://git.madduck.net/code/vinst.git/blobdiff_plain/10cac4edfc25c11d66c0950c22371c2f7a3fe615..d0c115dd764b56f005827e7df010af8f21d85e22:/preseed/jessie/commands/late_commands.d/enable_serial_console diff --git a/preseed/jessie/commands/late_commands.d/enable_serial_console b/preseed/jessie/commands/late_commands.d/enable_serial_console index 09f8acb..47768c0 100755 --- a/preseed/jessie/commands/late_commands.d/enable_serial_console +++ b/preseed/jessie/commands/late_commands.d/enable_serial_console @@ -1,9 +1,15 @@ #!/bin/sh echo "Enabling the serial console..." -#683124 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 -sed -i '/ttyS0/s/^#//;/ttyS0/s/9600 vt100/115200 linux/' /etc/inittab +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