Bug#555985: Missing xen support, regression from grub1
Goswin von Brederlow
goswin-v-b at web.de
Fri Nov 13 01:37:36 UTC 2009
Package: grub-pc
Version: 1.96+20090725-1
Severity: normal
Hi,
grub2 does not add entries for xen hypervisor and kernels. After
reading the docs I managed to create an entry manually like this:
menuentry "Xen 3.4, kernel 2.6.31.5 git 20091113" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 69c9f9d8-4772-4391-9111-e66ef6b49ac6
multiboot /xen-3.4-amd64.gz dom0_mem=512M
module /vmlinuz-2.6.31.5-xen-00513-g47dfde5 nomodeset
module /initrd.gz
}
I would suggest adding new variables to /etc/default/grub:
# Options for the xen hypervisor and kernel command line
#GRUB_CMDLINE_XEN_HYPERVISOR="dom0_mem=512M"
GRUB_CMDLINE_XEN_KERNEL="nomodeset"
and this in 10_linux ($3 == /boot/xen-3.4-amd64.gz for example):
xen_linux_entry ()
{
cat << EOF
menuentry "$1" {
EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
multiboot ${rel_dirname}/"$3" ${GRUB_CMDLINE_XEN_HYPERVISOR}
module ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2
EOF
if test -n "${initrd}" ; then
cat << EOF
module ${rel_dirname}/${initrd}
EOF
fi
cat << EOF
}
EOF
}
Now the tricky part is when to call that. There can be multiple
hypervisors installed (/boot/xen-<x>.<y>-<flavour>.gz). Also multiple
kernels (/boot/vmlinuz-*xen*). Xen kernels can also be for domU or
dom0+domU. In dom0 adding a domU kernel makes no sense. On the other
hand in domU adding non-xen kernels makes little sense.
So maybe /etc/defaults/grub should have a variable listing the pattern
for images that should be added:
# Add a menuentry for every linux kernel:
GRUB_PATTERN_LINUX="vmlinu[xz]*"
# Add a menuentry for every xen kernel:
GRUB_PATTERN_XEN="vmlinu[xz]*xen*"
# Add a menuentry only for dom0 xen kernel:
#GRUB_PATTERN_XEN="vmlinu[xz]*xen0*"
# Add a menuentry only for domU xen kernel:
#GRUB_PATTERN_XEN="vmlinu[xz]*xenu*"
and 10_linux could then use those to build its list of images.
How does that sound? Should I prepare a patch along those lines?
MfG
Goswin
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable-i386
APT policy: (1001, 'unstable-i386'), (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.29.4-frosties-2 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages grub-pc depends on:
ii debconf [debconf-2.0] 1.5.27 Debian configuration management sy
ii grub-common 1.96+20090725-1 GRand Unified Bootloader, version
ii libc6 2.10.1-2 GNU C Library: Shared libraries
ii ucf 3.0018 Update Configuration File: preserv
grub-pc recommends no packages.
Versions of packages grub-pc suggests:
pn desktop-base <none> (no description available)
ii genisoimage 9:1.1.9-1 Creates ISO-9660 CD-ROM filesystem
pn os-prober <none> (no description available)
-- debconf information excluded
More information about the Pkg-grub-devel
mailing list