diff --git a/grub-2.00-add-fw_path-search.patch b/grub-2.00-add-fw_path-search.patch deleted file mode 100644 index 367415e..0000000 --- a/grub-2.00-add-fw_path-search.patch +++ /dev/null @@ -1,78 +0,0 @@ -From d829d54d0f461c7bc6a7d8bd549cfdacfac51082 Mon Sep 17 00:00:00 2001 -From: Matthew Garrett -Date: Mon, 21 May 2012 14:36:39 -0400 -Subject: [PATCH] Add fw_path variable - ---- - grub-core/kern/main.c | 16 ++++++++++++++-- - grub-core/normal/main.c | 20 +++++++++++++++++++- - 2 files changed, 33 insertions(+), 3 deletions(-) - -diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 185230c..26481c6 100644 ---- a/grub-core/kern/main.c -+++ b/grub-core/kern/main.c -@@ -114,6 +114,20 @@ grub_set_prefix_and_root (void) - - grub_register_variable_hook ("root", 0, grub_env_write_root); - -+ grub_machine_get_bootlocation (&fwdevice, &fwpath); -+ -+ if (fwdevice && fwpath) -+ { -+ char *fw_path; -+ -+ fw_path = grub_xasprintf ("(%s)/%s", fwdevice, fwpath); -+ if (fw_path) -+ { -+ grub_env_set ("fw_path", fw_path); -+ grub_free (fw_path); -+ } -+ } -+ - if (prefix) - { - char *pptr = NULL; -@@ -131,8 +145,6 @@ grub_set_prefix_and_root (void) - if (pptr[0]) - path = grub_strdup (pptr); - } -- if ((!device || device[0] == ',' || !device[0]) || !path) -- grub_machine_get_bootlocation (&fwdevice, &fwpath); - - if (!device && fwdevice) - device = fwdevice; -diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 1963fe4..64c2a9f 100644 ---- a/grub-core/normal/main.c -+++ b/grub-core/normal/main.c -@@ -309,7 +309,25 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), - /* Guess the config filename. It is necessary to make CONFIG static, - so that it won't get broken by longjmp. */ - char *config; -- const char *prefix; -+ const char *prefix, *fw_path; -+ -+ fw_path = grub_env_get ("fw_path"); -+ if (fw_path) -+ { -+ config = grub_xasprintf ("%s/grub.cfg", fw_path); -+ if (config) -+ { -+ grub_file_t file; -+ -+ file = grub_file_open (config); -+ if (file) -+ { -+ grub_file_close (file); -+ grub_enter_normal_mode (config); -+ } -+ grub_free (config); -+ } -+ } - - prefix = grub_env_get ("prefix"); - if (prefix) --- -1.7.10.2 - diff --git a/grub-2.00-add-fw_path-search_v2.patch b/grub-2.00-add-fw_path-search_v2.patch new file mode 100644 index 0000000..c7857c3 --- /dev/null +++ b/grub-2.00-add-fw_path-search_v2.patch @@ -0,0 +1,88 @@ +From 40d6b00fa48ae9c1cecf143da5c6061f6ffcb719 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Wed, 19 Sep 2012 21:22:55 -0300 +Subject: [PATCH] Add fw_path variable (revised) + +This patch makes grub look for its config file on efi where the app was +found. It was originally written by Matthew Garrett, and adapted to fix the +"No modules are loaded on grub2 network boot" issue: + +https://bugzilla.redhat.com/show_bug.cgi?id=857936 +--- + grub-core/kern/main.c | 16 ++++++++++++++-- + grub-core/normal/main.c | 25 ++++++++++++++++++++++++- + 2 files changed, 38 insertions(+), 3 deletions(-) + +diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c +index 3262444..820fd66 100644 +--- a/grub-core/kern/main.c ++++ b/grub-core/kern/main.c +@@ -114,6 +114,20 @@ grub_set_prefix_and_root (void) + + grub_register_variable_hook ("root", 0, grub_env_write_root); + ++ grub_machine_get_bootlocation (&fwdevice, &fwpath); ++ ++ if (fwdevice && fwpath) ++ { ++ char *fw_path; ++ ++ fw_path = grub_xasprintf ("(%s)/%s", fwdevice, fwpath); ++ if (fw_path) ++ { ++ grub_env_set ("fw_path", fw_path); ++ grub_free (fw_path); ++ } ++ } ++ + if (prefix) + { + char *pptr = NULL; +@@ -131,8 +145,6 @@ grub_set_prefix_and_root (void) + if (pptr[0]) + path = grub_strdup (pptr); + } +- if ((!device || device[0] == ',' || !device[0]) || !path) +- grub_machine_get_bootlocation (&fwdevice, &fwpath); + + if (!device && fwdevice) + device = fwdevice; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 13473ec..39bb734 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -333,7 +333,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), + /* Guess the config filename. It is necessary to make CONFIG static, + so that it won't get broken by longjmp. */ + char *config; +- const char *prefix; ++ const char *prefix, *fw_path; ++ ++ fw_path = grub_env_get ("fw_path"); ++ if (fw_path) ++ { ++ config = grub_xasprintf ("%s/grub.cfg", fw_path); ++ if (config) ++ { ++ grub_file_t file; ++ ++ file = grub_file_open (config); ++ if (file) ++ { ++ grub_file_close (file); ++ grub_enter_normal_mode (config); ++ } ++ else ++ { ++ /* Ignore all errors. */ ++ grub_errno = 0; ++ } ++ grub_free (config); ++ } ++ } + + prefix = grub_env_get ("prefix"); + if (prefix) +-- +1.7.10.4 + diff --git a/grub-2.00-increase-the-ieee1275-device-path-buffer-size.patch b/grub-2.00-increase-the-ieee1275-device-path-buffer-size.patch new file mode 100644 index 0000000..8d254bf --- /dev/null +++ b/grub-2.00-increase-the-ieee1275-device-path-buffer-size.patch @@ -0,0 +1,29 @@ +From 7e1f42417dab20d470d1e45dfa73d00c763d792d Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Wed, 19 Sep 2012 20:50:38 -0300 +Subject: [PATCH] increase the ieee1275 device path buffer size + +There are cases when the openfirmware device path is bigger then 64 chars. + +This should fix this bugzilla: +https://bugzilla.redhat.com/show_bug.cgi?id=857936 +--- + grub-core/kern/ieee1275/init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 7d03a8a..5c45947 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -82,7 +82,7 @@ void (*grub_ieee1275_net_config) (const char *dev, + void + grub_machine_get_bootlocation (char **device, char **path) + { +- char bootpath[64]; /* XXX check length */ ++ char bootpath[256]; /* Max device path length */ + char *filename; + char *type; + +-- +1.7.10.4 + diff --git a/grub-2.00-no-insmod-on-sb.patch b/grub-2.00-no-insmod-on-sb.patch index 25719e4..828ce81 100644 --- a/grub-2.00-no-insmod-on-sb.patch +++ b/grub-2.00-no-insmod-on-sb.patch @@ -24,13 +24,15 @@ index eec575c..3df9dbd 100644 /* set ENVVAR=VALUE */ static grub_err_t grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)), -@@ -81,6 +85,11 @@ grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), +@@ -81,6 +85,13 @@ grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), { grub_dl_t mod; +#ifdef GRUB_MACHINE_EFI -+ if (grub_efi_secure_boot()) -+ return grub_error (GRUB_ERR_ACCESS_DENIED, N_("Secure Boot forbids insmod")); ++ if (grub_efi_secure_boot()) { ++ //grub_printf("%s\n", N_("Secure Boot forbids insmod")); ++ return 0; ++ } +#endif + if (argc == 0) diff --git a/grub2.spec b/grub2.spec index d53f651..2463759 100644 --- a/grub2.spec +++ b/grub2.spec @@ -41,7 +41,7 @@ Name: grub2 Epoch: 1 Version: 2.00 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -55,7 +55,7 @@ Source5: theme.tar.bz2 #Source6: grub-cd.cfg Patch2: grub-1.99-just-say-linux.patch Patch5: grub-1.99-ppc-terminfo.patch -Patch10: grub-2.00-add-fw_path-search.patch +Patch10: grub-2.00-add-fw_path-search_v2.patch Patch11: grub-2.00-Add-fwsetup.patch Patch13: grub-2.00-Dont-set-boot-on-ppc.patch Patch18: grub-2.00-ignore-gnulib-gets-stupidity.patch @@ -66,6 +66,7 @@ Patch22: grub2-use-linuxefi.patch Patch23: grub-2.00-dont-decrease-mmap-size.patch Patch24: grub-2.00-no-insmod-on-sb.patch Patch25: grub-2.00-efidisk-ahci-workaround.patch +Patch26: grub-2.00-increase-the-ieee1275-device-path-buffer-size.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -418,6 +419,13 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog +* Thu Sep 20 2012 Peter Jones - 2.00-8 +- Don't error on insmod on UEFI/SB, but also don't do any insmodding. +- Increase device path size for ieee1275 + Resolves: rhbz#857936 +- Make network booting work on ieee1275 machines. + Resolves: rhbz#857936 + * Wed Sep 05 2012 Matthew Garrett - 2.00-7 - Add Apple partition map support for EFI