GRUB USB – GRUB and USB Serial Support

grublinuxusb

How to access the grub menu using a usb serial converter?

I know it's possible to have grub menu in serial console, putting these lines in grub.conf:

serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal serial

But with usb serial converter? In linux it is /dev/ttyUSB0 and I can use it to see boot messages.

Best Answer

Didn't tried it myself, but I've found this information on the coreboot wiki (https://www.coreboot.org/GRUB2#On_a_USB_serial_or_USB_debug_adapter)

To enable serial, first find out the name of your usb serial port trough:

insmod nativedisk # needed not to get the disk disapearing when insmoding the *hci
insmod ehci
insmod ohci
insmod uhci
insmod usb
insmod usbserial_pl2303
insmod usbserial_ftdi
insmod usbserial_usbdebug
terminal_output

The terminal_output command should print it:

grub> terminal_output 
Active output terminals:
serial_usb1 gfxterm 
Available output terminals:
console vga_text serial 
Here we can see "serial_usb1" so we now know that its name is usb1

Then add the following on top of your grub.cfg:

insmod nativedisk
insmod ehci
insmod ohci
insmod uhci
insmod usb
insmod usbserial_pl2303
insmod usbserial_ftdi
insmod usbserial_usbdebug
serial --speed=115200 --word=8 --parity=no --stop=1 usb1
terminal_output --append serial_usb1
terminal_input --append serial_usb1

The following chips/protocols are supported:

usbdebug
ftdi
pl2303

The Wiki is outdated, but the answer seems legit.

Related Question