From b2ba2fbd9c9e58c670d7e7e4c5809b84bf20645c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Jan 31 2013 16:39:28 +0000 Subject: Merge branch 'f18' into f17 Conflicts: grub2.spec --- diff --git a/add-vlan-tag-support.patch b/add-vlan-tag-support.patch new file mode 100644 index 0000000..15f92f8 --- /dev/null +++ b/add-vlan-tag-support.patch @@ -0,0 +1,185 @@ +From 5573f16fd05c1f8f310f2ead176b52ed6d4a08ec Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Tue, 30 Oct 2012 15:19:39 -0200 +Subject: [PATCH] Add vlan-tag support + +This patch adds support for virtual LAN (VLAN) tagging. VLAN tagging allows +multiple VLANs in a bridged network to share the same physical network link but +maintain isolation: + +http://en.wikipedia.org/wiki/IEEE_802.1Q + +This patch should fix this bugzilla: +https://bugzilla.redhat.com/show_bug.cgi?id=871563 +--- + grub-core/kern/ieee1275/init.c | 1 + + grub-core/kern/ieee1275/openfw.c | 30 +++++++++++++++++++++++++++ + grub-core/net/ethernet.c | 42 +++++++++++++++++++++++++++++++++++--- + include/grub/ieee1275/ieee1275.h | 1 + + include/grub/net.h | 2 ++ + 5 files changed, 73 insertions(+), 3 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 5c45947..209cf8a 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -102,6 +102,7 @@ grub_machine_get_bootlocation (char **device, char **path) + char *dev, *canon; + char *ptr; + dev = grub_ieee1275_get_aliasdevname (bootpath); ++ grub_ieee1275_parse_net_options (bootpath); + canon = grub_ieee1275_canonicalise_devname (dev); + ptr = canon + grub_strlen (canon) - 1; + while (ptr > canon && (*ptr == ',' || *ptr == ':')) +diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c +index c2b1bdf..9fdfafa 100644 +--- a/grub-core/kern/ieee1275/openfw.c ++++ b/grub-core/kern/ieee1275/openfw.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + enum grub_ieee1275_parse_type + { +@@ -413,6 +414,35 @@ fail: + return ret; + } + ++int ++grub_ieee1275_parse_net_options (const char *path) ++{ ++ char *comma; ++ char *args; ++ char *option = 0; ++ ++ args = grub_ieee1275_get_devargs (path); ++ if (!args) ++ /* There is no option. */ ++ return -1; ++ ++ do ++ { ++ comma = grub_strchr (args, ','); ++ if (! comma) ++ option = grub_strdup (args); ++ else ++ option = grub_strndup (args, (grub_size_t)(comma - args)); ++ args = comma + 1; ++ ++ if (! grub_strncmp(option, "vtag", 4)) ++ grub_env_set ("vlan-tag", option + grub_strlen("vtag=")); ++ ++ } while (comma); ++ ++ return 0; ++} ++ + char * + grub_ieee1275_get_device_type (const char *path) + { +diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c +index b38e2c8..5e45d46 100644 +--- a/grub-core/net/ethernet.c ++++ b/grub-core/net/ethernet.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -56,10 +57,19 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, + { + struct etherhdr *eth; + grub_err_t err; ++ grub_uint32_t vlantag = 0; ++ grub_uint8_t etherhdr_size; + +- COMPILE_TIME_ASSERT (sizeof (*eth) < GRUB_NET_MAX_LINK_HEADER_SIZE); ++ etherhdr_size = sizeof (*eth); ++ COMPILE_TIME_ASSERT (sizeof (*eth) + 4 < GRUB_NET_MAX_LINK_HEADER_SIZE); + +- err = grub_netbuff_push (nb, sizeof (*eth)); ++ const char *vlantag_text = grub_env_get ("vlan-tag"); ++ if (vlantag_text != 0) { ++ etherhdr_size += 4; ++ vlantag = grub_strtoul (vlantag_text, 0, 16); ++ } ++ ++ err = grub_netbuff_push (nb, etherhdr_size); + if (err) + return err; + eth = (struct etherhdr *) nb->data; +@@ -76,6 +86,19 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, + return err; + inf->card->opened = 1; + } ++ ++ /* Check if a vlan-tag is needed. */ ++ if (vlantag != 0) ++ { ++ /* Move eth type to the right */ ++ grub_memcpy((char *) nb->data + etherhdr_size - 2, ++ (char *) nb->data + etherhdr_size - 6, 2); ++ ++ /* Add the tag in the middle */ ++ grub_memcpy((char *) nb->data + etherhdr_size - 6, ++ &vlantag, 4); ++ } ++ + return inf->card->driver->send (inf->card, nb); + } + +@@ -90,10 +113,23 @@ grub_net_recv_ethernet_packet (struct grub_net_buff *nb, + grub_net_link_level_address_t hwaddress; + grub_net_link_level_address_t src_hwaddress; + grub_err_t err; ++ grub_uint8_t etherhdr_size = sizeof (*eth); ++ ++ grub_uint16_t vlantag_identifier = 0; ++ grub_memcpy (&vlantag_identifier, nb->data + etherhdr_size - 2, 2); ++ ++ /* Check if a vlan-tag is present. */ ++ if (vlantag_identifier == VLANTAG_IDENTIFIER) ++ { ++ etherhdr_size += 4; ++ /* Move eth type to the original position */ ++ grub_memcpy((char *) nb->data + etherhdr_size - 6, ++ (char *) nb->data + etherhdr_size - 2, 2); ++ } + + eth = (struct etherhdr *) nb->data; + type = grub_be_to_cpu16 (eth->type); +- err = grub_netbuff_pull (nb, sizeof (*eth)); ++ err = grub_netbuff_pull (nb, etherhdr_size); + if (err) + return err; + +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 416a544..a8cf093 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -210,5 +210,6 @@ char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); + char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); + int EXPORT_FUNC(grub_ieee1275_cas_reboot) (char *script); + int EXPORT_FUNC(grub_ieee1275_set_boot_last_label) (const char *text); ++int EXPORT_FUNC(grub_ieee1275_parse_net_options) (const char *path); + + #endif /* ! GRUB_IEEE1275_HEADER */ +diff --git a/include/grub/net.h b/include/grub/net.h +index a7e5b2c..f4fec17 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -532,4 +532,6 @@ extern char *grub_net_default_server; + #define GRUB_NET_TRIES 40 + #define GRUB_NET_INTERVAL 400 + ++#define VLANTAG_IDENTIFIER 0x8100 ++ + #endif /* ! GRUB_NET_HEADER */ +-- +1.7.10.4 + diff --git a/follow-the-symbolic-link-ieee1275.patch b/follow-the-symbolic-link-ieee1275.patch new file mode 100644 index 0000000..0cf624b --- /dev/null +++ b/follow-the-symbolic-link-ieee1275.patch @@ -0,0 +1,27 @@ +From 9436d0324b98e71c8ab55b09b4248a617cd463a8 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Wed, 7 Nov 2012 16:22:33 -0200 +Subject: [PATCH] Follow the symbolic link (ieee1275) + +If the device used is a symlink, the file command must "follow +the link" in order to check the real device. +--- + util/grub-install.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-install.in b/util/grub-install.in +index 69a97ad..19dc3b4 100644 +--- a/util/grub-install.in ++++ b/util/grub-install.in +@@ -750,7 +750,7 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] + exit 1 + fi + +- if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ x$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t zero_check) = xtrue ]; then ++ if [ "$(file -s -b -L "${install_device}" | awk '{ print $1 }')" = ELF ] || [ x$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t zero_check) = xtrue ]; then + dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || { + gettext "Failed to copy Grub to the PReP partition." 1>&2 + echo 1>&2 +-- +1.7.10.4 + diff --git a/grub-2.00-Add-fwsetup.patch b/grub-2.00-Add-fwsetup.patch index 051a9e1..5abae3b 100644 --- a/grub-2.00-Add-fwsetup.patch +++ b/grub-2.00-Add-fwsetup.patch @@ -16,22 +16,22 @@ specific value and reboot. 6 files changed, 139 insertions(+) create mode 100644 grub-core/commands/efi/efifwsetup.c -diff --git a/ChangeLog b/ChangeLog -index ce52576..29ebcbd 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,11 @@ -+2012-05-24 Peter Jones -+ -+ * grub-core/Makefile.core.def: add efifwsetup module -+ * grub-core/commands/efi/efifwsetup.c: add code for fwsetup command -+ * grub-core/kern/efi/efi.c (grub_efi_set_variable): New function -+ * include/grub/efi/api.h: add define for OsIndications variable -+ * include/grub/efi/efi.h: export grub_efi_set_variable -+ - 2012-05-31 Vladimir Serbinenko - - * configure.ac: Bump to beta6. +#diff --git a/ChangeLog b/ChangeLog +#index ce52576..29ebcbd 100644 +#--- a/ChangeLog +#+++ b/ChangeLog +#@@ -1,3 +1,11 @@ +#+2012-05-24 Peter Jones +#+ +#+ * grub-core/Makefile.core.def: add efifwsetup module +#+ * grub-core/commands/efi/efifwsetup.c: add code for fwsetup command +#+ * grub-core/kern/efi/efi.c (grub_efi_set_variable): New function +#+ * include/grub/efi/api.h: add define for OsIndications variable +#+ * include/grub/efi/efi.h: export grub_efi_set_variable +#+ +# 2012-05-31 Vladimir Serbinenko +# +# * configure.ac: Bump to beta6. diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 000cf0d..d0c06d5 100644 --- a/grub-core/Makefile.core.def @@ -181,9 +181,9 @@ index 6f12c76..7a418a6 100644 + return grub_error (GRUB_ERR_IO, "could not set EFI variable `%s'", var); +} + - grub_uint64_t - grub_rtc_get_time_ms (void) - { + #pragma GCC diagnostic ignored "-Wcast-align" + + /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 26127de..a47a4e3 100644 --- a/include/grub/efi/api.h diff --git a/grub-2.00-Dont-set-boot-on-ppc.patch b/grub-2.00-Dont-set-boot-on-ppc.patch index c2051f4..481d8b9 100644 --- a/grub-2.00-Dont-set-boot-on-ppc.patch +++ b/grub-2.00-Dont-set-boot-on-ppc.patch @@ -10,10 +10,10 @@ there is no way to set boot-device. 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/util/grub-install.in b/util/grub-install.in -index 293b756..2503aa0 100644 +index e19f1cd..69a97ad 100644 --- a/util/grub-install.in +++ b/util/grub-install.in -@@ -818,14 +818,16 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] +@@ -807,14 +807,16 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] } fi @@ -37,7 +37,4 @@ index 293b756..2503aa0 100644 + fi fi elif [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = xmips-arc ]; then - dvhtool -d "${install_device}" --unix-to-vh "{grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" grub --- -1.7.10.1 - + dvhtool -d "${install_device}" --unix-to-vh "${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" grub diff --git a/grub-2.00-Handle-escapes-in-labels.patch b/grub-2.00-Handle-escapes-in-labels.patch new file mode 100644 index 0000000..65a2a41 --- /dev/null +++ b/grub-2.00-Handle-escapes-in-labels.patch @@ -0,0 +1,186 @@ +From d08e2511db353b2db9c5785d3f22079674abd708 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 1 Oct 2012 13:24:37 -0400 +Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. + +--- + grub-core/commands/wildcard.c | 16 +++++++++++++++- + grub-core/lib/cmdline.c | 34 +++++++++++++++++++++++++++++++-- + grub-core/script/execute.c | 44 +++++++++++++++++++++++++++++++++++++------ + 3 files changed, 85 insertions(+), 9 deletions(-) + +diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c +index 2b73d9a..d1235dc 100644 +--- a/grub-core/commands/wildcard.c ++++ b/grub-core/commands/wildcard.c +@@ -420,6 +420,12 @@ check_file (const char *dir, const char *basename) + return found; + } + ++static int ++is_hex(char c) ++{ ++ return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); ++} ++ + static void + unescape (char *out, const char *in, const char *end) + { +@@ -428,7 +434,15 @@ unescape (char *out, const char *in, const char *end) + + for (optr = out, iptr = in; iptr < end;) + { +- if (*iptr == '\\' && iptr + 1 < end) ++ if (*iptr == '\\' && iptr + 3 < end && iptr[1] == 'x' && is_hex(iptr[2]) && is_hex(iptr[3])) ++ { ++ *optr++ = *iptr++; ++ *optr++ = *iptr++; ++ *optr++ = *iptr++; ++ *optr++ = *iptr++; ++ continue; ++ } ++ else if (*iptr == '\\' && iptr + 1 < end) + { + *optr++ = iptr[1]; + iptr += 2; +diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c +index a702e64..c8605a7 100644 +--- a/grub-core/lib/cmdline.c ++++ b/grub-core/lib/cmdline.c +@@ -20,6 +20,12 @@ + #include + #include + ++static int ++is_hex(char c) ++{ ++ return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); ++} ++ + static unsigned int check_arg (char *c, int *has_space) + { + int space = 0; +@@ -27,7 +33,13 @@ static unsigned int check_arg (char *c, int *has_space) + + while (*c) + { +- if (*c == '\\' || *c == '\'' || *c == '"') ++ if (*c == '\\' && *(c+1) == 'x' && is_hex(*(c+2)) && is_hex(*(c+3))) ++ { ++ size += 4; ++ c += 4; ++ continue; ++ } ++ else if (*c == '\\' || *c == '\'' || *c == '"') + size++; + else if (*c == ' ') + space = 1; +@@ -82,7 +94,25 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf, + + while (*c) + { +- if (*c == '\\' || *c == '\'' || *c == '"') ++ if (*c == ' ') ++ { ++ *buf++ = '\\'; ++ *buf++ = 'x'; ++ *buf++ = '2'; ++ *buf++ = '0'; ++ c++; ++ continue; ++ } ++ else if (*c == '\\' && *(c+1) == 'x' && ++ is_hex(*(c+2)) && is_hex(*(c+3))) ++ { ++ *buf++ = *c++; ++ *buf++ = *c++; ++ *buf++ = *c++; ++ *buf++ = *c++; ++ continue; ++ } ++ else if (*c == '\\' || *c == '\'' || *c == '"') + *buf++ = '\\'; + + *buf++ = *c; +diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c +index b5e6eb0..c44eced 100644 +--- a/grub-core/script/execute.c ++++ b/grub-core/script/execute.c +@@ -52,6 +52,12 @@ static struct grub_script_scope *scope = 0; + /* Wildcard translator for GRUB script. */ + struct grub_script_wildcard_translator *grub_wildcard_translator; + ++static int ++is_hex(char c) ++{ ++ return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); ++} ++ + static char* + wildcard_escape (const char *s) + { +@@ -68,7 +74,15 @@ wildcard_escape (const char *s) + i = 0; + while ((ch = *s++)) + { +- if (ch == '*' || ch == '\\' || ch == '?') ++ if (ch == '\\' && s[0] == 'x' && is_hex(s[1]) && is_hex(s[2])) ++ { ++ p[i++] = ch; ++ p[i++] = *s++; ++ p[i++] = *s++; ++ p[i++] = *s++; ++ continue; ++ } ++ else if (ch == '*' || ch == '\\' || ch == '?') + p[i++] = '\\'; + p[i++] = ch; + } +@@ -92,7 +106,14 @@ wildcard_unescape (const char *s) + i = 0; + while ((ch = *s++)) + { +- if (ch == '\\') ++ if (ch == '\\' && s[0] == 'x' && is_hex(s[1]) && is_hex(s[2])) ++ { ++ p[i++] = '\\'; ++ p[i++] = *s++; ++ p[i++] = *s++; ++ p[i++] = *s++; ++ } ++ else if (ch == '\\') + p[i++] = *s++; + else + p[i++] = ch; +@@ -381,14 +402,24 @@ parse_string (const char *str, + int escaped = 0; + const char *optr; + + for (ptr = str; ptr && *ptr; ) + switch (*ptr) + { + case '\\': +- escaped = !escaped; +- if (!escaped && put) +- *((*put)++) = '\\'; +- ptr++; ++ if (!escaped && put && *(ptr+1) == 'x' && is_hex(*(ptr+2)) && is_hex(*(ptr+3))) ++ { ++ *((*put)++) = *ptr++; ++ *((*put)++) = *ptr++; ++ *((*put)++) = *ptr++; ++ *((*put)++) = *ptr++; ++ } ++ else ++ { ++ escaped = !escaped; ++ if (!escaped && put) ++ *((*put)++) = '\\'; ++ ptr++; ++ } + break; + case '$': + if (escaped) +-- +1.7.12.1 + diff --git a/grub-2.00-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch b/grub-2.00-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch new file mode 100644 index 0000000..953f2bd --- /dev/null +++ b/grub-2.00-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch @@ -0,0 +1,230 @@ +From 3e00d82827f80461f9fe6da37acd84235c08e5a5 Mon Sep 17 00:00:00 2001 +From: Gustavo Luiz Duarte +Date: Fri, 28 Sep 2012 19:42:07 -0400 +Subject: [PATCH] Issue separate DNS queries for ipv4 and ipv6 + +Adding multiple questions on a single DNS query is not supportted by +most DNS servers. This patch issues two separate DNS queries +sequentially for ipv4 and then for ipv6. + +There are 4 possible config options: + DNS_OPTION_IPV4: issue only one ipv4 query + DNS_OPTION_IPV6: issue only one ipv6 query + DNS_OPTION_PREFER_IPV4: issue the ipv4 query first and fallback to ipv6 + DNS_OPTION_PREFER_IPV6: issue the ipv6 query first and fallback to ipv4 +However, there is no code yet to set such config option. The default is +DNS_OPTION_PREFER_IPV4. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=860829 +--- + grub-core/net/dns.c | 99 ++++++++++++++++++++++++++++++++++++----------------- + include/grub/net.h | 9 +++++ + 2 files changed, 76 insertions(+), 32 deletions(-) + +diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c +index 3381ea7..725725c 100644 +--- a/grub-core/net/dns.c ++++ b/grub-core/net/dns.c +@@ -34,6 +34,14 @@ struct dns_cache_element + #define DNS_CACHE_SIZE 1021 + #define DNS_HASH_BASE 423 + ++typedef enum grub_dns_qtype_id ++ { ++ GRUB_DNS_QTYPE_A = 1, ++ GRUB_DNS_QTYPE_AAAA = 28 ++ } grub_dns_qtype_id_t; ++ ++static grub_dns_option_t dns_type_option = DNS_OPTION_PREFER_IPV4; ++ + static struct dns_cache_element dns_cache[DNS_CACHE_SIZE]; + static struct grub_net_network_level_address *dns_servers; + static grub_size_t dns_nservers, dns_servers_alloc; +@@ -410,13 +418,13 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), + return GRUB_ERR_NONE; + } + +-grub_err_t +-grub_net_dns_lookup (const char *name, ++static grub_err_t ++grub_net_dns_lookup_qtype (const char *name, + const struct grub_net_network_level_address *servers, + grub_size_t n_servers, + grub_size_t *naddresses, + struct grub_net_network_level_address **addresses, +- int cache) ++ int cache, grub_dns_qtype_id_t qtype) + { + grub_size_t send_servers = 0; + grub_size_t i, j; +@@ -471,8 +479,7 @@ grub_net_dns_lookup (const char *name, + + GRUB_NET_MAX_LINK_HEADER_SIZE + + GRUB_NET_UDP_HEADER_SIZE + + sizeof (struct dns_header) +- + grub_strlen (name) + 2 + 4 +- + 2 + 4); ++ + grub_strlen (name) + 2 + 4); + if (!nb) + { + grub_free (data.name); +@@ -482,7 +489,7 @@ grub_net_dns_lookup (const char *name, + + GRUB_NET_MAX_LINK_HEADER_SIZE + + GRUB_NET_UDP_HEADER_SIZE); + grub_netbuff_put (nb, sizeof (struct dns_header) +- + grub_strlen (name) + 2 + 4 + 2 + 4); ++ + grub_strlen (name) + 2 + 4); + head = (struct dns_header *) nb->data; + optr = (grub_uint8_t *) (head + 1); + for (iptr = name; *iptr; ) +@@ -509,18 +516,7 @@ grub_net_dns_lookup (const char *name, + + /* Type: A. */ + *optr++ = 0; +- *optr++ = 1; +- +- /* Class. */ +- *optr++ = 0; +- *optr++ = 1; +- +- /* Compressed name. */ +- *optr++ = 0xc0; +- *optr++ = 0x0c; +- /* Type: AAAA. */ +- *optr++ = 0; +- *optr++ = 28; ++ *optr++ = qtype; + + /* Class. */ + *optr++ = 0; +@@ -529,7 +525,7 @@ grub_net_dns_lookup (const char *name, + head->id = data.id; + head->flags = FLAGS_RD; + head->ra_z_r_code = 0; +- head->qdcount = grub_cpu_to_be16_compile_time (2); ++ head->qdcount = grub_cpu_to_be16_compile_time (1); + head->ancount = grub_cpu_to_be16_compile_time (0); + head->nscount = grub_cpu_to_be16_compile_time (0); + head->arcount = grub_cpu_to_be16_compile_time (0); +@@ -587,16 +583,47 @@ grub_net_dns_lookup (const char *name, + if (*data.naddresses) + return GRUB_ERR_NONE; + if (data.dns_err) +- return grub_error (GRUB_ERR_NET_NO_DOMAIN, +- N_("no DNS record found")); +- ++ { ++ grub_dprintf ("dns", "%s. QTYPE: %u QNAME: %s\n", ++ N_("no DNS record found"), qtype, name); ++ return GRUB_ERR_NET_NO_DOMAIN; ++ } + if (err) + { + grub_errno = err; + return err; + } +- return grub_error (GRUB_ERR_TIMEOUT, +- N_("no DNS reply received")); ++ grub_dprintf ("dns", "%s. QTYPE: %u QNAME: %s\n", ++ N_("no DNS reply received"), qtype, name); ++ return GRUB_ERR_TIMEOUT; ++} ++ ++grub_err_t ++grub_net_dns_lookup (const char *name, ++ const struct grub_net_network_level_address *servers, ++ grub_size_t n_servers, ++ grub_size_t *naddresses, ++ struct grub_net_network_level_address **addresses, ++ int cache) ++{ ++ if (dns_type_option == DNS_OPTION_IPV6 || dns_type_option == DNS_OPTION_PREFER_IPV6) ++ grub_net_dns_lookup_qtype (name, servers, n_servers, naddresses, ++ addresses, cache, GRUB_DNS_QTYPE_AAAA); ++ else ++ grub_net_dns_lookup_qtype (name, servers, n_servers, naddresses, ++ addresses, cache, GRUB_DNS_QTYPE_A); ++ if (!*naddresses) ++ { ++ if (dns_type_option == DNS_OPTION_PREFER_IPV4) ++ grub_net_dns_lookup_qtype (name, servers, n_servers, naddresses, ++ addresses, cache, GRUB_DNS_QTYPE_AAAA); ++ else if (dns_type_option == DNS_OPTION_PREFER_IPV6) ++ grub_net_dns_lookup_qtype (name, servers, n_servers, naddresses, ++ addresses, cache, GRUB_DNS_QTYPE_A); ++ } ++ if (!*naddresses) ++ return GRUB_ERR_NET_NO_DOMAIN; ++ return GRUB_ERR_NONE; + } + + static grub_err_t +@@ -604,22 +631,28 @@ grub_cmd_nslookup (struct grub_command *cmd __attribute__ ((unused)), + int argc, char **args) + { + grub_err_t err; +- grub_size_t naddresses, i; ++ struct grub_net_network_level_address cmd_server; ++ struct grub_net_network_level_address *servers; ++ grub_size_t nservers, i, naddresses = 0; + struct grub_net_network_level_address *addresses = 0; + if (argc != 2 && argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected")); + if (argc == 2) + { +- struct grub_net_network_level_address server; +- err = grub_net_resolve_address (args[1], &server); ++ err = grub_net_resolve_address (args[1], &cmd_server); + if (err) + return err; +- err = grub_net_dns_lookup (args[0], &server, 1, &naddresses, +- &addresses, 0); ++ servers = &cmd_server; ++ nservers = 1; + } + else +- err = grub_net_dns_lookup (args[0], dns_servers, dns_nservers, &naddresses, +- &addresses, 0); ++ { ++ servers = dns_servers; ++ nservers = dns_nservers; ++ } ++ ++ grub_net_dns_lookup (args[0], servers, nservers, &naddresses, ++ &addresses, 0); + + for (i = 0; i < naddresses; i++) + { +@@ -628,7 +661,9 @@ grub_cmd_nslookup (struct grub_command *cmd __attribute__ ((unused)), + grub_printf ("%s\n", buf); + } + grub_free (addresses); +- return GRUB_ERR_NONE; ++ if (naddresses) ++ return GRUB_ERR_NONE; ++ return grub_error (GRUB_ERR_NET_NO_DOMAIN, N_("no DNS record found")); + } + + static grub_err_t +diff --git a/include/grub/net.h b/include/grub/net.h +index 3877451..a7e5b2c 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -505,6 +505,15 @@ grub_err_t + grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, + const grub_net_network_level_address_t *proto_addr, + grub_net_link_level_address_t *hw_addr); ++ ++typedef enum ++ { ++ DNS_OPTION_IPV4, ++ DNS_OPTION_IPV6, ++ DNS_OPTION_PREFER_IPV4, ++ DNS_OPTION_PREFER_IPV6 ++ } grub_dns_option_t; ++ + grub_err_t + grub_net_dns_lookup (const char *name, + const struct grub_net_network_level_address *servers, +-- +1.7.11.4 + diff --git a/grub-2.00-add-X-option-to-printf-functions.patch b/grub-2.00-add-X-option-to-printf-functions.patch new file mode 100644 index 0000000..63d7b79 --- /dev/null +++ b/grub-2.00-add-X-option-to-printf-functions.patch @@ -0,0 +1,58 @@ +From 80f81f233bf74aac740d7a299d075ea46c9c7bd4 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Tue, 27 Nov 2012 16:58:39 -0200 +Subject: [PATCH 1/3] Add %X option to printf functions. + +--- + grub-core/kern/misc.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 95d4624..8ac087a 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -596,7 +596,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r) + static char * + grub_lltoa (char *str, int c, unsigned long long n) + { +- unsigned base = (c == 'x') ? 16 : 10; ++ unsigned base = ((c == 'x') || (c == 'X')) ? 16 : 10; + char *p; + + if ((long long) n < 0 && c == 'd') +@@ -611,7 +611,7 @@ grub_lltoa (char *str, int c, unsigned long long n) + do + { + unsigned d = (unsigned) (n & 0xf); +- *p++ = (d > 9) ? d + 'a' - 10 : d + '0'; ++ *p++ = (d > 9) ? d + ((c == 'x') ? 'a' : 'A') - 10 : d + '0'; + } + while (n >>= 4); + else +@@ -702,6 +702,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a + { + case 'p': + case 'x': ++ case 'X': + case 'u': + case 'd': + case 'c': +@@ -777,6 +778,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a + switch (c) + { + case 'x': ++ case 'X': + case 'u': + case 'd': + if (longlongfmt) +@@ -918,6 +920,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a + longlongfmt |= (sizeof (void *) == sizeof (long long)); + /* Fall through. */ + case 'x': ++ case 'X': + case 'u': + unsig = 1; + /* Fall through. */ +-- +1.7.10.4 + 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-cas-reboot-support.patch b/grub-2.00-cas-reboot-support.patch new file mode 100644 index 0000000..f0085a4 --- /dev/null +++ b/grub-2.00-cas-reboot-support.patch @@ -0,0 +1,174 @@ +From be9ee2df83a927d49184026154dd8d5039a8b664 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Thu, 20 Sep 2012 18:07:39 -0300 +Subject: [PATCH] IBM client architecture (CAS) reboot support + +This is an implementation of IBM client architecture (CAS) reboot for GRUB. + +There are cases where the POWER firmware must reboot in order to support +specific features requested by a kernel. The kernel calls +ibm,client-architecture-support and it may either return or reboot with the new +feature set. eg: + +Calling ibm,client-architecture-support.../ +Elapsed time since release of system processors: 70959 mins 50 secs +Welcome to GRUB! + +Instead of return to the GRUB menu, it will check if the flag for CAS reboot is +set. If so, grub will automatically boot the last booted kernel using the same +parameters +--- + grub-core/kern/ieee1275/openfw.c | 63 ++++++++++++++++++++++++++++++++++++++ + grub-core/normal/main.c | 19 ++++++++++++ + grub-core/script/execute.c | 7 +++++ + include/grub/ieee1275/ieee1275.h | 2 ++ + 4 files changed, 91 insertions(+) + +diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c +index 40abaa3..c2b1bdf 100644 +--- a/grub-core/kern/ieee1275/openfw.c ++++ b/grub-core/kern/ieee1275/openfw.c +@@ -523,3 +523,66 @@ grub_ieee1275_canonicalise_devname (const char *path) + return NULL; + } + ++/* Check if it's a CAS reboot. If so, set the script to be executed. */ ++int ++grub_ieee1275_cas_reboot (char *script) ++{ ++ grub_uint32_t ibm_ca_support_reboot; ++ grub_uint32_t ibm_fw_nbr_reboots; ++ char property_value[10]; ++ grub_ssize_t actual; ++ grub_ieee1275_ihandle_t options; ++ ++ if (grub_ieee1275_finddevice ("/options", &options) < 0) ++ return -1; ++ ++ /* Check two properties, one is enough to get cas reboot value */ ++ ibm_ca_support_reboot = 0; ++ if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, ++ "ibm,client-architecture-support-reboot", ++ &ibm_ca_support_reboot, ++ sizeof (ibm_ca_support_reboot), ++ &actual) >= 0) ++ grub_dprintf("ieee1275", "ibm,client-architecture-support-reboot: %u\n", ++ ibm_ca_support_reboot); ++ ++ ibm_fw_nbr_reboots = 0; ++ if (grub_ieee1275_get_property (options, "ibm,fw-nbr-reboots", ++ property_value, sizeof (property_value), ++ &actual) >= 0) ++ { ++ property_value[sizeof (property_value) - 1] = 0; ++ ibm_fw_nbr_reboots = (grub_uint8_t) grub_strtoul (property_value, 0, 10); ++ grub_dprintf("ieee1275", "ibm,fw-nbr-reboots: %u\n", ibm_fw_nbr_reboots); ++ } ++ ++ if (ibm_ca_support_reboot || ibm_fw_nbr_reboots) ++ { ++ if (! grub_ieee1275_get_property_length (options, "boot-last-label", &actual)) ++ { ++ if (actual > 1024) ++ script = grub_realloc (script, actual + 1); ++ grub_ieee1275_get_property (options, "boot-last-label", script, actual, ++ &actual); ++ return 0; ++ } ++ } ++ ++ grub_ieee1275_set_boot_last_label (""); ++ ++ return -1; ++} ++ ++int grub_ieee1275_set_boot_last_label (const char *text) ++{ ++ grub_ieee1275_ihandle_t options; ++ grub_ssize_t actual; ++ ++ grub_dprintf("ieee1275", "set boot_last_label (size: %u)\n", grub_strlen(text)); ++ if (! grub_ieee1275_finddevice ("/options", &options) && ++ options != (grub_ieee1275_ihandle_t) -1) ++ grub_ieee1275_set_property (options, "boot-last-label", text, ++ grub_strlen (text), &actual); ++ return 0; ++} ++ +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 39bb734..aa0b3e5 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -32,6 +32,9 @@ + #include + #include + #include ++#ifdef GRUB_MACHINE_IEEE1275 ++#include ++#endif + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -296,6 +299,22 @@ grub_normal_execute (const char *config, int nested, int batch) + { + menu = read_config_file (config); + ++#ifdef GRUB_MACHINE_IEEE1275 ++ int boot; ++ boot = 0; ++ char *script; ++ script = grub_malloc (1024); ++ if (! grub_ieee1275_cas_reboot (script)) ++ { ++ char *dummy[1] = { NULL }; ++ if (! grub_script_execute_sourcecode (script, 0, dummy)) ++ boot = 1; ++ } ++ grub_free (script); ++ if (boot) ++ grub_command_execute ("boot", 0, 0); ++#endif ++ + /* Ignore any error. */ + grub_errno = GRUB_ERR_NONE; + } +diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c +index b5e6eb0..4397540 100644 +--- a/grub-core/script/execute.c ++++ b/grub-core/script/execute.c +@@ -27,6 +27,9 @@ + #include + #include + #include ++#ifdef GRUB_MACHINE_IEEE1275 ++#include ++#endif + + /* Max digits for a char is 3 (0xFF is 255), similarly for an int it + is sizeof (int) * 3, and one extra for a possible -ve sign. */ +@@ -820,6 +823,10 @@ grub_script_execute_sourcecode (const char *source, int argc, char **args) + old_scope = scope; + scope = &new_scope; + ++#ifdef GRUB_MACHINE_IEEE1275 ++ grub_ieee1275_set_boot_last_label (source); ++#endif ++ + while (source) + { + char *line; +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 38a75fd..416a544 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -208,5 +208,7 @@ int EXPORT_FUNC(grub_ieee1275_devices_iterate) (int (*hook) + char *EXPORT_FUNC(grub_ieee1275_get_aliasdevname) (const char *path); + char *EXPORT_FUNC(grub_ieee1275_canonicalise_devname) (const char *path); + char *EXPORT_FUNC(grub_ieee1275_get_device_type) (const char *path); ++int EXPORT_FUNC(grub_ieee1275_cas_reboot) (char *script); ++int EXPORT_FUNC(grub_ieee1275_set_boot_last_label) (const char *text); + + #endif /* ! GRUB_IEEE1275_HEADER */ +-- +1.7.10.4 + diff --git a/grub-2.00-dhcp-client-id-and-uuid-options-added.patch b/grub-2.00-dhcp-client-id-and-uuid-options-added.patch new file mode 100644 index 0000000..c573936 --- /dev/null +++ b/grub-2.00-dhcp-client-id-and-uuid-options-added.patch @@ -0,0 +1,121 @@ +From d63a0b7fd665fae1dd34d3e86127b93dd87b8114 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Tue, 27 Nov 2012 17:18:53 -0200 +Subject: [PATCH 2/3] DHCP client ID and UUID options added. + +--- + grub-core/net/bootp.c | 56 +++++++++++++++++++++++++++++++++++++++++-------- + include/grub/net.h | 2 ++ + 2 files changed, 49 insertions(+), 9 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index bc07d53..3b4130d 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -51,6 +51,14 @@ set_env_limn_ro (const char *intername, const char *suffix, + grub_register_variable_hook (varname, 0, grub_env_write_readonly); + } + ++static char ++hexdigit (grub_uint8_t val) ++{ ++ if (val < 10) ++ return val + '0'; ++ return val + 'a' - 10; ++} ++ + static void + parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask) + { +@@ -81,6 +89,9 @@ parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask) + + taglength = *ptr++; + ++ grub_dprintf("net", "DHCP option %u (0x%02x) found with length %u.\n", ++ tagtype, tagtype, taglength); ++ + switch (tagtype) + { + case GRUB_NET_BOOTP_NETMASK: +@@ -121,7 +132,9 @@ parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask) + grub_net_add_dns_server (&s); + ptr += 4; + } +- } ++ /* Skip adittional increment */ ++ continue; ++ } + break; + case GRUB_NET_BOOTP_HOSTNAME: + set_env_limn_ro (name, "hostname", (char *) ptr, taglength); +@@ -139,6 +152,39 @@ parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask) + set_env_limn_ro (name, "extensionspath", (char *) ptr, taglength); + break; + ++ case GRUB_NET_BOOTP_CLIENT_ID: ++ set_env_limn_ro (name, "clientid", (char *) ptr, taglength); ++ break; ++ ++ case GRUB_NET_BOOTP_CLIENT_UUID: ++ { ++ if (taglength != 17) ++ break; ++ ++ /* The format is 9cfe245e-d0c8-bd45-a79f-54ea5fbd3d97 */ ++ ++ ptr += 1; ++ taglength -= 1; ++ ++ char *val = grub_malloc (2 * taglength + 4 + 1); ++ int i = 0; ++ int j = 0; ++ for (i = 0; i < taglength; i++) ++ { ++ val[2 * i + j] = hexdigit (ptr[i] >> 4); ++ val[2 * i + 1 + j] = hexdigit (ptr[i] & 0xf); ++ ++ if ((i == 3) || (i == 5) || (i == 7) || (i == 9)) ++ { ++ j++; ++ val[2 * i + 1+ j] = '-'; ++ } ++ } ++ ++ set_env_limn_ro (name, "clientuuid", (char *) val, 2 * taglength + 4); ++ } ++ break; ++ + /* If you need any other options please contact GRUB + developpement team. */ + } +@@ -299,14 +345,6 @@ grub_net_process_dhcp (struct grub_net_buff *nb, + } + } + +-static char +-hexdigit (grub_uint8_t val) +-{ +- if (val < 10) +- return val + '0'; +- return val + 'a' - 10; +-} +- + static grub_err_t + grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), + int argc, char **args) +diff --git a/include/grub/net.h b/include/grub/net.h +index a7e5b2c..45348dd 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -423,6 +423,8 @@ enum + GRUB_NET_BOOTP_DOMAIN = 0x0f, + GRUB_NET_BOOTP_ROOT_PATH = 0x11, + GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12, ++ GRUB_NET_BOOTP_CLIENT_ID = 0x3d, ++ GRUB_NET_BOOTP_CLIENT_UUID = 0x61, + GRUB_NET_BOOTP_END = 0xff + }; + +-- +1.7.10.4 + diff --git a/grub-2.00-dont-decrease-mmap-size.patch b/grub-2.00-dont-decrease-mmap-size.patch new file mode 100644 index 0000000..8139fc2 --- /dev/null +++ b/grub-2.00-dont-decrease-mmap-size.patch @@ -0,0 +1,34 @@ +From: Stuart Hayes +Subject: Don't decrease efi memory map size +Date: 2012-07-02 09:14:37 +0000 + + + +--- a/grub-core/loader/i386/linux.c 2012-06-27 20:55:09 +0000 ++++ b/grub-core/loader/i386/linux.c 2012-07-02 09:14:37 +0000 +@@ -118,12 +118,13 @@ + int ret; + grub_efi_memory_descriptor_t *mmap; + grub_efi_uintn_t desc_size; ++ grub_efi_uintn_t cur_mmap_size = mmap_size; + +- mmap = grub_malloc (mmap_size); ++ mmap = grub_malloc (cur_mmap_size); + if (! mmap) + return 0; + +- ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); ++ ret = grub_efi_get_memory_map (&cur_mmap_size, mmap, 0, &desc_size, 0); + grub_free (mmap); + + if (ret < 0) +@@ -134,6 +135,8 @@ + else if (ret > 0) + break; + ++ if (mmap_size < cur_mmap_size) ++ mmap_size = cur_mmap_size; + mmap_size += (1 << 12); + } + + diff --git a/grub-2.00-efidisk-ahci-workaround.patch b/grub-2.00-efidisk-ahci-workaround.patch new file mode 100644 index 0000000..36a91c8 --- /dev/null +++ b/grub-2.00-efidisk-ahci-workaround.patch @@ -0,0 +1,60 @@ +From 61474615b8e177881caa89fc04cae16019cf01b9 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Wed, 15 Aug 2012 14:37:07 -0400 +Subject: [PATCH] efidisk: Read chunks in smaller blocks + +--- + grub-core/disk/efi/efidisk.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index a432b44..77ab5b0 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -546,6 +546,9 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, + struct grub_efidisk_data *d; + grub_efi_block_io_t *bio; + grub_efi_status_t status; ++ grub_size_t remaining = size; ++ grub_size_t read = 0; ++ grub_size_t chunk = 0x500; + + d = disk->data; + bio = d->block_io; +@@ -554,14 +557,29 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, + "reading 0x%lx sectors at the sector 0x%llx from %s\n", + (unsigned long) size, (unsigned long long) sector, disk->name); + ++ while (remaining > chunk) { ++ status = efi_call_5 (bio->read_blocks, bio, bio->media->media_id, ++ (grub_efi_uint64_t) sector + read, ++ (grub_efi_uintn_t) chunk << disk->log_sector_size, ++ buf + (read << disk->log_sector_size)); ++ if (status != GRUB_EFI_SUCCESS) ++ return grub_error (GRUB_ERR_READ_ERROR, ++ N_("failure reading sector 0x%llx from `%s'"), ++ (unsigned long long) sector + read, ++ disk->name); ++ read += chunk; ++ remaining -= chunk; ++ } ++ + status = efi_call_5 (bio->read_blocks, bio, bio->media->media_id, +- (grub_efi_uint64_t) sector, +- (grub_efi_uintn_t) size << disk->log_sector_size, +- buf); ++ (grub_efi_uint64_t) sector + read, ++ (grub_efi_uintn_t) remaining << disk->log_sector_size, ++ buf + (read << disk->log_sector_size)); ++ + if (status != GRUB_EFI_SUCCESS) + return grub_error (GRUB_ERR_READ_ERROR, + N_("failure reading sector 0x%llx from `%s'"), +- (unsigned long long) sector, ++ (unsigned long long) sector + read, + disk->name); + + return GRUB_ERR_NONE; +-- +1.7.11.2 + diff --git a/grub-2.00-fix-http-crash.patch b/grub-2.00-fix-http-crash.patch new file mode 100644 index 0000000..ac110c3 --- /dev/null +++ b/grub-2.00-fix-http-crash.patch @@ -0,0 +1,28 @@ +From 4414df5e72937b0bb1c4a0bb66cd1132ec2a5720 Mon Sep 17 00:00:00 2001 +From: Gustavo Luiz Duarte +Date: Tue, 25 Sep 2012 18:40:55 -0400 +Subject: [PATCH] Fix crash on http + +Don't free file->data on receiving FIN flag since it is used all over without +checking. http_close() will be called later to free that memory. +https://bugzilla.redhat.com/show_bug.cgi?id=860834 +--- + grub-core/net/http.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/net/http.c b/grub-core/net/http.c +index a7542d1..a5f6f31 100644 +--- a/grub-core/net/http.c ++++ b/grub-core/net/http.c +@@ -386,7 +386,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) + + data->sock = grub_net_tcp_open (file->device->net->server, + HTTP_PORT, http_receive, +- http_err, http_err, ++ http_err, NULL, + file); + if (!data->sock) + { +-- +1.7.11.4 + diff --git a/grub-2.00-for-ppc-include-all-modules-in-the-core-image.patch b/grub-2.00-for-ppc-include-all-modules-in-the-core-image.patch new file mode 100644 index 0000000..1244650 --- /dev/null +++ b/grub-2.00-for-ppc-include-all-modules-in-the-core-image.patch @@ -0,0 +1,332 @@ +From 4613775aee8b413ba89bfb7233d49a4288e13390 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Mon, 15 Oct 2012 17:21:01 -0300 +Subject: [PATCH] for ppc, include all modules in the core image + +This patch implements the solution suggested by Gustavo Luiz Duarte +: + +Adding more modules to be built-in to the grub core ELF is easy. It is a +parameter passed by grub2-install to grub2-mkimage. However, there is a downside +on adding many modules to the core ELF: they are fully initialized in the grub's +first stage. It means you could hit a bug on a module you don't need and end up +with a non-bootable system. + +Another downside is that you wouldn't get updates for these built-in modules, as +updating the grub2 package only updates the modules residing in /boot and not +the grub core ELF in the PReP partition. + +A proper solution would be to add to grub the ability of having built-in +*inactive* modules which would be loaded and initialized only on demand (i.e. +explicitly calling the insmod command). + +This patch fix this bugzilla: +https://bugzilla.redhat.com/show_bug.cgi?id=866559 +--- + grub-core/kern/corecmd.c | 3 ++ + grub-core/kern/dl.c | 67 ++++++++++++++++++++++++++++++++++++++++--- + include/grub/dl.h | 1 + + include/grub/kernel.h | 1 + + include/grub/util/resolve.h | 5 ++++ + util/grub-mkimage.c | 37 +++++++++++++++++++++++- + util/resolve.c | 57 ++++++++++++++++++++++++++++++++++++ + 7 files changed, 166 insertions(+), 5 deletions(-) + +diff --git a/grub-core/kern/corecmd.c b/grub-core/kern/corecmd.c +index 16c03df..8684139 100644 +--- a/grub-core/kern/corecmd.c ++++ b/grub-core/kern/corecmd.c +@@ -100,6 +100,9 @@ grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), + else + mod = grub_dl_load (argv[0]); + ++ if (!mod) ++ grub_dl_load_core_by_name (argv[0]); ++ + if (mod) + grub_dl_ref (mod); + +diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c +index 5b0aa65..a498682 100644 +--- a/grub-core/kern/dl.c ++++ b/grub-core/kern/dl.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + + /* Platforms where modules are in a readonly area of memory. */ + #if defined(GRUB_MACHINE_QEMU) +@@ -47,6 +48,7 @@ + #pragma GCC diagnostic ignored "-Wcast-align" + + grub_dl_t grub_dl_head = 0; ++char grub_use_stale_modules = 0; + + grub_err_t + grub_dl_add (grub_dl_t mod); +@@ -659,6 +661,57 @@ grub_dl_load_core (void *addr, grub_size_t size) + return mod; + } + ++/* Load a module from core using a symbolic name. */ ++grub_dl_t ++grub_dl_load_core_by_name (const char *name) ++{ ++ struct grub_module_header *header; ++ grub_dl_t mod; ++ char *module_addr; ++ ++ mod = (grub_dl_t) grub_zalloc (sizeof (*mod)); ++ if (! mod) ++ return 0; ++ ++ grub_use_stale_modules = 1; ++ ++ FOR_MODULES (header) ++ { ++ /* Not an ELF module, skip. */ ++ if ((header->type != OBJ_TYPE_ELF) && ++ (header->type != OBJ_TYPE_ELF_STALE)) ++ continue; ++ ++ module_addr = (char *) header + sizeof (struct grub_module_header); ++ grub_dl_resolve_name (mod, (Elf_Ehdr *) module_addr); ++ ++ if (grub_strcmp(name, mod->name) == 0) ++ { ++ grub_printf ("WARNING: You are using the built-in '%s' module!\n", name); ++ ++ mod = grub_dl_load_core ((char *) header + sizeof (struct grub_module_header), ++ (header->size - sizeof (struct grub_module_header))); ++ ++ break; ++ } ++ else ++ mod = 0; ++ } ++ ++ if (! mod) ++ return 0; ++ else ++ { ++ if (grub_errno == GRUB_ERR_IO) ++ grub_errno = GRUB_ERR_NONE; ++ } ++ ++ if (grub_strcmp (mod->name, name) != 0) ++ grub_error (GRUB_ERR_BAD_MODULE, "mismatched names"); ++ ++ return mod; ++} ++ + /* Load a module from the file FILENAME. */ + grub_dl_t + grub_dl_load_file (const char *filename) +@@ -718,13 +771,19 @@ grub_dl_load (const char *name) + return 0; + } + ++ /* First, try to load module from the grub directory */ + filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s.mod", + grub_dl_dir, name); +- if (! filename) +- return 0; ++ if (filename) ++ { ++ mod = grub_dl_load_file (filename); ++ grub_free (filename); ++ } + +- mod = grub_dl_load_file (filename); +- grub_free (filename); ++ /* If the module isn't loaded, check if there is a stale module available and ++ * use it*/ ++ if (! mod && grub_use_stale_modules) ++ mod = grub_dl_load_core_by_name (name); + + if (! mod) + return 0; +diff --git a/include/grub/dl.h b/include/grub/dl.h +index 3119978..30f12f9 100644 +--- a/include/grub/dl.h ++++ b/include/grub/dl.h +@@ -181,6 +181,7 @@ typedef struct grub_dl *grub_dl_t; + grub_dl_t grub_dl_load_file (const char *filename); + grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name); + grub_dl_t grub_dl_load_core (void *addr, grub_size_t size); ++grub_dl_t grub_dl_load_core_by_name (const char *name); + int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod); + void grub_dl_unload_unneeded (void); + int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod); +diff --git a/include/grub/kernel.h b/include/grub/kernel.h +index eef4c3f..4cd2cb0 100644 +--- a/include/grub/kernel.h ++++ b/include/grub/kernel.h +@@ -25,6 +25,7 @@ + enum + { + OBJ_TYPE_ELF, ++ OBJ_TYPE_ELF_STALE, + OBJ_TYPE_MEMDISK, + OBJ_TYPE_CONFIG, + OBJ_TYPE_PREFIX +diff --git a/include/grub/util/resolve.h b/include/grub/util/resolve.h +index f42df32..1d0252c 100644 +--- a/include/grub/util/resolve.h ++++ b/include/grub/util/resolve.h +@@ -32,4 +32,9 @@ grub_util_resolve_dependencies (const char *prefix, + const char *dep_list_file, + char *modules[]); + ++struct grub_util_path_list * ++grub_util_create_complementary_module_list (const char *prefix, ++ const char *dep_list_file, ++ struct grub_util_path_list *path_list); ++ + #endif /* ! GRUB_UTIL_RESOLVE_HEADER */ +diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c +index a551bbb..b06f37a 100644 +--- a/util/grub-mkimage.c ++++ b/util/grub-mkimage.c +@@ -711,7 +711,7 @@ generate_image (const char *dir, const char *prefix, + size_t prefix_size = 0; + char *kernel_path; + size_t offset; +- struct grub_util_path_list *path_list, *p, *next; ++ struct grub_util_path_list *path_list, *path_list_comp = 0, *p, *next; + grub_size_t bss_size; + grub_uint64_t start_address; + void *rel_section = 0; +@@ -727,6 +727,10 @@ generate_image (const char *dir, const char *prefix, + + path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); + ++ if (image_target->id == IMAGE_PPC) ++ path_list_comp = grub_util_create_complementary_module_list (dir, ++ "moddep.lst", path_list); ++ + kernel_path = grub_util_get_path (dir, "kernel.img"); + + if (image_target->voidp_sizeof == 8) +@@ -761,6 +765,10 @@ generate_image (const char *dir, const char *prefix, + total_module_size += (ALIGN_ADDR (grub_util_get_image_size (p->name)) + + sizeof (struct grub_module_header)); + ++ for (p = path_list_comp; p; p = p->next) ++ total_module_size += (ALIGN_ADDR (grub_util_get_image_size (p->name)) ++ + sizeof (struct grub_module_header)); ++ + grub_util_info ("the total module size is 0x%llx", + (unsigned long long) total_module_size); + +@@ -835,6 +843,25 @@ generate_image (const char *dir, const char *prefix, + offset += mod_size; + } + ++ for (p = path_list_comp; p; p = p->next) ++ { ++ struct grub_module_header *header; ++ size_t mod_size, orig_size; ++ ++ orig_size = grub_util_get_image_size (p->name); ++ mod_size = ALIGN_ADDR (orig_size); ++ ++ header = (struct grub_module_header *) (kernel_img + offset); ++ memset (header, 0, sizeof (struct grub_module_header)); ++ header->type = grub_host_to_target32 (OBJ_TYPE_ELF_STALE); ++ header->size = grub_host_to_target32 (mod_size + sizeof (*header)); ++ offset += sizeof (*header); ++ memset (kernel_img + offset + orig_size, 0, mod_size - orig_size); ++ ++ grub_util_load_image (p->name, kernel_img + offset); ++ offset += mod_size; ++ } ++ + if (memdisk_path) + { + struct grub_module_header *header; +@@ -1639,6 +1666,14 @@ generate_image (const char *dir, const char *prefix, + free (path_list); + path_list = next; + } ++ ++ while (path_list_comp) ++ { ++ next = path_list_comp->next; ++ free ((void *) path_list_comp->name); ++ free (path_list_comp); ++ path_list_comp = next; ++ } + } + + +diff --git a/util/resolve.c b/util/resolve.c +index 1af24e6..997db99 100644 +--- a/util/resolve.c ++++ b/util/resolve.c +@@ -271,3 +271,60 @@ grub_util_resolve_dependencies (const char *prefix, + return prev; + } + } ++ ++struct grub_util_path_list * ++grub_util_create_complementary_module_list (const char *prefix, ++ const char *dep_list_file, ++ struct grub_util_path_list *path_list) ++{ ++ char *path; ++ FILE *fp; ++ struct grub_util_path_list *path_list_comp = 0; ++ struct grub_util_path_list *new_path; ++ char skip; ++ ++ path = grub_util_get_path (prefix, dep_list_file); ++ fp = fopen (path, "r"); ++ if (! fp) ++ grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); ++ ++ while (fgets (buf, sizeof (buf), fp)) ++ { ++ char *p; ++ struct grub_util_path_list *pl; ++ ++ skip = 0; ++ ++ /* Get the target name. */ ++ p = strchr (buf, ':'); ++ if (! p) ++ grub_util_error (_("invalid line format: %s"), buf); ++ ++ *p++ = '\0'; ++ ++ /* kernel is not a module */ ++ if (strcmp(buf, "kernel") == 0) ++ continue; ++ ++ /* Check if the module is already in the core. */ ++ for (pl = path_list; pl; pl = pl->next) ++ { ++ if (strcmp(buf, get_module_name(pl->name)) == 0) ++ { ++ skip = 1; ++ break; ++ } ++ } ++ ++ if (skip) ++ continue; ++ ++ /* Add the new path. */ ++ new_path = (struct grub_util_path_list *) xmalloc (sizeof (*new_path)); ++ new_path->name = get_module_path (prefix, buf); ++ new_path->next = path_list_comp; ++ path_list_comp = new_path; ++ } ++ ++ return path_list_comp; ++} +-- +1.7.10.4 + diff --git a/grub-2.00-ieee1276.patch b/grub-2.00-ieee1276.patch deleted file mode 100644 index b637868..0000000 --- a/grub-2.00-ieee1276.patch +++ /dev/null @@ -1,16 +0,0 @@ -From: Valdimir Serbinenko -Subject: Check for ieee1275 and not ieee1276. - -upstream rev 4404 - ---- a/util/grub-install.in 2012-05-31 11:38:21 +0000 -+++ b/util/grub-install.in 2012-06-01 20:43:10 +0000 -@@ -738,7 +738,7 @@ - elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ]; then - - # If a install device is defined, copy the core.elf to PReP partition. -- if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1276" ] && [ -n "${install_device}" ]; then -+ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ] && [ -n "${install_device}" ]; then - if [ "$("${grub_probe}" -m "${device_map}" -d "${install_device}" -t msdos_parttype)" != "41" ]; then - gettext "The chosen partition is not a PReP partition." 1>&2 - echo 1>&2 diff --git a/grub-2.00-linux-mbr.patch b/grub-2.00-linux-mbr.patch deleted file mode 100644 index ec579bb..0000000 --- a/grub-2.00-linux-mbr.patch +++ /dev/null @@ -1,82 +0,0 @@ -From: Valdimir Serbinenko -Subject: Fix MBR remapping workaround. - -upstream rev 4405 - ---- a/grub-core/kern/emu/hostdisk.c 2012-05-27 11:19:09 +0000 -+++ b/grub-core/kern/emu/hostdisk.c 2012-06-02 11:48:44 +0000 -@@ -1067,27 +1067,18 @@ - if (fd < 0) - return grub_errno; - -+#ifdef __linux__ -+ if (sector == 0) -+ /* Work around a bug in Linux ez remapping. Linux remaps all -+ sectors that are read together with the MBR in one read. It -+ should only remap the MBR, so we split the read in two -+ parts. -jochen */ -+ max = 1; -+#endif /* __linux__ */ -+ - if (max > size) - max = size; - --#ifdef __linux__ -- if (sector == 0 && max > 1) -- { -- /* Work around a bug in Linux ez remapping. Linux remaps all -- sectors that are read together with the MBR in one read. It -- should only remap the MBR, so we split the read in two -- parts. -jochen */ -- if (grub_util_fd_read (fd, buf, (1 << disk->log_sector_size)) -- != (1 << disk->log_sector_size)) -- return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"), -- map[disk->id].device, strerror (errno)); -- -- buf += (1 << disk->log_sector_size); -- size--; -- max--; -- } --#endif /* __linux__ */ -- - if (grub_util_fd_read (fd, buf, max << disk->log_sector_size) - != (ssize_t) (max << disk->log_sector_size)) - return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"), -@@ -1111,28 +1102,18 @@ - if (fd < 0) - return grub_errno; - -+#ifdef __linux__ -+ if (sector == 0) -+ /* Work around a bug in Linux ez remapping. Linux remaps all -+ sectors that are write together with the MBR in one write. It -+ should only remap the MBR, so we split the write in two -+ parts. -jochen */ -+ max = 1; -+#endif /* __linux__ */ -+ - if (max > size) - max = size; - --#ifdef __linux__ -- if (sector == 0 && max > 1) -- { -- /* Work around a bug in Linux ez remapping. Linux remaps all -- sectors that are write together with the MBR in one write. It -- should only remap the MBR, so we split the write in two -- parts. -jochen */ -- if (grub_util_fd_write (fd, buf, (1 << disk->log_sector_size)) -- != (1 << disk->log_sector_size)) -- return grub_error (GRUB_ERR_WRITE_ERROR, -- N_("cannot write to `%s': %s"), -- map[disk->id].device, strerror (errno)); -- -- buf += (1 << disk->log_sector_size); -- size--; -- max--; -- } --#endif /* __linux__ */ -- - if (grub_util_fd_write (fd, buf, max << disk->log_sector_size) - != (ssize_t) (max << disk->log_sector_size)) - return grub_error (GRUB_ERR_WRITE_ERROR, N_("cannot write to `%s': %s"), diff --git a/grub-2.00-no-canon.patch b/grub-2.00-no-canon.patch deleted file mode 100644 index 14082a7..0000000 --- a/grub-2.00-no-canon.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Valdimir Serbinenko -Subject: Don't canonicalise /dev/root and /dev/dm-*. - -upstream rev 4408 - ---- a/util/getroot.c 2012-05-28 15:43:12 +0000 -+++ b/util/getroot.c 2012-06-02 12:36:27 +0000 -@@ -1036,10 +1036,16 @@ - { - char *tmp = *cur; - int root, dm; -- *cur = canonicalize_file_name (tmp); -- if (*cur == NULL) -- grub_util_error (_("failed to get canonical path of %s"), tmp); -- free (tmp); -+ if (strcmp (*cur, "/dev/root") == 0 -+ || strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0) -+ *cur = tmp; -+ else -+ { -+ *cur = canonicalize_file_name (tmp); -+ if (*cur == NULL) -+ grub_util_error (_("failed to get canonical path of %s"), tmp); -+ free (tmp); -+ } - root = (strcmp (*cur, "/dev/root") == 0); - dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0); - if (!dm && !root) - diff --git a/grub-2.00-no-double-free.patch b/grub-2.00-no-double-free.patch deleted file mode 100644 index 5dd52a1..0000000 --- a/grub-2.00-no-double-free.patch +++ /dev/null @@ -1,17 +0,0 @@ -From: Vladimir Serbinenko -Subject: Avoid double-free in grub-probe -Date: 2012-06-05 15:16:14 +0000 - -=== modified file 'util/grub-probe.c' ---- a/util/grub-probe.c 2012-06-05 09:31:10 +0000 -+++ b/util/grub-probe.c 2012-06-05 15:16:14 +0000 -@@ -169,8 +169,6 @@ - } - *d = 0; - -- free ((char *) orig_path); -- - return new_path; - } - - diff --git a/grub-2.00-no-huge-video.patch b/grub-2.00-no-huge-video.patch deleted file mode 100644 index 573c7fc..0000000 --- a/grub-2.00-no-huge-video.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Valdimir Serbinenko -Subject: Reject huge flat panels and monitors over 4096x4096 - -https://bugzilla.redhat.com/show_bug.cgi?id=827003 - -Backport upstream rev 4412 - -diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c -index 3e1cc23..4628dd0 100644 ---- a/grub-core/video/efi_gop.c -+++ b/grub-core/video/efi_gop.c -@@ -368,7 +368,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height, - { - err = 1; - grub_gop_get_preferred_mode (&preferred_width, &preferred_height); -- if (err) -+ if (err || width >= 4096 || height >= 4096) - { - preferred_width = 800; - preferred_height = 600; -diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c -index 5656388..62e530a 100644 ---- a/grub-core/video/i386/pc/vbe.c -+++ b/grub-core/video/i386/pc/vbe.c -@@ -581,7 +581,6 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) - /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ - flat_panel_info = (struct grub_vbe_flat_panel_info *) - (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + sizeof (struct grub_video_edid_info)); -- grub_memset (flat_panel_info, 0, sizeof (*flat_panel_info)); - - if (controller_info.version >= 0x200 - && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) -@@ -590,14 +589,18 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) - if (grub_video_vbe_get_edid (&edid_info) == GRUB_ERR_NONE - && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE - && grub_video_edid_preferred_mode (&edid_info, width, height) -- == GRUB_ERR_NONE) -+ == GRUB_ERR_NONE && *width < 4096 && *height < 4096) - return GRUB_ERR_NONE; - - grub_errno = GRUB_ERR_NONE; - } - -+ grub_memset (flat_panel_info, 0, sizeof (*flat_panel_info)); - status = grub_vbe_bios_get_flat_panel_info (flat_panel_info); -- if (status == GRUB_VBE_STATUS_OK) -+ if (status == GRUB_VBE_STATUS_OK -+ && flat_panel_info->horizontal_size && flat_panel_info->vertical_size -+ && flat_panel_info->horizontal_size < 4096 -+ && flat_panel_info->vertical_size < 4096) - { - *width = flat_panel_info->horizontal_size; - *height = flat_panel_info->vertical_size; -diff --git a/grub-core/video/video.c b/grub-core/video/video.c -index 67de85a..c36994f 100644 ---- a/grub-core/video/video.c -+++ b/grub-core/video/video.c -@@ -415,7 +415,8 @@ grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, - | (((unsigned int) - (edid_info->detailed_timings[0].vertical_hi & 0xf0)) - << 4); -- return GRUB_ERR_NONE; -+ if (*width && *height) -+ return GRUB_ERR_NONE; - } - - return grub_error (GRUB_ERR_BAD_DEVICE, "no preferred mode available"); diff --git a/grub-2.00-no-insmod-on-sb.patch b/grub-2.00-no-insmod-on-sb.patch new file mode 100644 index 0000000..1bfd6f8 --- /dev/null +++ b/grub-2.00-no-insmod-on-sb.patch @@ -0,0 +1,113 @@ +From 8a2a8d6021d926f00c5f85dab2d66f4ed8be86a2 Mon Sep 17 00:00:00 2001 +From: Colin Watson +Date: Tue, 23 Oct 2012 10:40:49 -0400 +Subject: [PATCH] Don't allow insmod when secure boot is enabled. + +Hi, + +Fedora's patch to forbid insmod in UEFI Secure Boot environments is fine +as far as it goes. However, the insmod command is not the only way that +modules can be loaded. In particular, the 'normal' command, which +implements the usual GRUB menu and the fully-featured command prompt, +will implicitly load commands not currently loaded into memory. This +permits trivial Secure Boot violations by writing commands implementing +whatever you want to do and pointing $prefix at the malicious code. + +I'm currently test-building this patch (replacing your current +grub-2.00-no-insmod-on-sb.patch), but this should be more correct. It +moves the check into grub_dl_load_file. +--- + grub-core/kern/dl.c | 17 +++++++++++++++++ + grub-core/kern/efi/efi.c | 28 ++++++++++++++++++++++++++++ + include/grub/efi/efi.h | 1 + + 3 files changed, 46 insertions(+) + +diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c +index a498682..2578fce 100644 +--- a/grub-core/kern/dl.c ++++ b/grub-core/kern/dl.c +@@ -43,6 +43,10 @@ + #include + #endif + ++#ifdef GRUB_MACHINE_EFI ++#include ++#endif ++ + + + #pragma GCC diagnostic ignored "-Wcast-align" +@@ -721,6 +725,19 @@ grub_dl_load_file (const char *filename) + void *core = 0; + grub_dl_t mod = 0; + ++#ifdef GRUB_MACHINE_EFI ++ if (grub_efi_secure_boot ()) ++ { ++#if 0 ++ /* This is an error, but grub2-mkconfig still generates a pile of ++ * insmod commands, so emitting it would be mostly just obnoxious. */ ++ grub_error (GRUB_ERR_ACCESS_DENIED, ++ "Secure Boot forbids loading module from %s", filename); ++#endif ++ return 0; ++ } ++#endif ++ + file = grub_file_open (filename); + if (! file) + return 0; +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index 820968f..ad7aa8d 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -259,6 +259,34 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, + return grub_error (GRUB_ERR_IO, "could not set EFI variable `%s'", var); + } + ++grub_efi_boolean_t ++grub_efi_secure_boot (void) ++{ ++ grub_efi_guid_t efi_var_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; ++ grub_size_t datasize; ++ char *secure_boot = NULL; ++ char *setup_mode = NULL; ++ grub_efi_boolean_t ret = 0; ++ ++ secure_boot = grub_efi_get_variable("SecureBoot", &efi_var_guid, &datasize); ++ ++ if (datasize != 1 || !secure_boot) ++ goto out; ++ ++ setup_mode = grub_efi_get_variable("SetupMode", &efi_var_guid, &datasize); ++ ++ if (datasize != 1 || !setup_mode) ++ goto out; ++ ++ if (*secure_boot && !*setup_mode) ++ ret = 1; ++ ++ out: ++ grub_free (secure_boot); ++ grub_free (setup_mode); ++ return ret; ++} ++ + #pragma GCC diagnostic ignored "-Wcast-align" + + /* Search the mods section from the PE32/PE32+ image. This code uses +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index 9370fd5..a000c38 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -72,6 +72,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, + const grub_efi_guid_t *guid, + void *data, + grub_size_t datasize); ++grub_efi_boolean_t EXPORT_FUNC (grub_efi_secure_boot) (void); + int + EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, + const grub_efi_device_path_t *dp2); +-- +1.7.12.1 + diff --git a/grub-2.00-ppc-hints.patch b/grub-2.00-ppc-hints.patch deleted file mode 100644 index 448a637..0000000 --- a/grub-2.00-ppc-hints.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 1f1ddb93b57618a20b2adf7096ca1b21e2d252cc Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Wed, 6 Jun 2012 11:12:12 -0400 -Subject: [PATCH] Fixes for IBM PPC ieee1275 support. - ---- - ChangeLog | 17 +++++++++++++++++ - util/grub-probe.c | 19 ++++++++++++++----- - util/ieee1275/ofpath.c | 39 +++++++++++++++++++++++++++++++++------ - 3 files changed, 64 insertions(+), 11 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index e00c07c..4568bdb 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,20 @@ -+2012-06-05 Vladimir Serbinenko -+ -+ * util/grub-probe.c (escape_of_path): Don't add ieee1275/. -+ (probe): Add ieee1275 to OFW devices. -+ -+2012-06-04 Vladimir Serbinenko -+ -+ * util/ieee1275/ofpath.c (of_path_of_scsi): Fix wrong format specifier. -+ -+2012-06-04 Vladimir Serbinenko -+ -+ Handle IBM OFW path. -+ -+ * util/ieee1275/ofpath.c (find_obppath): Use devspec if obppath isn't -+ available. -+ (of_path_of_scsi): Handle vdevice. -+ - 2012-05-24 Peter Jones - - * grub-core/Makefile.core.def: add efifwsetup module -diff --git a/util/grub-probe.c b/util/grub-probe.c -index 8beb1bc..4db259b 100644 ---- a/util/grub-probe.c -+++ b/util/grub-probe.c -@@ -157,11 +157,10 @@ escape_of_path (const char *orig_path) - if (!strchr (orig_path, ',')) - return (char *) xstrdup (orig_path); - -- new_path = xmalloc (strlen (orig_path) * 2 + sizeof ("ieee1275/")); -+ new_path = xmalloc (strlen (orig_path) * 2 + 1); - - p = orig_path; -- grub_strcpy (new_path, "ieee1275/"); -- d = new_path + sizeof ("ieee1275/") - 1; -+ d = new_path; - while ((c = *p++) != '\0') - { - if (c == ',') -@@ -499,9 +498,14 @@ probe (const char *path, char **device_names, char delim) - - if (ofpath) - { -+ char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/")); -+ char *p; -+ p = stpcpy (tmp, "ieee1275/"); -+ strcpy (p, ofpath); - printf ("--hint-ieee1275='"); -- print_full_name (ofpath, dev); -+ print_full_name (tmp, dev); - printf ("' "); -+ free (tmp); - } - - biosname = guess_bios_drive (*curdev); -@@ -611,7 +615,12 @@ probe (const char *path, char **device_names, char delim) - - if (ofpath) - { -- print_full_name (ofpath, dev); -+ char *tmp = xmalloc (strlen (ofpath) + sizeof ("ieee1275/")); -+ char *p; -+ p = stpcpy (tmp, "ieee1275/"); -+ strcpy (p, ofpath); -+ print_full_name (tmp, dev); -+ free (tmp); - putchar (delim); - } - -diff --git a/util/ieee1275/ofpath.c b/util/ieee1275/ofpath.c -index 03baced..c7f7cdf 100644 ---- a/util/ieee1275/ofpath.c -+++ b/util/ieee1275/ofpath.c -@@ -65,7 +65,9 @@ grub_util_info (const char *fmt, ...) - fputc ('\n', stderr); - } - -+#define grub_util_warn grub_util_info - #define _(x) x -+#define xstrdup strdup - #endif - - static void -@@ -120,6 +122,12 @@ find_obppath (const char *sysfs_path_orig) - fd = open(path, O_RDONLY); - if (fd < 0 || fstat (fd, &st) < 0) - { -+ snprintf(path, path_size, "%s/devspec", sysfs_path); -+ fd = open(path, O_RDONLY); -+ } -+ -+ if (fd < 0 || fstat (fd, &st) < 0) -+ { - kill_trailing_dir(sysfs_path); - if (!strcmp(sysfs_path, "/sys")) - { -@@ -391,17 +399,36 @@ of_path_of_scsi(const char *sys_devname __attribute__((unused)), const char *dev - disk_name = "disk"; - - digit_string = trailing_digits (device); -- if (*digit_string == '\0') -+ if (strncmp (of_path, "/vdevice/", sizeof ("/vdevice/") - 1) == 0) - { -- snprintf(disk, sizeof (disk), "/%s@%x,%d", disk_name, tgt, lun); -+ unsigned long id = 0x8000 | (tgt << 8) | (bus << 5) | lun; -+ if (*digit_string == '\0') -+ { -+ snprintf(disk, sizeof (disk), "/%s@%04lx000000000000", disk_name, id); -+ } -+ else -+ { -+ int part; -+ -+ sscanf(digit_string, "%d", &part); -+ snprintf(disk, sizeof (disk), -+ "/%s@%04lx000000000000:%c", disk_name, id, 'a' + (part - 1)); -+ } - } - else - { -- int part; -+ if (*digit_string == '\0') -+ { -+ snprintf(disk, sizeof (disk), "/%s@%x,%d", disk_name, tgt, lun); -+ } -+ else -+ { -+ int part; - -- sscanf(digit_string, "%d", &part); -- snprintf(disk, sizeof (disk), -- "/%s@%x,%d:%c", disk_name, tgt, lun, 'a' + (part - 1)); -+ sscanf(digit_string, "%d", &part); -+ snprintf(disk, sizeof (disk), -+ "/%s@%x,%d:%c", disk_name, tgt, lun, 'a' + (part - 1)); -+ } - } - strcat(of_path, disk); - return of_path; --- -1.7.10.2 - diff --git a/grub-2.00-ppc-usb-quiesce.patch b/grub-2.00-ppc-usb-quiesce.patch deleted file mode 100644 index 5357811..0000000 --- a/grub-2.00-ppc-usb-quiesce.patch +++ /dev/null @@ -1,89 +0,0 @@ -From a2bf9168b1a0e964b9db4bd2887aafdcf400d772 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Wed, 6 Jun 2012 12:14:19 -0400 -Subject: [PATCH] Quiesce USB transactions on ppc. - ---- - grub-core/disk/ieee1275/ofdisk.c | 32 +++++++++++++++++++++++++++++ - grub-core/loader/powerpc/ieee1275/linux.c | 2 ++ - 2 files changed, 34 insertions(+) - -diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c -index 7266af6..b5bb713 100644 ---- a/grub-core/disk/ieee1275/ofdisk.c -+++ b/grub-core/disk/ieee1275/ofdisk.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - static char *last_devpath; - static grub_ieee1275_ihandle_t last_ihandle; -@@ -475,6 +476,34 @@ grub_ofdisk_init (void) - grub_disk_dev_register (&grub_ofdisk_dev); - } - -+static int quiesce (struct grub_ieee1275_devalias *alias) -+{ -+ static grub_ieee1275_ihandle_t ihandle; -+ struct set_color_args -+ { -+ struct grub_ieee1275_common_hdr common; -+ grub_ieee1275_cell_t method; -+ grub_ieee1275_cell_t ihandle; -+ grub_ieee1275_cell_t catch_result; -+ } -+ args; -+ -+ if (grub_strcmp (alias->type, "usb") != 0) -+ return 0; -+ -+ -+ if (grub_ieee1275_open (alias->path, &ihandle)) -+ return 0; -+ -+ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 1); -+ args.method = (grub_ieee1275_cell_t) "usb-quiesce"; -+ args.ihandle = ihandle; -+ -+ IEEE1275_CALL_ENTRY_FN (&args); -+ grub_ieee1275_close (ihandle); -+ return 0; -+} -+ - void - grub_ofdisk_fini (void) - { -@@ -483,5 +512,8 @@ grub_ofdisk_fini (void) - last_ihandle = 0; - last_devpath = NULL; - -+ grub_ieee1275_devices_iterate (quiesce); -+ grub_millisleep (10); -+ - grub_disk_dev_unregister (&grub_ofdisk_dev); - } -diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c -index 5cfa988..a1abc2a 100644 ---- a/grub-core/loader/powerpc/ieee1275/linux.c -+++ b/grub-core/loader/powerpc/ieee1275/linux.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - GRUB_MOD_LICENSE ("GPLv3+"); - -@@ -102,6 +103,7 @@ grub_linux_boot (void) - kernel_entry_t linuxmain; - grub_ssize_t actual; - -+ grub_arch_sync_caches ((void *) linux_addr, linux_size); - /* Set the command line arguments. */ - grub_ieee1275_set_property (grub_ieee1275_chosen, "bootargs", linux_args, - grub_strlen (linux_args) + 1, &actual); --- -1.7.10.2 - diff --git a/grub-2.00-search-for-specific-config-file-for-netboot.patch b/grub-2.00-search-for-specific-config-file-for-netboot.patch new file mode 100644 index 0000000..026d002 --- /dev/null +++ b/grub-2.00-search-for-specific-config-file-for-netboot.patch @@ -0,0 +1,205 @@ +From 38d458ddd69cb7dd6e7f58f9e9f3197c6b6184f3 Mon Sep 17 00:00:00 2001 +From: Paulo Flabiano Smorigo +Date: Tue, 27 Nov 2012 17:22:07 -0200 +Subject: [PATCH 3/3] Search for specific config file for netboot + +This patch implements a search for a specific configuration when the config +file is on a remoteserver. It uses the following order: + 1) DHCP client UUID option. + 2) MAC address (in lower case hexadecimal with dash separators); + 3) IP (in upper case hexadecimal) or IPv6; + 4) The original grub.cfg file. + +This procedure is similar to what is used by pxelinux and yaboot: +http://www.syslinux.org/wiki/index.php/PXELINUX#config + +This should close the bugzilla: +https://bugzilla.redhat.com/show_bug.cgi?id=873406 +--- + grub-core/net/net.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++ + grub-core/normal/main.c | 18 ++++++-- + include/grub/net.h | 3 ++ + 3 files changed, 135 insertions(+), 4 deletions(-) + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 01c5d32..49c32c5 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -1548,6 +1548,124 @@ grub_net_restore_hw (void) + return GRUB_ERR_NONE; + } + ++grub_err_t ++grub_net_search_configfile (char *config) ++{ ++ grub_size_t config_len; ++ char *suffix; ++ ++ auto int search_through (grub_size_t num_tries, grub_size_t slice_size); ++ int search_through (grub_size_t num_tries, grub_size_t slice_size) ++ { ++ while (num_tries-- > 0) ++ { ++ grub_dprintf ("net", "probe %s\n", config); ++ ++ grub_file_t file; ++ file = grub_file_open (config); ++ ++ if (file) ++ { ++ grub_file_close (file); ++ grub_dprintf ("net", "found!\n"); ++ return 0; ++ } ++ else ++ { ++ if (grub_errno == GRUB_ERR_IO) ++ grub_errno = GRUB_ERR_NONE; ++ } ++ ++ if (grub_strlen (suffix) < slice_size) ++ break; ++ ++ config[grub_strlen (config) - slice_size] = '\0'; ++ } ++ ++ return 1; ++ } ++ ++ config_len = grub_strlen (config); ++ config[config_len] = '-'; ++ suffix = config + config_len + 1; ++ ++ struct grub_net_network_level_interface *inf; ++ FOR_NET_NETWORK_LEVEL_INTERFACES (inf) ++ { ++ /* By the Client UUID. */ ++ ++ char client_uuid_var[sizeof ("net_") + grub_strlen (inf->name) + ++ sizeof ("_clientuuid") + 1]; ++ grub_snprintf (client_uuid_var, sizeof (client_uuid_var), ++ "net_%s_clientuuid", inf->name); ++ ++ const char *client_uuid; ++ client_uuid = grub_env_get (client_uuid_var); ++ ++ if (client_uuid) ++ { ++ grub_strcpy (suffix, client_uuid); ++ if (search_through (1, 0) == 0) return GRUB_ERR_NONE; ++ } ++ ++ /* By the MAC address. */ ++ ++ /* Add ethernet type */ ++ grub_strcpy (suffix, "01-"); ++ ++ grub_net_hwaddr_to_str (&inf->hwaddress, suffix + 3); ++ ++ char *ptr; ++ for (ptr = suffix; *ptr; ptr++) ++ if (*ptr == ':') ++ *ptr = '-'; ++ ++ if (search_through (1, 0) == 0) return GRUB_ERR_NONE; ++ ++ /* By IP address */ ++ ++ switch ((&inf->address)->type) ++ { ++ case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4: ++ { ++ grub_uint32_t n = grub_be_to_cpu32 ((&inf->address)->ipv4); ++ grub_snprintf (suffix, GRUB_NET_MAX_STR_ADDR_LEN, "%02X%02X%02X%02X", \ ++ ((n >> 24) & 0xff), ((n >> 16) & 0xff), \ ++ ((n >> 8) & 0xff), ((n >> 0) & 0xff)); ++ ++ if (search_through (8, 1) == 0) return GRUB_ERR_NONE; ++ break; ++ } ++ case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: ++ { ++ char buf[GRUB_NET_MAX_STR_ADDR_LEN]; ++ struct grub_net_network_level_address base; ++ base.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ grub_memcpy (&base.ipv6, ((&inf->address)->ipv6), 16); ++ grub_net_addr_to_str (&base, buf); ++ ++ for (ptr = buf; *ptr; ptr++) ++ if (*ptr == ':') ++ *ptr = '-'; ++ ++ grub_snprintf (suffix, GRUB_NET_MAX_STR_ADDR_LEN, "%s", buf); ++ if (search_through (1, 0) == 0) return GRUB_ERR_NONE; ++ break; ++ } ++ case GRUB_NET_NETWORK_LEVEL_PROTOCOL_DHCP_RECV: ++ return grub_error (GRUB_ERR_BUG, "shouldn't reach here"); ++ default: ++ return grub_error (GRUB_ERR_BUG, ++ "unsupported address type %d", (&inf->address)->type); ++ } ++ } ++ ++ /* Remove the remaining minus sign at the end. */ ++ config[config_len] = '\0'; ++ ++ return GRUB_ERR_NONE; ++} ++ + static struct grub_preboot *fini_hnd; + + static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index aa0b3e5..cc519a5 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #ifdef GRUB_MACHINE_IEEE1275 + #include + #endif +@@ -379,10 +380,19 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), + + prefix = grub_env_get ("prefix"); + if (prefix) +- { +- config = grub_xasprintf ("%s/grub.cfg", prefix); +- if (! config) +- goto quit; ++ { ++ grub_size_t config_len; ++ config_len = grub_strlen (prefix) + ++ sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); ++ config = grub_malloc (config_len); ++ ++ if (! config) ++ goto quit; ++ ++ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); ++ ++ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) ++ grub_net_search_configfile (config); + + grub_enter_normal_mode (config); + grub_free (config); +diff --git a/include/grub/net.h b/include/grub/net.h +index 45348dd..09b8d56 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -534,6 +534,9 @@ extern char *grub_net_default_server; + #define GRUB_NET_TRIES 40 + #define GRUB_NET_INTERVAL 400 + + #define VLANTAG_IDENTIFIER 0x8100 + ++grub_err_t ++grub_net_search_configfile (char *config); ++ + #endif /* ! GRUB_NET_HEADER */ +-- +1.7.10.4 + diff --git a/grub-2.00-support-vscsi-on-ibm-ppc.patch b/grub-2.00-support-vscsi-on-ibm-ppc.patch deleted file mode 100644 index c571058..0000000 --- a/grub-2.00-support-vscsi-on-ibm-ppc.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 6eb367e8ca2799f1ebfaeaa0fe69fe79c1aea884 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Tue, 6 Dec 2005 15:22:29 +0000 -Subject: [PATCH] Support vscsi on IBM machines. - -Support vscsi on IBM machines. -Tested by: Paulo Flabiano Smorigo. -Crucial information about API supplied by: Coleen . -Reviewed by: Coleen . ---- - ChangeLog | 8 ++++ - grub-core/disk/ieee1275/ofdisk.c | 91 ++++++++++++++++++++++++++++++-------- - 2 files changed, 80 insertions(+), 19 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index 4568bdb..6765e38 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,11 @@ -+2012-06-06 Vladimir Serbinenko -+ -+ * grub-core/disk/ieee1275/ofdisk.c (scan): Support vscsi on IBM -+ machines. -+ Tested by: Paulo Flabiano Smorigo. -+ Crucial information about API supplied by: Coleen . -+ Reviewed by: Coleen . -+ - 2012-06-05 Vladimir Serbinenko - - * util/grub-probe.c (escape_of_path): Don't add ieee1275/. -diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c -index 6b734f7..eb3ff4f 100644 ---- a/grub-core/disk/ieee1275/ofdisk.c -+++ b/grub-core/disk/ieee1275/ofdisk.c -@@ -115,33 +115,28 @@ ofdisk_hash_add (char *devpath, char *curcan) - static void - scan (void) - { -- auto int dev_iterate_real (struct grub_ieee1275_devalias *alias, -- int use_name); -+ auto int dev_iterate_real (const char *name, const char *path); - -- int dev_iterate_real (struct grub_ieee1275_devalias *alias, int use_name) -+ int dev_iterate_real (const char *name, const char *path) - { - struct ofdisk_hash_ent *op; - -+ grub_dprintf ("disk", "disk name = %s, path = %s\n", name, -+ path); - -- if (grub_strcmp (alias->type, "block") != 0) -- return 0; -- -- grub_dprintf ("disk", "disk name = %s, path = %s\n", alias->name, -- alias->path); -- -- op = ofdisk_hash_find (alias->path); -+ op = ofdisk_hash_find (path); - if (!op) - { -- char *name = grub_strdup (use_name ? alias->name : alias->path); -- char *can = grub_strdup (alias->path); -- if (!name || !can) -+ char *name_dup = grub_strdup (name); -+ char *can = grub_strdup (path); -+ if (!name_dup || !can) - { - grub_errno = GRUB_ERR_NONE; -- grub_free (name); -+ grub_free (name_dup); - grub_free (can); - return 0; - } -- op = ofdisk_hash_add (name, can); -+ op = ofdisk_hash_add (name_dup, can); - } - return 0; - } -@@ -149,18 +144,76 @@ scan (void) - auto int dev_iterate_alias (struct grub_ieee1275_devalias *alias); - int dev_iterate_alias (struct grub_ieee1275_devalias *alias) - { -- return dev_iterate_real (alias, 1); -+ if (grub_strcmp (alias->type, "block") != 0) -+ return 0; -+ return dev_iterate_real (alias->name, alias->path); - } - - auto int dev_iterate (struct grub_ieee1275_devalias *alias); - int dev_iterate (struct grub_ieee1275_devalias *alias) - { -- return dev_iterate_real (alias, 0); -+ if (grub_strcmp (alias->type, "vscsi") == 0) -+ { -+ static grub_ieee1275_ihandle_t ihandle; -+ struct set_color_args -+ { -+ struct grub_ieee1275_common_hdr common; -+ grub_ieee1275_cell_t method; -+ grub_ieee1275_cell_t ihandle; -+ grub_ieee1275_cell_t catch_result; -+ grub_ieee1275_cell_t nentries; -+ grub_ieee1275_cell_t table; -+ } -+ args; -+ char *buf, *bufptr; -+ unsigned i; -+ -+ if (grub_ieee1275_open (alias->path, &ihandle)) -+ return 0; -+ -+ INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); -+ args.method = (grub_ieee1275_cell_t) "vscsi-report-luns"; -+ args.ihandle = ihandle; -+ args.table = 0; -+ args.nentries = 0; -+ -+ if (IEEE1275_CALL_ENTRY_FN (&args) == -1) -+ { -+ grub_ieee1275_close (ihandle); -+ return 0; -+ } -+ -+ buf = grub_malloc (grub_strlen (alias->path) + 32); -+ if (!buf) -+ return 0; -+ bufptr = grub_stpcpy (buf, alias->path); -+ -+ for (i = 0; i < args.nentries; i++) -+ { -+ grub_uint64_t *ptr; -+ -+ ptr = *(grub_uint64_t **) (args.table + 4 + 8 * i); -+ while (*ptr) -+ { -+ grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, *ptr++); -+ if (dev_iterate_real (buf, buf)) -+ return 1; -+ } -+ } -+ grub_ieee1275_close (ihandle); -+ grub_free (buf); -+ return 0; -+ } -+ -+ if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS) -+ && grub_strcmp (alias->type, "block") == 0) -+ return dev_iterate_real (alias->path, alias->path); -+ -+ return grub_children_iterate (alias->path, dev_iterate); - } - - grub_devalias_iterate (dev_iterate_alias); -- if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS)) -- grub_ieee1275_devices_iterate (dev_iterate); -+ grub_children_iterate ("/", dev_iterate); - } - - static int --- -1.7.10.2 - diff --git a/grub-2.00-who-trusts-you-and-who-do-you-trust.patch b/grub-2.00-who-trusts-you-and-who-do-you-trust.patch new file mode 100644 index 0000000..e374ac2 --- /dev/null +++ b/grub-2.00-who-trusts-you-and-who-do-you-trust.patch @@ -0,0 +1,217 @@ +From 44cee23d139fe8faaca2622cc09041b1d684265b Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 5 Jun 2012 09:23:25 -0400 +Subject: [PATCH] Support secure boot. + +If SecureBoot is enabled, treat all authentications as failure, and also +use shim's verify routine to verify the kernel before loading. +--- + grub-core/loader/i386/linux.c | 26 +++++++++++++ + grub-core/normal/auth.c | 85 +++++++++++++++++++++++++++++++++++++++++ + grub-core/normal/main.c | 4 +- + grub-core/normal/menu_entry.c | 5 ++- + include/grub/auth.h | 3 ++ + 5 files changed, 121 insertions(+), 2 deletions(-) + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 6e8238e..090484c 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -681,6 +682,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int relocatable; + grub_uint64_t preffered_address = GRUB_LINUX_BZIMAGE_ADDR; + ++ void *buffer; ++ grub_err_t verified; ++ + grub_dl_ref (my_mod); + + if (argc == 0) +@@ -693,6 +697,28 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + if (! file) + goto fail; + ++ buffer = grub_malloc(grub_file_size(file)); ++ if (!buffer) ++ return grub_errno; ++ ++ if (grub_file_read (file, buffer, grub_file_size(file))) ++ { ++ if (!grub_errno) ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ argv[0]); ++ goto fail; ++ } ++ ++ verified = grub_auth_verify_signature(buffer, grub_file_size(file)); ++ grub_free(buffer); ++ if (verified != GRUB_ERR_NONE) ++ { ++ grub_errno = verified; ++ goto fail; ++ } ++ ++ grub_free(buffer); ++ grub_file_seek(file, 0); + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) + { + if (!grub_errno) +diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c +index c6bd96e..3e83ee8 100644 +--- a/grub-core/normal/auth.c ++++ b/grub-core/normal/auth.c +@@ -24,6 +24,8 @@ + #include + #include + #include ++#include ++#include + + struct grub_auth_user + { +@@ -198,6 +200,89 @@ grub_username_get (char buf[], unsigned buf_size) + } + + grub_err_t ++grub_auth_secure_boot (void) ++{ ++#ifdef GRUB_MACHINE_EFI ++ grub_size_t datasize = 0; ++ grub_uint8_t *data; ++ grub_efi_guid_t guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; ++ unsigned int x; ++ ++ data = grub_efi_get_variable ("SecureBoot", &guid, &datasize); ++ if (!data) ++ return GRUB_ERR_NONE; ++ ++ for (x = 0; x < datasize; x++) ++ if (data[x] == 1) ++ return GRUB_ACCESS_DENIED; ++#endif ++ ++ return GRUB_ERR_NONE; ++} ++ ++int ++grub_is_secure_boot (void) ++{ ++ return grub_auth_secure_boot() == GRUB_ACCESS_DENIED; ++} ++ ++#define SHIM_LOCK_GUID \ ++ { 0x605dab50, 0xe046, 0x4300, {0xab,0xb6,0x3d,0xd8,0x10,0xdd,0x8b,0x23} } ++ ++typedef grub_efi_status_t (*EFI_SHIM_LOCK_VERIFY)(void *buffer, grub_efi_uint32_t size); ++ ++typedef struct _SHIM_LOCK { ++ EFI_SHIM_LOCK_VERIFY Verify; ++} SHIM_LOCK; ++ ++grub_err_t ++grub_auth_verify_signature (void *buffer, grub_uint32_t size) ++{ ++#ifdef GRUB_MACHINE_EFI ++ grub_efi_guid_t shim_guid = SHIM_LOCK_GUID; ++ SHIM_LOCK *shim = NULL; ++ grub_efi_handle_t *handles, shim_handle = NULL; ++ grub_efi_uintn_t num_handles, i; ++ grub_efi_status_t status; ++ ++ if (!grub_is_secure_boot()) ++ return GRUB_ERR_NONE; ++ ++ handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &shim_guid, NULL, ++ &num_handles); ++ if (!handles || num_handles == 0) ++no_verify: ++ return grub_error (GRUB_ACCESS_DENIED, "Could not find signature verification routine"); ++ ++ for (i = 0; i < num_handles; i++) ++ { ++ shim_handle = handles[i]; ++ shim = grub_efi_open_protocol (shim_handle, &shim_guid, ++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); ++ if (shim) ++ break; ++ } ++ ++ if (!shim) ++ { ++ grub_free(handles); ++ goto no_verify; ++ } ++ ++ status = shim->Verify(buffer, size); ++ ++ grub_free(handles); ++ ++ if (status == GRUB_EFI_SUCCESS) ++ return GRUB_ERR_NONE; ++ ++ return grub_error (GRUB_ACCESS_DENIED, "Signature verification failed"); ++#else ++ return GRUB_ERR_NONE; ++#endif ++} ++ ++grub_err_t + grub_auth_check_authentication (const char *userlist) + { + char login[1024]; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 193d7d3..1e321a4 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -455,7 +455,9 @@ grub_cmdline_run (int nested) + { + grub_err_t err = GRUB_ERR_NONE; + +- err = grub_auth_check_authentication (NULL); ++ err = grub_auth_secure_boot (); ++ if (err == GRUB_ERR_NONE) ++ err = grub_auth_check_authentication (NULL); + + if (err) + { +diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c +index 7fc890d..4e7a08c 100644 +--- a/grub-core/normal/menu_entry.c ++++ b/grub-core/normal/menu_entry.c +@@ -1287,7 +1287,10 @@ grub_menu_entry_run (grub_menu_entry_t entry) + unsigned i; + grub_term_output_t term; + +- err = grub_auth_check_authentication (NULL); ++ ++ err = grub_auth_secure_boot (); ++ if (err == GRUB_ERR_NONE) ++ err = grub_auth_check_authentication (NULL); + + if (err) + { +diff --git a/include/grub/auth.h b/include/grub/auth.h +index 7473344..b933fa1 100644 +--- a/include/grub/auth.h ++++ b/include/grub/auth.h +@@ -32,6 +32,9 @@ grub_err_t grub_auth_unregister_authentication (const char *user); + + grub_err_t grub_auth_authenticate (const char *user); + grub_err_t grub_auth_deauthenticate (const char *user); ++grub_err_t grub_auth_secure_boot (void); ++int grub_is_secure_boot (void); ++grub_err_t grub_auth_verify_signature (void *buffer, grub_uint32_t size); + grub_err_t grub_auth_check_authentication (const char *userlist); + + #endif /* ! GRUB_AUTH_HEADER */ +-- +1.7.10.2 + diff --git a/grub2-add-bootpath-device-to-the-list.patch b/grub2-add-bootpath-device-to-the-list.patch new file mode 100644 index 0000000..d493bb5 --- /dev/null +++ b/grub2-add-bootpath-device-to-the-list.patch @@ -0,0 +1,54 @@ +From d2863ca186a6d4ba2a56559bf522f46c18403645 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Fri, 14 Dec 2012 20:10:21 -0200 +Subject: [PATCH] Add bootpath device to the list + +When scanning the devices, always check (and add) the bootpath device if it +isn't in the device list. +--- + grub-core/disk/ieee1275/ofdisk.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c +index b0aa7ec..99b156e 100644 +--- a/grub-core/disk/ieee1275/ofdisk.c ++++ b/grub-core/disk/ieee1275/ofdisk.c +@@ -213,6 +213,35 @@ scan (void) + return grub_children_iterate (alias->path, dev_iterate); + } + ++ char *bootpath; ++ int bootpath_size; ++ char *type; ++ ++ if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootpath", ++ &bootpath_size) ++ || bootpath_size <= 0) ++ { ++ /* Should never happen. */ ++ grub_printf ("/chosen/bootpath property missing!\n"); ++ return; ++ } ++ ++ bootpath = (char *) grub_malloc ((grub_size_t) bootpath_size + 64); ++ if (! bootpath) ++ { ++ grub_print_error (); ++ return; ++ } ++ grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, ++ (grub_size_t) bootpath_size + 1, 0); ++ bootpath[bootpath_size] = '\0'; ++ ++ type = grub_ieee1275_get_device_type (bootpath); ++ if (type && grub_strcmp (type, "block") == 0) ++ dev_iterate_real (bootpath, bootpath); ++ ++ grub_free (bootpath); ++ + grub_devalias_iterate (dev_iterate_alias); + grub_children_iterate ("/", dev_iterate); + } +-- +1.8.0 + diff --git a/grub2-cdpath.patch b/grub2-cdpath.patch new file mode 100644 index 0000000..3e00db4 --- /dev/null +++ b/grub2-cdpath.patch @@ -0,0 +1,25 @@ +From: Matthew Garrett +Date: 2012-07-10 11:58:52 EDT +Subject: [PATCH] Add support for crappy cd craparino + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index d9d788c..a432b44 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -750,6 +750,16 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + if (! ldp) + return 0; + ++ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE && ++ (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE)) ++ { ++ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; ++ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ++ ldp->length[0] = 4; ++ ldp->length[1] = 0; ++ ldp = find_last_device_path(dp); ++ } ++ + if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE + && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) + == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)) diff --git a/grub2-linuxefi.patch b/grub2-linuxefi.patch new file mode 100644 index 0000000..c0282d0 --- /dev/null +++ b/grub2-linuxefi.patch @@ -0,0 +1,480 @@ +From: Matthew Garrett +Date: 2012-07-10 11:58:52 EDT +Subject: [PATCH] Add support for linuxefi + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 39e77a4..f9cbfc3 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1415,6 +1415,14 @@ module = { + }; + + module = { ++ name = linuxefi; ++ efi = loader/i386/efi/linux.c; ++ efi = lib/cmdline.c; ++ enable = i386_efi; ++ enable = x86_64_efi; ++}; ++ ++module = { + name = chain; + efi = loader/efi/chainloader.c; + i386_pc = loader/i386/pc/chainloader.c; +diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c +index a2edc84..88b2557 100644 +--- a/grub-core/kern/efi/mm.c ++++ b/grub-core/kern/efi/mm.c +@@ -47,6 +47,38 @@ static grub_efi_uintn_t finish_desc_size; + static grub_efi_uint32_t finish_desc_version; + int grub_efi_is_finished = 0; + ++/* Allocate pages below a specified address */ ++void * ++grub_efi_allocate_pages_max (grub_efi_physical_address_t max, ++ grub_efi_uintn_t pages) ++{ ++ grub_efi_status_t status; ++ grub_efi_boot_services_t *b; ++ grub_efi_physical_address_t address = max; ++ ++ if (max > 0xffffffff) ++ return 0; ++ ++ b = grub_efi_system_table->boot_services; ++ status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address); ++ ++ if (status != GRUB_EFI_SUCCESS) ++ return 0; ++ ++ if (address == 0) ++ { ++ /* Uggh, the address 0 was allocated... This is too annoying, ++ so reallocate another one. */ ++ address = max; ++ status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_MAX_ADDRESS, GRUB_EFI_LOADER_DATA, pages, &address); ++ grub_efi_free_pages (0, pages); ++ if (status != GRUB_EFI_SUCCESS) ++ return 0; ++ } ++ ++ return (void *) ((grub_addr_t) address); ++} ++ + /* Allocate pages. Return the pointer to the first of allocated pages. */ + void * + grub_efi_allocate_pages (grub_efi_physical_address_t address, +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +new file mode 100644 +index 0000000..d06a0e3 +--- /dev/null ++++ b/grub-core/loader/i386/efi/linux.c +@@ -0,0 +1,369 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2012 Free Software Foundation, Inc. ++ * ++ * GRUB is free software: you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation, either version 3 of the License, or ++ * (at your option) any later version. ++ * ++ * GRUB is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with GRUB. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++GRUB_MOD_LICENSE ("GPLv3+"); ++ ++static grub_dl_t my_mod; ++static int loaded; ++static void *kernel_mem; ++static grub_uint64_t kernel_size; ++static grub_uint8_t *initrd_mem; ++static grub_uint32_t handover_offset; ++struct linux_kernel_params *params; ++static char *linux_cmdline; ++ ++#define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12) ++ ++#define SHIM_LOCK_GUID \ ++ { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} } ++ ++struct grub_efi_shim_lock ++{ ++ grub_efi_status_t (*verify) (void *buffer, grub_uint32_t size); ++}; ++typedef struct grub_efi_shim_lock grub_efi_shim_lock_t; ++ ++static grub_efi_boolean_t ++grub_linuxefi_secure_validate (void *data, grub_uint32_t size) ++{ ++ grub_efi_guid_t guid = SHIM_LOCK_GUID; ++ grub_efi_shim_lock_t *shim_lock; ++ ++ shim_lock = grub_efi_locate_protocol(&guid, NULL); ++ ++ if (!shim_lock) ++ return 1; ++ ++ if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS) ++ return 1; ++ ++ return 0; ++} ++ ++typedef void(*handover_func)(void *, grub_efi_system_table_t *, struct linux_kernel_params *); ++ ++static grub_err_t ++grub_linuxefi_boot (void) ++{ ++ handover_func hf; ++ int offset = 0; ++ ++#ifdef __x86_64__ ++ offset = 512; ++#endif ++ ++ hf = (handover_func)((char *)kernel_mem + handover_offset + offset); ++ ++ asm volatile ("cli"); ++ ++ hf (grub_efi_image_handle, grub_efi_system_table, params); ++ ++ /* Not reached */ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_linuxefi_unload (void) ++{ ++ grub_dl_unref (my_mod); ++ loaded = 0; ++ if (initrd_mem) ++ grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size)); ++ if (linux_cmdline) ++ grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1)); ++ if (kernel_mem) ++ grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); ++ if (params) ++ grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), ++ int argc, char *argv[]) ++{ ++ grub_file_t *files = 0; ++ int i, nfiles = 0; ++ grub_size_t size = 0; ++ grub_uint8_t *ptr; ++ ++ if (argc == 0) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ goto fail; ++ } ++ ++ if (!loaded) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); ++ goto fail; ++ } ++ ++ files = grub_zalloc (argc * sizeof (files[0])); ++ if (!files) ++ goto fail; ++ ++ for (i = 0; i < argc; i++) ++ { ++ grub_file_filter_disable_compression (); ++ files[i] = grub_file_open (argv[i]); ++ if (! files[i]) ++ goto fail; ++ nfiles++; ++ size += ALIGN_UP (grub_file_size (files[i]), 4); ++ } ++ ++ initrd_mem = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(size)); ++ ++ if (!initrd_mem) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate initrd")); ++ goto fail; ++ } ++ ++ params->ramdisk_size = size; ++ params->ramdisk_image = (grub_uint32_t)(grub_uint64_t) initrd_mem; ++ ++ ptr = initrd_mem; ++ ++ for (i = 0; i < nfiles; i++) ++ { ++ grub_ssize_t cursize = grub_file_size (files[i]); ++ if (grub_file_read (files[i], ptr, cursize) != cursize) ++ { ++ if (!grub_errno) ++ grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), ++ argv[i]); ++ goto fail; ++ } ++ ptr += cursize; ++ grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ++ ptr += ALIGN_UP_OVERHEAD (cursize, 4); ++ } ++ ++ params->ramdisk_size = size; ++ ++ fail: ++ for (i = 0; i < nfiles; i++) ++ grub_file_close (files[i]); ++ grub_free (files); ++ ++ if (initrd_mem && grub_errno) ++ grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(size)); ++ ++ return grub_errno; ++} ++ ++static grub_err_t ++grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), ++ int argc, char *argv[]) ++{ ++ grub_file_t file = 0; ++ struct linux_kernel_header lh; ++ grub_ssize_t len, start, filelen; ++ void *kernel; ++ ++ grub_dl_ref (my_mod); ++ ++ if (argc == 0) ++ { ++ grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); ++ goto fail; ++ } ++ ++ file = grub_file_open (argv[0]); ++ if (! file) ++ goto fail; ++ ++ filelen = grub_file_size (file); ++ ++ kernel = grub_malloc(filelen); ++ ++ if (!kernel) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("cannot allocate kernel buffer")); ++ goto fail; ++ } ++ ++ if (grub_file_read (file, kernel, filelen) != filelen) ++ { ++ grub_error (GRUB_ERR_FILE_READ_ERROR, N_("Can't read kernel %s"), argv[0]); ++ goto fail; ++ } ++ ++ if (! grub_linuxefi_secure_validate (kernel, filelen)) ++ { ++ grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); ++ grub_free (kernel); ++ goto fail; ++ } ++ ++ grub_file_seek (file, 0); ++ ++ grub_free(kernel); ++ ++ params = grub_efi_allocate_pages_max (0x3fffffff, BYTES_TO_PAGES(16384)); ++ ++ if (! params) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate kernel parameters"); ++ goto fail; ++ } ++ ++ memset (params, 0, 16384); ++ ++ if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) ++ { ++ if (!grub_errno) ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ argv[0]); ++ goto fail; ++ } ++ ++ if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("invalid magic number")); ++ goto fail; ++ } ++ ++ if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("too many setup sectors")); ++ goto fail; ++ } ++ ++ if (lh.version < grub_cpu_to_le16 (0x020b)) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("kernel too old")); ++ goto fail; ++ } ++ ++ if (!lh.handover_offset) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("kernel doesn't support EFI handover")); ++ goto fail; ++ } ++ ++ linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, ++ BYTES_TO_PAGES(lh.cmdline_size + 1)); ++ ++ if (!linux_cmdline) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline")); ++ goto fail; ++ } ++ ++ grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); ++ grub_create_loader_cmdline (argc, argv, ++ linux_cmdline + sizeof (LINUX_IMAGE) - 1, ++ lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1)); ++ ++ lh.cmd_line_ptr = (grub_uint32_t)(grub_uint64_t)linux_cmdline; ++ ++ handover_offset = lh.handover_offset; ++ ++ start = (lh.setup_sects + 1) * 512; ++ len = grub_file_size(file) - start; ++ ++ kernel_mem = grub_efi_allocate_pages(lh.pref_address, ++ BYTES_TO_PAGES(lh.init_size)); ++ ++ if (!kernel_mem) ++ kernel_mem = grub_efi_allocate_pages_max(0x3fffffff, ++ BYTES_TO_PAGES(lh.init_size)); ++ ++ if (!kernel_mem) ++ { ++ grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate kernel")); ++ goto fail; ++ } ++ ++ if (grub_file_seek (file, start) == (grub_off_t) -1) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ argv[0]); ++ goto fail; ++ } ++ ++ if (grub_file_read (file, kernel_mem, len) != len && !grub_errno) ++ { ++ grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), ++ argv[0]); ++ } ++ ++ if (grub_errno == GRUB_ERR_NONE) ++ { ++ grub_loader_set (grub_linuxefi_boot, grub_linuxefi_unload, 0); ++ loaded = 1; ++ lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; ++ } ++ ++ memcpy(params, &lh, 2 * 512); ++ ++ fail: ++ ++ if (file) ++ grub_file_close (file); ++ ++ if (grub_errno != GRUB_ERR_NONE) ++ { ++ grub_dl_unref (my_mod); ++ loaded = 0; ++ } ++ ++ if (linux_cmdline && !loaded) ++ grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1)); ++ ++ if (kernel_mem && !loaded) ++ grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size)); ++ ++ if (params && !loaded) ++ grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384)); ++ ++ return grub_errno; ++} ++ ++static grub_command_t cmd_linux, cmd_initrd; ++ ++GRUB_MOD_INIT(linuxefi) ++{ ++ cmd_linux = ++ grub_register_command ("linuxefi", grub_cmd_linux, ++ 0, N_("Load Linux.")); ++ cmd_initrd = ++ grub_register_command ("initrdefi", grub_cmd_initrd, ++ 0, N_("Load initrd.")); ++ my_mod = mod; ++} ++ ++GRUB_MOD_FINI(linuxefi) ++{ ++ grub_unregister_command (cmd_linux); ++ grub_unregister_command (cmd_initrd); ++} +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index e67d92b..1b0e7ae 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -40,6 +40,9 @@ void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds); + void * + EXPORT_FUNC(grub_efi_allocate_pages) (grub_efi_physical_address_t address, + grub_efi_uintn_t pages); ++void * ++EXPORT_FUNC(grub_efi_allocate_pages_max) (grub_efi_physical_address_t max, ++ grub_efi_uintn_t pages); + void EXPORT_FUNC(grub_efi_free_pages) (grub_efi_physical_address_t address, + grub_efi_uintn_t pages); + int +diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h +index 9d064c8..c29c5af 100644 +--- a/include/grub/i386/linux.h ++++ b/include/grub/i386/linux.h +@@ -139,6 +139,7 @@ struct linux_kernel_header + grub_uint64_t setup_data; + grub_uint64_t pref_address; + grub_uint32_t init_size; ++ grub_uint32_t handover_offset; + } __attribute__ ((packed)); + + /* Boot parameters for Linux based on 2.6.12. This is used by the setup +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +index d06a0e3..b79e632 100644 +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -326,6 +326,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + memcpy(params, &lh, 2 * 512); + ++ params->type_of_loader = 0x21; ++ + fail: + + if (file) diff --git a/grub2-use-linuxefi.patch b/grub2-use-linuxefi.patch new file mode 100644 index 0000000..18684b0 --- /dev/null +++ b/grub2-use-linuxefi.patch @@ -0,0 +1,50 @@ +From 151b1691fe0cf885df101c6e6a7cb1defc50428b Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 16 Jul 2012 18:57:11 -0400 +Subject: [PATCH] Use "linuxefi" and "initrdefi" where appropriate. + +--- + util/grub.d/10_linux.in | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index cd543bd..e2b8ab3 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -133,17 +133,31 @@ linux_entry () + printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/" + fi + message="$(gettext_printf "Loading Linux %s ..." ${version})" +- sed "s/^/$submenu_indentation/" << EOF ++ if [ -d /sys/firmware/efi ]; then ++ sed "s/^/$submenu_indentation/" << EOF ++ echo '$message' ++ linuxefi ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} ++EOF ++ else ++ sed "s/^/$submenu_indentation/" << EOF + echo '$message' + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} + EOF ++ fi + if test -n "${initrd}" ; then + # TRANSLATORS: ramdisk isn't identifier. Should be translated. + message="$(gettext_printf "Loading initial ramdisk ...")" +- sed "s/^/$submenu_indentation/" << EOF ++ if [ -d /sys/firmware/efi ]; then ++ sed "s/^/$submenu_indentation/" << EOF ++ echo '$message' ++ initrdefi ${rel_dirname}/${initrd} ++EOF ++ else ++ sed "s/^/$submenu_indentation/" << EOF + echo '$message' + initrd ${rel_dirname}/${initrd} + EOF ++ fi + fi + sed "s/^/$submenu_indentation/" << EOF + } +-- +1.7.10.4 + diff --git a/grub2.spec b/grub2.spec index 486f6c7..89f4858 100644 --- a/grub2.spec +++ b/grub2.spec @@ -18,10 +18,12 @@ %ifarch %{ix86} %global grubefiarch i386-efi %global grubefiname grubia32.efi +%global grubeficdname gcdia32.efi %endif %ifarch x86_64 %global grubefiarch %{_arch}-efi %global grubefiname grubx64.efi +%global grubeficdname gcdx64.efi %endif %if 0%{?rhel} @@ -33,13 +35,13 @@ %endif -%global tarversion 2.00~beta6 +%global tarversion 2.00 %undefine _missing_build_ids_terminate_build Name: grub2 Epoch: 1 -Version: 2.0 -Release: 0.39%{?dist} +Version: 2.00 +Release: 15%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -50,22 +52,32 @@ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source3: README.Fedora Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Source5: theme.tar.bz2 -Patch0: grub-2.00-ieee1276.patch -Patch1: grub-2.00-no-canon.patch +#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 -Patch14: grub-2.00-ignore-gnulib-gets-stupidity.patch -Patch15: grub-2.00-linux-mbr.patch -Patch16: grub-2.00-no-huge-video.patch -Patch17: grub-2.00-ppc-hints.patch -Patch18: grub-2.00-support-vscsi-on-ibm-ppc.patch -Patch19: grub-2.00-ppc-usb-quiesce.patch -Patch20: grub-2.00-no-double-free.patch -Patch21: grub-2.00-ppc_handle_devices_with_comma.patch -Patch22: grub-2.00-increase-the-ieee1275-device-path-buffer-size.patch +Patch18: grub-2.00-ignore-gnulib-gets-stupidity.patch +#Patch19: grub-2.00-who-trusts-you-and-who-do-you-trust.patch +Patch20: grub2-linuxefi.patch +Patch21: grub2-cdpath.patch +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 +Patch27: grub-2.00-Handle-escapes-in-labels.patch +Patch28: grub-2.00-fix-http-crash.patch +Patch29: grub-2.00-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch +Patch30: grub-2.00-cas-reboot-support.patch +Patch31: grub-2.00-for-ppc-include-all-modules-in-the-core-image.patch +Patch32: add-vlan-tag-support.patch +Patch33: follow-the-symbolic-link-ieee1275.patch +Patch34: grub-2.00-add-X-option-to-printf-functions.patch +Patch35: grub-2.00-dhcp-client-id-and-uuid-options-added.patch +Patch36: grub-2.00-search-for-specific-config-file-for-netboot.patch +Patch37: grub2-add-bootpath-device-to-the-list.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -83,6 +95,9 @@ BuildRequires: autoconf automake autogen device-mapper-devel BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo BuildRequires: dejavu-sans-fonts +%ifarch %{efiarchs} +BuildRequires: pesign >= 0.99-8 +%endif Requires: gettext os-prober which file system-logos Requires: %{name}-tools = %{epoch}:%{version}-%{release} @@ -130,7 +145,7 @@ cp %{SOURCE3} . # place unifont in the '.' from which configure is run cp %{SOURCE4} unifont.pcf.gz git init -git config user.email "pjones@fedoraproject.org" +git config user.email "grub2-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git add . git commit -a -q -m "%{tarversion} baseline." @@ -144,7 +159,7 @@ cp %{SOURCE3} . # place unifont in the '.' from which configure is run cp %{SOURCE4} unifont.pcf.gz git init -git config user.email "pjones@fedoraproject.org" +git config user.email "grub2-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git add . git commit -a -q -m "%{tarversion} baseline." @@ -168,10 +183,18 @@ cd grub-efi-%{tarversion} --program-transform-name=s,grub,%{name}, \ --disable-werror make %{?_smp_mflags} -./grub-mkimage -O %{grubefiarch} -o %{grubefiname} -d grub-core \ - part_gpt hfsplus fat ext2 btrfs normal chain boot configfile linux \ - minicmd reboot halt search font gfxterm echo video all_video \ - test gfxmenu png efifwsetup +CD_MODULES=" all_video boot btrfs cat chain configfile echo efifwsetup \ + efinet ext2 fat font gfxmenu gfxterm gzio halt hfsplus iso9660 \ + jpeg linuxefi minicmd normal part_apple part_msdos part_gpt \ + password_pbkdf2 png reboot search search_fs_uuid \ + search_fs_file search_label sleep test video xfs" +./grub-mkimage -O %{grubefiarch} -o %{grubeficdname}.orig -p /EFI/BOOT \ + -d grub-core ${CD_MODULES} +%pesign -s -i %{grubeficdname}.orig -o %{grubeficdname} +GRUB_MODULES="${CD_MODULES} mdraid09 mdraid1x" +./grub-mkimage -O %{grubefiarch} -o %{grubefiname}.orig -p /EFI/%{efidir} \ + -d grub-core ${GRUB_MODULES} +%pesign -s -i %{grubefiname}.orig -o %{grubefiname} cd .. %endif @@ -222,6 +245,7 @@ rm -fr $RPM_BUILD_ROOT %ifarch %{efiarchs} cd grub-efi-%{tarversion} make DESTDIR=$RPM_BUILD_ROOT install +find $RPM_BUILD_ROOT -iname "*.module" -exec chmod a-x {} \; # Ghost config file install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/ @@ -242,6 +266,8 @@ do # install -m 755 -D $BASE$EXT $TGT done install -m 755 %{grubefiname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubefiname} +install -m 755 %{grubeficdname} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{grubeficdname} +install -D -m 644 unicode.pf2 $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/fonts/unicode.pf2 cd .. %endif @@ -288,6 +314,18 @@ $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans- $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-12.pf2 -s 12 /usr/share/fonts/dejavu/DejaVuSans.ttf # "DejaVu Sans Regular 12" $RPM_BUILD_ROOT%{_bindir}/%{name}-mkfont -o boot/grub2/themes/system/DejaVuSans-Bold-14.pf2 -s 14 /usr/share/fonts/dejavu/DejaVuSans-Bold.ttf # "DejaVu Sans Bold 14" +# Make selinux happy with exec stack binaries. +mkdir ${RPM_BUILD_ROOT}%{_sysconfdir}/prelink.conf.d/ +cat << EOF > ${RPM_BUILD_ROOT}%{_sysconfdir}/prelink.conf.d/grub2.conf +# these have execstack, and break under selinux +-b /usr/bin/grub2-script-check +-b /usr/bin/grub2-mkrelpath +-b /usr/bin/grub2-fstest +-b /usr/sbin/grub2-bios-setup +-b /usr/sbin/grub2-probe +-b /usr/sbin/grub2-sparc64-setup +EOF + %clean rm -rf $RPM_BUILD_ROOT @@ -341,6 +379,7 @@ fi %{_libdir}/grub/%{grubefiarch} %config(noreplace) %{_sysconfdir}/%{name}-efi.cfg %attr(0755,root,root)/boot/efi/EFI/%{efidir} +%attr(0755,root,root)/boot/efi/EFI/%{efidir}/fonts %ghost %config(noreplace) /boot/efi/EFI/%{efidir}/grub.cfg %doc grub-%{tarversion}/COPYING %endif @@ -373,6 +412,7 @@ fi %endif %{_bindir}/%{name}-script-check %{_sysconfdir}/bash_completion.d/grub +%{_sysconfdir}/prelink.conf.d/grub2.conf %attr(0700,root,root) %dir %{_sysconfdir}/grub.d %config %{_sysconfdir}/grub.d/??_* %{_sysconfdir}/grub.d/README @@ -391,13 +431,76 @@ fi %doc grub-%{tarversion}/themes/starfield/COPYING.CC-BY-SA-3.0 %changelog -* Tue Nov 27 2012 Peter Jones - 2.0-0.39 -- Fix device path truncations on ppc (pfsmorigo, #857305) - -* Thu Aug 02 2012 Peter Jones - 2.0-0.38.beta6 +* Thu Dec 20 2012 Dennis Gilmore - 2.00-15 +- bump nvr + +* Mon Dec 17 2012 Karsten Hopp 2.00-14 +- add bootpath device to the device list (pfsmorigo, #886685) + +* Tue Nov 27 2012 Peter Jones - 2.00-13 +- Add vlan tag support (pfsmorigo, #871563) +- Follow symlinks during PReP installation in grub2-install (pfsmorigo, #874234) +- Improve search paths for config files on network boot (pfsmorigo, #873406) + +* Tue Oct 23 2012 Peter Jones - 2.00-12 +- Don't load modules when grub transitions to "normal" mode on UEFI. + +* Mon Oct 22 2012 Peter Jones - 2.00-11 +- Rebuild with newer pesign so we'll get signed with the final signing keys. + +* Thu Oct 18 2012 Peter Jones - 2.00-10 +- Various PPC fixes. +- Fix crash fetching from http (gustavold, #860834) +- Issue separate dns queries for ipv4 and ipv6 (gustavold, #860829) +- Support IBM CAS reboot (pfsmorigo, #859223) +- Include all modules in the core image on ppc (pfsmorigo, #866559) + +* Mon Oct 01 2012 Peter Jones - 1:2.00-9 +- Work around bug with using "\x20" in linux command line. + Related: rhbz#855849 + +* 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 + +* Thu Aug 23 2012 David Cantrell - 2.00-6 +- Only require pesign on EFI architectures (#851215) + +* Tue Aug 14 2012 Peter Jones - 2.00-5 +- Work around AHCI firmware bug in efidisk driver. +- Move to newer pesign macros +- Don't allow insmod if we're in secure-boot mode. + +* Wed Aug 08 2012 Peter Jones +- Split module lists for UEFI boot vs UEFI cd images. +- Add raid modules for UEFI image (related: #750794) +- Include a prelink whitelist for binaries that need execstack (#839813) +- Include fix efi memory map fix from upstream (#839363) + +* Wed Aug 08 2012 Peter Jones - 2.00-4 +- Correct grub-mkimage invocation to use efidir RPM macro (jwb) +- Sign with test keys on UEFI systems. - PPC - Handle device paths with commas correctly. Related: rhbz#828740 +* Wed Jul 25 2012 Peter Jones - 2.00-3 +- Add some more code to support Secure Boot, and temporarily disable + some other bits that don't work well enough yet. + Resolves: rhbz#836695 + +* Wed Jul 11 2012 Matthew Garrett - 2.00-2 +- Set a prefix for the image - needed for installer work +- Provide the font in the EFI directory for the same reason + +* Thu Jun 28 2012 Peter Jones - 2.00-1 +- Rebase to grub-2.00 release. + * Mon Jun 18 2012 Peter Jones - 2.0-0.37.beta6 - Fix double-free in grub-probe. diff --git a/sources b/sources index 0fefdba..0522594 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ +a1043102fbc7bcedbf53e7ee3d17ab91 grub-2.00.tar.xz +566c4668b90b610c1f6c0c402cbd6ab0 theme.tar.bz2 8c28087c5fcb3188f1244b390efffdbe unifont-5.1.20080820.pcf.gz -5e5c7bae1211f558e3c0a3011fef8609 theme.tar.bz2 -5e4e66785eef00384aedc29770e86f3d grub-2.00~beta6.tar.xz