|
|
int len; | int len; |
char line[1000]; | char line[1000]; |
| |
if (!grub && !(grub = locate( "grub" ))) |
if (!grub && !(grub = locate( "grub-set-default" ))) |
return BO_NOMAN; | return BO_NOMAN; |
| |
*def = 0; | *def = 0; |
|
|
static void | static void |
commitGrub( void ) | commitGrub( void ) |
{ | { |
FILE *f; |
char command[256]; |
int pid; |
|
static const char *args[] = { 0, "--batch", "--no-floppy", 0 }; |
|
|
|
if (sdRec.bmstamp != mTime( GRUB_MENU ) && | if (sdRec.bmstamp != mTime( GRUB_MENU ) && |
setGrub( sdRec.osname, &sdRec ) != BO_OK) | setGrub( sdRec.osname, &sdRec ) != BO_OK) |
return; | return; |
| |
args[0] = grub; |
sprintf(command, "%s %d", grub, sdRec.osindex); |
if ((f = pOpen( (char **)args, 'w', &pid ))) { |
system(command); |
fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex ); |
|
pClose( f, pid ); |
|
} |
|
} | } |
| |
static char *lilo; | static char *lilo; |