Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 413805 - sys-boot/grub-2: help on alternating serial/non-serial configs
Summary: sys-boot/grub-2: help on alternating serial/non-serial configs
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 23:05 UTC by Robin Johnson
Modified: 2012-06-25 03:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-04-27 23:05:14 UTC
(Background: three new infra boxes are EFI, and grub1 doesn't work there, so I'm getting grub2 sorted for infra use).

For infra boxes, we already generate the grub1 grub.conf. 
Our configurations alternate between serial and non-serial on most machines.
So every kernel has two entries, a serial one, and a non-serial one.
What's the best way of doing this with the new grub2?

Also, I can't find what the conversion of the timeout parameter on the terminal command is. I assume we need to have both terminal_input and terminal_output in grub2?

From the generated infra grub.conf:
serial --unit=1 --port=0x2f8 --speed=115200
terminal --timeout=5 console serial
# Options for cfengine:
##root (hd0,0)
##args root=/dev/md2 panic=180
##serial console=ttyS1,115200n8 console=tty0

title     Gentoo Linux (2.6.39-hardened-r8-infra18) (serial)
root      (hd0,0)
kernel    /boot/bzImage-2.6.39-hardened-r8-infra18.amd64 root=/dev/md2 panic=180 console=ttyS1,115200n8 console=tty0

title     Gentoo Linux (2.6.39-hardened-r8-infra18) (2.6.39-hardened-r8-infra18)
root      (hd0,0)
kernel    /boot/bzImage-2.6.39-hardened-r8-infra18.amd64 root=/dev/md2 panic=180

title     Gentoo Linux (2.6.39-hardened-r1-infra17) (serial)
root      (hd0,0)
kernel    /boot/bzImage-2.6.39-hardened-r1-infra17.amd64 root=/dev/md2 panic=180 console=ttyS1,115200n8 console=tty0

title     Gentoo Linux (2.6.39-hardened-r1-infra17) (2.6.39-hardened-r1-infra17)
root      (hd0,0)
kernel    /boot/bzImage-2.6.39-hardened-r1-infra17.amd64 root=/dev/md2 panic=180
...
Comment 1 Mike Gilbert gentoo-dev 2012-04-28 03:55:16 UTC
(In reply to comment #0)
> (Background: three new infra boxes are EFI, and grub1 doesn't work there, so
> I'm getting grub2 sorted for infra use).
> 
> For infra boxes, we already generate the grub1 grub.conf. 
> Our configurations alternate between serial and non-serial on most machines.
> So every kernel has two entries, a serial one, and a non-serial one.
> What's the best way of doing this with the new grub2?

If you are using grub-mkconfig, I think you want to modify /etc/grub.d/10_linux to create another entry. That may be as simple as adding a linux_entry call somewhere around line 242.

This seems like a bit of a special case, so you may want to just copy the logic from 10_linux into whatever script you are currently using to generate grub.conf.

> Also, I can't find what the conversion of the timeout parameter on the
> terminal command is. I assume we need to have both terminal_input and
> terminal_output in grub2?

I'm not sure on this one; I can't find it in the docs. I suggest asking in #grub on Freenode or mailing help-grub@gnu.org.
Comment 2 Mike Gilbert gentoo-dev 2012-06-25 03:41:10 UTC
I think upstream answered your questions in IRC.