Bug#627226: grub-common: Support for different options for Linux and Xen Linux kernels
Pawel Tecza
PTecza at icm.edu.pl
Wed May 18 20:13:29 UTC 2011
Package: grub-common
Version: 1.98+20100804-14
Severity: wishlist
Tags: patch
Hello,
I need to pass different options for Linux and Xen Linux kernels on my
server. Please look at the exemplary menu entries below:
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 and XEN
4.0-amd64' --class debian --class gnu-linux --class gnu --class os
--class xen {
insmod raid
insmod mdraid
insmod lvm
insmod part_gpt
insmod part_gpt
insmod ext2
set root='(lvm0-dom0)'
search --no-floppy --fs-uuid --set
5e6467b4-b670-4ea7-9fb3-9f45b94c93fe
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
multiboot /boot/xen-4.0-amd64.gz placeholder com1=9600,8n1
console=com1,vga dom0_mem=1024M
module /boot/vmlinuz-2.6.32-5-xen-amd64 placeholder
root=/dev/mapper/lvm0-dom0 ro console=tty0 console=hvc0 3
echo 'Loading initial ramdisk ...'
module /boot/initrd.img-2.6.32-5-xen-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64' --class
debian --class gnu-linux --class gnu --class os {
insmod raid
insmod mdraid
insmod lvm
insmod part_gpt
insmod part_gpt
insmod ext2
set root='(lvm0-dom0)'
search --no-floppy --fs-uuid --set
5e6467b4-b670-4ea7-9fb3-9f45b94c93fe
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
linux /boot/vmlinuz-2.6.32-5-xen-amd64
root=/dev/mapper/lvm0-dom0 ro console=tty0 console=ttyS0,9600n8 2
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-5-xen-amd64
}
As you can see I use different consoles for these kernels. I can't set
them in only one GRUB_CMDLINE_LINUX variable in /etc/default/grub file,
because grub-update command will use it for any my Linux kernels...
So I've patched 20_linux_xen and grub-mkconfig scripts and added new
GRUB_CMDLINE_LINUX_XEN variable for options of Xen Linux kernels:
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,9600n8 2"
GRUB_CMDLINE_LINUX_XEN="console=tty0 console=hvc0 3"
Of course, GRUB_CMDLINE_LINUX_XEN is optional variable. grub-update will
use GRUB_CMDLINE_LINUX if the new variable is unset or empty.
I believe that now GRUB_CMDLINE_XEN and GRUB_CMDLINE_LINUX_XEN is the
same pair like xenhopt and xenopt for old Grub.
I'm attaching my simple patch. Feel free to use it if you want.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRUB_CMDLINE_LINUX_XEN.patch
Type: text/x-patch
Size: 1194 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110518/34318afa/attachment-0003.bin>
More information about the Pkg-grub-devel
mailing list