* 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

@ -1,3 +1,9 @@
2011-03-30 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub.d/10_linux.in: Try alternative config filenames where
we parse config file.
* util/grub.d/20_linux_xen.in: Likewise.
2011-03-30 Alexey Shvetsov <alexxy@gentoo.org>
* util/grub.d/10_linux.in: Add gentoo-specific Linux and initrd names.

View File

@ -73,8 +73,8 @@ linux_entry ()
cat << EOF
load_video
EOF
if grep -qx "CONFIG_FB_EFI=y" /boot/config-${version} 2> /dev/null \
&& grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" /boot/config-${version} 2> /dev/null; then
if grep -qx "CONFIG_FB_EFI=y" "${config}" 2> /dev/null \
&& grep -qx "CONFIG_VT_HW_CONSOLE_BINDING=y" "${config}" 2> /dev/null; then
cat << EOF
set gfxpayload=keep
EOF
@ -147,14 +147,19 @@ while [ "x$list" != "x" ] ; do
fi
done
initramfs=
config=
for i in "config-${version}" "config-${alt_version}"; do
if test -e "${dirname}/${i}" ; then
initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${dirname}/${i}" | cut -f2 -d= | tr -d \"`
config="${dirname}/${i}"
break
fi
done
initramfs=
if test -n "${config}" ; then
initramfs=`grep CONFIG_INITRAMFS_SOURCE= "${config}" | cut -f2 -d= | tr -d \"`
fi
if test -n "${initrd}" ; then
echo "Found initrd image: ${dirname}/${initrd}" >&2
elif test -z "${initramfs}" ; then

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