File fix-grub2-entry-paths.diff of Package cobbler.15445

Index: cobbler-2.6.6/koan/app.py
===================================================================
--- cobbler-2.6.6.orig/koan/app.py
+++ cobbler-2.6.6/koan/app.py
@@ -1175,13 +1175,18 @@ class Koan:
 
                 # Create grub2 menuentry
                 grub_entry = """
-                cat <<EOF
-                menuentry "%s" {
-                    linux %s %s
-                    initrd %s
-                }
-                EOF
-                """ % (name, kernel_local, k_args, initrd_local)
+. "$pkgdatadir/grub-mkconfig_lib"
+
+rel_kernel=`make_system_path_relative_to_its_root {kernel}`
+rel_initrd=`make_system_path_relative_to_its_root {initrd}`
+
+cat <<EOF
+menuentry "{name}" {{
+    linux $rel_kernel {args}
+    initrd $rel_initrd
+}}
+EOF
+                """.format(name=name, kernel=kernel_local, args=k_args, initrd=initrd_local)
 
                 # Save grub2 menuentry
                 fd = open(grub_file,"w")
openSUSE Build Service is sponsored by