grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Changes to 10_linux (based on grub2 1.98) to generate boot stan


From: Dante Cinco
Subject: [PATCH] Changes to 10_linux (based on grub2 1.98) to generate boot stanza for Xen hypervisor (fix for bug #30257)
Date: Fri, 25 Jun 2010 17:34:00 -0700


I have attached a patch that will add the capability in the 10_linux grub2 script to detect and generate boot stanzas in grub.cfg for Xen hypervisors (if present). It relies on the presence of CONFIG_XEN_DOM0=y to identify dom0 kernels and pairs them with each version of the hypervisor that is present. It uses the multiboot command for the Xen hypervisor image and the module command for the vmlinuz kernel and initrd.img. It also explicitly sources /etc/default/grub to define a new Xen-only variable called GRUB_CMDLINE_XEN_DEFAULT. The alternative is to export this in /usr/sbin/grub-mkconfig like the other GRUB variables. It will also generate a boot stanza for the dom0 kernel without the hypervisor (in case the hypervisor is broken).

There is a GNU GRUB bug filed on this which is bug #30257: 10_linux ignores xen hypervisor entries and dom0 kernels.

Here's an example of an actual Xen boot stanza. The dummy=dummy in the vmlinuz line is needed due to some bug in GRUB or Xen. Without it, the boot will hang or stop and hit the initramfs (BusyBox) prompt.

/boot/grub/grub.cfg:

menuentry 'xen-4.0 osa-dom0 , with Linux 2.6.32.15-xen' --class osa-dom0 --class gnu-linux --class gnu --class os {
recordfail
insmod lvm
insmod ext2
set root='(system-dom0_0)'
search --no-floppy --fs-uuid --set cc290394-fa2a-4e13-9024-3bc5a5b9215d
multiboot /boot/xen-4.0.gz  com1=115200,8n1 console=com1 dom0_mem=512M dom0_max_vcpus=1 dom0_vcpus_pin=true  iommu=1,passthrough,no-intremap  loglvl=all loglvl_guest=all loglevl=10 debug  apic=on apic_verbosity=verbose  extra_guest_irqs=80 acpi=force numa=on
module /boot/vmlinuz-2.6.32.15-xen dummy=dummy root=/dev/mapper/system-dom0_0 ro quiet  earlyprintk=xen loglevel=10 debug acpi=force console=hvc0,115200n8
module /boot/initrd.img-2.6.32.15-xen
}

/etc/default/grub:

GRUB_CMDLINE_XEN_DEFAULT=" com1=115200,8n1 console=com1 dom0_mem=512M dom0_max_vcpus=1 dom0_vcpus_pin=true  iommu=1,passthrough,no-intremap  loglvl=all loglvl_guest=all loglevl=10 debug  apic=on apic_verbosity=verbose  extra_guest_irqs=80 acpi=force numa=on"

- Dante Cinco

Attachment: 10_linux.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]