Hello,

A while back, I tried installing GRUB on a FreeBSD GPT system.  GRUB
only installs to bios-boot partitions and while I could have changed the
freebsd-boot partition type on my system, I wanted GRUB to recognize
freebsd-boot partition types instead.  I made some simple patches to
allow GRUB to install to freebsd-boot and solaris-boot partition types.

I've attached the patches if somebody wants to merge them in (or tell me
why this is a bad idea)  :)

-Rick
--- include/grub/gpt_partition.h.orig   2010-03-06 12:51:37.000000000 -0800
+++ include/grub/gpt_partition.h        2010-10-10 02:57:26.000000000 -0700
@@ -40,6 +40,17 @@
     { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \
   }
 
+#define GRUB_GPT_PARTITION_TYPE_FREEBSD_BOOT \
+  { grub_cpu_to_le32 (0x83BD6B9D), grub_cpu_to_le16 (0x7F41), grub_cpu_to_le16 
(0x11DC), \
+    { 0xBE, 0x0B, 0x00, 0x15, 0x60, 0xB8, 0x4F, 0x0F } \
+  }
+  
+#define GRUB_GPT_PARTITION_TYPE_SOLARIS_BOOT \
+  { grub_cpu_to_le32 (0x6A82CB45), grub_cpu_to_le16 (0x1DD2), grub_cpu_to_le16 
(0x11B2), \
+    { 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } \
+  }
+
+
 struct grub_gpt_header
 {
   grub_uint8_t magic[8];
--- util/i386/pc/grub-setup.c.orig      2010-03-06 12:51:37.000000000 -0800
+++ util/i386/pc/grub-setup.c   2010-10-10 02:56:55.000000000 -0700
@@ -38,7 +38,8 @@
 #include <grub/util/getroot.h>
 
 static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = 
GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
-
+static const grub_gpt_part_type_t grub_gpt_partition_type_freebsd_boot = 
GRUB_GPT_PARTITION_TYPE_FREEBSD_BOOT;
+static const grub_gpt_part_type_t grub_gpt_partition_type_solaris_boot = 
GRUB_GPT_PARTITION_TYPE_SOLARIS_BOOT;
 #include <grub_setup_init.h>
 
 #include <stdio.h>
@@ -138,7 +139,9 @@
       struct grub_gpt_partentry *gptdata = p->data;
 
       /* If there's an embed region, it is in a dedicated partition.  */
-      if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16))
+      if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16) || 
+             ! memcmp (&gptdata->type, &grub_gpt_partition_type_freebsd_boot, 
16) ||
+                 ! memcmp (&gptdata->type, 
&grub_gpt_partition_type_solaris_boot, 16))
        {
          embed_region.start = p->start;
          embed_region.end = p->start + p->len;
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to