2007-06-13 Robert Millan <rmh@aybabtu.com>
* include/grub/util/misc.h: Define DEFAULT_DIRECTORY and DEFAULT_DEVICE_MAP. * util/grub-emu.c: Use above definitions from misc.h instead of defining them. * util/grub-mkdevicemap.c: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/grub-probe.c: Likewise. (probe): Abort with grub_util_error() when either grub_guess_root_device or grub_util_get_grub_dev fails.
This commit is contained in:
parent
0215dcbfdc
commit
baa574b487
6 changed files with 23 additions and 44 deletions
|
@ -38,15 +38,6 @@
|
|||
#define _GNU_SOURCE 1
|
||||
#include <getopt.h>
|
||||
|
||||
#ifdef __NetBSD__
|
||||
/* NetBSD uses /boot for its boot block. */
|
||||
# define DEFAULT_DIRECTORY "/grub"
|
||||
#else
|
||||
# define DEFAULT_DIRECTORY "/boot/grub"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
|
||||
|
||||
#define PRINT_FS 0
|
||||
#define PRINT_DRIVE 1
|
||||
#define PRINT_DEVICE 2
|
||||
|
@ -87,10 +78,7 @@ probe (const char *path)
|
|||
|
||||
device_name = grub_guess_root_device (path);
|
||||
if (! device_name)
|
||||
{
|
||||
fprintf (stderr, "cannot find a device for %s.\n", path);
|
||||
goto end;
|
||||
}
|
||||
grub_util_error ("cannot find a device for %s.\n", path);
|
||||
|
||||
if (print == PRINT_DEVICE)
|
||||
{
|
||||
|
@ -100,10 +88,7 @@ probe (const char *path)
|
|||
|
||||
drive_name = grub_util_get_grub_dev (device_name);
|
||||
if (! drive_name)
|
||||
{
|
||||
fprintf (stderr, "cannot find a GRUB drive for %s.\n", device_name);
|
||||
goto end;
|
||||
}
|
||||
grub_util_error ("cannot find a GRUB drive for %s.\n", device_name);
|
||||
|
||||
if (print == PRINT_DRIVE)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue