File do_not_use_grubby_compat_when_grub2_is_in_use.diff of Package cobbler.539
Index: cobbler-2.6.6/koan/app.py
===================================================================
--- cobbler-2.6.6.orig/koan/app.py
+++ cobbler-2.6.6/koan/app.py
@@ -1029,9 +1029,12 @@ class Koan:
raise InfoException, "grub2 is not installed"
use_grub2 = True
elif (make == "suse"):
- if not os.path.exists("/usr/sbin/grubby-compat"):
- raise InfoException, "grub2 is not installed"
- use_grubby_compat = True
+ if os.path.exists("/usr/sbin/grub2-install"):
+ use_grub2 = True
+ else:
+ if not os.path.exists("/usr/sbin/grubby-compat"):
+ raise InfoException, "grubby-compat is not installed"
+ use_grubby_compat = True
else:
if not os.path.exists("/sbin/grubby"):
raise InfoException, "grubby is not installed"
@@ -1179,10 +1182,13 @@ class Koan:
# Set paths for Ubuntu/Debian
# TODO: Add support for other distros when they ship grub2
- if make in ['ubuntu', 'debian']:
+ if make in ['ubuntu', 'debian', 'suse']:
grub_file = "/etc/grub.d/42_koan"
grub_default_file = "/etc/default/grub"
- cmd = ["update-grub"]
+ if make in ['suse']:
+ cmd = ['/sbin/update-bootloader', '--refresh']
+ else:
+ cmd = ["update-grub"]
default_cmd = ['sed', '-i', 's/^GRUB_DEFAULT\=.*$/GRUB_DEFAULT="%s"/g' % name, grub_default_file]
# Create grub2 menuentry