Cannot enable the serial console

I am trying, and failing miserably, to connect to the serial console on a laptop running Tumbleweed, from another laptop running Leap.

The first laptop does not suspend properly (cannot resume from suspend) and I would like to capture the serial console output in order to help debug. Since neither laptop has a serial port I’m connecting them with a usb-serial adapter on each end and a null modem serial cable between.

I’ve tried following this https://wiki.archlinux.org/index.php/Working_with_the_serial_console since, as far as I can tell, it is the most up to date guide. (Most other guides seem rather out of date, e.g. instructing to edit the /etc/inittab file, which does not exist).

Here are the kernel options I have set on the machine I’m trying to connect to:


quiet splash=silent resume=/dev/sda7 showopts no_console_suspend initcall_debug ignore_loglevel dyndbg="file suspend.c +p" console=ttyUSB0,115200n8 console=ttyS0,115200n8

and the serial console arguments from /etc/default/grub:


GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --parity=no --word=8"


and the output of `dmesg | grep tty’


    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.7.0-1.g24f30d5-default root=UUID=5329142e-1bb9-4dba-a67f-286177464189 quiet splash=silent resume=/dev/sda7 showopts no_console_suspend initcall_debug ignore_loglevel "dyndbg=file suspend.c +p" console=ttyUSB0,115200n8
    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.7.0-1.g24f30d5-default root=UUID=5329142e-1bb9-4dba-a67f-286177464189 quiet splash=silent resume=/dev/sda7 showopts no_console_suspend initcall_debug ignore_loglevel "dyndbg=file suspend.c +p" console=ttyUSB0,115200n8
    0.743575] calling  tty_class_init+0x0/0x2f @ 1
    0.743585] initcall tty_class_init+0x0/0x2f returned 0 after 0 usecs
    4.791121] tty tty38: hash matches
   10.587660] usb 1-2: pl2303 converter now attached to ttyUSB0
   11.066179] calling  pkttype_mt_init+0x0/0x1000 [xt_pkttype] @ 1175
   11.066183] initcall pkttype_mt_init+0x0/0x1000 [xt_pkttype] returned 0 after 0 usecs
  574.249722] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
 2112.975179] usb 1-2: pl2303 converter now attached to ttyUSB0
 2338.882992] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
 2488.153215] usb 1-3.1: pl2303 converter now attached to ttyUSB0
[43271.763213] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0


I’ve tried using minicom and gtkterm on the laptop I want to connect from; with port ttyUSB0 speed 115200. From what I understand when I reboot the laptop I want to connect to the output should come up on the other laptop, but nothing happens.

I’m kind of out of my depth here, so obviously I’m doing something wrong. Any help would be greatly appreciated.

Both in kernel and grub this is likely (missing) drivers. To use USB serial as console USB drivers must be built into kernel; but all distributions I am aware of build them as modules which are loaded too late. GRUB needs extra drivers for USB too (actually it needs extra drivers even for plain serial port, but it tries to guess and autoload them), and those drivers are not loaded automatically.

You may try netconsole. It is external module that can be loaded after system is booted; so you can point it to existing interface. Boot, load netconsole, try to suspend. I remember catching some suspend bugs this way.

I’d suggest…

You first outline your objectives,
Then think about what level of system access you need to gather information about your objective, for instance

  • Do you need real time access?
  • Do you need only BIOS level access, then Grub level access (pre-boot OS), then full OS?
  • If you really need a serial console, do you need a real console or will a virtual console work?

To track what is happening during a logoff/Standby/Hibernation/Shutdown, I don’t think you need real time or low level access, you should likely be able to collect pertinent info from the system logs (possibly turning up the debugging level). Depending on what you want to look at, I’d also suspect that pertinent data for restarting should also be in the system logs (journal).

TSU

@tsu2

Basically I am trying to follow this guide: https://01.org/blogs/rzhang/2015/best-practice-debug-linux-suspend/hibernate-issues which suggests using the serial console to capture as much logging information as possible. In my particular case, real time and low level access is not important. What I would like is as much logging information as possible from when the suspend command is issued. For that reason I don’t think I need BIOS or grub access, and a virtual console would do.

If there is an easier way to get this information I’d be grateful to know about it (because I’ve spent enough time trying to get the serial console working :)).

@arvidjaar

Thanks for telling me about netconsole; I had not heard of it. I’ll be sure to give it a try.

Is there a version of the kernel on the OBS that has the usb-serial driver built in? How would I enable the drivers for grub?