* grub-core/disk/raid.c (scan_devices): Check partition.

* grub-core/disk/lvm.c (do_lvm_scan): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-10-28 15:52:15 +02:00
parent 5b1ae25f06
commit 6563f63dfd
3 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2011-10-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/raid.c (scan_devices): Check partition.
* grub-core/disk/lvm.c (do_lvm_scan): Likewise.
2011-10-27 Vladimir Serbinenko <phcoder@gmail.com> 2011-10-27 Vladimir Serbinenko <phcoder@gmail.com>
Support BFS (befs) UUID. Support BFS (befs) UUID.

View file

@ -23,6 +23,7 @@
#include <grub/err.h> #include <grub/err.h>
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/lvm.h> #include <grub/lvm.h>
#include <grub/partition.h>
#ifdef GRUB_UTIL #ifdef GRUB_UTIL
#include <grub/emu/misc.h> #include <grub/emu/misc.h>
@ -153,7 +154,11 @@ do_lvm_scan (const char *scan_for)
for (vg = vg_list; vg; vg = vg->next) for (vg = vg_list; vg; vg = vg->next)
for (pv = vg->pvs; pv; pv = pv->next) for (pv = vg->pvs; pv; pv = pv->next)
if (pv->disk && pv->disk->id == disk->id if (pv->disk && pv->disk->id == disk->id
&& pv->disk->dev->id == disk->dev->id) && pv->disk->dev->id == disk->dev->id
&& grub_partition_get_start (pv->disk->partition)
== grub_partition_get_start (disk->partition)
&& grub_partition_get_len (pv->disk->partition)
== grub_partition_get_len (disk->partition))
{ {
grub_disk_close (disk); grub_disk_close (disk);
return 0; return 0;

View file

@ -23,6 +23,7 @@
#include <grub/err.h> #include <grub/err.h>
#include <grub/misc.h> #include <grub/misc.h>
#include <grub/raid.h> #include <grub/raid.h>
#include <grub/partition.h>
#ifdef GRUB_UTIL #ifdef GRUB_UTIL
#include <grub/util/misc.h> #include <grub/util/misc.h>
#endif #endif
@ -119,7 +120,11 @@ scan_devices (const char *arname)
struct grub_raid_member *m; struct grub_raid_member *m;
for (m = arr->members; m < arr->members + arr->nr_devs; m++) for (m = arr->members; m < arr->members + arr->nr_devs; m++)
if (m->device && m->device->id == disk->id if (m->device && m->device->id == disk->id
&& m->device->dev->id == m->device->dev->id) && m->device->dev->id == m->device->dev->id
&& grub_partition_get_start (m->device->partition)
== grub_partition_get_start (disk->partition)
&& grub_partition_get_len (m->device->partition)
== grub_partition_get_len (disk->partition))
{ {
grub_disk_close (disk); grub_disk_close (disk);
return 0; return 0;