mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 07:39:22 +00:00
2006-06-05 Yoshinori K. Okuji <okuji@enbug.org>
Count partitions from 1 instead of 0 in the string representation
of partitions. Still use 0-based internally.
* partmap/sun.c (grub_sun_is_valid): A cosmetic change.
(sun_partition_map_iterate): Use grub_partition_t instead of
struct grub_partition *. Cast DESC->START_CYLINDER to
grub_uint64_t after converting the endian.
(sun_partition_map_probe): Subtract 1 for PARTNUM.
(sun_partition_map_get_name): Add 1 to P->INDEX.
* partmap/pc.c (grub_partition_parse): Subtract 1 for
PCDATA->DOS_PART.
(pc_partition_map_get_name): Add 1 into PCDATA->DOS_PART.
* partmap/gpt.c (gpt_partition_map_iterate): Initialize PARTNO to
zero instead of one.
(gpt_partition_map_probe): Subtract 1 for PARTNUM.
(gpt_partition_map_get_name): Add 1 into P->INDEX.
* partmap/apple.c (apple_partition_map_iterate): Change the type
of POS to unsigned.
(apple_partition_map_probe): Subtract 1 for PARTNUM.
(apple_partition_map_get_name): Add 1 into P->INDEX.
* partmap/amiga.c (amiga_partition_map_iterate): Change the type
of POS to unsigned.
(amiga_partition_map_iterate): Cast NEXT to grub_off_t to
calculate the offset of a partition.
(amiga_partition_map_probe): Subtract 1 for PARTNUM.
(amiga_partition_map_get_name): Add 1 into P->INDEX.
* partmap/acorn.c (acorn_partition_map_find): Change the type of
SECTOR to grub_disk_addr_t.
(acorn_partition_map_iterate): Likewise.
(acorn_partition_map_probe): Subtract 1 for PARTNUM.
Change the type of SECTOR to grub_disk_addr_t. Declare P on the
top.
(acorn_partition_map_get_name): Add 1 into P->INDEX.
* kern/i386/pc/init.c (make_install_device): Add 1 into
GRUB_INSTALL_DOS_PART.
* fs/iso9660.c (grub_iso9660_mount): Fixed a reversed
conditional.
This commit is contained in:
1 parent
524a1e6a40
commit
deae281bfe
10 files changed
+131
-58
No files matched your search
+7
-9
@@ -84,7 +84,7 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
||||
struct grub_disk raw;
|
||||
int partno = 0;
|
||||
int next = -1;
|
||||
int pos;
|
||||
unsigned pos;
|
||||
|
||||
/* Enforce raw disk access. */
|
||||
raw = *disk;
|
||||
@@ -94,8 +94,7 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
||||
for (pos = 0; pos < 15; pos++)
|
||||
{
|
||||
/* Read the RDSK block which is a descriptor for the entire disk. */
|
||||
if (grub_disk_read (&raw, pos, 0,
|
||||
sizeof (rdsk), (char *) &rdsk))
|
||||
if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), (char *) &rdsk))
|
||||
return grub_errno;
|
||||
|
||||
if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0)
|
||||
@@ -116,8 +115,7 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
||||
struct grub_amiga_partition apart;
|
||||
|
||||
/* Read the RDSK block which is a descriptor for the entire disk. */
|
||||
if (grub_disk_read (&raw, next, 0,
|
||||
sizeof (apart), (char *) &apart))
|
||||
if (grub_disk_read (&raw, next, 0, sizeof (apart), (char *) &apart))
|
||||
return grub_errno;
|
||||
|
||||
/* Calculate the first block and the size of the partition. */
|
||||
@@ -129,7 +127,7 @@ amiga_partition_map_iterate (grub_disk_t disk,
|
||||
* grub_be_to_cpu32 (apart.heads)
|
||||
* grub_be_to_cpu32 (apart.block_per_track));
|
||||
|
||||
part.offset = next * 512;
|
||||
part.offset = (grub_off_t) next * 512;
|
||||
part.index = partno;
|
||||
part.partmap = &grub_amiga_partition_map;
|
||||
|
||||
@@ -155,7 +153,7 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
{
|
||||
if (partnum == partition->index)
|
||||
{
|
||||
p = (grub_partition_t) grub_malloc (sizeof (*p));
|
||||
@@ -170,7 +168,7 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str)
|
||||
}
|
||||
|
||||
/* Get the partition number. */
|
||||
partnum = grub_strtoul (s, 0, 10);
|
||||
partnum = grub_strtoul (s, 0, 10) - 1;
|
||||
if (grub_errno)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition");
|
||||
@@ -197,7 +195,7 @@ amiga_partition_map_get_name (const grub_partition_t p)
|
||||
if (! name)
|
||||
return 0;
|
||||
|
||||
grub_sprintf (name, "%d", p->index);
|
||||
grub_sprintf (name, "%d", p->index + 1);
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user