File kdm-cope-with-new-grub.diff of Package kdebase4-workspace
Index: kdm/backend/bootman.c
===================================================================
--- kdm/backend/bootman.c.orig 2010-07-06 08:54:30.000000000 +0200
+++ kdm/backend/bootman.c 2010-11-21 20:47:03.434812097 +0100
@@ -133,31 +133,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_MENU "/boot/grub/grub.cfg"