boot – Unable to use ttyUSB0 as console


I have a server (Ubuntu 20.04.1 Kernel 5.4.0-42-generic) that is meant to be headless and able to be remote rebooted (with encrypted root) I have a USB to Serial adapter in the machine and was wanting to use this as a console at boot time to enable headless/remote unlocking of the encrypted root.

I am able to successfully connect to the console once host is booted after enabling serial-getty@ttyUSB0.service so the adapter works and is cabled correctly.

I have added “console=tty0 console=ttyUSB0” to GRUB at boot time but this appears to be outright ignored by the kernel.

$ dmesg | grep tty
(    0.000000) Command line: BOOT_IMAGE=/vmlinuz-5.4.0-42-generic root=/dev/mapper/host--vg-host_root--lv ro ipv6.disable=1 console=tty0 console=ttyUSB0
(    0.056872) Kernel command line: BOOT_IMAGE=/vmlinuz-5.4.0-42-generic root=/dev/mapper/host--vg-host_root--lv ro ipv6.disable=1 console=tty0 console=ttyUSB0
(    0.115389) printk: console (tty0) enabled
(    0.458997) 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
(   54.731750) usb 1-1.5: pl2303 converter now attached to ttyUSB0

I have tested using “console=tty0 console=ttyS0” which appears to work though I have no serial port connected to that interface so unable to verify and would prefer to have this working via USB rather than needing to source a port header

$ dmesg | grep tty
(    0.000000) Command line: BOOT_IMAGE=/vmlinuz-5.4.0-42-generic root=/dev/mapper/host--vg-host_root--lv ro ipv6.disable=1 console=ttyS0 console=tty0
(    0.056348) Kernel command line: BOOT_IMAGE=/vmlinuz-5.4.0-42-generic root=/dev/mapper/host--vg-host_root--lv ro ipv6.disable=1 console=ttyS0 console=tty0
(    0.115326) printk: console (tty0) enabled
(   26.469014) printk: console (ttyS0) enabled
(   40.385803) 00:05: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
(   51.949414) tty tty40: hash matches
(   87.762789) systemd(1): Created slice system-serialx2dgetty.slice.
(   91.428703) usb 1-1.5: pl2303 converter now attached to ttyUSB0

My current theory is that the kernel has not been compiled with CONFIG_USB_SERIAL_CONSOLE enabled.

So my questions…

  1. Is my theory correct and I am unable to do this with current kernel build?
    1a) If so is there any way to request this be added in future kernel builds?
  2. Is there something I am missing that would get this to work?

Any assistance would be appreciated.
Cheers