From 69c580fd805f255c70a93554bc78e5f5e09f884b Mon Sep 17 00:00:00 2001 From: Sergey Matveychuk Date: Tue, 12 Oct 2010 15:48:46 +0000 Subject: [PATCH] - Add couple patches to allow grob to be installed on FreeBSD GPT partitions. - Remove an ugly patch. - Pass a maintainership to submitter. Submitted by: Rick --- sysutils/grub2/Makefile | 2 +- .../files/patch-include-grub-gpt_partition.h | 20 ++++++++++++++++ sysutils/grub2/files/patch-util-getroot.c | 11 --------- .../files/patch-util-i386-pc-grub-setup.c | 23 +++++++++++++++++++ 4 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 sysutils/grub2/files/patch-include-grub-gpt_partition.h delete mode 100644 sysutils/grub2/files/patch-util-getroot.c create mode 100644 sysutils/grub2/files/patch-util-i386-pc-grub-setup.c diff --git a/sysutils/grub2/Makefile b/sysutils/grub2/Makefile index 697a6686f612..0bea68c2605f 100644 --- a/sysutils/grub2/Makefile +++ b/sysutils/grub2/Makefile @@ -11,7 +11,7 @@ CATEGORIES= sysutils MASTER_SITES= ftp://alpha.gnu.org/gnu/grub/ DISTNAME= grub-${PORTVERSION} -MAINTAINER= sem@FreeBSD.org +MAINTAINER= rick@lgarchitecture.com COMMENT= Multiboot boot loader CONFLICTS= grub-0* diff --git a/sysutils/grub2/files/patch-include-grub-gpt_partition.h b/sysutils/grub2/files/patch-include-grub-gpt_partition.h new file mode 100644 index 000000000000..b26b0c1741ac --- /dev/null +++ b/sysutils/grub2/files/patch-include-grub-gpt_partition.h @@ -0,0 +1,20 @@ +--- 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]; diff --git a/sysutils/grub2/files/patch-util-getroot.c b/sysutils/grub2/files/patch-util-getroot.c deleted file mode 100644 index ebf767912531..000000000000 --- a/sysutils/grub2/files/patch-util-getroot.c +++ /dev/null @@ -1,11 +0,0 @@ ---- util/getroot.c.orig 2010-06-11 10:37:54.000000000 +0400 -+++ util/getroot.c 2010-06-11 10:38:31.000000000 +0400 -@@ -454,7 +454,7 @@ - #else - - /* This might be truly slow, but is there any better way? */ -- os_dev = find_root_device ("/dev", st.st_dev); -+ os_dev = find_root_device ("/dev", st.st_rdev); - #endif - #endif /* !__GNU__ */ - diff --git a/sysutils/grub2/files/patch-util-i386-pc-grub-setup.c b/sysutils/grub2/files/patch-util-i386-pc-grub-setup.c new file mode 100644 index 000000000000..e29a828fecc4 --- /dev/null +++ b/sysutils/grub2/files/patch-util-i386-pc-grub-setup.c @@ -0,0 +1,23 @@ +--- 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 + + 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 + + #include +@@ -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;