Grub2 and serial consoles

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Grub2 and serial consoles

Keith Wessel-3

Hi,

 

Wondering if there’s a way to have grub2-mkconfig include the lines needed to enable a serial console in my grub.cfg. Can I add them to /etc/grub.d/40_custom, or does that come too late in the file? I’d rather not go hacking the headers include if I don’t have to, unless that’s the right thing to do and Portage will be nice enough to not overwrite it without first asking me.

 

I finally got around to upgrading to grub2! It went very smoothly. Since grub2-mkconfig is available, I saw no reason to do a manual configuration. I might have just found one, though.

 

I have a USB to serial adapter which I’ve been using as a great way to handle emergencies when the system won’t boot. I couldn’t ever find a way to get it working with legacy Grub, but it looks like, once I can identify the USB port it’s using, it’s a matter of loading a couple more modules and adding it to my terminal_input and terminal_output lines.

 

Qustion: can I add it to the 40_custom, 00_header, or something similar? Or will I need to start maintaining my own grub.cfg?

 

Thanks,

Keith

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Grub2 and serial consoles

Keith Wessel-3

After finding some docs for the values allowed in /etc/default/grub in the Grub2 docs here:

http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration

 

I’ve found what I believe are the answers to my questions. The following values need to be added to /etc/default/grub:

GRUB_TERMINAL=”console serial”

This is a shortcut for setting input and output separately since they both need to be set to console and serial.

GRUB_SERIAL_COMMAND=”serial --speed=115200 --word=8 --parity=no --stop=1 usb1”

The usb1 should be substituted for your USB port. This doesn’t seem to meet the syntax for the serial command described in the Grub2 docs; the usb1 on the end of the line isn’t listed. I’m pulling this from the link below and don’t know if it’ll actually work.

GRUB_PRELOAD_MODULES=”several_modules_go_here”

 

The list of possible modules and the process for identifying the USB port can be found in section 3.1.2 of this documentation:

http://www.coreboot.org/GRUB2

 

I still need to get sighted assistance to identify the USB port but suspect this will work. If anyone has successfully made this change to /etc/default/grub, I’d love to hear from you.

 

Keith

 

From: Keith Wessel [mailto:[hidden email]] On Behalf Of Keith Wessel
Sent: Thursday, April 02, 2015 4:30 PM
To: [hidden email]
Subject: Grub2 and serial consoles

 

Hi,

 

Wondering if there’s a way to have grub2-mkconfig include the lines needed to enable a serial console in my grub.cfg. Can I add them to /etc/grub.d/40_custom, or does that come too late in the file? I’d rather not go hacking the headers include if I don’t have to, unless that’s the right thing to do and Portage will be nice enough to not overwrite it without first asking me.

 

I finally got around to upgrading to grub2! It went very smoothly. Since grub2-mkconfig is available, I saw no reason to do a manual configuration. I might have just found one, though.

 

I have a USB to serial adapter which I’ve been using as a great way to handle emergencies when the system won’t boot. I couldn’t ever find a way to get it working with legacy Grub, but it looks like, once I can identify the USB port it’s using, it’s a matter of loading a couple more modules and adding it to my terminal_input and terminal_output lines.

 

Qustion: can I add it to the 40_custom, 00_header, or something similar? Or will I need to start maintaining my own grub.cfg?

 

Thanks,

Keith

 

Loading...