Hi, I've managed to get kdm to work nicely with our grub. See attached for the patch. This requires a 'special' menu.lst to support selecting next boot OS and the BootManager option in kdmrc to be set to "GRUB".
Sample file:
# Important line, tells grub to use saved option to boot from
default saved
timeout 3
title FreeBSD 8.0-i386
root (hd1,0,a)
kernel /boot/loader
# Set the default, for next boot, to 1
savedefault 1
title FreeBSD 8.0-amd64
root (hd0,0,a)
kernel /boot/loader
# No need to set default as we are it
#savedefault
# Windows Vista
title Windows Vista
root (hd1,1)
makeactive
chainloader +1
# Set the default, for next boot, to 1
savedefault 1
Make sure you run `grub-set-default 1` otherwise grub will bork when it hits
the savedefault line (since it cannot create files and expects one to be
there).
Most of the linux distributions have a patched version of grub that allows a
difference (and easier) setup. (The patch is called grub-0.97-once.) We
could integrate that patch (and eliminate the need for this patch) but I feel
this way allows for greater flexibility.
Outstanding task: teach kdm to read the defaults file to correctly get the
next booting option (vs assuming the first one is the default).
For those on amd64 an easy way to get grub to work is to install the i386 grub
package (it doesn't have any dependencies beyond the base system). I'm
currently running grub on amd64.
Regards,
David
diff -ur kdm~/backend/bootman.c kdm/backend/bootman.c
--- kdm~/backend/bootman.c 2009-11-18 16:14:01.000000000 +0200
+++ kdm/backend/bootman.c 2009-11-18 16:15:31.000000000 +0200
@@ -80,7 +80,7 @@
int len;
char line[1000];
- if (!grub && !(grub = locate( "grub" )))
+ if (!grub && !(grub = locate( "grub-set-default" )))
return BO_NOMAN;
*def = 0;
@@ -130,19 +130,15 @@
static void
commitGrub( void )
{
- FILE *f;
- int pid;
- static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
+ char idx[3];
+ char *args[] = { grub, idx, NULL };
if (sdRec.bmstamp != mTime( GRUB_MENU ) &&
setGrub( sdRec.osname, &sdRec ) != BO_OK)
return;
- args[0] = grub;
- if ((f = pOpen( (char **)args, 'w', &pid ))) {
- fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex );
- pClose( f, &pid );
- }
+ snprintf(idx, 2, "%i", sdRec.osindex);
+ runAndWait(args, NULL);
}
static char *lilo;
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ kde-freebsd mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-freebsd See also http://freebsd.kde.org/ for latest information
