Bug#633127: /etc/grub/20_linux does not recognise some old Xen kernels

Ian Campbell ijc at hellion.org.uk
Sun Jul 10 19:41:43 UTC 2011


On Fri, 2011-07-08 at 17:07 +0100, Ian Jackson wrote:
> Package: grub-common
> Version: 1.98+20100804-14
> Tags: patch
> 
> From /etc/grub/20_linux_xen:
> | linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
> |         basename=$(basename $i)
> |         version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
> |         if grub_file_is_not_garbage "$i" && grep -qx "CONFIG_XEN_DOM0=y" /boot/config-${version} 2> /dev/null ; then echo -n "$i " ; fi
> |       done`
> | xen_list=`for i in /boot/xen*; do
> |         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
> |       done`
> 
> This checks for CONFIG_XEN_DOM0=y.  However, older "traditional"
> (non-dom0-pvops) kernels use a different configuration option for
> this (see below).

FWIW pv-ops kernels have a dummy symbol called XEN_PRIVILEGED_GUEST
(selected by XEN_DOM0) in order to remain compatible with tools which
were written against the traditional kernels so it is only really
necessary to check for the PRIVILEGE_GUEST name.

Ian.

> 
> People may continue to use these old kernels for a variety of reasons.
> So I suggest that this test should be changed:
> 
> 
> --- /etc/grub.d/20_linux_xen~   2011-01-17 23:37:04.000000000 +0000
> +++ /etc/grub.d/20_linux_xen    2011-07-08 17:06:01.000000000 +0100
> @@ -92,7 +92,7 @@
>  linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
>         basename=$(basename $i)
>         version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
> -        if grub_file_is_not_garbage "$i" && grep -qx "CONFIG_XEN_DOM0=y" /boot/config-${version} 2> /dev/null ; then echo -n "$i " ; fi
> +        if grub_file_is_not_garbage "$i" && grep -qx 'CONFIG_XEN_\(DOM0\|PRIVILEGED_GUEST\)=y' /boot/config-${version} 2> /dev/null ; then echo -n "$i " ; fi
>        done`
>  xen_list=`for i in /boot/xen*; do
>          if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
> 
> 
> Thanks,
> Ian.
> 
> root at gall-mite:~# grep CONFIG_XEN /boot/config-2.6.27.45-0.1.1 
> CONFIG_XEN_SAVE_RESTORE=y
> CONFIG_XEN_PCIDEV_FRONTEND=y
> # CONFIG_XEN_PCIDEV_FE_DEBUG is not set
> CONFIG_XEN=y
> CONFIG_XEN_INTERFACE_VERSION=0x00030207
> CONFIG_XEN_PRIVILEGED_GUEST=y
> # CONFIG_XEN_UNPRIVILEGED_GUEST is not set
> CONFIG_XEN_PRIVCMD=y
> CONFIG_XEN_XENBUS_DEV=y
> CONFIG_XEN_NETDEV_ACCEL_SFC_UTIL=m
> CONFIG_XEN_BACKEND=y
> CONFIG_XEN_BLKDEV_BACKEND=y
> CONFIG_XEN_BLKDEV_TAP=y
> CONFIG_XEN_BLKBACK_PAGEMAP=y
> CONFIG_XEN_NETDEV_BACKEND=y
> CONFIG_XEN_NETDEV_ACCEL_SFC_BACKEND=m
> CONFIG_XEN_PCIDEV_BACKEND=y
> CONFIG_XEN_PCIDEV_BACKEND_VPCI=y
> # CONFIG_XEN_PCIDEV_BACKEND_PASS is not set
> # CONFIG_XEN_PCIDEV_BACKEND_SLOT is not set
> # CONFIG_XEN_PCIDEV_BACKEND_CONTROLLER is not set
> # CONFIG_XEN_PCIDEV_BE_DEBUG is not set
> CONFIG_XEN_TPMDEV_BACKEND=m
> CONFIG_XEN_SCSI_BACKEND=m
> CONFIG_XEN_BLKDEV_FRONTEND=y
> CONFIG_XEN_NETDEV_FRONTEND=y
> CONFIG_XEN_NETDEV_ACCEL_SFC_FRONTEND=m
> CONFIG_XEN_SCSI_FRONTEND=m
> CONFIG_XEN_GRANT_DEV=y
> CONFIG_XEN_FRAMEBUFFER=y
> CONFIG_XEN_KEYBOARD=y
> CONFIG_XEN_DISABLE_SERIAL=y
> CONFIG_XEN_SYSFS=y
> # CONFIG_XEN_COMPAT_030002_AND_LATER is not set
> # CONFIG_XEN_COMPAT_030004_AND_LATER is not set
> # CONFIG_XEN_COMPAT_030100_AND_LATER is not set
> CONFIG_XEN_COMPAT_030200_AND_LATER=y
> # CONFIG_XEN_COMPAT_LATEST_ONLY is not set
> CONFIG_XEN_COMPAT=0x030200
> CONFIG_XEN_SMPBOOT=y
> CONFIG_XEN_DEVMEM=y
> CONFIG_XEN_BALLOON=y
> CONFIG_XEN_SCRUB_PAGES=y
> root at gall-mite:~#
> 
> 
> 
> _______________________________________________
> Pkg-grub-devel mailing list
> Pkg-grub-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grub-devel
> 

-- 
Ian Campbell


It is not doing the thing we like to do, but liking the thing we have to do,
that makes life blessed.
		-- Goethe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20110710/d939d0e6/attachment-0001.pgp>


More information about the Pkg-grub-devel mailing list