From: Vladimir 'phcoder' Serbinenko Date: Sat, 6 Feb 2010 17:47:17 +0000 (+0100) Subject: merge mainline into nestpart X-Git-Tag: 1.99~1003^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bc6fcf093189df31ee79336ba39aefae7a561a41;p=thirdparty%2Fgrub.git merge mainline into nestpart --- bc6fcf093189df31ee79336ba39aefae7a561a41 diff --cc util/hostdisk.c index 0bccf4ca7,5c56b7579..9ecb5b324 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@@ -334,13 -334,11 +334,14 @@@ open_device (const grub_disk_t disk, gr { int is_partition = 0; char dev[PATH_MAX]; + grub_disk_addr_t part_start = 0; + + part_start = grub_partition_get_start (disk->partition); strcpy (dev, map[disk->id].device); - if (disk->partition && strncmp (map[disk->id].device, "/dev/", 5) == 0) - if (disk->partition && sector >= disk->partition->start ++ if (disk->partition && sector >= part_start + && strncmp (map[disk->id].device, "/dev/", 5) == 0) - is_partition = linux_find_partition (dev, disk->partition->start); + is_partition = linux_find_partition (dev, part_start); /* Open the partition. */ grub_dprintf ("hostdisk", "opening the device `%s' in open_device()\n", dev);