aboutsummaryrefslogtreecommitdiff
path: root/sysutils/grub2-pcbsd
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2015-06-07 22:38:33 +0000
committerKris Moore <kmoore@FreeBSD.org>2015-06-07 22:38:33 +0000
commit12e4fe286a7f39fcb48fa68759b3ff462062ba0a (patch)
tree8c099e5034866f45fab6ad08305c732ff15bb360 /sysutils/grub2-pcbsd
parent7d456e01cfa7b6548a5a6415b8bc0bfa866bbaf0 (diff)
downloadports-12e4fe286a7f39fcb48fa68759b3ff462062ba0a.tar.gz
ports-12e4fe286a7f39fcb48fa68759b3ff462062ba0a.zip
Opps, forgot to delete/add some of the updated patches in files/
Notes
Notes: svn path=/head/; revision=388791
Diffstat (limited to 'sysutils/grub2-pcbsd')
-rw-r--r--sysutils/grub2-pcbsd/files/patch-geom-label-support182
-rw-r--r--sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c76
-rw-r--r--sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h11
-rw-r--r--sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c108
-rw-r--r--sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c15
-rw-r--r--sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c100
-rw-r--r--sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h11
-rw-r--r--sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h (renamed from sysutils/grub2-pcbsd/files/patch-include_grub_gpt_partition.h)6
-rw-r--r--sysutils/grub2-pcbsd/files/patch-po_LINGUAS5
-rw-r--r--sysutils/grub2-pcbsd/files/patch-util_grub-install.c19
-rw-r--r--sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in (renamed from sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig_lib.in)6
-rw-r--r--sysutils/grub2-pcbsd/files/patch-util_grub-probe.c19
-rw-r--r--sysutils/grub2-pcbsd/pkg-install22
13 files changed, 294 insertions, 286 deletions
diff --git a/sysutils/grub2-pcbsd/files/patch-geom-label-support b/sysutils/grub2-pcbsd/files/patch-geom-label-support
deleted file mode 100644
index e36f114b8a3d..000000000000
--- a/sysutils/grub2-pcbsd/files/patch-geom-label-support
+++ /dev/null
@@ -1,182 +0,0 @@
-diff --git a/grub-core/osdep/freebsd/getroot.c b/grub-core/osdep/freebsd/getroot.c
-index ccc1d70..64c0aad 100644
---- grub-core/osdep/freebsd/getroot.c
-+++ grub-core/osdep/freebsd/getroot.c
-@@ -296,6 +296,105 @@ grub_util_get_grub_dev_os (const char *os_dev)
- return grub_dev;
- }
-
-+int grub_util_check_geom_label(const char *name)
-+{
-+ struct gmesh mesh;
-+ struct gclass *class;
-+ struct ggeom *geom;
-+ struct gprovider *pp;
-+ struct gprovider *pplabel;
-+ struct gconsumer *cp;
-+ const char *geom_name;
-+ const char *test_name;
-+ int err;
-+
-+ err = geom_gettree (&mesh);
-+ if (err != 0)
-+ grub_util_error ("%s", _("couldn't open geom"));
-+
-+ LIST_FOREACH (class, &mesh.lg_class, lg_class)
-+ if (strcasecmp (class->lg_name, "label") == 0)
-+ break;
-+ if (!class)
-+ grub_util_error ("%s", _("couldn't find geom `label' class"));
-+
-+ if (strncmp (name, "/dev/", sizeof ("/dev/") - 1) == 0)
-+ test_name = name + sizeof ("/dev/") - 1;
-+ else
-+ test_name = name;
-+
-+ LIST_FOREACH (geom, &class->lg_geom, lg_geom)
-+ {
-+ LIST_FOREACH(pp, &geom->lg_provider, lg_provider)
-+ {
-+ geom_name = pp->lg_name;
-+ if (strcasecmp (geom_name, test_name) != 0)
-+ continue;
-+
-+ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer)
-+ {
-+ pplabel = cp->lg_provider;
-+ if (pplabel == NULL)
-+ continue;
-+ return 1;
-+ }
-+ }
-+ }
-+ return 0;
-+}
-+
-+const char *
-+grub_util_convert_geom_label_to_dev (const char *name, int *full_path)
-+{
-+ struct gmesh mesh;
-+ struct gclass *class;
-+ struct ggeom *geom;
-+ struct gprovider *pp;
-+ struct gprovider *pplabel;
-+ struct gconsumer *cp;
-+ static char buf[256];
-+ const char *geom_name;
-+ int err;
-+
-+ grub_util_info ("Converting label '%s' to device", name);
-+
-+ err = geom_gettree (&mesh);
-+ if (err != 0)
-+ grub_util_error ("%s", _("couldn't open geom"));
-+
-+ LIST_FOREACH (class, &mesh.lg_class, lg_class)
-+ if (strcasecmp (class->lg_name, "label") == 0)
-+ break;
-+ if (!class)
-+ grub_util_error ("%s", _("couldn't find geom `label' class"));
-+
-+
-+ LIST_FOREACH (geom, &class->lg_geom, lg_geom)
-+ {
-+ LIST_FOREACH(pp, &geom->lg_provider, lg_provider)
-+ {
-+ geom_name = pp->lg_name;
-+ if (strcasecmp (geom_name, name) != 0)
-+ continue;
-+
-+ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer)
-+ {
-+ pplabel = cp->lg_provider;
-+ if (pplabel == NULL)
-+ continue;
-+
-+ if ( full_path )
-+ snprintf(buf, sizeof(buf), "/dev/%s", pplabel->lg_name);
-+ else
-+ snprintf(buf, sizeof(buf), "%s", pplabel->lg_name);
-+ return buf;
-+ }
-+ }
-+ }
-+ grub_util_error ("%s", _("couldn't convert gptid to real device name"));
-+ return 0;
-+}
-+
- /* FIXME: geom actually gives us the whole container hierarchy.
- It can be used more efficiently than this. */
- void
-diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c
-index e3887cb..cd010ce 100644
---- grub-core/osdep/unix/getroot.c
-+++ grub-core/osdep/unix/getroot.c
-@@ -504,6 +504,12 @@ grub_guess_root_devices (const char *dir_in)
- if (!os_dev)
- os_dev = find_root_devices_from_libzfs (dir);
-
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+ if (os_dev)
-+ if ( grub_util_check_geom_label(os_dev) )
-+ os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1);
-+#endif
-+
- if (os_dev)
- {
- char **cur;
-diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h
-index 73fa2d3..3c43db4 100644
---- include/grub/emu/getroot.h
-+++ include/grub/emu/getroot.h
-@@ -44,6 +44,8 @@ char *grub_util_get_grub_dev (const char *os_dev);
- #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
- void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out,
- char **name_out);
-+int grub_util_check_geom_label(const char *name);
-+const char *grub_util_convert_geom_label_to_dev (const char *name, int *full_path);
- #endif
-
- #include <sys/stat.h>
-diff --git a/util/grub-install.c b/util/grub-install.c
-index 7d61c32..5900535 100644
---- util/grub-install.c
-+++ util/grub-install.c
-@@ -236,7 +236,16 @@ argp_parser (int key, char *arg, struct argp_state *state)
- case ARGP_KEY_ARG:
- if (install_device)
- grub_util_error ("%s", _("More than one install device?"));
-+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
-+ /* Check if passing a FreeBSD geom label */
-+ if ( grub_util_check_geom_label(arg) )
-+ install_device = \
-+ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1));
-+ else
- install_device = xstrdup (arg);
-+#else
-+ install_device = xstrdup (arg);
-+#endif
- return 0;
-
- default:
-diff --git a/util/grub-probe.c b/util/grub-probe.c
-index ecb7b6b..21e3fa3 100644
---- util/grub-probe.c
-+++ util/grub-probe.c
-@@ -799,7 +799,16 @@ argp_parser (int key, char *arg, struct argp_state *state)
-
- case ARGP_KEY_ARG:
- assert (arguments->ndevices < arguments->device_max);
-+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
-+ /* Check if passing a FreeBSD geom label */
-+ if ( grub_util_check_geom_label(arg) )
-+ arguments->devices[arguments->ndevices++] = \
-+ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1));
-+ else
- arguments->devices[arguments->ndevices++] = xstrdup(arg);
-+#else
-+ arguments->devices[arguments->ndevices++] = xstrdup(arg);
-+#endif
- break;
-
- default:
diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c b/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c
deleted file mode 100644
index 276b7f039a90..000000000000
--- a/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c
+++ /dev/null
@@ -1,76 +0,0 @@
---- grub-core/disk/geli.c.orig 2014-12-30 11:08:32.000000000 -0500
-+++ grub-core/disk/geli.c 2015-01-13 13:42:46.758595608 -0500
-@@ -225,7 +225,7 @@
-
- /* Look for GELI magic sequence. */
- if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC))
-- || grub_le_to_cpu32 (header->version) > 5
-+ || grub_le_to_cpu32 (header->version) > 7
- || grub_le_to_cpu32 (header->version) < 1)
- grub_util_error ("%s", _("wrong ELI magic or version"));
-
-@@ -265,7 +265,7 @@
-
- /* Look for GELI magic sequence. */
- if (grub_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC))
-- || grub_le_to_cpu32 (header.version) > 5
-+ || grub_le_to_cpu32 (header.version) > 7
- || grub_le_to_cpu32 (header.version) < 1)
- {
- grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]);
-@@ -401,6 +401,7 @@
- grub_uint8_t geomkey[GRUB_CRYPTO_MAX_MDLEN];
- grub_uint8_t verify_key[GRUB_CRYPTO_MAX_MDLEN];
- grub_uint8_t zero[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE];
-+ grub_uint8_t geli_cipher_key[64];
- char passphrase[MAX_PASSPHRASE] = "";
- unsigned i;
- gcry_err_code_t gcry_err;
-@@ -440,6 +441,9 @@
- if (!grub_password_get (passphrase, MAX_PASSPHRASE))
- return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied");
-
-+ /* Set the GELI passphrase to GRUB env, for passing to FreeBSD kernel */
-+ grub_env_set ("gelipassphrase", passphrase);
-+
- /* Calculate the PBKDF2 of the user supplied passphrase. */
- if (grub_le_to_cpu32 (header.niter) != 0)
- {
-@@ -524,6 +528,19 @@
- continue;
- grub_printf_ (N_("Slot %d opened\n"), i);
-
-+ if (grub_le_to_cpu32 (header.version) >= 7)
-+ {
-+ /* GELI >=7 uses the cipher_key */
-+ grub_memcpy (geli_cipher_key, candidate_key.cipher_key,
-+ sizeof (candidate_key.cipher_key));
-+ }
-+ else
-+ {
-+ /* GELI <=6 uses the iv_key */
-+ grub_memcpy (geli_cipher_key, candidate_key.iv_key,
-+ sizeof (candidate_key.iv_key));
-+ }
-+
- /* Set the master key. */
- if (!dev->rekey)
- {
-@@ -540,13 +557,13 @@
- grub_size_t real_keysize = keysize;
- if (grub_le_to_cpu16 (header.alg) == 0x16)
- real_keysize *= 2;
-- /* For a reason I don't know, the IV key is used in rekeying. */
-- grub_memcpy (dev->rekey_key, candidate_key.iv_key,
-- sizeof (candidate_key.iv_key));
-+
-+ grub_memcpy (dev->rekey_key, geli_cipher_key,
-+ sizeof (geli_cipher_key));
- dev->rekey_derived_size = real_keysize;
- dev->last_rekey = -1;
- COMPILE_TIME_ASSERT (sizeof (dev->rekey_key)
-- >= sizeof (candidate_key.iv_key));
-+ >= sizeof (geli_cipher_key));
- }
-
- dev->iv_prefix_len = sizeof (candidate_key.iv_key);
diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h b/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h
new file mode 100644
index 000000000000..9b353e42f498
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-grub-core_lib_libgcrypt_src_types.h
@@ -0,0 +1,11 @@
+--- grub-core/lib/libgcrypt/src/types.h.orig 2014-03-03 16:00:26 UTC
++++ grub-core/lib/libgcrypt/src/types.h
+@@ -113,6 +113,8 @@
+ #endif
+ #endif
+
++typedef uint64_t u64;
++
+ typedef union {
+ int a;
+ short b;
diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c
new file mode 100644
index 000000000000..a25e60121570
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_freebsd_getroot.c
@@ -0,0 +1,108 @@
+--- grub-core/osdep/freebsd/getroot.c.orig 2015-01-23 02:27:45 UTC
++++ grub-core/osdep/freebsd/getroot.c
+@@ -296,6 +296,105 @@ grub_util_get_grub_dev_os (const char *o
+ return grub_dev;
+ }
+
++int grub_util_check_geom_label(const char *name)
++{
++ struct gmesh mesh;
++ struct gclass *class;
++ struct ggeom *geom;
++ struct gprovider *pp;
++ struct gprovider *pplabel;
++ struct gconsumer *cp;
++ const char *geom_name;
++ const char *test_name;
++ int err;
++
++ err = geom_gettree (&mesh);
++ if (err != 0)
++ grub_util_error ("%s", _("couldn't open geom"));
++
++ LIST_FOREACH (class, &mesh.lg_class, lg_class)
++ if (strcasecmp (class->lg_name, "label") == 0)
++ break;
++ if (!class)
++ grub_util_error ("%s", _("couldn't find geom `label' class"));
++
++ if (strncmp (name, "/dev/", sizeof ("/dev/") - 1) == 0)
++ test_name = name + sizeof ("/dev/") - 1;
++ else
++ test_name = name;
++
++ LIST_FOREACH (geom, &class->lg_geom, lg_geom)
++ {
++ LIST_FOREACH(pp, &geom->lg_provider, lg_provider)
++ {
++ geom_name = pp->lg_name;
++ if (strcasecmp (geom_name, test_name) != 0)
++ continue;
++
++ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer)
++ {
++ pplabel = cp->lg_provider;
++ if (pplabel == NULL)
++ continue;
++ return 1;
++ }
++ }
++ }
++ return 0;
++}
++
++const char *
++grub_util_convert_geom_label_to_dev (const char *name, int *full_path)
++{
++ struct gmesh mesh;
++ struct gclass *class;
++ struct ggeom *geom;
++ struct gprovider *pp;
++ struct gprovider *pplabel;
++ struct gconsumer *cp;
++ static char buf[256];
++ const char *geom_name;
++ int err;
++
++ grub_util_info ("Converting label '%s' to device", name);
++
++ err = geom_gettree (&mesh);
++ if (err != 0)
++ grub_util_error ("%s", _("couldn't open geom"));
++
++ LIST_FOREACH (class, &mesh.lg_class, lg_class)
++ if (strcasecmp (class->lg_name, "label") == 0)
++ break;
++ if (!class)
++ grub_util_error ("%s", _("couldn't find geom `label' class"));
++
++
++ LIST_FOREACH (geom, &class->lg_geom, lg_geom)
++ {
++ LIST_FOREACH(pp, &geom->lg_provider, lg_provider)
++ {
++ geom_name = pp->lg_name;
++ if (strcasecmp (geom_name, name) != 0)
++ continue;
++
++ LIST_FOREACH(cp, &geom->lg_consumer, lg_consumer)
++ {
++ pplabel = cp->lg_provider;
++ if (pplabel == NULL)
++ continue;
++
++ if ( full_path )
++ snprintf(buf, sizeof(buf), "/dev/%s", pplabel->lg_name);
++ else
++ snprintf(buf, sizeof(buf), "%s", pplabel->lg_name);
++ return buf;
++ }
++ }
++ }
++ grub_util_error ("%s", _("couldn't convert gptid to real device name"));
++ return 0;
++}
++
+ /* FIXME: geom actually gives us the whole container hierarchy.
+ It can be used more efficiently than this. */
+ void
diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c
new file mode 100644
index 000000000000..824a9c552c1e
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_getroot.c
@@ -0,0 +1,15 @@
+--- grub-core/osdep/unix/getroot.c.orig 2015-06-03 14:54:01 UTC
++++ grub-core/osdep/unix/getroot.c
+@@ -507,6 +507,12 @@ grub_guess_root_devices (const char *dir
+ if (!os_dev)
+ os_dev = find_root_devices_from_libzfs (dir);
+
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++ if (os_dev)
++ if ( grub_util_check_geom_label(os_dev) )
++ os_dev = grub_util_convert_geom_label_to_dev (os_dev + sizeof ("/dev/") - 1, 1);
++#endif
++
+ if (os_dev)
+ {
+ char **cur;
diff --git a/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c
new file mode 100644
index 000000000000..15b7cb871052
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-grub-core_osdep_unix_platform.c
@@ -0,0 +1,100 @@
+--- grub-core/osdep/unix/platform.c.orig 2014-03-03 16:00:26 UTC
++++ grub-core/osdep/unix/platform.c
+@@ -81,52 +81,8 @@ get_ofpathname (const char *dev)
+ static void
+ grub_install_remove_efi_entries_by_distributor (const char *efi_distributor)
+ {
+- int fd;
+- pid_t pid = grub_util_exec_pipe ((const char * []){ "efibootmgr", NULL }, &fd);
+- char *line = NULL;
+- size_t len = 0;
+-
+- if (!pid)
+- {
+- grub_util_warn (_("Unable to open stream from %s: %s"),
+- "efibootmgr", strerror (errno));
+- return;
+- }
+-
+- FILE *fp = fdopen (fd, "r");
+- if (!fp)
+- {
+- grub_util_warn (_("Unable to open stream from %s: %s"),
+- "efibootmgr", strerror (errno));
+- return;
+- }
+-
+- line = xmalloc (80);
+- len = 80;
+- while (1)
+- {
+- int ret;
+- char *bootnum;
+- ret = getline (&line, &len, fp);
+- if (ret == -1)
+- break;
+- if (grub_memcmp (line, "Boot", sizeof ("Boot") - 1) != 0
+- || line[sizeof ("Boot") - 1] < '0'
+- || line[sizeof ("Boot") - 1] > '9')
+- continue;
+- if (!strcasestr (line, efi_distributor))
+- continue;
+- bootnum = line + sizeof ("Boot") - 1;
+- bootnum[4] = '\0';
+- if (!verbosity)
+- grub_util_exec ((const char * []){ "efibootmgr", "-q",
+- "-b", bootnum, "-B", NULL });
+- else
+- grub_util_exec ((const char * []){ "efibootmgr",
+- "-b", bootnum, "-B", NULL });
+- }
+-
+- free (line);
++ // We don't have efibootmgr on FreeBSD, have to set externally
++ return;
+ }
+
+ void
+@@ -134,40 +90,8 @@ grub_install_register_efi (grub_device_t
+ const char *efifile_path,
+ const char *efi_distributor)
+ {
+- const char * efidir_disk;
+- int efidir_part;
+- efidir_disk = grub_util_biosdisk_get_osdev (efidir_grub_dev->disk);
+- efidir_part = efidir_grub_dev->disk->partition ? efidir_grub_dev->disk->partition->number + 1 : 1;
+-
+- if (grub_util_exec_redirect_null ((const char * []){ "efibootmgr", "--version", NULL }))
+- {
+- /* TRANSLATORS: This message is shown when required executable `%s'
+- isn't found. */
+- grub_util_error (_("%s: not found"), "efibootmgr");
+- }
+-
+- /* On Linux, we need the efivars kernel modules. */
+-#ifdef __linux__
+- grub_util_exec ((const char * []){ "modprobe", "-q", "efivars", NULL });
+-#endif
+- /* Delete old entries from the same distributor. */
+- grub_install_remove_efi_entries_by_distributor (efi_distributor);
+-
+- char *efidir_part_str = xasprintf ("%d", efidir_part);
+-
+- if (!verbosity)
+- grub_util_exec ((const char * []){ "efibootmgr", "-q",
+- "-c", "-d", efidir_disk,
+- "-p", efidir_part_str, "-w",
+- "-L", efi_distributor, "-l",
+- efifile_path, NULL });
+- else
+- grub_util_exec ((const char * []){ "efibootmgr",
+- "-c", "-d", efidir_disk,
+- "-p", efidir_part_str, "-w",
+- "-L", efi_distributor, "-l",
+- efifile_path, NULL });
+- free (efidir_part_str);
++ // We don't have efibootmgr on FreeBSD, have to set externally
++ return;
+ }
+
+ void
diff --git a/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h b/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h
new file mode 100644
index 000000000000..10e7f60c58ae
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-include_grub_emu_getroot.h
@@ -0,0 +1,11 @@
+--- include/grub/emu/getroot.h.orig 2015-01-23 02:27:45 UTC
++++ include/grub/emu/getroot.h
+@@ -44,6 +44,8 @@ char *grub_util_get_grub_dev (const char
+ #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+ void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out,
+ char **name_out);
++int grub_util_check_geom_label(const char *name);
++const char *grub_util_convert_geom_label_to_dev (const char *name, int *full_path);
+ #endif
+
+ #include <sys/stat.h>
diff --git a/sysutils/grub2-pcbsd/files/patch-include_grub_gpt_partition.h b/sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h
index 4245333aa2d2..d8da78eea7b3 100644
--- a/sysutils/grub2-pcbsd/files/patch-include_grub_gpt_partition.h
+++ b/sysutils/grub2-pcbsd/files/patch-include_grub_gpt__partition.h
@@ -1,6 +1,6 @@
---- include/grub/gpt_partition.h.orig 2014-12-02 14:32:40.000000000 +0800
-+++ include/grub/gpt_partition.h 2014-12-02 14:35:03.000000000 +0800
-@@ -43,6 +43,14 @@
+--- include/grub/gpt_partition.h.orig 2014-03-03 16:00:26 UTC
++++ include/grub/gpt_partition.h
+@@ -43,6 +43,14 @@ typedef struct grub_gpt_part_type grub_g
{ 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \
}
diff --git a/sysutils/grub2-pcbsd/files/patch-po_LINGUAS b/sysutils/grub2-pcbsd/files/patch-po_LINGUAS
new file mode 100644
index 000000000000..2dbcb6e4d4cc
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-po_LINGUAS
@@ -0,0 +1,5 @@
+--- po/LINGUAS.orig 2015-01-30 16:30:32 UTC
++++ po/LINGUAS
+@@ -1 +1 @@
+-ast ca da de de@hebrew de_CH en@arabic en@cyrillic en@greek en@hebrew en@piglatin en@quot eo es fi fr gl hu id it ja lt nb nl pa pl pt_BR ru sl sv tr uk vi zh_CN zh_TW
++ast ca da de eo es fi fr gl hu id it ja lt nb nl pa pl pt_BR ru sl sv tr uk vi zh_CN zh_TW
diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-install.c b/sysutils/grub2-pcbsd/files/patch-util_grub-install.c
new file mode 100644
index 000000000000..bee5b764e6db
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-util_grub-install.c
@@ -0,0 +1,19 @@
+--- util/grub-install.c.orig 2015-06-03 14:54:01 UTC
++++ util/grub-install.c
+@@ -236,7 +236,16 @@ argp_parser (int key, char *arg, struct
+ case ARGP_KEY_ARG:
+ if (install_device)
+ grub_util_error ("%s", _("More than one install device?"));
++#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
++ /* Check if passing a FreeBSD geom label */
++ if ( grub_util_check_geom_label(arg) )
++ install_device = \
++ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1));
++ else
++ install_device = xstrdup (arg);
++#else
+ install_device = xstrdup (arg);
++#endif
+ return 0;
+
+ default:
diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig_lib.in b/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in
index f717ed12c21b..219e3c95aee8 100644
--- a/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig_lib.in
+++ b/sysutils/grub2-pcbsd/files/patch-util_grub-mkconfig__lib.in
@@ -1,6 +1,6 @@
---- util/grub-mkconfig_lib.in.orig 2014-03-03 11:00:26.000000000 -0500
-+++ util/grub-mkconfig_lib.in 2014-06-05 12:45:58.532199020 -0400
-@@ -139,7 +139,17 @@
+--- util/grub-mkconfig_lib.in.orig 2015-06-03 14:54:01 UTC
++++ util/grub-mkconfig_lib.in
+@@ -139,7 +139,17 @@ prepare_grub_to_access_device ()
echo "insmod ${module}"
done
diff --git a/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c b/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c
new file mode 100644
index 000000000000..eb75b0c1587e
--- /dev/null
+++ b/sysutils/grub2-pcbsd/files/patch-util_grub-probe.c
@@ -0,0 +1,19 @@
+--- util/grub-probe.c.orig 2015-06-03 14:54:01 UTC
++++ util/grub-probe.c
+@@ -805,7 +805,16 @@ argp_parser (int key, char *arg, struct
+
+ case ARGP_KEY_ARG:
+ assert (arguments->ndevices < arguments->device_max);
++#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
++ /* Check if passing a FreeBSD geom label */
++ if ( grub_util_check_geom_label(arg) )
++ arguments->devices[arguments->ndevices++] = \
++ xstrdup(grub_util_convert_geom_label_to_dev (arg + sizeof ("/dev/") - 1, 1));
++ else
++ arguments->devices[arguments->ndevices++] = xstrdup(arg);
++#else
+ arguments->devices[arguments->ndevices++] = xstrdup(arg);
++#endif
+ break;
+
+ default:
diff --git a/sysutils/grub2-pcbsd/pkg-install b/sysutils/grub2-pcbsd/pkg-install
deleted file mode 100644
index 87e013c76d49..000000000000
--- a/sysutils/grub2-pcbsd/pkg-install
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-PREFIX=${PKG_PREFIX-/usr/local}
-
-if [ "$2" != "POST-INSTALL" ] ; then
- exit 0
-fi
-
-# If this is during staging, we can skip for now
-echo $PREFIX | grep -q '/stage/'
-if [ $? -eq 0 ] ; then
- exit 0
-fi
-
-# Copy over user-editable 40_custom script
-if [ ! -e "${PREFIX}/etc/grub.d/40_custom" ] ; then
- cp ${PREFIX}/etc/grub.d/40_custom.dist ${PREFIX}/etc/grub.d/40_custom
- chmod 755 ${PREFIX}/etc/grub.d/40_custom
-fi
-
-exit 0
-