Fix menu title instability bug.
* grub-core/commands/menuentry.c (options): New option --id. (grub_normal_add_menu_entry): New argument id. All users updated. (grub_cmd_menuentry): Handle --id. (grub_menu_init): Accept unknown arguments. * grub-core/normal/main.c (features): Add feature_menuentry_id and feature_menuentry_options. * grub-core/normal/menu.c (grub_menu_execute_entry): Use id for saved_entry. (get_entry_number): Match with id as well. * include/grub/menu.h (grub_menu_entry): New member id. * util/grub-mkconfig_lib.in (grub_get_device_id): New function. * util/grub.d/00_header.in: Define menuentry_id_option. * util/grub.d/10_hurd.in: Define id. * util/grub.d/10_illumos.in: Likewise. * util/grub.d/10_kfreebsd.in: Likewise. * util/grub.d/10_linux.in: Likewise. * util/grub.d/10_netbsd.in: Likewise. * util/grub.d/10_windows.in: Likewise. * util/grub.d/20_linux_xen.in: Likewise. * util/grub.d/30_os-prober.in: Likewise.
This commit is contained in:
parent
0d31b7df86
commit
d9bef9bc43
17 changed files with 126 additions and 27 deletions
|
@ -87,7 +87,10 @@ linux_entry ()
|
|||
else
|
||||
title="$(gettext_quoted "%s, with Xen %s and Linux %s")"
|
||||
fi
|
||||
printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${xen_version}" "${version}"
|
||||
if [ -z "$boot_device_id" ]; then
|
||||
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
|
||||
fi
|
||||
printf "menuentry '${title}' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$recovery-$boot_device_id' {\n" "${os}" "${xen_version}" "${version}"
|
||||
if ! ${recovery} ; then
|
||||
save_default_entry | sed -e "s/^/\t/"
|
||||
fi
|
||||
|
@ -139,6 +142,7 @@ xen_list=`for i in /boot/xen*; do
|
|||
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
||||
done`
|
||||
prepare_boot_cache=
|
||||
boot_device_id=
|
||||
|
||||
while [ "x${xen_list}" != "x" ] ; do
|
||||
list="${linux_list}"
|
||||
|
@ -147,7 +151,10 @@ while [ "x${xen_list}" != "x" ] ; do
|
|||
xen_dirname=`dirname ${current_xen}`
|
||||
rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
|
||||
xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
|
||||
echo "submenu \"Xen ${xen_version}\" {"
|
||||
if [ -z "$boot_device_id" ]; then
|
||||
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
|
||||
fi
|
||||
echo "submenu \"Xen ${xen_version}\" \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
|
||||
while [ "x$list" != "x" ] ; do
|
||||
linux=`version_find_latest $list`
|
||||
gettext_printf "Found linux image: %s\n" "$linux" >&2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue