- Update to latest git pull - 2.02_3

- Add support for GELI passphrase kernel passthrough
- Patch grub-install / EFI support to disable trying to use Linux 'efibootmgr'
This commit is contained in:
Kris Moore 2014-10-21 15:24:01 +00:00
parent 4c20dde0e5
commit 3a78b54670
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=371324
5 changed files with 116 additions and 6 deletions

View file

@ -3,11 +3,11 @@
PORTNAME= grub2-pcbsd
PORTVERSION= 2.02p
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= sysutils
MASTER_SITES= http://www.pcbsd.org/~kris/software/ \
ftp://ftp.pcbsd.org/pub/software/
DISTNAME= grub-2.02_2
DISTNAME= grub-2.02_3
MAINTAINER= kmoore@FreeBSD.org
COMMENT= Multiboot boot loader

View file

@ -1,2 +1,2 @@
SHA256 (grub-2.02_2.tar.xz) = 6cc58fa5629e47a512b416810caf148f3659b039d2080fbd0b6b8c9c82958aab
SIZE (grub-2.02_2.tar.xz) = 4463684
SHA256 (grub-2.02_3.tar.xz) = 207b1d065f4ef18c77061c047b591a9cd2c946f5c320bdbf0fd48f41e02e4711
SIZE (grub-2.02_3.tar.xz) = 4466580

View file

@ -1,5 +1,5 @@
--- grub-core/disk/geli.c.orig 2014-05-15 14:00:10.000000000 -0400
+++ grub-core/disk/geli.c 2014-05-20 14:46:07.604565349 -0400
+++ grub-core/disk/geli.c 2014-09-26 10:18:53.325111693 -0400
@@ -225,7 +225,7 @@
/* Look for GELI magic sequence. */
@ -18,3 +18,13 @@
|| grub_le_to_cpu32 (header.version) < 1)
{
grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]);
@@ -430,6 +430,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)
{

View file

@ -5,7 +5,7 @@
#define MAX_SUPPORTED_FEATURE_STRLEN 50
static const char *spa_feature_names[] = {
- "org.illumos:lz4_compress",NULL
+ "org.illumos:lz4_compress","com.delphix:hole_birth",NULL
+ "org.illumos:lz4_compress","com.delphix:hole_birth","com.delphix:extensible_dataset","com.delphix:embedded_data",NULL
};
static int

View file

@ -0,0 +1,100 @@
--- grub-core/osdep/unix/platform.c.orig 2014-10-21 10:55:38.203922144 -0400
+++ grub-core/osdep/unix/platform.c 2014-10-21 10:56:54.300915974 -0400
@@ -81,52 +81,8 @@
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 @@
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