2007-05-05 Robert Millan <rmh@aybabtu.com>

* conf/i386-pc.rmk (grub_setup_SOURCES): Add partmap/gpt.c.
	(grub_probe_SOURCES): Likewise.
	* util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): Detect
	GPT and initialize dos_part and bsd_part accordingly.
	* util/i386/pc/grub-setup.c (setup): Ditto for install_dos_part and
	install_bsd_part.
	(main): Activate gpt module for use during partition identification,
	and deactivate it afterwards.
	* util/i386/pc/grub-install.in: Add gpt module to core.img.
	* util/i386/pc/grub-probe.c (main): Activate gpt module for use during
	partition identification, and deactivate it afterwards.
This commit is contained in:
robertmh committed 2007-05-04 23:00:56 +00:00
1 parent 99123174c9
commit 20b976586e
6 files changed
+81 -29

No files matched your search

+14 -1
View File
@@ -1,7 +1,7 @@
/* biosdisk.c - emulate biosdisk */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007 Free Software Foundation, Inc.
*
* GRUB is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -743,9 +743,12 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
const grub_partition_t partition)
{
struct grub_pc_partition *pcdata = 0;
int gpt = 0;
if (strcmp (partition->partmap->name, "pc_partition_map") == 0)
pcdata = partition->data;
else if (strcmp (partition->partmap->name, "gpt_partition_map") == 0)
gpt = 1;
if (pcdata)
{
@@ -757,6 +760,11 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
pcdata->dos_part, pcdata->bsd_part + 'a',
partition->start);
}
else if (gpt)
{
grub_util_info ("GPT partition %d starts from %lu",
partition->index, partition->start);
}
if (hdg.start == partition->start)
{
@@ -765,6 +773,11 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
dos_part = pcdata->dos_part;
bsd_part = pcdata->bsd_part;
}
else if (gpt)
{
dos_part = grub_cpu_to_le32 (partition->index);
bsd_part = grub_cpu_to_le32 (-1);
}
else
{
dos_part = 0;