e03f5192ff
Hi, Please help to review the patches. Thanks. (forwarded request 128468 from michael-chang) OBS-URL: https://build.opensuse.org/request/show/128513 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=41
89 lines
3.4 KiB
Diff
89 lines
3.4 KiB
Diff
From b411dc88b46890400a2e1ba0aa8650e00f738c23 Mon Sep 17 00:00:00 2001
|
|
From: Michael Chang <mchang@suse.com>
|
|
Date: Thu, 19 Jul 2012 18:43:55 +0800
|
|
Subject: [PATCH] fix menu in xen host server
|
|
|
|
References: bnc#771689, bnc#757895
|
|
Patch-Mainline: no
|
|
|
|
When system is configred as "Xen Virtual Machines Host Server", the
|
|
grub2 menu is not well organized. We could see some issues on it.
|
|
|
|
- Many duplicated xen entries generated by links to xen hypervisor
|
|
- Non bootable kernel entries trying to boot xen kernel natively
|
|
- The -dbg xen hypervisor takes precedence over release version
|
|
|
|
This patch fixes above three issues.
|
|
---
|
|
util/grub-mkconfig_lib.in | 5 +++++
|
|
util/grub.d/10_linux.in | 12 ++++++++++--
|
|
util/grub.d/20_linux_xen.in | 6 ++++--
|
|
3 files changed, 19 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
|
|
index 76133b4..defc364 100644
|
|
--- a/util/grub-mkconfig_lib.in
|
|
+++ b/util/grub-mkconfig_lib.in
|
|
@@ -239,6 +239,11 @@ version_test_gt ()
|
|
*.old:*.old) ;;
|
|
*.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;;
|
|
*:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;;
|
|
+# bnc#757895 - Grub2 menu items incorrect when "Xen Virtual Machines Host Server" selected
|
|
+# The dbg version should be placed after release version
|
|
+ dbg-*:dbg-*) ;;
|
|
+ dbg-*:*) version_test_gt_a="" ;;
|
|
+ *:dbg-*) version_test_gt_b="" ;;
|
|
esac
|
|
version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b"
|
|
return "$?"
|
|
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
|
index e7a180e..a02bf17 100644
|
|
--- a/util/grub.d/10_linux.in
|
|
+++ b/util/grub.d/10_linux.in
|
|
@@ -150,15 +150,23 @@ EOF
|
|
EOF
|
|
}
|
|
|
|
+# bnc#757895 - Grub2 menu items incorrect when "Xen Virtual Machines Host Server" selected
|
|
+# check kernel's flavor to prevent xen kernel from booting natively without hypervisor
|
|
+is_not_xen ()
|
|
+{
|
|
+ flavor=`echo $1 | sed -e "s,.*-,,g"`
|
|
+ test "x$flavor" != xxen
|
|
+}
|
|
+
|
|
machine=`uname -m`
|
|
case "x$machine" in
|
|
xi?86 | xx86_64)
|
|
list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
|
|
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
|
+ if grub_file_is_not_garbage "$i" && is_not_xen "$i" ; then echo -n "$i " ; fi
|
|
done` ;;
|
|
*)
|
|
list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
|
|
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
|
+ if grub_file_is_not_garbage "$i" && is_not_xen "$i" ; then echo -n "$i " ; fi
|
|
done` ;;
|
|
esac
|
|
|
|
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
|
|
index 1d94502..fd103f1 100644
|
|
--- a/util/grub.d/20_linux_xen.in
|
|
+++ b/util/grub.d/20_linux_xen.in
|
|
@@ -166,8 +166,10 @@ file_is_not_sym () {
|
|
esac
|
|
}
|
|
|
|
-xen_list=`for i in /boot/xen*; do
|
|
- if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then echo -n "$i " ; fi
|
|
+# bnc#757895 - Grub2 menu items incorrect when "Xen Virtual Machines Host Server" selected
|
|
+# wildcard expasion with correct suffix (.gz) and exclude symlinks for not generating many duplicated menu entries
|
|
+xen_list=`for i in /boot/xen*.gz; do
|
|
+ if grub_file_is_not_garbage "$i" && test ! -L "$i" ; then echo -n "$i " ; fi
|
|
done`
|
|
prepare_boot_cache=
|
|
boot_device_id=
|
|
--
|
|
1.7.3.4
|
|
|