* util/grub.d/10_linux.in: Try alternative config filenames where

we parse config file.
	* util/grub.d/20_linux_xen.in: Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-03-30 20:42:42 +02:00
parent baad885c14
commit 090b1b6ac6
3 changed files with 27 additions and 6 deletions

View file

@ -94,10 +94,20 @@ EOF
}
linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
if grub_file_is_not_garbage "$i"; then
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 || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" /boot/config-${version} 2> /dev/null); then echo -n "$i " ; fi
done`
dirname=$(dirname $i)
config=
for j in "config-${version}" "config-${alt_version}"; do
if test -e "${dirname}/${j}" ; then
config="${dirname}/${j}"
break
fi
done
if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then echo -n "$i " ; fi
fi
done`
if [ "x${linux_list}" = "x" ] ; then
exit 0
fi