merge 4096 into luks

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-04-24 03:12:06 +02:00
commit 572e3ea650
9 changed files with 334 additions and 221 deletions

View file

@ -92,8 +92,11 @@ grub_partition_msdos_iterate (grub_disk_t disk,
{
e = mbr.entries + p.index;
p.start = p.offset + grub_le_to_cpu32 (e->start) - delta;
p.len = grub_le_to_cpu32 (e->length);
p.start = p.offset
+ (grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)) - delta;
p.len = grub_le_to_cpu32 (e->length)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS);
p.msdostype = e->type;
grub_dprintf ("partition",
@ -128,7 +131,9 @@ grub_partition_msdos_iterate (grub_disk_t disk,
if (grub_msdos_partition_is_extended (e->type))
{
p.offset = ext_offset + grub_le_to_cpu32 (e->start);
p.offset = ext_offset
+ (grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
if (! ext_offset)
ext_offset = p.offset;
@ -206,8 +211,11 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
e = mbr.entries + i;
if (!grub_msdos_partition_is_empty (e->type)
&& end > offset + grub_le_to_cpu32 (e->start))
end = offset + grub_le_to_cpu32 (e->start);
&& end > offset
+ (grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)))
end = offset + (grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
/* If this is a GPT partition, this MBR is just a dummy. */
if (e->type == GRUB_PC_PARTITION_TYPE_GPT_DISK && i == 0)
@ -221,7 +229,9 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
if (grub_msdos_partition_is_extended (e->type))
{
offset = ext_offset + grub_le_to_cpu32 (e->start);
offset = ext_offset
+ (grub_le_to_cpu32 (e->start)
<< (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
if (! ext_offset)
ext_offset = offset;