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:
robertmh 2007-06-13 16:53:54 +00:00
parent 0215dcbfdc
commit baa574b487
6 changed files with 23 additions and 44 deletions

View file

@ -1,3 +1,15 @@
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.
2007-06-12 Robert Millan <rmh@aybabtu.com>
* normal/command.c (grub_command_execute): Use NULL rather than 0 for

View file

@ -25,6 +25,15 @@
#include <setjmp.h>
#include <unistd.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"
extern char *progname;
extern int verbosity;
extern jmp_buf main_env;

View file

@ -40,15 +40,6 @@
#include <grub_modules_init.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"
/* Used for going back to the main function. */
jmp_buf main_env;

View file

@ -35,15 +35,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"
#ifdef __linux__
# if !defined(__GLIBC__) || \
((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))

View file

@ -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)
{

View file

@ -50,15 +50,6 @@
#define DEFAULT_BOOT_FILE "boot.img"
#define DEFAULT_CORE_FILE "core.img"
#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"
/* This is the blocklist used in the diskboot image. */
struct boot_blocklist
{