Print this page
grub patch
*** 90,100 ****
const grub_partition_t partition))
{
struct grub_partition p;
union
{
! struct grub_sun_block sun;
grub_uint16_t raw[0];
} block;
int partnum;
grub_err_t err;
--- 90,100 ----
const grub_partition_t partition))
{
struct grub_partition p;
union
{
! struct grub_sun_block sunb;
grub_uint16_t raw[0];
} block;
int partnum;
grub_err_t err;
*** 102,112 ****
err = grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block),
&block);
if (err)
return err;
! if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sun.magic))
return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
if (! grub_sun_is_valid (block.raw))
return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
--- 102,112 ----
err = grub_disk_read (disk, 0, 0, sizeof (struct grub_sun_block),
&block);
if (err)
return err;
! if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.sunb.magic))
return grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table");
if (! grub_sun_is_valid (block.raw))
return grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum");
*** 114,131 ****
table _is_ recognized but invalid. */
for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++)
{
struct grub_sun_partition_descriptor *desc;
! if (block.sun.infos[partnum].id == 0
! || block.sun.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
continue;
! desc = &block.sun.partitions[partnum];
p.start = ((grub_uint64_t) grub_be_to_cpu32 (desc->start_cylinder)
! * grub_be_to_cpu16 (block.sun.ntrks)
! * grub_be_to_cpu16 (block.sun.nsect));
p.len = grub_be_to_cpu32 (desc->num_sectors);
p.number = p.index = partnum;
if (p.len)
{
if (hook (disk, &p))
--- 114,131 ----
table _is_ recognized but invalid. */
for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++)
{
struct grub_sun_partition_descriptor *desc;
! if (block.sunb.infos[partnum].id == 0
! || block.sunb.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID)
continue;
! desc = &block.sunb.partitions[partnum];
p.start = ((grub_uint64_t) grub_be_to_cpu32 (desc->start_cylinder)
! * grub_be_to_cpu16 (block.sunb.ntrks)
! * grub_be_to_cpu16 (block.sunb.nsect));
p.len = grub_be_to_cpu32 (desc->num_sectors);
p.number = p.index = partnum;
if (p.len)
{
if (hook (disk, &p))