2009-08-23 Robert Millan <rmh.grub@aybabtu.com>
* partmap/pc.c: Rename to ... * partmap/msdos.c: ... this. Update all users. (grub_pc_partition_map): Rename to ... (grub_msdos_partition_map): ... this. Update all users. * parttool/pcpart.c: Rename to ... * parttool/msdospart.c: ... this. Update all users. * include/grub/pc_partition.h: Rename to ... * include/grub/msdos_partition.h: ... this. Update all users. (grub_pc_partition_bsd_entry): Rename to ... (grub_msdos_partition_bsd_entry): ... this. Update all users. (grub_pc_partition_disk_label): Rename to ... (grub_msdos_partition_disk_label): ... this. Update all users. (grub_pc_partition_entry): Rename to ... (grub_msdos_partition_entry): ... this. Update all users. (grub_pc_partition_mbr): Rename to ... (grub_msdos_partition_mbr): ... this. Update all users. (grub_pc_partition): Rename to ... (grub_msdos_partition): ... this. Update all users. (grub_pc_partition_is_empty): Rename to ... (grub_msdos_partition_is_empty): ... this. Update all users. (grub_pc_partition_is_extended): Rename to ... (grub_msdos_partition_is_extended): ... this. Update all users. (grub_pc_partition_is_bsd): Rename to ... (grub_msdos_partition_is_bsd): ... this. Update all users. * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS) (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS) (apple_mod_LDFLAGS, msdos_mod_SOURCES, msdos_mod_CFLAGS) (msdos_mod_LDFLAGS, sun_mod_SOURCES, sun_mod_CFLAGS) (sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS) (acorn_mod_LDFLAGS, gpt_mod_SOURCES, gpt_mod_CFLAGS) (gpt_mod_LDFLAGS): Rename to ... (part_amiga_mod_SOURCES, part_amiga_mod_CFLAGS, part_amiga_mod_LDFLAGS) (part_apple_mod_SOURCES, part_apple_mod_CFLAGS, part_apple_mod_LDFLAGS) (part_msdos_mod_SOURCES, part_msdos_mod_CFLAGS, part_msdos_mod_LDFLAGS) (part_sun_mod_SOURCES, part_sun_mod_CFLAGS, part_sun_mod_LDFLAGS) (part_acorn_mod_SOURCES, part_acorn_mod_CFLAGS, part_acorn_mod_LDFLAGS) (part_gpt_mod_SOURCES, part_gpt_mod_CFLAGS) (part_gpt_mod_LDFLAGS): ... this. (pkglib_MODULES): Prefix partition modules with `part_'. Rename `pcpart.mod' to `msdospart.mod'. (pcpart_mod_SOURCES, pcpart_mod_CFLAGS, pcpart_mod_LDFLAGS): Rename to ... (msdospart_mod_SOURCES, msdospart_mod_CFLAGS) (msdospart_mod_LDFLAGS): ... this.
This commit is contained in:
parent
c11fded5f2
commit
71acf5e54b
19 changed files with 164 additions and 115 deletions
|
@ -22,7 +22,7 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/partition.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/pc_partition.h>
|
||||
#include <grub/msdos_partition.h>
|
||||
#include <grub/gpt_partition.h>
|
||||
|
||||
static grub_uint8_t grub_gpt_magic[8] =
|
||||
|
@ -45,7 +45,7 @@ gpt_partition_map_iterate (grub_disk_t disk,
|
|||
struct grub_gpt_header gpt;
|
||||
struct grub_gpt_partentry entry;
|
||||
struct grub_disk raw;
|
||||
struct grub_pc_partition_mbr mbr;
|
||||
struct grub_msdos_partition_mbr mbr;
|
||||
grub_uint64_t entries;
|
||||
unsigned int i;
|
||||
int last_offset = 0;
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
*/
|
||||
|
||||
#include <grub/partition.h>
|
||||
#include <grub/pc_partition.h>
|
||||
#include <grub/msdos_partition.h>
|
||||
#include <grub/disk.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/dl.h>
|
||||
|
||||
static struct grub_partition_map grub_pc_partition_map;
|
||||
static struct grub_partition_map grub_msdos_partition_map;
|
||||
|
||||
|
||||
/* Parse the partition representation in STR and return a partition. */
|
||||
|
@ -32,7 +32,7 @@ static grub_partition_t
|
|||
grub_partition_parse (const char *str)
|
||||
{
|
||||
grub_partition_t p;
|
||||
struct grub_pc_partition *pcdata;
|
||||
struct grub_msdos_partition *pcdata;
|
||||
|
||||
char *s = (char *) str;
|
||||
|
||||
|
@ -40,12 +40,12 @@ grub_partition_parse (const char *str)
|
|||
if (! p)
|
||||
return 0;
|
||||
|
||||
pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata));
|
||||
pcdata = (struct grub_msdos_partition *) grub_malloc (sizeof (*pcdata));
|
||||
if (! pcdata)
|
||||
goto fail;
|
||||
|
||||
p->data = pcdata;
|
||||
p->partmap = &grub_pc_partition_map;
|
||||
p->partmap = &grub_msdos_partition_map;
|
||||
|
||||
/* Initialize some of the fields with invalid values. */
|
||||
pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1;
|
||||
|
@ -93,9 +93,9 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
const grub_partition_t partition))
|
||||
{
|
||||
struct grub_partition p;
|
||||
struct grub_pc_partition pcdata;
|
||||
struct grub_pc_partition_mbr mbr;
|
||||
struct grub_pc_partition_disk_label label;
|
||||
struct grub_msdos_partition pcdata;
|
||||
struct grub_msdos_partition_mbr mbr;
|
||||
struct grub_msdos_partition_disk_label label;
|
||||
struct grub_disk raw;
|
||||
|
||||
/* Enforce raw disk access. */
|
||||
|
@ -106,12 +106,12 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
pcdata.ext_offset = 0;
|
||||
pcdata.dos_part = -1;
|
||||
p.data = &pcdata;
|
||||
p.partmap = &grub_pc_partition_map;
|
||||
p.partmap = &grub_msdos_partition_map;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int i;
|
||||
struct grub_pc_partition_entry *e;
|
||||
struct grub_msdos_partition_entry *e;
|
||||
|
||||
/* Read the MBR. */
|
||||
if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr))
|
||||
|
@ -147,8 +147,8 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr");
|
||||
|
||||
/* If this partition is a normal one, call the hook. */
|
||||
if (! grub_pc_partition_is_empty (e->type)
|
||||
&& ! grub_pc_partition_is_extended (e->type))
|
||||
if (! grub_msdos_partition_is_empty (e->type)
|
||||
&& ! grub_msdos_partition_is_extended (e->type))
|
||||
{
|
||||
pcdata.dos_part++;
|
||||
|
||||
|
@ -156,7 +156,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
return 1;
|
||||
|
||||
/* Check if this is a BSD partition. */
|
||||
if (grub_pc_partition_is_bsd (e->type))
|
||||
if (grub_msdos_partition_is_bsd (e->type))
|
||||
{
|
||||
/* Check if the BSD label is within the DOS partition. */
|
||||
if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR)
|
||||
|
@ -186,7 +186,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions);
|
||||
pcdata.bsd_part++)
|
||||
{
|
||||
struct grub_pc_partition_bsd_entry *be
|
||||
struct grub_msdos_partition_bsd_entry *be
|
||||
= label.entries + pcdata.bsd_part;
|
||||
|
||||
p.start = grub_le_to_cpu32 (be->offset);
|
||||
|
@ -210,7 +210,7 @@ pc_partition_map_iterate (grub_disk_t disk,
|
|||
{
|
||||
e = mbr.entries + i;
|
||||
|
||||
if (grub_pc_partition_is_extended (e->type))
|
||||
if (grub_msdos_partition_is_extended (e->type))
|
||||
{
|
||||
p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start);
|
||||
if (! pcdata.ext_offset)
|
||||
|
@ -234,14 +234,14 @@ static grub_partition_t
|
|||
pc_partition_map_probe (grub_disk_t disk, const char *str)
|
||||
{
|
||||
grub_partition_t p;
|
||||
struct grub_pc_partition *pcdata;
|
||||
struct grub_msdos_partition *pcdata;
|
||||
|
||||
auto int find_func (grub_disk_t d, const grub_partition_t partition);
|
||||
|
||||
int find_func (grub_disk_t d __attribute__ ((unused)),
|
||||
const grub_partition_t partition)
|
||||
{
|
||||
struct grub_pc_partition *partdata = partition->data;
|
||||
struct grub_msdos_partition *partdata = partition->data;
|
||||
|
||||
if ((pcdata->dos_part == partdata->dos_part || pcdata->dos_part == -1)
|
||||
&& pcdata->bsd_part == partdata->bsd_part)
|
||||
|
@ -283,7 +283,7 @@ static char *
|
|||
pc_partition_map_get_name (const grub_partition_t p)
|
||||
{
|
||||
char *name;
|
||||
struct grub_pc_partition *pcdata = p->data;
|
||||
struct grub_msdos_partition *pcdata = p->data;
|
||||
|
||||
name = grub_malloc (13);
|
||||
if (! name)
|
||||
|
@ -301,9 +301,9 @@ pc_partition_map_get_name (const grub_partition_t p)
|
|||
|
||||
|
||||
/* Partition map type. */
|
||||
static struct grub_partition_map grub_pc_partition_map =
|
||||
static struct grub_partition_map grub_msdos_partition_map =
|
||||
{
|
||||
.name = "pc_partition_map",
|
||||
.name = "msdos_partition_map",
|
||||
.iterate = pc_partition_map_iterate,
|
||||
.probe = pc_partition_map_probe,
|
||||
.get_name = pc_partition_map_get_name
|
||||
|
@ -311,10 +311,10 @@ static struct grub_partition_map grub_pc_partition_map =
|
|||
|
||||
GRUB_MOD_INIT(pc_partition_map)
|
||||
{
|
||||
grub_partition_map_register (&grub_pc_partition_map);
|
||||
grub_partition_map_register (&grub_msdos_partition_map);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(pc_partition_map)
|
||||
{
|
||||
grub_partition_map_unregister (&grub_pc_partition_map);
|
||||
grub_partition_map_unregister (&grub_msdos_partition_map);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue