2007-05-16 Jeroen Dekkers <jeroen@dekkers.cx>

* util/getroot.c (grub_guess_root_device): Remove RAID and LVM
	code, first search for device in /dev/mapper, then in /dev.
	(grub_util_get_grub_dev): New function.
	* include/grub/util/getroot.h (grub_util_get_grub_dev): Add
	prototype.
	* util/grub-probe.c (probe): Remove check for RAID, call
	grub_util_get_grub_dev() instead of
	grub_util_biosdisk_get_grub_dev().
	* util/grub-emu.c (main): Call grub_util_get_grub_dev() instead of
	grub_util_biosdisk_get_grub_dev().
	* util/i386/pc/grub-setup.c (main): Likewise.
This commit is contained in:
jeroen 2007-05-16 21:38:44 +00:00
parent 8fff7c2f2a
commit 849d55d3d1
6 changed files with 51 additions and 30 deletions

View file

@ -1,7 +1,7 @@
/* grub-probe.c - probe device information for a given path */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006 Free Software Foundation, Inc.
* Copyright (C) 2005,2006,2007 Free Software Foundation, Inc.
*
* GRUB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -98,19 +98,11 @@ probe (const char *path)
goto end;
}
if (device_name[0] == 'm' && device_name[1] == 'd'
&& device_name[2] >= '0' && device_name[2] <= '9')
drive_name = grub_util_get_grub_dev (device_name);
if (! drive_name)
{
drive_name = xstrdup (device_name);
}
else
{
drive_name = grub_util_biosdisk_get_grub_dev (device_name);
if (! drive_name)
{
fprintf (stderr, "cannot find a GRUB drive for %s.\n", device_name);
goto end;
}
fprintf (stderr, "cannot find a GRUB drive for %s.\n", device_name);
goto end;
}
if (print == PRINT_DRIVE)