File kdm-cope-with-new-grub.diff of Package kdebase4-workspace

Index: kdm/backend/bootman.c
===================================================================
--- kdm/backend/bootman.c.orig
+++ kdm/backend/bootman.c
@@ -136,31 +136,10 @@ setGrub(const char *opt, SdRec *sdr)
 static void
 commitGrub(void)
 {
-    if (sdRec.bmstamp != mTime(GRUB_MENU) &&
-            setGrub(sdRec.osname, &sdRec) != BO_OK)
-        return;
+    char buffer[PATH_MAX];
 
-    if (grubSetDefault) {
-        /* The grub-set-default command must be used, which is
-         * not so good because there is no way of setting an
-         * entry for the next boot only. */
-        char index[16];
-        const char *args[] = { grubSetDefault, index, 0 };
-        sprintf(index, "%d", sdRec.osindex);
-        runAndWait((char **)args, environ);
-    } else {
-        /* The grub shell can be used with `savedefault'.
-         * That requires a (widely distributed) patch to grub, e.g.
-         * grub-0.97-once.patch. It won't work with a vanilla grub.*/
-        FILE *f;
-        int pid;
-        static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
-        args[0] = grub;
-        if ((f = pOpen((char **)args, 'w', &pid))) {
-            fprintf(f, "savedefault --default=%d --once\n", sdRec.osindex);
-            pClose(f, &pid);
-        }
-    }
+    snprintf(buffer, PATH_MAX, "/usr/sbin/grubonce %d", sdRec.osindex);
+    system(buffer);
 }
 
 #define GRUB2_MAX_MENU_LEVEL 5
openSUSE Build Service is sponsored by