From: martin f. krafft Date: Thu, 13 Nov 2014 14:29:08 +0000 (+0100) Subject: improve post-setup serial console setup X-Git-Url: https://git.madduck.net/code/vinst.git/commitdiff_plain/3664764de897683e83aa4f41fc003a0475c74945?ds=sidebyside;hp=82f78b7c8d2a9efbce90ad2c9b72799a39de8672 improve post-setup serial console setup --- 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