What I want to accomplish
I would like to have remote terminal access to my NAS (which runs Debian Stretch) via an USB-RS232 adapter. As this machine is supposed to be headless, I would also like to see the boot process on the serial line.
(Still, for the sake of assessing this problem, there is a screen connected on the HDMI port at the moment.)
The actions I took
I appended console=ttyUSB0 to the kernel argument list. When booting, this causes my system to freeze.
The last lines of boot output are: (Bootloader is extlinux)
Loading /vmlinuz... ok Loading /initrd.img...ok Probing EDD (edd=off to disable)... ok When not using said kernel parameter the machine is booting without problems. From there on, I could accomplish serial terminal access easily by running
systemctl enable [email protected] systemctl start [email protected] on the remote server, and
screen -F /dev/ttyUSB0 9600 on my local machine. Hence, the USB-RS232 adapters are working correctly. The server is a Intel NUC 5CPYH with Braswell chipset and runs a Linux 4.9.0-4-amd64 debian kernel.
My question
Which actions do I have to take to get it working?
Edit № 1
When providing console=tty0 console=ttyUSB0,9600n8 as boot parameters the machine boots just fine, but I still cannot connect to the serial port. Also, systemctl status [email protected] says that the service is loaded and inactive (dead). I would have expected it to be up and running then.
Edit № 2
I did a bit of research and found out that my initramfs was lacking the relevant kernel modules. I managed to enter the initramfs shell by providing break=init as kernel parameter and saw that there was no /dev/ttyUSB0 device.
I added cp210x, pl2303 and ftdi_sio to /etc/initramfs-tools/modules and, after recreating the initramfs, saw that now there is a /dev/ttyUSB0 device in initramfs shell.
Still, I couldn't connect from my other machine. So I tried to start getty on that device manually:
# /sbin/getty -L 9600 /dev/ttyUSB0 vt100 getty: setsid: Operation not permitted # su root -c "/sbin/getty -L 9600 /dev/ttyUSB0 vt100" sh: su: not found So that's where I am now.
CONFIG_USB_SERIAL_CONSOLE=yto get boot messages on usb, and this is not often the case as it still marked "experimental".