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
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 serial-get[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.
Which actions do I have to take to get it working?
Edit № 1
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
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
/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.