All of lore.kernel.org
 help / color / mirror / Atom feed
* Support for solaris and freebsd GPT partition types
@ 2010-10-31  5:22 Rick
  2010-10-31 10:23 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Rick @ 2010-10-31  5:22 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]

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

[-- Attachment #2: patch-include-grub-gpt_partition.h --]
[-- Type: text/plain, Size: 694 bytes --]

--- 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];

[-- Attachment #3: patch-util-i386-pc-grub-setup.c --]
[-- Type: text/plain, Size: 1117 bytes --]

--- 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Support for solaris and freebsd GPT partition types
  2010-10-31  5:22 Support for solaris and freebsd GPT partition types Rick
@ 2010-10-31 10:23 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-10-31 10:23 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

On 10/31/2010 06:22 AM, Rick wrote:
> 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)  :)
>
>   
These types weren't reserved by us and blindly using them without
consulting the ones who reserved it is just squatting and can create any
kind of conflict.
> -Rick
>   
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-31 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31  5:22 Support for solaris and freebsd GPT partition types Rick
2010-10-31 10:23 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.