how to re-enable input on a serial console

10,588

The busybox example inittab looks a little different,

# Example of how to put a getty on a serial line (for a terminal)
#
#::respawn:/sbin/getty -L ttyS0 9600 vt100
#::respawn:/sbin/getty -L ttyS1 9600 vt100

could you give this a try?

Share:
10,588

Related videos on Youtube

CuriousPuzzleSolver
Author by

CuriousPuzzleSolver

Updated on September 18, 2022

Comments

  • CuriousPuzzleSolver
    CuriousPuzzleSolver over 1 year

    I have an old router which runs Linux and I'd like to have a serial console on. This used to work fine, but after a firmware update, I can now only get output on the console and cannot give any input back to the device. During boot there is a line that says "Console input is disabled" that wasn't there before.

    Without changing the firmware, how do I re-enable input on the serial console?

    ... my attempts so far ...

    I can log in over the LAN and load any files (and cross compile tools if need be), and there is a small non-volatile user flash partition, so any solution requiring me to write a quick program using ioctl or whatnot is fine. The embedded Linux has the system files like /sys/bus and /sys/devices/platform/serial8250.0 and so on in case that is useful. The files /dev/console, /dev/ttyS0, /dev/tty all have read and write permissions. Running getty -L 115200 ttyS0 makes a login prompt appear on the serial console, but I can't get it to accept any input. Adding the line

    ::respawn:-/bin/sh
    

    to inittab makes busybox give a shell prompt ... but again, the serial console won't take input.

    dmesg reports

    Kernel command line: root=/dev/ram rw init=/init console=ttyS0,115200
    

    and stty gives

    speed 38400 baud; line=0;  
    

    along with a bunch of unimportant looking settings, stty -a -F /dev/ttyS0 gives

    speed 115200 baud; stty: /dev/ttyS0  
    line = 0;  
    

    (and a whole bunch of settings that don't look important, but I'll type them up if people need them.)

    I'm at a loss here, so I'm not sure what information is needed.
    Any ideas for solving this puzzle? I have a feeling there is something simple I forgot to try.

    • kurtm
      kurtm over 10 years
      So this is special-purpose hardware that runs Linux as its firmware? They may have changed a hardware setting to prevent reading the input. Would a stty -a (lists all stty settings) give us more clues? Perhaps the kernel boot string specifies some different options now?
  • CuriousPuzzleSolver
    CuriousPuzzleSolver over 12 years
    Same as before, it makes a login prompt appear on the serial console, but I can't give it any input. I need to somehow enable input on /dev/console or something.