From 23d2ea7ed7d0b099004f78517adff7df35855530 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:46:01 +0000 Subject: import grub2-2.02-0.44.el7 --- diff --git a/.gitignore b/.gitignore index 618dc68..0342d81 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ SOURCES/grub-2.02~beta2.tar.xz SOURCES/theme.tar.bz2 SOURCES/unifont-5.1.20080820.pcf.gz -SOURCES/centos.cer diff --git a/.grub2.metadata b/.grub2.metadata index a5c2c6a..261f908 100644 --- a/.grub2.metadata +++ b/.grub2.metadata @@ -1,4 +1,3 @@ 1bf580f1e8bce4909a7ac7ca485cee02b00ed383 SOURCES/grub-2.02~beta2.tar.xz cf0b7763c528902da7e8b05cfa248f20c8825ce5 SOURCES/theme.tar.bz2 87f8600ba24e521b5d20bdf6c4b71af8ae861e3a SOURCES/unifont-5.1.20080820.pcf.gz -6e9105eb51e55a46761838f289a917611cad8091 SOURCES/centos.cer diff --git a/SOURCES/0001-Add-GRUB_DISABLE_UUID.patch b/SOURCES/0001-Add-GRUB_DISABLE_UUID.patch deleted file mode 100644 index e4fd8bd..0000000 --- a/SOURCES/0001-Add-GRUB_DISABLE_UUID.patch +++ /dev/null @@ -1,102 +0,0 @@ -From c15606e88f9b6a97985febb331d7ee6d0489ba7e Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 4 Sep 2014 16:49:25 -0400 -Subject: [PATCH] Add GRUB_DISABLE_UUID. - -This will cause "search --fs-uuid --set=root ..." not to be generated by -grub2-mkconfig, and instead simply attempt to use the grub device name -as it understands it. - -Good luck. - -Resolves: rhbz#1027833 -Signed-off-by: Peter Jones ---- - docs/grub.texi | 7 +++++++ - util/grub-mkconfig.in | 12 ++++++++++-- - util/grub-mkconfig_lib.in | 4 ++-- - 3 files changed, 19 insertions(+), 4 deletions(-) - -diff --git a/docs/grub.texi b/docs/grub.texi -index 46b9e7f..6b112c1 100644 ---- a/docs/grub.texi -+++ b/docs/grub.texi -@@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. - If this option is set to @samp{true}, disable the generation of recovery - mode menu entries. - -+@item GRUB_DISABLE_UUID -+Normally, @command{grub-mkconfig} will generate menu entries that use -+universally-unique identifiers (UUIDs) to identify various filesystems to -+search for files. This is usually more reliable, but in some cases it may -+not be appropriate. To disable this use of UUIDs, set this option to -+@samp{true}. -+ - @item GRUB_VIDEO_BACKEND - If graphical video support is required, either because the @samp{gfxterm} - graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, -diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index beb22de..bc26e7c 100644 ---- a/util/grub-mkconfig.in -+++ b/util/grub-mkconfig.in -@@ -130,11 +130,11 @@ fi - - # Device containing our userland. Typically used for root= parameter. - GRUB_DEVICE="`${grub_probe} --target=device /`" --GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true -+GRUB_DEVICE_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true - - # Device containing our /boot partition. Usually the same as GRUB_DEVICE. - GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" --GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true -+GRUB_DEVICE_BOOT_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true - - # Filesystem for the device containing our userland. Used for stuff like - # choosing Hurd filesystem module. -@@ -148,6 +148,13 @@ if test -f ${sysconfdir}/default/grub ; then - . ${sysconfdir}/default/grub - fi - -+if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then -+ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" -+fi -+if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_BOOT_UUID" ]; then -+ GRUB_DEVICE_BOOT_UUID="$GRUB_DEVICE_BOOT_UUID_GENERATED" -+fi -+ - # XXX: should this be deprecated at some point? - if [ "x${GRUB_TERMINAL}" != "x" ] ; then - GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" -@@ -213,6 +220,7 @@ export GRUB_DEFAULT \ - GRUB_SERIAL_COMMAND \ - GRUB_DISABLE_LINUX_UUID \ - GRUB_DISABLE_RECOVERY \ -+ GRUB_DISABLE_UUID \ - GRUB_VIDEO_BACKEND \ - GRUB_GFXMODE \ - GRUB_BACKGROUND \ -diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 7ac0bbe..5c9ed84 100644 ---- a/util/grub-mkconfig_lib.in -+++ b/util/grub-mkconfig_lib.in -@@ -156,7 +156,7 @@ prepare_grub_to_access_device () - if [ "x$fs_hint" != x ]; then - echo "set root='$fs_hint'" - fi -- if fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then -+ if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then - hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= - echo "if [ x\$feature_platform_search_hint = xy ]; then" - echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" -@@ -173,7 +173,7 @@ grub_get_device_id () - IFS=' - ' - device="$1" -- if fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then -+ if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then - echo "$fs_uuid"; - else - echo $device |sed 's, ,_,g' --- -1.9.3 - diff --git a/SOURCES/0001-Allow-fallback-to-include-entries-by-title-not-just-.patch b/SOURCES/0001-Allow-fallback-to-include-entries-by-title-not-just-.patch deleted file mode 100644 index c5e9341..0000000 --- a/SOURCES/0001-Allow-fallback-to-include-entries-by-title-not-just-.patch +++ /dev/null @@ -1,131 +0,0 @@ -From fed4e69879282065708ac7cce9e048f0bb90d51c Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Fri, 5 Sep 2014 10:07:04 -0400 -Subject: [PATCH] Allow "fallback" to include entries by title, not just - number. - -Resolves: rhbz#1026084 - -Signed-off-by: Peter Jones ---- - grub-core/normal/menu.c | 76 +++++++++++++++++++++++++++++++------------------ - 1 file changed, 49 insertions(+), 27 deletions(-) - -diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index cc27c37..a446d9a 100644 ---- a/grub-core/normal/menu.c -+++ b/grub-core/normal/menu.c -@@ -163,12 +163,35 @@ grub_menu_set_timeout (int timeout) - } - } - -+static int -+menuentry_eq (const char *id, const char *spec) -+{ -+ const char *ptr1, *ptr2; -+ ptr1 = id; -+ ptr2 = spec; -+ while (1) -+ { -+ if (*ptr2 == '>' && ptr2[1] != '>' && *ptr1 == 0) -+ return 1; -+ if (*ptr2 == '>' && ptr2[1] != '>') -+ return 0; -+ if (*ptr2 == '>') -+ ptr2++; -+ if (*ptr1 != *ptr2) -+ return 0; -+ if (*ptr1 == 0) -+ return 1; -+ ptr1++; -+ ptr2++; -+ } -+} -+ - /* Get the first entry number from the value of the environment variable NAME, - which is a space-separated list of non-negative integers. The entry number - which is returned is stripped from the value of NAME. If no entry number - can be found, -1 is returned. */ - static int --get_and_remove_first_entry_number (const char *name) -+get_and_remove_first_entry_number (grub_menu_t menu, const char *name) - { - const char *val; - char *tail; -@@ -182,9 +205,32 @@ get_and_remove_first_entry_number (const char *name) - - entry = (int) grub_strtoul (val, &tail, 0); - -+ if (grub_errno == GRUB_ERR_BAD_NUMBER) -+ { -+ /* See if the variable matches the title of a menu entry. */ -+ grub_menu_entry_t e = menu->entry_list; -+ int i; -+ -+ grub_errno = GRUB_ERR_NONE; -+ -+ for (i = 0; e; i++) -+ { -+ if (menuentry_eq (e->title, val) -+ || menuentry_eq (e->id, val)) -+ { -+ entry = i; -+ break; -+ } -+ e = e->next; -+ } -+ -+ if (! e) -+ entry = -1; -+ } -+ - if (grub_errno == GRUB_ERR_NONE) - { -- /* Skip whitespace to find the next digit. */ -+ /* Skip whitespace to find the next entry. */ - while (*tail && grub_isspace (*tail)) - tail++; - grub_env_set (name, tail); -@@ -347,7 +393,7 @@ grub_menu_execute_with_fallback (grub_menu_t menu, - grub_menu_execute_entry (entry, 1); - - /* Deal with fallback entries. */ -- while ((fallback_entry = get_and_remove_first_entry_number ("fallback")) -+ while ((fallback_entry = get_and_remove_first_entry_number (menu, "fallback")) - >= 0) - { - grub_print_error (); -@@ -465,30 +511,6 @@ grub_menu_register_viewer (struct grub_menu_viewer *viewer) - viewers = viewer; - } - --static int --menuentry_eq (const char *id, const char *spec) --{ -- const char *ptr1, *ptr2; -- ptr1 = id; -- ptr2 = spec; -- while (1) -- { -- if (*ptr2 == '>' && ptr2[1] != '>' && *ptr1 == 0) -- return 1; -- if (*ptr2 == '>' && ptr2[1] != '>') -- return 0; -- if (*ptr2 == '>') -- ptr2++; -- if (*ptr1 != *ptr2) -- return 0; -- if (*ptr1 == 0) -- return 1; -- ptr1++; -- ptr2++; -- } --} -- -- - /* Get the entry number from the variable NAME. */ - static int - get_entry_number (grub_menu_t menu, const char *name) --- -1.9.3 - diff --git a/SOURCES/0001-Fix-exit-back-to-EFI-firmware.patch b/SOURCES/0001-Fix-exit-back-to-EFI-firmware.patch deleted file mode 100644 index f8e7595..0000000 --- a/SOURCES/0001-Fix-exit-back-to-EFI-firmware.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a919488cc979e1c4f5bd468bb97c6e9562af0e5a Mon Sep 17 00:00:00 2001 -From: Fedora Ninjas -Date: Fri, 15 Aug 2014 11:29:22 -0400 -Subject: [PATCH] Fix exit back to EFI firmware - -Arm/AArch64 machines set up a timer event which is not getting -canceled when returning to firmware. This is because grub_exit() -calls grub_efi_fini() instead of grub_machine_fini(). The latter -will shutdown the timer (and other machine-specific things) as -well as make the call to grub_efi_fini(). ---- - grub-core/kern/arm/efi/init.c | 2 +- - grub-core/kern/efi/efi.c | 3 ++- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c -index 0c17d83..06df60e 100644 ---- a/grub-core/kern/arm/efi/init.c -+++ b/grub-core/kern/arm/efi/init.c -@@ -67,7 +67,7 @@ grub_machine_fini (int flags) - - b = grub_efi_system_table->boot_services; - -- efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0); -+ efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0); - efi_call_1 (b->close_event, tmr_evt); - - grub_efi_fini (); -diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 394e9fd..1e96754 100644 ---- a/grub-core/kern/efi/efi.c -+++ b/grub-core/kern/efi/efi.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* The handle of GRUB itself. Filled in by the startup code. */ - grub_efi_handle_t grub_efi_image_handle; -@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) - void - grub_exit (void) - { -- grub_efi_fini (); -+ grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); - efi_call_4 (grub_efi_system_table->boot_services->exit, - grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0); - for (;;) ; --- -1.9.3 - diff --git a/SOURCES/0001-Fix-up-some-man-pages-rpmdiff-noticed.patch b/SOURCES/0001-Fix-up-some-man-pages-rpmdiff-noticed.patch deleted file mode 100644 index f2e555d..0000000 --- a/SOURCES/0001-Fix-up-some-man-pages-rpmdiff-noticed.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 92faf6ed3b60067fe3fea3a51c62f20880c91b94 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 23 Sep 2014 09:58:49 -0400 -Subject: [PATCH] Fix up some man pages rpmdiff noticed. - ---- - configure.ac | 2 ++ - util/grub-macbless.8 | 26 +++++++++++++++++++ - util/grub-mkimage.1 | 2 +- - util/grub-syslinux2cfg.1 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 94 insertions(+), 1 deletion(-) - create mode 100644 util/grub-macbless.8 - create mode 100644 util/grub-syslinux2cfg.1 - -diff --git a/configure.ac b/configure.ac -index 53fd7c7..048ce7c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -76,6 +76,7 @@ grub_TRANSFORM([grub-fstest.3]) - grub_TRANSFORM([grub-glue-efi.3]) - grub_TRANSFORM([grub-install.1]) - grub_TRANSFORM([grub-kbdcomp.3]) -+grub_TRANSFORM([grub-macbless.8]) - grub_TRANSFORM([grub-menulst2cfg.1]) - grub_TRANSFORM([grub-mkconfig.1]) - grub_TRANSFORM([grub-mkfont.3]) -@@ -93,6 +94,7 @@ grub_TRANSFORM([grub-render-label.3]) - grub_TRANSFORM([grub-script-check.3]) - grub_TRANSFORM([grub-set-default.1]) - grub_TRANSFORM([grub-sparc64-setup.3]) -+grub_TRANSFORM([grub-syslinux2cfg.1]) - - # Optimization flag. Allow user to override. - if test "x$TARGET_CFLAGS" = x; then -diff --git a/util/grub-macbless.8 b/util/grub-macbless.8 -new file mode 100644 -index 0000000..ae842f3 ---- /dev/null -+++ b/util/grub-macbless.8 -@@ -0,0 +1,26 @@ -+.TH GRUB-MACBLESS 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-macbless\fR \(em Mac-style bless utility for HFS or HFS+ -+ -+.SH SYNOPSIS -+\fBgrub-macbless\fR [-p | --ppc] [-v | --verbose] [-x | --x86] \fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-mkimage\fR blesses a file on an HFS or HFS+ file system, so that it -+can be used to boot a Mac. -+ -+.SH OPTIONS -+.TP -+--ppc -+Bless the file for use on PPC-based Macs. -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+--x86 -+Bless the file for use on x86-based Macs. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 -index 4dea4f5..0eaaafe 100644 ---- a/util/grub-mkimage.1 -+++ b/util/grub-mkimage.1 -@@ -17,7 +17,7 @@ - [-v | --verbose] \fIMODULES\fR - - .SH DESCRIPTION --\fBgrub-mkimage\fI builds a bootable image of GRUB. -+\fBgrub-mkimage\fR builds a bootable image of GRUB. - - .SH OPTIONS - .TP -diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1 -new file mode 100644 -index 0000000..8530948 ---- /dev/null -+++ b/util/grub-syslinux2cfg.1 -@@ -0,0 +1,65 @@ -+.TH GRUB-SYSLINUX2CFG 1 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-syslinux2cfg\fR \(em Transform a syslinux config file into a GRUB config. -+ -+.SH SYNOPSIS -+\fBgrub-syslinux2cfg\fR [-c | --cwd=\fRDIR\fI] [-r | --root=\fIDIR\fR] [-v | --verbose] -+.RE -+.RS 25 -+[-t | --target-root=\fIDIR\fR] [-T | --target-cwd=\fIDIR\fR] -+.RE -+.RS 25 -+[-o | --output=\fIFILE\fR] [[-i | --isolinux] | -+.RE -+.RS 46 -+ [-s | --syslinux] | -+.RE -+.RS 46 -+ [-p | --pxelinux]] \fIFILE\fR -+ -+.SH DESCRIPTION -+\fBgrub-syslinux2cfg\fR builds a GRUB configuration file out of an existing -+syslinux configuration file. -+ -+.SH OPTIONS -+.TP -+--cwd=\fIDIR\fR -+Set \fIDIR\fR as syslinux's working directory. The default is to use the -+parent directory of the input file. -+ -+.TP -+--root=\fIDIR\fR -+Set \fIDIR\fR as the root directory of the syslinux disk. The default value -+is "/". -+ -+.TP -+--verbose -+Print verbose messages. -+ -+.TP -+--target-root=\fIDIR\fR -+Root directory as it will be seen at runtime. The default value is "/". -+ -+.TP -+--target-cwd=\fIDIR\fR -+Working directory of syslinux as it will be seen at runtime. The default -+value is the parent directory of the input file. -+ -+.TP -+--output=\fIFILE\fR -+Write the new config file to \fIFILE\fR. The default value is standard output. -+ -+.TP -+--isolinux -+Assume that the input file is an isolinux configuration file. -+ -+.TP -+--pxelinux -+Assume that the input file is a pxelinux configuration file. -+ -+.TP -+--syslinux -+Assume that the input file is a syslinux configuration file. -+ -+.SH SEE ALSO -+.BR "info grub" --- -1.9.3 - diff --git a/SOURCES/0001-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/SOURCES/0001-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch deleted file mode 100644 index 6cff382..0000000 --- a/SOURCES/0001-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 6c49dab7f960e77a7025cf697b3432bbf480ac96 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 4 Sep 2014 14:23:23 -0400 -Subject: [PATCH] Generate OS and CLASS in 10_linux from /etc/os-release - -This makes us use pretty names in the titles we generate in -grub2-mkconfig when GRUB_DISTRIBUTOR isn't set. - -Resolves: rhbz#996794 - -Signed-off-by: Peter Jones ---- - util/grub.d/10_linux.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 6480cd6..ede7175 100644 ---- a/util/grub.d/10_linux.in -+++ b/util/grub.d/10_linux.in -@@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" - CLASS="--class gnu-linux --class gnu --class os --unrestricted" - - if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then -- OS="$(sed 's, release .*$,,g' /etc/system-release)" -+ OS="$(eval $(grep PRETTY_NAME /etc/os-release) ; echo ${PRETTY_NAME})" -+ CLASS="--class $(eval $(grep '^ID_LIKE=\|^ID=' /etc/os-release) ; [ -n "${ID_LIKE}" ] && echo ${ID_LIKE} || echo ${ID}) ${CLASS}" - else - OS="${GRUB_DISTRIBUTOR}" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" --- -1.9.3 - diff --git a/SOURCES/0001-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch b/SOURCES/0001-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch deleted file mode 100644 index 9b610b0..0000000 --- a/SOURCES/0001-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 3cb3d2a07b11c95b3f8a908ae9d43eabef4dcf62 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Wed, 17 Sep 2014 15:13:14 -0500 -Subject: [PATCH 1/2] Initialized initrd_ctx so we don't free a random pointer - from the stack. - -Currently, if "linux" fails, the "goto fail;" in grub_cmd_initrd sends us -into grub_initrd_close() without grub_initrd_init() being called, and thus -it never clears initrd_ctx->components. grub_initrd_close() then frees that -address, which is stale data from the stack. If the stack happens to have a -stale *address* there that matches a recent allocation, then you'll get a -double free later. - -So initialize the memory up front. - -Signed-off-by: Peter Jones ---- - grub-core/loader/arm/linux.c | 2 +- - grub-core/loader/arm64/linux.c | 2 +- - grub-core/loader/i386/linux.c | 2 +- - grub-core/loader/i386/pc/linux.c | 2 +- - grub-core/loader/ia64/efi/linux.c | 2 +- - grub-core/loader/mips/linux.c | 2 +- - grub-core/loader/powerpc/ieee1275/linux.c | 2 +- - grub-core/loader/sparc64/ieee1275/linux.c | 2 +- - 8 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c -index e6770d9..62cbe75 100644 ---- a/grub-core/loader/arm/linux.c -+++ b/grub-core/loader/arm/linux.c -@@ -396,7 +396,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - { - grub_file_t file; - grub_size_t size = 0; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index f1d10a1..0dc144e 100644 ---- a/grub-core/loader/arm64/linux.c -+++ b/grub-core/loader/arm64/linux.c -@@ -328,7 +328,7 @@ static grub_err_t - grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) - { -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - int initrd_size, initrd_pages; - void *initrd_mem = NULL; - -diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 31fb91e..2ae1763 100644 ---- a/grub-core/loader/i386/linux.c -+++ b/grub-core/loader/i386/linux.c -@@ -1050,7 +1050,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - grub_addr_t addr_min, addr_max; - grub_addr_t addr; - grub_err_t err; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - { -diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 672c013..b481e46 100644 ---- a/grub-core/loader/i386/pc/linux.c -+++ b/grub-core/loader/i386/pc/linux.c -@@ -388,7 +388,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - grub_uint8_t *initrd_chunk; - grub_addr_t initrd_addr; - grub_err_t err; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - { -diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c -index 87ac49f..eb78e6e 100644 ---- a/grub-core/loader/ia64/efi/linux.c -+++ b/grub-core/loader/ia64/efi/linux.c -@@ -568,7 +568,7 @@ static grub_err_t - grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) - { -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - { -diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c -index ef64a5b..4a3e8c5 100644 ---- a/grub-core/loader/mips/linux.c -+++ b/grub-core/loader/mips/linux.c -@@ -415,7 +415,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - void *initrd_src; - grub_addr_t initrd_dest; - grub_err_t err; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); -diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c -index 4a14f66..787d7dc 100644 ---- a/grub-core/loader/powerpc/ieee1275/linux.c -+++ b/grub-core/loader/powerpc/ieee1275/linux.c -@@ -333,7 +333,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - grub_size_t size = 0; - grub_addr_t first_addr; - grub_addr_t addr; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - { -diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c -index de6ee2f..c5e8dfa 100644 ---- a/grub-core/loader/sparc64/ieee1275/linux.c -+++ b/grub-core/loader/sparc64/ieee1275/linux.c -@@ -373,7 +373,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), - grub_addr_t paddr; - grub_addr_t addr; - int ret; -- struct grub_linux_initrd_context initrd_ctx; -+ struct grub_linux_initrd_context initrd_ctx = { 0, }; - - if (argc == 0) - { --- -1.9.3 - diff --git a/SOURCES/0001-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/SOURCES/0001-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch deleted file mode 100644 index 96a33e7..0000000 --- a/SOURCES/0001-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +++ /dev/null @@ -1,33 +0,0 @@ -From de35b045e49e54a3823cfa2edbd35e131d266304 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 4 Sep 2014 15:52:08 -0400 -Subject: [PATCH] Minimize the sort ordering for .debug and -rescue- kernels. - -Resolves: rhbz#1065360 -Signed-off-by: Peter Jones ---- - util/grub-mkconfig_lib.in | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 14fadbc..e9a71b4 100644 ---- a/util/grub-mkconfig_lib.in -+++ b/util/grub-mkconfig_lib.in -@@ -248,6 +248,14 @@ version_test_gt () - *.old:*.old) ;; - *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; - *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; -+ *-rescue-*:*-rescue-*) ;; -+ *.debug:*.debug) ;; -+ *-rescue-*:*.debug) return 1 ;; -+ *.debug:*-rescue-*) return 0 ;; -+ *-rescue-*:*) return 1 ;; -+ *:*-rescue-*) return 0 ;; -+ *.debug:*) return 1 ;; -+ *:*.debug) return 0 ;; - esac - version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" - return "$?" --- -1.9.3 - diff --git a/SOURCES/0001-Try-prefix-if-fw_path-doesn-t-work.patch b/SOURCES/0001-Try-prefix-if-fw_path-doesn-t-work.patch deleted file mode 100644 index 56c6774..0000000 --- a/SOURCES/0001-Try-prefix-if-fw_path-doesn-t-work.patch +++ /dev/null @@ -1,211 +0,0 @@ -From b5adb83344dfeb6ff142dc41bd2a82d29029c1c2 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Fri, 3 Oct 2014 11:08:03 -0400 -Subject: [PATCH] Try $prefix if $fw_path doesn't work. - -Related: rhbz#1148652 - -Signed-off-by: Peter Jones ---- - grub-core/kern/ieee1275/init.c | 30 ++++++----- - grub-core/net/net.c | 2 +- - grub-core/normal/main.c | 118 ++++++++++++++++++++--------------------- - 3 files changed, 75 insertions(+), 75 deletions(-) - -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 8191f8c..8ca4bf7 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -131,23 +131,25 @@ grub_machine_get_bootlocation (char **device, char **path) - grub_free (canon); - } - else -- *device = grub_ieee1275_encode_devname (bootpath); -- grub_free (type); -- -- filename = grub_ieee1275_get_filename (bootpath); -- if (filename) - { -- char *lastslash = grub_strrchr (filename, '\\'); -- -- /* Truncate at last directory. */ -- if (lastslash) -+ filename = grub_ieee1275_get_filename (bootpath); -+ if (filename) - { -- *lastslash = '\0'; -- grub_translate_ieee1275_path (filename); -- -- *path = filename; -- } -+ char *lastslash = grub_strrchr (filename, '\\'); -+ -+ /* Truncate at last directory. */ -+ if (lastslash) -+ { -+ *lastslash = '\0'; -+ grub_translate_ieee1275_path (filename); -+ -+ *path = filename; -+ } -+ } -+ *device = grub_ieee1275_encode_devname (bootpath); - } -+ -+ grub_free (type); - grub_free (bootpath); - } - -diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 578e057..10bfed3 100644 ---- a/grub-core/net/net.c -+++ b/grub-core/net/net.c -@@ -1817,7 +1817,7 @@ grub_net_search_configfile (char *config) - /* Remove the remaining minus sign at the end. */ - config[config_len] = '\0'; - -- return GRUB_ERR_NONE; -+ return GRUB_ERR_FILE_NOT_FOUND; - } - - static struct grub_preboot *fini_hnd; -diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 4190985..aa14499 100644 ---- a/grub-core/normal/main.c -+++ b/grub-core/normal/main.c -@@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config) - grub_boot_time ("Exiting normal mode"); - } - -+static grub_err_t -+grub_try_normal (const char *variable) -+{ -+ char *config; -+ const char *prefix; -+ grub_err_t err = GRUB_ERR_FILE_NOT_FOUND; -+ -+ prefix = grub_env_get (variable); -+ if (!prefix) -+ return GRUB_ERR_FILE_NOT_FOUND; -+ -+ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) -+ { -+ 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) -+ return GRUB_ERR_FILE_NOT_FOUND; -+ -+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); -+ err = grub_net_search_configfile (config); -+ } -+ -+ if (err != GRUB_ERR_NONE) -+ { -+ config = grub_xasprintf ("%s/grub.cfg", prefix); -+ if (config) -+ { -+ grub_file_t file; -+ file = grub_file_open (config); -+ if (file) -+ { -+ grub_file_close (file); -+ err = GRUB_ERR_NONE; -+ } -+ } -+ } -+ -+ if (err == GRUB_ERR_NONE) -+ grub_enter_normal_mode (config); -+ -+ grub_errno = 0; -+ grub_free (config); -+ return err; -+} -+ - /* Enter normal mode from rescue mode. */ - static grub_err_t - grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), - int argc, char *argv[]) - { -- if (argc == 0) -+ if (argc) -+ grub_enter_normal_mode (argv[0]); -+ else - { -- /* 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; -- -- prefix = grub_env_get ("fw_path"); -- if (! prefix) -- prefix = grub_env_get ("prefix"); -- -- if (prefix) -- { -- if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) -- { -- 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); -- -- grub_net_search_configfile (config); -- -- grub_enter_normal_mode (config); -- grub_free (config); -- config = NULL; -- } -- -- if (!config) -- { -- config = grub_xasprintf ("%s/grub.cfg", prefix); -- 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); -- } -- } -- } -- else -- { -- grub_enter_normal_mode (0); -- } -+ /* Guess the config filename. */ -+ grub_err_t err; -+ err = grub_try_normal ("fw_path"); -+ if (err == GRUB_ERR_FILE_NOT_FOUND) -+ err = grub_try_normal ("prefix"); -+ if (err == GRUB_ERR_FILE_NOT_FOUND) -+ grub_enter_normal_mode (0); - } -- else -- grub_enter_normal_mode (argv[0]); - --quit: - return 0; - } - --- -1.9.3 - diff --git a/SOURCES/0001-Update-info-with-grub.cfg-netboot-selection-order-11.patch b/SOURCES/0001-Update-info-with-grub.cfg-netboot-selection-order-11.patch deleted file mode 100644 index 538f9f9..0000000 --- a/SOURCES/0001-Update-info-with-grub.cfg-netboot-selection-order-11.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 24f034631df06b2f33d0721b8cd5126906aa7b34 Mon Sep 17 00:00:00 2001 -From: Robert Marshall -Date: Mon, 16 Mar 2015 16:34:51 -0400 -Subject: [PATCH 1/2] Update info with grub.cfg netboot selection order - (#1148650) - -Added documentation to the grub info page that specifies the order -netboot clients will use to select a grub configuration file. - -Resolves rhbz#1148650 ---- - docs/grub.texi | 42 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 42 insertions(+) - -diff --git a/docs/grub.texi b/docs/grub.texi -index 6b112c1..ef09c83 100644 ---- a/docs/grub.texi -+++ b/docs/grub.texi -@@ -2414,6 +2414,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 - Then follow instructions printed out by grub-mknetdir on configuring your DHCP - server. - -+The grub.cfg file is placed in the same directory as the path output by -+grub-mknetdir hereafter referred to as FWPATH. GRUB will search for its -+configuration files in order using the following rules where the appended -+value corresponds to a value on the client machine. -+ -+@example -+@group -+@samp{(FWPATH)}/grub.cfg-@samp{(UUID OF NIC)} -+@samp{(FWPATH)}/grub.cfg-@samp{(MAC ADDRESS OF NIC)} -+@samp{(FWPATH)}/grub.cfg-@samp{(IPv4 OR IPv6 ADDRESS)} -+@samp{(FWPATH)}/grub.cfg -+@end group -+@end example -+ -+The client will only attempt to look up an IPv6 address config once, however, -+it will try the IPv4 multiple times. The concrete example below shows what -+would happen under the IPv4 case. -+ -+@example -+@group -+UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a -+MAC: 52:54:00:ec:33:81 -+IPV4: 10.0.0.130 (0A000082) -+@end group -+@end example -+ -+@example -+@group -+@samp{(FWPATH)}/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a -+@samp{(FWPATH)}/grub.cfg-52-54-00-ec-33-81 -+@samp{(FWPATH)}/grub.cfg-0A000082 -+@samp{(FWPATH)}/grub.cfg-0A00008 -+@samp{(FWPATH)}/grub.cfg-0A0000 -+@samp{(FWPATH)}/grub.cfg-0A000 -+@samp{(FWPATH)}/grub.cfg-0A00 -+@samp{(FWPATH)}/grub.cfg-0A0 -+@samp{(FWPATH)}/grub.cfg-0A -+@samp{(FWPATH)}/grub.cfg-0 -+@samp{(FWPATH)}/grub.cfg -+@end group -+@end example -+ - After GRUB has started, files on the TFTP server will be accessible via the - @samp{(tftp)} device. - --- -2.4.3 - diff --git a/SOURCES/0001-centos-grub2-password-fix.patch b/SOURCES/0001-centos-grub2-password-fix.patch deleted file mode 100644 index ac0966b..0000000 --- a/SOURCES/0001-centos-grub2-password-fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b6370991cc254737d07d04d2dca4fef1215e2536 Mon Sep 17 00:00:00 2001 -From: Johnny Hughes -Date: Tue, 15 Dec 2015 12:26:48 -0600 -Subject: [PATCH] centos grub2-password fix - ---- - util/grub-setpassword.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index dd76f00..a322dfb 100755 ---- a/util/grub-setpassword.in -+++ b/util/grub-setpassword.in -@@ -1,7 +1,7 @@ - #!/bin/sh -e - - if [ -d /sys/firmware/efi/efivars/ ]; then -- grubdir=`echo "/@bootdirname@/efi/EFI/redhat/" | sed 's,//*,/,g'` -+ grubdir=`echo "/@bootdirname@/efi/EFI/centos/" | sed 's,//*,/,g'` - else - grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'` - fi --- -1.8.3.1 - diff --git a/SOURCES/0001-efidisk-move-device-path-helpers-in-core-for-efinet.patch b/SOURCES/0001-efidisk-move-device-path-helpers-in-core-for-efinet.patch deleted file mode 100644 index 90de69d..0000000 --- a/SOURCES/0001-efidisk-move-device-path-helpers-in-core-for-efinet.patch +++ /dev/null @@ -1,207 +0,0 @@ -From 559b04c2e29643b73f238cf95add8cef9a192a00 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Thu, 7 May 2015 20:37:16 +0300 -Subject: [PATCH 01/17] efidisk: move device path helpers in core for efinet - ---- - grub-core/disk/efi/efidisk.c | 61 ++++++++------------------------------------ - grub-core/kern/efi/efi.c | 41 +++++++++++++++++++++++++++++ - include/grub/efi/efi.h | 4 +++ - 3 files changed, 55 insertions(+), 51 deletions(-) - -diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index 3b12c34..845c66f 100644 ---- a/grub-core/disk/efi/efidisk.c -+++ b/grub-core/disk/efi/efidisk.c -@@ -43,47 +43,6 @@ static struct grub_efidisk_data *fd_devices; - static struct grub_efidisk_data *hd_devices; - static struct grub_efidisk_data *cd_devices; - --/* Duplicate a device path. */ --static grub_efi_device_path_t * --duplicate_device_path (const grub_efi_device_path_t *dp) --{ -- grub_efi_device_path_t *p; -- grub_size_t total_size = 0; -- -- for (p = (grub_efi_device_path_t *) dp; -- ; -- p = GRUB_EFI_NEXT_DEVICE_PATH (p)) -- { -- total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); -- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) -- break; -- } -- -- p = grub_malloc (total_size); -- if (! p) -- return 0; -- -- grub_memcpy (p, dp, total_size); -- return p; --} -- --/* Return the device path node right before the end node. */ --static grub_efi_device_path_t * --find_last_device_path (const grub_efi_device_path_t *dp) --{ -- grub_efi_device_path_t *next, *p; -- -- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) -- return 0; -- -- for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); -- ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); -- p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) -- ; -- -- return p; --} -- - static struct grub_efidisk_data * - make_devices (void) - { -@@ -110,7 +69,7 @@ make_devices (void) - if (! dp) - continue; - -- ldp = find_last_device_path (dp); -+ ldp = grub_efi_find_last_device_path (dp); - if (! ldp) - /* This is empty. Why? */ - continue; -@@ -150,11 +109,11 @@ find_parent_device (struct grub_efidisk_data *devices, - grub_efi_device_path_t *dp, *ldp; - struct grub_efidisk_data *parent; - -- dp = duplicate_device_path (d->device_path); -+ dp = grub_efi_duplicate_device_path (d->device_path); - if (! dp) - return 0; - -- ldp = find_last_device_path (dp); -+ ldp = grub_efi_find_last_device_path (dp); - ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; - ldp->length = sizeof (*ldp); -@@ -180,11 +139,11 @@ is_child (struct grub_efidisk_data *child, - grub_efi_device_path_t *dp, *ldp; - int ret; - -- dp = duplicate_device_path (child->device_path); -+ dp = grub_efi_duplicate_device_path (child->device_path); - if (! dp) - return 0; - -- ldp = find_last_device_path (dp); -+ ldp = grub_efi_find_last_device_path (dp); - ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; - ldp->length = sizeof (*ldp); -@@ -207,8 +166,8 @@ add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d) - { - int ret; - -- ret = grub_efi_compare_device_paths (find_last_device_path ((*p)->device_path), -- find_last_device_path (d->device_path)); -+ ret = grub_efi_compare_device_paths (grub_efi_find_last_device_path ((*p)->device_path), -+ grub_efi_find_last_device_path (d->device_path)); - if (ret == 0) - ret = grub_efi_compare_device_paths ((*p)->device_path, - d->device_path); -@@ -795,7 +754,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) - if (! dp) - return 0; - -- ldp = find_last_device_path (dp); -+ ldp = grub_efi_find_last_device_path (dp); - if (! ldp) - return 0; - -@@ -811,14 +770,14 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) - - /* It is necessary to duplicate the device path so that GRUB - can overwrite it. */ -- dup_dp = duplicate_device_path (dp); -+ dup_dp = grub_efi_duplicate_device_path (dp); - if (! dup_dp) - return 0; - - while (1) - { - grub_efi_device_path_t *dup_ldp; -- dup_ldp = find_last_device_path (dup_dp); -+ dup_ldp = grub_efi_find_last_device_path (dup_dp); - if (!(GRUB_EFI_DEVICE_PATH_TYPE (dup_ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE - && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE - || GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) -diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index d99a6fb..c80d85b 100644 ---- a/grub-core/kern/efi/efi.c -+++ b/grub-core/kern/efi/efi.c -@@ -423,6 +423,47 @@ grub_efi_get_device_path (grub_efi_handle_t handle) - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); - } - -+/* Return the device path node right before the end node. */ -+grub_efi_device_path_t * -+grub_efi_find_last_device_path (const grub_efi_device_path_t *dp) -+{ -+ grub_efi_device_path_t *next, *p; -+ -+ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) -+ return 0; -+ -+ for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); -+ ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); -+ p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) -+ ; -+ -+ return p; -+} -+ -+/* Duplicate a device path. */ -+grub_efi_device_path_t * -+grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp) -+{ -+ grub_efi_device_path_t *p; -+ grub_size_t total_size = 0; -+ -+ for (p = (grub_efi_device_path_t *) dp; -+ ; -+ p = GRUB_EFI_NEXT_DEVICE_PATH (p)) -+ { -+ total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); -+ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) -+ break; -+ } -+ -+ p = grub_malloc (total_size); -+ if (! p) -+ return 0; -+ -+ grub_memcpy (p, dp, total_size); -+ return p; -+} -+ - static void - dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor) - { -diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index a000c38..2245632 100644 ---- a/include/grub/efi/efi.h -+++ b/include/grub/efi/efi.h -@@ -56,6 +56,10 @@ void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp); - char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); - grub_efi_device_path_t * - EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); -+grub_efi_device_path_t * -+EXPORT_FUNC(grub_efi_find_last_device_path) (const grub_efi_device_path_t *dp); -+grub_efi_device_path_t * -+EXPORT_FUNC(grub_efi_duplicate_device_path) (const grub_efi_device_path_t *dp); - grub_err_t EXPORT_FUNC (grub_efi_finish_boot_services) (grub_efi_uintn_t *outbuf_size, void *outbuf, - grub_efi_uintn_t *map_key, - grub_efi_uintn_t *efi_desc_size, --- -2.4.3 - diff --git a/SOURCES/0001-fix-EFI-detection-on-Windows.patch b/SOURCES/0001-fix-EFI-detection-on-Windows.patch index 0a6daba..0e9c5ab 100644 --- a/SOURCES/0001-fix-EFI-detection-on-Windows.patch +++ b/SOURCES/0001-fix-EFI-detection-on-Windows.patch @@ -1,7 +1,7 @@ -From a6e7719bbe05993613a8de69dba14fa092144925 Mon Sep 17 00:00:00 2001 +From ba80a1fbdd780c9731067d83a68f50232a721614 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Wed, 25 Dec 2013 22:36:28 +0400 -Subject: [PATCH 001/143] fix EFI detection on Windows +Subject: [PATCH 001/198] fix EFI detection on Windows We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns zero) *and* extended error information is ERROR_INVALID_FUNCTION. @@ -39,5 +39,5 @@ index f2b9d71..d217efe 100644 platform = PLAT_BIOS; return; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0002-Load-arm-with-SB-enabled.patch b/SOURCES/0002-Load-arm-with-SB-enabled.patch deleted file mode 100644 index e77569f..0000000 --- a/SOURCES/0002-Load-arm-with-SB-enabled.patch +++ /dev/null @@ -1,436 +0,0 @@ -From e396fd48c78901459f39926fe28c9fbc38ffdddb Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 18 Sep 2014 11:26:14 -0400 -Subject: [PATCH] Load arm with SB enabled. - -Make sure we actually try to validate secure boot on this platform (even -though we're not shipping it enabled by default.) - -This means giving the kernel grub's loaded image as the vehicle for the -kernel command line, because we can't call systab->bs->LoadImage() if SB -is enabled. ---- - grub-core/Makefile.core.def | 2 + - grub-core/loader/arm64/linux.c | 108 ++++++++++++++++++++------------------ - grub-core/loader/efi/linux.c | 65 +++++++++++++++++++++++ - grub-core/loader/i386/efi/linux.c | 39 ++------------ - include/grub/arm64/linux.h | 8 +++ - include/grub/efi/linux.h | 31 +++++++++++ - 6 files changed, 166 insertions(+), 87 deletions(-) - create mode 100644 grub-core/loader/efi/linux.c - create mode 100644 include/grub/efi/linux.h - -diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 9ff9ae5..9378c73 100644 ---- a/grub-core/Makefile.core.def -+++ b/grub-core/Makefile.core.def -@@ -1682,6 +1682,7 @@ module = { - ia64_efi = loader/ia64/efi/linux.c; - arm = loader/arm/linux.c; - arm64 = loader/arm64/linux.c; -+ arm64 = loader/efi/linux.c; - fdt = lib/fdt.c; - common = loader/linux.c; - common = lib/cmdline.c; -@@ -1718,6 +1719,7 @@ module = { - name = linuxefi; - efi = loader/i386/efi/linux.c; - efi = lib/cmdline.c; -+ efi = loader/efi/linux.c; - enable = i386_efi; - enable = x86_64_efi; - }; -diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 0dc144e..bdd9c9b 100644 ---- a/grub-core/loader/arm64/linux.c -+++ b/grub-core/loader/arm64/linux.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -44,6 +45,7 @@ static int loaded; - - static void *kernel_addr; - static grub_uint64_t kernel_size; -+static grub_uint32_t handover_offset; - - static char *linux_args; - static grub_uint32_t cmdline_size; -@@ -135,7 +137,9 @@ finalize_params (void) - { - grub_efi_boot_services_t *b; - grub_efi_status_t status; -+ grub_efi_loaded_image_t *loaded_image = NULL; - int node, retval; -+ int len; - - get_fdt (); - if (!fdt) -@@ -172,6 +176,23 @@ finalize_params (void) - grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", - fdt); - -+ /* Convert command line to UCS-2 */ -+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ if (!loaded_image) -+ goto failure; -+ -+ loaded_image->load_options_size = len = -+ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); -+ loaded_image->load_options = -+ grub_efi_allocate_pages (0, -+ BYTES_TO_PAGES (loaded_image->load_options_size)); -+ if (!loaded_image->load_options) -+ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters"); -+ -+ loaded_image->load_options_size = -+ 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, -+ (grub_uint8_t *) linux_args, len, NULL); -+ - return GRUB_ERR_NONE; - - failure: -@@ -181,6 +202,23 @@ failure: - return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); - } - -+static void -+free_params (void) -+{ -+ grub_efi_loaded_image_t *loaded_image = NULL; -+ -+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ if (loaded_image) -+ { -+ if (loaded_image->load_options) -+ grub_efi_free_pages ((grub_efi_physical_address_t) -+ loaded_image->load_options, -+ BYTES_TO_PAGES (loaded_image->load_options_size)); -+ loaded_image->load_options = NULL; -+ loaded_image->load_options_size = 0; -+ } -+} -+ - static grub_err_t - grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) -@@ -199,6 +237,10 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), - if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); - -+ if (grub_efi_secure_boot ()) -+ return grub_error (GRUB_ERR_INVALID_COMMAND, -+ N_("Not loading devicetree - Secure Boot is enabled")); -+ - if (loaded_fdt) - grub_free (loaded_fdt); - loaded_fdt = NULL; -@@ -243,65 +285,20 @@ out: - static grub_err_t - grub_linux_boot (void) - { -- grub_efi_memory_mapped_device_path_t *mempath; -- grub_efi_handle_t image_handle; -- grub_efi_boot_services_t *b; -- grub_efi_status_t status; - grub_err_t retval; -- grub_efi_loaded_image_t *loaded_image; -- int len; - - retval = finalize_params(); - if (retval != GRUB_ERR_NONE) - return retval; - -- mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); -- if (!mempath) -- return grub_errno; -- -- mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE; -- mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; -- mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); -- mempath[0].memory_type = GRUB_EFI_LOADER_DATA; -- mempath[0].start_address = (grub_addr_t) kernel_addr; -- mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size; -- -- mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; -- mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -- mempath[1].header.length = sizeof (grub_efi_device_path_t); -- -- b = grub_efi_system_table->boot_services; -- status = b->load_image (0, grub_efi_image_handle, -- (grub_efi_device_path_t *) mempath, -- kernel_addr, kernel_size, &image_handle); -- if (status != GRUB_EFI_SUCCESS) -- return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); -- - grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); - -- /* Convert command line to UCS-2 */ -- loaded_image = grub_efi_get_loaded_image (image_handle); -- loaded_image->load_options_size = len = -- (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); -- loaded_image->load_options = -- grub_efi_allocate_pages (0, -- BYTES_TO_PAGES (loaded_image->load_options_size)); -- if (!loaded_image->load_options) -- return grub_errno; -+ retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, -+ kernel_addr); - -- loaded_image->load_options_size = -- 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, -- (grub_uint8_t *) linux_args, len, NULL); -- -- grub_dprintf("linux", "starting image %p\n", image_handle); -- status = b->start_image (image_handle, 0, NULL); -- -- /* When successful, not reached */ -- b->unload_image (image_handle); -- grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, -- BYTES_TO_PAGES (loaded_image->load_options_size)); -- -- return grub_errno; -+ /* Never reached... */ -+ free_params(); -+ return retval; - } - - static grub_err_t -@@ -382,6 +379,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - { - grub_file_t file = 0; - struct grub_arm64_linux_kernel_header lh; -+ struct grub_arm64_linux_pe_header *pe; - - grub_dl_ref (my_mod); - -@@ -426,6 +424,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - - grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); - -+ if (!grub_linuxefi_secure_validate (kernel_addr, kernel_size)) -+ { -+ grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); -+ goto fail; -+ } -+ -+ pe = (void *)((unsigned long)kernel_addr + lh.hdr_offset); -+ handover_offset = pe->opt.entry_addr; -+ - cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE); - linux_args = grub_malloc (cmdline_size); - if (!linux_args) -@@ -464,7 +471,6 @@ fail: - return grub_errno; - } - -- - static grub_command_t cmd_linux, cmd_initrd, cmd_devicetree; - - GRUB_MOD_INIT (linux) -diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -new file mode 100644 -index 0000000..aea378a ---- /dev/null -+++ b/grub-core/loader/efi/linux.c -@@ -0,0 +1,65 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2014 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 -+ -+#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; -+ -+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 *, void *); -+ -+grub_err_t -+grub_efi_linux_boot (void *kernel_addr, grub_off_t offset, -+ void *kernel_params) -+{ -+ handover_func hf; -+ -+ hf = (handover_func)((char *)kernel_addr + offset); -+ hf (grub_efi_image_handle, grub_efi_system_table, kernel_params); -+ -+ return GRUB_ERR_BUG; -+} -diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index b79e632..e5b7785 100644 ---- a/grub-core/loader/i386/efi/linux.c -+++ b/grub-core/loader/i386/efi/linux.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - - GRUB_MOD_LICENSE ("GPLv3+"); - -@@ -40,52 +41,18 @@ 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; -+ return grub_efi_linux_boot ((char *)kernel_mem, handover_offset + offset, -+ params); - } - - static grub_err_t -diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index 864e5dc..2cbd64f 100644 ---- a/include/grub/arm64/linux.h -+++ b/include/grub/arm64/linux.h -@@ -20,6 +20,7 @@ - #define GRUB_LINUX_CPU_HEADER 1 - - #include -+#include - - #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ - -@@ -38,4 +39,11 @@ struct grub_arm64_linux_kernel_header - grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ - }; - -+struct grub_arm64_linux_pe_header -+{ -+ grub_uint32_t magic; -+ struct grub_pe32_coff_header coff; -+ struct grub_pe64_optional_header opt; -+}; -+ - #endif /* ! GRUB_LINUX_CPU_HEADER */ -diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h -new file mode 100644 -index 0000000..d9ede36 ---- /dev/null -+++ b/include/grub/efi/linux.h -@@ -0,0 +1,31 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2014 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 . -+ */ -+#ifndef GRUB_EFI_LINUX_HEADER -+#define GRUB_EFI_LINUX_HEADER 1 -+ -+#include -+#include -+#include -+ -+grub_efi_boolean_t -+EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); -+grub_err_t -+EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, -+ void *kernel_param); -+ -+#endif /* ! GRUB_EFI_LINUX_HEADER */ --- -1.9.3 - diff --git a/SOURCES/0002-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/SOURCES/0002-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch deleted file mode 100644 index 3b4aa57..0000000 --- a/SOURCES/0002-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +++ /dev/null @@ -1,450 +0,0 @@ -From 57df7233ae3789f525b8d7e910bf1e3ffe50ac87 Mon Sep 17 00:00:00 2001 -From: Robert Marshall -Date: Mon, 16 Mar 2015 14:14:19 -0400 -Subject: [PATCH 2/2] Use Distribution Package Sort for grub2-mkconfig - (#1124074) - -Users reported that newly installed kernels on their systems installed -with grub-mkconfig would not appear on the grub boot list in order -starting with the most recent. Added an option for rpm-based systems to -use the rpm-sort library to sort kernels instead. - -Resolves rhbz#1124074 ---- - .gitignore | 1 + - Makefile.util.def | 16 +++ - configure.ac | 29 +++++ - util/grub-mkconfig_lib.in | 8 +- - util/grub-rpm-sort.8 | 12 ++ - util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ - 6 files changed, 346 insertions(+), 1 deletion(-) - create mode 100644 util/grub-rpm-sort.8 - create mode 100644 util/grub-rpm-sort.c - -diff --git a/.gitignore b/.gitignore -index 18ab8e8..b6c4577 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -237,6 +237,7 @@ po/POTFILES.in - po/POTFILES-shell.in - /grub-glue-efi - /grub-render-label -+grub-rpm-sort - /grub-glue-efi.exe - /grub-render-label.exe - grub-core/gnulib/locale.h -diff --git a/Makefile.util.def b/Makefile.util.def -index 87029a1..3ac7572 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -675,6 +675,22 @@ program = { - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - }; - -+program = { -+ name = grub-rpm-sort; -+ mansection = 8; -+ installdir = sbin; -+ -+ common = grub-core/kern/emu/misc.c; -+ common = grub-core/kern/emu/argp_common.c; -+ common = grub-core/osdep/init.c; -+ common = util/misc.c; -+ common = util/grub-rpm-sort.c; -+ -+ ldadd = grub-core/gnulib/libgnu.a; -+ ldadd = libgrubkern.a; -+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; -+}; -+ - script = { - name = grub-mkconfig; - common = util/grub-mkconfig.in; -diff --git a/configure.ac b/configure.ac -index 048ce7c..de17e65 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) - grub_TRANSFORM([grub-mkrescue]) - grub_TRANSFORM([grub-probe]) - grub_TRANSFORM([grub-reboot]) -+grub_TRANSFORM([grub-rpm-sort]) - grub_TRANSFORM([grub-script-check]) - grub_TRANSFORM([grub-set-default]) - grub_TRANSFORM([grub-sparc64-setup]) -@@ -89,6 +90,7 @@ grub_TRANSFORM([grub-mkrescue.1]) - grub_TRANSFORM([grub-mkstandalone.3]) - grub_TRANSFORM([grub-ofpathname.3]) - grub_TRANSFORM([grub-probe.3]) -+grub_TRANSFORM([grub-rpm-sort.8]) - grub_TRANSFORM([grub-reboot.3]) - grub_TRANSFORM([grub-render-label.3]) - grub_TRANSFORM([grub-script-check.3]) -@@ -1543,6 +1545,33 @@ fi - - AC_SUBST([LIBDEVMAPPER]) - -+AC_ARG_ENABLE([rpm-sort], -+ [AS_HELP_STRING([--enable-rpm-sort], -+ [enable native rpm sorting of kernels in grub (default=guessed)])]) -+if test x"$enable_rpm-sort" = xno ; then -+ rpm_sort_excuse="explicitly disabled" -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ # Check for rpmlib header. -+ AC_CHECK_HEADER([rpm/rpmlib.h], [], -+ [rpm_sort_excuse="need rpm/rpmlib header"]) -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ # Check for rpm library. -+ AC_CHECK_LIB([rpm], [rpmvercmp], [], -+ [rpm_sort_excuse="rpmlib missing rpmvercmp"]) -+fi -+ -+if test x"$rpm_sort_excuse" = x ; then -+ LIBRPM="-lrpm"; -+ AC_DEFINE([HAVE_RPM], [1], -+ [Define to 1 if you have the rpm library.]) -+fi -+ -+AC_SUBST([LIBRPM]) -+ - LIBGEOM= - if test x$host_kernel = xkfreebsd; then - AC_CHECK_LIB([geom], [geom_gettree], [], -diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 5c9ed84..e85b60c 100644 ---- a/util/grub-mkconfig_lib.in -+++ b/util/grub-mkconfig_lib.in -@@ -213,6 +213,12 @@ version_sort () - esac - } - -+if [ "x$RPMLIB" = x ]; then -+ kernel_sort=version_sort -+else -+ kernel_sort="${sbindir}/grub-rpm-sort" -+fi -+ - version_test_numeric () - { - version_test_numeric_a="$1" -@@ -229,7 +235,7 @@ version_test_numeric () - version_test_numeric_a="$version_test_numeric_b" - version_test_numeric_b="$version_test_numeric_c" - fi -- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then -+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then - return 0 - else - return 1 -diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 -new file mode 100644 -index 0000000..8ce2148 ---- /dev/null -+++ b/util/grub-rpm-sort.8 -@@ -0,0 +1,12 @@ -+.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" -+.SH NAME -+\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. -+ -+.SH SYNOPSIS -+\fBgrub-rpm-sort\fR [OPTIONS]. -+ -+.SH DESCRIPTION -+You should not normally run this program directly. Use grub-mkconfig instead. -+ -+.SH SEE ALSO -+.BR "info grub" -diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c -new file mode 100644 -index 0000000..f33bd1e ---- /dev/null -+++ b/util/grub-rpm-sort.c -@@ -0,0 +1,281 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static size_t -+read_file (const char *input, char **ret) -+{ -+ FILE *in; -+ size_t s; -+ size_t sz = 2048; -+ size_t offset = 0; -+ char *text; -+ -+ if (!strcmp(input, "-")) -+ in = stdin; -+ else -+ in = grub_util_fopen(input, "r"); -+ -+ text = xmalloc (sz); -+ -+ if (!in) -+ grub_util_error (_("cannot open `%s': %s"), input, strerror (errno)); -+ -+ while ((s = fread (text + offset, 1, sz - offset, in)) != 0) -+ { -+ offset += s; -+ if (sz - offset == 0) -+ { -+ sz += 2048; -+ text = xrealloc (text, sz); -+ } -+ } -+ -+ text[offset] = '\0'; -+ *ret = text; -+ -+ if (in != stdin) -+ fclose(in); -+ -+ return offset + 1; -+} -+ -+/* returns name/version/release */ -+/* NULL string pointer returned if nothing found */ -+static void -+split_package_string (char *package_string, char **name, -+ char **version, char **release) -+{ -+ char *package_version, *package_release; -+ -+ /* Release */ -+ package_release = strrchr (package_string, '-'); -+ -+ if (package_release != NULL) -+ *package_release++ = '\0'; -+ -+ *release = package_release; -+ -+ /* Version */ -+ package_version = strrchr(package_string, '-'); -+ -+ if (package_version != NULL) -+ *package_version++ = '\0'; -+ -+ *version = package_version; -+ /* Name */ -+ *name = package_string; -+ -+ /* Bubble up non-null values from release to name */ -+ if (*name == NULL) -+ { -+ *name = (*version == NULL ? *release : *version); -+ *version = *release; -+ *release = NULL; -+ } -+ if (*version == NULL) -+ { -+ *version = *release; -+ *release = NULL; -+ } -+} -+ -+/* -+ * package name-version-release comparator for qsort -+ * expects p, q which are pointers to character strings (char *) -+ * which will not be altered in this function -+ */ -+static int -+package_version_compare (const void *p, const void *q) -+{ -+ char *local_p, *local_q; -+ char *lhs_name, *lhs_version, *lhs_release; -+ char *rhs_name, *rhs_version, *rhs_release; -+ int vercmpflag = 0; -+ -+ local_p = alloca (strlen (*(char * const *)p) + 1); -+ local_q = alloca (strlen (*(char * const *)q) + 1); -+ -+ /* make sure these allocated */ -+ assert (local_p); -+ assert (local_q); -+ -+ strcpy (local_p, *(char * const *)p); -+ strcpy (local_q, *(char * const *)q); -+ -+ split_package_string (local_p, &lhs_name, &lhs_version, &lhs_release); -+ split_package_string (local_q, &rhs_name, &rhs_version, &rhs_release); -+ -+ /* Check Name and return if unequal */ -+ vercmpflag = rpmvercmp ((lhs_name == NULL ? "" : lhs_name), -+ (rhs_name == NULL ? "" : rhs_name)); -+ if (vercmpflag != 0) -+ return vercmpflag; -+ -+ /* Check version and return if unequal */ -+ vercmpflag = rpmvercmp ((lhs_version == NULL ? "" : lhs_version), -+ (rhs_version == NULL ? "" : rhs_version)); -+ if (vercmpflag != 0) -+ return vercmpflag; -+ -+ /* Check release and return the version compare value */ -+ vercmpflag = rpmvercmp ((lhs_release == NULL ? "" : lhs_release), -+ (rhs_release == NULL ? "" : rhs_release)); -+ -+ return vercmpflag; -+} -+ -+static void -+add_input (const char *filename, char ***package_names, size_t *n_package_names) -+{ -+ char *orig_input_buffer = NULL; -+ char *input_buffer; -+ char *position_of_newline; -+ char **names = *package_names; -+ char **new_names = NULL; -+ size_t n_names = *n_package_names; -+ -+ if (!*package_names) -+ new_names = names = xmalloc (sizeof (char *) * 2); -+ -+ if (read_file (filename, &orig_input_buffer) < 2) -+ { -+ if (new_names) -+ free (new_names); -+ if (orig_input_buffer) -+ free (orig_input_buffer); -+ return; -+ } -+ -+ input_buffer = orig_input_buffer; -+ while (input_buffer && *input_buffer && -+ (position_of_newline = strchrnul (input_buffer, '\n'))) -+ { -+ size_t sz = position_of_newline - input_buffer; -+ char *new; -+ -+ if (sz == 0) -+ { -+ input_buffer = position_of_newline + 1; -+ continue; -+ } -+ -+ new = xmalloc (sz+1); -+ strncpy (new, input_buffer, sz); -+ new[sz] = '\0'; -+ -+ names = xrealloc (names, sizeof (char *) * (n_names + 1)); -+ names[n_names] = new; -+ n_names++; -+ -+ /* move buffer ahead to next line */ -+ input_buffer = position_of_newline + 1; -+ if (*position_of_newline == '\0') -+ input_buffer = NULL; -+ } -+ -+ free (orig_input_buffer); -+ -+ *package_names = names; -+ *n_package_names = n_names; -+} -+ -+static char * -+help_filter (int key, const char *text, void *input __attribute__ ((unused))) -+{ -+ return (char *)text; -+} -+ -+static struct argp_option options[] = { -+ { 0, } -+}; -+ -+struct arguments -+{ -+ size_t ninputs; -+ size_t input_max; -+ char **inputs; -+}; -+ -+static error_t -+argp_parser (int key, char *arg, struct argp_state *state) -+{ -+ struct arguments *arguments = state->input; -+ switch (key) -+ { -+ case ARGP_KEY_ARG: -+ assert (arguments->ninputs < arguments->input_max); -+ arguments->inputs[arguments->ninputs++] = xstrdup (arg); -+ break; -+ default: -+ return ARGP_ERR_UNKNOWN; -+ } -+ return 0; -+} -+ -+static struct argp argp = { -+ options, argp_parser, N_("[INPUT_FILES]"), -+ N_("Sort a list of strings in RPM version sort order."), -+ NULL, help_filter, NULL -+}; -+ -+int -+main (int argc, char *argv[]) -+{ -+ struct arguments arguments; -+ char **package_names = NULL; -+ size_t n_package_names = 0; -+ int i; -+ -+ grub_util_host_init (&argc, &argv); -+ -+ memset (&arguments, 0, sizeof (struct arguments)); -+ arguments.input_max = argc+1; -+ arguments.inputs = xmalloc ((arguments.input_max + 1) -+ * sizeof (arguments.inputs[0])); -+ memset (arguments.inputs, 0, (arguments.input_max + 1) -+ * sizeof (arguments.inputs[0])); -+ -+ /* Parse our arguments */ -+ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) -+ grub_util_error ("%s", _("Error in parsing command line arguments\n")); -+ -+ /* If there's no inputs in argv, add one for stdin */ -+ if (!arguments.ninputs) -+ { -+ arguments.ninputs = 1; -+ arguments.inputs[0] = xmalloc (2); -+ strcpy(arguments.inputs[0], "-"); -+ } -+ -+ for (i = 0; i < arguments.ninputs; i++) -+ add_input(arguments.inputs[i], &package_names, &n_package_names); -+ -+ if (package_names == NULL || n_package_names < 1) -+ grub_util_error ("%s", _("Invalid input\n")); -+ -+ qsort (package_names, n_package_names, sizeof (char *), -+ package_version_compare); -+ -+ /* send sorted list to stdout */ -+ for (i = 0; i < n_package_names; i++) -+ { -+ fprintf (stdout, "%s\n", package_names[i]); -+ free (package_names[i]); -+ } -+ -+ free (package_names); -+ for (i = 0; i < arguments.ninputs; i++) -+ free (arguments.inputs[i]); -+ -+ free (arguments.inputs); -+ -+ return 0; -+} --- -2.4.3 - diff --git a/SOURCES/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch b/SOURCES/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch index f1371c2..c445f6a 100644 --- a/SOURCES/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch +++ b/SOURCES/0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch @@ -1,8 +1,8 @@ -From 5bda44d7f98c36f87144869ec58b518f80a69b56 Mon Sep 17 00:00:00 2001 +From 7f8c6d27243d44c2c9ab30be8deb723a1889ed96 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 25 Dec 2013 23:31:42 +0100 -Subject: [PATCH 002/143] * grub-core/kern/arm/cache_armv6.S: Remove - .arch directive. +Subject: [PATCH 002/198] * grub-core/kern/arm/cache_armv6.S: Remove .arch + directive. As these functions are used on pre-ARMv6 CPUs as well we don't want to make assembler assume that architecture is higher than default one. @@ -39,5 +39,5 @@ index 39da1df..dfaded0 100644 # define DMB mcr p15, 0, r0, c7, c10, 5 # define DSB mcr p15, 0, r0, c7, c10, 4 -- -1.9.3 +2.7.4 diff --git a/SOURCES/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch b/SOURCES/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch index 3e99253..c1aaa6e 100644 --- a/SOURCES/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch +++ b/SOURCES/0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch @@ -1,7 +1,7 @@ -From 8ebe593c564edc8ae62086df8a1448e898ef259b Mon Sep 17 00:00:00 2001 +From 37e5556489575b6a15c1367929596bb3636f03f4 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Dec 2013 03:03:32 +0000 -Subject: [PATCH 003/143] * INSTALL (Cross-compiling the GRUB): Fix some +Subject: [PATCH 003/198] * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. * docs/grub.texi (Getting the source code): Likewise. --- @@ -84,5 +84,5 @@ index c796850..7c6244c 100644 Once you have used @kbd{git clone} to fetch an initial copy of a branch, you -- -1.9.3 +2.7.4 diff --git a/SOURCES/0004-NEWS-First-draft-of-2.02-entry.patch b/SOURCES/0004-NEWS-First-draft-of-2.02-entry.patch index 8da2fba..bbce02d 100644 --- a/SOURCES/0004-NEWS-First-draft-of-2.02-entry.patch +++ b/SOURCES/0004-NEWS-First-draft-of-2.02-entry.patch @@ -1,7 +1,7 @@ -From c0e2febef52139e0e580e52f553bf3aa521e390c Mon Sep 17 00:00:00 2001 +From 990b8a55e4adbf26763df3c42320e7891cbd599e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 27 Dec 2013 03:05:38 +0000 -Subject: [PATCH 004/143] * NEWS: First draft of 2.02 entry. +Subject: [PATCH 004/198] * NEWS: First draft of 2.02 entry. --- ChangeLog | 4 +++ @@ -150,5 +150,5 @@ index 4bb5f98..577d9fd 100644 * Appearance: -- -1.9.3 +2.7.4 diff --git a/SOURCES/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch b/SOURCES/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch index 8c4bf80..d6dc886 100644 --- a/SOURCES/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch +++ b/SOURCES/0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch @@ -1,7 +1,7 @@ -From 9ee79da5bf54babe11178ced48470b5f09d3dda3 Mon Sep 17 00:00:00 2001 +From ac95c6068056617c16ae940855bd48803e4aa651 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 27 Dec 2013 11:20:37 +0100 -Subject: [PATCH 005/143] Merge branch 'master' of git.sv.gnu.org:/srv/git/grub +Subject: [PATCH 005/198] Merge branch 'master' of git.sv.gnu.org:/srv/git/grub Conflicts: ChangeLog @@ -39,5 +39,5 @@ index 82dc61d..da3c2df 100644 * grub-core/osdep/windows/platform.c (get_platform): Fix EFI -- -1.9.3 +2.7.4 diff --git a/SOURCES/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch b/SOURCES/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch index c9fb0c3..d26e865 100644 --- a/SOURCES/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +++ b/SOURCES/0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch @@ -1,8 +1,8 @@ -From 94763697f5f33614b7bd6da91707a27b6872b750 Mon Sep 17 00:00:00 2001 +From 5e5536c1c547f3d9969d87f345a93fb454086992 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 28 Dec 2013 02:20:27 +0000 -Subject: [PATCH 006/143] * NEWS: The cmosclean command in fact dates back to - 1.99. Remove mention of it from 2.02. +Subject: [PATCH 006/198] * NEWS: The cmosclean command in fact dates back to + 1.99. Remove mention of it from 2.02. --- ChangeLog | 5 +++++ @@ -37,5 +37,5 @@ index 577d9fd..b74c05f 100644 coreboot. * Improve opcode parsing in ACPI halt implementation. -- -1.9.3 +2.7.4 diff --git a/SOURCES/0007-remove-unused-error.h-from-kern-emu-misc.c.patch b/SOURCES/0007-remove-unused-error.h-from-kern-emu-misc.c.patch index 51973fa..820d517 100644 --- a/SOURCES/0007-remove-unused-error.h-from-kern-emu-misc.c.patch +++ b/SOURCES/0007-remove-unused-error.h-from-kern-emu-misc.c.patch @@ -1,7 +1,7 @@ -From 904bd6b3cb12977def4f940e90aca3fe557c3bb5 Mon Sep 17 00:00:00 2001 +From ccf0094aefd14d170c84209d3508f4dc6c97ff74 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 28 Dec 2013 09:01:20 +0400 -Subject: [PATCH 007/143] remove unused error.h from kern/emu/misc.c +Subject: [PATCH 007/198] remove unused error.h from kern/emu/misc.c Fixes compilation on mingw32, where include is apparently missing. --- @@ -35,5 +35,5 @@ index 43471b4..bb606da 100644 #include #include -- -1.9.3 +2.7.4 diff --git a/SOURCES/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch b/SOURCES/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch index 0cc4a19..2240317 100644 --- a/SOURCES/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch +++ b/SOURCES/0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch @@ -1,8 +1,8 @@ -From 23cd074c57ee6f35776fd5122a050bcef6c9eef5 Mon Sep 17 00:00:00 2001 +From 05a567228906c64062e4cbaa66245e15aea1b39d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 28 Dec 2013 17:25:14 +0100 -Subject: [PATCH 008/143] Don't abort() on unavailable coreboot tables - if not running on coreboot. +Subject: [PATCH 008/198] Don't abort() on unavailable coreboot tables if not + running on coreboot. --- ChangeLog | 4 ++++ @@ -66,5 +66,5 @@ index 6b150b4..3314f02 100644 grub_video_coreboot_fb_late_init (); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch b/SOURCES/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch index 5d4fbd5..a95a5a9 100644 --- a/SOURCES/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch +++ b/SOURCES/0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch @@ -1,8 +1,8 @@ -From 3eff91e86e4df2cf8a5e1b26f98e96bf4731f526 Mon Sep 17 00:00:00 2001 +From 7563f6fec775dbe32e99ff38788e1ff56dc1a61f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 30 Dec 2013 06:49:15 +0100 -Subject: [PATCH 009/143] * NEWS: Add few missing entries. Correct - existing ones. +Subject: [PATCH 009/198] * NEWS: Add few missing entries. Correct existing + ones. --- ChangeLog | 4 ++++ @@ -117,5 +117,5 @@ index b74c05f..49a2459 100644 * HFS string is now treated like mac-roman and not UTF-8 * HFS mtime support. -- -1.9.3 +2.7.4 diff --git a/SOURCES/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch b/SOURCES/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch index 991cf81..e11d0b2 100644 --- a/SOURCES/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch +++ b/SOURCES/0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch @@ -1,7 +1,7 @@ -From 9e9507d2e1eaed4fc2ebe2959c5405687485f613 Mon Sep 17 00:00:00 2001 +From 5274da98cb155276f8b692340ec6cc4e26beb9b4 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 30 Dec 2013 12:56:19 +0000 -Subject: [PATCH 010/143] strip .eh_frame section from arm64-efi kernel +Subject: [PATCH 010/198] strip .eh_frame section from arm64-efi kernel Fixes grub-mkimage error "relocation 0x105 is not implemented yet." --- @@ -35,5 +35,5 @@ index c916246..42443bc 100644 i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch b/SOURCES/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch index d48f82e..359aa94 100644 --- a/SOURCES/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch +++ b/SOURCES/0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch @@ -1,7 +1,7 @@ -From 7e782c6996ee433c94fb378cbc8db0fa0f663c84 Mon Sep 17 00:00:00 2001 +From e4a3de3ef6a122504b5fb47de1f4a1bd6295d49a Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 10:38:54 +0400 -Subject: [PATCH 011/143] use {grub,boot}aa64.efi for boot images on AArch64 +Subject: [PATCH 011/198] use {grub,boot}aa64.efi for boot images on AArch64 According to UEFI 2.4 specification, default boot file name on AArch64 is BOOTAA64.EFI (3.4.1.1 Removable Media Boot Behavior). Also set default @@ -33,5 +33,5 @@ index 8cfe0ea..4608b80 100644 default: efi_file = "grub.efi"; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch b/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch index 7a9bb92..a096051 100644 --- a/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch +++ b/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch @@ -1,7 +1,7 @@ -From afda7f47601f36a98074d8d21ffb640256f02267 Mon Sep 17 00:00:00 2001 +From 5978975d49a71ec60608f91bebbfe7410b5d6b19 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 18:43:02 +0400 -Subject: [PATCH 012/143] fix 32 bit compilation on MinGW-w64 +Subject: [PATCH 012/198] fix 32 bit compilation on MinGW-w64 Use _FILE_OFFSET_BITS macro to distinguish between native MinGW and 32 bit under MinGW-64. The latter does not require fseeko/ftello @@ -41,5 +41,5 @@ index 36615b2..79efcfa 100644 #endif -- -1.9.3 +2.7.4 diff --git a/SOURCES/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch b/SOURCES/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch index 059475c..6a0eda8 100644 --- a/SOURCES/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch +++ b/SOURCES/0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch @@ -1,7 +1,7 @@ -From 9981c4e3f366b4795655368a78baa058b18711c6 Mon Sep 17 00:00:00 2001 +From 637ab9f9d8415bb29cafbbec51d32916b3975061 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 7 Jan 2014 20:34:25 +0400 -Subject: [PATCH 013/143] Change grub-mkrescue to use bootaa64.efi too +Subject: [PATCH 013/198] Change grub-mkrescue to use bootaa64.efi too Also add ChangeLog entry for previous change. --- @@ -40,5 +40,5 @@ index 317879d..0d03e55 100644 imgname); free (imgname); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0014-arm64-set-correct-length-of-device-path-end-entry.patch b/SOURCES/0014-arm64-set-correct-length-of-device-path-end-entry.patch index d75c4d5..20352dc 100644 --- a/SOURCES/0014-arm64-set-correct-length-of-device-path-end-entry.patch +++ b/SOURCES/0014-arm64-set-correct-length-of-device-path-end-entry.patch @@ -1,7 +1,7 @@ -From f493e0d352e1e8ff8cbafee69878d00487a04808 Mon Sep 17 00:00:00 2001 +From dc589e298bf6aa12be88ef88ca95e90dee3a729a Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Tue, 7 Jan 2014 17:52:50 +0000 -Subject: [PATCH 014/143] arm64: set correct length of device path end entry +Subject: [PATCH 014/198] arm64: set correct length of device path end entry The length of the Device Path End entry in the grub_linux_boot() function was incorrectly set to 0. This triggers an assert failure @@ -39,5 +39,5 @@ index 9d15aad..75ad871 100644 b = grub_efi_system_table->boot_services; status = b->load_image (0, grub_efi_image_handle, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch b/SOURCES/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch index 01bee9d..0fbbcd7 100644 --- a/SOURCES/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch +++ b/SOURCES/0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch @@ -1,7 +1,7 @@ -From 1c0db34a9597ecccb3ad4899892fb6ff6e22304d Mon Sep 17 00:00:00 2001 +From 8dcec304d484c978c8cee9bada8bd0bfc8e73a79 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 8 Jan 2014 11:05:20 +0000 -Subject: [PATCH 015/143] * Makefile.util.def (grub-macbless): Change +Subject: [PATCH 015/198] * Makefile.util.def (grub-macbless): Change mansection to 8. --- @@ -35,5 +35,5 @@ index 985e76c..3c99be2 100644 common = grub-core/osdep/init.c; common = grub-core/kern/emu/argp_common.c; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch b/SOURCES/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch index 8e6278f..e0b361b 100644 --- a/SOURCES/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch +++ b/SOURCES/0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch @@ -1,7 +1,7 @@ -From 3aea6cc46177a90056ba60381e6387377fe40c99 Mon Sep 17 00:00:00 2001 +From 12cbfd02ce0d0dc29dfd11350478371243257f47 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sun, 12 Jan 2014 15:29:21 +0400 -Subject: [PATCH 016/143] add part_apple to EFI rescue image to fix missing +Subject: [PATCH 016/198] add part_apple to EFI rescue image to fix missing prefix On Mac rescue image is booted from HFS+ partition, so bootpath looks like @@ -44,5 +44,5 @@ index 0d03e55..34e0b7a 100644 if (source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]) { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch b/SOURCES/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch index 232b518..324225a 100644 --- a/SOURCES/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch +++ b/SOURCES/0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch @@ -1,7 +1,7 @@ -From a433d177585c8355c6ede67469a521d05cf1e9d7 Mon Sep 17 00:00:00 2001 +From 43f8e295a66a74093a967fb974f2b2b818c8a6ce Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 02:30:52 +0000 -Subject: [PATCH 017/143] freebsd/hostdisk.c is only ever compiled on FreeBSD +Subject: [PATCH 017/198] freebsd/hostdisk.c is only ever compiled on FreeBSD * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove redundant preprocessor conditional. @@ -44,5 +44,5 @@ index bd5fddb..eb202dc 100644 return ret; } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch b/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch index dc4fc53..3e9529b 100644 --- a/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch +++ b/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch @@ -1,7 +1,7 @@ -From 4ec08b960f6de1190dea9fe7e6ab3b4b249840e5 Mon Sep 17 00:00:00 2001 +From 14ef7cf251a04dc21aaf27cc4c0b6bc5e965262e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 15:24:50 +0000 -Subject: [PATCH 018/143] Prefer more portable test(1) constructs +Subject: [PATCH 018/198] Prefer more portable test(1) constructs * util/grub.d/00_header.in (make_timeout): Use && rather than test -a. @@ -105,5 +105,5 @@ index 0470e66..7cf8487 100644 continue fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0019-NEWS-Add-few-missing-entries.patch b/SOURCES/0019-NEWS-Add-few-missing-entries.patch index 260d72b..9b69923 100644 --- a/SOURCES/0019-NEWS-Add-few-missing-entries.patch +++ b/SOURCES/0019-NEWS-Add-few-missing-entries.patch @@ -1,7 +1,7 @@ -From e18da008f74a3c5f27a191e4f7be80c02a49f2fe Mon Sep 17 00:00:00 2001 +From 0d79deaca0a3fb60d9343ae282b34381b04bb471 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:31:10 +0100 -Subject: [PATCH 019/143] * NEWS: Add few missing entries. +Subject: [PATCH 019/198] * NEWS: Add few missing entries. --- ChangeLog | 4 ++++ @@ -96,5 +96,5 @@ index 49a2459..a61df94 100644 improvements to the build system. * Remove variable length arrays. -- -1.9.3 +2.7.4 diff --git a/SOURCES/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch b/SOURCES/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch index 92794b8..993a626 100644 --- a/SOURCES/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch +++ b/SOURCES/0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch @@ -1,8 +1,8 @@ -From 29c96f00677e1dd2a9df4de645a7f5fab7b736a1 Mon Sep 17 00:00:00 2001 +From a990af656571a24156a183dd8a09765e788c3b22 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:41:47 +0100 -Subject: [PATCH 020/143] * grub-core/kern/efi/efi.c: Ensure that the - result starts with / and has no //. +Subject: [PATCH 020/198] * grub-core/kern/efi/efi.c: Ensure that the result + starts with / and has no //. --- ChangeLog | 5 +++++ @@ -86,5 +86,5 @@ index b253141..b9eb1ab 100644 return name; } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch b/SOURCES/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch index b62d429..48a2610 100644 --- a/SOURCES/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch +++ b/SOURCES/0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch @@ -1,8 +1,8 @@ -From fa9e3a9aa30988c2339e9d05c81b5d91534f4049 Mon Sep 17 00:00:00 2001 +From 762b39fcff62416481f12d2002abf7cdb76adbf3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:43:29 +0100 -Subject: [PATCH 021/143] * util/grub-mount.c: Extend GCC warning - workaround to grub-mount. +Subject: [PATCH 021/198] * util/grub-mount.c: Extend GCC warning workaround to + grub-mount. --- ChangeLog | 4 ++++ @@ -43,5 +43,5 @@ index 118881e..19de2e6 100644 static const char *root = NULL; grub_device_t dev = NULL; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch b/SOURCES/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch index d46ca9d..29a550c 100644 --- a/SOURCES/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch +++ b/SOURCES/0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch @@ -1,7 +1,7 @@ -From 3bea802b45b9c98f70753370522fa6e47ba8966b Mon Sep 17 00:00:00 2001 +From a8fb484206d0cc509ba27b8214bdb512ba258702 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 19:50:54 +0400 -Subject: [PATCH 022/143] reintroduce BUILD_LDFLAGS for the cross-compile case +Subject: [PATCH 022/198] reintroduce BUILD_LDFLAGS for the cross-compile case This allows providing separate LDFLAGS for build and host environments, which are not necessary the same for cross-compile case. In particular, it allows @@ -149,5 +149,5 @@ index 1b3142d..13b7979 100644 # trigtables.c -- -1.9.3 +2.7.4 diff --git a/SOURCES/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch b/SOURCES/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch index ecd6686..1f74a12 100644 --- a/SOURCES/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch +++ b/SOURCES/0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch @@ -1,8 +1,7 @@ -From ac660e42875162e599f50c085cb646c633cf376d Mon Sep 17 00:00:00 2001 +From 59a8ad9fb81ae9dc665a153242a580e51c2fc9b1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 16:57:35 +0100 -Subject: [PATCH 023/143] * grub-core/term/terminfo.c: Recognize keys - F1-F12. +Subject: [PATCH 023/198] * grub-core/term/terminfo.c: Recognize keys F1-F12. --- ChangeLog | 4 +++ @@ -151,5 +150,5 @@ index 3d48b19..f0d3e3d 100644 } #undef CONTINUE_READ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0024-Fix-ChangeLog-date.patch b/SOURCES/0024-Fix-ChangeLog-date.patch index 7663147..c5a1815 100644 --- a/SOURCES/0024-Fix-ChangeLog-date.patch +++ b/SOURCES/0024-Fix-ChangeLog-date.patch @@ -1,7 +1,7 @@ -From 6e5cf6b00fa82e5a02135ea5e21230ee44c72087 Mon Sep 17 00:00:00 2001 +From 5e0b14595aa213e38740d5908493999cbe4206af Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:01:16 +0400 -Subject: [PATCH 024/143] Fix ChangeLog date +Subject: [PATCH 024/198] Fix ChangeLog date --- ChangeLog | 2 +- @@ -21,5 +21,5 @@ index bdfbf44..fcbf220 100644 * configure.ac: Add support for BUILD_LDFLAGS. * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... -- -1.9.3 +2.7.4 diff --git a/SOURCES/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch b/SOURCES/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch index 04f7e73..f4a3f25 100644 --- a/SOURCES/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch +++ b/SOURCES/0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch @@ -1,7 +1,7 @@ -From bb3e1a1e8448f3ea9489b5ebfcec799196bc862f Mon Sep 17 00:00:00 2001 +From d52c3c475935ab1b1da008f9523c297422145297 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:04:11 +0400 -Subject: [PATCH 025/143] Use _W64 to detect MinGW W64-32 instead of +Subject: [PATCH 025/198] Use _W64 to detect MinGW W64-32 instead of _FILE_OFFSET_BITS In 94cee4a4c201bb506377b2c26e072eee8cb19d6f I overlooked that config.h @@ -43,5 +43,5 @@ index 79efcfa..bf6451b 100644 #define ftello ftello64 #endif -- -1.9.3 +2.7.4 diff --git a/SOURCES/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch b/SOURCES/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch index 744c2a8..5a1ce90 100644 --- a/SOURCES/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch +++ b/SOURCES/0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch @@ -1,7 +1,7 @@ -From 5ac7afd762d11b4c91d5756222c3abf5862203de Mon Sep 17 00:00:00 2001 +From 6ae39452bb18fc5004f9d2bd8041a706e2532916 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 20:41:24 +0400 -Subject: [PATCH 026/143] add BUILD_EXEEXT support to fix make clean on Windows +Subject: [PATCH 026/198] add BUILD_EXEEXT support to fix make clean on Windows Add $(BUILD_EXEEXT) to ensure files are removed. Also add CLEANFILES where appropriate. @@ -170,5 +170,5 @@ index 13b7979..826b3dd 100644 # XXX Use Automake's LEX & YACC support -- -1.9.3 +2.7.4 diff --git a/SOURCES/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch b/SOURCES/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch index 76918fd..b6e6cd8 100644 --- a/SOURCES/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch +++ b/SOURCES/0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch @@ -1,7 +1,7 @@ -From 09194ac15b3c348cbf147e8ea27b982b57a7a778 Mon Sep 17 00:00:00 2001 +From 903a7b030c82d7e23acf89e2cd25ecd2138397bd Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 21:22:57 +0400 -Subject: [PATCH 027/143] fix include loop on MinGW due to libintl.h pulling +Subject: [PATCH 027/198] fix include loop on MinGW due to libintl.h pulling stdio.h In file included from ./include/grub/dl.h:23:0, @@ -277,5 +277,5 @@ index d393da7..8cc331d 100644 struct grub_procfs_entry { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch b/SOURCES/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch index 8180ce2..5215b05 100644 --- a/SOURCES/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch +++ b/SOURCES/0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch @@ -1,8 +1,8 @@ -From 9cbb9fc3d79e449affe7ed5e104aa828b72ad2cd Mon Sep 17 00:00:00 2001 +From c611b3a4ec67d3fd3886b9bb93ccc41a40de1955 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:26:40 +0100 -Subject: [PATCH 028/143] * grub-core/commands/macbless.c: Rename FILE - and DIR to avoid conflicts. +Subject: [PATCH 028/198] * grub-core/commands/macbless.c: Rename FILE and DIR + to avoid conflicts. Reported by: Andrey Borzenkov. --- @@ -57,5 +57,5 @@ index c521083..4724edd 100644 static grub_err_t -- -1.9.3 +2.7.4 diff --git a/SOURCES/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch b/SOURCES/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch index fcc5013..75c4682 100644 --- a/SOURCES/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch +++ b/SOURCES/0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch @@ -1,8 +1,8 @@ -From 6c3fa2da4fd22c3ebda0c6cf69f97d578c04e704 Mon Sep 17 00:00:00 2001 +From 0e1f799b78a8311319638e6a06a29385b3da0a82 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sat, 18 Jan 2014 19:41:15 +0100 -Subject: [PATCH 029/143] * Makefile.util.def: Link grub-ofpathname with - zfs libs. +Subject: [PATCH 029/198] * Makefile.util.def: Link grub-ofpathname with zfs + libs. --- ChangeLog | 4 ++++ @@ -35,5 +35,5 @@ index 83df212..a286a89 100644 program = { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch b/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch new file mode 100644 index 0000000..46ea7e0 --- /dev/null +++ b/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch @@ -0,0 +1,42 @@ +From 62d74eb68cebd48250469a1bfd4a042267fb04c9 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Sat, 18 Jan 2014 19:43:19 +0100 +Subject: [PATCH 030/198] * Makefile.am (default_payload.elf): Add modules + multiboot cbmemc linux16 gzio echo help. + +--- + ChangeLog | 7 ++++++- + Makefile.am | 2 +- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index edceb66..cff9386 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,4 +1,9 @@ +-2014-01-01 Mike Gilbert ++2014-01-18 Vladimir Serbinenko ++ ++ * Makefile.am (default_payload.elf): Add modules ++ multiboot cbmemc linux16 gzio echo help. ++ ++2014-01-18 Mike Gilbert + + * Makefile.util.def: Link grub-ofpathname with zfs libs. + +diff --git a/Makefile.am b/Makefile.am +index aa526f5..97c062d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -399,7 +399,7 @@ bootcheck: $(BOOTCHECKS) + + if COND_i386_coreboot + default_payload.elf: grub-mkstandalone grub-mkimage +- pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg ++ pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg + endif + + windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows +-- +2.7.4 + diff --git a/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules.patch b/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules.patch deleted file mode 100644 index 1f6c382..0000000 --- a/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3f6bd432acbf2244e6f4b83dd3a259392b10afb6 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Sat, 18 Jan 2014 19:43:19 +0100 -Subject: [PATCH 030/143] * Makefile.am (default_payload.elf): Add - modules multiboot cbmemc linux16 gzio echo help. - ---- - ChangeLog | 7 ++++++- - Makefile.am | 2 +- - 2 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/ChangeLog b/ChangeLog -index edceb66..cff9386 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,4 +1,9 @@ --2014-01-01 Mike Gilbert -+2014-01-18 Vladimir Serbinenko -+ -+ * Makefile.am (default_payload.elf): Add modules -+ multiboot cbmemc linux16 gzio echo help. -+ -+2014-01-18 Mike Gilbert - - * Makefile.util.def: Link grub-ofpathname with zfs libs. - -diff --git a/Makefile.am b/Makefile.am -index aa526f5..97c062d 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -399,7 +399,7 @@ bootcheck: $(BOOTCHECKS) - - if COND_i386_coreboot - default_payload.elf: grub-mkstandalone grub-mkimage -- pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg -+ pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg - endif - - windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows --- -1.9.3 - diff --git a/SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch b/SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch index 3b1a8c0..01fea1c 100644 --- a/SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch +++ b/SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch @@ -1,7 +1,7 @@ -From d0cf0d7dcd4813a168d2bd94ec77ee0ae8ff860e Mon Sep 17 00:00:00 2001 +From d173f8fd3046732a13ecefec5ada5129b828db20 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 22:48:04 +0400 -Subject: [PATCH 031/143] fix removal of {cpu,machine} links on mingw/msys +Subject: [PATCH 031/198] fix removal of {cpu,machine} links on mingw/msys At least on Windows 2003 using "ln -s dir1 dir2" in msys shell succeeds, but results in what looks like hard link. Subsequent "rm -f dir2" (e.g. @@ -51,5 +51,5 @@ index 32d5477..b2bb88d 100644 [link_dir=yes else -- -1.9.3 +2.7.4 diff --git a/SOURCES/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch b/SOURCES/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch index a11f833..94d3ddb 100644 --- a/SOURCES/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch +++ b/SOURCES/0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch @@ -1,8 +1,8 @@ -From 221f6e1ac22f66881276d4cb012d588ecfb17e47 Mon Sep 17 00:00:00 2001 +From 8a7b98011d7a26e4e73b8b772921e011e4da3aa1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:54:09 +0100 -Subject: [PATCH 032/143] * grub-core/normal/main.c (read_config_file): - Buffer config file. Reduces boot time. +Subject: [PATCH 032/198] * grub-core/normal/main.c (read_config_file): Buffer + config file. Reduces boot time. --- ChangeLog | 5 +++++ @@ -64,5 +64,5 @@ index c36663f..3a926fc 100644 if (ctmp) old_file = grub_strdup (ctmp); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch b/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch index 7e69b96..44c986d 100644 --- a/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch +++ b/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch @@ -1,7 +1,7 @@ -From d353b169aa6b2a9cd03d0c2987da7da059aa6f99 Mon Sep 17 00:00:00 2001 +From bd7b390604d6122afda2763345406fa880fa4fd7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 20:02:51 +0100 -Subject: [PATCH 033/143] * util/grub-install.c: Fix a typo. +Subject: [PATCH 033/198] * util/grub-install.c: Fix a typo. --- ChangeLog | 4 ++++ @@ -36,5 +36,5 @@ index 4608b80..5903f34 100644 if (disk_module && grub_strcmp (disk_module, "ata") == 0) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch b/SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch index 4a33b6c..65d6fe9 100644 --- a/SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch +++ b/SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch @@ -1,7 +1,7 @@ -From 85cc4b1abfed85fd8504da4acc391d5936de2812 Mon Sep 17 00:00:00 2001 +From de25a0fc647100d8d6639676d233c80149056070 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Jan 2014 23:15:40 +0400 -Subject: [PATCH 034/143] use MODULE_FILES for genemuinit* instead of MOD_FILES +Subject: [PATCH 034/198] use MODULE_FILES for genemuinit* instead of MOD_FILES MinGW native nm does not support ELF binaries. --- @@ -87,5 +87,5 @@ index 6b83f59..a99a15d 100644 fi done -- -1.9.3 +2.7.4 diff --git a/SOURCES/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch b/SOURCES/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch index 4bb4ccd..6e40406 100644 --- a/SOURCES/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch +++ b/SOURCES/0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch @@ -1,7 +1,7 @@ -From 97fca4331e317b0491912c3cf3d02a9fac96c419 Mon Sep 17 00:00:00 2001 +From 82366b73d1430f2ff2086401e09c88be1f170bd5 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Jan 2014 02:28:46 +0000 -Subject: [PATCH 035/143] Ignore EPERM when modifying kern.geom.debugflags +Subject: [PATCH 035/198] Ignore EPERM when modifying kern.geom.debugflags Many tests fail when run as a non-root user on FreeBSD. The failures all amount to an inability to open files using grub_util_fd_open, @@ -54,5 +54,5 @@ index eb202dc..6145d07 100644 ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0036-change-stop-condition-to-avoid-infinite-loops.patch b/SOURCES/0036-change-stop-condition-to-avoid-infinite-loops.patch index a065485..5d8fbcf 100644 --- a/SOURCES/0036-change-stop-condition-to-avoid-infinite-loops.patch +++ b/SOURCES/0036-change-stop-condition-to-avoid-infinite-loops.patch @@ -1,7 +1,7 @@ -From 547d1e84df5d57c7600ead4556d43d5dbbe33c4b Mon Sep 17 00:00:00 2001 +From d294c5d19587897546b91c4c75b2b64f42d7f391 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 21 Jan 2014 10:49:39 -0200 -Subject: [PATCH 036/143] change stop condition to avoid infinite loops +Subject: [PATCH 036/198] change stop condition to avoid infinite loops In net/net.c there is a while (1) that only exits if there is a stop condition and more then 10 packages or if there is no package received. @@ -48,5 +48,5 @@ index 0e57e93..56355f3 100644 /* Maybe should be better have a fixed number of packets for each card and just mark them as used and not used. */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0037-increase-network-try-interval-gradually.patch b/SOURCES/0037-increase-network-try-interval-gradually.patch index d85b797..5c33f43 100644 --- a/SOURCES/0037-increase-network-try-interval-gradually.patch +++ b/SOURCES/0037-increase-network-try-interval-gradually.patch @@ -1,7 +1,7 @@ -From d3652ff33623d842fc4422ffd98e4303795e9519 Mon Sep 17 00:00:00 2001 +From 734177c57499142bbdad947e8671cf1fbf4285ad Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 21 Jan 2014 11:03:51 -0200 -Subject: [PATCH 037/143] increase network try interval gradually +Subject: [PATCH 037/198] increase network try interval gradually * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try interval gradually. @@ -107,5 +107,5 @@ index de6259e..0e0a605 100644 #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch b/SOURCES/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch index 8599034..ffaf5e8 100644 --- a/SOURCES/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch +++ b/SOURCES/0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch @@ -1,7 +1,7 @@ -From 90d83cda679fef485f7bb1a318bd682c4eb86cb4 Mon Sep 17 00:00:00 2001 +From c972993cfa2c96a61e59f4729190e3b68a7651e0 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 19:29:33 +0400 -Subject: [PATCH 038/143] look for DejaVu also in /usr/share/fonts/truetype +Subject: [PATCH 038/198] look for DejaVu also in /usr/share/fonts/truetype It is installed in this path on openSUSE. --- @@ -35,5 +35,5 @@ index cf3de3b..120263e 100644 DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" break 2 -- -1.9.3 +2.7.4 diff --git a/SOURCES/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch b/SOURCES/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch index 7abb266..f722877 100644 --- a/SOURCES/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch +++ b/SOURCES/0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch @@ -1,7 +1,7 @@ -From 3e02e2fbd2089645ac2c482dad59318394b62252 Mon Sep 17 00:00:00 2001 +From 4342ee0cb790901801df4965b854fcd39cf1548c Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 19:41:11 +0400 -Subject: [PATCH 039/143] Show detected path to DejaVuSans in configure summary +Subject: [PATCH 039/198] Show detected path to DejaVuSans in configure summary --- ChangeLog | 1 + @@ -33,5 +33,5 @@ index 120263e..8888c2f 100644 echo starfield theme: No "($starfield_excuse)" fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch b/SOURCES/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch index 573b3b2..8658dc8 100644 --- a/SOURCES/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch +++ b/SOURCES/0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch @@ -1,7 +1,7 @@ -From 6e9483ee94033f4bb7b9a17bd032c4af4479abc0 Mon Sep 17 00:00:00 2001 +From 290dac0294fcf7a441e80f10a59ffdea61a1c422 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Tue, 21 Jan 2014 20:54:09 +0400 -Subject: [PATCH 040/143] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime +Subject: [PATCH 040/198] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime files Not all toolkits provide static libraries. This patch enables creation of self @@ -58,5 +58,5 @@ index 97c062d..f02ae0a 100644 EXTRA_DIST += linguas.sh -- -1.9.3 +2.7.4 diff --git a/SOURCES/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch b/SOURCES/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch index e89d938..8f95556 100644 --- a/SOURCES/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch +++ b/SOURCES/0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch @@ -1,7 +1,7 @@ -From 100e7015f7dcf2cee0c4ddbbd7498a67bac695d0 Mon Sep 17 00:00:00 2001 +From 2e763a9ee4ff7ec25c113b15cb41c11a5998505c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 23 Jan 2014 12:05:36 +0000 -Subject: [PATCH 041/143] * util/grub-install.c (write_to_disk): Add an info +Subject: [PATCH 041/198] * util/grub-install.c (write_to_disk): Add an info message. --- @@ -34,5 +34,5 @@ index 5903f34..787dc90 100644 core_size, core_img); free (core_img); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0042-util-grub-install.c-List-available-targets.patch b/SOURCES/0042-util-grub-install.c-List-available-targets.patch index c12e35d..6e56862 100644 --- a/SOURCES/0042-util-grub-install.c-List-available-targets.patch +++ b/SOURCES/0042-util-grub-install.c-List-available-targets.patch @@ -1,7 +1,7 @@ -From d25ddbcafa537525f606938df0e500c50a5e93e1 Mon Sep 17 00:00:00 2001 +From 535107794dc13438bd2cd0c298667a0eb430c839 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 24 Jan 2014 18:09:25 +0100 -Subject: [PATCH 042/143] * util/grub-install.c: List available targets. +Subject: [PATCH 042/198] * util/grub-install.c: List available targets. --- ChangeLog | 4 ++++ @@ -105,5 +105,5 @@ index 787dc90..2e6226a 100644 return xasprintf (text, program_name, GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME); default: -- -1.9.3 +2.7.4 diff --git a/SOURCES/0043-Fix-several-translatable-strings.patch b/SOURCES/0043-Fix-several-translatable-strings.patch index 3c25967..6bdf2fd 100644 --- a/SOURCES/0043-Fix-several-translatable-strings.patch +++ b/SOURCES/0043-Fix-several-translatable-strings.patch @@ -1,7 +1,7 @@ -From 2cd73ec6b2efeaff2bdcd40cce0cd3145d9e07d0 Mon Sep 17 00:00:00 2001 +From f39c9cfa5cb967d6176ee0d1988c2f1d754e7fec Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 24 Jan 2014 18:20:27 +0100 -Subject: [PATCH 043/143] Fix several translatable strings. +Subject: [PATCH 043/198] Fix several translatable strings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -74,5 +74,5 @@ index 5e944c2..f4fda6d 100644 {"output", 'o', N_("FILE"), 0, N_("write output to FILE [default=stdout]."), 0}, {"isolinux", 'i', 0, 0, N_("assume input is an isolinux configuration file."), 0}, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0044-do-not-set-default-prefix-in-grub-mkimage.patch b/SOURCES/0044-do-not-set-default-prefix-in-grub-mkimage.patch index 2caa0c9..946941a 100644 --- a/SOURCES/0044-do-not-set-default-prefix-in-grub-mkimage.patch +++ b/SOURCES/0044-do-not-set-default-prefix-in-grub-mkimage.patch @@ -1,7 +1,7 @@ -From 2b2a550c14e70d17af4140e64d08022ed170f0c8 Mon Sep 17 00:00:00 2001 +From d98c0be0194a7c0d618b87293f5fc926c09ee611 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 25 Jan 2014 19:54:51 +0400 -Subject: [PATCH 044/143] do not set default prefix in grub-mkimage +Subject: [PATCH 044/198] do not set default prefix in grub-mkimage Default prefix is likely wrong on Unix and completely wrong on Windows. Let caller set it explicitly to avoid any ambiguity. @@ -71,5 +71,5 @@ index a2bd4c1..1e0bcf1 100644 arguments.memdisk, arguments.pubkeys, arguments.npubkeys, arguments.config, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch b/SOURCES/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch index daf6702..55358ec 100644 --- a/SOURCES/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch +++ b/SOURCES/0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch @@ -1,7 +1,7 @@ -From 90efd351fa4f81df97473e1bb8c8234a801f8ebe Mon Sep 17 00:00:00 2001 +From 93dbdbb99181cfb0dc87955ddced6e05f18dee92 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 25 Jan 2014 21:49:41 +0400 -Subject: [PATCH 045/143] fix Mingw W64-32 cross compile failure due to printf +Subject: [PATCH 045/198] fix Mingw W64-32 cross compile failure due to printf redefinition in libintl.h In file included from util/misc.c:36:0: @@ -104,5 +104,5 @@ index 63ebb90..2b3322d 100644 f.close () fw.close () -- -1.9.3 +2.7.4 diff --git a/SOURCES/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch b/SOURCES/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch index 2d0824d..2949216 100644 --- a/SOURCES/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch +++ b/SOURCES/0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch @@ -1,9 +1,9 @@ -From c18e39b667adb11624f3f4162c1342b76712d655 Mon Sep 17 00:00:00 2001 +From db5ae694f5e18c847b0e0dbe9a3d2c95239a7d33 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 26 Jan 2014 02:36:05 +0100 -Subject: [PATCH 046/143] * grub-core/term/serial.c - (grub_serial_register): Fix invalid free. Ensure that pointers are - inited to NULL and that pointers are not accessed after free. +Subject: [PATCH 046/198] * grub-core/term/serial.c (grub_serial_register): Fix + invalid free. Ensure that pointers are inited to NULL and that pointers are + not accessed after free. --- ChangeLog | 5 +++++ @@ -56,5 +56,5 @@ index b581a76..c9b5574 100644 } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0047-grub-install-support-for-partitioned-partx-loop-devi.patch b/SOURCES/0047-grub-install-support-for-partitioned-partx-loop-devi.patch index 5a4df90..960e379 100644 --- a/SOURCES/0047-grub-install-support-for-partitioned-partx-loop-devi.patch +++ b/SOURCES/0047-grub-install-support-for-partitioned-partx-loop-devi.patch @@ -1,8 +1,8 @@ -From c889057e089d69bd187c8ba134c9669247744628 Mon Sep 17 00:00:00 2001 +From 5fc42eeb85e2971ea777fbe2c95e2b0d384bb86d Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Sun, 26 Jan 2014 02:56:04 +0100 -Subject: [PATCH 047/143] grub-install: support for partitioned partx - loop devices. +Subject: [PATCH 047/198] grub-install: support for partitioned partx loop + devices. * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect /dev/loopX as being the parent of /dev/loopXpY. @@ -51,5 +51,5 @@ index 772de0a..19581d3 100644 return path; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch b/SOURCES/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch index 2e2fe1a..15ce6c6 100644 --- a/SOURCES/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch +++ b/SOURCES/0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch @@ -1,8 +1,8 @@ -From 379cbd6233fe227544ff3073b60b295fe841b654 Mon Sep 17 00:00:00 2001 +From c10ca57b760978f32d1d34d78cda9fd57e1e0bfa Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 26 Jan 2014 03:31:10 +0100 -Subject: [PATCH 048/143] * grub-core/term/at_keyboard.c: Tolerate - missing keyboard. +Subject: [PATCH 048/198] * grub-core/term/at_keyboard.c: Tolerate missing + keyboard. --- ChangeLog | 4 ++++ @@ -36,5 +36,5 @@ index f5071ce..b4257e8 100644 { e0_received = 1; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0049-.gitignore-add-missing-files-and-.exe-variants.patch b/SOURCES/0049-.gitignore-add-missing-files-and-.exe-variants.patch index 71bc474..48253f7 100644 --- a/SOURCES/0049-.gitignore-add-missing-files-and-.exe-variants.patch +++ b/SOURCES/0049-.gitignore-add-missing-files-and-.exe-variants.patch @@ -1,7 +1,7 @@ -From 58ca3abc65a64d950d6da8b473e91f16d410f1ac Mon Sep 17 00:00:00 2001 +From 74b69fc18796030dc99ef0a8e55aa8560e431001 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 29 Jan 2014 13:26:00 -0200 -Subject: [PATCH 049/143] .gitignore: add missing files and .exe variants. +Subject: [PATCH 049/198] .gitignore: add missing files and .exe variants. --- .gitignore | 7 +++++++ @@ -69,5 +69,5 @@ index d37d4a6..a49f5f1 100644 2013-12-14 Vladimir Serbinenko -- -1.9.3 +2.7.4 diff --git a/SOURCES/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch b/SOURCES/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch index d67ef51..7c3537a 100644 --- a/SOURCES/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch +++ b/SOURCES/0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch @@ -1,8 +1,8 @@ -From f21c40f33c95d908cee32a5063f285d22574a507 Mon Sep 17 00:00:00 2001 +From 84dc1cb8eccdebe6529cf9e60f830fb6c57c7706 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:41:48 +0100 -Subject: [PATCH 050/143] * util/grub-mkfont.c: Downgrade warnings about - unhandled features to debug. +Subject: [PATCH 050/198] * util/grub-mkfont.c: Downgrade warnings about + unhandled features to debug. --- ChangeLog | 9 +++++++++ @@ -73,5 +73,5 @@ index 3cb02ad..3de07ee 100644 } } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch b/SOURCES/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch index ca6c86d..7903d50 100644 --- a/SOURCES/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch +++ b/SOURCES/0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch @@ -1,8 +1,8 @@ -From 5795341bb64a4e101d7c067d688b19a41dd50662 Mon Sep 17 00:00:00 2001 +From 6ff67fe45fcb69a278f5aaeeb5eebff3b7bb6dc2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:43:25 +0100 -Subject: [PATCH 051/143] * grub-core/disk/ahci.c: Do not enable I/O - decoding and keep enabling busmaster for the end. +Subject: [PATCH 051/198] * grub-core/disk/ahci.c: Do not enable I/O decoding + and keep enabling busmaster for the end. --- ChangeLog | 5 +++++ @@ -53,5 +53,5 @@ index 0b13fb8..18c1327 100644 if (adevs[i]) { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch b/SOURCES/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch index 8236481..64017b9 100644 --- a/SOURCES/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch +++ b/SOURCES/0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch @@ -1,8 +1,8 @@ -From 50cb0018044359180aa57e6aa7ec944def83bbcc Mon Sep 17 00:00:00 2001 +From d8b18f6b814a830dd1279669e10fb5f714e2138f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:45:18 +0100 -Subject: [PATCH 052/143] * grub-core/disk/ahci.c: Allocate and clean - space for all possible 32 slots to avoid pointing to uninited area. +Subject: [PATCH 052/198] * grub-core/disk/ahci.c: Allocate and clean space for + all possible 32 slots to avoid pointing to uninited area. --- ChangeLog | 5 +++++ @@ -51,5 +51,5 @@ index 18c1327..d63fd09 100644 = grub_dma_get_phys (adevs[i]->command_table_chunk); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch b/SOURCES/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch index 1c26b0b..7be2eb0 100644 --- a/SOURCES/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch +++ b/SOURCES/0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch @@ -1,7 +1,7 @@ -From 3f00de9c207fb4b3f9e45fd775650404ce087aac Mon Sep 17 00:00:00 2001 +From cbe41438563125a6f5aa4225c987b70abda81753 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:46:17 +0100 -Subject: [PATCH 053/143] * grub-core/disk/ahci.c: Add safety cleanups. +Subject: [PATCH 053/198] * grub-core/disk/ahci.c: Add safety cleanups. --- ChangeLog | 4 ++++ @@ -58,5 +58,5 @@ index d63fd09..643e691 100644 while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) if (grub_get_time_ms () > endtime) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch b/SOURCES/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch index 1dbe706..174aa86 100644 --- a/SOURCES/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch +++ b/SOURCES/0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch @@ -1,8 +1,8 @@ -From 5e8c619b17cdf70b30d37412738b149d80874c28 Mon Sep 17 00:00:00 2001 +From d0c3c16e995308838d724775cd8624a69907046e Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:49:51 +0100 -Subject: [PATCH 054/143] * grub-core/disk/ahci.c: Properly handle - transactions with no transferred data. +Subject: [PATCH 054/198] * grub-core/disk/ahci.c: Properly handle transactions + with no transferred data. --- ChangeLog | 5 +++++ @@ -50,5 +50,5 @@ index 643e691..fdd40c6 100644 | (parms->write ? GRUB_AHCI_CONFIG_WRITE : GRUB_AHCI_CONFIG_READ) | (parms->taskfile.cmd == 8 ? (1 << 8) : 0); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch b/SOURCES/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch index 0e135a8..e4e4043 100644 --- a/SOURCES/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch +++ b/SOURCES/0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch @@ -1,8 +1,8 @@ -From 45dd39fb467d061a550113fd5e5431209f0db73c Mon Sep 17 00:00:00 2001 +From 729607c36706453f0a035aa3261f1c2ff8ee8253 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 29 Jan 2014 23:50:49 +0100 -Subject: [PATCH 055/143] * grub-core/disk/ahci.c: Increase timeout. - Some SSDs take up to 7 seconds to recover if last poweroff was bad. +Subject: [PATCH 055/198] * grub-core/disk/ahci.c: Increase timeout. Some SSDs + take up to 7 seconds to recover if last poweroff was bad. --- ChangeLog | 5 +++++ @@ -38,5 +38,5 @@ index fdd40c6..5e4a639 100644 if (grub_get_time_ms () > endtime) { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch b/SOURCES/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch index b2dbf4f..2f6748a 100644 --- a/SOURCES/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch +++ b/SOURCES/0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch @@ -1,8 +1,8 @@ -From 767cf43a2e5c738df50155cc8729ad0f57d6ab47 Mon Sep 17 00:00:00 2001 +From 1e22128933aa895e18593039c5a70ecb4e081491 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 3 Feb 2014 14:34:27 +0100 -Subject: [PATCH 056/143] * util/grub-mkfont.c: Build fix for argp.h - with older gcc. +Subject: [PATCH 056/198] * util/grub-mkfont.c: Build fix for argp.h with older + gcc. --- ChangeLog | 4 ++++ @@ -38,5 +38,5 @@ index 3de07ee..e6485b4 100644 #include -- -1.9.3 +2.7.4 diff --git a/SOURCES/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch b/SOURCES/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch index 20ed6af..3059935 100644 --- a/SOURCES/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch +++ b/SOURCES/0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch @@ -1,8 +1,8 @@ -From 3365d3eb4062cee9581f3560ec3e93f8c8ababb2 Mon Sep 17 00:00:00 2001 +From 5d3c633229d54d0e3825fe0a9775858a93a664a7 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 3 Feb 2014 14:35:51 +0100 -Subject: [PATCH 057/143] * util/grub-mkrescue.c: Build fix for argp.h - with older gcc. +Subject: [PATCH 057/198] * util/grub-mkrescue.c: Build fix for argp.h with + older gcc. --- ChangeLog | 4 ++++ @@ -40,5 +40,5 @@ index 34e0b7a..e719839 100644 #include #include -- -1.9.3 +2.7.4 diff --git a/SOURCES/0058-add-grub_env_set_net_property-function.patch b/SOURCES/0058-add-grub_env_set_net_property-function.patch index 18e1201..2d32330 100644 --- a/SOURCES/0058-add-grub_env_set_net_property-function.patch +++ b/SOURCES/0058-add-grub_env_set_net_property-function.patch @@ -1,7 +1,7 @@ -From 533058df7c164a4d3498dfaa626923904597f162 Mon Sep 17 00:00:00 2001 +From dfbcd97b4207c2684fdf3cfe4292e0c96c65eed2 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 4 Feb 2014 18:41:38 -0200 -Subject: [PATCH 058/143] add grub_env_set_net_property function +Subject: [PATCH 058/198] add grub_env_set_net_property function * grub-core/net/bootp.c: Remove set_env_limn_ro. * grub-core/net/net.c: Add grub_env_set_net_property. @@ -195,5 +195,5 @@ index 0e0a605..538baa3 100644 grub_net_poll_cards (unsigned time, int *stop_condition); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch b/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch index b2bd212..6a067d9 100644 --- a/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch +++ b/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch @@ -1,7 +1,7 @@ -From 1a768cc5a65094e19c216caf92dd190317df25fc Mon Sep 17 00:00:00 2001 +From f44c6a2cdb0e1c211fd5effb78c70c12e6da2006 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 4 Feb 2014 19:00:55 -0200 -Subject: [PATCH 059/143] add bootpath parser for open firmware +Subject: [PATCH 059/198] add bootpath parser for open firmware It enables net boot even when there is no bootp/dhcp server. @@ -207,5 +207,5 @@ index dc54bea..8e42513 100644 /* Maps a device alias to a pathname. */ extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch b/SOURCES/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch index 52d68c3..376a334 100644 --- a/SOURCES/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch +++ b/SOURCES/0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch @@ -1,8 +1,8 @@ -From 7f4e3839c9b872f0981e1ecdecfa2bd91065f99c Mon Sep 17 00:00:00 2001 +From d92788a92466b22fb10c2d3f6c9c68d0002227b3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 20 Feb 2014 10:11:43 +0100 -Subject: [PATCH 060/143] * grub-core/disk/ahci.c: Ignore NPORTS field - and rely on PI exclusively. +Subject: [PATCH 060/198] * grub-core/disk/ahci.c: Ignore NPORTS field and rely + on PI exclusively. --- ChangeLog | 5 +++++ @@ -36,5 +36,5 @@ index 5e4a639..89365cd 100644 grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, hba->ports_implemented); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch b/SOURCES/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch index 11deb12..d6186e0 100644 --- a/SOURCES/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch +++ b/SOURCES/0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch @@ -1,8 +1,8 @@ -From c65d7e05498edecd560753768114b574f7c3543d Mon Sep 17 00:00:00 2001 +From 22a8b7bb4c77ba1ef1833e0dae052c108180250f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:47:57 +0100 -Subject: [PATCH 061/143] * grub-core/kern/i386/coreboot/mmap.c: Filter - out 0xa0000-0x100000 region. +Subject: [PATCH 061/198] * grub-core/kern/i386/coreboot/mmap.c: Filter out + 0xa0000-0x100000 region. --- ChangeLog | 5 +++++ @@ -78,5 +78,5 @@ index 1197975..4d29f6b 100644 return 0; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch b/SOURCES/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch index b98968e..64554c0 100644 --- a/SOURCES/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch +++ b/SOURCES/0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch @@ -1,8 +1,8 @@ -From 4530afc725782bbb92d4681fc338acebc4604b45 Mon Sep 17 00:00:00 2001 +From 2e42389be6fe6bb026a41fddae4bbce70658fdc9 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:48:57 +0100 -Subject: [PATCH 062/143] * grub-core/loader/i386/multiboot_mbi.c - (grub_multiboot_make_mbi): Limit location to 640K. +Subject: [PATCH 062/198] * grub-core/loader/i386/multiboot_mbi.c + (grub_multiboot_make_mbi): Limit location to 640K. --- ChangeLog | 5 +++++ @@ -38,5 +38,5 @@ index 7431aa4..f10c087 100644 GRUB_RELOCATOR_PREFERENCE_NONE, 0); if (err) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch b/SOURCES/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch index a2820a8..763652b 100644 --- a/SOURCES/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch +++ b/SOURCES/0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch @@ -1,8 +1,8 @@ -From e85cc7078e669509d3a22c4e76f94cdd53335fff Mon Sep 17 00:00:00 2001 +From 623002084c7550214ae9740547a557ffb31c3658 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 09:50:47 +0100 -Subject: [PATCH 063/143] * grub-core/mmap/i386/uppermem.c (lower_hook) - [COREBOOT]: Ignore low tables for low memory calculations. +Subject: [PATCH 063/198] * grub-core/mmap/i386/uppermem.c (lower_hook) + [COREBOOT]: Ignore low tables for low memory calculations. --- ChangeLog | 5 +++++ @@ -43,5 +43,5 @@ index bd8b429..a6be989 100644 } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch b/SOURCES/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch index 4c0dac1..2284523 100644 --- a/SOURCES/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch +++ b/SOURCES/0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch @@ -1,8 +1,8 @@ -From 37e3b5e42930e8cd4e801e4203dc2fde335b4b10 Mon Sep 17 00:00:00 2001 +From dd0a4f1120118f08a4d760ceec511238321779f8 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 10:07:11 +0100 -Subject: [PATCH 064/143] * grub-core/kern/i386/pc/mmap.c: Fallback to - EISA memory map if E820 failed to return any regions. +Subject: [PATCH 064/198] * grub-core/kern/i386/pc/mmap.c: Fallback to EISA + memory map if E820 failed to return any regions. --- ChangeLog | 5 +++++ @@ -84,5 +84,5 @@ index 8009e83..f1375f3 100644 grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch b/SOURCES/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch index ba1192e..a6e99c6 100644 --- a/SOURCES/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch +++ b/SOURCES/0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch @@ -1,9 +1,9 @@ -From 1cdf2c717c0f4a2efac0e5dc8b5c564f930c537a Mon Sep 17 00:00:00 2001 +From 738e0c73073b27de660696d32c2030bc683de2a2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 28 Feb 2014 10:50:05 +0100 -Subject: [PATCH 065/143] * include/grub/i386/openbsd_bootarg.h: Add - addr and frequency fields. * grub-core/loader/i386/bsd.c - (grub_cmd_openbsd): Fill addr field. +Subject: [PATCH 065/198] * include/grub/i386/openbsd_bootarg.h: Add addr and + frequency fields. * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr + field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66,5 +66,5 @@ index 01ca486..9ebe6b4 100644 struct grub_openbsd_bootarg_pcibios -- -1.9.3 +2.7.4 diff --git a/SOURCES/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch b/SOURCES/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch index 4dc5ad3..fb7baec 100644 --- a/SOURCES/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch +++ b/SOURCES/0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch @@ -1,7 +1,7 @@ -From 2a20b05871d51635060ab58c1b63ac2ee9f8a359 Mon Sep 17 00:00:00 2001 +From 735117103884aaa27fe4875ef556b2d17cfe107e Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Thu, 20 Mar 2014 16:57:12 +0530 -Subject: [PATCH 066/143] ieee1275: check for IBM pseries emulated machine +Subject: [PATCH 066/198] ieee1275: check for IBM pseries emulated machine is_qemu is not being set lead to disabling of feature like GRUB_IEEE1275_FLAG_HAS_CURSORONOFF. This resulted in cursor not being @@ -29,5 +29,5 @@ index d92ae14..3e12e6b 100644 if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0) grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch b/SOURCES/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch index 65614f5..260f988 100644 --- a/SOURCES/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch +++ b/SOURCES/0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch @@ -1,8 +1,8 @@ -From 530b22a1c04a08fbdb4dcbc3d34bc610af17cc68 Mon Sep 17 00:00:00 2001 +From 234e316455c92875f3cc7d35f11da7f7a4d3cb6b Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Wed, 26 Mar 2014 08:13:07 +0100 -Subject: [PATCH 067/143] * grub-core/loader/arm64/linux.c: Remove - redundant "0x". +Subject: [PATCH 067/198] * grub-core/loader/arm64/linux.c: Remove redundant + "0x". --- ChangeLog | 4 ++++ @@ -35,5 +35,5 @@ index 65129c2..f1d10a1 100644 } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch b/SOURCES/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch index d5cb1d1..66a65ae 100644 --- a/SOURCES/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch +++ b/SOURCES/0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch @@ -1,8 +1,8 @@ -From 5d1749ea5730be5c9c32228461b784317a500f4b Mon Sep 17 00:00:00 2001 +From aadd7669d805fcd510687ba5d0ca9e78c2d88a93 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Wed, 26 Mar 2014 08:48:30 +0100 -Subject: [PATCH 068/143] * grub-core/lib/relocator.c: Fix the case when - end of leftover is used. +Subject: [PATCH 068/198] * grub-core/lib/relocator.c: Fix the case when end of + leftover is used. --- ChangeLog | 4 ++++ @@ -35,5 +35,5 @@ index 9f9770b..cb11ea5 100644 &= ((1 << (8 - (start % 8))) - 1); grub_memset (lo->freebytes + (offstart + 7) / 8, 0, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0069-Fix-grub-probe-0-option.patch b/SOURCES/0069-Fix-grub-probe-0-option.patch index d85fa3a..8e47962 100644 --- a/SOURCES/0069-Fix-grub-probe-0-option.patch +++ b/SOURCES/0069-Fix-grub-probe-0-option.patch @@ -1,7 +1,7 @@ -From fdf24f98bc9e4632bfe7f280872cbbf40942ae7b Mon Sep 17 00:00:00 2001 +From cf7c88c63e219f906d058b71f889264ac8e3bc3b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 31 Mar 2014 13:51:17 +0100 -Subject: [PATCH 069/143] Fix grub-probe -0 option +Subject: [PATCH 069/198] Fix grub-probe -0 option * util/grub-probe,c (options): Make -0 work again (broken by conversion to argp). @@ -51,5 +51,5 @@ index 1f3b59f..80509be 100644 /* Free resources. */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch b/SOURCES/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch index 64e8ab2..9968cb7 100644 --- a/SOURCES/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch +++ b/SOURCES/0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch @@ -1,7 +1,7 @@ -From 0a65563c2b355c0eb7412b46f015556691f1b5d1 Mon Sep 17 00:00:00 2001 +From 0ec41b585c1cc4dfa79f880d3a62c72bc5f24d22 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 31 Mar 2014 14:48:33 +0100 -Subject: [PATCH 070/143] Fix partmap, cryptodisk, and abstraction handling in +Subject: [PATCH 070/198] Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig @@ -362,5 +362,5 @@ index 80509be..ecb7b6b 100644 continue; } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch b/SOURCES/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch index 7cd3384..87dcd45 100644 --- a/SOURCES/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch +++ b/SOURCES/0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch @@ -1,7 +1,7 @@ -From bd2125649cbeae60a5caff05d5a39c88a4e6eff6 Mon Sep 17 00:00:00 2001 +From a1fee7dd97762ecc39a9b74c7c0fcc97df0fcca7 Mon Sep 17 00:00:00 2001 From: Thomas Falcon Date: Mon, 31 Mar 2014 15:32:30 +0100 -Subject: [PATCH 071/143] btrfs: fix get_root key comparison failures due to +Subject: [PATCH 071/198] btrfs: fix get_root key comparison failures due to endianness * grub-core/fs/btrfs.c (get_root): Convert @@ -40,5 +40,5 @@ index 89666b6..f7b6c15 100644 key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM; err = lower_bound (data, &key_in, &key_out, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch b/SOURCES/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch index e8af09a..b91b9e1 100644 --- a/SOURCES/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch +++ b/SOURCES/0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch @@ -1,7 +1,7 @@ -From c3d9e64a61d17e57ef941a6a46e5a148c51c8519 Mon Sep 17 00:00:00 2001 +From 07122fa30773a0668180fd187989477421235afa Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 3 Apr 2014 21:31:12 +0200 -Subject: [PATCH 072/143] * grub-core/osdep/linux/getroot.c +Subject: [PATCH 072/198] * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe device names. --- @@ -51,5 +51,5 @@ index 19581d3..7007193 100644 return path; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch b/SOURCES/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch index 8846511..bd4bf45 100644 --- a/SOURCES/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch +++ b/SOURCES/0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch @@ -1,7 +1,7 @@ -From cb2cfc87fad111a539e9645f6a96d0a89a28c8ab Mon Sep 17 00:00:00 2001 +From b9f76056507285b672cb5b3ec7317cae24863e6a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 07:58:42 +0200 -Subject: [PATCH 073/143] Replace few instances of memcmp/memcpy in the code +Subject: [PATCH 073/198] Replace few instances of memcmp/memcpy in the code that should be grub_memcmp/grub_memcpy. --- @@ -98,5 +98,5 @@ index 19985f0..41ef910 100644 else { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch b/SOURCES/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch index 564f09e..f7242e4 100644 --- a/SOURCES/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch +++ b/SOURCES/0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch @@ -1,7 +1,7 @@ -From 91152c6e2944e9ad3583482140f8991b972fec08 Mon Sep 17 00:00:00 2001 +From c47197b3425d1629d6633ffff8fd1e81f8321119 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 08:02:38 +0200 -Subject: [PATCH 074/143] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. +Subject: [PATCH 074/198] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer pulled from libgcc. --- @@ -43,5 +43,5 @@ index fdc6611..97233d7 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0075-Add-missing-endif.patch b/SOURCES/0075-Add-missing-endif.patch index df7aa60..5a5dd51 100644 --- a/SOURCES/0075-Add-missing-endif.patch +++ b/SOURCES/0075-Add-missing-endif.patch @@ -1,7 +1,7 @@ -From fb1b02802aa368f43c8d0a871e017c14cb39b180 Mon Sep 17 00:00:00 2001 +From df0d554f4b8fc76de44f34aaa6ed47b3501e5fc4 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 4 Apr 2014 08:11:15 +0200 -Subject: [PATCH 075/143] Add missing #endif +Subject: [PATCH 075/198] Add missing #endif --- include/grub/libgcc.h | 1 + @@ -20,5 +20,5 @@ index 97233d7..8e93b67 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch b/SOURCES/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch index c1037c8..40c287a 100644 --- a/SOURCES/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch +++ b/SOURCES/0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch @@ -1,7 +1,7 @@ -From fb62186fefaca6b302eb61081bb6281042ff7283 Mon Sep 17 00:00:00 2001 +From d47063b3fdf1acb1028893751ca98f764a0ac39b Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 6 Apr 2014 00:44:44 +0200 -Subject: [PATCH 076/143] * grub-core/lib/syslinux_parse.c: Fix timeout +Subject: [PATCH 076/198] * grub-core/lib/syslinux_parse.c: Fix timeout quoting. --- @@ -35,5 +35,5 @@ index 21fa175..6bc504b 100644 if (err) return err; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch b/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch index 3b774c9..1e8ec74 100644 --- a/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch +++ b/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch @@ -1,7 +1,7 @@ -From d576e05a7bfe25413f70b54f671f305397bacf5e Mon Sep 17 00:00:00 2001 +From 6539eeb60268e646ca9f99a6ba8967c8fcb55807 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 10 Apr 2014 14:42:41 +0100 -Subject: [PATCH 077/143] Improve LVM "logical_volumes" string matching +Subject: [PATCH 077/198] Improve LVM "logical_volumes" string matching * grub-core/disk/lvm.c (grub_lvm_detect): Search for "logical_volumes" block a little more accurately. @@ -41,5 +41,5 @@ index 483c17e..862a966 100644 /* And add all the lvs to the volume group. */ while (1) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch b/SOURCES/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch index f512a75..50b34bc 100644 --- a/SOURCES/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch +++ b/SOURCES/0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch @@ -1,7 +1,7 @@ -From 0942ce33c5b88d85a6b81f4b3dd75c32fdf21978 Mon Sep 17 00:00:00 2001 +From 6eb6afd8f913c6e2da737d42c6561aacc3873c84 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 10 Apr 2014 16:54:33 +0100 -Subject: [PATCH 078/143] Tolerate devices with no filesystem UUID returned by +Subject: [PATCH 078/198] Tolerate devices with no filesystem UUID returned by os-prober * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem @@ -79,5 +79,5 @@ index 7cf8487..6f38c82 100644 hurd) onstr="$(gettext_printf "(on %s)" "${DEVICE}")" -- -1.9.3 +2.7.4 diff --git a/SOURCES/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch b/SOURCES/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch index 0efba39..22608e2 100644 --- a/SOURCES/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch +++ b/SOURCES/0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch @@ -1,7 +1,7 @@ -From 42c1756fd0ff7d94dcc8e9be2e429a2a976f6d41 Mon Sep 17 00:00:00 2001 +From 9889cf801bb7e8b70a249873a9c8254ac6ef8a39 Mon Sep 17 00:00:00 2001 From: Piotr Krysiuk Date: Sun, 20 Apr 2014 15:58:45 +0200 -Subject: [PATCH 079/143] Allow loading old kernels by placing GDT in +Subject: [PATCH 079/198] Allow loading old kernels by placing GDT in conventional memory. --- @@ -45,5 +45,5 @@ index d2a1b27..ffaf25f 100644 if (err) return err; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch b/SOURCES/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch index aaa2228..b6afcd5 100644 --- a/SOURCES/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch +++ b/SOURCES/0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch @@ -1,8 +1,8 @@ -From ec4609b70a7deebf6381297aae95dd4bf05bd008 Mon Sep 17 00:00:00 2001 +From ad3da599d5735859d141ecb8cb9a31f126cd6aa5 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 20 Apr 2014 16:12:41 +0200 -Subject: [PATCH 080/143] * grub-core/kern/misc.c (__bzero): Don't - compile in GRUB_UTIL. +Subject: [PATCH 080/198] * grub-core/kern/misc.c (__bzero): Don't compile in + GRUB_UTIL. Reported by: Yves Blusseau . --- @@ -39,5 +39,5 @@ index 54db2e1..c5c815d 100644 __bzero (void *s, grub_size_t n) { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch b/SOURCES/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch index 67e8193..7e02b0d 100644 --- a/SOURCES/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch +++ b/SOURCES/0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch @@ -1,8 +1,8 @@ -From 4a307e8fe1298f88641a40c8a8008363aa4b9c17 Mon Sep 17 00:00:00 2001 +From 650ec2a7667e0a06ab4af1030d1a4e3832ac48c6 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 12 May 2014 10:01:48 +0200 -Subject: [PATCH 081/143] * grub-core/commands/verify.c - (grub_pubkey_open): Fix memdisk check. +Subject: [PATCH 081/198] * grub-core/commands/verify.c (grub_pubkey_open): Fix + memdisk check. --- ChangeLog | 5 +++++ @@ -36,5 +36,5 @@ index a9dfd88..6349ccf 100644 fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); if (!fsuf) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch b/SOURCES/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch index 5ad0e40..2fbaaee 100644 --- a/SOURCES/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch +++ b/SOURCES/0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch @@ -1,8 +1,8 @@ -From 61fdf8bebdeaed4b601f0eca847282780380191f Mon Sep 17 00:00:00 2001 +From 34115409b23070d7f50ef990498af89d067d34e1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 15 May 2014 14:36:48 +0200 -Subject: [PATCH 082/143] * grub-core/commands/verify.c - (grub_pubkey_open): Trust procfs. +Subject: [PATCH 082/198] * grub-core/commands/verify.c (grub_pubkey_open): + Trust procfs. --- ChangeLog | 4 ++++ @@ -39,5 +39,5 @@ index 6349ccf..525bdd1 100644 fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); if (!fsuf) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch b/SOURCES/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch index 0189af4..25b56be 100644 --- a/SOURCES/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch +++ b/SOURCES/0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch @@ -1,7 +1,7 @@ -From 473348e663de53939fc077a1e1ef262405712dd8 Mon Sep 17 00:00:00 2001 +From 002c7908388cea822217b6a907de419676d6e4b8 Mon Sep 17 00:00:00 2001 From: Trevor Woerner Date: Sat, 21 Jun 2014 20:26:47 +0200 -Subject: [PATCH 083/143] * util/grub-gen-asciih.c (add_glyph): Fix +Subject: [PATCH 083/198] * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. --- @@ -69,5 +69,5 @@ index e01447a..e35dcb7 100644 if (glyph.width == 8 && glyph.height == 16 -- -1.9.3 +2.7.4 diff --git a/SOURCES/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch b/SOURCES/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch index 5dc0249..5560c8b 100644 --- a/SOURCES/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch +++ b/SOURCES/0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch @@ -1,8 +1,8 @@ -From 9de53cc99ce4c8e404e645443d07324bd9cfc157 Mon Sep 17 00:00:00 2001 +From 4dec12a88ad4473d82a851eadb9eb88c6aa7419a Mon Sep 17 00:00:00 2001 From: Stephane Rochoy Date: Sun, 22 Jun 2014 01:34:57 +0200 -Subject: [PATCH 084/143] * grub-core/commands/efi/lsefisystab.c - (grub_cmd_lsefisystab): Show EFI system table physical address. +Subject: [PATCH 084/198] * grub-core/commands/efi/lsefisystab.c + (grub_cmd_lsefisystab): Show EFI system table physical address. --- ChangeLog | 5 +++++ @@ -35,5 +35,5 @@ index eda8c5f..8717db9 100644 st->hdr.signature, st->hdr.revision); { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch b/SOURCES/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch index 5b06a4e..52916fb 100644 --- a/SOURCES/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch +++ b/SOURCES/0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch @@ -1,8 +1,8 @@ -From 3be166827cecb977ad47ac4d3d89ec92688307a4 Mon Sep 17 00:00:00 2001 +From 0df1a50e41fb12fbeb6709575e5f12d64ed73b66 Mon Sep 17 00:00:00 2001 From: Stephane Rochoy Date: Sun, 22 Jun 2014 01:35:52 +0200 -Subject: [PATCH 085/143] * grub-core/loader/i386/bsd.c - (grub_netbsd_boot): Pass pointer to EFI system table. +Subject: [PATCH 085/198] * grub-core/loader/i386/bsd.c (grub_netbsd_boot): + Pass pointer to EFI system table. --- ChangeLog | 5 +++++ @@ -68,5 +68,5 @@ index e48c19b..9b4f460 100644 + #endif -- -1.9.3 +2.7.4 diff --git a/SOURCES/0086-util-grub-install.c-Fix-handling-of-disk-module.patch b/SOURCES/0086-util-grub-install.c-Fix-handling-of-disk-module.patch index 26c86f6..d3a85de 100644 --- a/SOURCES/0086-util-grub-install.c-Fix-handling-of-disk-module.patch +++ b/SOURCES/0086-util-grub-install.c-Fix-handling-of-disk-module.patch @@ -1,8 +1,7 @@ -From d45ed8a6bf7c0c0abacb268da1f6d569743f16a0 Mon Sep 17 00:00:00 2001 +From c4640480f1a6a5eefcfcb8f82fbc8680c2f2989b Mon Sep 17 00:00:00 2001 From: Glenn Washburn Date: Sun, 22 Jun 2014 01:45:11 +0200 -Subject: [PATCH 086/143] * util/grub-install.c: Fix handling of - --disk-module. +Subject: [PATCH 086/198] * util/grub-install.c: Fix handling of --disk-module. --- ChangeLog | 4 ++++ @@ -43,5 +42,5 @@ index e9c6a46..7d61c32 100644 "This option is only available on BIOS target."), 2}, {"no-nvram", OPTION_NO_NVRAM, 0, 0, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch b/SOURCES/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch index 57e46ef..000ab00 100644 --- a/SOURCES/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch +++ b/SOURCES/0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch @@ -1,9 +1,9 @@ -From a9c472a7eeec6816868dbccce6decaef3b3c62bb Mon Sep 17 00:00:00 2001 +From 4895a5f05df22facb04bb1363fc63feff06a6ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=9F=D0=B5=D1=85=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Sun, 22 Jun 2014 03:51:50 +0400 -Subject: [PATCH 087/143] * grub-core/commands/loadenv.c - (check_blocklists): Fix overlap check. +Subject: [PATCH 087/198] * grub-core/commands/loadenv.c (check_blocklists): + Fix overlap check. --- ChangeLog | 4 ++++ @@ -54,5 +54,5 @@ index 6af8112..acd93d1 100644 /* This might be actually valid, but it is unbelievable that any filesystem makes such a silly allocation. */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch b/SOURCES/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch index 4df5517..d3d5c4e 100644 --- a/SOURCES/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +++ b/SOURCES/0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch @@ -1,8 +1,8 @@ -From e4ecf3a1f8eef683feae27ed84c85eb8aeb79e11 Mon Sep 17 00:00:00 2001 +From 3030e71cb8687cd628d8f03a80fb4aa4a601bec1 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 28 Dec 2013 02:20:27 +0000 -Subject: [PATCH 088/143] * NEWS: The cmosclean command in fact dates back to - 1.99. Remove mention of it from 2.02. +Subject: [PATCH 088/198] * NEWS: The cmosclean command in fact dates back to + 1.99. Remove mention of it from 2.02. --- NEWS | 2 ++ @@ -22,5 +22,5 @@ index a61df94..f621c65 100644 * Use the TSC as a possible time source on i386-ieee1275. * Merge PowerPC grub-mkrescue implementation with the common one. -- -1.9.3 +2.7.4 diff --git a/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch b/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch index 0065544..7fe8ce0 100644 --- a/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch +++ b/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch @@ -1,7 +1,7 @@ -From f01392a68f7f20bcc064a7d28e10805509701c4d Mon Sep 17 00:00:00 2001 +From 8cb1eca9733253479c1ee24b34c03fee596b716e Mon Sep 17 00:00:00 2001 From: Mark Hamzy Date: Wed, 28 Mar 2012 14:46:41 -0500 -Subject: [PATCH 089/143] Migrate PPC from Yaboot to Grub2 +Subject: [PATCH 089/198] Migrate PPC from Yaboot to Grub2 Add configuration support for serial terminal consoles. This will set the maximum screen size so that text is not overwritten. @@ -150,5 +150,5 @@ index 0000000..10d6658 + terminfo -g ${X}x${Y} ${TERMINAL} +EOF -- -1.9.3 +2.7.4 diff --git a/SOURCES/0090-Add-fw_path-variable-revised.patch b/SOURCES/0090-Add-fw_path-variable-revised.patch index 5caff3f..2ca25f1 100644 --- a/SOURCES/0090-Add-fw_path-variable-revised.patch +++ b/SOURCES/0090-Add-fw_path-variable-revised.patch @@ -1,7 +1,7 @@ -From 5bd3e1f888eeddc2575608516220ffa7b8270c7a Mon Sep 17 00:00:00 2001 +From 622dd3cf5628440c92f4da46c40f39639d7e98e8 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 19 Sep 2012 21:22:55 -0300 -Subject: [PATCH 090/143] Add fw_path variable (revised) +Subject: [PATCH 090/198] 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 @@ -77,5 +77,5 @@ index 3a926fc..6f4970f 100644 prefix = grub_env_get ("prefix"); if (prefix) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0091-Add-support-for-linuxefi.patch b/SOURCES/0091-Add-support-for-linuxefi.patch index d3f4172..b311741 100644 --- a/SOURCES/0091-Add-support-for-linuxefi.patch +++ b/SOURCES/0091-Add-support-for-linuxefi.patch @@ -1,7 +1,7 @@ -From 70e7bfb2caa9d0f52187b4f6e84762c6459c5903 Mon Sep 17 00:00:00 2001 +From cb8ffd0f744e6ed0f5ba50d5bb7c7b2795ce9a8f Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 10 Jul 2012 11:58:52 -0400 -Subject: [PATCH 091/143] Add support for linuxefi +Subject: [PATCH 091/198] Add support for linuxefi --- grub-core/Makefile.core.def | 8 + @@ -478,5 +478,5 @@ index da0ca3b..fc36bda 100644 /* Boot parameters for Linux based on 2.6.12. This is used by the setup -- -1.9.3 +2.7.4 diff --git a/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch b/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch index e0e1cf2..79b1b21 100644 --- a/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch +++ b/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch @@ -1,7 +1,7 @@ -From acc83cfa76a6457be73b1e748a80deb3967e2364 Mon Sep 17 00:00:00 2001 +From 7e496ebf185783ac12c0d85af7a734222ba98a65 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 16 Jul 2012 18:57:11 -0400 -Subject: [PATCH 092/143] Use "linuxefi" and "initrdefi" where appropriate. +Subject: [PATCH 092/198] Use "linuxefi" and "initrdefi" where appropriate. --- util/grub.d/10_linux.in | 18 ++++++++++++++++-- @@ -46,5 +46,5 @@ index 00d1931..ad34cc0 100644 sed "s/^/$submenu_indentation/" << EOF } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch b/SOURCES/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch index 79eea04..fea62e7 100644 --- a/SOURCES/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +++ b/SOURCES/0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch @@ -1,7 +1,7 @@ -From fe7b32ab9e58470fdf930d8efc7c9ebcd69e6ef3 Mon Sep 17 00:00:00 2001 +From a97e6dbf00fa02e1a8fdf178ed4d1081864b9294 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Oct 2012 10:40:49 -0400 -Subject: [PATCH 093/143] Don't allow insmod when secure boot is enabled. +Subject: [PATCH 093/198] Don't allow insmod when secure boot is enabled. Hi, @@ -113,5 +113,5 @@ index 9370fd5..a000c38 100644 EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, const grub_efi_device_path_t *dp2); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0094-Pass-x-hex-hex-straight-through-unmolested.patch b/SOURCES/0094-Pass-x-hex-hex-straight-through-unmolested.patch index 83cf483..c4c2bb7 100644 --- a/SOURCES/0094-Pass-x-hex-hex-straight-through-unmolested.patch +++ b/SOURCES/0094-Pass-x-hex-hex-straight-through-unmolested.patch @@ -1,7 +1,7 @@ -From a4f335a93d417c7f51f715d55ae59621fc9772ad Mon Sep 17 00:00:00 2001 +From 652311cb4bd9ded7ab15b2c9805988c464fe21c8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 1 Oct 2012 13:24:37 -0400 -Subject: [PATCH 094/143] Pass "\x[[:hex:]][[:hex:]]" straight through +Subject: [PATCH 094/198] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. --- @@ -179,5 +179,5 @@ index afd5513..8f01c1b 100644 case '$': if (escaped) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0095-Fix-crash-on-http.patch b/SOURCES/0095-Fix-crash-on-http.patch index cf87c9e..0f40957 100644 --- a/SOURCES/0095-Fix-crash-on-http.patch +++ b/SOURCES/0095-Fix-crash-on-http.patch @@ -1,7 +1,7 @@ -From e5a51c7c96d347cd6cbb7a2aa11f5dd7358c802a Mon Sep 17 00:00:00 2001 +From b01ecf0925ea952e2febb4a50f84f45c7b60ada3 Mon Sep 17 00:00:00 2001 From: Gustavo Luiz Duarte Date: Tue, 25 Sep 2012 18:40:55 -0400 -Subject: [PATCH 095/143] Fix crash on http +Subject: [PATCH 095/198] 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. @@ -24,5 +24,5 @@ index 4684f8b..ef9538c 100644 if (!data->sock) { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch b/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch index 93bb525..926338d 100644 --- a/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch +++ b/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch @@ -1,7 +1,7 @@ -From 9d1411ffa7290c1cbdc9ee95bb5fcc5506e63e0f Mon Sep 17 00:00:00 2001 +From 37c27f14658c4a9c239343397100c187c5eba434 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Thu, 20 Sep 2012 18:07:39 -0300 -Subject: [PATCH 096/143] IBM client architecture (CAS) reboot support +Subject: [PATCH 096/198] IBM client architecture (CAS) reboot support This is an implementation of IBM client architecture (CAS) reboot for GRUB. @@ -170,5 +170,5 @@ index 8e42513..9f26c69 100644 #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0097-Add-vlan-tag-support.patch b/SOURCES/0097-Add-vlan-tag-support.patch index dad2d5d..332bd30 100644 --- a/SOURCES/0097-Add-vlan-tag-support.patch +++ b/SOURCES/0097-Add-vlan-tag-support.patch @@ -1,7 +1,7 @@ -From c987623113e2d03e80f0ba1e108bf0a800628f85 Mon Sep 17 00:00:00 2001 +From 6249aac7ff8e18595ad74e26cb727a0c94461d10 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 30 Oct 2012 15:19:39 -0200 -Subject: [PATCH 097/143] Add vlan-tag support +Subject: [PATCH 097/198] 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 @@ -182,5 +182,5 @@ index 538baa3..a799e6b 100644 + #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0098-Add-X-option-to-printf-functions.patch b/SOURCES/0098-Add-X-option-to-printf-functions.patch index 8865950..a5ad00e 100644 --- a/SOURCES/0098-Add-X-option-to-printf-functions.patch +++ b/SOURCES/0098-Add-X-option-to-printf-functions.patch @@ -1,7 +1,7 @@ -From d7aaf1651f4b36721f73331753d017d33d7879b4 Mon Sep 17 00:00:00 2001 +From cf0b5ad37f8bdfd77e1d0e81962ddc8db477db65 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 16:58:39 -0200 -Subject: [PATCH 098/143] Add %X option to printf functions. +Subject: [PATCH 098/198] Add %X option to printf functions. --- grub-core/kern/misc.c | 7 +++++-- @@ -54,5 +54,5 @@ index c5c815d..a56cfe7 100644 case 'd': { -- -1.9.3 +2.7.4 diff --git a/SOURCES/0099-DHCP-client-ID-and-UUID-options-added.patch b/SOURCES/0099-DHCP-client-ID-and-UUID-options-added.patch index 1699024..7928e16 100644 --- a/SOURCES/0099-DHCP-client-ID-and-UUID-options-added.patch +++ b/SOURCES/0099-DHCP-client-ID-and-UUID-options-added.patch @@ -1,7 +1,7 @@ -From 2f3846a557e4ddf83f44e166d959ee460bedf8e1 Mon Sep 17 00:00:00 2001 +From 8c1b7c9003d8f00871953e768eebd8d380781b70 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:18:53 -0200 -Subject: [PATCH 099/143] DHCP client ID and UUID options added. +Subject: [PATCH 099/198] DHCP client ID and UUID options added. --- grub-core/net/bootp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++----- @@ -141,5 +141,5 @@ index a799e6b..59e5975 100644 }; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0100-Search-for-specific-config-file-for-netboot.patch b/SOURCES/0100-Search-for-specific-config-file-for-netboot.patch index 2616383..0ad427d 100644 --- a/SOURCES/0100-Search-for-specific-config-file-for-netboot.patch +++ b/SOURCES/0100-Search-for-specific-config-file-for-netboot.patch @@ -1,7 +1,7 @@ -From bf19a1e123fd09552165bd0d2b19ccf438c0a46c Mon Sep 17 00:00:00 2001 +From 66e6d4e742919936d7de18eb06e6f4218596354c Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 27 Nov 2012 17:22:07 -0200 -Subject: [PATCH 100/143] Search for specific config file for netboot +Subject: [PATCH 100/198] 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: @@ -199,5 +199,5 @@ index 59e5975..88fc71c 100644 + #endif /* ! GRUB_NET_HEADER */ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch b/SOURCES/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch index b7dc5dc..646f551 100644 --- a/SOURCES/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +++ b/SOURCES/0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch @@ -1,7 +1,7 @@ -From ddfb160353df14e9f88affe7498512a553146872 Mon Sep 17 00:00:00 2001 +From b09ae20aebe9d8e755960944b6b20b92d760ae51 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Tue, 22 Jan 2013 06:31:38 +0100 -Subject: [PATCH 101/143] blscfg: add blscfg module to parse Boot Loader +Subject: [PATCH 101/198] blscfg: add blscfg module to parse Boot Loader Specification snippets http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec @@ -247,5 +247,5 @@ index 0000000..4274aca + grub_unregister_extcmd (cmd); +} -- -1.9.3 +2.7.4 diff --git a/SOURCES/0102-Move-bash-completion-script-922997.patch b/SOURCES/0102-Move-bash-completion-script-922997.patch index 97d882b..fd4f641 100644 --- a/SOURCES/0102-Move-bash-completion-script-922997.patch +++ b/SOURCES/0102-Move-bash-completion-script-922997.patch @@ -1,7 +1,7 @@ -From f60046d87e55646d36c21520c5f6391c184ec8ad Mon Sep 17 00:00:00 2001 +From a0b4722de7e1eaaf80a0bcd3f45515cc95b2aec8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Apr 2013 14:35:34 -0400 -Subject: [PATCH 102/143] Move bash completion script (#922997) +Subject: [PATCH 102/198] Move bash completion script (#922997) Apparently these go in a new place now. --- @@ -22,5 +22,5 @@ index 136287c..0bcdb06 100644 $(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status -- -1.9.3 +2.7.4 diff --git a/SOURCES/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch b/SOURCES/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch index 0bbfabc..cef0800 100644 --- a/SOURCES/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch +++ b/SOURCES/0103-for-ppc-reset-console-display-attr-when-clear-screen.patch @@ -1,7 +1,7 @@ -From e52a5b66e765740deea4dbd201ab802c408184b9 Mon Sep 17 00:00:00 2001 +From 0baaacf5fdcd3f3dc44ba3ac447d514d1dee2a4c Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 24 Apr 2013 10:51:48 -0300 -Subject: [PATCH 103/143] for ppc, reset console display attr when clear screen +Subject: [PATCH 103/198] for ppc, reset console display attr when clear screen This should fix this bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=908519 @@ -23,5 +23,5 @@ index f0d3e3d..7cb7909 100644 data->reverse_video_off = grub_strdup ("\e[m"); if (grub_strcmp ("ieee1275", str) == 0) -- -1.9.3 +2.7.4 diff --git a/SOURCES/0104-Don-t-write-messages-to-the-screen.patch b/SOURCES/0104-Don-t-write-messages-to-the-screen.patch index c3bb21c..5a0171a 100644 --- a/SOURCES/0104-Don-t-write-messages-to-the-screen.patch +++ b/SOURCES/0104-Don-t-write-messages-to-the-screen.patch @@ -1,7 +1,7 @@ -From 0ee337319fc8c21da04bca1cabb51b3445dba3fd Mon Sep 17 00:00:00 2001 +From edae3ee3c0b077cda1295f111e92ed0ce191bfed Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:30:20 -0400 -Subject: [PATCH 104/143] Don't write messages to the screen +Subject: [PATCH 104/198] Don't write messages to the screen Writing messages to the screen before the menus or boot splash happens so quickly it looks like something is wrong and isn't @@ -154,5 +154,5 @@ index ad34cc0..e762e1f 100644 EOF fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch b/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch index 5ae2b7e..3bd14de 100644 --- a/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch +++ b/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch @@ -1,7 +1,7 @@ -From e3cabcd95237fadbad8e6a0e36222d97d16b5365 Mon Sep 17 00:00:00 2001 +From 8831a9810ef95acb596f7096b9325e1db9b08cce Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 13:53:48 -0400 -Subject: [PATCH 105/143] Don't print GNU GRUB header +Subject: [PATCH 105/198] Don't print GNU GRUB header No one cares. --- @@ -29,5 +29,5 @@ index 85d2a28..3777cd2 100644 static void -- -1.9.3 +2.7.4 diff --git a/SOURCES/0106-Don-t-add-to-highlighted-row.patch b/SOURCES/0106-Don-t-add-to-highlighted-row.patch index e1bcb39..148aa03 100644 --- a/SOURCES/0106-Don-t-add-to-highlighted-row.patch +++ b/SOURCES/0106-Don-t-add-to-highlighted-row.patch @@ -1,7 +1,7 @@ -From c89f05d148a1a1416513d22f62d23504b35dd230 Mon Sep 17 00:00:00 2001 +From 624dcfd2171e83412c0ad5ad0b9ccd1cef38570a Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 17:49:45 -0400 -Subject: [PATCH 106/143] Don't add '*' to highlighted row +Subject: [PATCH 106/198] Don't add '*' to highlighted row It is already highlighted. --- @@ -22,5 +22,5 @@ index 2ff2941..2f84fcc 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0107-Message-string-cleanups.patch b/SOURCES/0107-Message-string-cleanups.patch index 2c71592..99c3337 100644 --- a/SOURCES/0107-Message-string-cleanups.patch +++ b/SOURCES/0107-Message-string-cleanups.patch @@ -1,7 +1,7 @@ -From 6c33a9b3a96a5e8c782a8eef97f5d95a3a542921 Mon Sep 17 00:00:00 2001 +From 723d82b17a3a0083b9aa84c797571392079a8cff Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 11:09:04 -0400 -Subject: [PATCH 107/143] Message string cleanups +Subject: [PATCH 107/198] Message string cleanups Make use of terminology consistent. Remove jargon. --- @@ -67,5 +67,5 @@ index 2f84fcc..9d20c6b 100644 { grub_print_error (); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch b/SOURCES/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch index 7d1da28..77ea118 100644 --- a/SOURCES/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +++ b/SOURCES/0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch @@ -1,7 +1,7 @@ -From 6227514ebbfcf1744060eb4bf1b39b669221809d Mon Sep 17 00:00:00 2001 +From fb308b574bebddfe5837e9680ff6bc917a23a2ef Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:23 -0400 -Subject: [PATCH 108/143] Fix border spacing now that we aren't displaying it +Subject: [PATCH 108/198] Fix border spacing now that we aren't displaying it --- grub-core/normal/menu_text.c | 6 +++--- @@ -28,5 +28,5 @@ index 9d20c6b..aa3454f 100644 geo->timeout_lines = 2; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0109-Use-the-correct-indentation-for-the-term-help-text.patch b/SOURCES/0109-Use-the-correct-indentation-for-the-term-help-text.patch index 6911db2..ec15af2 100644 --- a/SOURCES/0109-Use-the-correct-indentation-for-the-term-help-text.patch +++ b/SOURCES/0109-Use-the-correct-indentation-for-the-term-help-text.patch @@ -1,7 +1,7 @@ -From 9cc9edb600ad1acc1598910ed95a8482ff3de6e2 Mon Sep 17 00:00:00 2001 +From ce969717fe4520e71309a87a920d628e571ecd9e Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:08:49 -0400 -Subject: [PATCH 109/143] Use the correct indentation for the term help text +Subject: [PATCH 109/198] Use the correct indentation for the term help text That is consistent with the menu help text --- @@ -24,5 +24,5 @@ index 3777cd2..0da2a52 100644 grub_print_message_indented (msg_formatted, 0, 0, term); grub_putcode ('\n', term); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0110-Indent-menu-entries.patch b/SOURCES/0110-Indent-menu-entries.patch index 7930d76..a4e59ff 100644 --- a/SOURCES/0110-Indent-menu-entries.patch +++ b/SOURCES/0110-Indent-menu-entries.patch @@ -1,7 +1,7 @@ -From e52c695e09447f6fbc51c23f1745d50c6db5c7b8 Mon Sep 17 00:00:00 2001 +From 7ffcc7ec5900f15e0e722e1f6ac6a80d9632927a Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:30:55 -0400 -Subject: [PATCH 110/143] Indent menu entries +Subject: [PATCH 110/198] Indent menu entries --- grub-core/normal/menu_text.c | 3 ++- @@ -22,5 +22,5 @@ index aa3454f..01b6f1c 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, -- -1.9.3 +2.7.4 diff --git a/SOURCES/0111-Fix-margins.patch b/SOURCES/0111-Fix-margins.patch index 3c7c493..b8f14ec 100644 --- a/SOURCES/0111-Fix-margins.patch +++ b/SOURCES/0111-Fix-margins.patch @@ -1,7 +1,7 @@ -From a623d490ea6a94cc7db68400d3fea5b0c25ccb9c Mon Sep 17 00:00:00 2001 +From c49fcf2ea51773e5d2cde1d6348345777bd09af8 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 14:59:36 -0400 -Subject: [PATCH 111/143] Fix margins +Subject: [PATCH 111/198] Fix margins --- grub-core/normal/menu_text.c | 8 +++----- @@ -33,5 +33,5 @@ index 01b6f1c..ead3391 100644 - geo->timeout_lines /* timeout */ - 1 /* empty final line */; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch b/SOURCES/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch index c8dd53a..301c4e0 100644 --- a/SOURCES/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch +++ b/SOURCES/0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch @@ -1,7 +1,7 @@ -From 5980cac9e0320a3eb65e7fb73487a565d21361da Mon Sep 17 00:00:00 2001 +From 80fe9ed670d67991d5b52a8c85f22e0a2c35ccff Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 12 Jun 2013 11:51:49 -0400 -Subject: [PATCH 112/143] Add support for UEFI operating systems returned by +Subject: [PATCH 112/198] Add support for UEFI operating systems returned by os-prober os-prober returns UEFI operating systems in the form: @@ -47,5 +47,5 @@ index 6f38c82..9f955ab 100644 esac done -- -1.9.3 +2.7.4 diff --git a/SOURCES/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch b/SOURCES/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch index 664682f..94e01bb 100644 --- a/SOURCES/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/SOURCES/0113-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -1,7 +1,7 @@ -From 3fd909cbba26f1f76a64aa095937b00cd1785570 Mon Sep 17 00:00:00 2001 +From 66f6b47987f09fe873e9b48c2108862401e76fb9 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Tue, 11 Jun 2013 15:14:05 -0300 -Subject: [PATCH 113/143] Disable GRUB video support for IBM power machines +Subject: [PATCH 113/198] Disable GRUB video support for IBM power machines Should fix the problem in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=973205 @@ -61,5 +61,5 @@ index 6a21f5d..663935d 100644 extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch b/SOURCES/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch index c734740..b1dc10c 100644 --- a/SOURCES/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +++ b/SOURCES/0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch @@ -1,7 +1,7 @@ -From 6550cd89b1dee8c9ad866cbf10bf72dc2ff8a8bc Mon Sep 17 00:00:00 2001 +From 72897a5a7d2c32d758165ff57565fc8bddf64495 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 21 Jun 2013 14:44:08 -0400 -Subject: [PATCH 114/143] Use -2 instead of -1 for our right-hand margin, so +Subject: [PATCH 114/198] Use -2 instead of -1 for our right-hand margin, so linewrapping works (#976643). Signed-off-by: Peter Jones @@ -23,5 +23,5 @@ index ead3391..bc1fc71 100644 geo->first_entry_y = 3; /* three empty lines*/ -- -1.9.3 +2.7.4 diff --git a/SOURCES/0115-Use-linux16-when-appropriate-880840.patch b/SOURCES/0115-Use-linux16-when-appropriate-880840.patch index 6cef47e..4ec282b 100644 --- a/SOURCES/0115-Use-linux16-when-appropriate-880840.patch +++ b/SOURCES/0115-Use-linux16-when-appropriate-880840.patch @@ -1,7 +1,7 @@ -From ba749818b7a53df63d887cb17497f82c78ca934c Mon Sep 17 00:00:00 2001 +From d34664a3f98abe6c2828ebe148ef24ea462bfc36 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:05:07 -0400 -Subject: [PATCH 115/143] Use linux16 when appropriate (#880840) +Subject: [PATCH 115/198] Use linux16 when appropriate (#880840) The kernel group really would prefer that we use the 16 bit entry point on x86 bios machines. @@ -48,5 +48,5 @@ index e762e1f..600bfd2 100644 fi fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0116-Enable-pager-by-default.-985860.patch b/SOURCES/0116-Enable-pager-by-default.-985860.patch index f300fb8..e4c1018 100644 --- a/SOURCES/0116-Enable-pager-by-default.-985860.patch +++ b/SOURCES/0116-Enable-pager-by-default.-985860.patch @@ -1,7 +1,7 @@ -From 26f2fbd4fb424ad097ea99578864ae526b79f732 Mon Sep 17 00:00:00 2001 +From 78e75e5f9d48fff92a2bc2f606520bef8fa68e4e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:09:27 -0400 -Subject: [PATCH 116/143] Enable pager by default. (#985860) +Subject: [PATCH 116/198] Enable pager by default. (#985860) Signed-off-by: Peter Jones --- @@ -22,5 +22,5 @@ index ce2ec81..fefa7dd 100644 load_env fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch b/SOURCES/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch index 0baa67a..b67d0ce 100644 --- a/SOURCES/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +++ b/SOURCES/0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch @@ -1,7 +1,7 @@ -From 3e8fad7dba63db810a9626d472de5270b2d1bb75 Mon Sep 17 00:00:00 2001 +From b91219b5c003c0f77ff5151031928abebf4f9de5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 28 Oct 2013 10:13:27 -0400 -Subject: [PATCH 117/143] F10 doesn't work on serial, so don't tell the user to +Subject: [PATCH 117/198] F10 doesn't work on serial, so don't tell the user to hit it (#987443) Signed-off-by: Peter Jones @@ -23,5 +23,5 @@ index bc1fc71..6202c2a 100644 STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0118-Don-t-say-GNU-Linux-in-generated-menus.patch b/SOURCES/0118-Don-t-say-GNU-Linux-in-generated-menus.patch index ba22a7f..46d611a 100644 --- a/SOURCES/0118-Don-t-say-GNU-Linux-in-generated-menus.patch +++ b/SOURCES/0118-Don-t-say-GNU-Linux-in-generated-menus.patch @@ -1,7 +1,7 @@ -From 03d405d9b503c435f3a975c5789a0bda9650a753 Mon Sep 17 00:00:00 2001 +From 008834cce424865eb428a0d7ece929d042c1fbf7 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 14 Mar 2011 14:27:42 -0400 -Subject: [PATCH 118/143] Don't say "GNU/Linux" in generated menus. +Subject: [PATCH 118/198] Don't say "GNU/Linux" in generated menus. --- util/grub.d/10_linux.in | 4 ++-- @@ -41,5 +41,5 @@ index a608435..79d4e38 100644 fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0119-Don-t-draw-a-border-around-the-menu.patch b/SOURCES/0119-Don-t-draw-a-border-around-the-menu.patch index 34e0d66..791ac27 100644 --- a/SOURCES/0119-Don-t-draw-a-border-around-the-menu.patch +++ b/SOURCES/0119-Don-t-draw-a-border-around-the-menu.patch @@ -1,7 +1,7 @@ -From 6bf4deb61df3ecb1e2d108195efa5ac980baa961 Mon Sep 17 00:00:00 2001 +From 9b0d489943360c596f6e21f56979423fe8acc2c2 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 15 May 2013 16:47:33 -0400 -Subject: [PATCH 119/143] Don't draw a border around the menu +Subject: [PATCH 119/198] Don't draw a border around the menu It looks cleaner without it. --- @@ -70,5 +70,5 @@ index 6202c2a..beddd7f 100644 grub_term_highlight_color = old_color_highlight; geo->timeout_y = geo->first_entry_y + geo->num_entries -- -1.9.3 +2.7.4 diff --git a/SOURCES/0120-Use-the-standard-margin-for-the-timeout-string.patch b/SOURCES/0120-Use-the-standard-margin-for-the-timeout-string.patch index 4d3af1e..7a99811 100644 --- a/SOURCES/0120-Use-the-standard-margin-for-the-timeout-string.patch +++ b/SOURCES/0120-Use-the-standard-margin-for-the-timeout-string.patch @@ -1,7 +1,7 @@ -From a3e6964bd3242bd042489bb510e63fc0224fede4 Mon Sep 17 00:00:00 2001 +From 946f5809983d520768e2d769873e5b2437a9d7e7 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Fri, 7 Jun 2013 10:52:32 -0400 -Subject: [PATCH 120/143] Use the standard margin for the timeout string +Subject: [PATCH 120/198] Use the standard margin for the timeout string So that it aligns with the other messages --- @@ -39,5 +39,5 @@ index beddd7f..33b208b 100644 } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch b/SOURCES/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch index 37e91be..c8edd7d 100644 --- a/SOURCES/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch +++ b/SOURCES/0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch @@ -1,7 +1,7 @@ -From a7a033ed92a55dd44314ed20f720a3d32fa9c684 Mon Sep 17 00:00:00 2001 +From c9f932e3dc369211b6e5c2c64c3525a7d4cdd54a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 10 Jan 2014 09:36:24 -0500 -Subject: [PATCH 121/143] Fix grub_script_execute_sourcecode() usage on ppc. +Subject: [PATCH 121/198] Fix grub_script_execute_sourcecode() usage on ppc. 593e430c made it not take the extra argc/argv that this code still passes it. @@ -25,5 +25,5 @@ index 0da2a52..f66c03c 100644 } grub_free (script); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch b/SOURCES/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch index cfc5ec3..e3df7dc 100644 --- a/SOURCES/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch +++ b/SOURCES/0122-Add-.eh_frame-to-list-of-relocations-stripped.patch @@ -1,7 +1,7 @@ -From 9120cc5592d26a945ead586b71820fb9708f5062 Mon Sep 17 00:00:00 2001 +From e8b95ab3be8c4fbde991c5a00215616cbbd7d495 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 13 Jan 2014 21:50:59 -0500 -Subject: [PATCH 122/143] Add .eh_frame to list of relocations stripped +Subject: [PATCH 122/198] Add .eh_frame to list of relocations stripped --- conf/Makefile.common | 2 +- @@ -21,5 +21,5 @@ index e4c301f..6f836d8 100644 CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d -- -1.9.3 +2.7.4 diff --git a/SOURCES/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch b/SOURCES/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch index 0d77e70..72fa284 100644 --- a/SOURCES/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +++ b/SOURCES/0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch @@ -1,7 +1,7 @@ -From 1c9518bb506f8f4fa6b388571c76797705e7b566 Mon Sep 17 00:00:00 2001 +From b437c2152d9b21a519fa7354f11618c65e6088e8 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 13:12:23 -0500 -Subject: [PATCH 123/143] Make 10_linux work with our changes for linux16 and +Subject: [PATCH 123/198] Make 10_linux work with our changes for linux16 and linuxefi on aarch64 Signed-off-by: Peter Jones @@ -81,5 +81,5 @@ index c943a1e..2b8c561 100644 for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do if test -e "${i}" ; then -- -1.9.3 +2.7.4 diff --git a/SOURCES/0124-Don-t-print-during-fdt-loading-method.patch b/SOURCES/0124-Don-t-print-during-fdt-loading-method.patch index 8bf4191..0eacb45 100644 --- a/SOURCES/0124-Don-t-print-during-fdt-loading-method.patch +++ b/SOURCES/0124-Don-t-print-during-fdt-loading-method.patch @@ -1,7 +1,7 @@ -From aa8c71086da3a28382b8bd958bac1c5d3b2b2be3 Mon Sep 17 00:00:00 2001 +From a9fea4d18102d1db1253427a907b25a9d6c7e00a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jan 2014 16:15:46 -0500 -Subject: [PATCH 124/143] Don't print during fdt loading method. +Subject: [PATCH 124/198] Don't print during fdt loading method. Signed-off-by: Peter Jones --- @@ -23,5 +23,5 @@ index 2b8c561..acf2e0e 100644 EOF fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch b/SOURCES/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch index 1958333..315fa4a 100644 --- a/SOURCES/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch +++ b/SOURCES/0125-Honor-a-symlink-when-generating-configuration-by-gru.patch @@ -1,7 +1,7 @@ -From 37ad82c4f11e293e30eea26302624691e80f19b8 Mon Sep 17 00:00:00 2001 +From 59bf229ab8f723b8dac858475c9a3cfc6d71987b Mon Sep 17 00:00:00 2001 From: Marcel Kolaja Date: Tue, 21 Jan 2014 10:57:08 -0500 -Subject: [PATCH 125/143] Honor a symlink when generating configuration by +Subject: [PATCH 125/198] Honor a symlink when generating configuration by grub2-mkconfig Honor a symlink when generating configuration by grub2-mkconfig, so that @@ -25,5 +25,5 @@ index ca040dd..b00f9e6 100644 fi -- -1.9.3 +2.7.4 diff --git a/SOURCES/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch b/SOURCES/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch index ea0ac8e..864f681 100644 --- a/SOURCES/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +++ b/SOURCES/0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch @@ -1,7 +1,7 @@ -From ee6df3680adbe2bb8165c98ed0e39f6258cd873e Mon Sep 17 00:00:00 2001 +From fdc3bfebfc9a2d7c2b9fb09ae2f873b1ee741d21 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 30 Jun 2014 14:16:46 -0400 -Subject: [PATCH 126/143] Don't munge raw spaces when we're doing our cmdline +Subject: [PATCH 126/198] Don't munge raw spaces when we're doing our cmdline escaping (#923374) Signed-off-by: Peter Jones @@ -32,5 +32,5 @@ index 0a5b2af..970ea86 100644 { *buf++ = *c++; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch b/SOURCES/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch index 94ed88d..168b432 100644 --- a/SOURCES/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch +++ b/SOURCES/0127-Don-t-require-a-password-to-boot-entries-generated-b.patch @@ -1,7 +1,7 @@ -From 0ce7596ab544955073318a4ed650d7d0615b933e Mon Sep 17 00:00:00 2001 +From ba498a04ca96c30736a09a6f05a9624e03cee895 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 11 Feb 2014 11:14:50 -0500 -Subject: [PATCH 127/143] Don't require a password to boot entries generated by +Subject: [PATCH 127/198] Don't require a password to boot entries generated by grub-mkconfig. When we set a password, we just want that to mean you can't /edit/ an entry. @@ -27,5 +27,5 @@ index acf2e0e..136abd7 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS="$(sed 's, release .*$,,g' /etc/system-release)" -- -1.9.3 +2.7.4 diff --git a/SOURCES/0128-Don-t-emit-Booting-.-message.patch b/SOURCES/0128-Don-t-emit-Booting-.-message.patch index c7b26c6..337e0d6 100644 --- a/SOURCES/0128-Don-t-emit-Booting-.-message.patch +++ b/SOURCES/0128-Don-t-emit-Booting-.-message.patch @@ -1,7 +1,7 @@ -From 34f60bd4d04b142667c5fc0a4287b118834e71bb Mon Sep 17 00:00:00 2001 +From ee3cd4eb157b2b455a3d6dc31c4ff39d38ecc740 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 09:37:49 -0500 -Subject: [PATCH 128/143] Don't emit "Booting ..." message. +Subject: [PATCH 128/198] Don't emit "Booting ..." message. UI team still hates this stuff, so we're disabling it for RHEL 7. @@ -44,5 +44,5 @@ index b485df8..62e5db1 100644 errs_before = grub_err_printed_errors; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch b/SOURCES/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch index cb00dcc..df34119 100644 --- a/SOURCES/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch +++ b/SOURCES/0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch @@ -1,7 +1,7 @@ -From fe42ce5fc9eec355027a533861dfe7f2eeefc63c Mon Sep 17 00:00:00 2001 +From 882b6646ff583e524fc70929825ee29d35eef61d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Feb 2014 15:21:46 -0500 -Subject: [PATCH 129/143] Make CTRL and ALT keys work as expected on EFI +Subject: [PATCH 129/198] Make CTRL and ALT keys work as expected on EFI systems (version 5). This is version 4. @@ -300,5 +300,5 @@ index e5dd543..1423403 100644 { grub_efi_status_t -- -1.9.3 +2.7.4 diff --git a/SOURCES/0130-May-as-well-try-it.patch b/SOURCES/0130-May-as-well-try-it.patch index f8b611d..a48db30 100644 --- a/SOURCES/0130-May-as-well-try-it.patch +++ b/SOURCES/0130-May-as-well-try-it.patch @@ -1,7 +1,7 @@ -From bd4b1ae40c743174fc0236851855dfaf6094f875 Mon Sep 17 00:00:00 2001 +From b93064670dd42ff44c1cebb0a223477afcb89b56 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 4 Mar 2014 11:00:23 -0500 -Subject: [PATCH 130/143] May as well try it. +Subject: [PATCH 130/198] May as well try it. --- conf/Makefile.extra-dist | 1 - @@ -1958,5 +1958,5 @@ index 0000000..37ea2dd +.SH SEE ALSO +.BR "info grub" -- -1.9.3 +2.7.4 diff --git a/SOURCES/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch b/SOURCES/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch index 20f0dae..887367c 100644 --- a/SOURCES/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +++ b/SOURCES/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch @@ -1,7 +1,7 @@ -From d60083bf794914c4f26f561adcdd107abe80cd7e Mon Sep 17 00:00:00 2001 +From 3ddb1355db71ac8536b79b6c09808808cde50566 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 19 Feb 2014 15:58:43 -0500 -Subject: [PATCH 131/143] use fw_path prefix when fallback searching for grub +Subject: [PATCH 131/198] use fw_path prefix when fallback searching for grub config When PXE booting via UEFI firmware, grub was searching for grub.cfg @@ -41,5 +41,5 @@ index f66c03c..5e2ac15 100644 { grub_size_t config_len; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch b/SOURCES/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch index 23874fc..3af1c37 100644 --- a/SOURCES/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +++ b/SOURCES/0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch @@ -1,7 +1,7 @@ -From 2927c4943326f09bd626744b8a46fc8ee16fea1c Mon Sep 17 00:00:00 2001 +From 3043f62cdff6d08927a99b3aa19ee76daf678fab Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 6 Mar 2014 11:51:33 -0500 -Subject: [PATCH 132/143] Try mac/guid/etc before grub.cfg on tftp config +Subject: [PATCH 132/198] Try mac/guid/etc before grub.cfg on tftp config files. Signed-off-by: Peter Jones @@ -111,5 +111,5 @@ index 5e2ac15..4190985 100644 else grub_enter_normal_mode (argv[0]); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch b/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch index 8887866..5517f4b 100644 --- a/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch +++ b/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch @@ -1,7 +1,7 @@ -From cf2e819b7059f199075b099260983e8108eea74a Mon Sep 17 00:00:00 2001 +From d11b2eb425d2125f67dd8d8e9b11d9be7d6f3f11 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 5 Feb 2014 09:42:42 -0200 -Subject: [PATCH 133/143] trim arp packets with abnormal size +Subject: [PATCH 133/198] trim arp packets with abnormal size GRUB uses arp request to create the arp response. If the incoming packet is foobared, GRUB needs to trim the arp response packet before sending it. @@ -27,5 +27,5 @@ index d62d0cc..77581f4 100644 /* We've already checked that pln is either 4 or 16. */ char tmp[16]; -- -1.9.3 +2.7.4 diff --git a/SOURCES/0134-Fix-convert-function-to-support-NVMe-devices.patch b/SOURCES/0134-Fix-convert-function-to-support-NVMe-devices.patch index a5b9f8d..5ae26bf 100644 --- a/SOURCES/0134-Fix-convert-function-to-support-NVMe-devices.patch +++ b/SOURCES/0134-Fix-convert-function-to-support-NVMe-devices.patch @@ -1,7 +1,7 @@ -From f451ce261bcdb24d3428daac54e32e06c698e2f7 Mon Sep 17 00:00:00 2001 +From 5e1b45be24a3614eb8ce083e06c71a1f651b5ae7 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 18 Feb 2014 11:34:00 -0500 -Subject: [PATCH 134/143] Fix convert function to support NVMe devices +Subject: [PATCH 134/198] Fix convert function to support NVMe devices This is adapted from the patch at https://bugzilla.redhat.com/show_bug.cgi?id=1019660 , which is against @@ -55,5 +55,5 @@ index 3958105..e700610 100644 return grub_util_devmapper_part_to_disk (&st, is_part, os_dev); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch b/SOURCES/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch index 9b8709e..feb6fca 100644 --- a/SOURCES/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +++ b/SOURCES/0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch @@ -1,7 +1,7 @@ -From da07b568a45d2c87ab2f6e498f0e304c73c5d195 Mon Sep 17 00:00:00 2001 +From 4d363cc16d83a499ea1b14212e77e9e9c79d4984 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 12 Mar 2014 10:58:16 -0400 -Subject: [PATCH 135/143] Fix bad test on GRUB_DISABLE_SUBMENU. +Subject: [PATCH 135/198] Fix bad test on GRUB_DISABLE_SUBMENU. The file /etc/grub.d/10_linux does @@ -20,7 +20,7 @@ Resolves: rhbz#1063414 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 136abd7..3f799e9 100644 +index 136abd7..767093c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -255,7 +255,11 @@ while [ "x$list" != "x" ] ; do @@ -37,5 +37,5 @@ index 136abd7..3f799e9 100644 "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" -- -1.9.3 +2.7.4 diff --git a/SOURCES/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch b/SOURCES/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch index 13dfa37..5b2f37b 100644 --- a/SOURCES/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +++ b/SOURCES/0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch @@ -1,7 +1,7 @@ -From e7ba5525f976930b792c91132eb5ec96c5379797 Mon Sep 17 00:00:00 2001 +From 413ce3c3f8acaa9d3060faf0b13fd8957af75565 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Mon, 10 Feb 2014 16:13:10 -0500 -Subject: [PATCH 136/143] Switch to use APM Mustang device tree, for hardware +Subject: [PATCH 136/198] Switch to use APM Mustang device tree, for hardware testing. Signed-off-by: David A. Marlin @@ -10,7 +10,7 @@ Signed-off-by: David A. Marlin 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 3f799e9..2639511 100644 +index 767093c..3722c1e 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do @@ -25,5 +25,5 @@ index 3f799e9..2639511 100644 fi done -- -1.9.3 +2.7.4 diff --git a/SOURCES/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch b/SOURCES/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch index 32d7b61..3b14f48 100644 --- a/SOURCES/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch +++ b/SOURCES/0137-Use-the-default-device-tree-from-the-grub-default-fi.patch @@ -1,7 +1,7 @@ -From 5f1ee8ff7170321250874116eb80cbec83cc70ab Mon Sep 17 00:00:00 2001 +From 8219e2570e551ccf6034ce4bc6f8da1f61ff6663 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 12 Feb 2014 14:54:04 -0500 -Subject: [PATCH 137/143] Use the default device tree from the grub default +Subject: [PATCH 137/198] Use the default device tree from the grub default file instead of hardcoding a value. @@ -27,7 +27,7 @@ index b00f9e6..beb22de 100644 if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 2639511..6480cd6 100644 +index 3722c1e..8782d8c 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do @@ -42,5 +42,5 @@ index 2639511..6480cd6 100644 fi done -- -1.9.3 +2.7.4 diff --git a/SOURCES/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/SOURCES/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 1690be3..4d3fe73 100644 --- a/SOURCES/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/SOURCES/0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,7 +1,7 @@ -From f4bbb76f70ceca4e089e926ee44d8d3fe919f040 Mon Sep 17 00:00:00 2001 +From 147daeab22db793978f952b6f0d832919a1b0081 Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Sat, 15 Feb 2014 15:10:22 -0500 -Subject: [PATCH 138/143] reopen SNP protocol for exclusive use by grub +Subject: [PATCH 138/198] reopen SNP protocol for exclusive use by grub --- grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++ @@ -42,5 +42,5 @@ index 2b344d6..a6e4c79 100644 } } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch b/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch index df6e385..927361c 100644 --- a/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch +++ b/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch @@ -1,7 +1,7 @@ -From 3aed1012cb8f559a0241569d6ec6b1be23844b05 Mon Sep 17 00:00:00 2001 +From 412b86d8848d524acc84ce40b8e63b0ed52ab68e Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Thu, 20 Feb 2014 12:54:52 -0500 -Subject: [PATCH 139/143] Reduce timer event frequency by 10 +Subject: [PATCH 139/198] Reduce timer event frequency by 10 Timer event to keep grub msec counter was running at 1000HZ. This was too fast for UEFI timer driver and resulted in a 10x slowdown in grub time @@ -36,5 +36,5 @@ index a6ae034..0c17d83 100644 grub_install_get_time_ms (grub_efi_get_time_ms); } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0140-always-return-error-to-UEFI.patch b/SOURCES/0140-always-return-error-to-UEFI.patch index 78ffebf..724d956 100644 --- a/SOURCES/0140-always-return-error-to-UEFI.patch +++ b/SOURCES/0140-always-return-error-to-UEFI.patch @@ -1,7 +1,7 @@ -From 36a34ede9dfa34840c59c7b331c1bc8d8ae7442e Mon Sep 17 00:00:00 2001 +From a2a99457e562f6ddc719744803d49f4561cd65cf Mon Sep 17 00:00:00 2001 From: Fedora Ninjas Date: Wed, 26 Feb 2014 21:49:12 -0500 -Subject: [PATCH 140/143] always return error to UEFI +Subject: [PATCH 140/198] always return error to UEFI --- grub-core/kern/efi/efi.c | 2 +- @@ -21,5 +21,5 @@ index cd839cc..1a8dba5 100644 } -- -1.9.3 +2.7.4 diff --git a/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch b/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch index 0a5460d..cfd084f 100644 --- a/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch +++ b/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch @@ -1,7 +1,7 @@ -From 8014cad21bb2cc986f10f0a927036851f490a8ec Mon Sep 17 00:00:00 2001 +From cc224a3b44036164ff95320190a3424a7c1ddb87 Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 13 Aug 2014 18:59:58 +0000 -Subject: [PATCH 141/143] Add powerpc little-endian (ppc64le) flags +Subject: [PATCH 141/198] Add powerpc little-endian (ppc64le) flags libgcc dependency was removed *just* for this target because the distros that use ppc64el doesn't have 32-bit support on it. @@ -92,5 +92,5 @@ index 5c087c8..cb7fd9f 100644 if COND_i386_pc -- -1.9.3 +2.7.4 diff --git a/SOURCES/0142-Files-reorganization-and-include-some-libgcc-fuction.patch b/SOURCES/0142-Files-reorganization-and-include-some-libgcc-fuction.patch index 9d34594..dbc2bec 100644 --- a/SOURCES/0142-Files-reorganization-and-include-some-libgcc-fuction.patch +++ b/SOURCES/0142-Files-reorganization-and-include-some-libgcc-fuction.patch @@ -1,7 +1,7 @@ -From a4ea9134214da4801400129cdf7108a5f9e98a10 Mon Sep 17 00:00:00 2001 +From 034afc94f6126bd352587265f03fa383f998f0fc Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Wed, 13 Aug 2014 19:00:19 +0000 -Subject: [PATCH 142/143] Files reorganization and include some libgcc fuctions +Subject: [PATCH 142/198] Files reorganization and include some libgcc fuctions As we avoid libgcc dependency for powerpc64el, we moved some functions to other files and add the necessary ones. @@ -435,5 +435,5 @@ index 8e93b67..5bdb8fb 100644 void EXPORT_FUNC (__aeabi_lasr) (void); void EXPORT_FUNC (__aeabi_llsl) (void); -- -1.9.3 +2.7.4 diff --git a/SOURCES/0143-Suport-for-bi-endianess-in-elf-file.patch b/SOURCES/0143-Suport-for-bi-endianess-in-elf-file.patch index 6971fc9..f65e2c1 100644 --- a/SOURCES/0143-Suport-for-bi-endianess-in-elf-file.patch +++ b/SOURCES/0143-Suport-for-bi-endianess-in-elf-file.patch @@ -1,7 +1,7 @@ -From 9facac630985467ee1ad40beaed07d50ee18062c Mon Sep 17 00:00:00 2001 +From 2dae852b62bb2227ba2e4faf4864c7779104657a Mon Sep 17 00:00:00 2001 From: Paulo Flabiano Smorigo Date: Fri, 15 Aug 2014 14:39:53 -0300 -Subject: [PATCH 143/143] Suport for bi-endianess in elf file +Subject: [PATCH 143/198] Suport for bi-endianess in elf file * grub-core/kern/elf.c: check and switch endianess with grub_{be,le}_to cpu functions. @@ -198,5 +198,5 @@ index 1d09971..ecf9df6 100644 + return GRUB_ERR_NONE; +} -- -1.9.3 +2.7.4 diff --git a/SOURCES/0144-Add-grub_util_readlink.patch b/SOURCES/0144-Add-grub_util_readlink.patch deleted file mode 100644 index 6ba75f0..0000000 --- a/SOURCES/0144-Add-grub_util_readlink.patch +++ /dev/null @@ -1,3734 +0,0 @@ -From a4492dc21cd26878cc5f4a7766275b17b1f0340c Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Wed, 3 Sep 2014 10:01:03 -0400 -Subject: [PATCH 144/145] Add grub_util_readlink() - -Add grub_util_readlink(). This requires pulling in stat and readlink from -gnulib, which pulls in stat and related headers, but after that the -implementation is straightforward. - -Signed-off-by: Peter Jones -Reviewed-by: Adam Jackson ---- - grub-core/gnulib/Makefile.am | 177 +++++++- - grub-core/gnulib/gettimeofday.c | 154 +++++++ - grub-core/gnulib/pathmax.h | 83 ++++ - grub-core/gnulib/readlink.c | 74 ++++ - grub-core/gnulib/stat.c | 138 +++++++ - grub-core/gnulib/sys_stat.in.h | 732 ++++++++++++++++++++++++++++++++++ - grub-core/gnulib/sys_time.in.h | 213 ++++++++++ - grub-core/gnulib/sys_types.in.h | 2 + - grub-core/gnulib/time.h | 586 +++++++++++++++++++++++++++ - grub-core/gnulib/time.in.h | 274 +++++++++++++ - grub-core/osdep/windows/hostdisk.c | 6 + - include/grub/osdep/hostfile_aros.h | 6 + - include/grub/osdep/hostfile_unix.h | 6 + - include/grub/osdep/hostfile_windows.h | 2 + - m4/gettimeofday.m4 | 138 +++++++ - m4/gnulib-cache.m4 | 3 +- - m4/gnulib-comp.m4 | 49 +++ - m4/largefile.m4 | 146 +++++++ - m4/pathmax.m4 | 42 ++ - m4/readlink.m4 | 71 ++++ - m4/stat.m4 | 71 ++++ - m4/sys_stat_h.m4 | 96 +++++ - m4/sys_time_h.m4 | 110 +++++ - m4/time_h.m4 | 118 ++++++ - 24 files changed, 3295 insertions(+), 2 deletions(-) - create mode 100644 grub-core/gnulib/gettimeofday.c - create mode 100644 grub-core/gnulib/pathmax.h - create mode 100644 grub-core/gnulib/readlink.c - create mode 100644 grub-core/gnulib/stat.c - create mode 100644 grub-core/gnulib/sys_stat.in.h - create mode 100644 grub-core/gnulib/sys_time.in.h - create mode 100644 grub-core/gnulib/time.h - create mode 100644 grub-core/gnulib/time.in.h - create mode 100644 m4/gettimeofday.m4 - create mode 100644 m4/largefile.m4 - create mode 100644 m4/pathmax.m4 - create mode 100644 m4/readlink.m4 - create mode 100644 m4/stat.m4 - create mode 100644 m4/sys_stat_h.m4 - create mode 100644 m4/sys_time_h.m4 - create mode 100644 m4/time_h.m4 - -diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am -index 3444397..b7c5e60 100644 ---- a/grub-core/gnulib/Makefile.am -+++ b/grub-core/gnulib/Makefile.am -@@ -21,7 +21,7 @@ - # the same distribution terms as the rest of that program. - # - # Generated by gnulib-tool. --# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex -+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex - - AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects - -@@ -326,6 +326,15 @@ libgnu_a_SOURCES += gettext.h - - ## end gnulib module gettext-h - -+## begin gnulib module gettimeofday -+ -+ -+EXTRA_DIST += gettimeofday.c -+ -+EXTRA_libgnu_a_SOURCES += gettimeofday.c -+ -+## end gnulib module gettimeofday -+ - ## begin gnulib module havelib - - -@@ -596,6 +605,13 @@ EXTRA_libgnu_a_SOURCES += nl_langinfo.c - - ## end gnulib module nl_langinfo - -+## begin gnulib module pathmax -+ -+ -+EXTRA_DIST += pathmax.h -+ -+## end gnulib module pathmax -+ - ## begin gnulib module progname - - libgnu_a_SOURCES += progname.h progname.c -@@ -611,6 +627,15 @@ EXTRA_libgnu_a_SOURCES += rawmemchr.c - - ## end gnulib module rawmemchr - -+## begin gnulib module readlink -+ -+ -+EXTRA_DIST += readlink.c -+ -+EXTRA_libgnu_a_SOURCES += readlink.c -+ -+## end gnulib module readlink -+ - ## begin gnulib module realloc-posix - - -@@ -725,6 +750,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h - - ## end gnulib module snippet/warn-on-use - -+## begin gnulib module stat -+ -+ -+EXTRA_DIST += stat.c -+ -+EXTRA_libgnu_a_SOURCES += stat.c -+ -+## end gnulib module stat -+ - ## begin gnulib module stdalign - - BUILT_SOURCES += $(STDALIGN_H) -@@ -1280,6 +1314,102 @@ libgnu_a_SOURCES += strnlen1.h strnlen1.c - - ## end gnulib module strnlen1 - -+## begin gnulib module sys_stat -+ -+BUILT_SOURCES += sys/stat.h -+ -+# We need the following in order to create when the system -+# has one that is incomplete. -+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_at)$(MKDIR_P) sys -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ -+ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ -+ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ -+ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -+ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -+ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ -+ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -+ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ -+ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -+ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -+ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ -+ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ -+ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ -+ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -+ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -+ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -+ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -+ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ -+ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -+ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -+ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ -+ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ -+ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ -+ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ -+ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ -+ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ -+ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ -+ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ -+ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ -+ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -+ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -+ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ -+ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ -+ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -+ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/sys_stat.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t -+MOSTLYCLEANDIRS += sys -+ -+EXTRA_DIST += sys_stat.in.h -+ -+## end gnulib module sys_stat -+ -+## begin gnulib module sys_time -+ -+BUILT_SOURCES += sys/time.h -+ -+# We need the following in order to create when the system -+# doesn't have one that works with the given compiler. -+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_at)$(MKDIR_P) sys -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ -+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -+ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ -+ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ -+ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ -+ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ -+ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/sys_time.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += sys/time.h sys/time.h-t -+ -+EXTRA_DIST += sys_time.in.h -+ -+## end gnulib module sys_time -+ - ## begin gnulib module sys_types - - BUILT_SOURCES += sys/types.h -@@ -1334,6 +1464,51 @@ EXTRA_DIST += sysexits.in.h - - ## end gnulib module sysexits - -+## begin gnulib module time -+ -+BUILT_SOURCES += time.h -+ -+# We need the following in order to create when the system -+# doesn't have one that works with the given compiler. -+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -+ $(AM_V_GEN)rm -f $@-t $@ && \ -+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ -+ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ -+ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -+ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -+ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -+ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ -+ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ -+ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ -+ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ -+ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -+ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ -+ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -+ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -+ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -+ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -+ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ -+ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -+ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ -+ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ -+ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ -+ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ -+ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ -+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -+ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -+ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -+ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ -+ < $(srcdir)/time.in.h; \ -+ } > $@-t && \ -+ mv $@-t $@ -+MOSTLYCLEANFILES += time.h time.h-t -+ -+EXTRA_DIST += time.in.h -+ -+## end gnulib module time -+ - ## begin gnulib module unistd - - BUILT_SOURCES += unistd.h -diff --git a/grub-core/gnulib/gettimeofday.c b/grub-core/gnulib/gettimeofday.c -new file mode 100644 -index 0000000..8b2058e ---- /dev/null -+++ b/grub-core/gnulib/gettimeofday.c -@@ -0,0 +1,154 @@ -+/* Provide gettimeofday for systems that don't have it or for which it's broken. -+ -+ Copyright (C) 2001-2003, 2005-2007, 2009-2014 Free Software Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+/* written by Jim Meyering */ -+ -+#include -+ -+/* Specification. */ -+#include -+ -+#include -+ -+#if HAVE_SYS_TIMEB_H -+# include -+#endif -+ -+#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME -+ -+/* Work around the bug in some systems whereby gettimeofday clobbers -+ the static buffer that localtime uses for its return value. The -+ gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has -+ this problem. The tzset replacement is necessary for at least -+ Solaris 2.5, 2.5.1, and 2.6. */ -+ -+static struct tm tm_zero_buffer; -+static struct tm *localtime_buffer_addr = &tm_zero_buffer; -+ -+# undef localtime -+extern struct tm *localtime (time_t const *); -+ -+# undef gmtime -+extern struct tm *gmtime (time_t const *); -+ -+/* This is a wrapper for localtime. It is used only on systems for which -+ gettimeofday clobbers the static buffer used for localtime's result. -+ -+ On the first call, record the address of the static buffer that -+ localtime uses for its result. */ -+ -+struct tm * -+rpl_localtime (time_t const *timep) -+{ -+ struct tm *tm = localtime (timep); -+ -+ if (localtime_buffer_addr == &tm_zero_buffer) -+ localtime_buffer_addr = tm; -+ -+ return tm; -+} -+ -+/* Same as above, since gmtime and localtime use the same buffer. */ -+struct tm * -+rpl_gmtime (time_t const *timep) -+{ -+ struct tm *tm = gmtime (timep); -+ -+ if (localtime_buffer_addr == &tm_zero_buffer) -+ localtime_buffer_addr = tm; -+ -+ return tm; -+} -+ -+#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ -+ -+#if TZSET_CLOBBERS_LOCALTIME -+ -+# undef tzset -+extern void tzset (void); -+ -+/* This is a wrapper for tzset, for systems on which tzset may clobber -+ the static buffer used for localtime's result. */ -+void -+rpl_tzset (void) -+{ -+ /* Save and restore the contents of the buffer used for localtime's -+ result around the call to tzset. */ -+ struct tm save = *localtime_buffer_addr; -+ tzset (); -+ *localtime_buffer_addr = save; -+} -+#endif -+ -+/* This is a wrapper for gettimeofday. It is used only on systems -+ that lack this function, or whose implementation of this function -+ causes problems. */ -+ -+int -+gettimeofday (struct timeval *restrict tv, void *restrict tz) -+{ -+#undef gettimeofday -+#if HAVE_GETTIMEOFDAY -+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME -+ /* Save and restore the contents of the buffer used for localtime's -+ result around the call to gettimeofday. */ -+ struct tm save = *localtime_buffer_addr; -+# endif -+ -+# if defined timeval /* 'struct timeval' overridden by gnulib? */ -+# undef timeval -+ struct timeval otv; -+ int result = gettimeofday (&otv, (struct timezone *) tz); -+ if (result == 0) -+ { -+ tv->tv_sec = otv.tv_sec; -+ tv->tv_usec = otv.tv_usec; -+ } -+# else -+ int result = gettimeofday (tv, (struct timezone *) tz); -+# endif -+ -+# if GETTIMEOFDAY_CLOBBERS_LOCALTIME -+ *localtime_buffer_addr = save; -+# endif -+ -+ return result; -+ -+#else -+ -+# if HAVE__FTIME -+ -+ struct _timeb timebuf; -+ _ftime (&timebuf); -+ tv->tv_sec = timebuf.time; -+ tv->tv_usec = timebuf.millitm * 1000; -+ -+# else -+ -+# if !defined OK_TO_USE_1S_CLOCK -+# error "Only 1-second nominal clock resolution found. Is that intended?" \ -+ "If so, compile with the -DOK_TO_USE_1S_CLOCK option." -+# endif -+ tv->tv_sec = time (NULL); -+ tv->tv_usec = 0; -+ -+# endif -+ -+ return 0; -+ -+#endif -+} -diff --git a/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h -new file mode 100644 -index 0000000..33fc355 ---- /dev/null -+++ b/grub-core/gnulib/pathmax.h -@@ -0,0 +1,83 @@ -+/* Define PATH_MAX somehow. Requires sys/types.h. -+ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2014 Free Software -+ Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+#ifndef _PATHMAX_H -+# define _PATHMAX_H -+ -+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename, -+ including the terminating NUL byte. -+ -+ PATH_MAX is not defined on systems which have no limit on filename length, -+ such as GNU/Hurd. -+ -+ This file does *not* define PATH_MAX always. Programs that use this file -+ can handle the GNU/Hurd case in several ways: -+ - Either with a package-wide handling, or with a per-file handling, -+ - Either through a -+ #ifdef PATH_MAX -+ or through a fallback like -+ #ifndef PATH_MAX -+ # define PATH_MAX 8192 -+ #endif -+ or through a fallback like -+ #ifndef PATH_MAX -+ # define PATH_MAX pathconf ("/", _PC_PATH_MAX) -+ #endif -+ */ -+ -+# include -+ -+# include -+ -+# ifndef _POSIX_PATH_MAX -+# define _POSIX_PATH_MAX 256 -+# endif -+ -+/* Don't include sys/param.h if it already has been. */ -+# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN -+# include -+# endif -+ -+# if !defined PATH_MAX && defined MAXPATHLEN -+# define PATH_MAX MAXPATHLEN -+# endif -+ -+# ifdef __hpux -+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename, -+ *not* including the terminating NUL byte, and is set to 1023. -+ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is -+ not defined at all any more. */ -+# undef PATH_MAX -+# define PATH_MAX 1024 -+# endif -+ -+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, -+ section "Maximum Path Length Limitation", -+ -+ explains that the maximum size of a filename, including the terminating -+ NUL byte, is 260 = 3 + 256 + 1. -+ This is the same value as -+ - FILENAME_MAX in , -+ - _MAX_PATH in , -+ - MAX_PATH in . -+ Undefine the original value, because mingw's gets it wrong. */ -+# undef PATH_MAX -+# define PATH_MAX 260 -+# endif -+ -+#endif /* _PATHMAX_H */ -diff --git a/grub-core/gnulib/readlink.c b/grub-core/gnulib/readlink.c -new file mode 100644 -index 0000000..4c49639 ---- /dev/null -+++ b/grub-core/gnulib/readlink.c -@@ -0,0 +1,74 @@ -+/* Stub for readlink(). -+ Copyright (C) 2003-2007, 2009-2014 Free Software Foundation, Inc. -+ -+ This program 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. -+ -+ This program 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 this program. If not, see . */ -+ -+#include -+ -+/* Specification. */ -+#include -+ -+#include -+#include -+#include -+ -+#if !HAVE_READLINK -+ -+/* readlink() substitute for systems that don't have a readlink() function, -+ such as DJGPP 2.03 and mingw32. */ -+ -+ssize_t -+readlink (const char *name, char *buf _GL_UNUSED, -+ size_t bufsize _GL_UNUSED) -+{ -+ struct stat statbuf; -+ -+ /* In general we should use lstat() here, not stat(). But on platforms -+ without symbolic links, lstat() - if it exists - would be equivalent to -+ stat(), therefore we can use stat(). This saves us a configure check. */ -+ if (stat (name, &statbuf) >= 0) -+ errno = EINVAL; -+ return -1; -+} -+ -+#else /* HAVE_READLINK */ -+ -+# undef readlink -+ -+/* readlink() wrapper that uses correct types, for systems like cygwin -+ 1.5.x where readlink returns int, and which rejects trailing slash, -+ for Solaris 9. */ -+ -+ssize_t -+rpl_readlink (const char *name, char *buf, size_t bufsize) -+{ -+# if READLINK_TRAILING_SLASH_BUG -+ size_t len = strlen (name); -+ if (len && name[len - 1] == '/') -+ { -+ /* Even if name without the slash is a symlink to a directory, -+ both lstat() and stat() must resolve the trailing slash to -+ the directory rather than the symlink. We can therefore -+ safely use stat() to distinguish between EINVAL and -+ ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */ -+ struct stat st; -+ if (stat (name, &st) == 0) -+ errno = EINVAL; -+ return -1; -+ } -+# endif /* READLINK_TRAILING_SLASH_BUG */ -+ return readlink (name, buf, bufsize); -+} -+ -+#endif /* HAVE_READLINK */ -diff --git a/grub-core/gnulib/stat.c b/grub-core/gnulib/stat.c -new file mode 100644 -index 0000000..35f4b0b ---- /dev/null -+++ b/grub-core/gnulib/stat.c -@@ -0,0 +1,138 @@ -+/* Work around platform bugs in stat. -+ Copyright (C) 2009-2014 Free Software Foundation, Inc. -+ -+ This program 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. -+ -+ This program 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 this program. If not, see . */ -+ -+/* written by Eric Blake */ -+ -+/* If the user's config.h happens to include , let it include only -+ the system's here, so that orig_stat doesn't recurse to -+ rpl_stat. */ -+#define __need_system_sys_stat_h -+#include -+ -+/* Get the original definition of stat. It might be defined as a macro. */ -+#include -+#include -+#undef __need_system_sys_stat_h -+ -+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+# if _GL_WINDOWS_64_BIT_ST_SIZE -+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */ -+# define stat _stati64 -+# define REPLACE_FUNC_STAT_DIR 1 -+# undef REPLACE_FUNC_STAT_FILE -+# elif REPLACE_FUNC_STAT_FILE -+/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a. -+ Bypass it. */ -+# define stat _stat -+# define REPLACE_FUNC_STAT_DIR 1 -+# undef REPLACE_FUNC_STAT_FILE -+# endif -+#endif -+ -+static int -+orig_stat (const char *filename, struct stat *buf) -+{ -+ return stat (filename, buf); -+} -+ -+/* Specification. */ -+/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc -+ eliminates this include because of the preliminary #include -+ above. */ -+#include "sys/stat.h" -+ -+#include -+#include -+#include -+#include -+#include "dosname.h" -+#include "verify.h" -+ -+#if REPLACE_FUNC_STAT_DIR -+# include "pathmax.h" -+ /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also -+ have a constant PATH_MAX. */ -+# ifndef PATH_MAX -+# error "Please port this replacement to your platform" -+# endif -+#endif -+ -+/* Store information about NAME into ST. Work around bugs with -+ trailing slashes. Mingw has other bugs (such as st_ino always -+ being 0 on success) which this wrapper does not work around. But -+ at least this implementation provides the ability to emulate fchdir -+ correctly. */ -+ -+int -+rpl_stat (char const *name, struct stat *st) -+{ -+ int result = orig_stat (name, st); -+#if REPLACE_FUNC_STAT_FILE -+ /* Solaris 9 mistakenly succeeds when given a non-directory with a -+ trailing slash. */ -+ if (result == 0 && !S_ISDIR (st->st_mode)) -+ { -+ size_t len = strlen (name); -+ if (ISSLASH (name[len - 1])) -+ { -+ errno = ENOTDIR; -+ return -1; -+ } -+ } -+#endif /* REPLACE_FUNC_STAT_FILE */ -+#if REPLACE_FUNC_STAT_DIR -+ -+ if (result == -1 && errno == ENOENT) -+ { -+ /* Due to mingw's oddities, there are some directories (like -+ c:\) where stat() only succeeds with a trailing slash, and -+ other directories (like c:\windows) where stat() only -+ succeeds without a trailing slash. But we want the two to be -+ synonymous, since chdir() manages either style. Likewise, Mingw also -+ reports ENOENT for names longer than PATH_MAX, when we want -+ ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR. -+ Fortunately, mingw PATH_MAX is small enough for stack -+ allocation. */ -+ char fixed_name[PATH_MAX + 1] = {0}; -+ size_t len = strlen (name); -+ bool check_dir = false; -+ verify (PATH_MAX <= 4096); -+ if (PATH_MAX <= len) -+ errno = ENAMETOOLONG; -+ else if (len) -+ { -+ strcpy (fixed_name, name); -+ if (ISSLASH (fixed_name[len - 1])) -+ { -+ check_dir = true; -+ while (len && ISSLASH (fixed_name[len - 1])) -+ fixed_name[--len] = '\0'; -+ if (!len) -+ fixed_name[0] = '/'; -+ } -+ else -+ fixed_name[len++] = '/'; -+ result = orig_stat (fixed_name, st); -+ if (result == 0 && check_dir && !S_ISDIR (st->st_mode)) -+ { -+ result = -1; -+ errno = ENOTDIR; -+ } -+ } -+ } -+#endif /* REPLACE_FUNC_STAT_DIR */ -+ return result; -+} -diff --git a/grub-core/gnulib/sys_stat.in.h b/grub-core/gnulib/sys_stat.in.h -new file mode 100644 -index 0000000..b47a7ff ---- /dev/null -+++ b/grub-core/gnulib/sys_stat.in.h -@@ -0,0 +1,732 @@ -+/* Provide a more complete sys/stat header file. -+ Copyright (C) 2005-2014 Free Software Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ -+ -+/* This file is supposed to be used on platforms where is -+ incomplete. It is intended to provide definitions and prototypes -+ needed by an application. Start with what the system provides. */ -+ -+#if __GNUC__ >= 3 -+@PRAGMA_SYSTEM_HEADER@ -+#endif -+@PRAGMA_COLUMNS@ -+ -+#if defined __need_system_sys_stat_h -+/* Special invocation convention. */ -+ -+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ -+ -+#else -+/* Normal invocation convention. */ -+ -+#ifndef _@GUARD_PREFIX@_SYS_STAT_H -+ -+/* Get nlink_t. -+ May also define off_t to a 64-bit type on native Windows. */ -+#include -+ -+/* Get struct timespec. */ -+#include -+ -+/* The include_next requires a split double-inclusion guard. */ -+#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ -+ -+#ifndef _@GUARD_PREFIX@_SYS_STAT_H -+#define _@GUARD_PREFIX@_SYS_STAT_H -+ -+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -+ -+/* The definition of _GL_ARG_NONNULL is copied here. */ -+ -+/* The definition of _GL_WARN_ON_USE is copied here. */ -+ -+/* Before doing "#define mkdir rpl_mkdir" below, we need to include all -+ headers that may declare mkdir(). Native Windows platforms declare mkdir -+ in and/or , not in . */ -+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+# include /* mingw32, mingw64 */ -+# include /* mingw64, MSVC 9 */ -+#endif -+ -+/* Native Windows platforms declare umask() in . */ -+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) -+# include -+#endif -+ -+/* Large File Support on native Windows. */ -+#if @WINDOWS_64_BIT_ST_SIZE@ -+# define stat _stati64 -+#endif -+ -+#ifndef S_IFIFO -+# ifdef _S_IFIFO -+# define S_IFIFO _S_IFIFO -+# endif -+#endif -+ -+#ifndef S_IFMT -+# define S_IFMT 0170000 -+#endif -+ -+#if STAT_MACROS_BROKEN -+# undef S_ISBLK -+# undef S_ISCHR -+# undef S_ISDIR -+# undef S_ISFIFO -+# undef S_ISLNK -+# undef S_ISNAM -+# undef S_ISMPB -+# undef S_ISMPC -+# undef S_ISNWK -+# undef S_ISREG -+# undef S_ISSOCK -+#endif -+ -+#ifndef S_ISBLK -+# ifdef S_IFBLK -+# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -+# else -+# define S_ISBLK(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISCHR -+# ifdef S_IFCHR -+# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -+# else -+# define S_ISCHR(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISDIR -+# ifdef S_IFDIR -+# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -+# else -+# define S_ISDIR(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISDOOR /* Solaris 2.5 and up */ -+# define S_ISDOOR(m) 0 -+#endif -+ -+#ifndef S_ISFIFO -+# ifdef S_IFIFO -+# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -+# else -+# define S_ISFIFO(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISLNK -+# ifdef S_IFLNK -+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -+# else -+# define S_ISLNK(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISMPB /* V7 */ -+# ifdef S_IFMPB -+# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -+# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -+# else -+# define S_ISMPB(m) 0 -+# define S_ISMPC(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISMPX /* AIX */ -+# define S_ISMPX(m) 0 -+#endif -+ -+#ifndef S_ISNAM /* Xenix */ -+# ifdef S_IFNAM -+# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) -+# else -+# define S_ISNAM(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISNWK /* HP/UX */ -+# ifdef S_IFNWK -+# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -+# else -+# define S_ISNWK(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISPORT /* Solaris 10 and up */ -+# define S_ISPORT(m) 0 -+#endif -+ -+#ifndef S_ISREG -+# ifdef S_IFREG -+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -+# else -+# define S_ISREG(m) 0 -+# endif -+#endif -+ -+#ifndef S_ISSOCK -+# ifdef S_IFSOCK -+# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -+# else -+# define S_ISSOCK(m) 0 -+# endif -+#endif -+ -+ -+#ifndef S_TYPEISMQ -+# define S_TYPEISMQ(p) 0 -+#endif -+ -+#ifndef S_TYPEISTMO -+# define S_TYPEISTMO(p) 0 -+#endif -+ -+ -+#ifndef S_TYPEISSEM -+# ifdef S_INSEM -+# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) -+# else -+# define S_TYPEISSEM(p) 0 -+# endif -+#endif -+ -+#ifndef S_TYPEISSHM -+# ifdef S_INSHD -+# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) -+# else -+# define S_TYPEISSHM(p) 0 -+# endif -+#endif -+ -+/* high performance ("contiguous data") */ -+#ifndef S_ISCTG -+# define S_ISCTG(p) 0 -+#endif -+ -+/* Cray DMF (data migration facility): off line, with data */ -+#ifndef S_ISOFD -+# define S_ISOFD(p) 0 -+#endif -+ -+/* Cray DMF (data migration facility): off line, with no data */ -+#ifndef S_ISOFL -+# define S_ISOFL(p) 0 -+#endif -+ -+/* 4.4BSD whiteout */ -+#ifndef S_ISWHT -+# define S_ISWHT(m) 0 -+#endif -+ -+/* If any of the following are undefined, -+ define them to their de facto standard values. */ -+#if !S_ISUID -+# define S_ISUID 04000 -+#endif -+#if !S_ISGID -+# define S_ISGID 02000 -+#endif -+ -+/* S_ISVTX is a common extension to POSIX. */ -+#ifndef S_ISVTX -+# define S_ISVTX 01000 -+#endif -+ -+#if !S_IRUSR && S_IREAD -+# define S_IRUSR S_IREAD -+#endif -+#if !S_IRUSR -+# define S_IRUSR 00400 -+#endif -+#if !S_IRGRP -+# define S_IRGRP (S_IRUSR >> 3) -+#endif -+#if !S_IROTH -+# define S_IROTH (S_IRUSR >> 6) -+#endif -+ -+#if !S_IWUSR && S_IWRITE -+# define S_IWUSR S_IWRITE -+#endif -+#if !S_IWUSR -+# define S_IWUSR 00200 -+#endif -+#if !S_IWGRP -+# define S_IWGRP (S_IWUSR >> 3) -+#endif -+#if !S_IWOTH -+# define S_IWOTH (S_IWUSR >> 6) -+#endif -+ -+#if !S_IXUSR && S_IEXEC -+# define S_IXUSR S_IEXEC -+#endif -+#if !S_IXUSR -+# define S_IXUSR 00100 -+#endif -+#if !S_IXGRP -+# define S_IXGRP (S_IXUSR >> 3) -+#endif -+#if !S_IXOTH -+# define S_IXOTH (S_IXUSR >> 6) -+#endif -+ -+#if !S_IRWXU -+# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -+#endif -+#if !S_IRWXG -+# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) -+#endif -+#if !S_IRWXO -+# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -+#endif -+ -+/* S_IXUGO is a common extension to POSIX. */ -+#if !S_IXUGO -+# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) -+#endif -+ -+#ifndef S_IRWXUGO -+# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) -+#endif -+ -+/* Macros for futimens and utimensat. */ -+#ifndef UTIME_NOW -+# define UTIME_NOW (-1) -+# define UTIME_OMIT (-2) -+#endif -+ -+ -+#if @GNULIB_FCHMODAT@ -+# if !@HAVE_FCHMODAT@ -+_GL_FUNCDECL_SYS (fchmodat, int, -+ (int fd, char const *file, mode_t mode, int flag) -+ _GL_ARG_NONNULL ((2))); -+# endif -+_GL_CXXALIAS_SYS (fchmodat, int, -+ (int fd, char const *file, mode_t mode, int flag)); -+_GL_CXXALIASWARN (fchmodat); -+#elif defined GNULIB_POSIXCHECK -+# undef fchmodat -+# if HAVE_RAW_DECL_FCHMODAT -+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " -+ "use gnulib module openat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_FSTAT@ -+# if @REPLACE_FSTAT@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef fstat -+# define fstat rpl_fstat -+# endif -+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); -+_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); -+# else -+_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); -+# endif -+_GL_CXXALIASWARN (fstat); -+#elif @WINDOWS_64_BIT_ST_SIZE@ -+/* Above, we define stat to _stati64. */ -+# define fstat _fstati64 -+#elif defined GNULIB_POSIXCHECK -+# undef fstat -+# if HAVE_RAW_DECL_FSTAT -+_GL_WARN_ON_USE (fstat, "fstat has portability problems - " -+ "use gnulib module fstat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_FSTATAT@ -+# if @REPLACE_FSTATAT@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef fstatat -+# define fstatat rpl_fstatat -+# endif -+_GL_FUNCDECL_RPL (fstatat, int, -+ (int fd, char const *name, struct stat *st, int flags) -+ _GL_ARG_NONNULL ((2, 3))); -+_GL_CXXALIAS_RPL (fstatat, int, -+ (int fd, char const *name, struct stat *st, int flags)); -+# else -+# if !@HAVE_FSTATAT@ -+_GL_FUNCDECL_SYS (fstatat, int, -+ (int fd, char const *name, struct stat *st, int flags) -+ _GL_ARG_NONNULL ((2, 3))); -+# endif -+_GL_CXXALIAS_SYS (fstatat, int, -+ (int fd, char const *name, struct stat *st, int flags)); -+# endif -+_GL_CXXALIASWARN (fstatat); -+#elif defined GNULIB_POSIXCHECK -+# undef fstatat -+# if HAVE_RAW_DECL_FSTATAT -+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - " -+ "use gnulib module openat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_FUTIMENS@ -+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens -+ implementation relies on futimesat, which on Solaris 10 makes an invocation -+ to futimens that is meant to invoke the libc's futimens(), not gnulib's -+ futimens(). */ -+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun) -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef futimens -+# define futimens rpl_futimens -+# endif -+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2])); -+_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2])); -+# else -+# if !@HAVE_FUTIMENS@ -+_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); -+# endif -+_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); -+# endif -+# if @HAVE_FUTIMENS@ -+_GL_CXXALIASWARN (futimens); -+# endif -+#elif defined GNULIB_POSIXCHECK -+# undef futimens -+# if HAVE_RAW_DECL_FUTIMENS -+_GL_WARN_ON_USE (futimens, "futimens is not portable - " -+ "use gnulib module futimens for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_LCHMOD@ -+/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME -+ denotes a symbolic link. */ -+# if !@HAVE_LCHMOD@ -+/* The lchmod replacement follows symbolic links. Callers should take -+ this into account; lchmod should be applied only to arguments that -+ are known to not be symbolic links. On hosts that lack lchmod, -+ this can lead to race conditions between the check and the -+ invocation of lchmod, but we know of no workarounds that are -+ reliable in general. You might try requesting support for lchmod -+ from your operating system supplier. */ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define lchmod chmod -+# endif -+/* Need to cast, because on mingw, the second parameter of chmod is -+ int mode. */ -+_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int, -+ (const char *filename, mode_t mode)); -+# else -+# if 0 /* assume already declared */ -+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) -+ _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); -+# endif -+# if @HAVE_LCHMOD@ -+_GL_CXXALIASWARN (lchmod); -+# endif -+#elif defined GNULIB_POSIXCHECK -+# undef lchmod -+# if HAVE_RAW_DECL_LCHMOD -+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - " -+ "use gnulib module lchmod for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_LSTAT@ -+# if ! @HAVE_LSTAT@ -+/* mingw does not support symlinks, therefore it does not have lstat. But -+ without links, stat does just fine. */ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define lstat stat -+# endif -+_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf)); -+# elif @REPLACE_LSTAT@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef lstat -+# define lstat rpl_lstat -+# endif -+_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf) -+ _GL_ARG_NONNULL ((1, 2))); -+_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf)); -+# else -+_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf)); -+# endif -+# if @HAVE_LSTAT@ -+_GL_CXXALIASWARN (lstat); -+# endif -+#elif defined GNULIB_POSIXCHECK -+# undef lstat -+# if HAVE_RAW_DECL_LSTAT -+_GL_WARN_ON_USE (lstat, "lstat is unportable - " -+ "use gnulib module lstat for portability"); -+# endif -+#endif -+ -+ -+#if @REPLACE_MKDIR@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef mkdir -+# define mkdir rpl_mkdir -+# endif -+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); -+#else -+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. -+ Additionally, it declares _mkdir (and depending on compile flags, an -+ alias mkdir), only in the nonstandard includes and , -+ which are included above. */ -+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+ -+# if !GNULIB_defined_rpl_mkdir -+static int -+rpl_mkdir (char const *name, mode_t mode) -+{ -+ return _mkdir (name); -+} -+# define GNULIB_defined_rpl_mkdir 1 -+# endif -+ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define mkdir rpl_mkdir -+# endif -+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); -+# else -+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); -+# endif -+#endif -+_GL_CXXALIASWARN (mkdir); -+ -+ -+#if @GNULIB_MKDIRAT@ -+# if !@HAVE_MKDIRAT@ -+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode) -+ _GL_ARG_NONNULL ((2))); -+# endif -+_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)); -+_GL_CXXALIASWARN (mkdirat); -+#elif defined GNULIB_POSIXCHECK -+# undef mkdirat -+# if HAVE_RAW_DECL_MKDIRAT -+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - " -+ "use gnulib module openat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_MKFIFO@ -+# if @REPLACE_MKFIFO@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef mkfifo -+# define mkfifo rpl_mkfifo -+# endif -+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode)); -+# else -+# if !@HAVE_MKFIFO@ -+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode) -+ _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode)); -+# endif -+_GL_CXXALIASWARN (mkfifo); -+#elif defined GNULIB_POSIXCHECK -+# undef mkfifo -+# if HAVE_RAW_DECL_MKFIFO -+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - " -+ "use gnulib module mkfifo for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_MKFIFOAT@ -+# if !@HAVE_MKFIFOAT@ -+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) -+ _GL_ARG_NONNULL ((2))); -+# endif -+_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); -+_GL_CXXALIASWARN (mkfifoat); -+#elif defined GNULIB_POSIXCHECK -+# undef mkfifoat -+# if HAVE_RAW_DECL_MKFIFOAT -+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - " -+ "use gnulib module mkfifoat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_MKNOD@ -+# if @REPLACE_MKNOD@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef mknod -+# define mknod rpl_mknod -+# endif -+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); -+# else -+# if !@HAVE_MKNOD@ -+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) -+ _GL_ARG_NONNULL ((1))); -+# endif -+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ -+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); -+# endif -+_GL_CXXALIASWARN (mknod); -+#elif defined GNULIB_POSIXCHECK -+# undef mknod -+# if HAVE_RAW_DECL_MKNOD -+_GL_WARN_ON_USE (mknod, "mknod is not portable - " -+ "use gnulib module mknod for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_MKNODAT@ -+# if !@HAVE_MKNODAT@ -+_GL_FUNCDECL_SYS (mknodat, int, -+ (int fd, char const *file, mode_t mode, dev_t dev) -+ _GL_ARG_NONNULL ((2))); -+# endif -+_GL_CXXALIAS_SYS (mknodat, int, -+ (int fd, char const *file, mode_t mode, dev_t dev)); -+_GL_CXXALIASWARN (mknodat); -+#elif defined GNULIB_POSIXCHECK -+# undef mknodat -+# if HAVE_RAW_DECL_MKNODAT -+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - " -+ "use gnulib module mkfifoat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_STAT@ -+# if @REPLACE_STAT@ -+/* We can't use the object-like #define stat rpl_stat, because of -+ struct stat. This means that rpl_stat will not be used if the user -+ does (stat)(a,b). Oh well. */ -+# if defined _AIX && defined stat && defined _LARGE_FILES -+ /* With _LARGE_FILES defined, AIX (only) defines stat to stat64, -+ so we have to replace stat64() instead of stat(). */ -+# undef stat64 -+# define stat64(name, st) rpl_stat (name, st) -+# elif @WINDOWS_64_BIT_ST_SIZE@ -+ /* Above, we define stat to _stati64. */ -+# if defined __MINGW32__ && defined _stati64 -+# ifndef _USE_32BIT_TIME_T -+ /* The system headers define _stati64 to _stat64. */ -+# undef _stat64 -+# define _stat64(name, st) rpl_stat (name, st) -+# endif -+# elif defined _MSC_VER && defined _stati64 -+# ifdef _USE_32BIT_TIME_T -+ /* The system headers define _stati64 to _stat32i64. */ -+# undef _stat32i64 -+# define _stat32i64(name, st) rpl_stat (name, st) -+# else -+ /* The system headers define _stati64 to _stat64. */ -+# undef _stat64 -+# define _stat64(name, st) rpl_stat (name, st) -+# endif -+# else -+# undef _stati64 -+# define _stati64(name, st) rpl_stat (name, st) -+# endif -+# elif defined __MINGW32__ && defined stat -+# ifdef _USE_32BIT_TIME_T -+ /* The system headers define stat to _stat32i64. */ -+# undef _stat32i64 -+# define _stat32i64(name, st) rpl_stat (name, st) -+# else -+ /* The system headers define stat to _stat64. */ -+# undef _stat64 -+# define _stat64(name, st) rpl_stat (name, st) -+# endif -+# elif defined _MSC_VER && defined stat -+# ifdef _USE_32BIT_TIME_T -+ /* The system headers define stat to _stat32. */ -+# undef _stat32 -+# define _stat32(name, st) rpl_stat (name, st) -+# else -+ /* The system headers define stat to _stat64i32. */ -+# undef _stat64i32 -+# define _stat64i32(name, st) rpl_stat (name, st) -+# endif -+# else /* !(_AIX ||__MINGW32__ || _MSC_VER) */ -+# undef stat -+# define stat(name, st) rpl_stat (name, st) -+# endif /* !_LARGE_FILES */ -+_GL_EXTERN_C int stat (const char *name, struct stat *buf) -+ _GL_ARG_NONNULL ((1, 2)); -+# endif -+#elif defined GNULIB_POSIXCHECK -+# undef stat -+# if HAVE_RAW_DECL_STAT -+_GL_WARN_ON_USE (stat, "stat is unportable - " -+ "use gnulib module stat for portability"); -+# endif -+#endif -+ -+ -+#if @GNULIB_UTIMENSAT@ -+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat -+ implementation relies on futimesat, which on Solaris 10 makes an invocation -+ to utimensat that is meant to invoke the libc's utimensat(), not gnulib's -+ utimensat(). */ -+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun) -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef utimensat -+# define utimensat rpl_utimensat -+# endif -+_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name, -+ struct timespec const times[2], int flag) -+ _GL_ARG_NONNULL ((2))); -+_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name, -+ struct timespec const times[2], int flag)); -+# else -+# if !@HAVE_UTIMENSAT@ -+_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, -+ struct timespec const times[2], int flag) -+ _GL_ARG_NONNULL ((2))); -+# endif -+_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, -+ struct timespec const times[2], int flag)); -+# endif -+# if @HAVE_UTIMENSAT@ -+_GL_CXXALIASWARN (utimensat); -+# endif -+#elif defined GNULIB_POSIXCHECK -+# undef utimensat -+# if HAVE_RAW_DECL_UTIMENSAT -+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - " -+ "use gnulib module utimensat for portability"); -+# endif -+#endif -+ -+ -+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ -+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ -+#endif -diff --git a/grub-core/gnulib/sys_time.in.h b/grub-core/gnulib/sys_time.in.h -new file mode 100644 -index 0000000..30057ad ---- /dev/null -+++ b/grub-core/gnulib/sys_time.in.h -@@ -0,0 +1,213 @@ -+/* Provide a more complete sys/time.h. -+ -+ Copyright (C) 2007-2014 Free Software Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+/* Written by Paul Eggert. */ -+ -+#ifndef _@GUARD_PREFIX@_SYS_TIME_H -+ -+#if __GNUC__ >= 3 -+@PRAGMA_SYSTEM_HEADER@ -+#endif -+@PRAGMA_COLUMNS@ -+ -+/* On Cygwin and on many BSDish systems, includes itself -+ recursively via . -+ Simply delegate to the system's header in this case; it is a no-op. -+ Without this extra ifdef, the C++ gettimeofday declaration below -+ would be a forward declaration in gnulib's nested . */ -+#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_ -+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ -+#else -+ -+/* The include_next requires a split double-inclusion guard. */ -+#if @HAVE_SYS_TIME_H@ -+# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ -+#endif -+ -+#ifndef _@GUARD_PREFIX@_SYS_TIME_H -+#define _@GUARD_PREFIX@_SYS_TIME_H -+ -+#if ! @HAVE_SYS_TIME_H@ -+# include -+#endif -+ -+/* On native Windows with MSVC, get the 'struct timeval' type. -+ Also, on native Windows with a 64-bit time_t, where we are overriding the -+ 'struct timeval' type, get all declarations of system functions whose -+ signature contains 'struct timeval'. */ -+#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H -+# define _GL_INCLUDING_WINSOCK2_H -+# include -+# undef _GL_INCLUDING_WINSOCK2_H -+#endif -+ -+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -+ -+/* The definition of _GL_ARG_NONNULL is copied here. */ -+ -+/* The definition of _GL_WARN_ON_USE is copied here. */ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@ -+ -+# if @REPLACE_STRUCT_TIMEVAL@ -+# define timeval rpl_timeval -+# endif -+ -+# if !GNULIB_defined_struct_timeval -+struct timeval -+{ -+ time_t tv_sec; -+ long int tv_usec; -+}; -+# define GNULIB_defined_struct_timeval 1 -+# endif -+ -+#endif -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#if @GNULIB_GETTIMEOFDAY@ -+# if @REPLACE_GETTIMEOFDAY@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gettimeofday -+# define gettimeofday rpl_gettimeofday -+# endif -+_GL_FUNCDECL_RPL (gettimeofday, int, -+ (struct timeval *restrict, void *restrict) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (gettimeofday, int, -+ (struct timeval *restrict, void *restrict)); -+# else -+# if !@HAVE_GETTIMEOFDAY@ -+_GL_FUNCDECL_SYS (gettimeofday, int, -+ (struct timeval *restrict, void *restrict) -+ _GL_ARG_NONNULL ((1))); -+# endif -+/* Need to cast, because on glibc systems, by default, the second argument is -+ struct timezone *. */ -+_GL_CXXALIAS_SYS_CAST (gettimeofday, int, -+ (struct timeval *restrict, void *restrict)); -+# endif -+_GL_CXXALIASWARN (gettimeofday); -+#elif defined GNULIB_POSIXCHECK -+# undef gettimeofday -+# if HAVE_RAW_DECL_GETTIMEOFDAY -+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - " -+ "use gnulib module gettimeofday for portability"); -+# endif -+#endif -+ -+/* Hide some function declarations from . */ -+ -+#if defined _MSC_VER && @HAVE_WINSOCK2_H@ -+# if !defined _@GUARD_PREFIX@_UNISTD_H -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef close -+# define close close_used_without_including_unistd_h -+# else -+ _GL_WARN_ON_USE (close, -+ "close() used without including "); -+# endif -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gethostname -+# define gethostname gethostname_used_without_including_unistd_h -+# else -+ _GL_WARN_ON_USE (gethostname, -+ "gethostname() used without including "); -+# endif -+# endif -+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef socket -+# define socket socket_used_without_including_sys_socket_h -+# undef connect -+# define connect connect_used_without_including_sys_socket_h -+# undef accept -+# define accept accept_used_without_including_sys_socket_h -+# undef bind -+# define bind bind_used_without_including_sys_socket_h -+# undef getpeername -+# define getpeername getpeername_used_without_including_sys_socket_h -+# undef getsockname -+# define getsockname getsockname_used_without_including_sys_socket_h -+# undef getsockopt -+# define getsockopt getsockopt_used_without_including_sys_socket_h -+# undef listen -+# define listen listen_used_without_including_sys_socket_h -+# undef recv -+# define recv recv_used_without_including_sys_socket_h -+# undef send -+# define send send_used_without_including_sys_socket_h -+# undef recvfrom -+# define recvfrom recvfrom_used_without_including_sys_socket_h -+# undef sendto -+# define sendto sendto_used_without_including_sys_socket_h -+# undef setsockopt -+# define setsockopt setsockopt_used_without_including_sys_socket_h -+# undef shutdown -+# define shutdown shutdown_used_without_including_sys_socket_h -+# else -+ _GL_WARN_ON_USE (socket, -+ "socket() used without including "); -+ _GL_WARN_ON_USE (connect, -+ "connect() used without including "); -+ _GL_WARN_ON_USE (accept, -+ "accept() used without including "); -+ _GL_WARN_ON_USE (bind, -+ "bind() used without including "); -+ _GL_WARN_ON_USE (getpeername, -+ "getpeername() used without including "); -+ _GL_WARN_ON_USE (getsockname, -+ "getsockname() used without including "); -+ _GL_WARN_ON_USE (getsockopt, -+ "getsockopt() used without including "); -+ _GL_WARN_ON_USE (listen, -+ "listen() used without including "); -+ _GL_WARN_ON_USE (recv, -+ "recv() used without including "); -+ _GL_WARN_ON_USE (send, -+ "send() used without including "); -+ _GL_WARN_ON_USE (recvfrom, -+ "recvfrom() used without including "); -+ _GL_WARN_ON_USE (sendto, -+ "sendto() used without including "); -+ _GL_WARN_ON_USE (setsockopt, -+ "setsockopt() used without including "); -+ _GL_WARN_ON_USE (shutdown, -+ "shutdown() used without including "); -+# endif -+# endif -+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef select -+# define select select_used_without_including_sys_select_h -+# else -+ _GL_WARN_ON_USE (select, -+ "select() used without including "); -+# endif -+# endif -+#endif -+ -+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ -+#endif /* _CYGWIN_SYS_TIME_H */ -+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ -diff --git a/grub-core/gnulib/sys_types.in.h b/grub-core/gnulib/sys_types.in.h -index d7da356..9520c09 100644 ---- a/grub-core/gnulib/sys_types.in.h -+++ b/grub-core/gnulib/sys_types.in.h -@@ -23,7 +23,9 @@ - #ifndef _@GUARD_PREFIX@_SYS_TYPES_H - - /* The include_next requires a split double-inclusion guard. */ -+# define _GL_INCLUDING_SYS_TYPES_H - #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@ -+# undef _GL_INCLUDING_SYS_TYPES_H - - #ifndef _@GUARD_PREFIX@_SYS_TYPES_H - #define _@GUARD_PREFIX@_SYS_TYPES_H -diff --git a/grub-core/gnulib/time.h b/grub-core/gnulib/time.h -new file mode 100644 -index 0000000..b9203d5 ---- /dev/null -+++ b/grub-core/gnulib/time.h -@@ -0,0 +1,586 @@ -+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ -+/* A more-standard . -+ -+ Copyright (C) 2007-2014 Free Software Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+#if __GNUC__ >= 3 -+#pragma GCC system_header -+#endif -+ -+ -+/* Don't get in the way of glibc when it includes time.h merely to -+ declare a few standard symbols, rather than to declare all the -+ symbols. Also, Solaris 8 eventually includes itself -+ recursively; if that is happening, just include the system -+ without adding our own declarations. */ -+#if (defined __need_time_t || defined __need_clock_t \ -+ || defined __need_timespec \ -+ || defined _GL_TIME_H) -+ -+# include_next -+ -+#else -+ -+# define _GL_TIME_H -+ -+# include_next -+ -+/* NetBSD 5.0 mis-defines NULL. */ -+# include -+ -+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -+#ifndef _GL_CXXDEFS_H -+#define _GL_CXXDEFS_H -+ -+/* The three most frequent use cases of these macros are: -+ -+ * For providing a substitute for a function that is missing on some -+ platforms, but is declared and works fine on the platforms on which -+ it exists: -+ -+ #if @GNULIB_FOO@ -+ # if !@HAVE_FOO@ -+ _GL_FUNCDECL_SYS (foo, ...); -+ # endif -+ _GL_CXXALIAS_SYS (foo, ...); -+ _GL_CXXALIASWARN (foo); -+ #elif defined GNULIB_POSIXCHECK -+ ... -+ #endif -+ -+ * For providing a replacement for a function that exists on all platforms, -+ but is broken/insufficient and needs to be replaced on some platforms: -+ -+ #if @GNULIB_FOO@ -+ # if @REPLACE_FOO@ -+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+ # undef foo -+ # define foo rpl_foo -+ # endif -+ _GL_FUNCDECL_RPL (foo, ...); -+ _GL_CXXALIAS_RPL (foo, ...); -+ # else -+ _GL_CXXALIAS_SYS (foo, ...); -+ # endif -+ _GL_CXXALIASWARN (foo); -+ #elif defined GNULIB_POSIXCHECK -+ ... -+ #endif -+ -+ * For providing a replacement for a function that exists on some platforms -+ but is broken/insufficient and needs to be replaced on some of them and -+ is additionally either missing or undeclared on some other platforms: -+ -+ #if @GNULIB_FOO@ -+ # if @REPLACE_FOO@ -+ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+ # undef foo -+ # define foo rpl_foo -+ # endif -+ _GL_FUNCDECL_RPL (foo, ...); -+ _GL_CXXALIAS_RPL (foo, ...); -+ # else -+ # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ -+ _GL_FUNCDECL_SYS (foo, ...); -+ # endif -+ _GL_CXXALIAS_SYS (foo, ...); -+ # endif -+ _GL_CXXALIASWARN (foo); -+ #elif defined GNULIB_POSIXCHECK -+ ... -+ #endif -+*/ -+ -+/* _GL_EXTERN_C declaration; -+ performs the declaration with C linkage. */ -+#if defined __cplusplus -+# define _GL_EXTERN_C extern "C" -+#else -+# define _GL_EXTERN_C extern -+#endif -+ -+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); -+ declares a replacement function, named rpl_func, with the given prototype, -+ consisting of return type, parameters, and attributes. -+ Example: -+ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) -+ _GL_ARG_NONNULL ((1))); -+ */ -+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ -+ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) -+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ -+ _GL_EXTERN_C rettype rpl_func parameters_and_attributes -+ -+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); -+ declares the system function, named func, with the given prototype, -+ consisting of return type, parameters, and attributes. -+ Example: -+ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) -+ _GL_ARG_NONNULL ((1))); -+ */ -+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ -+ _GL_EXTERN_C rettype func parameters_and_attributes -+ -+/* _GL_CXXALIAS_RPL (func, rettype, parameters); -+ declares a C++ alias called GNULIB_NAMESPACE::func -+ that redirects to rpl_func, if GNULIB_NAMESPACE is defined. -+ Example: -+ _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); -+ */ -+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ -+ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ -+ namespace GNULIB_NAMESPACE \ -+ { \ -+ rettype (*const func) parameters = ::rpl_func; \ -+ } \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#else -+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); -+ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); -+ except that the C function rpl_func may have a slightly different -+ declaration. A cast is used to silence the "invalid conversion" error -+ that would otherwise occur. */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ -+ namespace GNULIB_NAMESPACE \ -+ { \ -+ rettype (*const func) parameters = \ -+ reinterpret_cast(::rpl_func); \ -+ } \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#else -+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIAS_SYS (func, rettype, parameters); -+ declares a C++ alias called GNULIB_NAMESPACE::func -+ that redirects to the system provided function func, if GNULIB_NAMESPACE -+ is defined. -+ Example: -+ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); -+ */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+ /* If we were to write -+ rettype (*const func) parameters = ::func; -+ like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls -+ better (remove an indirection through a 'static' pointer variable), -+ but then the _GL_CXXALIASWARN macro below would cause a warning not only -+ for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ -+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ -+ namespace GNULIB_NAMESPACE \ -+ { \ -+ static rettype (*func) parameters = ::func; \ -+ } \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#else -+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); -+ is like _GL_CXXALIAS_SYS (func, rettype, parameters); -+ except that the C function func may have a slightly different declaration. -+ A cast is used to silence the "invalid conversion" error that would -+ otherwise occur. */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ -+ namespace GNULIB_NAMESPACE \ -+ { \ -+ static rettype (*func) parameters = \ -+ reinterpret_cast(::func); \ -+ } \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#else -+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); -+ is like _GL_CXXALIAS_SYS (func, rettype, parameters); -+ except that the C function is picked among a set of overloaded functions, -+ namely the one with rettype2 and parameters2. Two consecutive casts -+ are used to silence the "cannot find a match" and "invalid conversion" -+ errors that would otherwise occur. */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+ /* The outer cast must be a reinterpret_cast. -+ The inner cast: When the function is defined as a set of overloaded -+ functions, it works as a static_cast<>, choosing the designated variant. -+ When the function is defined as a single variant, it works as a -+ reinterpret_cast<>. The parenthesized cast syntax works both ways. */ -+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ -+ namespace GNULIB_NAMESPACE \ -+ { \ -+ static rettype (*func) parameters = \ -+ reinterpret_cast( \ -+ (rettype2(*)parameters2)(::func)); \ -+ } \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#else -+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIASWARN (func); -+ causes a warning to be emitted when ::func is used but not when -+ GNULIB_NAMESPACE::func is used. func must be defined without overloaded -+ variants. */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+# define _GL_CXXALIASWARN(func) \ -+ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) -+# define _GL_CXXALIASWARN_1(func,namespace) \ -+ _GL_CXXALIASWARN_2 (func, namespace) -+/* To work around GCC bug , -+ we enable the warning only when not optimizing. */ -+# if !__OPTIMIZE__ -+# define _GL_CXXALIASWARN_2(func,namespace) \ -+ _GL_WARN_ON_USE (func, \ -+ "The symbol ::" #func " refers to the system function. " \ -+ "Use " #namespace "::" #func " instead.") -+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -+# define _GL_CXXALIASWARN_2(func,namespace) \ -+ extern __typeof__ (func) func -+# else -+# define _GL_CXXALIASWARN_2(func,namespace) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+# endif -+#else -+# define _GL_CXXALIASWARN(func) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); -+ causes a warning to be emitted when the given overloaded variant of ::func -+ is used but not when GNULIB_NAMESPACE::func is used. */ -+#if defined __cplusplus && defined GNULIB_NAMESPACE -+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ -+ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ -+ GNULIB_NAMESPACE) -+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ -+ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) -+/* To work around GCC bug , -+ we enable the warning only when not optimizing. */ -+# if !__OPTIMIZE__ -+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ -+ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ -+ "The symbol ::" #func " refers to the system function. " \ -+ "Use " #namespace "::" #func " instead.") -+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ -+ extern __typeof__ (func) func -+# else -+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+# endif -+#else -+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ -+ _GL_EXTERN_C int _gl_cxxalias_dummy -+#endif -+ -+#endif /* _GL_CXXDEFS_H */ -+ -+/* The definition of _GL_ARG_NONNULL is copied here. */ -+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools -+ that the values passed as arguments n, ..., m must be non-NULL pointers. -+ n = 1 stands for the first argument, n = 2 for the second argument etc. */ -+#ifndef _GL_ARG_NONNULL -+# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 -+# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) -+# else -+# define _GL_ARG_NONNULL(params) -+# endif -+#endif -+ -+/* The definition of _GL_WARN_ON_USE is copied here. */ -+#ifndef _GL_WARN_ON_USE -+ -+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -+/* A compiler attribute is available in gcc versions 4.3.0 and later. */ -+# define _GL_WARN_ON_USE(function, message) \ -+extern __typeof__ (function) function __attribute__ ((__warning__ (message))) -+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -+/* Verify the existence of the function. */ -+# define _GL_WARN_ON_USE(function, message) \ -+extern __typeof__ (function) function -+# else /* Unsupported. */ -+# define _GL_WARN_ON_USE(function, message) \ -+_GL_WARN_EXTERN_C int _gl_warn_on_use -+# endif -+#endif -+ -+/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") -+ is like _GL_WARN_ON_USE (function, "string"), except that the function is -+ declared with the given prototype, consisting of return type, parameters, -+ and attributes. -+ This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does -+ not work in this case. */ -+#ifndef _GL_WARN_ON_USE_CXX -+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -+extern rettype function parameters_and_attributes \ -+ __attribute__ ((__warning__ (msg))) -+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING -+/* Verify the existence of the function. */ -+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -+extern rettype function parameters_and_attributes -+# else /* Unsupported. */ -+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -+_GL_WARN_EXTERN_C int _gl_warn_on_use -+# endif -+#endif -+ -+/* _GL_WARN_EXTERN_C declaration; -+ performs the declaration with C linkage. */ -+#ifndef _GL_WARN_EXTERN_C -+# if defined __cplusplus -+# define _GL_WARN_EXTERN_C extern "C" -+# else -+# define _GL_WARN_EXTERN_C extern -+# endif -+#endif -+ -+/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). -+ Or they define it with the wrong member names or define it in -+ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, -+ but the pthreads-win32 library defines it in . */ -+# if ! 1 -+# if 0 -+# include -+# elif 0 -+# include -+# else -+ -+# ifdef __cplusplus -+extern "C" { -+# endif -+ -+# if !GNULIB_defined_struct_timespec -+# undef timespec -+# define timespec rpl_timespec -+struct timespec -+{ -+ time_t tv_sec; -+ long int tv_nsec; -+}; -+# define GNULIB_defined_struct_timespec 1 -+# endif -+ -+# ifdef __cplusplus -+} -+# endif -+ -+# endif -+# endif -+ -+# if !GNULIB_defined_struct_time_t_must_be_integral -+/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires -+ time_t to be an integer type, even though C99 permits floating -+ point. We don't know of any implementation that uses floating -+ point, and it is much easier to write code that doesn't have to -+ worry about that corner case, so we force the issue. */ -+struct __time_t_must_be_integral { -+ unsigned int __floating_time_t_unsupported : (time_t) 1; -+}; -+# define GNULIB_defined_struct_time_t_must_be_integral 1 -+# endif -+ -+/* Sleep for at least RQTP seconds unless interrupted, If interrupted, -+ return -1 and store the remaining time into RMTP. See -+ . */ -+# if 0 -+# if GNULIB_PORTCHECK -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define nanosleep rpl_nanosleep -+# endif -+_GL_FUNCDECL_RPL (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp)); -+# else -+# if ! 1 -+_GL_FUNCDECL_SYS (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp) -+ _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp)); -+# endif -+_GL_CXXALIASWARN (nanosleep); -+# endif -+ -+/* Return the 'time_t' representation of TP and normalize TP. */ -+# if 0 -+# if GNULIB_PORTCHECK -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define mktime rpl_mktime -+# endif -+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); -+# else -+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); -+# endif -+_GL_CXXALIASWARN (mktime); -+# endif -+ -+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See -+ and -+ . */ -+# if 0 -+# if GNULIB_PORTCHECK -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef localtime_r -+# define localtime_r rpl_localtime_r -+# endif -+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# else -+# if ! 1 -+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+# endif -+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# endif -+# if 1 -+_GL_CXXALIASWARN (localtime_r); -+# endif -+# if GNULIB_PORTCHECK -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gmtime_r -+# define gmtime_r rpl_gmtime_r -+# endif -+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# else -+# if ! 1 -+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+# endif -+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# endif -+# if 1 -+_GL_CXXALIASWARN (gmtime_r); -+# endif -+# endif -+ -+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See -+ and -+ . */ -+# if 1 -+# if 0 -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef localtime -+# define localtime rpl_localtime -+# endif -+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); -+# else -+_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); -+# endif -+_GL_CXXALIASWARN (localtime); -+# endif -+ -+# if 1 -+# if 0 -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gmtime -+# define gmtime rpl_gmtime -+# endif -+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); -+# else -+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); -+# endif -+_GL_CXXALIASWARN (gmtime); -+# endif -+ -+/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store -+ the resulting broken-down time into TM. See -+ . */ -+# if 0 -+# if ! 1 -+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, -+ char const *restrict __format, -+ struct tm *restrict __tm) -+ _GL_ARG_NONNULL ((1, 2, 3))); -+# endif -+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, -+ char const *restrict __format, -+ struct tm *restrict __tm)); -+_GL_CXXALIASWARN (strptime); -+# endif -+ -+/* Convert TM to a time_t value, assuming UTC. */ -+# if 0 -+# if GNULIB_PORTCHECK -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef timegm -+# define timegm rpl_timegm -+# endif -+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); -+# else -+# if ! 1 -+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); -+# endif -+_GL_CXXALIASWARN (timegm); -+# endif -+ -+/* Encourage applications to avoid unsafe functions that can overrun -+ buffers when given outlandish struct tm values. Portable -+ applications should use strftime (or even sprintf) instead. */ -+# if defined GNULIB_POSIXCHECK -+# undef asctime -+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef asctime_r -+_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef ctime -+_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef ctime_r -+_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+ -+#endif -diff --git a/grub-core/gnulib/time.in.h b/grub-core/gnulib/time.in.h -new file mode 100644 -index 0000000..81abdf4 ---- /dev/null -+++ b/grub-core/gnulib/time.in.h -@@ -0,0 +1,274 @@ -+/* A more-standard . -+ -+ Copyright (C) 2007-2014 Free Software Foundation, Inc. -+ -+ This program 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, or (at your option) -+ any later version. -+ -+ This program 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 this program; if not, see . */ -+ -+#if __GNUC__ >= 3 -+@PRAGMA_SYSTEM_HEADER@ -+#endif -+@PRAGMA_COLUMNS@ -+ -+/* Don't get in the way of glibc when it includes time.h merely to -+ declare a few standard symbols, rather than to declare all the -+ symbols. Also, Solaris 8 eventually includes itself -+ recursively; if that is happening, just include the system -+ without adding our own declarations. */ -+#if (defined __need_time_t || defined __need_clock_t \ -+ || defined __need_timespec \ -+ || defined _@GUARD_PREFIX@_TIME_H) -+ -+# @INCLUDE_NEXT@ @NEXT_TIME_H@ -+ -+#else -+ -+# define _@GUARD_PREFIX@_TIME_H -+ -+# @INCLUDE_NEXT@ @NEXT_TIME_H@ -+ -+/* NetBSD 5.0 mis-defines NULL. */ -+# include -+ -+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -+ -+/* The definition of _GL_ARG_NONNULL is copied here. */ -+ -+/* The definition of _GL_WARN_ON_USE is copied here. */ -+ -+/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). -+ Or they define it with the wrong member names or define it in -+ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, -+ but the pthreads-win32 library defines it in . */ -+# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ -+# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ -+# include -+# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ -+# include -+# else -+ -+# ifdef __cplusplus -+extern "C" { -+# endif -+ -+# if !GNULIB_defined_struct_timespec -+# undef timespec -+# define timespec rpl_timespec -+struct timespec -+{ -+ time_t tv_sec; -+ long int tv_nsec; -+}; -+# define GNULIB_defined_struct_timespec 1 -+# endif -+ -+# ifdef __cplusplus -+} -+# endif -+ -+# endif -+# endif -+ -+# if !GNULIB_defined_struct_time_t_must_be_integral -+/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires -+ time_t to be an integer type, even though C99 permits floating -+ point. We don't know of any implementation that uses floating -+ point, and it is much easier to write code that doesn't have to -+ worry about that corner case, so we force the issue. */ -+struct __time_t_must_be_integral { -+ unsigned int __floating_time_t_unsupported : (time_t) 1; -+}; -+# define GNULIB_defined_struct_time_t_must_be_integral 1 -+# endif -+ -+/* Sleep for at least RQTP seconds unless interrupted, If interrupted, -+ return -1 and store the remaining time into RMTP. See -+ . */ -+# if @GNULIB_NANOSLEEP@ -+# if @REPLACE_NANOSLEEP@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define nanosleep rpl_nanosleep -+# endif -+_GL_FUNCDECL_RPL (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp)); -+# else -+# if ! @HAVE_NANOSLEEP@ -+_GL_FUNCDECL_SYS (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp) -+ _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (nanosleep, int, -+ (struct timespec const *__rqtp, struct timespec *__rmtp)); -+# endif -+_GL_CXXALIASWARN (nanosleep); -+# endif -+ -+/* Return the 'time_t' representation of TP and normalize TP. */ -+# if @GNULIB_MKTIME@ -+# if @REPLACE_MKTIME@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# define mktime rpl_mktime -+# endif -+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); -+# else -+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); -+# endif -+_GL_CXXALIASWARN (mktime); -+# endif -+ -+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See -+ and -+ . */ -+# if @GNULIB_TIME_R@ -+# if @REPLACE_LOCALTIME_R@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef localtime_r -+# define localtime_r rpl_localtime_r -+# endif -+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# else -+# if ! @HAVE_DECL_LOCALTIME_R@ -+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+# endif -+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# endif -+# if @HAVE_DECL_LOCALTIME_R@ -+_GL_CXXALIASWARN (localtime_r); -+# endif -+# if @REPLACE_LOCALTIME_R@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gmtime_r -+# define gmtime_r rpl_gmtime_r -+# endif -+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# else -+# if ! @HAVE_DECL_LOCALTIME_R@ -+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result) -+ _GL_ARG_NONNULL ((1, 2))); -+# endif -+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, -+ struct tm *restrict __result)); -+# endif -+# if @HAVE_DECL_LOCALTIME_R@ -+_GL_CXXALIASWARN (gmtime_r); -+# endif -+# endif -+ -+/* Convert TIMER to RESULT, assuming local time and UTC respectively. See -+ and -+ . */ -+# if @GNULIB_GETTIMEOFDAY@ -+# if @REPLACE_LOCALTIME@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef localtime -+# define localtime rpl_localtime -+# endif -+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); -+# else -+_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); -+# endif -+_GL_CXXALIASWARN (localtime); -+# endif -+ -+# if @GNULIB_GETTIMEOFDAY@ -+# if @REPLACE_GMTIME@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef gmtime -+# define gmtime rpl_gmtime -+# endif -+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) -+ _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); -+# else -+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); -+# endif -+_GL_CXXALIASWARN (gmtime); -+# endif -+ -+/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store -+ the resulting broken-down time into TM. See -+ . */ -+# if @GNULIB_STRPTIME@ -+# if ! @HAVE_STRPTIME@ -+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, -+ char const *restrict __format, -+ struct tm *restrict __tm) -+ _GL_ARG_NONNULL ((1, 2, 3))); -+# endif -+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, -+ char const *restrict __format, -+ struct tm *restrict __tm)); -+_GL_CXXALIASWARN (strptime); -+# endif -+ -+/* Convert TM to a time_t value, assuming UTC. */ -+# if @GNULIB_TIMEGM@ -+# if @REPLACE_TIMEGM@ -+# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -+# undef timegm -+# define timegm rpl_timegm -+# endif -+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); -+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); -+# else -+# if ! @HAVE_TIMEGM@ -+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); -+# endif -+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); -+# endif -+_GL_CXXALIASWARN (timegm); -+# endif -+ -+/* Encourage applications to avoid unsafe functions that can overrun -+ buffers when given outlandish struct tm values. Portable -+ applications should use strftime (or even sprintf) instead. */ -+# if defined GNULIB_POSIXCHECK -+# undef asctime -+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef asctime_r -+_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef ctime -+_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+# if defined GNULIB_POSIXCHECK -+# undef ctime_r -+_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " -+ "better use strftime (or even sprintf) instead"); -+# endif -+ -+#endif -diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c -index d390b25..9127e92 100644 ---- a/grub-core/osdep/windows/hostdisk.c -+++ b/grub-core/osdep/windows/hostdisk.c -@@ -353,6 +353,12 @@ grub_util_mkdir (const char *dir) - free (windows_name); - } - -+ssize_t -+grub_util_readlink (const char *name, char *buf, size_t bufsize) -+{ -+ return readlink(name, buf, bufsize); -+} -+ - int - grub_util_rename (const char *from, const char *to) - { -diff --git a/include/grub/osdep/hostfile_aros.h b/include/grub/osdep/hostfile_aros.h -index a059c0f..161fbb7 100644 ---- a/include/grub/osdep/hostfile_aros.h -+++ b/include/grub/osdep/hostfile_aros.h -@@ -68,6 +68,12 @@ grub_util_rename (const char *from, const char *to) - return rename (from, to); - } - -+static inline ssize_t -+grub_util_readlink (const char *name, char *buf, size_t bufsize) -+{ -+ return readlink(name, buf, bufsize); -+} -+ - #define grub_util_mkdir(a) mkdir ((a), 0755) - - struct grub_util_fd -diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/hostfile_unix.h -index 9ffe46f..17cd3aa 100644 ---- a/include/grub/osdep/hostfile_unix.h -+++ b/include/grub/osdep/hostfile_unix.h -@@ -71,6 +71,12 @@ grub_util_rename (const char *from, const char *to) - return rename (from, to); - } - -+static inline ssize_t -+grub_util_readlink (const char *name, char *buf, size_t bufsize) -+{ -+ return readlink(name, buf, bufsize); -+} -+ - #define grub_util_mkdir(a) mkdir ((a), 0755) - - #if defined (__NetBSD__) -diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h -index bf6451b..8c92d05 100644 ---- a/include/grub/osdep/hostfile_windows.h -+++ b/include/grub/osdep/hostfile_windows.h -@@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t; - - int - grub_util_rename (const char *from, const char *to); -+ssize_t -+grub_util_readlink (const char *name, char *buf, size_t bufsize); - int - grub_util_unlink (const char *name); - void -diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 -new file mode 100644 -index 0000000..1c2d66e ---- /dev/null -+++ b/m4/gettimeofday.m4 -@@ -0,0 +1,138 @@ -+# serial 21 -+ -+# Copyright (C) 2001-2003, 2005, 2007, 2009-2014 Free Software Foundation, Inc. -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+dnl From Jim Meyering. -+ -+AC_DEFUN([gl_FUNC_GETTIMEOFDAY], -+[ -+ AC_REQUIRE([AC_C_RESTRICT]) -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) -+ AC_CHECK_FUNCS_ONCE([gettimeofday]) -+ -+ gl_gettimeofday_timezone=void -+ if test $ac_cv_func_gettimeofday != yes; then -+ HAVE_GETTIMEOFDAY=0 -+ else -+ gl_FUNC_GETTIMEOFDAY_CLOBBER -+ AC_CACHE_CHECK([for gettimeofday with POSIX signature], -+ [gl_cv_func_gettimeofday_posix_signature], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ struct timeval c; -+ int gettimeofday (struct timeval *restrict, void *restrict); -+ ]], -+ [[/* glibc uses struct timezone * rather than the POSIX void * -+ if _GNU_SOURCE is defined. However, since the only portable -+ use of gettimeofday uses NULL as the second parameter, and -+ since the glibc definition is actually more typesafe, it is -+ not worth wrapping this to get a compliant signature. */ -+ int (*f) (struct timeval *restrict, void *restrict) -+ = gettimeofday; -+ int x = f (&c, 0); -+ return !(x | c.tv_sec | c.tv_usec); -+ ]])], -+ [gl_cv_func_gettimeofday_posix_signature=yes], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+int gettimeofday (struct timeval *restrict, struct timezone *restrict); -+ ]])], -+ [gl_cv_func_gettimeofday_posix_signature=almost], -+ [gl_cv_func_gettimeofday_posix_signature=no])])]) -+ if test $gl_cv_func_gettimeofday_posix_signature = almost; then -+ gl_gettimeofday_timezone='struct timezone' -+ elif test $gl_cv_func_gettimeofday_posix_signature != yes; then -+ REPLACE_GETTIMEOFDAY=1 -+ fi -+ dnl If we override 'struct timeval', we also have to override gettimeofday. -+ if test $REPLACE_STRUCT_TIMEVAL = 1; then -+ REPLACE_GETTIMEOFDAY=1 -+ fi -+ m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ -+ gl_FUNC_TZSET_CLOBBER -+ case "$gl_cv_func_tzset_clobber" in -+ *yes) -+ REPLACE_GETTIMEOFDAY=1 -+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME -+ AC_DEFINE([tzset], [rpl_tzset], -+ [Define to rpl_tzset if the wrapper function should be used.]) -+ AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], -+ [Define if tzset clobbers localtime's static buffer.]) -+ ;; -+ esac -+ ]) -+ fi -+ AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], -+ [Define this to 'void' or 'struct timezone' to match the system's -+ declaration of the second argument to gettimeofday.]) -+]) -+ -+ -+dnl See if gettimeofday clobbers the static buffer that localtime uses -+dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 -+dnl (i.e., Darwin 1.3.7) has this problem. -+dnl -+dnl If it does, then arrange to use gettimeofday and localtime only via -+dnl the wrapper functions that work around the problem. -+ -+AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], -+[ -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) -+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles -+ -+ AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], -+ [gl_cv_func_gettimeofday_clobber], -+ [AC_RUN_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ #include -+ #include -+ #include -+ ]], -+ [[ -+ time_t t = 0; -+ struct tm *lt; -+ struct tm saved_lt; -+ struct timeval tv; -+ lt = localtime (&t); -+ saved_lt = *lt; -+ gettimeofday (&tv, NULL); -+ return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; -+ ]])], -+ [gl_cv_func_gettimeofday_clobber=no], -+ [gl_cv_func_gettimeofday_clobber=yes], -+ [# When cross-compiling: -+ case "$host_os" in -+ # Guess all is fine on glibc systems. -+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; -+ # If we don't know, assume the worst. -+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; -+ esac -+ ])]) -+ -+ case "$gl_cv_func_gettimeofday_clobber" in -+ *yes) -+ REPLACE_GETTIMEOFDAY=1 -+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME -+ AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], -+ [Define if gettimeofday clobbers the localtime buffer.]) -+ ;; -+ esac -+]) -+ -+AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ -+ REPLACE_GMTIME=1 -+ REPLACE_LOCALTIME=1 -+]) -+ -+# Prerequisites of lib/gettimeofday.c. -+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ -+ AC_CHECK_HEADERS([sys/timeb.h]) -+ AC_CHECK_FUNCS([_ftime]) -+]) -diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 -index 4089184..ef2ec5b 100644 ---- a/m4/gnulib-cache.m4 -+++ b/m4/gnulib-cache.m4 -@@ -27,7 +27,7 @@ - - - # Specification in the form of a command-line invocation: --# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex -+# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex - - # Specification in the form of a few gnulib-tool.m4 macro invocations: - gl_LOCAL_DIR([]) -@@ -39,6 +39,7 @@ gl_MODULES([ - getline - gettext - progname -+ readlink - regex - ]) - gl_AVOID([]) -diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 -index 7a19f60..66fd0ed 100644 ---- a/m4/gnulib-comp.m4 -+++ b/m4/gnulib-comp.m4 -@@ -60,10 +60,13 @@ AC_DEFUN([gl_EARLY], - # Code from module getopt-posix: - # Code from module gettext: - # Code from module gettext-h: -+ # Code from module gettimeofday: - # Code from module havelib: - # Code from module include_next: - # Code from module intprops: - # Code from module langinfo: -+ # Code from module largefile: -+ AC_REQUIRE([AC_SYS_LARGEFILE]) - # Code from module localcharset: - # Code from module locale: - # Code from module localeconv: -@@ -81,8 +84,10 @@ AC_DEFUN([gl_EARLY], - # Code from module multiarch: - # Code from module nl_langinfo: - # Code from module nocrash: -+ # Code from module pathmax: - # Code from module progname: - # Code from module rawmemchr: -+ # Code from module readlink: - # Code from module realloc-posix: - # Code from module regex: - # Code from module size_max: -@@ -92,6 +97,7 @@ AC_DEFUN([gl_EARLY], - # Code from module snippet/c++defs: - # Code from module snippet/warn-on-use: - # Code from module ssize_t: -+ # Code from module stat: - # Code from module stdalign: - # Code from module stdbool: - # Code from module stddef: -@@ -108,8 +114,11 @@ AC_DEFUN([gl_EARLY], - # Code from module strndup: - # Code from module strnlen: - # Code from module strnlen1: -+ # Code from module sys_stat: -+ # Code from module sys_time: - # Code from module sys_types: - # Code from module sysexits: -+ # Code from module time: - # Code from module unistd: - # Code from module unitypes: - # Code from module uniwidth/base: -@@ -211,7 +220,14 @@ AC_DEFUN([gl_INIT], - AM_GNU_GETTEXT_VERSION([0.18.1]) - AC_SUBST([LIBINTL]) - AC_SUBST([LTLIBINTL]) -+ gl_FUNC_GETTIMEOFDAY -+ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then -+ AC_LIBOBJ([gettimeofday]) -+ gl_PREREQ_GETTIMEOFDAY -+ fi -+ gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) - gl_LANGINFO_H -+ AC_REQUIRE([gl_LARGEFILE]) - gl_LOCALCHARSET - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" - AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) -@@ -284,6 +300,7 @@ AC_DEFUN([gl_INIT], - AC_LIBOBJ([nl_langinfo]) - fi - gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) -+ gl_PATHMAX - AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) - AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) - gl_FUNC_RAWMEMCHR -@@ -292,6 +309,12 @@ AC_DEFUN([gl_INIT], - gl_PREREQ_RAWMEMCHR - fi - gl_STRING_MODULE_INDICATOR([rawmemchr]) -+ gl_FUNC_READLINK -+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then -+ AC_LIBOBJ([readlink]) -+ gl_PREREQ_READLINK -+ fi -+ gl_UNISTD_MODULE_INDICATOR([readlink]) - gl_FUNC_REALLOC_POSIX - if test $REPLACE_REALLOC = 1; then - AC_LIBOBJ([realloc]) -@@ -309,6 +332,12 @@ AC_DEFUN([gl_INIT], - fi - gl_UNISTD_MODULE_INDICATOR([sleep]) - gt_TYPE_SSIZE_T -+ gl_FUNC_STAT -+ if test $REPLACE_STAT = 1; then -+ AC_LIBOBJ([stat]) -+ gl_PREREQ_STAT -+ fi -+ gl_SYS_STAT_MODULE_INDICATOR([stat]) - gl_STDALIGN_H - AM_STDBOOL_H - gl_STDDEF_H -@@ -355,9 +384,14 @@ AC_DEFUN([gl_INIT], - gl_PREREQ_STRNLEN - fi - gl_STRING_MODULE_INDICATOR([strnlen]) -+ gl_HEADER_SYS_STAT_H -+ AC_PROG_MKDIR_P -+ gl_HEADER_SYS_TIME_H -+ AC_PROG_MKDIR_P - gl_SYS_TYPES_H - AC_PROG_MKDIR_P - gl_SYSEXITS -+ gl_HEADER_TIME_H - gl_UNISTD_H - gl_LIBUNISTRING_LIBHEADER([0.9], [unitypes.h]) - gl_LIBUNISTRING_LIBHEADER([0.9], [uniwidth.h]) -@@ -562,6 +596,7 @@ AC_DEFUN([gl_FILE_LIST], [ - lib/getopt1.c - lib/getopt_int.h - lib/gettext.h -+ lib/gettimeofday.c - lib/intprops.h - lib/itold.c - lib/langinfo.in.h -@@ -587,6 +622,7 @@ AC_DEFUN([gl_FILE_LIST], [ - lib/msvc-nothrow.c - lib/msvc-nothrow.h - lib/nl_langinfo.c -+ lib/pathmax.h - lib/printf-args.c - lib/printf-args.h - lib/printf-parse.c -@@ -595,6 +631,7 @@ AC_DEFUN([gl_FILE_LIST], [ - lib/progname.h - lib/rawmemchr.c - lib/rawmemchr.valgrind -+ lib/readlink.c - lib/realloc.c - lib/ref-add.sin - lib/ref-del.sin -@@ -606,6 +643,7 @@ AC_DEFUN([gl_FILE_LIST], [ - lib/regexec.c - lib/size_max.h - lib/sleep.c -+ lib/stat.c - lib/stdalign.in.h - lib/stdbool.in.h - lib/stddef.in.h -@@ -627,8 +665,11 @@ AC_DEFUN([gl_FILE_LIST], [ - lib/strnlen.c - lib/strnlen1.c - lib/strnlen1.h -+ lib/sys_stat.in.h -+ lib/sys_time.in.h - lib/sys_types.in.h - lib/sysexits.in.h -+ lib/time.in.h - lib/unistd.c - lib/unistd.in.h - lib/unitypes.in.h -@@ -667,6 +708,7 @@ AC_DEFUN([gl_FILE_LIST], [ - m4/getline.m4 - m4/getopt.m4 - m4/gettext.m4 -+ m4/gettimeofday.m4 - m4/glibc2.m4 - m4/glibc21.m4 - m4/gnulib-common.m4 -@@ -681,6 +723,7 @@ AC_DEFUN([gl_FILE_LIST], [ - m4/inttypes-pri.m4 - m4/inttypes_h.m4 - m4/langinfo_h.m4 -+ m4/largefile.m4 - m4/lcmessage.m4 - m4/lib-ld.m4 - m4/lib-link.m4 -@@ -712,16 +755,19 @@ AC_DEFUN([gl_FILE_LIST], [ - m4/nls.m4 - m4/nocrash.m4 - m4/off_t.m4 -+ m4/pathmax.m4 - m4/po.m4 - m4/printf-posix.m4 - m4/printf.m4 - m4/progtest.m4 - m4/rawmemchr.m4 -+ m4/readlink.m4 - m4/realloc.m4 - m4/regex.m4 - m4/size_max.m4 - m4/sleep.m4 - m4/ssize_t.m4 -+ m4/stat.m4 - m4/stdalign.m4 - m4/stdbool.m4 - m4/stddef_h.m4 -@@ -737,9 +783,12 @@ AC_DEFUN([gl_FILE_LIST], [ - m4/strndup.m4 - m4/strnlen.m4 - m4/sys_socket_h.m4 -+ m4/sys_stat_h.m4 -+ m4/sys_time_h.m4 - m4/sys_types_h.m4 - m4/sysexits.m4 - m4/threadlib.m4 -+ m4/time_h.m4 - m4/uintmax_t.m4 - m4/unistd_h.m4 - m4/vasnprintf.m4 -diff --git a/m4/largefile.m4 b/m4/largefile.m4 -new file mode 100644 -index 0000000..a1b564a ---- /dev/null -+++ b/m4/largefile.m4 -@@ -0,0 +1,146 @@ -+# Enable large files on systems where this is not the default. -+ -+# Copyright 1992-1996, 1998-2014 Free Software Foundation, Inc. -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# The following implementation works around a problem in autoconf <= 2.69; -+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, -+# or configures them incorrectly in some cases. -+m4_version_prereq([2.70], [] ,[ -+ -+# _AC_SYS_LARGEFILE_TEST_INCLUDES -+# ------------------------------- -+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], -+[@%:@include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]];[]dnl -+]) -+ -+ -+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, -+# CACHE-VAR, -+# DESCRIPTION, -+# PROLOGUE, [FUNCTION-BODY]) -+# -------------------------------------------------------- -+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], -+[AC_CACHE_CHECK([for $1 value needed for large files], [$3], -+[while :; do -+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( -+ [AC_LANG_PROGRAM([$5], [$6])], -+ [$3=no; break]) -+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( -+ [AC_LANG_PROGRAM([@%:@define $1 $2 -+$5], [$6])], -+ [$3=$2; break]) -+ $3=unknown -+ break -+done]) -+case $$3 in #( -+ no | unknown) ;; -+ *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);; -+esac -+rm -rf conftest*[]dnl -+])# _AC_SYS_LARGEFILE_MACRO_VALUE -+ -+ -+# AC_SYS_LARGEFILE -+# ---------------- -+# By default, many hosts won't let programs access large files; -+# one must use special compiler options to get large-file access to work. -+# For more details about this brain damage please see: -+# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html -+AC_DEFUN([AC_SYS_LARGEFILE], -+[AC_ARG_ENABLE(largefile, -+ [ --disable-largefile omit support for large files]) -+if test "$enable_largefile" != no; then -+ -+ AC_CACHE_CHECK([for special C compiler options needed for large files], -+ ac_cv_sys_largefile_CC, -+ [ac_cv_sys_largefile_CC=no -+ if test "$GCC" != yes; then -+ ac_save_CC=$CC -+ while :; do -+ # IRIX 6.2 and later do not support large files by default, -+ # so use the C compiler's -n32 option if that helps. -+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) -+ AC_COMPILE_IFELSE([], [break]) -+ CC="$CC -n32" -+ AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) -+ break -+ done -+ CC=$ac_save_CC -+ rm -f conftest.$ac_ext -+ fi]) -+ if test "$ac_cv_sys_largefile_CC" != no; then -+ CC=$CC$ac_cv_sys_largefile_CC -+ fi -+ -+ _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, -+ ac_cv_sys_file_offset_bits, -+ [Number of bits in a file offset, on hosts where this is settable.], -+ [_AC_SYS_LARGEFILE_TEST_INCLUDES]) -+ if test $ac_cv_sys_file_offset_bits = unknown; then -+ _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, -+ ac_cv_sys_large_files, -+ [Define for large files, on AIX-style hosts.], -+ [_AC_SYS_LARGEFILE_TEST_INCLUDES]) -+ fi -+ -+ AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1], -+ [Enable large inode numbers on Mac OS X 10.5.]) -+fi -+])# AC_SYS_LARGEFILE -+])# m4_version_prereq 2.70 -+ -+# Enable large files on systems where this is implemented by Gnulib, not by the -+# system headers. -+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib -+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively. -+AC_DEFUN([gl_LARGEFILE], -+[ -+ AC_REQUIRE([AC_CANONICAL_HOST]) -+ case "$host_os" in -+ mingw*) -+ dnl Native Windows. -+ dnl mingw64 defines off_t to a 64-bit type already, if -+ dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. -+ AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; -+ ]], -+ [[]])], -+ [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) -+ ]) -+ if test $gl_cv_type_off_t_64 = no; then -+ WINDOWS_64_BIT_OFF_T=1 -+ else -+ WINDOWS_64_BIT_OFF_T=0 -+ fi -+ dnl But all native Windows platforms (including mingw64) have a 32-bit -+ dnl st_size member in 'struct stat'. -+ WINDOWS_64_BIT_ST_SIZE=1 -+ ;; -+ *) -+ dnl Nothing to do on gnulib's side. -+ dnl A 64-bit off_t is -+ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, -+ dnl OSF/1, Cygwin, -+ dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on -+ dnl glibc, HP-UX, Solaris, -+ dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, -+ dnl - impossible to achieve on Minix 3.1.8. -+ WINDOWS_64_BIT_OFF_T=0 -+ WINDOWS_64_BIT_ST_SIZE=0 -+ ;; -+ esac -+]) -diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 -new file mode 100644 -index 0000000..114f91f ---- /dev/null -+++ b/m4/pathmax.m4 -@@ -0,0 +1,42 @@ -+# pathmax.m4 serial 10 -+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2014 Free Software Foundation, -+dnl Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+AC_DEFUN([gl_PATHMAX], -+[ -+ dnl Prerequisites of lib/pathmax.h. -+ AC_CHECK_HEADERS_ONCE([sys/param.h]) -+]) -+ -+# Expands to a piece of C program that defines PATH_MAX in the same way as -+# "pathmax.h" will do. -+AC_DEFUN([gl_PATHMAX_SNIPPET], [[ -+/* Arrange to define PATH_MAX, like "pathmax.h" does. */ -+#if HAVE_UNISTD_H -+# include -+#endif -+#include -+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN -+# include -+#endif -+#if !defined PATH_MAX && defined MAXPATHLEN -+# define PATH_MAX MAXPATHLEN -+#endif -+#ifdef __hpux -+# undef PATH_MAX -+# define PATH_MAX 1024 -+#endif -+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -+# undef PATH_MAX -+# define PATH_MAX 260 -+#endif -+]]) -+ -+# Prerequisites of gl_PATHMAX_SNIPPET. -+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], -+[ -+ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) -+]) -diff --git a/m4/readlink.m4 b/m4/readlink.m4 -new file mode 100644 -index 0000000..f9ce868 ---- /dev/null -+++ b/m4/readlink.m4 -@@ -0,0 +1,71 @@ -+# readlink.m4 serial 12 -+dnl Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+AC_DEFUN([gl_FUNC_READLINK], -+[ -+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) -+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles -+ AC_CHECK_FUNCS_ONCE([readlink]) -+ if test $ac_cv_func_readlink = no; then -+ HAVE_READLINK=0 -+ else -+ AC_CACHE_CHECK([whether readlink signature is correct], -+ [gl_cv_decl_readlink_works], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ /* Cause compilation failure if original declaration has wrong type. */ -+ ssize_t readlink (const char *, char *, size_t);]])], -+ [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) -+ dnl Solaris 9 ignores trailing slash. -+ dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. -+ AC_CACHE_CHECK([whether readlink handles trailing slash correctly], -+ [gl_cv_func_readlink_works], -+ [# We have readlink, so assume ln -s works. -+ ln -s conftest.no-such conftest.link -+ ln -s conftest.link conftest.lnk2 -+ AC_RUN_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+]], [[char buf[20]; -+ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], -+ [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], -+ [case "$host_os" in -+ # Guess yes on glibc systems. -+ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; -+ # If we don't know, assume the worst. -+ *) gl_cv_func_readlink_works="guessing no" ;; -+ esac -+ ]) -+ rm -f conftest.link conftest.lnk2]) -+ case "$gl_cv_func_readlink_works" in -+ *yes) -+ if test "$gl_cv_decl_readlink_works" != yes; then -+ REPLACE_READLINK=1 -+ fi -+ ;; -+ *) -+ AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink -+ fails to recognize a trailing slash.]) -+ REPLACE_READLINK=1 -+ ;; -+ esac -+ fi -+]) -+ -+# Like gl_FUNC_READLINK, except prepare for separate compilation -+# (no REPLACE_READLINK, no AC_LIBOBJ). -+AC_DEFUN([gl_FUNC_READLINK_SEPARATE], -+[ -+ AC_CHECK_FUNCS_ONCE([readlink]) -+ gl_PREREQ_READLINK -+]) -+ -+# Prerequisites of lib/readlink.c. -+AC_DEFUN([gl_PREREQ_READLINK], -+[ -+ : -+]) -diff --git a/m4/stat.m4 b/m4/stat.m4 -new file mode 100644 -index 0000000..1ae327b ---- /dev/null -+++ b/m4/stat.m4 -@@ -0,0 +1,71 @@ -+# serial 11 -+ -+# Copyright (C) 2009-2014 Free Software Foundation, Inc. -+# -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+AC_DEFUN([gl_FUNC_STAT], -+[ -+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles -+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) -+ AC_CHECK_FUNCS_ONCE([lstat]) -+ dnl mingw is the only known platform where stat(".") and stat("./") differ -+ AC_CACHE_CHECK([whether stat handles trailing slashes on directories], -+ [gl_cv_func_stat_dir_slash], -+ [AC_RUN_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])], -+ [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no], -+ [case $host_os in -+ mingw*) gl_cv_func_stat_dir_slash="guessing no";; -+ *) gl_cv_func_stat_dir_slash="guessing yes";; -+ esac])]) -+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). -+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) -+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). -+ AC_CACHE_CHECK([whether stat handles trailing slashes on files], -+ [gl_cv_func_stat_file_slash], -+ [touch conftest.tmp -+ # Assume that if we have lstat, we can also check symlinks. -+ if test $ac_cv_func_lstat = yes; then -+ ln -s conftest.tmp conftest.lnk -+ fi -+ AC_RUN_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+]], [[int result = 0; -+ struct stat st; -+ if (!stat ("conftest.tmp/", &st)) -+ result |= 1; -+#if HAVE_LSTAT -+ if (!stat ("conftest.lnk/", &st)) -+ result |= 2; -+#endif -+ return result; -+ ]])], -+ [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], -+ [case "$host_os" in -+ # Guess yes on glibc systems. -+ *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; -+ # If we don't know, assume the worst. -+ *) gl_cv_func_stat_file_slash="guessing no" ;; -+ esac -+ ]) -+ rm -f conftest.tmp conftest.lnk]) -+ case $gl_cv_func_stat_dir_slash in -+ *no) REPLACE_STAT=1 -+ AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs -+ help when passed a directory name with a trailing slash]);; -+ esac -+ case $gl_cv_func_stat_file_slash in -+ *no) REPLACE_STAT=1 -+ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs -+ help when passed a file name with a trailing slash]);; -+ esac -+]) -+ -+# Prerequisites of lib/stat.c. -+AC_DEFUN([gl_PREREQ_STAT], [:]) -diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 -new file mode 100644 -index 0000000..eaa7642 ---- /dev/null -+++ b/m4/sys_stat_h.m4 -@@ -0,0 +1,96 @@ -+# sys_stat_h.m4 serial 28 -*- Autoconf -*- -+dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Eric Blake. -+dnl Provide a GNU-like . -+ -+AC_DEFUN([gl_HEADER_SYS_STAT_H], -+[ -+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) -+ -+ dnl Check for broken stat macros. -+ AC_REQUIRE([AC_HEADER_STAT]) -+ -+ gl_CHECK_NEXT_HEADERS([sys/stat.h]) -+ -+ dnl Ensure the type mode_t gets defined. -+ AC_REQUIRE([AC_TYPE_MODE_T]) -+ -+ dnl Whether to override 'struct stat'. -+ m4_ifdef([gl_LARGEFILE], [ -+ AC_REQUIRE([gl_LARGEFILE]) -+ ], [ -+ WINDOWS_64_BIT_ST_SIZE=0 -+ ]) -+ AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) -+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then -+ AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1], -+ [Define to 1 if Gnulib overrides 'struct stat' on Windows so that -+ struct stat.st_size becomes 64-bit.]) -+ fi -+ -+ dnl Define types that are supposed to be defined in or -+ dnl . -+ AC_CHECK_TYPE([nlink_t], [], -+ [AC_DEFINE([nlink_t], [int], -+ [Define to the type of st_nlink in struct stat, or a supertype.])], -+ [#include -+ #include ]) -+ -+ dnl Check for declarations of anything we want to poison if the -+ dnl corresponding gnulib module is not in use. -+ gl_WARN_ON_USE_PREPARE([[#include -+ ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat -+ mknod mknodat stat utimensat]) -+]) # gl_HEADER_SYS_STAT_H -+ -+AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], -+[ -+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. -+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) -+ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) -+ dnl Define it also as a C macro, for the benefit of the unit tests. -+ gl_MODULE_INDICATOR_FOR_TESTS([$1]) -+]) -+ -+AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], -+[ -+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR -+ GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) -+ GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) -+ GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) -+ GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) -+ GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) -+ GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) -+ GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) -+ GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) -+ GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) -+ GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) -+ GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) -+ GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) -+ GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) -+ dnl Assume proper GNU behavior unless another module says otherwise. -+ HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) -+ HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) -+ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) -+ HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) -+ HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) -+ HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) -+ HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) -+ HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) -+ HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) -+ HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) -+ HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) -+ REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) -+ REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) -+ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) -+ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) -+ REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) -+ REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) -+ REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) -+ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) -+ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) -+]) -diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 -new file mode 100644 -index 0000000..5c79300 ---- /dev/null -+++ b/m4/sys_time_h.m4 -@@ -0,0 +1,110 @@ -+# Configure a replacement for . -+# serial 8 -+ -+# Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# Written by Paul Eggert and Martin Lambers. -+ -+AC_DEFUN([gl_HEADER_SYS_TIME_H], -+[ -+ dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement -+ dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 -+ dnl statements that occur in other macros. -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) -+]) -+ -+AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], -+[ -+ AC_REQUIRE([AC_C_RESTRICT]) -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) -+ AC_CHECK_HEADERS_ONCE([sys/time.h]) -+ gl_CHECK_NEXT_HEADERS([sys/time.h]) -+ -+ if test $ac_cv_header_sys_time_h != yes; then -+ HAVE_SYS_TIME_H=0 -+ fi -+ -+ dnl On native Windows with MSVC, 'struct timeval' is defined in -+ dnl only. So include that header in the list. -+ gl_PREREQ_SYS_H_WINSOCK2 -+ AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#if HAVE_SYS_TIME_H -+ #include -+ #endif -+ #include -+ #if HAVE_WINSOCK2_H -+ # include -+ #endif -+ ]], -+ [[static struct timeval x; x.tv_sec = x.tv_usec;]])], -+ [gl_cv_sys_struct_timeval=yes], -+ [gl_cv_sys_struct_timeval=no]) -+ ]) -+ if test $gl_cv_sys_struct_timeval != yes; then -+ HAVE_STRUCT_TIMEVAL=0 -+ else -+ dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined -+ dnl (in and for mingw64, in only -+ dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is -+ dnl smaller than the 'time_t' type mandated by POSIX. -+ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but -+ dnl that is good enough. -+ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], -+ [gl_cv_sys_struct_timeval_tv_sec], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#if HAVE_SYS_TIME_H -+ #include -+ #endif -+ #include -+ #if HAVE_WINSOCK2_H -+ # include -+ #endif -+ ]], -+ [[static struct timeval x; -+ typedef int verify_tv_sec_type[ -+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 -+ ]; -+ ]])], -+ [gl_cv_sys_struct_timeval_tv_sec=yes], -+ [gl_cv_sys_struct_timeval_tv_sec=no]) -+ ]) -+ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then -+ REPLACE_STRUCT_TIMEVAL=1 -+ fi -+ fi -+ -+ dnl Check for declarations of anything we want to poison if the -+ dnl corresponding gnulib module is not in use. -+ gl_WARN_ON_USE_PREPARE([[ -+#if HAVE_SYS_TIME_H -+# include -+#endif -+#include -+ ]], [gettimeofday]) -+]) -+ -+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], -+[ -+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. -+ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) -+ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) -+ dnl Define it also as a C macro, for the benefit of the unit tests. -+ gl_MODULE_INDICATOR_FOR_TESTS([$1]) -+]) -+ -+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], -+[ -+ GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) -+ dnl Assume POSIX behavior unless another module says otherwise. -+ HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) -+ HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) -+ HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) -+ REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) -+ REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) -+]) -diff --git a/m4/time_h.m4 b/m4/time_h.m4 -new file mode 100644 -index 0000000..9852778 ---- /dev/null -+++ b/m4/time_h.m4 -@@ -0,0 +1,118 @@ -+# Configure a more-standard replacement for . -+ -+# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc. -+ -+# serial 8 -+ -+# This file is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# Written by Paul Eggert and Jim Meyering. -+ -+AC_DEFUN([gl_HEADER_TIME_H], -+[ -+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded -+ dnl once only, before all statements that occur in other macros. -+ AC_REQUIRE([gl_HEADER_TIME_H_BODY]) -+]) -+ -+AC_DEFUN([gl_HEADER_TIME_H_BODY], -+[ -+ AC_REQUIRE([AC_C_RESTRICT]) -+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) -+ gl_NEXT_HEADERS([time.h]) -+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) -+]) -+ -+dnl Check whether 'struct timespec' is declared -+dnl in time.h, sys/time.h, or pthread.h. -+ -+AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], -+[ -+ AC_CHECK_HEADERS_ONCE([sys/time.h]) -+ AC_CACHE_CHECK([for struct timespec in ], -+ [gl_cv_sys_struct_timespec_in_time_h], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ ]], -+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], -+ [gl_cv_sys_struct_timespec_in_time_h=yes], -+ [gl_cv_sys_struct_timespec_in_time_h=no])]) -+ -+ TIME_H_DEFINES_STRUCT_TIMESPEC=0 -+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 -+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 -+ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then -+ TIME_H_DEFINES_STRUCT_TIMESPEC=1 -+ else -+ AC_CACHE_CHECK([for struct timespec in ], -+ [gl_cv_sys_struct_timespec_in_sys_time_h], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ ]], -+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], -+ [gl_cv_sys_struct_timespec_in_sys_time_h=yes], -+ [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) -+ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then -+ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 -+ else -+ AC_CACHE_CHECK([for struct timespec in ], -+ [gl_cv_sys_struct_timespec_in_pthread_h], -+ [AC_COMPILE_IFELSE( -+ [AC_LANG_PROGRAM( -+ [[#include -+ ]], -+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], -+ [gl_cv_sys_struct_timespec_in_pthread_h=yes], -+ [gl_cv_sys_struct_timespec_in_pthread_h=no])]) -+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then -+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 -+ fi -+ fi -+ fi -+ AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) -+ AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) -+ AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) -+]) -+ -+AC_DEFUN([gl_TIME_MODULE_INDICATOR], -+[ -+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. -+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) -+ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) -+ dnl Define it also as a C macro, for the benefit of the unit tests. -+ gl_MODULE_INDICATOR_FOR_TESTS([$1]) -+]) -+ -+AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], -+[ -+ GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) -+ GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) -+ GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) -+ GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) -+ GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) -+ dnl Assume proper GNU behavior unless another module says otherwise. -+ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) -+ HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) -+ HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) -+ HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) -+ dnl If another module says to replace or to not replace, do that. -+ dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; -+ dnl this lets maintainers check for portability. -+ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) -+ REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) -+ REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) -+ REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) -+ -+ dnl Hack so that the time module doesn't depend on the sys_time module. -+ dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. -+ : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) -+ dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME -+ dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier -+ dnl is no longer a big deal. -+ REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) -+ REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) -+]) --- -1.9.3 - diff --git a/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch b/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch new file mode 100644 index 0000000..eafb7e9 --- /dev/null +++ b/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch @@ -0,0 +1,52 @@ +From d4c213d4c71336cefdc0419de510ac19665b5d32 Mon Sep 17 00:00:00 2001 +From: Fedora Ninjas +Date: Fri, 15 Aug 2014 11:29:22 -0400 +Subject: [PATCH 144/198] Fix exit back to EFI firmware + +Arm/AArch64 machines set up a timer event which is not getting +canceled when returning to firmware. This is because grub_exit() +calls grub_efi_fini() instead of grub_machine_fini(). The latter +will shutdown the timer (and other machine-specific things) as +well as make the call to grub_efi_fini(). +--- + grub-core/kern/arm/efi/init.c | 2 +- + grub-core/kern/efi/efi.c | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c +index 0c17d83..06df60e 100644 +--- a/grub-core/kern/arm/efi/init.c ++++ b/grub-core/kern/arm/efi/init.c +@@ -67,7 +67,7 @@ grub_machine_fini (int flags) + + b = grub_efi_system_table->boot_services; + +- efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0); ++ efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_CANCEL, 0); + efi_call_1 (b->close_event, tmr_evt); + + grub_efi_fini (); +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index 1a8dba5..d99a6fb 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* The handle of GRUB itself. Filled in by the startup code. */ + grub_efi_handle_t grub_efi_image_handle; +@@ -156,7 +157,7 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) + void + grub_exit (void) + { +- grub_efi_fini (); ++ grub_machine_fini (GRUB_LOADER_FLAG_NORETURN); + efi_call_4 (grub_efi_system_table->boot_services->exit, + grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0); + for (;;) ; +-- +2.7.4 + diff --git a/SOURCES/0145-Add-grub_util_readlink.patch b/SOURCES/0145-Add-grub_util_readlink.patch new file mode 100644 index 0000000..6443da8 --- /dev/null +++ b/SOURCES/0145-Add-grub_util_readlink.patch @@ -0,0 +1,3734 @@ +From 70ab42b16aa19b381262dc7a75a045d5ef6b2495 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 3 Sep 2014 10:01:03 -0400 +Subject: [PATCH 145/198] Add grub_util_readlink() + +Add grub_util_readlink(). This requires pulling in stat and readlink from +gnulib, which pulls in stat and related headers, but after that the +implementation is straightforward. + +Signed-off-by: Peter Jones +Reviewed-by: Adam Jackson +--- + grub-core/gnulib/Makefile.am | 177 +++++++- + grub-core/gnulib/gettimeofday.c | 154 +++++++ + grub-core/gnulib/pathmax.h | 83 ++++ + grub-core/gnulib/readlink.c | 74 ++++ + grub-core/gnulib/stat.c | 138 +++++++ + grub-core/gnulib/sys_stat.in.h | 732 ++++++++++++++++++++++++++++++++++ + grub-core/gnulib/sys_time.in.h | 213 ++++++++++ + grub-core/gnulib/sys_types.in.h | 2 + + grub-core/gnulib/time.h | 586 +++++++++++++++++++++++++++ + grub-core/gnulib/time.in.h | 274 +++++++++++++ + grub-core/osdep/windows/hostdisk.c | 6 + + include/grub/osdep/hostfile_aros.h | 6 + + include/grub/osdep/hostfile_unix.h | 6 + + include/grub/osdep/hostfile_windows.h | 2 + + m4/gettimeofday.m4 | 138 +++++++ + m4/gnulib-cache.m4 | 3 +- + m4/gnulib-comp.m4 | 49 +++ + m4/largefile.m4 | 146 +++++++ + m4/pathmax.m4 | 42 ++ + m4/readlink.m4 | 71 ++++ + m4/stat.m4 | 71 ++++ + m4/sys_stat_h.m4 | 96 +++++ + m4/sys_time_h.m4 | 110 +++++ + m4/time_h.m4 | 118 ++++++ + 24 files changed, 3295 insertions(+), 2 deletions(-) + create mode 100644 grub-core/gnulib/gettimeofday.c + create mode 100644 grub-core/gnulib/pathmax.h + create mode 100644 grub-core/gnulib/readlink.c + create mode 100644 grub-core/gnulib/stat.c + create mode 100644 grub-core/gnulib/sys_stat.in.h + create mode 100644 grub-core/gnulib/sys_time.in.h + create mode 100644 grub-core/gnulib/time.h + create mode 100644 grub-core/gnulib/time.in.h + create mode 100644 m4/gettimeofday.m4 + create mode 100644 m4/largefile.m4 + create mode 100644 m4/pathmax.m4 + create mode 100644 m4/readlink.m4 + create mode 100644 m4/stat.m4 + create mode 100644 m4/sys_stat_h.m4 + create mode 100644 m4/sys_time_h.m4 + create mode 100644 m4/time_h.m4 + +diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am +index 3444397..b7c5e60 100644 +--- a/grub-core/gnulib/Makefile.am ++++ b/grub-core/gnulib/Makefile.am +@@ -21,7 +21,7 @@ + # the same distribution terms as the rest of that program. + # + # Generated by gnulib-tool. +-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex ++# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex + + AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects + +@@ -326,6 +326,15 @@ libgnu_a_SOURCES += gettext.h + + ## end gnulib module gettext-h + ++## begin gnulib module gettimeofday ++ ++ ++EXTRA_DIST += gettimeofday.c ++ ++EXTRA_libgnu_a_SOURCES += gettimeofday.c ++ ++## end gnulib module gettimeofday ++ + ## begin gnulib module havelib + + +@@ -596,6 +605,13 @@ EXTRA_libgnu_a_SOURCES += nl_langinfo.c + + ## end gnulib module nl_langinfo + ++## begin gnulib module pathmax ++ ++ ++EXTRA_DIST += pathmax.h ++ ++## end gnulib module pathmax ++ + ## begin gnulib module progname + + libgnu_a_SOURCES += progname.h progname.c +@@ -611,6 +627,15 @@ EXTRA_libgnu_a_SOURCES += rawmemchr.c + + ## end gnulib module rawmemchr + ++## begin gnulib module readlink ++ ++ ++EXTRA_DIST += readlink.c ++ ++EXTRA_libgnu_a_SOURCES += readlink.c ++ ++## end gnulib module readlink ++ + ## begin gnulib module realloc-posix + + +@@ -725,6 +750,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h + + ## end gnulib module snippet/warn-on-use + ++## begin gnulib module stat ++ ++ ++EXTRA_DIST += stat.c ++ ++EXTRA_libgnu_a_SOURCES += stat.c ++ ++## end gnulib module stat ++ + ## begin gnulib module stdalign + + BUILT_SOURCES += $(STDALIGN_H) +@@ -1280,6 +1314,102 @@ libgnu_a_SOURCES += strnlen1.h strnlen1.c + + ## end gnulib module strnlen1 + ++## begin gnulib module sys_stat ++ ++BUILT_SOURCES += sys/stat.h ++ ++# We need the following in order to create when the system ++# has one that is incomplete. ++sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_at)$(MKDIR_P) sys ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ ++ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ ++ -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ ++ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ ++ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ ++ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ ++ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ ++ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ ++ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ ++ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ ++ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ ++ -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ ++ -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ ++ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ ++ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ ++ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ ++ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ ++ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ ++ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ ++ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ ++ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ ++ -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ ++ -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ ++ -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ ++ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ ++ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ ++ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ ++ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ ++ -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ ++ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ ++ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ ++ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ ++ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ ++ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ ++ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/sys_stat.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t ++MOSTLYCLEANDIRS += sys ++ ++EXTRA_DIST += sys_stat.in.h ++ ++## end gnulib module sys_stat ++ ++## begin gnulib module sys_time ++ ++BUILT_SOURCES += sys/time.h ++ ++# We need the following in order to create when the system ++# doesn't have one that works with the given compiler. ++sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_at)$(MKDIR_P) sys ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ ++ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ ++ -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ ++ -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ ++ -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ ++ -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ ++ -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/sys_time.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += sys/time.h sys/time.h-t ++ ++EXTRA_DIST += sys_time.in.h ++ ++## end gnulib module sys_time ++ + ## begin gnulib module sys_types + + BUILT_SOURCES += sys/types.h +@@ -1334,6 +1464,51 @@ EXTRA_DIST += sysexits.in.h + + ## end gnulib module sysexits + ++## begin gnulib module time ++ ++BUILT_SOURCES += time.h ++ ++# We need the following in order to create when the system ++# doesn't have one that works with the given compiler. ++time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) ++ $(AM_V_GEN)rm -f $@-t $@ && \ ++ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ ++ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ ++ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ ++ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ ++ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ ++ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ ++ -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ ++ -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ ++ -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ ++ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ ++ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ ++ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ ++ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ ++ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ ++ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ ++ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ ++ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ ++ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ ++ -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ ++ -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ ++ -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ ++ -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ ++ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ ++ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ ++ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ ++ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ ++ < $(srcdir)/time.in.h; \ ++ } > $@-t && \ ++ mv $@-t $@ ++MOSTLYCLEANFILES += time.h time.h-t ++ ++EXTRA_DIST += time.in.h ++ ++## end gnulib module time ++ + ## begin gnulib module unistd + + BUILT_SOURCES += unistd.h +diff --git a/grub-core/gnulib/gettimeofday.c b/grub-core/gnulib/gettimeofday.c +new file mode 100644 +index 0000000..8b2058e +--- /dev/null ++++ b/grub-core/gnulib/gettimeofday.c +@@ -0,0 +1,154 @@ ++/* Provide gettimeofday for systems that don't have it or for which it's broken. ++ ++ Copyright (C) 2001-2003, 2005-2007, 2009-2014 Free Software Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++/* written by Jim Meyering */ ++ ++#include ++ ++/* Specification. */ ++#include ++ ++#include ++ ++#if HAVE_SYS_TIMEB_H ++# include ++#endif ++ ++#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME ++ ++/* Work around the bug in some systems whereby gettimeofday clobbers ++ the static buffer that localtime uses for its return value. The ++ gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has ++ this problem. The tzset replacement is necessary for at least ++ Solaris 2.5, 2.5.1, and 2.6. */ ++ ++static struct tm tm_zero_buffer; ++static struct tm *localtime_buffer_addr = &tm_zero_buffer; ++ ++# undef localtime ++extern struct tm *localtime (time_t const *); ++ ++# undef gmtime ++extern struct tm *gmtime (time_t const *); ++ ++/* This is a wrapper for localtime. It is used only on systems for which ++ gettimeofday clobbers the static buffer used for localtime's result. ++ ++ On the first call, record the address of the static buffer that ++ localtime uses for its result. */ ++ ++struct tm * ++rpl_localtime (time_t const *timep) ++{ ++ struct tm *tm = localtime (timep); ++ ++ if (localtime_buffer_addr == &tm_zero_buffer) ++ localtime_buffer_addr = tm; ++ ++ return tm; ++} ++ ++/* Same as above, since gmtime and localtime use the same buffer. */ ++struct tm * ++rpl_gmtime (time_t const *timep) ++{ ++ struct tm *tm = gmtime (timep); ++ ++ if (localtime_buffer_addr == &tm_zero_buffer) ++ localtime_buffer_addr = tm; ++ ++ return tm; ++} ++ ++#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ ++ ++#if TZSET_CLOBBERS_LOCALTIME ++ ++# undef tzset ++extern void tzset (void); ++ ++/* This is a wrapper for tzset, for systems on which tzset may clobber ++ the static buffer used for localtime's result. */ ++void ++rpl_tzset (void) ++{ ++ /* Save and restore the contents of the buffer used for localtime's ++ result around the call to tzset. */ ++ struct tm save = *localtime_buffer_addr; ++ tzset (); ++ *localtime_buffer_addr = save; ++} ++#endif ++ ++/* This is a wrapper for gettimeofday. It is used only on systems ++ that lack this function, or whose implementation of this function ++ causes problems. */ ++ ++int ++gettimeofday (struct timeval *restrict tv, void *restrict tz) ++{ ++#undef gettimeofday ++#if HAVE_GETTIMEOFDAY ++# if GETTIMEOFDAY_CLOBBERS_LOCALTIME ++ /* Save and restore the contents of the buffer used for localtime's ++ result around the call to gettimeofday. */ ++ struct tm save = *localtime_buffer_addr; ++# endif ++ ++# if defined timeval /* 'struct timeval' overridden by gnulib? */ ++# undef timeval ++ struct timeval otv; ++ int result = gettimeofday (&otv, (struct timezone *) tz); ++ if (result == 0) ++ { ++ tv->tv_sec = otv.tv_sec; ++ tv->tv_usec = otv.tv_usec; ++ } ++# else ++ int result = gettimeofday (tv, (struct timezone *) tz); ++# endif ++ ++# if GETTIMEOFDAY_CLOBBERS_LOCALTIME ++ *localtime_buffer_addr = save; ++# endif ++ ++ return result; ++ ++#else ++ ++# if HAVE__FTIME ++ ++ struct _timeb timebuf; ++ _ftime (&timebuf); ++ tv->tv_sec = timebuf.time; ++ tv->tv_usec = timebuf.millitm * 1000; ++ ++# else ++ ++# if !defined OK_TO_USE_1S_CLOCK ++# error "Only 1-second nominal clock resolution found. Is that intended?" \ ++ "If so, compile with the -DOK_TO_USE_1S_CLOCK option." ++# endif ++ tv->tv_sec = time (NULL); ++ tv->tv_usec = 0; ++ ++# endif ++ ++ return 0; ++ ++#endif ++} +diff --git a/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h +new file mode 100644 +index 0000000..33fc355 +--- /dev/null ++++ b/grub-core/gnulib/pathmax.h +@@ -0,0 +1,83 @@ ++/* Define PATH_MAX somehow. Requires sys/types.h. ++ Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2014 Free Software ++ Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++#ifndef _PATHMAX_H ++# define _PATHMAX_H ++ ++/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename, ++ including the terminating NUL byte. ++ ++ PATH_MAX is not defined on systems which have no limit on filename length, ++ such as GNU/Hurd. ++ ++ This file does *not* define PATH_MAX always. Programs that use this file ++ can handle the GNU/Hurd case in several ways: ++ - Either with a package-wide handling, or with a per-file handling, ++ - Either through a ++ #ifdef PATH_MAX ++ or through a fallback like ++ #ifndef PATH_MAX ++ # define PATH_MAX 8192 ++ #endif ++ or through a fallback like ++ #ifndef PATH_MAX ++ # define PATH_MAX pathconf ("/", _PC_PATH_MAX) ++ #endif ++ */ ++ ++# include ++ ++# include ++ ++# ifndef _POSIX_PATH_MAX ++# define _POSIX_PATH_MAX 256 ++# endif ++ ++/* Don't include sys/param.h if it already has been. */ ++# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN ++# include ++# endif ++ ++# if !defined PATH_MAX && defined MAXPATHLEN ++# define PATH_MAX MAXPATHLEN ++# endif ++ ++# ifdef __hpux ++/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename, ++ *not* including the terminating NUL byte, and is set to 1023. ++ Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is ++ not defined at all any more. */ ++# undef PATH_MAX ++# define PATH_MAX 1024 ++# endif ++ ++# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, ++ section "Maximum Path Length Limitation", ++ ++ explains that the maximum size of a filename, including the terminating ++ NUL byte, is 260 = 3 + 256 + 1. ++ This is the same value as ++ - FILENAME_MAX in , ++ - _MAX_PATH in , ++ - MAX_PATH in . ++ Undefine the original value, because mingw's gets it wrong. */ ++# undef PATH_MAX ++# define PATH_MAX 260 ++# endif ++ ++#endif /* _PATHMAX_H */ +diff --git a/grub-core/gnulib/readlink.c b/grub-core/gnulib/readlink.c +new file mode 100644 +index 0000000..4c49639 +--- /dev/null ++++ b/grub-core/gnulib/readlink.c +@@ -0,0 +1,74 @@ ++/* Stub for readlink(). ++ Copyright (C) 2003-2007, 2009-2014 Free Software Foundation, Inc. ++ ++ This program 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. ++ ++ This program 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 this program. If not, see . */ ++ ++#include ++ ++/* Specification. */ ++#include ++ ++#include ++#include ++#include ++ ++#if !HAVE_READLINK ++ ++/* readlink() substitute for systems that don't have a readlink() function, ++ such as DJGPP 2.03 and mingw32. */ ++ ++ssize_t ++readlink (const char *name, char *buf _GL_UNUSED, ++ size_t bufsize _GL_UNUSED) ++{ ++ struct stat statbuf; ++ ++ /* In general we should use lstat() here, not stat(). But on platforms ++ without symbolic links, lstat() - if it exists - would be equivalent to ++ stat(), therefore we can use stat(). This saves us a configure check. */ ++ if (stat (name, &statbuf) >= 0) ++ errno = EINVAL; ++ return -1; ++} ++ ++#else /* HAVE_READLINK */ ++ ++# undef readlink ++ ++/* readlink() wrapper that uses correct types, for systems like cygwin ++ 1.5.x where readlink returns int, and which rejects trailing slash, ++ for Solaris 9. */ ++ ++ssize_t ++rpl_readlink (const char *name, char *buf, size_t bufsize) ++{ ++# if READLINK_TRAILING_SLASH_BUG ++ size_t len = strlen (name); ++ if (len && name[len - 1] == '/') ++ { ++ /* Even if name without the slash is a symlink to a directory, ++ both lstat() and stat() must resolve the trailing slash to ++ the directory rather than the symlink. We can therefore ++ safely use stat() to distinguish between EINVAL and ++ ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat(). */ ++ struct stat st; ++ if (stat (name, &st) == 0) ++ errno = EINVAL; ++ return -1; ++ } ++# endif /* READLINK_TRAILING_SLASH_BUG */ ++ return readlink (name, buf, bufsize); ++} ++ ++#endif /* HAVE_READLINK */ +diff --git a/grub-core/gnulib/stat.c b/grub-core/gnulib/stat.c +new file mode 100644 +index 0000000..35f4b0b +--- /dev/null ++++ b/grub-core/gnulib/stat.c +@@ -0,0 +1,138 @@ ++/* Work around platform bugs in stat. ++ Copyright (C) 2009-2014 Free Software Foundation, Inc. ++ ++ This program 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. ++ ++ This program 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 this program. If not, see . */ ++ ++/* written by Eric Blake */ ++ ++/* If the user's config.h happens to include , let it include only ++ the system's here, so that orig_stat doesn't recurse to ++ rpl_stat. */ ++#define __need_system_sys_stat_h ++#include ++ ++/* Get the original definition of stat. It might be defined as a macro. */ ++#include ++#include ++#undef __need_system_sys_stat_h ++ ++#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++# if _GL_WINDOWS_64_BIT_ST_SIZE ++# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */ ++# define stat _stati64 ++# define REPLACE_FUNC_STAT_DIR 1 ++# undef REPLACE_FUNC_STAT_FILE ++# elif REPLACE_FUNC_STAT_FILE ++/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a. ++ Bypass it. */ ++# define stat _stat ++# define REPLACE_FUNC_STAT_DIR 1 ++# undef REPLACE_FUNC_STAT_FILE ++# endif ++#endif ++ ++static int ++orig_stat (const char *filename, struct stat *buf) ++{ ++ return stat (filename, buf); ++} ++ ++/* Specification. */ ++/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc ++ eliminates this include because of the preliminary #include ++ above. */ ++#include "sys/stat.h" ++ ++#include ++#include ++#include ++#include ++#include "dosname.h" ++#include "verify.h" ++ ++#if REPLACE_FUNC_STAT_DIR ++# include "pathmax.h" ++ /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also ++ have a constant PATH_MAX. */ ++# ifndef PATH_MAX ++# error "Please port this replacement to your platform" ++# endif ++#endif ++ ++/* Store information about NAME into ST. Work around bugs with ++ trailing slashes. Mingw has other bugs (such as st_ino always ++ being 0 on success) which this wrapper does not work around. But ++ at least this implementation provides the ability to emulate fchdir ++ correctly. */ ++ ++int ++rpl_stat (char const *name, struct stat *st) ++{ ++ int result = orig_stat (name, st); ++#if REPLACE_FUNC_STAT_FILE ++ /* Solaris 9 mistakenly succeeds when given a non-directory with a ++ trailing slash. */ ++ if (result == 0 && !S_ISDIR (st->st_mode)) ++ { ++ size_t len = strlen (name); ++ if (ISSLASH (name[len - 1])) ++ { ++ errno = ENOTDIR; ++ return -1; ++ } ++ } ++#endif /* REPLACE_FUNC_STAT_FILE */ ++#if REPLACE_FUNC_STAT_DIR ++ ++ if (result == -1 && errno == ENOENT) ++ { ++ /* Due to mingw's oddities, there are some directories (like ++ c:\) where stat() only succeeds with a trailing slash, and ++ other directories (like c:\windows) where stat() only ++ succeeds without a trailing slash. But we want the two to be ++ synonymous, since chdir() manages either style. Likewise, Mingw also ++ reports ENOENT for names longer than PATH_MAX, when we want ++ ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR. ++ Fortunately, mingw PATH_MAX is small enough for stack ++ allocation. */ ++ char fixed_name[PATH_MAX + 1] = {0}; ++ size_t len = strlen (name); ++ bool check_dir = false; ++ verify (PATH_MAX <= 4096); ++ if (PATH_MAX <= len) ++ errno = ENAMETOOLONG; ++ else if (len) ++ { ++ strcpy (fixed_name, name); ++ if (ISSLASH (fixed_name[len - 1])) ++ { ++ check_dir = true; ++ while (len && ISSLASH (fixed_name[len - 1])) ++ fixed_name[--len] = '\0'; ++ if (!len) ++ fixed_name[0] = '/'; ++ } ++ else ++ fixed_name[len++] = '/'; ++ result = orig_stat (fixed_name, st); ++ if (result == 0 && check_dir && !S_ISDIR (st->st_mode)) ++ { ++ result = -1; ++ errno = ENOTDIR; ++ } ++ } ++ } ++#endif /* REPLACE_FUNC_STAT_DIR */ ++ return result; ++} +diff --git a/grub-core/gnulib/sys_stat.in.h b/grub-core/gnulib/sys_stat.in.h +new file mode 100644 +index 0000000..b47a7ff +--- /dev/null ++++ b/grub-core/gnulib/sys_stat.in.h +@@ -0,0 +1,732 @@ ++/* Provide a more complete sys/stat header file. ++ Copyright (C) 2005-2014 Free Software Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */ ++ ++/* This file is supposed to be used on platforms where is ++ incomplete. It is intended to provide definitions and prototypes ++ needed by an application. Start with what the system provides. */ ++ ++#if __GNUC__ >= 3 ++@PRAGMA_SYSTEM_HEADER@ ++#endif ++@PRAGMA_COLUMNS@ ++ ++#if defined __need_system_sys_stat_h ++/* Special invocation convention. */ ++ ++#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ ++ ++#else ++/* Normal invocation convention. */ ++ ++#ifndef _@GUARD_PREFIX@_SYS_STAT_H ++ ++/* Get nlink_t. ++ May also define off_t to a 64-bit type on native Windows. */ ++#include ++ ++/* Get struct timespec. */ ++#include ++ ++/* The include_next requires a split double-inclusion guard. */ ++#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ ++ ++#ifndef _@GUARD_PREFIX@_SYS_STAT_H ++#define _@GUARD_PREFIX@_SYS_STAT_H ++ ++/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ ++ ++/* The definition of _GL_ARG_NONNULL is copied here. */ ++ ++/* The definition of _GL_WARN_ON_USE is copied here. */ ++ ++/* Before doing "#define mkdir rpl_mkdir" below, we need to include all ++ headers that may declare mkdir(). Native Windows platforms declare mkdir ++ in and/or , not in . */ ++#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++# include /* mingw32, mingw64 */ ++# include /* mingw64, MSVC 9 */ ++#endif ++ ++/* Native Windows platforms declare umask() in . */ ++#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) ++# include ++#endif ++ ++/* Large File Support on native Windows. */ ++#if @WINDOWS_64_BIT_ST_SIZE@ ++# define stat _stati64 ++#endif ++ ++#ifndef S_IFIFO ++# ifdef _S_IFIFO ++# define S_IFIFO _S_IFIFO ++# endif ++#endif ++ ++#ifndef S_IFMT ++# define S_IFMT 0170000 ++#endif ++ ++#if STAT_MACROS_BROKEN ++# undef S_ISBLK ++# undef S_ISCHR ++# undef S_ISDIR ++# undef S_ISFIFO ++# undef S_ISLNK ++# undef S_ISNAM ++# undef S_ISMPB ++# undef S_ISMPC ++# undef S_ISNWK ++# undef S_ISREG ++# undef S_ISSOCK ++#endif ++ ++#ifndef S_ISBLK ++# ifdef S_IFBLK ++# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) ++# else ++# define S_ISBLK(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISCHR ++# ifdef S_IFCHR ++# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) ++# else ++# define S_ISCHR(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISDIR ++# ifdef S_IFDIR ++# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) ++# else ++# define S_ISDIR(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISDOOR /* Solaris 2.5 and up */ ++# define S_ISDOOR(m) 0 ++#endif ++ ++#ifndef S_ISFIFO ++# ifdef S_IFIFO ++# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) ++# else ++# define S_ISFIFO(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISLNK ++# ifdef S_IFLNK ++# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) ++# else ++# define S_ISLNK(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISMPB /* V7 */ ++# ifdef S_IFMPB ++# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) ++# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) ++# else ++# define S_ISMPB(m) 0 ++# define S_ISMPC(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISMPX /* AIX */ ++# define S_ISMPX(m) 0 ++#endif ++ ++#ifndef S_ISNAM /* Xenix */ ++# ifdef S_IFNAM ++# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) ++# else ++# define S_ISNAM(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISNWK /* HP/UX */ ++# ifdef S_IFNWK ++# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) ++# else ++# define S_ISNWK(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISPORT /* Solaris 10 and up */ ++# define S_ISPORT(m) 0 ++#endif ++ ++#ifndef S_ISREG ++# ifdef S_IFREG ++# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) ++# else ++# define S_ISREG(m) 0 ++# endif ++#endif ++ ++#ifndef S_ISSOCK ++# ifdef S_IFSOCK ++# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) ++# else ++# define S_ISSOCK(m) 0 ++# endif ++#endif ++ ++ ++#ifndef S_TYPEISMQ ++# define S_TYPEISMQ(p) 0 ++#endif ++ ++#ifndef S_TYPEISTMO ++# define S_TYPEISTMO(p) 0 ++#endif ++ ++ ++#ifndef S_TYPEISSEM ++# ifdef S_INSEM ++# define S_TYPEISSEM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSEM) ++# else ++# define S_TYPEISSEM(p) 0 ++# endif ++#endif ++ ++#ifndef S_TYPEISSHM ++# ifdef S_INSHD ++# define S_TYPEISSHM(p) (S_ISNAM ((p)->st_mode) && (p)->st_rdev == S_INSHD) ++# else ++# define S_TYPEISSHM(p) 0 ++# endif ++#endif ++ ++/* high performance ("contiguous data") */ ++#ifndef S_ISCTG ++# define S_ISCTG(p) 0 ++#endif ++ ++/* Cray DMF (data migration facility): off line, with data */ ++#ifndef S_ISOFD ++# define S_ISOFD(p) 0 ++#endif ++ ++/* Cray DMF (data migration facility): off line, with no data */ ++#ifndef S_ISOFL ++# define S_ISOFL(p) 0 ++#endif ++ ++/* 4.4BSD whiteout */ ++#ifndef S_ISWHT ++# define S_ISWHT(m) 0 ++#endif ++ ++/* If any of the following are undefined, ++ define them to their de facto standard values. */ ++#if !S_ISUID ++# define S_ISUID 04000 ++#endif ++#if !S_ISGID ++# define S_ISGID 02000 ++#endif ++ ++/* S_ISVTX is a common extension to POSIX. */ ++#ifndef S_ISVTX ++# define S_ISVTX 01000 ++#endif ++ ++#if !S_IRUSR && S_IREAD ++# define S_IRUSR S_IREAD ++#endif ++#if !S_IRUSR ++# define S_IRUSR 00400 ++#endif ++#if !S_IRGRP ++# define S_IRGRP (S_IRUSR >> 3) ++#endif ++#if !S_IROTH ++# define S_IROTH (S_IRUSR >> 6) ++#endif ++ ++#if !S_IWUSR && S_IWRITE ++# define S_IWUSR S_IWRITE ++#endif ++#if !S_IWUSR ++# define S_IWUSR 00200 ++#endif ++#if !S_IWGRP ++# define S_IWGRP (S_IWUSR >> 3) ++#endif ++#if !S_IWOTH ++# define S_IWOTH (S_IWUSR >> 6) ++#endif ++ ++#if !S_IXUSR && S_IEXEC ++# define S_IXUSR S_IEXEC ++#endif ++#if !S_IXUSR ++# define S_IXUSR 00100 ++#endif ++#if !S_IXGRP ++# define S_IXGRP (S_IXUSR >> 3) ++#endif ++#if !S_IXOTH ++# define S_IXOTH (S_IXUSR >> 6) ++#endif ++ ++#if !S_IRWXU ++# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) ++#endif ++#if !S_IRWXG ++# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) ++#endif ++#if !S_IRWXO ++# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) ++#endif ++ ++/* S_IXUGO is a common extension to POSIX. */ ++#if !S_IXUGO ++# define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) ++#endif ++ ++#ifndef S_IRWXUGO ++# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) ++#endif ++ ++/* Macros for futimens and utimensat. */ ++#ifndef UTIME_NOW ++# define UTIME_NOW (-1) ++# define UTIME_OMIT (-2) ++#endif ++ ++ ++#if @GNULIB_FCHMODAT@ ++# if !@HAVE_FCHMODAT@ ++_GL_FUNCDECL_SYS (fchmodat, int, ++ (int fd, char const *file, mode_t mode, int flag) ++ _GL_ARG_NONNULL ((2))); ++# endif ++_GL_CXXALIAS_SYS (fchmodat, int, ++ (int fd, char const *file, mode_t mode, int flag)); ++_GL_CXXALIASWARN (fchmodat); ++#elif defined GNULIB_POSIXCHECK ++# undef fchmodat ++# if HAVE_RAW_DECL_FCHMODAT ++_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - " ++ "use gnulib module openat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_FSTAT@ ++# if @REPLACE_FSTAT@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef fstat ++# define fstat rpl_fstat ++# endif ++_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2))); ++_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf)); ++# else ++_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); ++# endif ++_GL_CXXALIASWARN (fstat); ++#elif @WINDOWS_64_BIT_ST_SIZE@ ++/* Above, we define stat to _stati64. */ ++# define fstat _fstati64 ++#elif defined GNULIB_POSIXCHECK ++# undef fstat ++# if HAVE_RAW_DECL_FSTAT ++_GL_WARN_ON_USE (fstat, "fstat has portability problems - " ++ "use gnulib module fstat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_FSTATAT@ ++# if @REPLACE_FSTATAT@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef fstatat ++# define fstatat rpl_fstatat ++# endif ++_GL_FUNCDECL_RPL (fstatat, int, ++ (int fd, char const *name, struct stat *st, int flags) ++ _GL_ARG_NONNULL ((2, 3))); ++_GL_CXXALIAS_RPL (fstatat, int, ++ (int fd, char const *name, struct stat *st, int flags)); ++# else ++# if !@HAVE_FSTATAT@ ++_GL_FUNCDECL_SYS (fstatat, int, ++ (int fd, char const *name, struct stat *st, int flags) ++ _GL_ARG_NONNULL ((2, 3))); ++# endif ++_GL_CXXALIAS_SYS (fstatat, int, ++ (int fd, char const *name, struct stat *st, int flags)); ++# endif ++_GL_CXXALIASWARN (fstatat); ++#elif defined GNULIB_POSIXCHECK ++# undef fstatat ++# if HAVE_RAW_DECL_FSTATAT ++_GL_WARN_ON_USE (fstatat, "fstatat is not portable - " ++ "use gnulib module openat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_FUTIMENS@ ++/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens ++ implementation relies on futimesat, which on Solaris 10 makes an invocation ++ to futimens that is meant to invoke the libc's futimens(), not gnulib's ++ futimens(). */ ++# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun) ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef futimens ++# define futimens rpl_futimens ++# endif ++_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2])); ++_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2])); ++# else ++# if !@HAVE_FUTIMENS@ ++_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); ++# endif ++_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); ++# endif ++# if @HAVE_FUTIMENS@ ++_GL_CXXALIASWARN (futimens); ++# endif ++#elif defined GNULIB_POSIXCHECK ++# undef futimens ++# if HAVE_RAW_DECL_FUTIMENS ++_GL_WARN_ON_USE (futimens, "futimens is not portable - " ++ "use gnulib module futimens for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_LCHMOD@ ++/* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME ++ denotes a symbolic link. */ ++# if !@HAVE_LCHMOD@ ++/* The lchmod replacement follows symbolic links. Callers should take ++ this into account; lchmod should be applied only to arguments that ++ are known to not be symbolic links. On hosts that lack lchmod, ++ this can lead to race conditions between the check and the ++ invocation of lchmod, but we know of no workarounds that are ++ reliable in general. You might try requesting support for lchmod ++ from your operating system supplier. */ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define lchmod chmod ++# endif ++/* Need to cast, because on mingw, the second parameter of chmod is ++ int mode. */ ++_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int, ++ (const char *filename, mode_t mode)); ++# else ++# if 0 /* assume already declared */ ++_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode) ++ _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode)); ++# endif ++# if @HAVE_LCHMOD@ ++_GL_CXXALIASWARN (lchmod); ++# endif ++#elif defined GNULIB_POSIXCHECK ++# undef lchmod ++# if HAVE_RAW_DECL_LCHMOD ++_GL_WARN_ON_USE (lchmod, "lchmod is unportable - " ++ "use gnulib module lchmod for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_LSTAT@ ++# if ! @HAVE_LSTAT@ ++/* mingw does not support symlinks, therefore it does not have lstat. But ++ without links, stat does just fine. */ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define lstat stat ++# endif ++_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf)); ++# elif @REPLACE_LSTAT@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef lstat ++# define lstat rpl_lstat ++# endif ++_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf) ++ _GL_ARG_NONNULL ((1, 2))); ++_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf)); ++# else ++_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf)); ++# endif ++# if @HAVE_LSTAT@ ++_GL_CXXALIASWARN (lstat); ++# endif ++#elif defined GNULIB_POSIXCHECK ++# undef lstat ++# if HAVE_RAW_DECL_LSTAT ++_GL_WARN_ON_USE (lstat, "lstat is unportable - " ++ "use gnulib module lstat for portability"); ++# endif ++#endif ++ ++ ++#if @REPLACE_MKDIR@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef mkdir ++# define mkdir rpl_mkdir ++# endif ++_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); ++#else ++/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. ++ Additionally, it declares _mkdir (and depending on compile flags, an ++ alias mkdir), only in the nonstandard includes and , ++ which are included above. */ ++# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++ ++# if !GNULIB_defined_rpl_mkdir ++static int ++rpl_mkdir (char const *name, mode_t mode) ++{ ++ return _mkdir (name); ++} ++# define GNULIB_defined_rpl_mkdir 1 ++# endif ++ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define mkdir rpl_mkdir ++# endif ++_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); ++# else ++_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); ++# endif ++#endif ++_GL_CXXALIASWARN (mkdir); ++ ++ ++#if @GNULIB_MKDIRAT@ ++# if !@HAVE_MKDIRAT@ ++_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode) ++ _GL_ARG_NONNULL ((2))); ++# endif ++_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)); ++_GL_CXXALIASWARN (mkdirat); ++#elif defined GNULIB_POSIXCHECK ++# undef mkdirat ++# if HAVE_RAW_DECL_MKDIRAT ++_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - " ++ "use gnulib module openat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_MKFIFO@ ++# if @REPLACE_MKFIFO@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef mkfifo ++# define mkfifo rpl_mkfifo ++# endif ++_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode)); ++# else ++# if !@HAVE_MKFIFO@ ++_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode) ++ _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode)); ++# endif ++_GL_CXXALIASWARN (mkfifo); ++#elif defined GNULIB_POSIXCHECK ++# undef mkfifo ++# if HAVE_RAW_DECL_MKFIFO ++_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - " ++ "use gnulib module mkfifo for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_MKFIFOAT@ ++# if !@HAVE_MKFIFOAT@ ++_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) ++ _GL_ARG_NONNULL ((2))); ++# endif ++_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); ++_GL_CXXALIASWARN (mkfifoat); ++#elif defined GNULIB_POSIXCHECK ++# undef mkfifoat ++# if HAVE_RAW_DECL_MKFIFOAT ++_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - " ++ "use gnulib module mkfifoat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_MKNOD@ ++# if @REPLACE_MKNOD@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef mknod ++# define mknod rpl_mknod ++# endif ++_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); ++# else ++# if !@HAVE_MKNOD@ ++_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) ++ _GL_ARG_NONNULL ((1))); ++# endif ++/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ ++_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); ++# endif ++_GL_CXXALIASWARN (mknod); ++#elif defined GNULIB_POSIXCHECK ++# undef mknod ++# if HAVE_RAW_DECL_MKNOD ++_GL_WARN_ON_USE (mknod, "mknod is not portable - " ++ "use gnulib module mknod for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_MKNODAT@ ++# if !@HAVE_MKNODAT@ ++_GL_FUNCDECL_SYS (mknodat, int, ++ (int fd, char const *file, mode_t mode, dev_t dev) ++ _GL_ARG_NONNULL ((2))); ++# endif ++_GL_CXXALIAS_SYS (mknodat, int, ++ (int fd, char const *file, mode_t mode, dev_t dev)); ++_GL_CXXALIASWARN (mknodat); ++#elif defined GNULIB_POSIXCHECK ++# undef mknodat ++# if HAVE_RAW_DECL_MKNODAT ++_GL_WARN_ON_USE (mknodat, "mknodat is not portable - " ++ "use gnulib module mkfifoat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_STAT@ ++# if @REPLACE_STAT@ ++/* We can't use the object-like #define stat rpl_stat, because of ++ struct stat. This means that rpl_stat will not be used if the user ++ does (stat)(a,b). Oh well. */ ++# if defined _AIX && defined stat && defined _LARGE_FILES ++ /* With _LARGE_FILES defined, AIX (only) defines stat to stat64, ++ so we have to replace stat64() instead of stat(). */ ++# undef stat64 ++# define stat64(name, st) rpl_stat (name, st) ++# elif @WINDOWS_64_BIT_ST_SIZE@ ++ /* Above, we define stat to _stati64. */ ++# if defined __MINGW32__ && defined _stati64 ++# ifndef _USE_32BIT_TIME_T ++ /* The system headers define _stati64 to _stat64. */ ++# undef _stat64 ++# define _stat64(name, st) rpl_stat (name, st) ++# endif ++# elif defined _MSC_VER && defined _stati64 ++# ifdef _USE_32BIT_TIME_T ++ /* The system headers define _stati64 to _stat32i64. */ ++# undef _stat32i64 ++# define _stat32i64(name, st) rpl_stat (name, st) ++# else ++ /* The system headers define _stati64 to _stat64. */ ++# undef _stat64 ++# define _stat64(name, st) rpl_stat (name, st) ++# endif ++# else ++# undef _stati64 ++# define _stati64(name, st) rpl_stat (name, st) ++# endif ++# elif defined __MINGW32__ && defined stat ++# ifdef _USE_32BIT_TIME_T ++ /* The system headers define stat to _stat32i64. */ ++# undef _stat32i64 ++# define _stat32i64(name, st) rpl_stat (name, st) ++# else ++ /* The system headers define stat to _stat64. */ ++# undef _stat64 ++# define _stat64(name, st) rpl_stat (name, st) ++# endif ++# elif defined _MSC_VER && defined stat ++# ifdef _USE_32BIT_TIME_T ++ /* The system headers define stat to _stat32. */ ++# undef _stat32 ++# define _stat32(name, st) rpl_stat (name, st) ++# else ++ /* The system headers define stat to _stat64i32. */ ++# undef _stat64i32 ++# define _stat64i32(name, st) rpl_stat (name, st) ++# endif ++# else /* !(_AIX ||__MINGW32__ || _MSC_VER) */ ++# undef stat ++# define stat(name, st) rpl_stat (name, st) ++# endif /* !_LARGE_FILES */ ++_GL_EXTERN_C int stat (const char *name, struct stat *buf) ++ _GL_ARG_NONNULL ((1, 2)); ++# endif ++#elif defined GNULIB_POSIXCHECK ++# undef stat ++# if HAVE_RAW_DECL_STAT ++_GL_WARN_ON_USE (stat, "stat is unportable - " ++ "use gnulib module stat for portability"); ++# endif ++#endif ++ ++ ++#if @GNULIB_UTIMENSAT@ ++/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat ++ implementation relies on futimesat, which on Solaris 10 makes an invocation ++ to utimensat that is meant to invoke the libc's utimensat(), not gnulib's ++ utimensat(). */ ++# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun) ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef utimensat ++# define utimensat rpl_utimensat ++# endif ++_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name, ++ struct timespec const times[2], int flag) ++ _GL_ARG_NONNULL ((2))); ++_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name, ++ struct timespec const times[2], int flag)); ++# else ++# if !@HAVE_UTIMENSAT@ ++_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, ++ struct timespec const times[2], int flag) ++ _GL_ARG_NONNULL ((2))); ++# endif ++_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, ++ struct timespec const times[2], int flag)); ++# endif ++# if @HAVE_UTIMENSAT@ ++_GL_CXXALIASWARN (utimensat); ++# endif ++#elif defined GNULIB_POSIXCHECK ++# undef utimensat ++# if HAVE_RAW_DECL_UTIMENSAT ++_GL_WARN_ON_USE (utimensat, "utimensat is not portable - " ++ "use gnulib module utimensat for portability"); ++# endif ++#endif ++ ++ ++#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ ++#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ ++#endif +diff --git a/grub-core/gnulib/sys_time.in.h b/grub-core/gnulib/sys_time.in.h +new file mode 100644 +index 0000000..30057ad +--- /dev/null ++++ b/grub-core/gnulib/sys_time.in.h +@@ -0,0 +1,213 @@ ++/* Provide a more complete sys/time.h. ++ ++ Copyright (C) 2007-2014 Free Software Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++/* Written by Paul Eggert. */ ++ ++#ifndef _@GUARD_PREFIX@_SYS_TIME_H ++ ++#if __GNUC__ >= 3 ++@PRAGMA_SYSTEM_HEADER@ ++#endif ++@PRAGMA_COLUMNS@ ++ ++/* On Cygwin and on many BSDish systems, includes itself ++ recursively via . ++ Simply delegate to the system's header in this case; it is a no-op. ++ Without this extra ifdef, the C++ gettimeofday declaration below ++ would be a forward declaration in gnulib's nested . */ ++#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_ ++# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ ++#else ++ ++/* The include_next requires a split double-inclusion guard. */ ++#if @HAVE_SYS_TIME_H@ ++# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ ++#endif ++ ++#ifndef _@GUARD_PREFIX@_SYS_TIME_H ++#define _@GUARD_PREFIX@_SYS_TIME_H ++ ++#if ! @HAVE_SYS_TIME_H@ ++# include ++#endif ++ ++/* On native Windows with MSVC, get the 'struct timeval' type. ++ Also, on native Windows with a 64-bit time_t, where we are overriding the ++ 'struct timeval' type, get all declarations of system functions whose ++ signature contains 'struct timeval'. */ ++#if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H ++# define _GL_INCLUDING_WINSOCK2_H ++# include ++# undef _GL_INCLUDING_WINSOCK2_H ++#endif ++ ++/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ ++ ++/* The definition of _GL_ARG_NONNULL is copied here. */ ++ ++/* The definition of _GL_WARN_ON_USE is copied here. */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@ ++ ++# if @REPLACE_STRUCT_TIMEVAL@ ++# define timeval rpl_timeval ++# endif ++ ++# if !GNULIB_defined_struct_timeval ++struct timeval ++{ ++ time_t tv_sec; ++ long int tv_usec; ++}; ++# define GNULIB_defined_struct_timeval 1 ++# endif ++ ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#if @GNULIB_GETTIMEOFDAY@ ++# if @REPLACE_GETTIMEOFDAY@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gettimeofday ++# define gettimeofday rpl_gettimeofday ++# endif ++_GL_FUNCDECL_RPL (gettimeofday, int, ++ (struct timeval *restrict, void *restrict) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (gettimeofday, int, ++ (struct timeval *restrict, void *restrict)); ++# else ++# if !@HAVE_GETTIMEOFDAY@ ++_GL_FUNCDECL_SYS (gettimeofday, int, ++ (struct timeval *restrict, void *restrict) ++ _GL_ARG_NONNULL ((1))); ++# endif ++/* Need to cast, because on glibc systems, by default, the second argument is ++ struct timezone *. */ ++_GL_CXXALIAS_SYS_CAST (gettimeofday, int, ++ (struct timeval *restrict, void *restrict)); ++# endif ++_GL_CXXALIASWARN (gettimeofday); ++#elif defined GNULIB_POSIXCHECK ++# undef gettimeofday ++# if HAVE_RAW_DECL_GETTIMEOFDAY ++_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - " ++ "use gnulib module gettimeofday for portability"); ++# endif ++#endif ++ ++/* Hide some function declarations from . */ ++ ++#if defined _MSC_VER && @HAVE_WINSOCK2_H@ ++# if !defined _@GUARD_PREFIX@_UNISTD_H ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef close ++# define close close_used_without_including_unistd_h ++# else ++ _GL_WARN_ON_USE (close, ++ "close() used without including "); ++# endif ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gethostname ++# define gethostname gethostname_used_without_including_unistd_h ++# else ++ _GL_WARN_ON_USE (gethostname, ++ "gethostname() used without including "); ++# endif ++# endif ++# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef socket ++# define socket socket_used_without_including_sys_socket_h ++# undef connect ++# define connect connect_used_without_including_sys_socket_h ++# undef accept ++# define accept accept_used_without_including_sys_socket_h ++# undef bind ++# define bind bind_used_without_including_sys_socket_h ++# undef getpeername ++# define getpeername getpeername_used_without_including_sys_socket_h ++# undef getsockname ++# define getsockname getsockname_used_without_including_sys_socket_h ++# undef getsockopt ++# define getsockopt getsockopt_used_without_including_sys_socket_h ++# undef listen ++# define listen listen_used_without_including_sys_socket_h ++# undef recv ++# define recv recv_used_without_including_sys_socket_h ++# undef send ++# define send send_used_without_including_sys_socket_h ++# undef recvfrom ++# define recvfrom recvfrom_used_without_including_sys_socket_h ++# undef sendto ++# define sendto sendto_used_without_including_sys_socket_h ++# undef setsockopt ++# define setsockopt setsockopt_used_without_including_sys_socket_h ++# undef shutdown ++# define shutdown shutdown_used_without_including_sys_socket_h ++# else ++ _GL_WARN_ON_USE (socket, ++ "socket() used without including "); ++ _GL_WARN_ON_USE (connect, ++ "connect() used without including "); ++ _GL_WARN_ON_USE (accept, ++ "accept() used without including "); ++ _GL_WARN_ON_USE (bind, ++ "bind() used without including "); ++ _GL_WARN_ON_USE (getpeername, ++ "getpeername() used without including "); ++ _GL_WARN_ON_USE (getsockname, ++ "getsockname() used without including "); ++ _GL_WARN_ON_USE (getsockopt, ++ "getsockopt() used without including "); ++ _GL_WARN_ON_USE (listen, ++ "listen() used without including "); ++ _GL_WARN_ON_USE (recv, ++ "recv() used without including "); ++ _GL_WARN_ON_USE (send, ++ "send() used without including "); ++ _GL_WARN_ON_USE (recvfrom, ++ "recvfrom() used without including "); ++ _GL_WARN_ON_USE (sendto, ++ "sendto() used without including "); ++ _GL_WARN_ON_USE (setsockopt, ++ "setsockopt() used without including "); ++ _GL_WARN_ON_USE (shutdown, ++ "shutdown() used without including "); ++# endif ++# endif ++# if !defined _@GUARD_PREFIX@_SYS_SELECT_H ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef select ++# define select select_used_without_including_sys_select_h ++# else ++ _GL_WARN_ON_USE (select, ++ "select() used without including "); ++# endif ++# endif ++#endif ++ ++#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ ++#endif /* _CYGWIN_SYS_TIME_H */ ++#endif /* _@GUARD_PREFIX@_SYS_TIME_H */ +diff --git a/grub-core/gnulib/sys_types.in.h b/grub-core/gnulib/sys_types.in.h +index d7da356..9520c09 100644 +--- a/grub-core/gnulib/sys_types.in.h ++++ b/grub-core/gnulib/sys_types.in.h +@@ -23,7 +23,9 @@ + #ifndef _@GUARD_PREFIX@_SYS_TYPES_H + + /* The include_next requires a split double-inclusion guard. */ ++# define _GL_INCLUDING_SYS_TYPES_H + #@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@ ++# undef _GL_INCLUDING_SYS_TYPES_H + + #ifndef _@GUARD_PREFIX@_SYS_TYPES_H + #define _@GUARD_PREFIX@_SYS_TYPES_H +diff --git a/grub-core/gnulib/time.h b/grub-core/gnulib/time.h +new file mode 100644 +index 0000000..b9203d5 +--- /dev/null ++++ b/grub-core/gnulib/time.h +@@ -0,0 +1,586 @@ ++/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ ++/* A more-standard . ++ ++ Copyright (C) 2007-2014 Free Software Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++#if __GNUC__ >= 3 ++#pragma GCC system_header ++#endif ++ ++ ++/* Don't get in the way of glibc when it includes time.h merely to ++ declare a few standard symbols, rather than to declare all the ++ symbols. Also, Solaris 8 eventually includes itself ++ recursively; if that is happening, just include the system ++ without adding our own declarations. */ ++#if (defined __need_time_t || defined __need_clock_t \ ++ || defined __need_timespec \ ++ || defined _GL_TIME_H) ++ ++# include_next ++ ++#else ++ ++# define _GL_TIME_H ++ ++# include_next ++ ++/* NetBSD 5.0 mis-defines NULL. */ ++# include ++ ++/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ ++#ifndef _GL_CXXDEFS_H ++#define _GL_CXXDEFS_H ++ ++/* The three most frequent use cases of these macros are: ++ ++ * For providing a substitute for a function that is missing on some ++ platforms, but is declared and works fine on the platforms on which ++ it exists: ++ ++ #if @GNULIB_FOO@ ++ # if !@HAVE_FOO@ ++ _GL_FUNCDECL_SYS (foo, ...); ++ # endif ++ _GL_CXXALIAS_SYS (foo, ...); ++ _GL_CXXALIASWARN (foo); ++ #elif defined GNULIB_POSIXCHECK ++ ... ++ #endif ++ ++ * For providing a replacement for a function that exists on all platforms, ++ but is broken/insufficient and needs to be replaced on some platforms: ++ ++ #if @GNULIB_FOO@ ++ # if @REPLACE_FOO@ ++ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++ # undef foo ++ # define foo rpl_foo ++ # endif ++ _GL_FUNCDECL_RPL (foo, ...); ++ _GL_CXXALIAS_RPL (foo, ...); ++ # else ++ _GL_CXXALIAS_SYS (foo, ...); ++ # endif ++ _GL_CXXALIASWARN (foo); ++ #elif defined GNULIB_POSIXCHECK ++ ... ++ #endif ++ ++ * For providing a replacement for a function that exists on some platforms ++ but is broken/insufficient and needs to be replaced on some of them and ++ is additionally either missing or undeclared on some other platforms: ++ ++ #if @GNULIB_FOO@ ++ # if @REPLACE_FOO@ ++ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++ # undef foo ++ # define foo rpl_foo ++ # endif ++ _GL_FUNCDECL_RPL (foo, ...); ++ _GL_CXXALIAS_RPL (foo, ...); ++ # else ++ # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@ ++ _GL_FUNCDECL_SYS (foo, ...); ++ # endif ++ _GL_CXXALIAS_SYS (foo, ...); ++ # endif ++ _GL_CXXALIASWARN (foo); ++ #elif defined GNULIB_POSIXCHECK ++ ... ++ #endif ++*/ ++ ++/* _GL_EXTERN_C declaration; ++ performs the declaration with C linkage. */ ++#if defined __cplusplus ++# define _GL_EXTERN_C extern "C" ++#else ++# define _GL_EXTERN_C extern ++#endif ++ ++/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes); ++ declares a replacement function, named rpl_func, with the given prototype, ++ consisting of return type, parameters, and attributes. ++ Example: ++ _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) ++ _GL_ARG_NONNULL ((1))); ++ */ ++#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \ ++ _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes) ++#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \ ++ _GL_EXTERN_C rettype rpl_func parameters_and_attributes ++ ++/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes); ++ declares the system function, named func, with the given prototype, ++ consisting of return type, parameters, and attributes. ++ Example: ++ _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...) ++ _GL_ARG_NONNULL ((1))); ++ */ ++#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \ ++ _GL_EXTERN_C rettype func parameters_and_attributes ++ ++/* _GL_CXXALIAS_RPL (func, rettype, parameters); ++ declares a C++ alias called GNULIB_NAMESPACE::func ++ that redirects to rpl_func, if GNULIB_NAMESPACE is defined. ++ Example: ++ _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); ++ */ ++#define _GL_CXXALIAS_RPL(func,rettype,parameters) \ ++ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ ++ namespace GNULIB_NAMESPACE \ ++ { \ ++ rettype (*const func) parameters = ::rpl_func; \ ++ } \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#else ++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); ++ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); ++ except that the C function rpl_func may have a slightly different ++ declaration. A cast is used to silence the "invalid conversion" error ++ that would otherwise occur. */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ ++ namespace GNULIB_NAMESPACE \ ++ { \ ++ rettype (*const func) parameters = \ ++ reinterpret_cast(::rpl_func); \ ++ } \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#else ++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIAS_SYS (func, rettype, parameters); ++ declares a C++ alias called GNULIB_NAMESPACE::func ++ that redirects to the system provided function func, if GNULIB_NAMESPACE ++ is defined. ++ Example: ++ _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); ++ */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++ /* If we were to write ++ rettype (*const func) parameters = ::func; ++ like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls ++ better (remove an indirection through a 'static' pointer variable), ++ but then the _GL_CXXALIASWARN macro below would cause a warning not only ++ for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ ++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ ++ namespace GNULIB_NAMESPACE \ ++ { \ ++ static rettype (*func) parameters = ::func; \ ++ } \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#else ++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters); ++ is like _GL_CXXALIAS_SYS (func, rettype, parameters); ++ except that the C function func may have a slightly different declaration. ++ A cast is used to silence the "invalid conversion" error that would ++ otherwise occur. */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ ++ namespace GNULIB_NAMESPACE \ ++ { \ ++ static rettype (*func) parameters = \ ++ reinterpret_cast(::func); \ ++ } \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#else ++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2); ++ is like _GL_CXXALIAS_SYS (func, rettype, parameters); ++ except that the C function is picked among a set of overloaded functions, ++ namely the one with rettype2 and parameters2. Two consecutive casts ++ are used to silence the "cannot find a match" and "invalid conversion" ++ errors that would otherwise occur. */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++ /* The outer cast must be a reinterpret_cast. ++ The inner cast: When the function is defined as a set of overloaded ++ functions, it works as a static_cast<>, choosing the designated variant. ++ When the function is defined as a single variant, it works as a ++ reinterpret_cast<>. The parenthesized cast syntax works both ways. */ ++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ ++ namespace GNULIB_NAMESPACE \ ++ { \ ++ static rettype (*func) parameters = \ ++ reinterpret_cast( \ ++ (rettype2(*)parameters2)(::func)); \ ++ } \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#else ++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIASWARN (func); ++ causes a warning to be emitted when ::func is used but not when ++ GNULIB_NAMESPACE::func is used. func must be defined without overloaded ++ variants. */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++# define _GL_CXXALIASWARN(func) \ ++ _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) ++# define _GL_CXXALIASWARN_1(func,namespace) \ ++ _GL_CXXALIASWARN_2 (func, namespace) ++/* To work around GCC bug , ++ we enable the warning only when not optimizing. */ ++# if !__OPTIMIZE__ ++# define _GL_CXXALIASWARN_2(func,namespace) \ ++ _GL_WARN_ON_USE (func, \ ++ "The symbol ::" #func " refers to the system function. " \ ++ "Use " #namespace "::" #func " instead.") ++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING ++# define _GL_CXXALIASWARN_2(func,namespace) \ ++ extern __typeof__ (func) func ++# else ++# define _GL_CXXALIASWARN_2(func,namespace) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++# endif ++#else ++# define _GL_CXXALIASWARN(func) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes); ++ causes a warning to be emitted when the given overloaded variant of ::func ++ is used but not when GNULIB_NAMESPACE::func is used. */ ++#if defined __cplusplus && defined GNULIB_NAMESPACE ++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ ++ _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \ ++ GNULIB_NAMESPACE) ++# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ ++ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) ++/* To work around GCC bug , ++ we enable the warning only when not optimizing. */ ++# if !__OPTIMIZE__ ++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ ++ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ ++ "The symbol ::" #func " refers to the system function. " \ ++ "Use " #namespace "::" #func " instead.") ++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING ++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ ++ extern __typeof__ (func) func ++# else ++# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++# endif ++#else ++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \ ++ _GL_EXTERN_C int _gl_cxxalias_dummy ++#endif ++ ++#endif /* _GL_CXXDEFS_H */ ++ ++/* The definition of _GL_ARG_NONNULL is copied here. */ ++/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools ++ that the values passed as arguments n, ..., m must be non-NULL pointers. ++ n = 1 stands for the first argument, n = 2 for the second argument etc. */ ++#ifndef _GL_ARG_NONNULL ++# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 ++# define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) ++# else ++# define _GL_ARG_NONNULL(params) ++# endif ++#endif ++ ++/* The definition of _GL_WARN_ON_USE is copied here. */ ++#ifndef _GL_WARN_ON_USE ++ ++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) ++/* A compiler attribute is available in gcc versions 4.3.0 and later. */ ++# define _GL_WARN_ON_USE(function, message) \ ++extern __typeof__ (function) function __attribute__ ((__warning__ (message))) ++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING ++/* Verify the existence of the function. */ ++# define _GL_WARN_ON_USE(function, message) \ ++extern __typeof__ (function) function ++# else /* Unsupported. */ ++# define _GL_WARN_ON_USE(function, message) \ ++_GL_WARN_EXTERN_C int _gl_warn_on_use ++# endif ++#endif ++ ++/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") ++ is like _GL_WARN_ON_USE (function, "string"), except that the function is ++ declared with the given prototype, consisting of return type, parameters, ++ and attributes. ++ This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does ++ not work in this case. */ ++#ifndef _GL_WARN_ON_USE_CXX ++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) ++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ ++extern rettype function parameters_and_attributes \ ++ __attribute__ ((__warning__ (msg))) ++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING ++/* Verify the existence of the function. */ ++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ ++extern rettype function parameters_and_attributes ++# else /* Unsupported. */ ++# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ ++_GL_WARN_EXTERN_C int _gl_warn_on_use ++# endif ++#endif ++ ++/* _GL_WARN_EXTERN_C declaration; ++ performs the declaration with C linkage. */ ++#ifndef _GL_WARN_EXTERN_C ++# if defined __cplusplus ++# define _GL_WARN_EXTERN_C extern "C" ++# else ++# define _GL_WARN_EXTERN_C extern ++# endif ++#endif ++ ++/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). ++ Or they define it with the wrong member names or define it in ++ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, ++ but the pthreads-win32 library defines it in . */ ++# if ! 1 ++# if 0 ++# include ++# elif 0 ++# include ++# else ++ ++# ifdef __cplusplus ++extern "C" { ++# endif ++ ++# if !GNULIB_defined_struct_timespec ++# undef timespec ++# define timespec rpl_timespec ++struct timespec ++{ ++ time_t tv_sec; ++ long int tv_nsec; ++}; ++# define GNULIB_defined_struct_timespec 1 ++# endif ++ ++# ifdef __cplusplus ++} ++# endif ++ ++# endif ++# endif ++ ++# if !GNULIB_defined_struct_time_t_must_be_integral ++/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires ++ time_t to be an integer type, even though C99 permits floating ++ point. We don't know of any implementation that uses floating ++ point, and it is much easier to write code that doesn't have to ++ worry about that corner case, so we force the issue. */ ++struct __time_t_must_be_integral { ++ unsigned int __floating_time_t_unsupported : (time_t) 1; ++}; ++# define GNULIB_defined_struct_time_t_must_be_integral 1 ++# endif ++ ++/* Sleep for at least RQTP seconds unless interrupted, If interrupted, ++ return -1 and store the remaining time into RMTP. See ++ . */ ++# if 0 ++# if GNULIB_PORTCHECK ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define nanosleep rpl_nanosleep ++# endif ++_GL_FUNCDECL_RPL (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp)); ++# else ++# if ! 1 ++_GL_FUNCDECL_SYS (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp) ++ _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp)); ++# endif ++_GL_CXXALIASWARN (nanosleep); ++# endif ++ ++/* Return the 'time_t' representation of TP and normalize TP. */ ++# if 0 ++# if GNULIB_PORTCHECK ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define mktime rpl_mktime ++# endif ++_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); ++# else ++_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); ++# endif ++_GL_CXXALIASWARN (mktime); ++# endif ++ ++/* Convert TIMER to RESULT, assuming local time and UTC respectively. See ++ and ++ . */ ++# if 0 ++# if GNULIB_PORTCHECK ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef localtime_r ++# define localtime_r rpl_localtime_r ++# endif ++_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# else ++# if ! 1 ++_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++# endif ++_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# endif ++# if 1 ++_GL_CXXALIASWARN (localtime_r); ++# endif ++# if GNULIB_PORTCHECK ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gmtime_r ++# define gmtime_r rpl_gmtime_r ++# endif ++_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# else ++# if ! 1 ++_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++# endif ++_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# endif ++# if 1 ++_GL_CXXALIASWARN (gmtime_r); ++# endif ++# endif ++ ++/* Convert TIMER to RESULT, assuming local time and UTC respectively. See ++ and ++ . */ ++# if 1 ++# if 0 ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef localtime ++# define localtime rpl_localtime ++# endif ++_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); ++# else ++_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); ++# endif ++_GL_CXXALIASWARN (localtime); ++# endif ++ ++# if 1 ++# if 0 ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gmtime ++# define gmtime rpl_gmtime ++# endif ++_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); ++# else ++_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); ++# endif ++_GL_CXXALIASWARN (gmtime); ++# endif ++ ++/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store ++ the resulting broken-down time into TM. See ++ . */ ++# if 0 ++# if ! 1 ++_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, ++ char const *restrict __format, ++ struct tm *restrict __tm) ++ _GL_ARG_NONNULL ((1, 2, 3))); ++# endif ++_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, ++ char const *restrict __format, ++ struct tm *restrict __tm)); ++_GL_CXXALIASWARN (strptime); ++# endif ++ ++/* Convert TM to a time_t value, assuming UTC. */ ++# if 0 ++# if GNULIB_PORTCHECK ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef timegm ++# define timegm rpl_timegm ++# endif ++_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); ++# else ++# if ! 1 ++_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); ++# endif ++_GL_CXXALIASWARN (timegm); ++# endif ++ ++/* Encourage applications to avoid unsafe functions that can overrun ++ buffers when given outlandish struct tm values. Portable ++ applications should use strftime (or even sprintf) instead. */ ++# if defined GNULIB_POSIXCHECK ++# undef asctime ++_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef asctime_r ++_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef ctime ++_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef ctime_r ++_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++ ++#endif +diff --git a/grub-core/gnulib/time.in.h b/grub-core/gnulib/time.in.h +new file mode 100644 +index 0000000..81abdf4 +--- /dev/null ++++ b/grub-core/gnulib/time.in.h +@@ -0,0 +1,274 @@ ++/* A more-standard . ++ ++ Copyright (C) 2007-2014 Free Software Foundation, Inc. ++ ++ This program 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, or (at your option) ++ any later version. ++ ++ This program 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 this program; if not, see . */ ++ ++#if __GNUC__ >= 3 ++@PRAGMA_SYSTEM_HEADER@ ++#endif ++@PRAGMA_COLUMNS@ ++ ++/* Don't get in the way of glibc when it includes time.h merely to ++ declare a few standard symbols, rather than to declare all the ++ symbols. Also, Solaris 8 eventually includes itself ++ recursively; if that is happening, just include the system ++ without adding our own declarations. */ ++#if (defined __need_time_t || defined __need_clock_t \ ++ || defined __need_timespec \ ++ || defined _@GUARD_PREFIX@_TIME_H) ++ ++# @INCLUDE_NEXT@ @NEXT_TIME_H@ ++ ++#else ++ ++# define _@GUARD_PREFIX@_TIME_H ++ ++# @INCLUDE_NEXT@ @NEXT_TIME_H@ ++ ++/* NetBSD 5.0 mis-defines NULL. */ ++# include ++ ++/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ ++ ++/* The definition of _GL_ARG_NONNULL is copied here. */ ++ ++/* The definition of _GL_WARN_ON_USE is copied here. */ ++ ++/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3). ++ Or they define it with the wrong member names or define it in ++ (e.g., FreeBSD circa 1997). Stock Mingw prior to 3.0 does not define it, ++ but the pthreads-win32 library defines it in . */ ++# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@ ++# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ ++# include ++# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ ++# include ++# else ++ ++# ifdef __cplusplus ++extern "C" { ++# endif ++ ++# if !GNULIB_defined_struct_timespec ++# undef timespec ++# define timespec rpl_timespec ++struct timespec ++{ ++ time_t tv_sec; ++ long int tv_nsec; ++}; ++# define GNULIB_defined_struct_timespec 1 ++# endif ++ ++# ifdef __cplusplus ++} ++# endif ++ ++# endif ++# endif ++ ++# if !GNULIB_defined_struct_time_t_must_be_integral ++/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires ++ time_t to be an integer type, even though C99 permits floating ++ point. We don't know of any implementation that uses floating ++ point, and it is much easier to write code that doesn't have to ++ worry about that corner case, so we force the issue. */ ++struct __time_t_must_be_integral { ++ unsigned int __floating_time_t_unsupported : (time_t) 1; ++}; ++# define GNULIB_defined_struct_time_t_must_be_integral 1 ++# endif ++ ++/* Sleep for at least RQTP seconds unless interrupted, If interrupted, ++ return -1 and store the remaining time into RMTP. See ++ . */ ++# if @GNULIB_NANOSLEEP@ ++# if @REPLACE_NANOSLEEP@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define nanosleep rpl_nanosleep ++# endif ++_GL_FUNCDECL_RPL (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp)); ++# else ++# if ! @HAVE_NANOSLEEP@ ++_GL_FUNCDECL_SYS (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp) ++ _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (nanosleep, int, ++ (struct timespec const *__rqtp, struct timespec *__rmtp)); ++# endif ++_GL_CXXALIASWARN (nanosleep); ++# endif ++ ++/* Return the 'time_t' representation of TP and normalize TP. */ ++# if @GNULIB_MKTIME@ ++# if @REPLACE_MKTIME@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# define mktime rpl_mktime ++# endif ++_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp)); ++# else ++_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp)); ++# endif ++_GL_CXXALIASWARN (mktime); ++# endif ++ ++/* Convert TIMER to RESULT, assuming local time and UTC respectively. See ++ and ++ . */ ++# if @GNULIB_TIME_R@ ++# if @REPLACE_LOCALTIME_R@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef localtime_r ++# define localtime_r rpl_localtime_r ++# endif ++_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# else ++# if ! @HAVE_DECL_LOCALTIME_R@ ++_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++# endif ++_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# endif ++# if @HAVE_DECL_LOCALTIME_R@ ++_GL_CXXALIASWARN (localtime_r); ++# endif ++# if @REPLACE_LOCALTIME_R@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gmtime_r ++# define gmtime_r rpl_gmtime_r ++# endif ++_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# else ++# if ! @HAVE_DECL_LOCALTIME_R@ ++_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result) ++ _GL_ARG_NONNULL ((1, 2))); ++# endif ++_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer, ++ struct tm *restrict __result)); ++# endif ++# if @HAVE_DECL_LOCALTIME_R@ ++_GL_CXXALIASWARN (gmtime_r); ++# endif ++# endif ++ ++/* Convert TIMER to RESULT, assuming local time and UTC respectively. See ++ and ++ . */ ++# if @GNULIB_GETTIMEOFDAY@ ++# if @REPLACE_LOCALTIME@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef localtime ++# define localtime rpl_localtime ++# endif ++_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); ++# else ++_GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); ++# endif ++_GL_CXXALIASWARN (localtime); ++# endif ++ ++# if @GNULIB_GETTIMEOFDAY@ ++# if @REPLACE_GMTIME@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef gmtime ++# define gmtime rpl_gmtime ++# endif ++_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer) ++ _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer)); ++# else ++_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer)); ++# endif ++_GL_CXXALIASWARN (gmtime); ++# endif ++ ++/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store ++ the resulting broken-down time into TM. See ++ . */ ++# if @GNULIB_STRPTIME@ ++# if ! @HAVE_STRPTIME@ ++_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf, ++ char const *restrict __format, ++ struct tm *restrict __tm) ++ _GL_ARG_NONNULL ((1, 2, 3))); ++# endif ++_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf, ++ char const *restrict __format, ++ struct tm *restrict __tm)); ++_GL_CXXALIASWARN (strptime); ++# endif ++ ++/* Convert TM to a time_t value, assuming UTC. */ ++# if @GNULIB_TIMEGM@ ++# if @REPLACE_TIMEGM@ ++# if !(defined __cplusplus && defined GNULIB_NAMESPACE) ++# undef timegm ++# define timegm rpl_timegm ++# endif ++_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); ++_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm)); ++# else ++# if ! @HAVE_TIMEGM@ ++_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1))); ++# endif ++_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm)); ++# endif ++_GL_CXXALIASWARN (timegm); ++# endif ++ ++/* Encourage applications to avoid unsafe functions that can overrun ++ buffers when given outlandish struct tm values. Portable ++ applications should use strftime (or even sprintf) instead. */ ++# if defined GNULIB_POSIXCHECK ++# undef asctime ++_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef asctime_r ++_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef ctime ++_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++# if defined GNULIB_POSIXCHECK ++# undef ctime_r ++_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " ++ "better use strftime (or even sprintf) instead"); ++# endif ++ ++#endif +diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c +index d390b25..9127e92 100644 +--- a/grub-core/osdep/windows/hostdisk.c ++++ b/grub-core/osdep/windows/hostdisk.c +@@ -353,6 +353,12 @@ grub_util_mkdir (const char *dir) + free (windows_name); + } + ++ssize_t ++grub_util_readlink (const char *name, char *buf, size_t bufsize) ++{ ++ return readlink(name, buf, bufsize); ++} ++ + int + grub_util_rename (const char *from, const char *to) + { +diff --git a/include/grub/osdep/hostfile_aros.h b/include/grub/osdep/hostfile_aros.h +index a059c0f..161fbb7 100644 +--- a/include/grub/osdep/hostfile_aros.h ++++ b/include/grub/osdep/hostfile_aros.h +@@ -68,6 +68,12 @@ grub_util_rename (const char *from, const char *to) + return rename (from, to); + } + ++static inline ssize_t ++grub_util_readlink (const char *name, char *buf, size_t bufsize) ++{ ++ return readlink(name, buf, bufsize); ++} ++ + #define grub_util_mkdir(a) mkdir ((a), 0755) + + struct grub_util_fd +diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/hostfile_unix.h +index 9ffe46f..17cd3aa 100644 +--- a/include/grub/osdep/hostfile_unix.h ++++ b/include/grub/osdep/hostfile_unix.h +@@ -71,6 +71,12 @@ grub_util_rename (const char *from, const char *to) + return rename (from, to); + } + ++static inline ssize_t ++grub_util_readlink (const char *name, char *buf, size_t bufsize) ++{ ++ return readlink(name, buf, bufsize); ++} ++ + #define grub_util_mkdir(a) mkdir ((a), 0755) + + #if defined (__NetBSD__) +diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h +index bf6451b..8c92d05 100644 +--- a/include/grub/osdep/hostfile_windows.h ++++ b/include/grub/osdep/hostfile_windows.h +@@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t; + + int + grub_util_rename (const char *from, const char *to); ++ssize_t ++grub_util_readlink (const char *name, char *buf, size_t bufsize); + int + grub_util_unlink (const char *name); + void +diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 +new file mode 100644 +index 0000000..1c2d66e +--- /dev/null ++++ b/m4/gettimeofday.m4 +@@ -0,0 +1,138 @@ ++# serial 21 ++ ++# Copyright (C) 2001-2003, 2005, 2007, 2009-2014 Free Software Foundation, Inc. ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++dnl From Jim Meyering. ++ ++AC_DEFUN([gl_FUNC_GETTIMEOFDAY], ++[ ++ AC_REQUIRE([AC_C_RESTRICT]) ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) ++ AC_CHECK_FUNCS_ONCE([gettimeofday]) ++ ++ gl_gettimeofday_timezone=void ++ if test $ac_cv_func_gettimeofday != yes; then ++ HAVE_GETTIMEOFDAY=0 ++ else ++ gl_FUNC_GETTIMEOFDAY_CLOBBER ++ AC_CACHE_CHECK([for gettimeofday with POSIX signature], ++ [gl_cv_func_gettimeofday_posix_signature], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ struct timeval c; ++ int gettimeofday (struct timeval *restrict, void *restrict); ++ ]], ++ [[/* glibc uses struct timezone * rather than the POSIX void * ++ if _GNU_SOURCE is defined. However, since the only portable ++ use of gettimeofday uses NULL as the second parameter, and ++ since the glibc definition is actually more typesafe, it is ++ not worth wrapping this to get a compliant signature. */ ++ int (*f) (struct timeval *restrict, void *restrict) ++ = gettimeofday; ++ int x = f (&c, 0); ++ return !(x | c.tv_sec | c.tv_usec); ++ ]])], ++ [gl_cv_func_gettimeofday_posix_signature=yes], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++int gettimeofday (struct timeval *restrict, struct timezone *restrict); ++ ]])], ++ [gl_cv_func_gettimeofday_posix_signature=almost], ++ [gl_cv_func_gettimeofday_posix_signature=no])])]) ++ if test $gl_cv_func_gettimeofday_posix_signature = almost; then ++ gl_gettimeofday_timezone='struct timezone' ++ elif test $gl_cv_func_gettimeofday_posix_signature != yes; then ++ REPLACE_GETTIMEOFDAY=1 ++ fi ++ dnl If we override 'struct timeval', we also have to override gettimeofday. ++ if test $REPLACE_STRUCT_TIMEVAL = 1; then ++ REPLACE_GETTIMEOFDAY=1 ++ fi ++ m4_ifdef([gl_FUNC_TZSET_CLOBBER], [ ++ gl_FUNC_TZSET_CLOBBER ++ case "$gl_cv_func_tzset_clobber" in ++ *yes) ++ REPLACE_GETTIMEOFDAY=1 ++ gl_GETTIMEOFDAY_REPLACE_LOCALTIME ++ AC_DEFINE([tzset], [rpl_tzset], ++ [Define to rpl_tzset if the wrapper function should be used.]) ++ AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1], ++ [Define if tzset clobbers localtime's static buffer.]) ++ ;; ++ esac ++ ]) ++ fi ++ AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], ++ [Define this to 'void' or 'struct timezone' to match the system's ++ declaration of the second argument to gettimeofday.]) ++]) ++ ++ ++dnl See if gettimeofday clobbers the static buffer that localtime uses ++dnl for its return value. The gettimeofday function from Mac OS X 10.0.4 ++dnl (i.e., Darwin 1.3.7) has this problem. ++dnl ++dnl If it does, then arrange to use gettimeofday and localtime only via ++dnl the wrapper functions that work around the problem. ++ ++AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], ++[ ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H]) ++ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles ++ ++ AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer], ++ [gl_cv_func_gettimeofday_clobber], ++ [AC_RUN_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ #include ++ #include ++ #include ++ ]], ++ [[ ++ time_t t = 0; ++ struct tm *lt; ++ struct tm saved_lt; ++ struct timeval tv; ++ lt = localtime (&t); ++ saved_lt = *lt; ++ gettimeofday (&tv, NULL); ++ return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0; ++ ]])], ++ [gl_cv_func_gettimeofday_clobber=no], ++ [gl_cv_func_gettimeofday_clobber=yes], ++ [# When cross-compiling: ++ case "$host_os" in ++ # Guess all is fine on glibc systems. ++ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; ++ # If we don't know, assume the worst. ++ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; ++ esac ++ ])]) ++ ++ case "$gl_cv_func_gettimeofday_clobber" in ++ *yes) ++ REPLACE_GETTIMEOFDAY=1 ++ gl_GETTIMEOFDAY_REPLACE_LOCALTIME ++ AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], ++ [Define if gettimeofday clobbers the localtime buffer.]) ++ ;; ++ esac ++]) ++ ++AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ ++ REPLACE_GMTIME=1 ++ REPLACE_LOCALTIME=1 ++]) ++ ++# Prerequisites of lib/gettimeofday.c. ++AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [ ++ AC_CHECK_HEADERS([sys/timeb.h]) ++ AC_CHECK_FUNCS([_ftime]) ++]) +diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 +index 4089184..ef2ec5b 100644 +--- a/m4/gnulib-cache.m4 ++++ b/m4/gnulib-cache.m4 +@@ -27,7 +27,7 @@ + + + # Specification in the form of a command-line invocation: +-# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname regex ++# gnulib-tool --import --dir=. --lib=libgnu --source-base=grub-core/gnulib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files argp error fnmatch getdelim getline gettext progname readlink regex + + # Specification in the form of a few gnulib-tool.m4 macro invocations: + gl_LOCAL_DIR([]) +@@ -39,6 +39,7 @@ gl_MODULES([ + getline + gettext + progname ++ readlink + regex + ]) + gl_AVOID([]) +diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 +index 7a19f60..66fd0ed 100644 +--- a/m4/gnulib-comp.m4 ++++ b/m4/gnulib-comp.m4 +@@ -60,10 +60,13 @@ AC_DEFUN([gl_EARLY], + # Code from module getopt-posix: + # Code from module gettext: + # Code from module gettext-h: ++ # Code from module gettimeofday: + # Code from module havelib: + # Code from module include_next: + # Code from module intprops: + # Code from module langinfo: ++ # Code from module largefile: ++ AC_REQUIRE([AC_SYS_LARGEFILE]) + # Code from module localcharset: + # Code from module locale: + # Code from module localeconv: +@@ -81,8 +84,10 @@ AC_DEFUN([gl_EARLY], + # Code from module multiarch: + # Code from module nl_langinfo: + # Code from module nocrash: ++ # Code from module pathmax: + # Code from module progname: + # Code from module rawmemchr: ++ # Code from module readlink: + # Code from module realloc-posix: + # Code from module regex: + # Code from module size_max: +@@ -92,6 +97,7 @@ AC_DEFUN([gl_EARLY], + # Code from module snippet/c++defs: + # Code from module snippet/warn-on-use: + # Code from module ssize_t: ++ # Code from module stat: + # Code from module stdalign: + # Code from module stdbool: + # Code from module stddef: +@@ -108,8 +114,11 @@ AC_DEFUN([gl_EARLY], + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen1: ++ # Code from module sys_stat: ++ # Code from module sys_time: + # Code from module sys_types: + # Code from module sysexits: ++ # Code from module time: + # Code from module unistd: + # Code from module unitypes: + # Code from module uniwidth/base: +@@ -211,7 +220,14 @@ AC_DEFUN([gl_INIT], + AM_GNU_GETTEXT_VERSION([0.18.1]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) ++ gl_FUNC_GETTIMEOFDAY ++ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then ++ AC_LIBOBJ([gettimeofday]) ++ gl_PREREQ_GETTIMEOFDAY ++ fi ++ gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + gl_LANGINFO_H ++ AC_REQUIRE([gl_LARGEFILE]) + gl_LOCALCHARSET + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) +@@ -284,6 +300,7 @@ AC_DEFUN([gl_INIT], + AC_LIBOBJ([nl_langinfo]) + fi + gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) ++ gl_PATHMAX + AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) + AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) + gl_FUNC_RAWMEMCHR +@@ -292,6 +309,12 @@ AC_DEFUN([gl_INIT], + gl_PREREQ_RAWMEMCHR + fi + gl_STRING_MODULE_INDICATOR([rawmemchr]) ++ gl_FUNC_READLINK ++ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then ++ AC_LIBOBJ([readlink]) ++ gl_PREREQ_READLINK ++ fi ++ gl_UNISTD_MODULE_INDICATOR([readlink]) + gl_FUNC_REALLOC_POSIX + if test $REPLACE_REALLOC = 1; then + AC_LIBOBJ([realloc]) +@@ -309,6 +332,12 @@ AC_DEFUN([gl_INIT], + fi + gl_UNISTD_MODULE_INDICATOR([sleep]) + gt_TYPE_SSIZE_T ++ gl_FUNC_STAT ++ if test $REPLACE_STAT = 1; then ++ AC_LIBOBJ([stat]) ++ gl_PREREQ_STAT ++ fi ++ gl_SYS_STAT_MODULE_INDICATOR([stat]) + gl_STDALIGN_H + AM_STDBOOL_H + gl_STDDEF_H +@@ -355,9 +384,14 @@ AC_DEFUN([gl_INIT], + gl_PREREQ_STRNLEN + fi + gl_STRING_MODULE_INDICATOR([strnlen]) ++ gl_HEADER_SYS_STAT_H ++ AC_PROG_MKDIR_P ++ gl_HEADER_SYS_TIME_H ++ AC_PROG_MKDIR_P + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_SYSEXITS ++ gl_HEADER_TIME_H + gl_UNISTD_H + gl_LIBUNISTRING_LIBHEADER([0.9], [unitypes.h]) + gl_LIBUNISTRING_LIBHEADER([0.9], [uniwidth.h]) +@@ -562,6 +596,7 @@ AC_DEFUN([gl_FILE_LIST], [ + lib/getopt1.c + lib/getopt_int.h + lib/gettext.h ++ lib/gettimeofday.c + lib/intprops.h + lib/itold.c + lib/langinfo.in.h +@@ -587,6 +622,7 @@ AC_DEFUN([gl_FILE_LIST], [ + lib/msvc-nothrow.c + lib/msvc-nothrow.h + lib/nl_langinfo.c ++ lib/pathmax.h + lib/printf-args.c + lib/printf-args.h + lib/printf-parse.c +@@ -595,6 +631,7 @@ AC_DEFUN([gl_FILE_LIST], [ + lib/progname.h + lib/rawmemchr.c + lib/rawmemchr.valgrind ++ lib/readlink.c + lib/realloc.c + lib/ref-add.sin + lib/ref-del.sin +@@ -606,6 +643,7 @@ AC_DEFUN([gl_FILE_LIST], [ + lib/regexec.c + lib/size_max.h + lib/sleep.c ++ lib/stat.c + lib/stdalign.in.h + lib/stdbool.in.h + lib/stddef.in.h +@@ -627,8 +665,11 @@ AC_DEFUN([gl_FILE_LIST], [ + lib/strnlen.c + lib/strnlen1.c + lib/strnlen1.h ++ lib/sys_stat.in.h ++ lib/sys_time.in.h + lib/sys_types.in.h + lib/sysexits.in.h ++ lib/time.in.h + lib/unistd.c + lib/unistd.in.h + lib/unitypes.in.h +@@ -667,6 +708,7 @@ AC_DEFUN([gl_FILE_LIST], [ + m4/getline.m4 + m4/getopt.m4 + m4/gettext.m4 ++ m4/gettimeofday.m4 + m4/glibc2.m4 + m4/glibc21.m4 + m4/gnulib-common.m4 +@@ -681,6 +723,7 @@ AC_DEFUN([gl_FILE_LIST], [ + m4/inttypes-pri.m4 + m4/inttypes_h.m4 + m4/langinfo_h.m4 ++ m4/largefile.m4 + m4/lcmessage.m4 + m4/lib-ld.m4 + m4/lib-link.m4 +@@ -712,16 +755,19 @@ AC_DEFUN([gl_FILE_LIST], [ + m4/nls.m4 + m4/nocrash.m4 + m4/off_t.m4 ++ m4/pathmax.m4 + m4/po.m4 + m4/printf-posix.m4 + m4/printf.m4 + m4/progtest.m4 + m4/rawmemchr.m4 ++ m4/readlink.m4 + m4/realloc.m4 + m4/regex.m4 + m4/size_max.m4 + m4/sleep.m4 + m4/ssize_t.m4 ++ m4/stat.m4 + m4/stdalign.m4 + m4/stdbool.m4 + m4/stddef_h.m4 +@@ -737,9 +783,12 @@ AC_DEFUN([gl_FILE_LIST], [ + m4/strndup.m4 + m4/strnlen.m4 + m4/sys_socket_h.m4 ++ m4/sys_stat_h.m4 ++ m4/sys_time_h.m4 + m4/sys_types_h.m4 + m4/sysexits.m4 + m4/threadlib.m4 ++ m4/time_h.m4 + m4/uintmax_t.m4 + m4/unistd_h.m4 + m4/vasnprintf.m4 +diff --git a/m4/largefile.m4 b/m4/largefile.m4 +new file mode 100644 +index 0000000..a1b564a +--- /dev/null ++++ b/m4/largefile.m4 +@@ -0,0 +1,146 @@ ++# Enable large files on systems where this is not the default. ++ ++# Copyright 1992-1996, 1998-2014 Free Software Foundation, Inc. ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# The following implementation works around a problem in autoconf <= 2.69; ++# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, ++# or configures them incorrectly in some cases. ++m4_version_prereq([2.70], [] ,[ ++ ++# _AC_SYS_LARGEFILE_TEST_INCLUDES ++# ------------------------------- ++m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], ++[@%:@include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]];[]dnl ++]) ++ ++ ++# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, ++# CACHE-VAR, ++# DESCRIPTION, ++# PROLOGUE, [FUNCTION-BODY]) ++# -------------------------------------------------------- ++m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], ++[AC_CACHE_CHECK([for $1 value needed for large files], [$3], ++[while :; do ++ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( ++ [AC_LANG_PROGRAM([$5], [$6])], ++ [$3=no; break]) ++ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( ++ [AC_LANG_PROGRAM([@%:@define $1 $2 ++$5], [$6])], ++ [$3=$2; break]) ++ $3=unknown ++ break ++done]) ++case $$3 in #( ++ no | unknown) ;; ++ *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);; ++esac ++rm -rf conftest*[]dnl ++])# _AC_SYS_LARGEFILE_MACRO_VALUE ++ ++ ++# AC_SYS_LARGEFILE ++# ---------------- ++# By default, many hosts won't let programs access large files; ++# one must use special compiler options to get large-file access to work. ++# For more details about this brain damage please see: ++# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html ++AC_DEFUN([AC_SYS_LARGEFILE], ++[AC_ARG_ENABLE(largefile, ++ [ --disable-largefile omit support for large files]) ++if test "$enable_largefile" != no; then ++ ++ AC_CACHE_CHECK([for special C compiler options needed for large files], ++ ac_cv_sys_largefile_CC, ++ [ac_cv_sys_largefile_CC=no ++ if test "$GCC" != yes; then ++ ac_save_CC=$CC ++ while :; do ++ # IRIX 6.2 and later do not support large files by default, ++ # so use the C compiler's -n32 option if that helps. ++ AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) ++ AC_COMPILE_IFELSE([], [break]) ++ CC="$CC -n32" ++ AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) ++ break ++ done ++ CC=$ac_save_CC ++ rm -f conftest.$ac_ext ++ fi]) ++ if test "$ac_cv_sys_largefile_CC" != no; then ++ CC=$CC$ac_cv_sys_largefile_CC ++ fi ++ ++ _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ++ ac_cv_sys_file_offset_bits, ++ [Number of bits in a file offset, on hosts where this is settable.], ++ [_AC_SYS_LARGEFILE_TEST_INCLUDES]) ++ if test $ac_cv_sys_file_offset_bits = unknown; then ++ _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ++ ac_cv_sys_large_files, ++ [Define for large files, on AIX-style hosts.], ++ [_AC_SYS_LARGEFILE_TEST_INCLUDES]) ++ fi ++ ++ AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1], ++ [Enable large inode numbers on Mac OS X 10.5.]) ++fi ++])# AC_SYS_LARGEFILE ++])# m4_version_prereq 2.70 ++ ++# Enable large files on systems where this is implemented by Gnulib, not by the ++# system headers. ++# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib ++# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively. ++AC_DEFUN([gl_LARGEFILE], ++[ ++ AC_REQUIRE([AC_CANONICAL_HOST]) ++ case "$host_os" in ++ mingw*) ++ dnl Native Windows. ++ dnl mingw64 defines off_t to a 64-bit type already, if ++ dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. ++ AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1]; ++ ]], ++ [[]])], ++ [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no]) ++ ]) ++ if test $gl_cv_type_off_t_64 = no; then ++ WINDOWS_64_BIT_OFF_T=1 ++ else ++ WINDOWS_64_BIT_OFF_T=0 ++ fi ++ dnl But all native Windows platforms (including mingw64) have a 32-bit ++ dnl st_size member in 'struct stat'. ++ WINDOWS_64_BIT_ST_SIZE=1 ++ ;; ++ *) ++ dnl Nothing to do on gnulib's side. ++ dnl A 64-bit off_t is ++ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX, ++ dnl OSF/1, Cygwin, ++ dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on ++ dnl glibc, HP-UX, Solaris, ++ dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX, ++ dnl - impossible to achieve on Minix 3.1.8. ++ WINDOWS_64_BIT_OFF_T=0 ++ WINDOWS_64_BIT_ST_SIZE=0 ++ ;; ++ esac ++]) +diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 +new file mode 100644 +index 0000000..114f91f +--- /dev/null ++++ b/m4/pathmax.m4 +@@ -0,0 +1,42 @@ ++# pathmax.m4 serial 10 ++dnl Copyright (C) 2002-2003, 2005-2006, 2009-2014 Free Software Foundation, ++dnl Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++AC_DEFUN([gl_PATHMAX], ++[ ++ dnl Prerequisites of lib/pathmax.h. ++ AC_CHECK_HEADERS_ONCE([sys/param.h]) ++]) ++ ++# Expands to a piece of C program that defines PATH_MAX in the same way as ++# "pathmax.h" will do. ++AC_DEFUN([gl_PATHMAX_SNIPPET], [[ ++/* Arrange to define PATH_MAX, like "pathmax.h" does. */ ++#if HAVE_UNISTD_H ++# include ++#endif ++#include ++#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN ++# include ++#endif ++#if !defined PATH_MAX && defined MAXPATHLEN ++# define PATH_MAX MAXPATHLEN ++#endif ++#ifdef __hpux ++# undef PATH_MAX ++# define PATH_MAX 1024 ++#endif ++#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ ++# undef PATH_MAX ++# define PATH_MAX 260 ++#endif ++]]) ++ ++# Prerequisites of gl_PATHMAX_SNIPPET. ++AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ], ++[ ++ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h]) ++]) +diff --git a/m4/readlink.m4 b/m4/readlink.m4 +new file mode 100644 +index 0000000..f9ce868 +--- /dev/null ++++ b/m4/readlink.m4 +@@ -0,0 +1,71 @@ ++# readlink.m4 serial 12 ++dnl Copyright (C) 2003, 2007, 2009-2014 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++AC_DEFUN([gl_FUNC_READLINK], ++[ ++ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) ++ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles ++ AC_CHECK_FUNCS_ONCE([readlink]) ++ if test $ac_cv_func_readlink = no; then ++ HAVE_READLINK=0 ++ else ++ AC_CACHE_CHECK([whether readlink signature is correct], ++ [gl_cv_decl_readlink_works], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ /* Cause compilation failure if original declaration has wrong type. */ ++ ssize_t readlink (const char *, char *, size_t);]])], ++ [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) ++ dnl Solaris 9 ignores trailing slash. ++ dnl FreeBSD 7.2 dereferences only one level of links with trailing slash. ++ AC_CACHE_CHECK([whether readlink handles trailing slash correctly], ++ [gl_cv_func_readlink_works], ++ [# We have readlink, so assume ln -s works. ++ ln -s conftest.no-such conftest.link ++ ln -s conftest.link conftest.lnk2 ++ AC_RUN_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++]], [[char buf[20]; ++ return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])], ++ [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], ++ [case "$host_os" in ++ # Guess yes on glibc systems. ++ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; ++ # If we don't know, assume the worst. ++ *) gl_cv_func_readlink_works="guessing no" ;; ++ esac ++ ]) ++ rm -f conftest.link conftest.lnk2]) ++ case "$gl_cv_func_readlink_works" in ++ *yes) ++ if test "$gl_cv_decl_readlink_works" != yes; then ++ REPLACE_READLINK=1 ++ fi ++ ;; ++ *) ++ AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink ++ fails to recognize a trailing slash.]) ++ REPLACE_READLINK=1 ++ ;; ++ esac ++ fi ++]) ++ ++# Like gl_FUNC_READLINK, except prepare for separate compilation ++# (no REPLACE_READLINK, no AC_LIBOBJ). ++AC_DEFUN([gl_FUNC_READLINK_SEPARATE], ++[ ++ AC_CHECK_FUNCS_ONCE([readlink]) ++ gl_PREREQ_READLINK ++]) ++ ++# Prerequisites of lib/readlink.c. ++AC_DEFUN([gl_PREREQ_READLINK], ++[ ++ : ++]) +diff --git a/m4/stat.m4 b/m4/stat.m4 +new file mode 100644 +index 0000000..1ae327b +--- /dev/null ++++ b/m4/stat.m4 +@@ -0,0 +1,71 @@ ++# serial 11 ++ ++# Copyright (C) 2009-2014 Free Software Foundation, Inc. ++# ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++AC_DEFUN([gl_FUNC_STAT], ++[ ++ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles ++ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) ++ AC_CHECK_FUNCS_ONCE([lstat]) ++ dnl mingw is the only known platform where stat(".") and stat("./") differ ++ AC_CACHE_CHECK([whether stat handles trailing slashes on directories], ++ [gl_cv_func_stat_dir_slash], ++ [AC_RUN_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])], ++ [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no], ++ [case $host_os in ++ mingw*) gl_cv_func_stat_dir_slash="guessing no";; ++ *) gl_cv_func_stat_dir_slash="guessing yes";; ++ esac])]) ++ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). ++ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) ++ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). ++ AC_CACHE_CHECK([whether stat handles trailing slashes on files], ++ [gl_cv_func_stat_file_slash], ++ [touch conftest.tmp ++ # Assume that if we have lstat, we can also check symlinks. ++ if test $ac_cv_func_lstat = yes; then ++ ln -s conftest.tmp conftest.lnk ++ fi ++ AC_RUN_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++]], [[int result = 0; ++ struct stat st; ++ if (!stat ("conftest.tmp/", &st)) ++ result |= 1; ++#if HAVE_LSTAT ++ if (!stat ("conftest.lnk/", &st)) ++ result |= 2; ++#endif ++ return result; ++ ]])], ++ [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], ++ [case "$host_os" in ++ # Guess yes on glibc systems. ++ *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; ++ # If we don't know, assume the worst. ++ *) gl_cv_func_stat_file_slash="guessing no" ;; ++ esac ++ ]) ++ rm -f conftest.tmp conftest.lnk]) ++ case $gl_cv_func_stat_dir_slash in ++ *no) REPLACE_STAT=1 ++ AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs ++ help when passed a directory name with a trailing slash]);; ++ esac ++ case $gl_cv_func_stat_file_slash in ++ *no) REPLACE_STAT=1 ++ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs ++ help when passed a file name with a trailing slash]);; ++ esac ++]) ++ ++# Prerequisites of lib/stat.c. ++AC_DEFUN([gl_PREREQ_STAT], [:]) +diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 +new file mode 100644 +index 0000000..eaa7642 +--- /dev/null ++++ b/m4/sys_stat_h.m4 +@@ -0,0 +1,96 @@ ++# sys_stat_h.m4 serial 28 -*- Autoconf -*- ++dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++dnl From Eric Blake. ++dnl Provide a GNU-like . ++ ++AC_DEFUN([gl_HEADER_SYS_STAT_H], ++[ ++ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) ++ ++ dnl Check for broken stat macros. ++ AC_REQUIRE([AC_HEADER_STAT]) ++ ++ gl_CHECK_NEXT_HEADERS([sys/stat.h]) ++ ++ dnl Ensure the type mode_t gets defined. ++ AC_REQUIRE([AC_TYPE_MODE_T]) ++ ++ dnl Whether to override 'struct stat'. ++ m4_ifdef([gl_LARGEFILE], [ ++ AC_REQUIRE([gl_LARGEFILE]) ++ ], [ ++ WINDOWS_64_BIT_ST_SIZE=0 ++ ]) ++ AC_SUBST([WINDOWS_64_BIT_ST_SIZE]) ++ if test $WINDOWS_64_BIT_ST_SIZE = 1; then ++ AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1], ++ [Define to 1 if Gnulib overrides 'struct stat' on Windows so that ++ struct stat.st_size becomes 64-bit.]) ++ fi ++ ++ dnl Define types that are supposed to be defined in or ++ dnl . ++ AC_CHECK_TYPE([nlink_t], [], ++ [AC_DEFINE([nlink_t], [int], ++ [Define to the type of st_nlink in struct stat, or a supertype.])], ++ [#include ++ #include ]) ++ ++ dnl Check for declarations of anything we want to poison if the ++ dnl corresponding gnulib module is not in use. ++ gl_WARN_ON_USE_PREPARE([[#include ++ ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat ++ mknod mknodat stat utimensat]) ++]) # gl_HEADER_SYS_STAT_H ++ ++AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR], ++[ ++ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. ++ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) ++ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ++ dnl Define it also as a C macro, for the benefit of the unit tests. ++ gl_MODULE_INDICATOR_FOR_TESTS([$1]) ++]) ++ ++AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], ++[ ++ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR ++ GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) ++ GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) ++ GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) ++ GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) ++ GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) ++ GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) ++ GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) ++ GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) ++ GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) ++ GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) ++ GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) ++ GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) ++ GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) ++ dnl Assume proper GNU behavior unless another module says otherwise. ++ HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) ++ HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) ++ HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) ++ HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) ++ HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) ++ HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) ++ HAVE_MKFIFO=1; AC_SUBST([HAVE_MKFIFO]) ++ HAVE_MKFIFOAT=1; AC_SUBST([HAVE_MKFIFOAT]) ++ HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD]) ++ HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT]) ++ HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT]) ++ REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT]) ++ REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT]) ++ REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS]) ++ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) ++ REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) ++ REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) ++ REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) ++ REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) ++ REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) ++]) +diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 +new file mode 100644 +index 0000000..5c79300 +--- /dev/null ++++ b/m4/sys_time_h.m4 +@@ -0,0 +1,110 @@ ++# Configure a replacement for . ++# serial 8 ++ ++# Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# Written by Paul Eggert and Martin Lambers. ++ ++AC_DEFUN([gl_HEADER_SYS_TIME_H], ++[ ++ dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement ++ dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 ++ dnl statements that occur in other macros. ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) ++]) ++ ++AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], ++[ ++ AC_REQUIRE([AC_C_RESTRICT]) ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) ++ AC_CHECK_HEADERS_ONCE([sys/time.h]) ++ gl_CHECK_NEXT_HEADERS([sys/time.h]) ++ ++ if test $ac_cv_header_sys_time_h != yes; then ++ HAVE_SYS_TIME_H=0 ++ fi ++ ++ dnl On native Windows with MSVC, 'struct timeval' is defined in ++ dnl only. So include that header in the list. ++ gl_PREREQ_SYS_H_WINSOCK2 ++ AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#if HAVE_SYS_TIME_H ++ #include ++ #endif ++ #include ++ #if HAVE_WINSOCK2_H ++ # include ++ #endif ++ ]], ++ [[static struct timeval x; x.tv_sec = x.tv_usec;]])], ++ [gl_cv_sys_struct_timeval=yes], ++ [gl_cv_sys_struct_timeval=no]) ++ ]) ++ if test $gl_cv_sys_struct_timeval != yes; then ++ HAVE_STRUCT_TIMEVAL=0 ++ else ++ dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined ++ dnl (in and for mingw64, in only ++ dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is ++ dnl smaller than the 'time_t' type mandated by POSIX. ++ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but ++ dnl that is good enough. ++ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], ++ [gl_cv_sys_struct_timeval_tv_sec], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#if HAVE_SYS_TIME_H ++ #include ++ #endif ++ #include ++ #if HAVE_WINSOCK2_H ++ # include ++ #endif ++ ]], ++ [[static struct timeval x; ++ typedef int verify_tv_sec_type[ ++ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 ++ ]; ++ ]])], ++ [gl_cv_sys_struct_timeval_tv_sec=yes], ++ [gl_cv_sys_struct_timeval_tv_sec=no]) ++ ]) ++ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then ++ REPLACE_STRUCT_TIMEVAL=1 ++ fi ++ fi ++ ++ dnl Check for declarations of anything we want to poison if the ++ dnl corresponding gnulib module is not in use. ++ gl_WARN_ON_USE_PREPARE([[ ++#if HAVE_SYS_TIME_H ++# include ++#endif ++#include ++ ]], [gettimeofday]) ++]) ++ ++AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR], ++[ ++ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. ++ AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) ++ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ++ dnl Define it also as a C macro, for the benefit of the unit tests. ++ gl_MODULE_INDICATOR_FOR_TESTS([$1]) ++]) ++ ++AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], ++[ ++ GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) ++ dnl Assume POSIX behavior unless another module says otherwise. ++ HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) ++ HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) ++ HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H]) ++ REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY]) ++ REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL]) ++]) +diff --git a/m4/time_h.m4 b/m4/time_h.m4 +new file mode 100644 +index 0000000..9852778 +--- /dev/null ++++ b/m4/time_h.m4 +@@ -0,0 +1,118 @@ ++# Configure a more-standard replacement for . ++ ++# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc. ++ ++# serial 8 ++ ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. ++ ++# Written by Paul Eggert and Jim Meyering. ++ ++AC_DEFUN([gl_HEADER_TIME_H], ++[ ++ dnl Use AC_REQUIRE here, so that the default behavior below is expanded ++ dnl once only, before all statements that occur in other macros. ++ AC_REQUIRE([gl_HEADER_TIME_H_BODY]) ++]) ++ ++AC_DEFUN([gl_HEADER_TIME_H_BODY], ++[ ++ AC_REQUIRE([AC_C_RESTRICT]) ++ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) ++ gl_NEXT_HEADERS([time.h]) ++ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) ++]) ++ ++dnl Check whether 'struct timespec' is declared ++dnl in time.h, sys/time.h, or pthread.h. ++ ++AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], ++[ ++ AC_CHECK_HEADERS_ONCE([sys/time.h]) ++ AC_CACHE_CHECK([for struct timespec in ], ++ [gl_cv_sys_struct_timespec_in_time_h], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ ]], ++ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], ++ [gl_cv_sys_struct_timespec_in_time_h=yes], ++ [gl_cv_sys_struct_timespec_in_time_h=no])]) ++ ++ TIME_H_DEFINES_STRUCT_TIMESPEC=0 ++ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0 ++ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0 ++ if test $gl_cv_sys_struct_timespec_in_time_h = yes; then ++ TIME_H_DEFINES_STRUCT_TIMESPEC=1 ++ else ++ AC_CACHE_CHECK([for struct timespec in ], ++ [gl_cv_sys_struct_timespec_in_sys_time_h], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ ]], ++ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], ++ [gl_cv_sys_struct_timespec_in_sys_time_h=yes], ++ [gl_cv_sys_struct_timespec_in_sys_time_h=no])]) ++ if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then ++ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1 ++ else ++ AC_CACHE_CHECK([for struct timespec in ], ++ [gl_cv_sys_struct_timespec_in_pthread_h], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[#include ++ ]], ++ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])], ++ [gl_cv_sys_struct_timespec_in_pthread_h=yes], ++ [gl_cv_sys_struct_timespec_in_pthread_h=no])]) ++ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then ++ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1 ++ fi ++ fi ++ fi ++ AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC]) ++ AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC]) ++ AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC]) ++]) ++ ++AC_DEFUN([gl_TIME_MODULE_INDICATOR], ++[ ++ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. ++ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) ++ gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ++ dnl Define it also as a C macro, for the benefit of the unit tests. ++ gl_MODULE_INDICATOR_FOR_TESTS([$1]) ++]) ++ ++AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], ++[ ++ GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) ++ GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) ++ GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) ++ GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) ++ GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) ++ dnl Assume proper GNU behavior unless another module says otherwise. ++ HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) ++ HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) ++ HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) ++ HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) ++ dnl If another module says to replace or to not replace, do that. ++ dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; ++ dnl this lets maintainers check for portability. ++ REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) ++ REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME]) ++ REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP]) ++ REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM]) ++ ++ dnl Hack so that the time module doesn't depend on the sys_time module. ++ dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. ++ : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) ++ dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME ++ dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier ++ dnl is no longer a big deal. ++ REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) ++ REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) ++]) +-- +2.7.4 + diff --git a/SOURCES/0145-Make-editenv-chase-symlinks-including-those-across-d.patch b/SOURCES/0145-Make-editenv-chase-symlinks-including-those-across-d.patch deleted file mode 100644 index ce4b06c..0000000 --- a/SOURCES/0145-Make-editenv-chase-symlinks-including-those-across-d.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 4ebb0b512d9cf934ace9478fde7890cebb33f56d Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Wed, 3 Sep 2014 10:38:00 -0400 -Subject: [PATCH 145/145] Make editenv chase symlinks including those across - devices. - -This lets us make /boot/grub2/grubenv a symlink to -/boot/efi/EFI/fedora/grubenv even though they're different mount points, -which allows /usr/bin/grub2-editenv to be the same across platforms -(i.e. UEFI vs BIOS). - -Signed-off-by: Peter Jones -Reviewed-by: Adam Jackson ---- - Makefile.util.def | 9 +++++++++ - util/editenv.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- - 2 files changed, 53 insertions(+), 2 deletions(-) - -diff --git a/Makefile.util.def b/Makefile.util.def -index 8f40e78..87029a1 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -228,8 +228,17 @@ program = { - - common = util/grub-editenv.c; - common = util/editenv.c; -+ common = util/grub-install-common.c; - common = grub-core/osdep/init.c; -+ common = grub-core/osdep/compress.c; -+ extra_dist = grub-core/osdep/unix/compress.c; -+ extra_dist = grub-core/osdep/basic/compress.c; -+ common = util/mkimage.c; -+ common = grub-core/osdep/config.c; -+ common = util/config.c; -+ common = util/resolve.c; - -+ ldadd = '$(LIBLZMA)'; - ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; - ldadd = libgrubkern.a; -diff --git a/util/editenv.c b/util/editenv.c -index c6f8d22..d8d1dad 100644 ---- a/util/editenv.c -+++ b/util/editenv.c -@@ -37,6 +37,7 @@ grub_util_create_envblk_file (const char *name) - FILE *fp; - char *buf; - char *namenew; -+ char *rename_target = xstrdup(name); - - buf = xmalloc (DEFAULT_ENVBLK_SIZE); - -@@ -59,7 +60,48 @@ grub_util_create_envblk_file (const char *name) - free (buf); - fclose (fp); - -- if (grub_util_rename (namenew, name) < 0) -- grub_util_error (_("cannot rename the file %s to %s"), namenew, name); -+ ssize_t size = 1; -+ while (1) -+ { -+ char *linkbuf; -+ ssize_t retsize; -+ -+ linkbuf = xmalloc(size+1); -+ retsize = grub_util_readlink (rename_target, linkbuf, size); -+ if (retsize < 0 && (errno == ENOENT || errno == EINVAL)) -+ { -+ free (linkbuf); -+ break; -+ } -+ else if (retsize < 0) -+ { -+ grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name); -+ free (linkbuf); -+ free (namenew); -+ return; -+ } -+ else if (retsize == size) -+ { -+ free(linkbuf); -+ size += 128; -+ continue; -+ } -+ -+ free (rename_target); -+ linkbuf[retsize] = '\0'; -+ rename_target = linkbuf; -+ } -+ -+ int rc = grub_util_rename (namenew, rename_target); -+ if (rc < 0 && errno == EXDEV) -+ { -+ rc = grub_install_copy_file (namenew, rename_target, 1); -+ grub_util_unlink (namenew); -+ } -+ -+ if (rc < 0) -+ grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name); -+ - free (namenew); -+ free (rename_target); - } --- -1.9.3 - diff --git a/SOURCES/0146-Make-editenv-chase-symlinks-including-those-across-d.patch b/SOURCES/0146-Make-editenv-chase-symlinks-including-those-across-d.patch new file mode 100644 index 0000000..490b81e --- /dev/null +++ b/SOURCES/0146-Make-editenv-chase-symlinks-including-those-across-d.patch @@ -0,0 +1,106 @@ +From 1c5b023056beece6e9eec0270212b88a62d28057 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 3 Sep 2014 10:38:00 -0400 +Subject: [PATCH 146/198] Make editenv chase symlinks including those across + devices. + +This lets us make /boot/grub2/grubenv a symlink to +/boot/efi/EFI/fedora/grubenv even though they're different mount points, +which allows /usr/bin/grub2-editenv to be the same across platforms +(i.e. UEFI vs BIOS). + +Signed-off-by: Peter Jones +Reviewed-by: Adam Jackson +--- + Makefile.util.def | 9 +++++++++ + util/editenv.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 53 insertions(+), 2 deletions(-) + +diff --git a/Makefile.util.def b/Makefile.util.def +index 8f40e78..87029a1 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -228,8 +228,17 @@ program = { + + common = util/grub-editenv.c; + common = util/editenv.c; ++ common = util/grub-install-common.c; + common = grub-core/osdep/init.c; ++ common = grub-core/osdep/compress.c; ++ extra_dist = grub-core/osdep/unix/compress.c; ++ extra_dist = grub-core/osdep/basic/compress.c; ++ common = util/mkimage.c; ++ common = grub-core/osdep/config.c; ++ common = util/config.c; ++ common = util/resolve.c; + ++ ldadd = '$(LIBLZMA)'; + ldadd = libgrubmods.a; + ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; +diff --git a/util/editenv.c b/util/editenv.c +index c6f8d22..d8d1dad 100644 +--- a/util/editenv.c ++++ b/util/editenv.c +@@ -37,6 +37,7 @@ grub_util_create_envblk_file (const char *name) + FILE *fp; + char *buf; + char *namenew; ++ char *rename_target = xstrdup(name); + + buf = xmalloc (DEFAULT_ENVBLK_SIZE); + +@@ -59,7 +60,48 @@ grub_util_create_envblk_file (const char *name) + free (buf); + fclose (fp); + +- if (grub_util_rename (namenew, name) < 0) +- grub_util_error (_("cannot rename the file %s to %s"), namenew, name); ++ ssize_t size = 1; ++ while (1) ++ { ++ char *linkbuf; ++ ssize_t retsize; ++ ++ linkbuf = xmalloc(size+1); ++ retsize = grub_util_readlink (rename_target, linkbuf, size); ++ if (retsize < 0 && (errno == ENOENT || errno == EINVAL)) ++ { ++ free (linkbuf); ++ break; ++ } ++ else if (retsize < 0) ++ { ++ grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name); ++ free (linkbuf); ++ free (namenew); ++ return; ++ } ++ else if (retsize == size) ++ { ++ free(linkbuf); ++ size += 128; ++ continue; ++ } ++ ++ free (rename_target); ++ linkbuf[retsize] = '\0'; ++ rename_target = linkbuf; ++ } ++ ++ int rc = grub_util_rename (namenew, rename_target); ++ if (rc < 0 && errno == EXDEV) ++ { ++ rc = grub_install_copy_file (namenew, rename_target, 1); ++ grub_util_unlink (namenew); ++ } ++ ++ if (rc < 0) ++ grub_util_error (_("cannot rename the file %s to %s: %m"), namenew, name); ++ + free (namenew); ++ free (rename_target); + } +-- +2.7.4 + diff --git a/SOURCES/0147-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch b/SOURCES/0147-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch new file mode 100644 index 0000000..8acf3d1 --- /dev/null +++ b/SOURCES/0147-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch @@ -0,0 +1,33 @@ +From c34b472bcc4b11f00a6cf699016aeec464a77d1d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 4 Sep 2014 14:23:23 -0400 +Subject: [PATCH 147/198] Generate OS and CLASS in 10_linux from + /etc/os-release + +This makes us use pretty names in the titles we generate in +grub2-mkconfig when GRUB_DISTRIBUTOR isn't set. + +Resolves: rhbz#996794 + +Signed-off-by: Peter Jones +--- + util/grub.d/10_linux.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 8782d8c..e8088a1 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" + CLASS="--class gnu-linux --class gnu --class os --unrestricted" + + if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then +- OS="$(sed 's, release .*$,,g' /etc/system-release)" ++ OS="$(eval $(grep PRETTY_NAME /etc/os-release) ; echo ${PRETTY_NAME})" ++ CLASS="--class $(eval $(grep '^ID_LIKE=\|^ID=' /etc/os-release) ; [ -n "${ID_LIKE}" ] && echo ${ID_LIKE} || echo ${ID}) ${CLASS}" + else + OS="${GRUB_DISTRIBUTOR}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" +-- +2.7.4 + diff --git a/SOURCES/0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch b/SOURCES/0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch new file mode 100644 index 0000000..8b3cee9 --- /dev/null +++ b/SOURCES/0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch @@ -0,0 +1,34 @@ +From 6fdf50141a37a6af9df041daf577f6dca2479155 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 4 Sep 2014 15:52:08 -0400 +Subject: [PATCH 148/198] Minimize the sort ordering for .debug and -rescue- + kernels. + +Resolves: rhbz#1065360 +Signed-off-by: Peter Jones +--- + util/grub-mkconfig_lib.in | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 14fadbc..7ac0bbe 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -248,6 +248,14 @@ version_test_gt () + *.old:*.old) ;; + *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=gt ;; + *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed -e 's/\.old$//'`" ; version_test_gt_cmp=ge ;; ++ *-rescue-*:*-rescue-*) ;; ++ *.debug:*.debug) ;; ++ *-rescue-*:*.debug) return 1 ;; ++ *.debug:*-rescue-*) return 0 ;; ++ *-rescue-*:*) return 1 ;; ++ *:*-rescue-*) return 0 ;; ++ *.debug:*) return 1 ;; ++ *:*.debug) return 0 ;; + esac + version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" + return "$?" +-- +2.7.4 + diff --git a/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch b/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch new file mode 100644 index 0000000..1c85f6f --- /dev/null +++ b/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch @@ -0,0 +1,102 @@ +From 6d6f8893adbe2b61ef2cc47980a3b34298bb600c Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 4 Sep 2014 16:49:25 -0400 +Subject: [PATCH 149/198] Add GRUB_DISABLE_UUID. + +This will cause "search --fs-uuid --set=root ..." not to be generated by +grub2-mkconfig, and instead simply attempt to use the grub device name +as it understands it. + +Good luck. + +Resolves: rhbz#1027833 +Signed-off-by: Peter Jones +--- + docs/grub.texi | 7 +++++++ + util/grub-mkconfig.in | 12 ++++++++++-- + util/grub-mkconfig_lib.in | 4 ++-- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 46b9e7f..6b112c1 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. + If this option is set to @samp{true}, disable the generation of recovery + mode menu entries. + ++@item GRUB_DISABLE_UUID ++Normally, @command{grub-mkconfig} will generate menu entries that use ++universally-unique identifiers (UUIDs) to identify various filesystems to ++search for files. This is usually more reliable, but in some cases it may ++not be appropriate. To disable this use of UUIDs, set this option to ++@samp{true}. ++ + @item GRUB_VIDEO_BACKEND + If graphical video support is required, either because the @samp{gfxterm} + graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set, +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index beb22de..bc26e7c 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -130,11 +130,11 @@ fi + + # Device containing our userland. Typically used for root= parameter. + GRUB_DEVICE="`${grub_probe} --target=device /`" +-GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true ++GRUB_DEVICE_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true + + # Device containing our /boot partition. Usually the same as GRUB_DEVICE. + GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" +-GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true ++GRUB_DEVICE_BOOT_UUID_GENERATED="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true + + # Filesystem for the device containing our userland. Used for stuff like + # choosing Hurd filesystem module. +@@ -148,6 +148,13 @@ if test -f ${sysconfdir}/default/grub ; then + . ${sysconfdir}/default/grub + fi + ++if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then ++ GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" ++fi ++if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_BOOT_UUID" ]; then ++ GRUB_DEVICE_BOOT_UUID="$GRUB_DEVICE_BOOT_UUID_GENERATED" ++fi ++ + # XXX: should this be deprecated at some point? + if [ "x${GRUB_TERMINAL}" != "x" ] ; then + GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" +@@ -213,6 +220,7 @@ export GRUB_DEFAULT \ + GRUB_SERIAL_COMMAND \ + GRUB_DISABLE_LINUX_UUID \ + GRUB_DISABLE_RECOVERY \ ++ GRUB_DISABLE_UUID \ + GRUB_VIDEO_BACKEND \ + GRUB_GFXMODE \ + GRUB_BACKGROUND \ +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 7ac0bbe..5c9ed84 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -156,7 +156,7 @@ prepare_grub_to_access_device () + if [ "x$fs_hint" != x ]; then + echo "set root='$fs_hint'" + fi +- if fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then ++ if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then + hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints= + echo "if [ x\$feature_platform_search_hint = xy ]; then" + echo " search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}" +@@ -173,7 +173,7 @@ grub_get_device_id () + IFS=' + ' + device="$1" +- if fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then ++ if [ "x$GRUB_DISABLE_UUID" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then + echo "$fs_uuid"; + else + echo $device |sed 's, ,_,g' +-- +2.7.4 + diff --git a/SOURCES/0150-Allow-fallback-to-include-entries-by-title-not-just-.patch b/SOURCES/0150-Allow-fallback-to-include-entries-by-title-not-just-.patch new file mode 100644 index 0000000..a126895 --- /dev/null +++ b/SOURCES/0150-Allow-fallback-to-include-entries-by-title-not-just-.patch @@ -0,0 +1,131 @@ +From 15e18b7beca626007718183d25c626272f689a5c Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 5 Sep 2014 10:07:04 -0400 +Subject: [PATCH 150/198] Allow "fallback" to include entries by title, not + just number. + +Resolves: rhbz#1026084 + +Signed-off-by: Peter Jones +--- + grub-core/normal/menu.c | 76 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 49 insertions(+), 27 deletions(-) + +diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c +index cc27c37..a446d9a 100644 +--- a/grub-core/normal/menu.c ++++ b/grub-core/normal/menu.c +@@ -163,12 +163,35 @@ grub_menu_set_timeout (int timeout) + } + } + ++static int ++menuentry_eq (const char *id, const char *spec) ++{ ++ const char *ptr1, *ptr2; ++ ptr1 = id; ++ ptr2 = spec; ++ while (1) ++ { ++ if (*ptr2 == '>' && ptr2[1] != '>' && *ptr1 == 0) ++ return 1; ++ if (*ptr2 == '>' && ptr2[1] != '>') ++ return 0; ++ if (*ptr2 == '>') ++ ptr2++; ++ if (*ptr1 != *ptr2) ++ return 0; ++ if (*ptr1 == 0) ++ return 1; ++ ptr1++; ++ ptr2++; ++ } ++} ++ + /* Get the first entry number from the value of the environment variable NAME, + which is a space-separated list of non-negative integers. The entry number + which is returned is stripped from the value of NAME. If no entry number + can be found, -1 is returned. */ + static int +-get_and_remove_first_entry_number (const char *name) ++get_and_remove_first_entry_number (grub_menu_t menu, const char *name) + { + const char *val; + char *tail; +@@ -182,9 +205,32 @@ get_and_remove_first_entry_number (const char *name) + + entry = (int) grub_strtoul (val, &tail, 0); + ++ if (grub_errno == GRUB_ERR_BAD_NUMBER) ++ { ++ /* See if the variable matches the title of a menu entry. */ ++ grub_menu_entry_t e = menu->entry_list; ++ int i; ++ ++ grub_errno = GRUB_ERR_NONE; ++ ++ for (i = 0; e; i++) ++ { ++ if (menuentry_eq (e->title, val) ++ || menuentry_eq (e->id, val)) ++ { ++ entry = i; ++ break; ++ } ++ e = e->next; ++ } ++ ++ if (! e) ++ entry = -1; ++ } ++ + if (grub_errno == GRUB_ERR_NONE) + { +- /* Skip whitespace to find the next digit. */ ++ /* Skip whitespace to find the next entry. */ + while (*tail && grub_isspace (*tail)) + tail++; + grub_env_set (name, tail); +@@ -347,7 +393,7 @@ grub_menu_execute_with_fallback (grub_menu_t menu, + grub_menu_execute_entry (entry, 1); + + /* Deal with fallback entries. */ +- while ((fallback_entry = get_and_remove_first_entry_number ("fallback")) ++ while ((fallback_entry = get_and_remove_first_entry_number (menu, "fallback")) + >= 0) + { + grub_print_error (); +@@ -465,30 +511,6 @@ grub_menu_register_viewer (struct grub_menu_viewer *viewer) + viewers = viewer; + } + +-static int +-menuentry_eq (const char *id, const char *spec) +-{ +- const char *ptr1, *ptr2; +- ptr1 = id; +- ptr2 = spec; +- while (1) +- { +- if (*ptr2 == '>' && ptr2[1] != '>' && *ptr1 == 0) +- return 1; +- if (*ptr2 == '>' && ptr2[1] != '>') +- return 0; +- if (*ptr2 == '>') +- ptr2++; +- if (*ptr1 != *ptr2) +- return 0; +- if (*ptr1 == 0) +- return 1; +- ptr1++; +- ptr2++; +- } +-} +- +- + /* Get the entry number from the variable NAME. */ + static int + get_entry_number (grub_menu_t menu, const char *name) +-- +2.7.4 + diff --git a/SOURCES/0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch b/SOURCES/0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch new file mode 100644 index 0000000..2ccd177 --- /dev/null +++ b/SOURCES/0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch @@ -0,0 +1,134 @@ +From 22107f5857dd95a55f14fbdf8a78c6b26e9a134e Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 17 Sep 2014 15:13:14 -0500 +Subject: [PATCH 151/198] Initialized initrd_ctx so we don't free a random + pointer from the stack. + +Currently, if "linux" fails, the "goto fail;" in grub_cmd_initrd sends us +into grub_initrd_close() without grub_initrd_init() being called, and thus +it never clears initrd_ctx->components. grub_initrd_close() then frees that +address, which is stale data from the stack. If the stack happens to have a +stale *address* there that matches a recent allocation, then you'll get a +double free later. + +So initialize the memory up front. + +Signed-off-by: Peter Jones +--- + grub-core/loader/arm/linux.c | 2 +- + grub-core/loader/arm64/linux.c | 2 +- + grub-core/loader/i386/linux.c | 2 +- + grub-core/loader/i386/pc/linux.c | 2 +- + grub-core/loader/ia64/efi/linux.c | 2 +- + grub-core/loader/mips/linux.c | 2 +- + grub-core/loader/powerpc/ieee1275/linux.c | 2 +- + grub-core/loader/sparc64/ieee1275/linux.c | 2 +- + 8 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c +index e6770d9..62cbe75 100644 +--- a/grub-core/loader/arm/linux.c ++++ b/grub-core/loader/arm/linux.c +@@ -396,7 +396,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + { + grub_file_t file; + grub_size_t size = 0; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index f1d10a1..0dc144e 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -328,7 +328,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + int initrd_size, initrd_pages; + void *initrd_mem = NULL; + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index 31fb91e..2ae1763 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -1050,7 +1050,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + { +diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c +index 672c013..b481e46 100644 +--- a/grub-core/loader/i386/pc/linux.c ++++ b/grub-core/loader/i386/pc/linux.c +@@ -388,7 +388,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_uint8_t *initrd_chunk; + grub_addr_t initrd_addr; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + { +diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c +index 87ac49f..eb78e6e 100644 +--- a/grub-core/loader/ia64/efi/linux.c ++++ b/grub-core/loader/ia64/efi/linux.c +@@ -568,7 +568,7 @@ static grub_err_t + grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + { +diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c +index ef64a5b..4a3e8c5 100644 +--- a/grub-core/loader/mips/linux.c ++++ b/grub-core/loader/mips/linux.c +@@ -415,7 +415,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + void *initrd_src; + grub_addr_t initrd_dest; + grub_err_t err; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); +diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c +index 4a14f66..787d7dc 100644 +--- a/grub-core/loader/powerpc/ieee1275/linux.c ++++ b/grub-core/loader/powerpc/ieee1275/linux.c +@@ -333,7 +333,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_size_t size = 0; + grub_addr_t first_addr; + grub_addr_t addr; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + { +diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c +index de6ee2f..c5e8dfa 100644 +--- a/grub-core/loader/sparc64/ieee1275/linux.c ++++ b/grub-core/loader/sparc64/ieee1275/linux.c +@@ -373,7 +373,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + grub_addr_t paddr; + grub_addr_t addr; + int ret; +- struct grub_linux_initrd_context initrd_ctx; ++ struct grub_linux_initrd_context initrd_ctx = { 0, }; + + if (argc == 0) + { +-- +2.7.4 + diff --git a/SOURCES/0152-Load-arm-with-SB-enabled.patch b/SOURCES/0152-Load-arm-with-SB-enabled.patch new file mode 100644 index 0000000..c365c9b --- /dev/null +++ b/SOURCES/0152-Load-arm-with-SB-enabled.patch @@ -0,0 +1,436 @@ +From 0c0ca3a51e6edda6900a3f812c3a442a57b9c8d1 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 18 Sep 2014 11:26:14 -0400 +Subject: [PATCH 152/198] Load arm with SB enabled. + +Make sure we actually try to validate secure boot on this platform (even +though we're not shipping it enabled by default.) + +This means giving the kernel grub's loaded image as the vehicle for the +kernel command line, because we can't call systab->bs->LoadImage() if SB +is enabled. +--- + grub-core/Makefile.core.def | 2 + + grub-core/loader/arm64/linux.c | 108 ++++++++++++++++++++------------------ + grub-core/loader/efi/linux.c | 65 +++++++++++++++++++++++ + grub-core/loader/i386/efi/linux.c | 39 ++------------ + include/grub/arm64/linux.h | 8 +++ + include/grub/efi/linux.h | 31 +++++++++++ + 6 files changed, 166 insertions(+), 87 deletions(-) + create mode 100644 grub-core/loader/efi/linux.c + create mode 100644 include/grub/efi/linux.h + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 9ff9ae5..9378c73 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -1682,6 +1682,7 @@ module = { + ia64_efi = loader/ia64/efi/linux.c; + arm = loader/arm/linux.c; + arm64 = loader/arm64/linux.c; ++ arm64 = loader/efi/linux.c; + fdt = lib/fdt.c; + common = loader/linux.c; + common = lib/cmdline.c; +@@ -1718,6 +1719,7 @@ module = { + name = linuxefi; + efi = loader/i386/efi/linux.c; + efi = lib/cmdline.c; ++ efi = loader/efi/linux.c; + enable = i386_efi; + enable = x86_64_efi; + }; +diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c +index 0dc144e..bdd9c9b 100644 +--- a/grub-core/loader/arm64/linux.c ++++ b/grub-core/loader/arm64/linux.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -44,6 +45,7 @@ static int loaded; + + static void *kernel_addr; + static grub_uint64_t kernel_size; ++static grub_uint32_t handover_offset; + + static char *linux_args; + static grub_uint32_t cmdline_size; +@@ -135,7 +137,9 @@ finalize_params (void) + { + grub_efi_boot_services_t *b; + grub_efi_status_t status; ++ grub_efi_loaded_image_t *loaded_image = NULL; + int node, retval; ++ int len; + + get_fdt (); + if (!fdt) +@@ -172,6 +176,23 @@ finalize_params (void) + grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n", + fdt); + ++ /* Convert command line to UCS-2 */ ++ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (!loaded_image) ++ goto failure; ++ ++ loaded_image->load_options_size = len = ++ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); ++ loaded_image->load_options = ++ grub_efi_allocate_pages (0, ++ BYTES_TO_PAGES (loaded_image->load_options_size)); ++ if (!loaded_image->load_options) ++ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters"); ++ ++ loaded_image->load_options_size = ++ 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, ++ (grub_uint8_t *) linux_args, len, NULL); ++ + return GRUB_ERR_NONE; + + failure: +@@ -181,6 +202,23 @@ failure: + return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT"); + } + ++static void ++free_params (void) ++{ ++ grub_efi_loaded_image_t *loaded_image = NULL; ++ ++ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle); ++ if (loaded_image) ++ { ++ if (loaded_image->load_options) ++ grub_efi_free_pages ((grub_efi_physical_address_t) ++ loaded_image->load_options, ++ BYTES_TO_PAGES (loaded_image->load_options_size)); ++ loaded_image->load_options = NULL; ++ loaded_image->load_options_size = 0; ++ } ++} ++ + static grub_err_t + grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) +@@ -199,6 +237,10 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)), + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + ++ if (grub_efi_secure_boot ()) ++ return grub_error (GRUB_ERR_INVALID_COMMAND, ++ N_("Not loading devicetree - Secure Boot is enabled")); ++ + if (loaded_fdt) + grub_free (loaded_fdt); + loaded_fdt = NULL; +@@ -243,65 +285,20 @@ out: + static grub_err_t + grub_linux_boot (void) + { +- grub_efi_memory_mapped_device_path_t *mempath; +- grub_efi_handle_t image_handle; +- grub_efi_boot_services_t *b; +- grub_efi_status_t status; + grub_err_t retval; +- grub_efi_loaded_image_t *loaded_image; +- int len; + + retval = finalize_params(); + if (retval != GRUB_ERR_NONE) + return retval; + +- mempath = grub_malloc (2 * sizeof (grub_efi_memory_mapped_device_path_t)); +- if (!mempath) +- return grub_errno; +- +- mempath[0].header.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE; +- mempath[0].header.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE; +- mempath[0].header.length = grub_cpu_to_le16_compile_time (sizeof (*mempath)); +- mempath[0].memory_type = GRUB_EFI_LOADER_DATA; +- mempath[0].start_address = (grub_addr_t) kernel_addr; +- mempath[0].end_address = (grub_addr_t) kernel_addr + kernel_size; +- +- mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE; +- mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; +- mempath[1].header.length = sizeof (grub_efi_device_path_t); +- +- b = grub_efi_system_table->boot_services; +- status = b->load_image (0, grub_efi_image_handle, +- (grub_efi_device_path_t *) mempath, +- kernel_addr, kernel_size, &image_handle); +- if (status != GRUB_EFI_SUCCESS) +- return grub_error (GRUB_ERR_BAD_OS, "cannot load image"); +- + grub_dprintf ("linux", "linux command line: '%s'\n", linux_args); + +- /* Convert command line to UCS-2 */ +- loaded_image = grub_efi_get_loaded_image (image_handle); +- loaded_image->load_options_size = len = +- (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t); +- loaded_image->load_options = +- grub_efi_allocate_pages (0, +- BYTES_TO_PAGES (loaded_image->load_options_size)); +- if (!loaded_image->load_options) +- return grub_errno; ++ retval = grub_efi_linux_boot ((char *)kernel_addr, handover_offset, ++ kernel_addr); + +- loaded_image->load_options_size = +- 2 * grub_utf8_to_utf16 (loaded_image->load_options, len, +- (grub_uint8_t *) linux_args, len, NULL); +- +- grub_dprintf("linux", "starting image %p\n", image_handle); +- status = b->start_image (image_handle, 0, NULL); +- +- /* When successful, not reached */ +- b->unload_image (image_handle); +- grub_efi_free_pages ((grub_efi_physical_address_t) loaded_image->load_options, +- BYTES_TO_PAGES (loaded_image->load_options_size)); +- +- return grub_errno; ++ /* Never reached... */ ++ free_params(); ++ return retval; + } + + static grub_err_t +@@ -382,6 +379,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + { + grub_file_t file = 0; + struct grub_arm64_linux_kernel_header lh; ++ struct grub_arm64_linux_pe_header *pe; + + grub_dl_ref (my_mod); + +@@ -426,6 +424,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + grub_dprintf ("linux", "kernel @ %p\n", kernel_addr); + ++ if (!grub_linuxefi_secure_validate (kernel_addr, kernel_size)) ++ { ++ grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); ++ goto fail; ++ } ++ ++ pe = (void *)((unsigned long)kernel_addr + lh.hdr_offset); ++ handover_offset = pe->opt.entry_addr; ++ + cmdline_size = grub_loader_cmdline_size (argc, argv) + sizeof (LINUX_IMAGE); + linux_args = grub_malloc (cmdline_size); + if (!linux_args) +@@ -464,7 +471,6 @@ fail: + return grub_errno; + } + +- + static grub_command_t cmd_linux, cmd_initrd, cmd_devicetree; + + GRUB_MOD_INIT (linux) +diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c +new file mode 100644 +index 0000000..aea378a +--- /dev/null ++++ b/grub-core/loader/efi/linux.c +@@ -0,0 +1,65 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 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 ++ ++#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; ++ ++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 *, void *); ++ ++grub_err_t ++grub_efi_linux_boot (void *kernel_addr, grub_off_t offset, ++ void *kernel_params) ++{ ++ handover_func hf; ++ ++ hf = (handover_func)((char *)kernel_addr + offset); ++ hf (grub_efi_image_handle, grub_efi_system_table, kernel_params); ++ ++ return GRUB_ERR_BUG; ++} +diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c +index b79e632..e5b7785 100644 +--- a/grub-core/loader/i386/efi/linux.c ++++ b/grub-core/loader/i386/efi/linux.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -40,52 +41,18 @@ 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; ++ return grub_efi_linux_boot ((char *)kernel_mem, handover_offset + offset, ++ params); + } + + static grub_err_t +diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h +index 864e5dc..2cbd64f 100644 +--- a/include/grub/arm64/linux.h ++++ b/include/grub/arm64/linux.h +@@ -20,6 +20,7 @@ + #define GRUB_LINUX_CPU_HEADER 1 + + #include ++#include + + #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ + +@@ -38,4 +39,11 @@ struct grub_arm64_linux_kernel_header + grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ + }; + ++struct grub_arm64_linux_pe_header ++{ ++ grub_uint32_t magic; ++ struct grub_pe32_coff_header coff; ++ struct grub_pe64_optional_header opt; ++}; ++ + #endif /* ! GRUB_LINUX_CPU_HEADER */ +diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h +new file mode 100644 +index 0000000..d9ede36 +--- /dev/null ++++ b/include/grub/efi/linux.h +@@ -0,0 +1,31 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2014 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 . ++ */ ++#ifndef GRUB_EFI_LINUX_HEADER ++#define GRUB_EFI_LINUX_HEADER 1 ++ ++#include ++#include ++#include ++ ++grub_efi_boolean_t ++EXPORT_FUNC(grub_linuxefi_secure_validate) (void *data, grub_uint32_t size); ++grub_err_t ++EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset, ++ void *kernel_param); ++ ++#endif /* ! GRUB_EFI_LINUX_HEADER */ +-- +2.7.4 + diff --git a/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch b/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch new file mode 100644 index 0000000..1b042e0 --- /dev/null +++ b/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch @@ -0,0 +1,153 @@ +From b1c4268fc7b10a8febe2800256b6a6cbc1caf437 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 23 Sep 2014 09:58:49 -0400 +Subject: [PATCH 153/198] Fix up some man pages rpmdiff noticed. + +--- + configure.ac | 2 ++ + util/grub-macbless.8 | 26 +++++++++++++++++++ + util/grub-mkimage.1 | 2 +- + util/grub-syslinux2cfg.1 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 94 insertions(+), 1 deletion(-) + create mode 100644 util/grub-macbless.8 + create mode 100644 util/grub-syslinux2cfg.1 + +diff --git a/configure.ac b/configure.ac +index 53fd7c7..048ce7c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -76,6 +76,7 @@ grub_TRANSFORM([grub-fstest.3]) + grub_TRANSFORM([grub-glue-efi.3]) + grub_TRANSFORM([grub-install.1]) + grub_TRANSFORM([grub-kbdcomp.3]) ++grub_TRANSFORM([grub-macbless.8]) + grub_TRANSFORM([grub-menulst2cfg.1]) + grub_TRANSFORM([grub-mkconfig.1]) + grub_TRANSFORM([grub-mkfont.3]) +@@ -93,6 +94,7 @@ grub_TRANSFORM([grub-render-label.3]) + grub_TRANSFORM([grub-script-check.3]) + grub_TRANSFORM([grub-set-default.1]) + grub_TRANSFORM([grub-sparc64-setup.3]) ++grub_TRANSFORM([grub-syslinux2cfg.1]) + + # Optimization flag. Allow user to override. + if test "x$TARGET_CFLAGS" = x; then +diff --git a/util/grub-macbless.8 b/util/grub-macbless.8 +new file mode 100644 +index 0000000..ae842f3 +--- /dev/null ++++ b/util/grub-macbless.8 +@@ -0,0 +1,26 @@ ++.TH GRUB-MACBLESS 1 "Wed Feb 26 2014" ++.SH NAME ++\fBgrub-macbless\fR \(em Mac-style bless utility for HFS or HFS+ ++ ++.SH SYNOPSIS ++\fBgrub-macbless\fR [-p | --ppc] [-v | --verbose] [-x | --x86] \fIFILE\fR ++ ++.SH DESCRIPTION ++\fBgrub-mkimage\fR blesses a file on an HFS or HFS+ file system, so that it ++can be used to boot a Mac. ++ ++.SH OPTIONS ++.TP ++--ppc ++Bless the file for use on PPC-based Macs. ++ ++.TP ++--verbose ++Print verbose messages. ++ ++.TP ++--x86 ++Bless the file for use on x86-based Macs. ++ ++.SH SEE ALSO ++.BR "info grub" +diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 +index 4dea4f5..0eaaafe 100644 +--- a/util/grub-mkimage.1 ++++ b/util/grub-mkimage.1 +@@ -17,7 +17,7 @@ + [-v | --verbose] \fIMODULES\fR + + .SH DESCRIPTION +-\fBgrub-mkimage\fI builds a bootable image of GRUB. ++\fBgrub-mkimage\fR builds a bootable image of GRUB. + + .SH OPTIONS + .TP +diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1 +new file mode 100644 +index 0000000..8530948 +--- /dev/null ++++ b/util/grub-syslinux2cfg.1 +@@ -0,0 +1,65 @@ ++.TH GRUB-SYSLINUX2CFG 1 "Wed Feb 26 2014" ++.SH NAME ++\fBgrub-syslinux2cfg\fR \(em Transform a syslinux config file into a GRUB config. ++ ++.SH SYNOPSIS ++\fBgrub-syslinux2cfg\fR [-c | --cwd=\fRDIR\fI] [-r | --root=\fIDIR\fR] [-v | --verbose] ++.RE ++.RS 25 ++[-t | --target-root=\fIDIR\fR] [-T | --target-cwd=\fIDIR\fR] ++.RE ++.RS 25 ++[-o | --output=\fIFILE\fR] [[-i | --isolinux] | ++.RE ++.RS 46 ++ [-s | --syslinux] | ++.RE ++.RS 46 ++ [-p | --pxelinux]] \fIFILE\fR ++ ++.SH DESCRIPTION ++\fBgrub-syslinux2cfg\fR builds a GRUB configuration file out of an existing ++syslinux configuration file. ++ ++.SH OPTIONS ++.TP ++--cwd=\fIDIR\fR ++Set \fIDIR\fR as syslinux's working directory. The default is to use the ++parent directory of the input file. ++ ++.TP ++--root=\fIDIR\fR ++Set \fIDIR\fR as the root directory of the syslinux disk. The default value ++is "/". ++ ++.TP ++--verbose ++Print verbose messages. ++ ++.TP ++--target-root=\fIDIR\fR ++Root directory as it will be seen at runtime. The default value is "/". ++ ++.TP ++--target-cwd=\fIDIR\fR ++Working directory of syslinux as it will be seen at runtime. The default ++value is the parent directory of the input file. ++ ++.TP ++--output=\fIFILE\fR ++Write the new config file to \fIFILE\fR. The default value is standard output. ++ ++.TP ++--isolinux ++Assume that the input file is an isolinux configuration file. ++ ++.TP ++--pxelinux ++Assume that the input file is a pxelinux configuration file. ++ ++.TP ++--syslinux ++Assume that the input file is a syslinux configuration file. ++ ++.SH SEE ALSO ++.BR "info grub" +-- +2.7.4 + diff --git a/SOURCES/0154-Try-prefix-if-fw_path-doesn-t-work.patch b/SOURCES/0154-Try-prefix-if-fw_path-doesn-t-work.patch new file mode 100644 index 0000000..f10f9f1 --- /dev/null +++ b/SOURCES/0154-Try-prefix-if-fw_path-doesn-t-work.patch @@ -0,0 +1,211 @@ +From 6d94c560ac4fa7bf0b8db3a37b414cc188fe4376 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Fri, 3 Oct 2014 11:08:03 -0400 +Subject: [PATCH 154/198] Try $prefix if $fw_path doesn't work. + +Related: rhbz#1148652 + +Signed-off-by: Peter Jones +--- + grub-core/kern/ieee1275/init.c | 30 ++++++----- + grub-core/net/net.c | 2 +- + grub-core/normal/main.c | 118 ++++++++++++++++++++--------------------- + 3 files changed, 75 insertions(+), 75 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 8191f8c..8ca4bf7 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -131,23 +131,25 @@ grub_machine_get_bootlocation (char **device, char **path) + grub_free (canon); + } + else +- *device = grub_ieee1275_encode_devname (bootpath); +- grub_free (type); +- +- filename = grub_ieee1275_get_filename (bootpath); +- if (filename) + { +- char *lastslash = grub_strrchr (filename, '\\'); +- +- /* Truncate at last directory. */ +- if (lastslash) ++ filename = grub_ieee1275_get_filename (bootpath); ++ if (filename) + { +- *lastslash = '\0'; +- grub_translate_ieee1275_path (filename); +- +- *path = filename; +- } ++ char *lastslash = grub_strrchr (filename, '\\'); ++ ++ /* Truncate at last directory. */ ++ if (lastslash) ++ { ++ *lastslash = '\0'; ++ grub_translate_ieee1275_path (filename); ++ ++ *path = filename; ++ } ++ } ++ *device = grub_ieee1275_encode_devname (bootpath); + } ++ ++ grub_free (type); + grub_free (bootpath); + } + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 578e057..10bfed3 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -1817,7 +1817,7 @@ grub_net_search_configfile (char *config) + /* Remove the remaining minus sign at the end. */ + config[config_len] = '\0'; + +- return GRUB_ERR_NONE; ++ return GRUB_ERR_FILE_NOT_FOUND; + } + + static struct grub_preboot *fini_hnd; +diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c +index 4190985..aa14499 100644 +--- a/grub-core/normal/main.c ++++ b/grub-core/normal/main.c +@@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config) + grub_boot_time ("Exiting normal mode"); + } + ++static grub_err_t ++grub_try_normal (const char *variable) ++{ ++ char *config; ++ const char *prefix; ++ grub_err_t err = GRUB_ERR_FILE_NOT_FOUND; ++ ++ prefix = grub_env_get (variable); ++ if (!prefix) ++ return GRUB_ERR_FILE_NOT_FOUND; ++ ++ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) ++ { ++ 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) ++ return GRUB_ERR_FILE_NOT_FOUND; ++ ++ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); ++ err = grub_net_search_configfile (config); ++ } ++ ++ if (err != GRUB_ERR_NONE) ++ { ++ config = grub_xasprintf ("%s/grub.cfg", prefix); ++ if (config) ++ { ++ grub_file_t file; ++ file = grub_file_open (config); ++ if (file) ++ { ++ grub_file_close (file); ++ err = GRUB_ERR_NONE; ++ } ++ } ++ } ++ ++ if (err == GRUB_ERR_NONE) ++ grub_enter_normal_mode (config); ++ ++ grub_errno = 0; ++ grub_free (config); ++ return err; ++} ++ + /* Enter normal mode from rescue mode. */ + static grub_err_t + grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) + { +- if (argc == 0) ++ if (argc) ++ grub_enter_normal_mode (argv[0]); ++ else + { +- /* 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; +- +- prefix = grub_env_get ("fw_path"); +- if (! prefix) +- prefix = grub_env_get ("prefix"); +- +- if (prefix) +- { +- if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) +- { +- 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); +- +- grub_net_search_configfile (config); +- +- grub_enter_normal_mode (config); +- grub_free (config); +- config = NULL; +- } +- +- if (!config) +- { +- config = grub_xasprintf ("%s/grub.cfg", prefix); +- 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); +- } +- } +- } +- else +- { +- grub_enter_normal_mode (0); +- } ++ /* Guess the config filename. */ ++ grub_err_t err; ++ err = grub_try_normal ("fw_path"); ++ if (err == GRUB_ERR_FILE_NOT_FOUND) ++ err = grub_try_normal ("prefix"); ++ if (err == GRUB_ERR_FILE_NOT_FOUND) ++ grub_enter_normal_mode (0); + } +- else +- grub_enter_normal_mode (argv[0]); + +-quit: + return 0; + } + +-- +2.7.4 + diff --git a/SOURCES/0155-Update-info-with-grub.cfg-netboot-selection-order-11.patch b/SOURCES/0155-Update-info-with-grub.cfg-netboot-selection-order-11.patch new file mode 100644 index 0000000..5e00d7c --- /dev/null +++ b/SOURCES/0155-Update-info-with-grub.cfg-netboot-selection-order-11.patch @@ -0,0 +1,70 @@ +From 24f034631df06b2f33d0721b8cd5126906aa7b34 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 16 Mar 2015 16:34:51 -0400 +Subject: [PATCH 155/198] Update info with grub.cfg netboot selection order + (#1148650) + +Added documentation to the grub info page that specifies the order +netboot clients will use to select a grub configuration file. + +Resolves rhbz#1148650 +--- + docs/grub.texi | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 6b112c1..ef09c83 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -2414,6 +2414,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38 + Then follow instructions printed out by grub-mknetdir on configuring your DHCP + server. + ++The grub.cfg file is placed in the same directory as the path output by ++grub-mknetdir hereafter referred to as FWPATH. GRUB will search for its ++configuration files in order using the following rules where the appended ++value corresponds to a value on the client machine. ++ ++@example ++@group ++@samp{(FWPATH)}/grub.cfg-@samp{(UUID OF NIC)} ++@samp{(FWPATH)}/grub.cfg-@samp{(MAC ADDRESS OF NIC)} ++@samp{(FWPATH)}/grub.cfg-@samp{(IPv4 OR IPv6 ADDRESS)} ++@samp{(FWPATH)}/grub.cfg ++@end group ++@end example ++ ++The client will only attempt to look up an IPv6 address config once, however, ++it will try the IPv4 multiple times. The concrete example below shows what ++would happen under the IPv4 case. ++ ++@example ++@group ++UUID: 7726a678-7fc0-4853-a4f6-c85ac36a120a ++MAC: 52:54:00:ec:33:81 ++IPV4: 10.0.0.130 (0A000082) ++@end group ++@end example ++ ++@example ++@group ++@samp{(FWPATH)}/grub.cfg-7726a678-7fc0-4853-a4f6-c85ac36a120a ++@samp{(FWPATH)}/grub.cfg-52-54-00-ec-33-81 ++@samp{(FWPATH)}/grub.cfg-0A000082 ++@samp{(FWPATH)}/grub.cfg-0A00008 ++@samp{(FWPATH)}/grub.cfg-0A0000 ++@samp{(FWPATH)}/grub.cfg-0A000 ++@samp{(FWPATH)}/grub.cfg-0A00 ++@samp{(FWPATH)}/grub.cfg-0A0 ++@samp{(FWPATH)}/grub.cfg-0A ++@samp{(FWPATH)}/grub.cfg-0 ++@samp{(FWPATH)}/grub.cfg ++@end group ++@end example ++ + After GRUB has started, files on the TFTP server will be accessible via the + @samp{(tftp)} device. + +-- +2.7.4 + diff --git a/SOURCES/0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch b/SOURCES/0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch new file mode 100644 index 0000000..00a9866 --- /dev/null +++ b/SOURCES/0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch @@ -0,0 +1,450 @@ +From 57df7233ae3789f525b8d7e910bf1e3ffe50ac87 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 16 Mar 2015 14:14:19 -0400 +Subject: [PATCH 156/198] Use Distribution Package Sort for grub2-mkconfig + (#1124074) + +Users reported that newly installed kernels on their systems installed +with grub-mkconfig would not appear on the grub boot list in order +starting with the most recent. Added an option for rpm-based systems to +use the rpm-sort library to sort kernels instead. + +Resolves rhbz#1124074 +--- + .gitignore | 1 + + Makefile.util.def | 16 +++ + configure.ac | 29 +++++ + util/grub-mkconfig_lib.in | 8 +- + util/grub-rpm-sort.8 | 12 ++ + util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 346 insertions(+), 1 deletion(-) + create mode 100644 util/grub-rpm-sort.8 + create mode 100644 util/grub-rpm-sort.c + +diff --git a/.gitignore b/.gitignore +index 18ab8e8..b6c4577 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -237,6 +237,7 @@ po/POTFILES.in + po/POTFILES-shell.in + /grub-glue-efi + /grub-render-label ++grub-rpm-sort + /grub-glue-efi.exe + /grub-render-label.exe + grub-core/gnulib/locale.h +diff --git a/Makefile.util.def b/Makefile.util.def +index 87029a1..3ac7572 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -675,6 +675,22 @@ program = { + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; + ++program = { ++ name = grub-rpm-sort; ++ mansection = 8; ++ installdir = sbin; ++ ++ common = grub-core/kern/emu/misc.c; ++ common = grub-core/kern/emu/argp_common.c; ++ common = grub-core/osdep/init.c; ++ common = util/misc.c; ++ common = util/grub-rpm-sort.c; ++ ++ ldadd = grub-core/gnulib/libgnu.a; ++ ldadd = libgrubkern.a; ++ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; ++}; ++ + script = { + name = grub-mkconfig; + common = util/grub-mkconfig.in; +diff --git a/configure.ac b/configure.ac +index 048ce7c..de17e65 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) + grub_TRANSFORM([grub-mkrescue]) + grub_TRANSFORM([grub-probe]) + grub_TRANSFORM([grub-reboot]) ++grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) + grub_TRANSFORM([grub-sparc64-setup]) +@@ -89,6 +90,7 @@ grub_TRANSFORM([grub-mkrescue.1]) + grub_TRANSFORM([grub-mkstandalone.3]) + grub_TRANSFORM([grub-ofpathname.3]) + grub_TRANSFORM([grub-probe.3]) ++grub_TRANSFORM([grub-rpm-sort.8]) + grub_TRANSFORM([grub-reboot.3]) + grub_TRANSFORM([grub-render-label.3]) + grub_TRANSFORM([grub-script-check.3]) +@@ -1543,6 +1545,33 @@ fi + + AC_SUBST([LIBDEVMAPPER]) + ++AC_ARG_ENABLE([rpm-sort], ++ [AS_HELP_STRING([--enable-rpm-sort], ++ [enable native rpm sorting of kernels in grub (default=guessed)])]) ++if test x"$enable_rpm-sort" = xno ; then ++ rpm_sort_excuse="explicitly disabled" ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ # Check for rpmlib header. ++ AC_CHECK_HEADER([rpm/rpmlib.h], [], ++ [rpm_sort_excuse="need rpm/rpmlib header"]) ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ # Check for rpm library. ++ AC_CHECK_LIB([rpm], [rpmvercmp], [], ++ [rpm_sort_excuse="rpmlib missing rpmvercmp"]) ++fi ++ ++if test x"$rpm_sort_excuse" = x ; then ++ LIBRPM="-lrpm"; ++ AC_DEFINE([HAVE_RPM], [1], ++ [Define to 1 if you have the rpm library.]) ++fi ++ ++AC_SUBST([LIBRPM]) ++ + LIBGEOM= + if test x$host_kernel = xkfreebsd; then + AC_CHECK_LIB([geom], [geom_gettree], [], +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 5c9ed84..e85b60c 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -213,6 +213,12 @@ version_sort () + esac + } + ++if [ "x$RPMLIB" = x ]; then ++ kernel_sort=version_sort ++else ++ kernel_sort="${sbindir}/grub-rpm-sort" ++fi ++ + version_test_numeric () + { + version_test_numeric_a="$1" +@@ -229,7 +235,7 @@ version_test_numeric () + version_test_numeric_a="$version_test_numeric_b" + version_test_numeric_b="$version_test_numeric_c" + fi +- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then ++ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then + return 0 + else + return 1 +diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8 +new file mode 100644 +index 0000000..8ce2148 +--- /dev/null ++++ b/util/grub-rpm-sort.8 +@@ -0,0 +1,12 @@ ++.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014" ++.SH NAME ++\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare. ++ ++.SH SYNOPSIS ++\fBgrub-rpm-sort\fR [OPTIONS]. ++ ++.SH DESCRIPTION ++You should not normally run this program directly. Use grub-mkconfig instead. ++ ++.SH SEE ALSO ++.BR "info grub" +diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c +new file mode 100644 +index 0000000..f33bd1e +--- /dev/null ++++ b/util/grub-rpm-sort.c +@@ -0,0 +1,281 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static size_t ++read_file (const char *input, char **ret) ++{ ++ FILE *in; ++ size_t s; ++ size_t sz = 2048; ++ size_t offset = 0; ++ char *text; ++ ++ if (!strcmp(input, "-")) ++ in = stdin; ++ else ++ in = grub_util_fopen(input, "r"); ++ ++ text = xmalloc (sz); ++ ++ if (!in) ++ grub_util_error (_("cannot open `%s': %s"), input, strerror (errno)); ++ ++ while ((s = fread (text + offset, 1, sz - offset, in)) != 0) ++ { ++ offset += s; ++ if (sz - offset == 0) ++ { ++ sz += 2048; ++ text = xrealloc (text, sz); ++ } ++ } ++ ++ text[offset] = '\0'; ++ *ret = text; ++ ++ if (in != stdin) ++ fclose(in); ++ ++ return offset + 1; ++} ++ ++/* returns name/version/release */ ++/* NULL string pointer returned if nothing found */ ++static void ++split_package_string (char *package_string, char **name, ++ char **version, char **release) ++{ ++ char *package_version, *package_release; ++ ++ /* Release */ ++ package_release = strrchr (package_string, '-'); ++ ++ if (package_release != NULL) ++ *package_release++ = '\0'; ++ ++ *release = package_release; ++ ++ /* Version */ ++ package_version = strrchr(package_string, '-'); ++ ++ if (package_version != NULL) ++ *package_version++ = '\0'; ++ ++ *version = package_version; ++ /* Name */ ++ *name = package_string; ++ ++ /* Bubble up non-null values from release to name */ ++ if (*name == NULL) ++ { ++ *name = (*version == NULL ? *release : *version); ++ *version = *release; ++ *release = NULL; ++ } ++ if (*version == NULL) ++ { ++ *version = *release; ++ *release = NULL; ++ } ++} ++ ++/* ++ * package name-version-release comparator for qsort ++ * expects p, q which are pointers to character strings (char *) ++ * which will not be altered in this function ++ */ ++static int ++package_version_compare (const void *p, const void *q) ++{ ++ char *local_p, *local_q; ++ char *lhs_name, *lhs_version, *lhs_release; ++ char *rhs_name, *rhs_version, *rhs_release; ++ int vercmpflag = 0; ++ ++ local_p = alloca (strlen (*(char * const *)p) + 1); ++ local_q = alloca (strlen (*(char * const *)q) + 1); ++ ++ /* make sure these allocated */ ++ assert (local_p); ++ assert (local_q); ++ ++ strcpy (local_p, *(char * const *)p); ++ strcpy (local_q, *(char * const *)q); ++ ++ split_package_string (local_p, &lhs_name, &lhs_version, &lhs_release); ++ split_package_string (local_q, &rhs_name, &rhs_version, &rhs_release); ++ ++ /* Check Name and return if unequal */ ++ vercmpflag = rpmvercmp ((lhs_name == NULL ? "" : lhs_name), ++ (rhs_name == NULL ? "" : rhs_name)); ++ if (vercmpflag != 0) ++ return vercmpflag; ++ ++ /* Check version and return if unequal */ ++ vercmpflag = rpmvercmp ((lhs_version == NULL ? "" : lhs_version), ++ (rhs_version == NULL ? "" : rhs_version)); ++ if (vercmpflag != 0) ++ return vercmpflag; ++ ++ /* Check release and return the version compare value */ ++ vercmpflag = rpmvercmp ((lhs_release == NULL ? "" : lhs_release), ++ (rhs_release == NULL ? "" : rhs_release)); ++ ++ return vercmpflag; ++} ++ ++static void ++add_input (const char *filename, char ***package_names, size_t *n_package_names) ++{ ++ char *orig_input_buffer = NULL; ++ char *input_buffer; ++ char *position_of_newline; ++ char **names = *package_names; ++ char **new_names = NULL; ++ size_t n_names = *n_package_names; ++ ++ if (!*package_names) ++ new_names = names = xmalloc (sizeof (char *) * 2); ++ ++ if (read_file (filename, &orig_input_buffer) < 2) ++ { ++ if (new_names) ++ free (new_names); ++ if (orig_input_buffer) ++ free (orig_input_buffer); ++ return; ++ } ++ ++ input_buffer = orig_input_buffer; ++ while (input_buffer && *input_buffer && ++ (position_of_newline = strchrnul (input_buffer, '\n'))) ++ { ++ size_t sz = position_of_newline - input_buffer; ++ char *new; ++ ++ if (sz == 0) ++ { ++ input_buffer = position_of_newline + 1; ++ continue; ++ } ++ ++ new = xmalloc (sz+1); ++ strncpy (new, input_buffer, sz); ++ new[sz] = '\0'; ++ ++ names = xrealloc (names, sizeof (char *) * (n_names + 1)); ++ names[n_names] = new; ++ n_names++; ++ ++ /* move buffer ahead to next line */ ++ input_buffer = position_of_newline + 1; ++ if (*position_of_newline == '\0') ++ input_buffer = NULL; ++ } ++ ++ free (orig_input_buffer); ++ ++ *package_names = names; ++ *n_package_names = n_names; ++} ++ ++static char * ++help_filter (int key, const char *text, void *input __attribute__ ((unused))) ++{ ++ return (char *)text; ++} ++ ++static struct argp_option options[] = { ++ { 0, } ++}; ++ ++struct arguments ++{ ++ size_t ninputs; ++ size_t input_max; ++ char **inputs; ++}; ++ ++static error_t ++argp_parser (int key, char *arg, struct argp_state *state) ++{ ++ struct arguments *arguments = state->input; ++ switch (key) ++ { ++ case ARGP_KEY_ARG: ++ assert (arguments->ninputs < arguments->input_max); ++ arguments->inputs[arguments->ninputs++] = xstrdup (arg); ++ break; ++ default: ++ return ARGP_ERR_UNKNOWN; ++ } ++ return 0; ++} ++ ++static struct argp argp = { ++ options, argp_parser, N_("[INPUT_FILES]"), ++ N_("Sort a list of strings in RPM version sort order."), ++ NULL, help_filter, NULL ++}; ++ ++int ++main (int argc, char *argv[]) ++{ ++ struct arguments arguments; ++ char **package_names = NULL; ++ size_t n_package_names = 0; ++ int i; ++ ++ grub_util_host_init (&argc, &argv); ++ ++ memset (&arguments, 0, sizeof (struct arguments)); ++ arguments.input_max = argc+1; ++ arguments.inputs = xmalloc ((arguments.input_max + 1) ++ * sizeof (arguments.inputs[0])); ++ memset (arguments.inputs, 0, (arguments.input_max + 1) ++ * sizeof (arguments.inputs[0])); ++ ++ /* Parse our arguments */ ++ if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) ++ grub_util_error ("%s", _("Error in parsing command line arguments\n")); ++ ++ /* If there's no inputs in argv, add one for stdin */ ++ if (!arguments.ninputs) ++ { ++ arguments.ninputs = 1; ++ arguments.inputs[0] = xmalloc (2); ++ strcpy(arguments.inputs[0], "-"); ++ } ++ ++ for (i = 0; i < arguments.ninputs; i++) ++ add_input(arguments.inputs[i], &package_names, &n_package_names); ++ ++ if (package_names == NULL || n_package_names < 1) ++ grub_util_error ("%s", _("Invalid input\n")); ++ ++ qsort (package_names, n_package_names, sizeof (char *), ++ package_version_compare); ++ ++ /* send sorted list to stdout */ ++ for (i = 0; i < n_package_names; i++) ++ { ++ fprintf (stdout, "%s\n", package_names[i]); ++ free (package_names[i]); ++ } ++ ++ free (package_names); ++ for (i = 0; i < arguments.ninputs; i++) ++ free (arguments.inputs[i]); ++ ++ free (arguments.inputs); ++ ++ return 0; ++} +-- +2.7.4 + diff --git a/SOURCES/0157-efidisk-move-device-path-helpers-in-core-for-efinet.patch b/SOURCES/0157-efidisk-move-device-path-helpers-in-core-for-efinet.patch new file mode 100644 index 0000000..674cfe9 --- /dev/null +++ b/SOURCES/0157-efidisk-move-device-path-helpers-in-core-for-efinet.patch @@ -0,0 +1,207 @@ +From 559b04c2e29643b73f238cf95add8cef9a192a00 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:37:16 +0300 +Subject: [PATCH 157/198] efidisk: move device path helpers in core for efinet + +--- + grub-core/disk/efi/efidisk.c | 61 ++++++++------------------------------------ + grub-core/kern/efi/efi.c | 41 +++++++++++++++++++++++++++++ + include/grub/efi/efi.h | 4 +++ + 3 files changed, 55 insertions(+), 51 deletions(-) + +diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c +index 3b12c34..845c66f 100644 +--- a/grub-core/disk/efi/efidisk.c ++++ b/grub-core/disk/efi/efidisk.c +@@ -43,47 +43,6 @@ static struct grub_efidisk_data *fd_devices; + static struct grub_efidisk_data *hd_devices; + static struct grub_efidisk_data *cd_devices; + +-/* Duplicate a device path. */ +-static grub_efi_device_path_t * +-duplicate_device_path (const grub_efi_device_path_t *dp) +-{ +- grub_efi_device_path_t *p; +- grub_size_t total_size = 0; +- +- for (p = (grub_efi_device_path_t *) dp; +- ; +- p = GRUB_EFI_NEXT_DEVICE_PATH (p)) +- { +- total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); +- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) +- break; +- } +- +- p = grub_malloc (total_size); +- if (! p) +- return 0; +- +- grub_memcpy (p, dp, total_size); +- return p; +-} +- +-/* Return the device path node right before the end node. */ +-static grub_efi_device_path_t * +-find_last_device_path (const grub_efi_device_path_t *dp) +-{ +- grub_efi_device_path_t *next, *p; +- +- if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) +- return 0; +- +- for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); +- ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); +- p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) +- ; +- +- return p; +-} +- + static struct grub_efidisk_data * + make_devices (void) + { +@@ -110,7 +69,7 @@ make_devices (void) + if (! dp) + continue; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + if (! ldp) + /* This is empty. Why? */ + continue; +@@ -150,11 +109,11 @@ find_parent_device (struct grub_efidisk_data *devices, + grub_efi_device_path_t *dp, *ldp; + struct grub_efidisk_data *parent; + +- dp = duplicate_device_path (d->device_path); ++ dp = grub_efi_duplicate_device_path (d->device_path); + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp->length = sizeof (*ldp); +@@ -180,11 +139,11 @@ is_child (struct grub_efidisk_data *child, + grub_efi_device_path_t *dp, *ldp; + int ret; + +- dp = duplicate_device_path (child->device_path); ++ dp = grub_efi_duplicate_device_path (child->device_path); + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; + ldp->length = sizeof (*ldp); +@@ -207,8 +166,8 @@ add_device (struct grub_efidisk_data **devices, struct grub_efidisk_data *d) + { + int ret; + +- ret = grub_efi_compare_device_paths (find_last_device_path ((*p)->device_path), +- find_last_device_path (d->device_path)); ++ ret = grub_efi_compare_device_paths (grub_efi_find_last_device_path ((*p)->device_path), ++ grub_efi_find_last_device_path (d->device_path)); + if (ret == 0) + ret = grub_efi_compare_device_paths ((*p)->device_path, + d->device_path); +@@ -795,7 +754,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + if (! dp) + return 0; + +- ldp = find_last_device_path (dp); ++ ldp = grub_efi_find_last_device_path (dp); + if (! ldp) + return 0; + +@@ -811,14 +770,14 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) + + /* It is necessary to duplicate the device path so that GRUB + can overwrite it. */ +- dup_dp = duplicate_device_path (dp); ++ dup_dp = grub_efi_duplicate_device_path (dp); + if (! dup_dp) + return 0; + + while (1) + { + grub_efi_device_path_t *dup_ldp; +- dup_ldp = find_last_device_path (dup_dp); ++ dup_ldp = grub_efi_find_last_device_path (dup_dp); + if (!(GRUB_EFI_DEVICE_PATH_TYPE (dup_ldp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE + && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE + || GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE))) +diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c +index d99a6fb..c80d85b 100644 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -423,6 +423,47 @@ grub_efi_get_device_path (grub_efi_handle_t handle) + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + } + ++/* Return the device path node right before the end node. */ ++grub_efi_device_path_t * ++grub_efi_find_last_device_path (const grub_efi_device_path_t *dp) ++{ ++ grub_efi_device_path_t *next, *p; ++ ++ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) ++ return 0; ++ ++ for (p = (grub_efi_device_path_t *) dp, next = GRUB_EFI_NEXT_DEVICE_PATH (p); ++ ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (next); ++ p = next, next = GRUB_EFI_NEXT_DEVICE_PATH (next)) ++ ; ++ ++ return p; ++} ++ ++/* Duplicate a device path. */ ++grub_efi_device_path_t * ++grub_efi_duplicate_device_path (const grub_efi_device_path_t *dp) ++{ ++ grub_efi_device_path_t *p; ++ grub_size_t total_size = 0; ++ ++ for (p = (grub_efi_device_path_t *) dp; ++ ; ++ p = GRUB_EFI_NEXT_DEVICE_PATH (p)) ++ { ++ total_size += GRUB_EFI_DEVICE_PATH_LENGTH (p); ++ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (p)) ++ break; ++ } ++ ++ p = grub_malloc (total_size); ++ if (! p) ++ return 0; ++ ++ grub_memcpy (p, dp, total_size); ++ return p; ++} ++ + static void + dump_vendor_path (const char *type, grub_efi_vendor_device_path_t *vendor) + { +diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h +index a000c38..2245632 100644 +--- a/include/grub/efi/efi.h ++++ b/include/grub/efi/efi.h +@@ -56,6 +56,10 @@ void EXPORT_FUNC(grub_efi_print_device_path) (grub_efi_device_path_t *dp); + char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); + grub_efi_device_path_t * + EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); ++grub_efi_device_path_t * ++EXPORT_FUNC(grub_efi_find_last_device_path) (const grub_efi_device_path_t *dp); ++grub_efi_device_path_t * ++EXPORT_FUNC(grub_efi_duplicate_device_path) (const grub_efi_device_path_t *dp); + grub_err_t EXPORT_FUNC (grub_efi_finish_boot_services) (grub_efi_uintn_t *outbuf_size, void *outbuf, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *efi_desc_size, +-- +2.7.4 + diff --git a/SOURCES/0158-efinet-Check-for-immediate-completition.patch b/SOURCES/0158-efinet-Check-for-immediate-completition.patch index cfd04c1..e6d4d63 100644 --- a/SOURCES/0158-efinet-Check-for-immediate-completition.patch +++ b/SOURCES/0158-efinet-Check-for-immediate-completition.patch @@ -1,7 +1,7 @@ From 763eff26748ca3d2ae8b178aef15da54a70527a5 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Fri, 27 Mar 2015 14:27:56 +0100 -Subject: [PATCH 01/23] efinet: Check for immediate completition. +Subject: [PATCH 158/198] efinet: Check for immediate completition. This both speeds GRUB up and workarounds unexpected EFI behaviour. --- @@ -47,5 +47,5 @@ index a6e4c79..78df215 100644 } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0159-efinet-memory-leak-on-module-removal.patch b/SOURCES/0159-efinet-memory-leak-on-module-removal.patch index 7eec92a..563b6a9 100644 --- a/SOURCES/0159-efinet-memory-leak-on-module-removal.patch +++ b/SOURCES/0159-efinet-memory-leak-on-module-removal.patch @@ -1,7 +1,7 @@ From 8471c374d9379ba80e4b3bbcacb4813a2d04f008 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 08:08:57 +0300 -Subject: [PATCH 02/23] efinet: memory leak on module removal +Subject: [PATCH 159/198] efinet: memory leak on module removal --- grub-core/net/drivers/efi/efinet.c | 8 +++++++- @@ -26,5 +26,5 @@ index 78df215..810adf3 100644 } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch b/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch index cdc8b49..8890d90 100644 --- a/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch +++ b/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch @@ -1,7 +1,7 @@ From fe8c0ca495c7225682e2af47d0d77b4ad0077f34 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 08:39:29 +0300 -Subject: [PATCH 03/23] efinet: cannot free const char * pointer +Subject: [PATCH 160/198] efinet: cannot free const char * pointer --- grub-core/net/drivers/efi/efinet.c | 2 +- @@ -21,5 +21,5 @@ index 810adf3..bb863e6 100644 } } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0161-Revert-efinet-memory-leak-on-module-removal.patch b/SOURCES/0161-Revert-efinet-memory-leak-on-module-removal.patch index 284c4b5..1722af6 100644 --- a/SOURCES/0161-Revert-efinet-memory-leak-on-module-removal.patch +++ b/SOURCES/0161-Revert-efinet-memory-leak-on-module-removal.patch @@ -1,7 +1,7 @@ From 41772bb7633fab5e38f0dac90e1e04538a066a3d Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 09:13:53 +0300 -Subject: [PATCH 04/23] Revert "efinet: memory leak on module removal" +Subject: [PATCH 161/198] Revert "efinet: memory leak on module removal" This reverts commits 47b2bee3ef0ea60fc3f5bfc37f3784e559385297 and 8d3c4544ffdd0289a4b0bdeb0cdc6355f801a4b3. It is not safe @@ -30,5 +30,5 @@ index bb863e6..78df215 100644 } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch b/SOURCES/0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch index f280428..839bd67 100644 --- a/SOURCES/0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch +++ b/SOURCES/0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch @@ -1,7 +1,7 @@ From 0faa80b06bc1e9956d7ee6aa3b23574b7c4c18c8 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:37:17 +0300 -Subject: [PATCH 05/23] efinet: skip virtual IPv4 and IPv6 devices when +Subject: [PATCH 162/198] efinet: skip virtual IPv4 and IPv6 devices when enumerating cards EDK2 PXE driver creates two child devices - IPv4 and IPv6 - with @@ -93,5 +93,5 @@ index 78df215..caa7b50 100644 GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! pxe) -- -2.4.3 +2.7.4 diff --git a/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch b/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch index 608f8cb..c8cdfd7 100644 --- a/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch +++ b/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch @@ -1,7 +1,7 @@ From 0a84c5c3f0a50115372a61c68cc752367d669b07 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:37:17 +0300 -Subject: [PATCH 06/23] efinet: open Simple Network Protocol exclusively +Subject: [PATCH 163/198] efinet: open Simple Network Protocol exclusively EDK2 network stack is based on Managed Network Protocol which is layered on top of Simple Management Protocol and does background polling. This @@ -85,5 +85,5 @@ index caa7b50..6a1dd1f 100644 .recv = get_card_packet }; -- -2.4.3 +2.7.4 diff --git a/SOURCES/0164-efinet-enable-hardware-filters-when-opening-interfac.patch b/SOURCES/0164-efinet-enable-hardware-filters-when-opening-interfac.patch index 4c91618..c95b6f4 100644 --- a/SOURCES/0164-efinet-enable-hardware-filters-when-opening-interfac.patch +++ b/SOURCES/0164-efinet-enable-hardware-filters-when-opening-interfac.patch @@ -1,7 +1,8 @@ From 2c38daa48daebd9b5ebfbb94a9c451b00c9f251c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 16 Jun 2015 19:52:45 +0300 -Subject: [PATCH 07/23] efinet: enable hardware filters when opening interface +Subject: [PATCH 164/198] efinet: enable hardware filters when opening + interface Exclusive open on SNP will close all existing protocol instances which may disable all receive filters on interface. Reinstall them after we @@ -103,5 +104,5 @@ index 1423403..029ee92 100644 void (*statistics) (void); void (*mcastiptomac) (void); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0165-efinet-handle-get_status-on-buggy-firmware-properly.patch b/SOURCES/0165-efinet-handle-get_status-on-buggy-firmware-properly.patch index 803a5ab..8305371 100644 --- a/SOURCES/0165-efinet-handle-get_status-on-buggy-firmware-properly.patch +++ b/SOURCES/0165-efinet-handle-get_status-on-buggy-firmware-properly.patch @@ -1,7 +1,8 @@ From 17bd27e298d2b27859c8c6ee2e654d8f03988c42 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 6 Aug 2015 10:49:46 -0700 -Subject: [PATCH 08/23] efinet: handle get_status() on buggy firmware properly +Subject: [PATCH 165/198] efinet: handle get_status() on buggy firmware + properly The EFI spec indicates that get_status() should return the address of the buffer we passed into transmit to indicate the the buffer was transmitted. However we @@ -62,5 +63,5 @@ index 7b8c4a5..ea0e0ca 100644 return GRUB_ERR_NONE; } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0166-Handle-rssd-storage-devices.patch b/SOURCES/0166-Handle-rssd-storage-devices.patch index 14754c7..fab6ff4 100644 --- a/SOURCES/0166-Handle-rssd-storage-devices.patch +++ b/SOURCES/0166-Handle-rssd-storage-devices.patch @@ -1,7 +1,7 @@ From 1ab087435c259702c62fdfe85e28f3e3f2459266 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 Jun 2015 15:50:41 -0400 -Subject: [PATCH 09/23] Handle rssd storage devices. +Subject: [PATCH 166/198] Handle rssd storage devices. Resolves: rhbz#1087962 @@ -35,5 +35,5 @@ index 7007193..5987d07 100644 if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9') { -- -2.4.3 +2.7.4 diff --git a/SOURCES/0167-xfs-Fix-termination-loop-for-directory-iteration.patch b/SOURCES/0167-xfs-Fix-termination-loop-for-directory-iteration.patch index 6f4521b..7101b96 100644 --- a/SOURCES/0167-xfs-Fix-termination-loop-for-directory-iteration.patch +++ b/SOURCES/0167-xfs-Fix-termination-loop-for-directory-iteration.patch @@ -1,7 +1,7 @@ From 6afb93f24d48ff10d4266396b079b79033e05b0a Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 14 Jul 2014 17:21:29 +0200 -Subject: [PATCH 10/23] xfs: Fix termination loop for directory iteration +Subject: [PATCH 167/198] xfs: Fix termination loop for directory iteration Directory iteration used wrong position (sizeof wrong structure) for termination of iteration inside a directory block. Luckily the position @@ -28,5 +28,5 @@ index 16ffd3f..4bd52d1 100644 struct grub_xfs_dir2_entry *direntry; grub_uint8_t *freetag; -- -2.4.3 +2.7.4 diff --git a/SOURCES/0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch b/SOURCES/0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch index 01dbad0..d451ad0 100644 --- a/SOURCES/0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch +++ b/SOURCES/0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch @@ -1,8 +1,8 @@ From 54a4f53f9ecae2378195e4e66a8410d3862a0be2 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 14 Jul 2014 17:21:30 +0200 -Subject: [PATCH 11/23] xfs: Convert inode numbers to cpu endianity immediately - after reading +Subject: [PATCH 168/198] xfs: Convert inode numbers to cpu endianity + immediately after reading Currently XFS driver converted inode numbers to native endianity only when using them to compute inode position. Although this works, it is @@ -78,5 +78,5 @@ index 4bd52d1..0d704e9 100644 data->bsize = grub_be_to_cpu32 (data->sblock.bsize); data->agsize = grub_be_to_cpu32 (data->sblock.agsize); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch b/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch index 89b1257..408f4f0 100644 --- a/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch +++ b/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch @@ -1,7 +1,7 @@ From bc7e3f1e508c91b9ad7d3459998c5cd31d1caca0 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 1 Jun 2015 14:28:45 +0200 -Subject: [PATCH 12/23] xfs: Add helpers for inode size +Subject: [PATCH 169/198] xfs: Add helpers for inode size Add helpers to return size of XFS inode on disk and when loaded in memory. @@ -93,5 +93,5 @@ index 0d704e9..26d8147 100644 } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0170-xfs-V5-filesystem-format-support.patch b/SOURCES/0170-xfs-V5-filesystem-format-support.patch index 36d6a39..22dd543 100644 --- a/SOURCES/0170-xfs-V5-filesystem-format-support.patch +++ b/SOURCES/0170-xfs-V5-filesystem-format-support.patch @@ -1,7 +1,7 @@ From f9187f5eef9776ba51dca88e347bfd6675787cb6 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 1 Jun 2015 14:28:46 +0200 -Subject: [PATCH 13/23] xfs: V5 filesystem format support +Subject: [PATCH 170/198] xfs: V5 filesystem format support Add support for new XFS on disk format. We have to handle optional filetype fields in directory entries, additional CRC, LSN, UUID entries @@ -575,5 +575,5 @@ index 26d8147..f00e43e 100644 grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch b/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch index 5f5ae3e..5db364d 100644 --- a/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch +++ b/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch @@ -1,7 +1,7 @@ From 4ac2b84fea9a90d68970c0729a02895d47a8b40c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 19 Jun 2015 18:38:25 +0300 -Subject: [PATCH 14/23] xfs: silence Coverity overflow warning +Subject: [PATCH 171/198] xfs: silence Coverity overflow warning inode size cannot really overflow integer, but Coverity does not know it. CID: 96602 @@ -23,5 +23,5 @@ index f00e43e..7249291 100644 /* -- -2.4.3 +2.7.4 diff --git a/SOURCES/0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch b/SOURCES/0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch index c2d3385..28561a2 100644 --- a/SOURCES/0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch +++ b/SOURCES/0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch @@ -1,7 +1,7 @@ From a1f8402056e13cadab252dd64d7dc28ccdf6fda0 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 18 Nov 2014 16:03:08 +0800 -Subject: [PATCH 15/23] send router solicitation for ipv6 address autoconf v2 +Subject: [PATCH 172/198] send router solicitation for ipv6 address autoconf v2 Many routers have long router advertisment interval configured by default. The Neighbor Discovery protocol (RFC4861) has defined default @@ -159,5 +159,5 @@ index 7a8e614..dcceaa5 100644 +grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf); #endif -- -2.4.3 +2.7.4 diff --git a/SOURCES/0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch b/SOURCES/0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch index b8be36e..05ab7e9 100644 --- a/SOURCES/0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch +++ b/SOURCES/0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch @@ -1,7 +1,7 @@ From 70717c72f114860c25908eabc4cb18a15ed2680e Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Mon, 3 Nov 2014 16:27:45 +0800 -Subject: [PATCH 16/23] icmp6 fix no respond to neighbor solicit message +Subject: [PATCH 173/198] icmp6 fix no respond to neighbor solicit message The structure size used in grub_netbuff_pull to get the pointer to option header is apparently wrong, which leads to subsequent range check @@ -25,5 +25,5 @@ index 0843a15..7822394 100644 { grub_netbuff_free (nb); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch b/SOURCES/0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch index 94346e9..107025f 100644 --- a/SOURCES/0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch +++ b/SOURCES/0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch @@ -1,7 +1,7 @@ From af355a7fe160c6c798e416f8f14e059aaf16ea13 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 10 Oct 2014 11:11:09 +0200 -Subject: [PATCH 17/23] calibrate_tsc(): use the Stall() EFI boot service on +Subject: [PATCH 174/198] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1150698 @@ -69,5 +69,5 @@ index 3a4cae6..e499648 100644 grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0175-fix-memory-corruption-in-pubkey-filter-over-network.patch b/SOURCES/0175-fix-memory-corruption-in-pubkey-filter-over-network.patch index 2774ff0..d7ae66e 100644 --- a/SOURCES/0175-fix-memory-corruption-in-pubkey-filter-over-network.patch +++ b/SOURCES/0175-fix-memory-corruption-in-pubkey-filter-over-network.patch @@ -1,7 +1,7 @@ From 27d2434ea9aed09b6cefdcc8600e191fa6d1c2fb Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 5 Dec 2014 21:17:08 +0300 -Subject: [PATCH 18/23] fix memory corruption in pubkey filter over network +Subject: [PATCH 175/198] fix memory corruption in pubkey filter over network grub_pubkey_open closed original file after it was read; it set io->device to NULL to prevent grub_file_close from trying to close device. @@ -163,5 +163,5 @@ index 525bdd1..d599576 100644 } -- -2.4.3 +2.7.4 diff --git a/SOURCES/0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch b/SOURCES/0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch index bca5e11..1a4033b 100644 --- a/SOURCES/0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +++ b/SOURCES/0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch @@ -1,8 +1,8 @@ From 204d0616ba497656d21e65f1b26561c539ea1a21 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH 19/23] Make grub2-mkconfig construct titles that look like the - ones we want elsewhere. +Subject: [PATCH 176/198] Make grub2-mkconfig construct titles that look like + the ones we want elsewhere. Resolves: rhbz#1215839 @@ -68,5 +68,5 @@ index e8088a1..b3c460c 100644 echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else -- -2.4.3 +2.7.4 diff --git a/SOURCES/0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch b/SOURCES/0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch index d95749f..e8b8e12 100644 --- a/SOURCES/0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch +++ b/SOURCES/0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch @@ -1,7 +1,7 @@ From 224bdbee2e9cc9a9aaa198cec9b984bb1fa0ee73 Mon Sep 17 00:00:00 2001 From: RHEL Ninjas Date: Mon, 13 Apr 2015 12:42:53 +1000 -Subject: [PATCH 20/23] don't strip fw_path twice for EFI network boot +Subject: [PATCH 177/198] don't strip fw_path twice for EFI network boot --- grub-core/kern/efi/init.c | 7 ++++++- @@ -26,5 +26,5 @@ index 942ab02..c391df4 100644 /* Get the directory. */ p = grub_strrchr (*path, '/'); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0178-Add-friendly-grub2-password-config-tool-985962.patch b/SOURCES/0178-Add-friendly-grub2-password-config-tool-985962.patch index a4d289e..1d6d4d2 100644 --- a/SOURCES/0178-Add-friendly-grub2-password-config-tool-985962.patch +++ b/SOURCES/0178-Add-friendly-grub2-password-config-tool-985962.patch @@ -1,7 +1,7 @@ From bde7036b706857aff32a025e82da5bc32473e439 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 25 Jun 2015 11:13:11 -0400 -Subject: [PATCH 21/23] Add friendly grub2 password config tool (#985962) +Subject: [PATCH 178/198] Add friendly grub2 password config tool (#985962) Provided a tool for users to reset the grub2 root user password without having to alter the grub.cfg. The hashed password now @@ -278,5 +278,5 @@ index 0000000..facd409 +fi +EOF -- -2.4.3 +2.7.4 diff --git a/SOURCES/0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch b/SOURCES/0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch index 05bc86a..93fcbca 100644 --- a/SOURCES/0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch +++ b/SOURCES/0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch @@ -1,7 +1,7 @@ From f742724d51dc84b32a1298cd6bab62f12d887052 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Aug 2015 11:46:42 -0400 -Subject: [PATCH 22/23] Try to make sure configure.ac and grub-rpm-sort play +Subject: [PATCH 179/198] Try to make sure configure.ac and grub-rpm-sort play nice. Apparently the test for whether to use grub-rpm-sort and also the @@ -57,5 +57,5 @@ index e85b60c..c67a319 100644 version_test_numeric () -- -2.4.3 +2.7.4 diff --git a/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch b/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch index e1fcab3..4ffab63 100644 --- a/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch +++ b/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch @@ -1,7 +1,7 @@ From f1edaeeeffdfc291e0b17d87f8727baaecbfaf63 Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Wed, 22 Jul 2015 13:59:55 -0400 -Subject: [PATCH 23/23] ppc64le sync mkconfig to disk (#1212114) +Subject: [PATCH 180/198] ppc64le sync mkconfig to disk (#1212114) If creating a new grub2 entry using grub2-mkconfig, the entry is not immediately sync'd to disk. If a crash happens before the writeback, @@ -38,5 +38,5 @@ index e029d0d..cf315e2 100644 + sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot +fi -- -2.4.3 +2.7.4 diff --git a/SOURCES/0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch b/SOURCES/0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch index dbde843..0ff3253 100644 --- a/SOURCES/0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch +++ b/SOURCES/0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch @@ -1,7 +1,7 @@ From 66804a1e21978713902da654ec890574efe25e7d Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:16:22 -0700 -Subject: [PATCH 1/3] tcp: ack when we get an OOO/lost packet +Subject: [PATCH 181/198] tcp: ack when we get an OOO/lost packet While adding tcp window scaling support I was finding that I'd get some packet loss or reordering when transferring from large distances and grub would just @@ -33,5 +33,5 @@ index 2077f55..fa29a2a 100644 { nb_top_p = grub_priority_queue_top (sock->pq); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0182-tcp-add-window-scaling-support.patch b/SOURCES/0182-tcp-add-window-scaling-support.patch index b91ce62..5441703 100644 --- a/SOURCES/0182-tcp-add-window-scaling-support.patch +++ b/SOURCES/0182-tcp-add-window-scaling-support.patch @@ -1,7 +1,7 @@ From 8e86a32160008b34796f597016cc335680bb3486 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:57:55 -0700 -Subject: [PATCH 2/3] tcp: add window scaling support +Subject: [PATCH 182/198] tcp: add window scaling support Sometimes we have to provision boxes across regions, such as California to Sweden. The http server has a 10 minute timeout, so if we can't get our 250mb @@ -86,5 +86,5 @@ index fa29a2a..c22ef03 100644 tcp_socket_register (socket); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0183-efinet-retransmit-if-our-device-is-busy.patch b/SOURCES/0183-efinet-retransmit-if-our-device-is-busy.patch index 7fbddc2..34852f1 100644 --- a/SOURCES/0183-efinet-retransmit-if-our-device-is-busy.patch +++ b/SOURCES/0183-efinet-retransmit-if-our-device-is-busy.patch @@ -1,7 +1,7 @@ From 1b9767c1360827639927ab9bd337d1344d3b2d68 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 31 Aug 2015 13:34:35 -0400 -Subject: [PATCH 3/3] efinet: retransmit if our device is busy +Subject: [PATCH 183/198] efinet: retransmit if our device is busy When I fixed the txbuf handling I ripped out the retransmission code since it was flooding our network when we had the buggy behavior. Turns out this was too @@ -44,5 +44,5 @@ index ea0e0ca..c3a128c 100644 return grub_error (GRUB_ERR_TIMEOUT, N_("couldn't send network packet")); -- -2.4.3 +2.7.4 diff --git a/SOURCES/0184-Be-more-aggro-about-actually-using-the-configured-ne.patch b/SOURCES/0184-Be-more-aggro-about-actually-using-the-configured-ne.patch deleted file mode 100644 index ee62a3c..0000000 --- a/SOURCES/0184-Be-more-aggro-about-actually-using-the-configured-ne.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 46d5b1ccce248a275b1dcf15824fb3501a32d9dc Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Fri, 11 Sep 2015 17:30:49 -0400 -Subject: [PATCH] Be more aggro about actually using the *configured* network - device. - -Right now we use any SNP device with the same mac+IP block, but when -it's discovered there will be more than one of them. We need to pick -the same one we were loaded with, so that it'll be configured the same -way as it was before, and won't be re-used by the system firmware later. - -Resolves: rhbz#1257475 - -Signed-off-by: Peter Jones ---- - grub-core/net/drivers/efi/efinet.c | 124 +++++++++++++++++++++++++++++-------- - include/grub/efi/api.h | 4 ++ - 2 files changed, 102 insertions(+), 26 deletions(-) - -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index c3a128c..fd47b8a 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -239,46 +239,85 @@ grub_efinet_get_device_handle (struct grub_net_card *card) - return card->efi_handle; - } - --static void --grub_efinet_findcards (void) -+static int -+grub_efinet_find_snp_cards (int preferred_only, grub_efi_handle_t preferred, -+ int *i) - { -- grub_efi_uintn_t num_handles; -- grub_efi_handle_t *handles; -+ grub_efi_uintn_t num_handles = 0; -+ grub_efi_handle_t *handles = NULL; - grub_efi_handle_t *handle; -- int i = 0; -+ grub_efi_device_path_t *pdp = NULL, *pp = NULL, *pc = NULL; -+ int ret = 0; -+ -+ if (preferred) -+ { -+ grub_efi_device_path_t *pdpc; -+ pdpc = pdp = grub_efi_get_device_path (preferred); -+ if (pdp == NULL) -+ { -+ grub_print_error (); -+ return -1; -+ } - -- /* Find handles which support the disk io interface. */ -+ for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (pdpc); -+ pdpc = GRUB_EFI_NEXT_DEVICE_PATH (pdpc)) -+ { -+ pp = pc; -+ pc = pdpc; -+ } -+ } -+ -+ /* Find handles which support the SNP interface. */ - handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &net_io_guid, - 0, &num_handles); -- if (! handles) -- return; -- for (handle = handles; num_handles--; handle++) -+ -+ for (handle = handles; handle && num_handles--; handle++) - { - grub_efi_simple_network_t *net; - struct grub_net_card *card; - grub_efi_device_path_t *dp, *parent = NULL, *child = NULL; - -- /* EDK2 UEFI PXE driver creates IPv4 and IPv6 messaging devices as -- children of main MAC messaging device. We only need one device with -- bound SNP per physical card, otherwise they compete with each other -- when polling for incoming packets. -- */ -+ /* if we're looking for only the preferred handle, skip anything that -+ isn't it. */ -+ if (preferred_only && preferred != NULL && *handle != preferred) -+ continue; -+ -+ /* if we're not looking for the preferred handle, skip it if it's -+ found. */ -+ if (!preferred_only && *handle == preferred) -+ continue; -+ - dp = grub_efi_get_device_path (*handle); - if (!dp) - continue; -- for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp); dp = GRUB_EFI_NEXT_DEVICE_PATH (dp)) -+ -+ for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp); -+ dp = GRUB_EFI_NEXT_DEVICE_PATH (dp)) - { - parent = child; - child = dp; - } -- if (child -- && GRUB_EFI_DEVICE_PATH_TYPE (child) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -- && (GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE -- || GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) -- && parent -- && GRUB_EFI_DEVICE_PATH_TYPE (parent) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -- && GRUB_EFI_DEVICE_PATH_SUBTYPE (parent) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) -- continue; -+ -+ if (!preferred_only) -+ { -+ if (pp && pc -+ && grub_efi_compare_device_paths (pp, parent) == 0 -+ && grub_efi_compare_device_paths (pc, child) == 0) -+ continue; -+ -+ if (child -+ && (GRUB_EFI_DEVICE_PATH_IS_TYPE(child, -+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE, -+ GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) || -+ GRUB_EFI_DEVICE_PATH_IS_TYPE(child, -+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE, -+ GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE)) -+ && parent -+ && (GRUB_EFI_DEVICE_PATH_IS_TYPE(parent, -+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE, -+ GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE))) -+ continue; -+ } - - net = grub_efi_open_protocol (*handle, &net_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -@@ -302,7 +341,7 @@ grub_efinet_findcards (void) - { - grub_print_error (); - grub_free (handles); -- return; -+ return -1; - } - - card->mtu = net->mode->max_packet_size; -@@ -313,13 +352,14 @@ grub_efinet_findcards (void) - grub_print_error (); - grub_free (handles); - grub_free (card); -- return; -+ return -1; - } - card->txbusy = 0; - - card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256; - -- card->name = grub_xasprintf ("efinet%d", i++); -+ card->name = grub_xasprintf ("efinet%d", *i); -+ *i = (*i)+1; - card->driver = &efidriver; - card->flags = 0; - card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; -@@ -330,8 +370,38 @@ grub_efinet_findcards (void) - card->efi_handle = *handle; - - grub_net_card_register (card); -+ ret++; - } - grub_free (handles); -+ -+ return ret; -+} -+ -+static void -+grub_efinet_findcards (void) -+{ -+ grub_efi_loaded_image_t *image = NULL; -+ int rc; -+ int efinet_number = 0; -+ -+ image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ -+ if (image && image->device_handle) -+ { -+ rc = grub_efinet_find_snp_cards (1, image->device_handle, &efinet_number); -+ if (rc < 0) -+ return; -+ -+ rc = grub_efinet_find_snp_cards (0, image->device_handle, &efinet_number); -+ if (rc < 0) -+ return; -+ } -+ else -+ { -+ rc = grub_efinet_find_snp_cards (0, NULL, &efinet_number); -+ if (rc < 0) -+ return; -+ } - } - - static void -@@ -353,6 +423,8 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - struct grub_efi_pxe_mode *pxe_mode; - if (card->driver != &efidriver) - continue; -+ if (hnd != card->efi_handle) -+ continue; - cdp = grub_efi_get_device_path (card->efi_handle); - if (! cdp) - continue; -diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 029ee92..f0640c2 100644 ---- a/include/grub/efi/api.h -+++ b/include/grub/efi/api.h -@@ -573,6 +573,10 @@ typedef struct grub_efi_device_path grub_efi_device_path_t; - It seems to be identical to EFI_DEVICE_PATH. */ - typedef struct grub_efi_device_path grub_efi_device_path_protocol_t; - -+#define GRUB_EFI_DEVICE_PATH_IS_TYPE(dp, type, subtype) \ -+ ((GRUB_EFI_DEVICE_PATH_TYPE(dp) == (type)) && \ -+ (GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) == (subtype))) -+ - #define GRUB_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f) - #define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype) - #define GRUB_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length) --- -2.4.3 - diff --git a/SOURCES/0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch b/SOURCES/0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch index aeb5543..69d69e4 100644 --- a/SOURCES/0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +++ b/SOURCES/0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch @@ -1,7 +1,8 @@ -From 2cdea5ad6c34d04e0a2a833fc010618d3e6bddac Mon Sep 17 00:00:00 2001 +From f7cfef0838ab21316699cad18c3621ec0a67dd3f Mon Sep 17 00:00:00 2001 From: RHEL Ninjas Date: Fri, 25 Sep 2015 16:24:23 +0900 -Subject: [PATCH] efinet: add filter for the first exclusive reopen of SNP +Subject: [PATCH 185/198] efinet: add filter for the first exclusive reopen of + SNP --- grub-core/net/drivers/efi/efinet.c | 24 ++++++++++++++++++++++++ @@ -43,5 +44,5 @@ index fd47b8a..b6b5187 100644 } return; -- -2.5.0 +2.7.4 diff --git a/SOURCES/0186-Fix-security-issue-when-reading-username-and-passwor.patch b/SOURCES/0186-Fix-security-issue-when-reading-username-and-passwor.patch index 6419faf..e6fd9d2 100644 --- a/SOURCES/0186-Fix-security-issue-when-reading-username-and-passwor.patch +++ b/SOURCES/0186-Fix-security-issue-when-reading-username-and-passwor.patch @@ -1,7 +1,7 @@ From 3afaf579fb89ee4e1f6fc53f950e8ec574a9489a Mon Sep 17 00:00:00 2001 From: Hector Marco-Gisbert Date: Fri, 13 Nov 2015 16:21:09 +0100 -Subject: [PATCH 186/187] Fix security issue when reading username and password +Subject: [PATCH 186/198] Fix security issue when reading username and password This patch fixes two integer underflows at: * grub-core/lib/crypto.c @@ -43,5 +43,5 @@ index c6bd96e..5782ec5 100644 cur_len--; grub_printf ("\b"); -- -2.5.0 +2.7.4 diff --git a/SOURCES/0187-01_users-Handle-GRUB_PASSWORD-better.patch b/SOURCES/0187-01_users-Handle-GRUB_PASSWORD-better.patch index 18bc327..0895aa7 100644 --- a/SOURCES/0187-01_users-Handle-GRUB_PASSWORD-better.patch +++ b/SOURCES/0187-01_users-Handle-GRUB_PASSWORD-better.patch @@ -1,7 +1,7 @@ From dcc927227824dbcb9a7e1f809aedf2b1e08078b3 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Dec 2015 09:28:38 -0500 -Subject: [PATCH 187/187] 01_users: Handle GRUB_PASSWORD better. +Subject: [PATCH 187/198] 01_users: Handle GRUB_PASSWORD better. Only handle GRUB_PASSWORD not GRUB2_PASSWORD (as that's more likely to be acceptable upstream). @@ -41,5 +41,5 @@ index facd409..db2f44b 100644 export superusers password_pbkdf2 root \${GRUB2_PASSWORD} -- -2.5.0 +2.7.4 diff --git a/SOURCES/0188-Failed-config-now-returns-exit-code-1252311.patch b/SOURCES/0188-Failed-config-now-returns-exit-code-1252311.patch new file mode 100644 index 0000000..b7a5540 --- /dev/null +++ b/SOURCES/0188-Failed-config-now-returns-exit-code-1252311.patch @@ -0,0 +1,28 @@ +From 3533a831dbe66fe7f7dc7399c28c7a6fbf3b6de7 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Fri, 29 Jan 2016 14:49:24 -0500 +Subject: [PATCH 188/198] Failed config now returns exit code (#1252311) + +Grub would notify the user if the new config was invalid, however, it +did not exit properly with exit code 1. Added the proper exit code. + +Resolves: rhbz#1252311 +--- + util/grub-mkconfig.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index cf315e2..7db8949 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -281,6 +281,7 @@ Ensure that there are no errors in /etc/default/grub + and /etc/grub.d/* files or please file a bug report with + %s file attached." "${grub_cfg}.new" >&2 + echo >&2 ++ exit 1 + else + # none of the children aborted with error, install the new grub.cfg + cat ${grub_cfg}.new > ${grub_cfg} +-- +2.7.4 + diff --git a/SOURCES/0189-Warn-if-grub-password-will-not-be-read-1290803.patch b/SOURCES/0189-Warn-if-grub-password-will-not-be-read-1290803.patch new file mode 100644 index 0000000..536cafe --- /dev/null +++ b/SOURCES/0189-Warn-if-grub-password-will-not-be-read-1290803.patch @@ -0,0 +1,31 @@ +From 4cf5db62b8c0f9c696bdb39f4100b5d12be33906 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 22 Feb 2016 15:30:05 -0500 +Subject: [PATCH 189/198] Warn if grub password will not be read (#1290803) + +It is possible for a system to have never run grub-mkconfig and add the +section that reads the user.cfg file which contains a user set GRUB +password. Users in that scenario will now be warned that grub-mkconfig +must be run prior to their newly set password taking effect. + +Resolves: rhbz#1290803 +--- + util/grub-setpassword.in | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in +index dd76f00..fb9d3a3 100755 +--- a/util/grub-setpassword.in ++++ b/util/grub-setpassword.in +@@ -121,3 +121,8 @@ fi + install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || : + chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || : + echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg" ++ ++if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then ++ echo "WARNING: The current configuration lacks password support!" ++ echo "Update your configuration with @grub_mkconfig@ to support this feature." ++fi +-- +2.7.4 + diff --git a/SOURCES/0190-Clean-up-grub-setpassword-documentation-1290799.patch b/SOURCES/0190-Clean-up-grub-setpassword-documentation-1290799.patch new file mode 100644 index 0000000..a0245d9 --- /dev/null +++ b/SOURCES/0190-Clean-up-grub-setpassword-documentation-1290799.patch @@ -0,0 +1,58 @@ +From 2b4982864cc6e4da2c99fe162cb829229d1d787e Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Tue, 26 Jan 2016 10:28:35 -0500 +Subject: [PATCH 190/198] Clean up grub-setpassword documentation (#1290799) + +The output for --help had some errors. Corrected those and polished the +text to be a little easier to follow. Carried verbage over to man page +to maintain internal consistency. + +Resolves: rhbz#1290799 +--- + util/grub-setpassword.8 | 2 +- + util/grub-setpassword.in | 15 +++++++-------- + 2 files changed, 8 insertions(+), 9 deletions(-) + +diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 +index 49200a8..dc91dd6 100644 +--- a/util/grub-setpassword.8 ++++ b/util/grub-setpassword.8 +@@ -19,7 +19,7 @@ Display program usage and exit. + -v, --version + Display the current version. + .TP +--o, --output[=\fIDIRECTORY PATH\fR] ++-o, --output=<\fIDIRECTORY\fR> + Choose the file path to which user.cfg will be written. + + .SH SEE ALSO +diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in +index fb9d3a3..c8c0fa4 100755 +--- a/util/grub-setpassword.in ++++ b/util/grub-setpassword.in +@@ -16,15 +16,14 @@ grub_mkpasswd="${bindir}/@grub_mkpasswd_pbkdf2@" + # Print the usage. + usage () { + cat < put user.cfg in a user-selected directory + + Report bugs at https://bugzilla.redhat.com. + EOF +-- +2.7.4 + diff --git a/SOURCES/0191-Fix-locale-issue-in-grub-setpassword-1294243.patch b/SOURCES/0191-Fix-locale-issue-in-grub-setpassword-1294243.patch new file mode 100644 index 0000000..096ab44 --- /dev/null +++ b/SOURCES/0191-Fix-locale-issue-in-grub-setpassword-1294243.patch @@ -0,0 +1,30 @@ +From 4be1cfb939c905147c84474dc91fd9ebbe426a62 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Fri, 29 Jan 2016 16:56:11 -0500 +Subject: [PATCH 191/198] Fix locale issue in grub-setpassword (#1294243) + +A shell substitution was expecting non-translated output to grab the +hashed password and put it in the user.cfg file. Modified code to force +the generic C locale when this particular piece of code is run. + +Resolves: rhbz#1294243 +--- + util/grub-setpassword.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in +index c8c0fa4..d7924af 100755 +--- a/util/grub-setpassword.in ++++ b/util/grub-setpassword.in +@@ -104,7 +104,7 @@ getpass() { + P1="$1" && shift + + ( echo ${P0} ; echo ${P1} ) | \ +- ${grub_mkpasswd} | \ ++ LC_ALL=C ${grub_mkpasswd} | \ + grep -v '[eE]nter password:' | \ + sed -e "s/PBKDF2 hash of your password is //" + } +-- +2.7.4 + diff --git a/SOURCES/0192-efi-really-mark-memory-of-unknown-type-as-reserved.patch b/SOURCES/0192-efi-really-mark-memory-of-unknown-type-as-reserved.patch new file mode 100644 index 0000000..87b4649 --- /dev/null +++ b/SOURCES/0192-efi-really-mark-memory-of-unknown-type-as-reserved.patch @@ -0,0 +1,69 @@ +From 017b6f226d5b50aedc8f1b757e78df2b563f8f54 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 26 Nov 2015 19:50:42 +0300 +Subject: [PATCH 192/198] efi: really mark memory of unknown type as reserved + +9be4c45dbe3c877d1f4856e99ee15133c6cd2261 added switch case between +fall through cases, causing all memory regions of unknown type to be +marked as available. + +Move default case into its own block and add explicit FALLTHROUGH +annotation. + +Reported by Elliott, Robert (Persistent Memory) + +(cherry picked from commit 3d2c8048da7db334fd6d57b27304ac765fd4cd67) + +Resolves: rhbz#1288608 +--- + grub-core/mmap/efi/mmap.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c +index a77efe8..900a4d6 100644 +--- a/grub-core/mmap/efi/mmap.c ++++ b/grub-core/mmap/efi/mmap.c +@@ -73,6 +73,7 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_AVAILABLE, hook_data); + break; + } ++ /* FALLTHROUGH */ + case GRUB_EFI_RUNTIME_SERVICES_CODE: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MEMORY_CODE, hook_data); +@@ -83,10 +84,6 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_BADRAM, hook_data); + break; + +- default: +- grub_printf ("Unknown memory type %d, considering reserved\n", +- desc->type); +- + case GRUB_EFI_BOOT_SERVICES_DATA: + if (!avoid_efi_boot_services) + { +@@ -94,6 +91,7 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_AVAILABLE, hook_data); + break; + } ++ /* FALLTHROUGH */ + case GRUB_EFI_RESERVED_MEMORY_TYPE: + case GRUB_EFI_RUNTIME_SERVICES_DATA: + case GRUB_EFI_MEMORY_MAPPED_IO: +@@ -119,6 +117,13 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MEMORY_NVS, hook_data); + break; ++ ++ default: ++ grub_printf ("Unknown memory type %d, considering reserved\n", ++ desc->type); ++ hook (desc->physical_start, desc->num_pages * 4096, ++ GRUB_MEMORY_RESERVED, hook_data); ++ break; + } + } + +-- +2.7.4 + diff --git a/SOURCES/0193-Translate-UEFI-persistent-memory-type.patch b/SOURCES/0193-Translate-UEFI-persistent-memory-type.patch new file mode 100644 index 0000000..07ed629 --- /dev/null +++ b/SOURCES/0193-Translate-UEFI-persistent-memory-type.patch @@ -0,0 +1,103 @@ +From b58554b8d1c349f85fdad5bd07e7ff3356e2c060 Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Thu, 3 Dec 2015 11:38:36 -0600 +Subject: [PATCH 193/198] Translate UEFI persistent memory type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define +* GRUB_EFI_PERSISTENT_MEMORY (UEFI memory map type 14) per UEFI 2.5 +* GRUB_MEMORY_PERSISTENT (E820 type 7) per ACPI 3.0 +* GRUB_MEMORY_PERSISTENT_LEGACY (E820 unofficial type 12) per ACPI 3.0 + +and translate GRUB_EFI_PERSISTENT_MEMORY to GRUB_MEMORY_PERSISTENT in +grub_efi_mmap_iterate(). + +Includes +* adding the E820 names to lsmmap +* handling the E820 types in make_efi_memtype() + +Suggested-by: Vladimir 'φ-coder/phcoder' Serbinenko +Suggested-by: Andrei Borzenkov +(cherry picked from commit 76ce1de740f202985ffd7b2e980cf34c75a2dac3) + +Resolves: rhbz#1288608 +--- + grub-core/commands/lsmmap.c | 2 ++ + grub-core/mmap/efi/mmap.c | 12 ++++++++++++ + include/grub/efi/api.h | 1 + + include/grub/memory.h | 2 ++ + 4 files changed, 17 insertions(+) + +diff --git a/grub-core/commands/lsmmap.c b/grub-core/commands/lsmmap.c +index 4b504fd..816ee47 100644 +--- a/grub-core/commands/lsmmap.c ++++ b/grub-core/commands/lsmmap.c +@@ -37,6 +37,8 @@ static const char *names[] = + is required to save accross hibernations. */ + [GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"), + [GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"), ++ [GRUB_MEMORY_PERSISTENT] = N_("persistent RAM"), ++ [GRUB_MEMORY_PERSISTENT_LEGACY] = N_("persistent RAM (legacy)"), + [GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"), + [GRUB_MEMORY_CODE] = N_("RAM holding firmware code") + }; +diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c +index 900a4d6..bd495a1 100644 +--- a/grub-core/mmap/efi/mmap.c ++++ b/grub-core/mmap/efi/mmap.c +@@ -118,6 +118,11 @@ grub_efi_mmap_iterate (grub_memory_hook_t hook, void *hook_data, + GRUB_MEMORY_NVS, hook_data); + break; + ++ case GRUB_EFI_PERSISTENT_MEMORY: ++ hook (desc->physical_start, desc->num_pages * 4096, ++ GRUB_MEMORY_PERSISTENT, hook_data); ++ break; ++ + default: + grub_printf ("Unknown memory type %d, considering reserved\n", + desc->type); +@@ -147,6 +152,13 @@ make_efi_memtype (int type) + /* No way to remove a chunk of memory from EFI mmap. + So mark it as unusable. */ + case GRUB_MEMORY_HOLE: ++ /* ++ * AllocatePages() does not support GRUB_EFI_PERSISTENT_MEMORY, ++ * so no translation for GRUB_MEMORY_PERSISTENT or ++ * GRUB_MEMORY_PERSISTENT_LEGACY. ++ */ ++ case GRUB_MEMORY_PERSISTENT: ++ case GRUB_MEMORY_PERSISTENT_LEGACY: + case GRUB_MEMORY_RESERVED: + return GRUB_EFI_UNUSABLE_MEMORY; + +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index f0640c2..e481c26 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -431,6 +431,7 @@ enum grub_efi_memory_type + GRUB_EFI_MEMORY_MAPPED_IO, + GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + GRUB_EFI_PAL_CODE, ++ GRUB_EFI_PERSISTENT_MEMORY, + GRUB_EFI_MAX_MEMORY_TYPE + }; + typedef enum grub_efi_memory_type grub_efi_memory_type_t; +diff --git a/include/grub/memory.h b/include/grub/memory.h +index 083cfb6..6da114a 100644 +--- a/include/grub/memory.h ++++ b/include/grub/memory.h +@@ -30,6 +30,8 @@ typedef enum grub_memory_type + GRUB_MEMORY_ACPI = 3, + GRUB_MEMORY_NVS = 4, + GRUB_MEMORY_BADRAM = 5, ++ GRUB_MEMORY_PERSISTENT = 7, ++ GRUB_MEMORY_PERSISTENT_LEGACY = 12, + GRUB_MEMORY_COREBOOT_TABLES = 16, + GRUB_MEMORY_CODE = 20, + /* This one is special: it's used internally but is never reported +-- +2.7.4 + diff --git a/SOURCES/0194-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch b/SOURCES/0194-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch new file mode 100644 index 0000000..c3d8af4 --- /dev/null +++ b/SOURCES/0194-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch @@ -0,0 +1,184 @@ +From b09105154fff8679d6ec5790d6486619a62331ea Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Thu, 17 Dec 2015 10:53:32 -0600 +Subject: [PATCH 194/198] lsefimmap: support persistent memory and other UEFI + 2.5 features + +This should accompany + 76ce1de740 Translate UEFI persistent memory type + +1. Add a string for the EfiPersistentMemory type 14 that was +added in UEFI 2.5. + +2. Decode the memory attributes that were added in UEFI 2.5: +* NV (non-volatile) +* MORE_RELIABLE (higher reliable, e.g., mirrored memory in a system + with partial memory mirroring) +* RO (read-only) + +3. Use proper IEC binary units (KiB, MiB, etc.) for power-of-two +values rather than misusing SI power-of-ten units (KB, MB, etc.) + +4. The lsmmap command only decodes memory ranges sizes up to GiB scale +units. Persistent memory ranges will reach into the TiB scale. +Since 64-bit size field supports TiB, PiB, and EiB, decode all of +them for completeness. + +5. In the lsefimmap command, rewrite the print statements to +* avoid rounding +* avoid a big nested if/else tree. + +For example: In the sixth entry below, the value of 309MB implies +316416KB but is really reporting 316436KB. + +Widen the size column to 6 digits to accommodate typical cases. +The worst case value would require 14 digits; if that happens, +let the columns get out of sync. + +Old format: +Type Physical start - end #Pages Size Attributes +conv-mem 0000000000000000-0000000000092fff 00000093 588KB UC WC WT WB +reserved 0000000000093000-0000000000093fff 00000001 4KB UC WC WT WB +conv-mem 0000000000094000-000000000009ffff 0000000c 48KB UC WC WT WB +conv-mem 0000000000100000-000000000fffffff 0000ff00 255MB UC WC WT WB +BS-code 0000000010000000-0000000010048fff 00000049 292KB UC WC WT WB +conv-mem 0000000010049000-000000002354dfff 00013505 309MB UC WC WT WB +ldr-data 000000002354e000-000000003ecfffff 0001b7b2 439MB UC WC WT WB +BS-data 000000003ed00000-000000003ed7ffff 00000080 512KB UC WC WT WB +conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 705MB UC WC WT WB +reserved 000000006af60000-000000006b55ffff 00000600 6MB UC WC WT WB +BS-data 000000006b560000-000000006b560fff 00000001 4KB UC WC WT WB +RT-data 000000006b561000-000000006b5e1fff 00000081 516KB RT UC WC WT WB +BS-data 000000006b5e2000-000000006ecfafff 00003719 55MB UC WC WT WB +BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KB UC WC WT WB +conv-mem 000000006ecfc000-00000000711fafff 000024ff 36MB UC WC WT WB +BS-data 00000000711fb000-000000007128dfff 00000093 588KB UC WC WT WB +Unk 0d 0000000880000000-0000000e7fffffff 00600000 24GB UC WC WT WB NV +reserved 0000001680000000-0000001c7fffffff 00600000 24GB UC WC WT WB NV + +New format: +Type Physical start - end #Pages Size Attributes +conv-mem 0000000000000000-0000000000092fff 00000093 588KiB UC WC WT WB +reserved 0000000000093000-0000000000093fff 00000001 4KiB UC WC WT WB +conv-mem 0000000000094000-000000000009ffff 0000000c 48KiB UC WC WT WB +conv-mem 0000000000100000-000000000fffffff 0000ff00 255MiB UC WC WT WB +BS-code 0000000010000000-0000000010048fff 00000049 292KiB UC WC WT WB +conv-mem 0000000010049000-000000002354dfff 00013505 316436KiB UC WC WT WB +ldr-data 000000002354e000-000000003ecfffff 0001b7b2 450248KiB UC WC WT WB +BS-data 000000003ed00000-000000003ed7ffff 00000080 512KiB UC WC WT WB +conv-mem 000000003ed80000-000000006af5ffff 0002c1e0 722816KiB UC WC WT WB +reserved 000000006af60000-000000006b55ffff 00000600 6MiB UC WC WT WB +BS-data 000000006b560000-000000006b560fff 00000001 4KiB UC WC WT WB +RT-data 000000006b561000-000000006b5e1fff 00000081 516KiB RT UC WC WT WB +BS-data 000000006b5e2000-000000006ecfafff 00003719 56420KiB UC WC WT WB +BS-code 000000006ecfb000-000000006ecfbfff 00000001 4KiB UC WC WT WB +conv-mem 000000006ecfc000-0000000071222fff 00002527 38044KiB UC WC WT WB +BS-data 0000000071223000-00000000712ddfff 000000bb 748KiB UC WC WT WB +persist 0000000880000000-0000000e7fffffff 00600000 24GiB UC WC WT WB NV +reserved 0000001680000000-0000001c7fffffff 00600000 24GiB UC WC WT WB NV + +(cherry picked from commit c79c59f1295df8ea660f8a858f9532d76a5f67b7) + +Resolves: rhbz#1288608 +--- + grub-core/commands/efi/lsefimmap.c | 47 +++++++++++++++++++++++++------------- + include/grub/efi/api.h | 3 +++ + 2 files changed, 34 insertions(+), 16 deletions(-) + +diff --git a/grub-core/commands/efi/lsefimmap.c b/grub-core/commands/efi/lsefimmap.c +index 215b45b..c85ff7f 100644 +--- a/grub-core/commands/efi/lsefimmap.c ++++ b/grub-core/commands/efi/lsefimmap.c +@@ -51,7 +51,7 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + + grub_printf + ("Type Physical start - end #Pages " +- " Size Attributes\n"); ++ " Size Attributes\n"); + memory_map_end = ADD_MEMORY_DESCRIPTOR (memory_map, map_size); + for (desc = memory_map; + desc < memory_map_end; +@@ -74,7 +74,8 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + "ACPI-nvs", + "MMIO ", + "IO-ports", +- "PAL-code" ++ "PAL-code", ++ "persist ", + }; + if (desc->type < ARRAY_SIZE (types_str)) + grub_printf ("%s ", types_str[desc->type]); +@@ -87,21 +88,29 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + desc->physical_start + (desc->num_pages << 12) - 1, + desc->num_pages); + +- size = desc->num_pages; +- size <<= (12 - 10); +- if (size < 1024) +- grub_printf (" %4" PRIuGRUB_UINT64_T "KB", size); ++ size = desc->num_pages << 12; /* 4 KiB page size */ ++ /* ++ * Since size is a multiple of 4 KiB, no need to handle units ++ * of just Bytes (which would use a mask of 0x3ff). ++ * ++ * 14 characters would support the largest possible number of 4 KiB ++ * pages that are not a multiple of larger units (e.g., MiB): ++ * 17592186044415 (0xffffff_fffff000), but that uses a lot of ++ * whitespace for a rare case. 6 characters usually suffices; ++ * columns will be off if not, but this is preferable to rounding. ++ */ ++ if (size & 0xfffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "KiB", size >> 10); ++ else if (size & 0x3fffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "MiB", size >> 20); ++ else if (size & 0xffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "GiB", size >> 30); ++ else if (size & 0x3ffffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "TiB", size >> 40); ++ else if (size & 0xfffffffffffffff) ++ grub_printf (" %6" PRIuGRUB_UINT64_T "PiB", size >> 50); + else +- { +- size /= 1024; +- if (size < 1024) +- grub_printf (" %4" PRIuGRUB_UINT64_T "MB", size); +- else +- { +- size /= 1024; +- grub_printf (" %4" PRIuGRUB_UINT64_T "GB", size); +- } +- } ++ grub_printf (" %6" PRIuGRUB_UINT64_T "EiB", size >> 60); + + attr = desc->attribute; + if (attr & GRUB_EFI_MEMORY_RUNTIME) +@@ -122,6 +131,12 @@ grub_cmd_lsefimmap (grub_command_t cmd __attribute__ ((unused)), + grub_printf (" RP"); + if (attr & GRUB_EFI_MEMORY_XP) + grub_printf (" XP"); ++ if (attr & GRUB_EFI_MEMORY_NV) ++ grub_printf (" NV"); ++ if (attr & GRUB_EFI_MEMORY_MORE_RELIABLE) ++ grub_printf (" MR"); ++ if (attr & GRUB_EFI_MEMORY_RO) ++ grub_printf (" RO"); + + grub_printf ("\n"); + } +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index e481c26..79b4869 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -49,6 +49,9 @@ + #define GRUB_EFI_MEMORY_WP 0x0000000000001000LL + #define GRUB_EFI_MEMORY_RP 0x0000000000002000LL + #define GRUB_EFI_MEMORY_XP 0x0000000000004000LL ++#define GRUB_EFI_MEMORY_NV 0x0000000000008000LL ++#define GRUB_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL ++#define GRUB_EFI_MEMORY_RO 0x0000000000020000LL + #define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL + + #define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +-- +2.7.4 + diff --git a/SOURCES/0195-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch b/SOURCES/0195-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch new file mode 100644 index 0000000..c810e2a --- /dev/null +++ b/SOURCES/0195-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch @@ -0,0 +1,87 @@ +From 33f78043a7e610ed030dfa4a2d58f53df73d9117 Mon Sep 17 00:00:00 2001 +From: Robert Elliott +Date: Fri, 22 Jan 2016 13:32:30 +0100 +Subject: [PATCH 195/198] efiemu: Handle persistent RAM and unknown possible + future additions. + +(cherry picked from commit ae3b83a4d4df75a01198a2fed7542391e7c449e0) + +Resolves: rhbz#1288608 +--- + grub-core/efiemu/mm.c | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c +index d4a4f3a..13af4ad 100644 +--- a/grub-core/efiemu/mm.c ++++ b/grub-core/efiemu/mm.c +@@ -99,7 +99,8 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, + grub_size_t align_overhead; + struct grub_efiemu_memrequest *ret, *cur, *prev; + /* Check that the request is correct */ +- if (type >= GRUB_EFI_MAX_MEMORY_TYPE || type <= GRUB_EFI_LOADER_CODE) ++ if (type <= GRUB_EFI_LOADER_CODE || type == GRUB_EFI_PERSISTENT_MEMORY || ++ type >= GRUB_EFI_MAX_MEMORY_TYPE) + return -2; + + /* Add new size to requested size */ +@@ -166,6 +167,13 @@ efiemu_alloc_requests (void) + GRUB_EFI_MEMORY_MAPPED_IO, + GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + GRUB_EFI_PAL_CODE ++ ++ /* ++ * These are not allocatable: ++ * GRUB_EFI_RESERVED_MEMORY_TYPE ++ * GRUB_EFI_PERSISTENT_MEMORY ++ * >= GRUB_EFI_MAX_MEMORY_TYPE ++ */ + }; + + /* Compute total memory needed */ +@@ -402,6 +410,10 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_ACPI_MEMORY_NVS); + ++ case GRUB_MEMORY_PRAM: ++ case GRUB_MEMORY_PMEM: ++ return grub_efiemu_add_to_mmap (addr, size, ++ GRUB_EFI_PERSISTENT_MEMORY); + default: + grub_dprintf ("efiemu", + "Unknown memory type %d. Assuming unusable\n", type); +@@ -445,7 +457,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) + case GRUB_EFI_MEMORY_MAPPED_IO: + case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case GRUB_EFI_PAL_CODE: +- case GRUB_EFI_MAX_MEMORY_TYPE: ++ default: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_RESERVED, hook_data); + break; +@@ -468,6 +480,12 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_NVS, hook_data); + break; ++ ++ case GRUB_EFI_PERSISTENT_MEMORY: ++ hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, ++ GRUB_MEMORY_PMEM, hook_data); ++ break; ++ + } + + return 0; +@@ -503,7 +521,8 @@ grub_efiemu_mmap_sort_and_uniq (void) + [GRUB_EFI_ACPI_MEMORY_NVS] = 3, + [GRUB_EFI_MEMORY_MAPPED_IO] = 4, + [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, +- [GRUB_EFI_PAL_CODE] = 4 ++ [GRUB_EFI_PAL_CODE] = 4, ++ [GRUB_EFI_PERSISTENT_MEMORY] = 4 + }; + + int i, j, k, done; +-- +2.7.4 + diff --git a/SOURCES/0196-efiemu-Fix-compilation-failure.patch b/SOURCES/0196-efiemu-Fix-compilation-failure.patch new file mode 100644 index 0000000..4d48826 --- /dev/null +++ b/SOURCES/0196-efiemu-Fix-compilation-failure.patch @@ -0,0 +1,39 @@ +From 27223cf488006231734bc964d33899c4647feb12 Mon Sep 17 00:00:00 2001 +From: Vladimir Serbinenko +Date: Fri, 22 Jan 2016 14:10:30 +0100 +Subject: [PATCH 196/198] efiemu: Fix compilation failure + +(cherry picked from commit b6a03dfd327489d53ee07c6d7d593b99c7b7cb62) + +Resolves: rhbz#1288608 +--- + grub-core/efiemu/mm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c +index 13af4ad..e606dbf 100644 +--- a/grub-core/efiemu/mm.c ++++ b/grub-core/efiemu/mm.c +@@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_ACPI_MEMORY_NVS); + +- case GRUB_MEMORY_PRAM: +- case GRUB_MEMORY_PMEM: ++ case GRUB_MEMORY_PERSISTENT: ++ case GRUB_MEMORY_PERSISTENT_LEGACY: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_PERSISTENT_MEMORY); + default: +@@ -483,7 +483,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) + + case GRUB_EFI_PERSISTENT_MEMORY: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, +- GRUB_MEMORY_PMEM, hook_data); ++ GRUB_MEMORY_PERSISTENT, hook_data); + break; + + } +-- +2.7.4 + diff --git a/SOURCES/0197-devmapper-getroot-use-makedev-instead-of-direct-shif.patch b/SOURCES/0197-devmapper-getroot-use-makedev-instead-of-direct-shif.patch new file mode 100644 index 0000000..8cb031e --- /dev/null +++ b/SOURCES/0197-devmapper-getroot-use-makedev-instead-of-direct-shif.patch @@ -0,0 +1,34 @@ +From 580b04b48c7e727d666647737b0b39279c9a0b9e Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Sat, 7 Nov 2015 09:46:46 +0300 +Subject: [PATCH 197/198] devmapper/getroot: use makedev instead of direct + shift + +Fixes device detection with large number of devices. + +Reported by Tim Wallberg + +(cherry picked from commit 349a381df0ce2e809506f7b166bf952f97407330) + +Resolves: rhbz#1279599 +--- + grub-core/osdep/devmapper/getroot.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c +index d02386b..de32102 100644 +--- a/grub-core/osdep/devmapper/getroot.c ++++ b/grub-core/osdep/devmapper/getroot.c +@@ -204,8 +204,7 @@ grub_util_devmapper_part_to_disk (struct stat *st, + &major, &minor, 0)) + { + *is_part = 1; +- return grub_find_device ("/dev", +- (major << 8) | minor); ++ return grub_find_device ("/dev", makedev (major, minor)); + } + *is_part = 0; + return xstrdup (path); +-- +2.7.4 + diff --git a/SOURCES/0198-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch b/SOURCES/0198-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch new file mode 100644 index 0000000..19a6b14 --- /dev/null +++ b/SOURCES/0198-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch @@ -0,0 +1,73 @@ +From 4038b958782b8509bad567030896689b052b6b3f Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov +Date: Thu, 7 May 2015 20:24:24 +0300 +Subject: [PATCH 198/198] loader/linux: do not pad initrd with zeroes at the + end + +Syslinux memdisk is using initrd image and needs to know uncompressed +size in advance. For gzip uncompressed size is at the end of compressed +stream. Grub padded each input file to 4 bytes at the end, which means +syslinux got wrong size. + +Linux initramfs loader apparently does not care about trailing alignment. +So change code to align beginning of each file instead which atomatically +gives us the correct size for single file. + +Reported-By: David Shaw + +(cherry picked from commit a8c473288d3f0a5e17a903a5121dea1a695dda3b) + +Resolves: rhbz#1219864 +--- + grub-core/loader/linux.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c +index 117232f..d2cd591 100644 +--- a/grub-core/loader/linux.c ++++ b/grub-core/loader/linux.c +@@ -161,6 +161,9 @@ grub_initrd_init (int argc, char *argv[], + for (i = 0; i < argc; i++) + { + const char *fname = argv[i]; ++ ++ initrd_ctx->size = ALIGN_UP (initrd_ctx->size, 4); ++ + if (grub_memcmp (argv[i], "newc:", 5) == 0) + { + const char *ptr, *eptr; +@@ -205,7 +208,7 @@ grub_initrd_init (int argc, char *argv[], + initrd_ctx->nfiles++; + initrd_ctx->components[i].size + = grub_file_size (initrd_ctx->components[i].file); +- initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); ++ initrd_ctx->size += initrd_ctx->components[i].size; + } + + if (newc) +@@ -248,10 +251,12 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, + int i; + int newc = 0; + struct dir *root = 0; ++ grub_ssize_t cursize = 0; + + for (i = 0; i < initrd_ctx->nfiles; i++) + { +- grub_ssize_t cursize; ++ grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); ++ ptr += ALIGN_UP_OVERHEAD (cursize, 4); + + if (initrd_ctx->components[i].newc_name) + { +@@ -283,8 +288,6 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, + return grub_errno; + } + ptr += cursize; +- grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4)); +- ptr += ALIGN_UP_OVERHEAD (cursize, 4); + } + if (newc) + ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); +-- +2.7.4 + diff --git a/SOURCES/0199-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/SOURCES/0199-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch new file mode 100644 index 0000000..7a5228d --- /dev/null +++ b/SOURCES/0199-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -0,0 +1,77 @@ +From eb7b30cea4811f93eacb31ee6bf005039a4bf053 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 7 Apr 2016 10:58:06 -0400 +Subject: [PATCH 199/201] Revert "reopen SNP protocol for exclusive use by + grub" + +I *think* this should have been replaced by upstream's +49426e9fd2e562c73a4f1206f32eff9e424a1a73, so I'm reverting for now. + +May resolve rhbz#1273974. + +This reverts commit 147daeab22db793978f952b6f0d832919a1b0081. +--- + grub-core/net/drivers/efi/efinet.c | 40 -------------------------------------- + 1 file changed, 40 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index b6b5187..a3ce4c6 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -410,7 +410,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + { + struct grub_net_card *card; + grub_efi_device_path_t *dp; +- grub_efi_simple_network_t *net; + + dp = grub_efi_get_device_path (hnd); + if (! dp) +@@ -466,45 +465,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + &pxe_mode->dhcp_ack, + sizeof (pxe_mode->dhcp_ack), + 1, device, path); +- net = grub_efi_open_protocol (card->efi_handle, &net_io_guid, +- GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); +- if (net) { +- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED +- && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS) +- continue; +- +- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED) +- continue; +- +- if (net->mode->state == GRUB_EFI_NETWORK_STARTED +- && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS) +- continue; +- +- /* Enable hardware receive filters if driver declares support for it. +- We need unicast and broadcast and additionaly all nodes and +- solicited multicast for IPv6. Solicited multicast is per-IPv6 +- address and we currently do not have API to do it so simply +- try to enable receive of all multicast packets or evertyhing in +- the worst case (i386 PXE driver always enables promiscuous too). +- +- This does trust firmware to do what it claims to do. +- */ +- if (net->mode->receive_filter_mask) +- { +- grub_uint32_t filters = GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST | +- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST | +- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST; +- +- filters &= net->mode->receive_filter_mask; +- if (!(filters & GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST)) +- filters |= (net->mode->receive_filter_mask & +- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS); +- +- efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL); +- } +- +- card->efi_net = net; +- } + return; + } + } +-- +2.7.4 + diff --git a/SOURCES/0200-Add-a-url-parser.patch b/SOURCES/0200-Add-a-url-parser.patch new file mode 100644 index 0000000..bb69edb --- /dev/null +++ b/SOURCES/0200-Add-a-url-parser.patch @@ -0,0 +1,1019 @@ +From 4603f2d492d4b60eb63155efcc79cc8f8c2f077a Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 14 Jun 2016 16:18:44 -0400 +Subject: [PATCH 200/201] Add a url parser. + +This patch adds a url parser that can parse http, https, tftp, and tftps +urls, and is easily extensible to handle more types. + +It's a little ugly in terms of the arguments it takes. + +Signed-off-by: Peter Jones +--- + grub-core/Makefile.core.def | 1 + + grub-core/kern/misc.c | 13 + + grub-core/net/url.c | 856 ++++++++++++++++++++++++++++++++++++++++++++ + include/grub/misc.h | 45 +++ + include/grub/net/url.h | 28 ++ + 5 files changed, 943 insertions(+) + create mode 100644 grub-core/net/url.c + create mode 100644 include/grub/net/url.h + +diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def +index 9378c73..d73ea6f 100644 +--- a/grub-core/Makefile.core.def ++++ b/grub-core/Makefile.core.def +@@ -2103,6 +2103,7 @@ module = { + common = net/ethernet.c; + common = net/arp.c; + common = net/netbuff.c; ++ common = net/url.c; + }; + + module = { +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index a3e5056..392c697 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -325,6 +325,19 @@ grub_strrchr (const char *s, int c) + return p; + } + ++char * ++grub_strchrnul (const char *s, int c) ++{ ++ do ++ { ++ if (*s == c) ++ break; ++ } ++ while (*s++); ++ ++ return (char *) s; ++} ++ + int + grub_strword (const char *haystack, const char *needle) + { +diff --git a/grub-core/net/url.c b/grub-core/net/url.c +new file mode 100644 +index 0000000..537019f +--- /dev/null ++++ b/grub-core/net/url.c +@@ -0,0 +1,856 @@ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2016 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 . ++ */ ++ ++#ifdef URL_TEST ++ ++#define _GNU_SOURCE 1 ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define N_(x) x ++ ++#define grub_malloc(x) malloc(x) ++#define grub_free(x) ({if (x) free(x);}) ++#define grub_error(a, fmt, args...) printf(fmt "\n", ## args) ++#define grub_dprintf(a, fmt, args...) printf(a ": " fmt, ## args) ++#define grub_strlen(x) strlen(x) ++#define grub_strdup(x) strdup(x) ++#define grub_strstr(x,y) strstr(x,y) ++#define grub_memcpy(x,y,z) memcpy(x,y,z) ++#define grub_strcmp(x,y) strcmp(x,y) ++#define grub_strncmp(x,y,z) strncmp(x,y,z) ++#define grub_strcasecmp(x,y) strcasecmp(x,y) ++#define grub_strchrnul(x,y) strchrnul(x,y) ++#define grub_strchr(x,y) strchr(x,y) ++#define grub_strndup(x,y) strndup(x,y) ++#define grub_strtoul(x,y,z) strtoul(x,y,z) ++#define grub_memmove(x,y,z) memmove(x,y,z) ++#define grub_size_t size_t ++#define grub_errno errno ++ ++#else ++#include ++#include ++#include ++#include ++#endif ++ ++static char * ++translate_slashes(char *str) ++{ ++ int i, j; ++ if (str == NULL) ++ return str; ++ ++ for (i = 0, j = 0; str[i] != '\0'; i++, j++) ++ { ++ if (str[i] == '\\') ++ { ++ str[j] = '/'; ++ if (str[i+1] == '\\') ++ i++; ++ } ++ } ++ ++ return str; ++} ++ ++static inline int ++hex2int (char c) ++{ ++ if (c >= '0' && c <= '9') ++ return c - '0'; ++ c |= 0x20; ++ if (c >= 'a' && c <= 'f') ++ return c - 'a' + 10; ++ return -1; ++} ++ ++static int ++url_unescape (char *buf, grub_size_t len) ++{ ++ int c, rc; ++ unsigned int i; ++ ++ ++ if (len < 3) ++ { ++ for (i = 0; i < len; i++) ++ if (buf[i] == '%') ++ return -1; ++ return 0; ++ } ++ ++ for (i = 0; len > 2 && i < len - 2; i++) ++ { ++ if (buf[i] == '%') ++ { ++ unsigned int j; ++ for (j = i+1; j < i+3; j++) ++ { ++ if (!(buf[j] >= '0' && buf[j] <= '9') && ++ !(buf[j] >= 'a' && buf[j] <= 'f') && ++ !(buf[j] >= 'A' && buf[j] <= 'F')) ++ return -1; ++ } ++ i += 2; ++ } ++ } ++ if (i == len - 2) ++ { ++ if (buf[i+1] == '%' || buf[i+2] == '%') ++ return -1; ++ } ++ for (i = 0; i < len - 2; i++) ++ { ++ if (buf[i] == '%') ++ { ++ rc = hex2int (buf[i+1]); ++ if (rc < 0) ++ return -1; ++ c = (rc & 0xf) << 4; ++ rc = hex2int (buf[i+2]); ++ if (rc < 0) ++ return -1; ++ c |= (rc & 0xf); ++ ++ buf[i] = c; ++ grub_memmove (buf+i+1, buf+i+3, len-(i+2)); ++ len -= 2; ++ } ++ } ++ return 0; ++} ++ ++static int ++extract_http_url_info (char *url, int ssl, ++ char **userinfo, char **host, int *port, ++ char **file) ++{ ++ char *colon, *slash, *query, *at = NULL, *separator, *auth_end; ++ ++ char *userinfo_off = NULL; ++ char *userinfo_end; ++ char *host_off = NULL; ++ char *host_end; ++ char *port_off = NULL; ++ char *port_end; ++ char *file_off = NULL; ++ ++ grub_size_t l; ++ int c; ++ ++ if (!url || !userinfo || !host || !port || !file) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid argument"); ++ ++ *userinfo = *host = *file = NULL; ++ *port = -1; ++ ++ userinfo_off = url; ++ ++ slash = grub_strchrnul (userinfo_off, '/'); ++ query = grub_strchrnul (userinfo_off, '?'); ++ auth_end = slash < query ? slash : query; ++ /* auth_end here is one /past/ the last character in the auth section, i.e. ++ * it's the : or / or NUL */ ++ ++ separator = grub_strchrnul (userinfo_off, '@'); ++ if (separator > auth_end) ++ { ++ host_off = userinfo_off; ++ userinfo_off = NULL; ++ userinfo_end = NULL; ++ } ++ else ++ { ++ at = separator; ++ *separator = '\0'; ++ userinfo_end = separator; ++ host_off = separator + 1; ++ } ++ ++ if (*host_off == '[') ++ { ++ separator = grub_strchrnul (host_off, ']'); ++ if (separator >= auth_end) ++ goto fail; ++ ++ separator += 1; ++ host_end = separator; ++ } ++ else ++ { ++ host_end = separator = colon = grub_strchrnul (host_off, ':'); ++ ++ if (colon > auth_end) ++ { ++ separator = NULL; ++ host_end = auth_end; ++ } ++ } ++ ++ if (separator && separator < auth_end) ++ { ++ if (*separator == ':') ++ { ++ port_off = separator + 1; ++ port_end = auth_end; ++ ++ if (auth_end - port_end > 0) ++ goto fail; ++ if (port_end - port_off < 1) ++ goto fail; ++ } ++ else ++ goto fail; ++ } ++ ++ file_off = auth_end; ++ if (port_off) ++ { ++ unsigned long portul; ++ ++ separator = NULL; ++ c = *port_end; ++ *port_end = '\0'; ++ ++ portul = grub_strtoul (port_off, &separator, 10); ++ *port_end = c; ++#ifdef URL_TEST ++ if (portul == ULONG_MAX && errno == ERANGE) ++ goto fail; ++#else ++ if (grub_errno == GRUB_ERR_OUT_OF_RANGE) ++ goto fail; ++#endif ++ if (portul & ~0xfffful) ++ goto fail; ++ if (separator != port_end) ++ goto fail; ++ ++ *port = portul & 0xfffful; ++ } ++ else if (ssl) ++ *port = 443; ++ else ++ *port = 80; ++ ++ if (userinfo_off && *userinfo_off) ++ { ++ l = userinfo_end - userinfo_off + 1; ++ ++ *userinfo = grub_strndup (userinfo_off, l); ++ if (!*userinfo) ++ goto fail; ++ (*userinfo)[l-1]= '\0'; ++ } ++ ++ l = host_end - host_off; ++ c = *host_end; ++ *host_end = '\0'; ++ *host = grub_strndup (host_off, l); ++ *host_end = c; ++ if (!*host) ++ goto fail; ++ (*host)[l] = '\0'; ++ ++ *file = grub_strdup (file_off); ++ if (!*file) ++ goto fail; ++ ++ if (at) ++ *at = '@'; ++ return 0; ++fail: ++ if (at) ++ *at = '@'; ++ grub_free (*userinfo); ++ grub_free (*host); ++ grub_free (*file); ++ ++ return -1; ++} ++ ++static int ++extract_tftp_url_info (char *url, int ssl, char **host, char **file, int *port) ++{ ++ char *slash, *semi; ++ ++ char *host_off = url; ++ char *host_end; ++ char *file_off; ++ ++ int c; ++ ++ if (!url || !host || !file || !port) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid argument"); ++ ++ if (ssl) ++ *port = 3713; ++ else ++ *port = 69; ++ ++ slash = grub_strchr (url, '/'); ++ if (!slash) ++ return -1; ++ ++ host_end = file_off = slash; ++ ++ semi = grub_strchrnul (slash, ';'); ++ if (!grub_strncmp (semi, ";mode=", 6) && grub_strcmp (semi+6, "octet")) ++ { ++ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, ++ N_("TFTP mode `%s' is not implemented."), semi+6); ++ return -1; ++ } ++ ++ /* ++ * Maybe somebody added a new method, I dunno. Anyway, semi is a reserved ++ * character, so if it's there, it's the start of the mode block or it's ++ * invalid. So set it to \0 unconditionally, not just for ;mode=octet ++ */ ++ *semi = '\0'; ++ ++ c = *host_end; ++ *host_end = '\0'; ++ *host = grub_strdup (host_off); ++ *host_end = c; ++ ++ *file = grub_strdup (file_off); ++ ++ if (!*file || !*host) ++ { ++ grub_free (*file); ++ grub_free (*host); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++int ++extract_url_info (const char *urlbuf, grub_size_t buflen, ++ char **scheme, char **userinfo, ++ char **host, int *port, char **file) ++{ ++ char *url; ++ char *colon; ++ ++ char *scheme_off; ++ char *specific_off; ++ ++ int rc; ++ int c; ++ ++ int https; ++ ++ if (!urlbuf || !buflen || !scheme || !userinfo || !host || !port || !file) ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid argument"); ++ ++ *scheme = *userinfo = *host = *file = NULL; ++ *port = -1; ++ ++ /* make sure we have our own coherent grub_string. */ ++ url = grub_malloc (buflen + 1); ++ if (!url) ++ return -1; ++ ++ grub_memcpy (url, urlbuf, buflen); ++ url[buflen] = '\0'; ++ ++ grub_dprintf ("net", "dhcpv6 boot-file-url: `%s'\n", url); ++ ++ /* get rid of any backslashes */ ++ url = translate_slashes (url); ++ ++ /* find the constituent parts */ ++ colon = grub_strstr (url, "://"); ++ if (!colon) ++ goto fail; ++ ++ scheme_off = url; ++ c = *colon; ++ *colon = '\0'; ++ specific_off = colon + 3; ++ ++ https = !grub_strcasecmp (scheme_off, "https"); ++ ++ rc = 0; ++ if (!grub_strcasecmp (scheme_off, "tftp")) ++ { ++ rc = extract_tftp_url_info (specific_off, 0, host, file, port); ++ } ++#ifdef URL_TEST ++ else if (!grub_strcasecmp (scheme_off, "http") || https) ++#else ++ else if (!grub_strcasecmp (scheme_off, "http")) ++#endif ++ { ++ rc = extract_http_url_info (specific_off, ++ https, userinfo, host, port, file); ++ } ++#ifdef URL_TEST ++ else if (!grub_strcasecmp (scheme_off, "iscsi")) ++ { ++ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, ++ N_("Unimplemented URL scheme `%s'"), scheme_off); ++ *colon = c; ++ goto fail; ++ } ++ else if (!grub_strcasecmp (scheme_off, "tftps")) ++ { ++ rc = extract_tftp_url_info (specific_off, 1, host, file, port); ++ } ++#endif ++ else ++ { ++ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, ++ N_("Unimplemented URL scheme `%s'"), scheme_off); ++ *colon = c; ++ goto fail; ++ } ++ ++ if (rc < 0) ++ { ++ *colon = c; ++ goto fail; ++ } ++ ++ *scheme = grub_strdup (scheme_off); ++ *colon = c; ++ if (!*scheme) ++ goto fail; ++ ++ if (*userinfo) ++ { ++ rc = url_unescape (*userinfo, grub_strlen (*userinfo)); ++ if (rc < 0) ++ goto fail; ++ } ++ ++ if (*host) ++ { ++ rc = url_unescape (*host, grub_strlen (*host)); ++ if (rc < 0) ++ goto fail; ++ } ++ ++ if (*file) ++ { ++ rc = url_unescape (*file, grub_strlen (*file)); ++ if (rc < 0) ++ goto fail; ++ } ++ ++ grub_free (url); ++ return 0; ++fail: ++ grub_free (*scheme); ++ grub_free (*userinfo); ++ grub_free (*host); ++ grub_free (*file); ++ ++ if (!grub_errno) ++ grub_error (GRUB_ERR_NET_BAD_ADDRESS, N_("Invalid boot-file-url `%s'"), ++ url); ++ grub_free (url); ++ return -1; ++} ++ ++#ifdef URL_TEST ++ ++struct test { ++ char *url; ++ int rc; ++ char *scheme; ++ char *userinfo; ++ char *host; ++ int port; ++ char *file; ++} tests[] = { ++ {.url = "http://foo.example.com/", ++ .rc = 0, ++ .scheme = "http", ++ .host = "foo.example.com", ++ .port = 80, ++ .file = "/", ++ }, ++ {.url = "http://foo.example.com/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .host = "foo.example.com", ++ .port = 80, ++ .file = "/?foobar", ++ }, ++ {.url = "http://[foo.example.com/", ++ .rc = -1, ++ }, ++ {.url = "http://[foo.example.com/?foobar", ++ .rc = -1, ++ }, ++ {.url = "http://foo.example.com:/", ++ .rc = -1, ++ }, ++ {.url = "http://foo.example.com:81/", ++ .rc = 0, ++ .scheme = "http", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "http://foo.example.com:81/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "http://[1234::1]/", ++ .rc = 0, ++ .scheme = "http", ++ .host = "[1234::1]", ++ .port = 80, ++ .file = "/", ++ }, ++ {.url = "http://[1234::1]/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .host = "[1234::1]", ++ .port = 80, ++ .file = "/?foobar", ++ }, ++ {.url = "http://[1234::1]:81/", ++ .rc = 0, ++ .scheme = "http", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "http://[1234::1]:81/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "http://foo@foo.example.com/", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 80, ++ .file = "/", ++ }, ++ {.url = "http://foo@foo.example.com/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 80, ++ .file = "/?foobar", ++ }, ++ {.url = "http://foo@[foo.example.com/", ++ .rc = -1, ++ }, ++ {.url = "http://foo@[foo.example.com/?foobar", ++ .rc = -1, ++ }, ++ {.url = "http://foo@foo.example.com:81/", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "http://foo@foo.example.com:81/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "http://foo@[1234::1]/", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 80, ++ .file = "/", ++ }, ++ {.url = "http://foo@[1234::1]/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 80, ++ .file = "/?foobar", ++ }, ++ {.url = "http://foo@[1234::1]:81/", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "http://foo@[1234::1]:81/?foobar", ++ .rc = 0, ++ .scheme = "http", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "https://foo.example.com/", ++ .rc = 0, ++ .scheme = "https", ++ .host = "foo.example.com", ++ .port = 443, ++ .file = "/", ++ }, ++ {.url = "https://foo.example.com/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .host = "foo.example.com", ++ .port = 443, ++ .file = "/?foobar", ++ }, ++ {.url = "https://[foo.example.com/", ++ .rc = -1, ++ }, ++ {.url = "https://[foo.example.com/?foobar", ++ .rc = -1, ++ }, ++ {.url = "https://foo.example.com:81/", ++ .rc = 0, ++ .scheme = "https", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "https://foo.example.com:81/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "https://[1234::1]/", ++ .rc = 0, ++ .scheme = "https", ++ .host = "[1234::1]", ++ .port = 443, ++ .file = "/", ++ }, ++ {.url = "https://[1234::1]/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .host = "[1234::1]", ++ .port = 443, ++ .file = "/?foobar", ++ }, ++ {.url = "https://[1234::1]:81/", ++ .rc = 0, ++ .scheme = "https", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "https://[1234::1]:81/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "https://foo@foo.example.com/", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 443, ++ .file = "/", ++ }, ++ {.url = "https://foo@foo.example.com/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 443, ++ .file = "/?foobar", ++ }, ++ {.url = "https://foo@[foo.example.com/", ++ .rc = -1, ++ }, ++ {.url = "https://f%6fo@[foo.example.com/?fooba%72", ++ .rc = -1, ++ }, ++ {.url = "https://foo@foo.example.com:81/", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "https://foo@foo.example.com:81/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "foo.example.com", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "https://foo@[1234::1]/", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 443, ++ .file = "/", ++ }, ++ {.url = "https://foo@[1234::1]/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 443, ++ .file = "/?foobar", ++ }, ++ {.url = "https://f%6fo@[12%334::1]:81/", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/", ++ }, ++ {.url = "https://foo@[1234::1]:81/?foobar", ++ .rc = 0, ++ .scheme = "https", ++ .userinfo = "foo", ++ .host = "[1234::1]", ++ .port = 81, ++ .file = "/?foobar", ++ }, ++ {.url = "tftp://foo.e%78ample.com/foo/bar/b%61%7a", ++ .rc = 0, ++ .scheme = "tftp", ++ .host = "foo.example.com", ++ .port = 69, ++ .file = "/foo/bar/baz", ++ }, ++ {.url = "tftp://foo.example.com/foo/bar/baz", ++ .rc = 0, ++ .scheme = "tftp", ++ .host = "foo.example.com", ++ .port = 69, ++ .file = "/foo/bar/baz", ++ }, ++ {.url = "tftps://foo.example.com/foo/bar/baz", ++ .rc = 0, ++ .scheme = "tftps", ++ .host = "foo.example.com", ++ .port = 3713, ++ .file = "/foo/bar/baz", ++ }, ++ {.url = "tftps://foo.example.com/foo/bar/baz;mode=netascii", ++ .rc = -1, ++ }, ++ {.url = "tftps://foo.example.com/foo/bar/baz;mode=octet", ++ .rc = 0, ++ .scheme = "tftps", ++ .host = "foo.example.com", ++ .port = 3713, ++ .file = "/foo/bar/baz", ++ }, ++ {.url = "tftps://foo.example.com/foo/bar/baz;mode=invalid", ++ .rc = -1, ++ }, ++ {.url = "", ++ }, ++}; ++ ++static int ++string_test (char *name, char *a, char *b) ++{ ++ if ((a && !b) || (!a && b)) ++ { ++ printf("expected %s \"%s\", got \"%s\"\n", name, a, b); ++ return -1; ++ } ++ if (a && b && strcmp(a, b)) ++ { ++ printf("expected %s \"%s\", got \"%s\"\n", name, a, b); ++ return -1; ++ } ++ return 0; ++} ++ ++int ++main(void) ++{ ++ unsigned int i; ++ int rc; ++ ++ for (i = 0; tests[i].url[0] != '\0'; i++) ++ { ++ char *scheme, *userinfo, *host, *file; ++ int port; ++ ++ printf("======= url: \"%s\"\n", tests[i].url); ++ rc = extract_url_info(tests[i].url, strlen(tests[i].url) + 1, ++ &scheme, &userinfo, &host, &port, &file); ++ if (tests[i].rc != rc) ++ { ++ printf(" extract_url_info(...) = %d\n", rc); ++ exit(1); ++ } ++ else if (rc >= 0) ++ { ++ if (string_test("scheme", tests[i].scheme, scheme) < 0) ++ exit(1); ++ if (string_test("userinfo", tests[i].userinfo, userinfo) < 0) ++ exit(1); ++ if (string_test("host", tests[i].host, host) < 0) ++ exit(1); ++ if (port != tests[i].port) ++ { ++ printf(" bad port \"%d\" should have been \"%d\"\n", ++ port, tests[i].port); ++ exit(1); ++ } ++ if (string_test("file", tests[i].file, file) < 0) ++ exit(1); ++ } ++ free(scheme); ++ free(userinfo); ++ free(host); ++ free(file); ++ } ++ printf("everything worked?!?\n"); ++} ++#endif +diff --git a/include/grub/misc.h b/include/grub/misc.h +index c6cd456..3425029 100644 +--- a/include/grub/misc.h ++++ b/include/grub/misc.h +@@ -104,6 +104,7 @@ int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); + + char *EXPORT_FUNC(grub_strchr) (const char *s, int c); + char *EXPORT_FUNC(grub_strrchr) (const char *s, int c); ++char *EXPORT_FUNC(grub_strchrnul) (const char *s, int c); + int EXPORT_FUNC(grub_strword) (const char *s, const char *w); + + /* Copied from gnulib. +@@ -226,6 +227,50 @@ grub_toupper (int c) + return c; + } + ++static inline char * ++grub_strcasestr (const char *haystack, const char *needle) ++{ ++ /* Be careful not to look at the entire extent of haystack or needle ++ until needed. This is useful because of these two cases: ++ - haystack may be very long, and a match of needle found early, ++ - needle may be very long, and not even a short initial segment of ++ needle may be found in haystack. */ ++ if (*needle != '\0') ++ { ++ /* Speed up the following searches of needle by caching its first ++ character. */ ++ char b = *needle++; ++ ++ for (;; haystack++) ++ { ++ if (*haystack == '\0') ++ /* No match. */ ++ return 0; ++ if (grub_tolower(*haystack) == grub_tolower(b)) ++ /* The first character matches. */ ++ { ++ const char *rhaystack = haystack + 1; ++ const char *rneedle = needle; ++ ++ for (;; rhaystack++, rneedle++) ++ { ++ if (*rneedle == '\0') ++ /* Found a match. */ ++ return (char *) haystack; ++ if (*rhaystack == '\0') ++ /* No match. */ ++ return 0; ++ if (grub_tolower(*rhaystack) != grub_tolower(*rneedle)) ++ /* Nothing in this round. */ ++ break; ++ } ++ } ++ } ++ } ++ else ++ return (char *) haystack; ++} ++ + static inline int + grub_strcasecmp (const char *s1, const char *s2) + { +diff --git a/include/grub/net/url.h b/include/grub/net/url.h +new file mode 100644 +index 0000000..a215fa2 +--- /dev/null ++++ b/include/grub/net/url.h +@@ -0,0 +1,28 @@ ++/* url.h - prototypes for url parsing functions */ ++/* ++ * GRUB -- GRand Unified Bootloader ++ * Copyright (C) 2016 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 . ++ */ ++ ++#ifndef GRUB_URL_HEADER ++#define GRUB_URL_HEADER 1 ++ ++int ++EXPORT_FUNC(extract_url_info) (const char *urlbuf, grub_size_t buflen, ++ char **scheme, char **userinfo, ++ char **host, int *port, char **file); ++ ++#endif /* GRUB_URL_HEADER */ +-- +2.7.4 + diff --git a/SOURCES/0201-efinet-and-bootp-add-support-for-dhcpv6.patch b/SOURCES/0201-efinet-and-bootp-add-support-for-dhcpv6.patch new file mode 100644 index 0000000..81f683f --- /dev/null +++ b/SOURCES/0201-efinet-and-bootp-add-support-for-dhcpv6.patch @@ -0,0 +1,653 @@ +From b82d52b798d4685fe0badd4feeb8c4c9e98fe571 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 8 Jun 2016 21:03:37 -0400 +Subject: [PATCH] efinet and bootp: add support for dhcpv6 + +Signed-off-by: Peter Jones +--- + grub-core/net/bootp.c | 172 +++++++++++++++++++++++++++++++++++++ + grub-core/net/drivers/efi/efinet.c | 52 +++++++++-- + grub-core/net/net.c | 67 +++++++++++++++ + grub-core/net/tftp.c | 4 + + include/grub/efi/api.h | 129 ++++++++++++++++++++++++++-- + include/grub/net.h | 59 +++++++++++++ + 6 files changed, 469 insertions(+), 14 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 88f2056..bed6a81 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + + static char * +@@ -335,6 +336,177 @@ grub_net_configure_by_dhcp_ack (const char *name, + return inter; + } + ++struct grub_net_network_level_interface * ++grub_net_configure_by_dhcpv6_ack (const char *name, ++ struct grub_net_card *card, ++ grub_net_interface_flags_t flags ++ __attribute__((__unused__)), ++ const grub_net_link_level_address_t *hwaddr, ++ const struct grub_net_dhcpv6_packet *packet, ++ int is_def, char **device, char **path) ++{ ++ struct grub_net_network_level_interface *inter = NULL; ++ struct grub_net_network_level_address addr; ++ int mask = -1; ++ ++ if (device) ++ *device = 0; ++ if (path) ++ *path = 0; ++ ++ grub_dprintf ("net", "mac address is %02x:%02x:%02x:%02x:%02x:%02x\n", ++ hwaddr->mac[0], hwaddr->mac[1], hwaddr->mac[2], ++ hwaddr->mac[3], hwaddr->mac[4], hwaddr->mac[5]); ++ ++ if (is_def) ++ grub_net_default_server = 0; ++ ++ if (is_def && !grub_net_default_server && packet) ++ { ++ const grub_uint8_t *options = packet->dhcp_options; ++ unsigned int option_max = 1024 - OFFSET_OF (dhcp_options, packet); ++ unsigned int i; ++ ++ for (i = 0; i < option_max - sizeof (grub_net_dhcpv6_option_t); ) ++ { ++ grub_uint16_t num, len; ++ grub_net_dhcpv6_option_t *opt = ++ (grub_net_dhcpv6_option_t *)(options + i); ++ ++ num = grub_be_to_cpu16(opt->option_num); ++ len = grub_be_to_cpu16(opt->option_len); ++ ++ grub_dprintf ("net", "got dhcpv6 option %d len %d\n", num, len); ++ ++ if (len == 0) ++ break; ++ ++ if (len + i > 1024) ++ break; ++ ++ if (num == GRUB_NET_DHCP6_BOOTFILE_URL) ++ { ++ char *scheme, *userinfo, *host, *file; ++ char *tmp; ++ int hostlen; ++ int port; ++ int rc = extract_url_info ((const char *)opt->option_data, ++ (grub_size_t)len, ++ &scheme, &userinfo, &host, &port, ++ &file); ++ if (rc < 0) ++ continue; ++ ++ /* right now this only handles tftp. */ ++ if (grub_strcmp("tftp", scheme)) ++ { ++ grub_free (scheme); ++ grub_free (userinfo); ++ grub_free (host); ++ grub_free (file); ++ continue; ++ } ++ grub_free (userinfo); ++ ++ hostlen = grub_strlen (host); ++ if (hostlen > 2 && host[0] == '[' && host[hostlen-1] == ']') ++ { ++ tmp = host+1; ++ host[hostlen-1] = '\0'; ++ } ++ else ++ tmp = host; ++ ++ *device = grub_xasprintf ("%s,%s", scheme, tmp); ++ grub_free (scheme); ++ grub_free (host); ++ ++ if (file && *file) ++ { ++ tmp = grub_strrchr (file, '/'); ++ if (tmp) ++ *(tmp+1) = '\0'; ++ else ++ file[0] = '\0'; ++ } ++ else if (!file) ++ file = grub_strdup (""); ++ ++ if (file[0] == '/') ++ { ++ *path = grub_strdup (file+1); ++ grub_free (file); ++ } ++ else ++ *path = file; ++ } ++ else if (num == GRUB_NET_DHCP6_IA_NA) ++ { ++ const grub_net_dhcpv6_option_t *ia_na_opt; ++ const grub_net_dhcpv6_opt_ia_na_t *ia_na = ++ (const grub_net_dhcpv6_opt_ia_na_t *)opt; ++ unsigned int left = len - OFFSET_OF (options, ia_na); ++ unsigned int j; ++ ++ if ((grub_uint8_t *)ia_na + left > ++ (grub_uint8_t *)options + option_max) ++ left -= ((grub_uint8_t *)ia_na + left) ++ - ((grub_uint8_t *)options + option_max); ++ ++ if (len < OFFSET_OF (option_data, opt) ++ + sizeof (grub_net_dhcpv6_option_t)) ++ { ++ grub_dprintf ("net", ++ "found dhcpv6 ia_na option with no address\n"); ++ continue; ++ } ++ ++ for (j = 0; left > sizeof (grub_net_dhcpv6_option_t); ) ++ { ++ ia_na_opt = (const grub_net_dhcpv6_option_t *) ++ (ia_na->options + j); ++ grub_uint16_t ia_na_opt_num, ia_na_opt_len; ++ ++ ia_na_opt_num = grub_be_to_cpu16 (ia_na_opt->option_num); ++ ia_na_opt_len = grub_be_to_cpu16 (ia_na_opt->option_len); ++ if (ia_na_opt_len == 0) ++ break; ++ if (j + ia_na_opt_len > left) ++ break; ++ if (ia_na_opt_num == GRUB_NET_DHCP6_IA_ADDRESS) ++ { ++ const grub_net_dhcpv6_opt_ia_address_t *ia_addr; ++ ++ ia_addr = (const grub_net_dhcpv6_opt_ia_address_t *) ++ ia_na_opt; ++ addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ grub_memcpy(addr.ipv6, ia_addr->ipv6_address, ++ sizeof (ia_addr->ipv6_address)); ++ inter = grub_net_add_addr (name, card, &addr, hwaddr, 0); ++ } ++ ++ j += ia_na_opt_len; ++ left -= ia_na_opt_len; ++ } ++ } ++ ++ i += len + 4; ++ } ++ ++ grub_print_error (); ++ } ++ ++ if (is_def) ++ { ++ grub_env_set ("net_default_interface", name); ++ grub_env_export ("net_default_interface"); ++ } ++ ++ if (inter) ++ grub_net_add_ipv6_local (inter, mask); ++ return inter; ++} ++ + void + grub_net_process_dhcp (struct grub_net_buff *nb, + struct grub_net_card *card) +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index 3f11243..d7befb2 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -18,11 +18,15 @@ + + #include + #include ++#include + #include ++#include + #include + #include + #include + #include ++#include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -339,7 +343,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + char **path) + { + struct grub_net_card *card; +- grub_efi_device_path_t *dp; ++ grub_efi_device_path_t *dp, *ldp = NULL; + + dp = grub_efi_get_device_path (hnd); + if (! dp) +@@ -350,14 +354,19 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + grub_efi_device_path_t *cdp; + struct grub_efi_pxe *pxe; + struct grub_efi_pxe_mode *pxe_mode; ++ + if (card->driver != &efidriver) + continue; ++ + cdp = grub_efi_get_device_path (card->efi_handle); + if (! cdp) + continue; ++ ++ ldp = grub_efi_find_last_device_path (dp); ++ + if (grub_efi_compare_device_paths (dp, cdp) != 0) + { +- grub_efi_device_path_t *ldp, *dup_dp, *dup_ldp; ++ grub_efi_device_path_t *dup_dp, *dup_ldp; + int match; + + /* EDK2 UEFI PXE driver creates pseudo devices with type IPv4/IPv6 +@@ -366,7 +375,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + devices. We skip them when enumerating cards, so here we need to + find matching MAC device. + */ +- ldp = grub_efi_find_last_device_path (dp); + if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE + || (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE + && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE)) +@@ -383,16 +391,44 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + if (!match) + continue; + } ++ + pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); + if (! pxe) + continue; ++ + pxe_mode = pxe->mode; +- grub_net_configure_by_dhcp_ack (card->name, card, 0, +- (struct grub_net_bootp_packet *) +- &pxe_mode->dhcp_ack, +- sizeof (pxe_mode->dhcp_ack), +- 1, device, path); ++ if (pxe_mode->using_ipv6) ++ { ++ grub_net_link_level_address_t hwaddr; ++ ++ grub_dprintf ("efinet", "using ipv6 and dhcpv6\n"); ++ grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n", ++ pxe_mode->dhcp_ack_received ? "yes" : "no", ++ pxe_mode->dhcp_ack_received ? "" : " cannot continue"); ++ if (!pxe_mode->dhcp_ack_received) ++ continue; ++ ++ hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; ++ grub_memcpy (hwaddr.mac, ++ card->efi_net->mode->current_address, ++ sizeof (hwaddr.mac)); ++ ++ grub_net_configure_by_dhcpv6_ack (card->name, card, 0, ++ &hwaddr, &pxe_mode->dhcp_ack, ++ 1, device, path); ++ grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); ++ } ++ else ++ { ++ grub_dprintf ("efinet", "using ipv4 and dhcp\n"); ++ grub_net_configure_by_dhcp_ack (card->name, card, 0, ++ (struct grub_net_bootp_packet *) ++ &pxe_mode->dhcp_ack, ++ sizeof (pxe_mode->dhcp_ack), ++ 1, device, path); ++ grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); ++ } + return; + } + } +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index b10addb..81d3b62 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -969,6 +969,73 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa + grub_net_network_level_interfaces = inter; + } + ++int ++grub_ipv6_get_masksize(grub_uint8_t *be_mask) ++{ ++ grub_uint8_t *mask; ++ grub_uint16_t mask16[8]; ++ unsigned int x; ++ int ret = 0; ++ ++ grub_memcpy (mask16, be_mask, sizeof(mask16)); ++ for (x = 0; x < 8; x++) ++ mask16[x] = grub_be_to_cpu16 (mask16[x]); ++ ++ mask = (grub_uint8_t *)mask16; ++ ++ for (x = 15; x > 0; x++) ++ { ++ grub_uint8_t octet = mask[x]; ++ while (octet & 0x80) ++ { ++ ret++; ++ octet <<= 1; ++ } ++ if (ret) ++ ret += 8 * (15 - x); ++ break; ++ } ++ ++ return ret; ++} ++ ++grub_err_t ++grub_net_add_ipv6_local (struct grub_net_network_level_interface *inter, ++ int mask) ++{ ++ struct grub_net_route *route; ++ ++ if (inter->address.type != GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6) ++ return 0; ++ ++ if (mask == -1) ++ mask = grub_ipv6_get_masksize ((grub_uint8_t *)inter->address.ipv6); ++ ++ if (mask == -1) ++ return 0; ++ ++ route = grub_zalloc (sizeof (*route)); ++ if (!route) ++ return grub_errno; ++ ++ route->name = grub_xasprintf ("%s:local", inter->name); ++ if (!route->name) ++ { ++ grub_free (route); ++ return grub_errno; ++ } ++ ++ route->target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ grub_memcpy (route->target.ipv6.base, inter->address.ipv6, ++ sizeof (inter->address.ipv6)); ++ route->target.ipv6.masksize = mask; ++ route->is_gateway = 0; ++ route->interface = inter; ++ ++ grub_net_route_register (route); ++ ++ return 0; ++} + + grub_err_t + grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter, +diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c +index 5173614..22a4deb 100644 +--- a/grub-core/net/tftp.c ++++ b/grub-core/net/tftp.c +@@ -370,18 +370,22 @@ tftp_open (struct grub_file *file, const char *filename) + if (!data->pq) + return grub_errno; + ++ grub_dprintf("tftp", "resolving address for %s\n", file->device->net->server); + err = grub_net_resolve_address (file->device->net->server, &addr); + if (err) + { ++ grub_dprintf("tftp", "Address resolution failed: %d\n", err); + destroy_pq (data); + return err; + } + ++ grub_dprintf("tftp", "opening connection\n"); + data->sock = grub_net_udp_open (addr, + TFTP_SERVER_PORT, tftp_receive, + file); + if (!data->sock) + { ++ grub_dprintf("tftp", "connection failed\n"); + destroy_pq (data); + return grub_errno; + } +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index a6cce6e..9422ba9 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -527,10 +527,16 @@ typedef void *grub_efi_handle_t; + typedef void *grub_efi_event_t; + typedef grub_efi_uint64_t grub_efi_lba_t; + typedef grub_efi_uintn_t grub_efi_tpl_t; +-typedef grub_uint8_t grub_efi_mac_address_t[32]; +-typedef grub_uint8_t grub_efi_ipv4_address_t[4]; +-typedef grub_uint16_t grub_efi_ipv6_address_t[8]; +-typedef grub_uint8_t grub_efi_ip_address_t[8] __attribute__ ((aligned(4))); ++typedef grub_efi_uint8_t grub_efi_mac_address_t[32]; ++typedef grub_efi_uint8_t grub_efi_ipv4_address_t[4]; ++typedef grub_efi_uint8_t grub_efi_ipv6_address_t[16]; ++typedef union ++{ ++ grub_efi_uint32_t addr[4]; ++ grub_efi_ipv4_address_t v4; ++ grub_efi_ipv6_address_t v6; ++} grub_efi_ip_address_t __attribute__ ((aligned(4))); ++ + typedef grub_efi_uint64_t grub_efi_physical_address_t; + typedef grub_efi_uint64_t grub_efi_virtual_address_t; + +@@ -1405,16 +1411,127 @@ struct grub_efi_simple_text_output_interface + }; + typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t; + +-typedef grub_uint8_t grub_efi_pxe_packet_t[1472]; ++typedef struct grub_efi_pxe_dhcpv4_packet ++{ ++ grub_efi_uint8_t bootp_opcode; ++ grub_efi_uint8_t bootp_hwtype; ++ grub_efi_uint8_t bootp_hwaddr_len; ++ grub_efi_uint8_t bootp_gate_hops; ++ grub_efi_uint32_t bootp_ident; ++ grub_efi_uint16_t bootp_seconds; ++ grub_efi_uint16_t bootp_flags; ++ grub_efi_uint8_t bootp_ci_addr[4]; ++ grub_efi_uint8_t bootp_yi_addr[4]; ++ grub_efi_uint8_t bootp_si_addr[4]; ++ grub_efi_uint8_t bootp_gi_addr[4]; ++ grub_efi_uint8_t bootp_hw_addr[16]; ++ grub_efi_uint8_t bootp_srv_name[64]; ++ grub_efi_uint8_t bootp_boot_file[128]; ++ grub_efi_uint32_t dhcp_magik; ++ grub_efi_uint8_t dhcp_options[56]; ++} grub_efi_pxe_dhcpv4_packet_t; ++ ++struct grub_efi_pxe_dhcpv6_packet ++{ ++ grub_efi_uint32_t message_type:8; ++ grub_efi_uint32_t transaction_id:24; ++ grub_efi_uint8_t dhcp_options[1024]; ++} GRUB_PACKED; ++typedef struct grub_efi_pxe_dhcpv6_packet grub_efi_pxe_dhcpv6_packet_t; ++ ++typedef union ++{ ++ grub_efi_uint8_t raw[1472]; ++ grub_efi_pxe_dhcpv4_packet_t dhcpv4; ++ grub_efi_pxe_dhcpv6_packet_t dhcpv6; ++} grub_efi_pxe_packet_t; ++ ++#define GRUB_EFI_PXE_MAX_IPCNT 8 ++#define GRUB_EFI_PXE_MAX_ARP_ENTRIES 8 ++#define GRUB_EFI_PXE_MAX_ROUTE_ENTRIES 8 ++ ++typedef struct grub_efi_pxe_ip_filter ++{ ++ grub_efi_uint8_t filters; ++ grub_efi_uint8_t ip_count; ++ grub_efi_uint8_t reserved; ++ grub_efi_ip_address_t ip_list[GRUB_EFI_PXE_MAX_IPCNT]; ++} grub_efi_pxe_ip_filter_t; ++ ++typedef struct grub_efi_pxe_arp_entry ++{ ++ grub_efi_ip_address_t ip_addr; ++ grub_efi_mac_address_t mac_addr; ++} grub_efi_pxe_arp_entry_t; ++ ++typedef struct grub_efi_pxe_route_entry ++{ ++ grub_efi_ip_address_t ip_addr; ++ grub_efi_ip_address_t subnet_mask; ++ grub_efi_ip_address_t gateway_addr; ++} grub_efi_pxe_route_entry_t; ++ ++typedef struct grub_efi_pxe_icmp_error ++{ ++ grub_efi_uint8_t type; ++ grub_efi_uint8_t code; ++ grub_efi_uint16_t checksum; ++ union ++ { ++ grub_efi_uint32_t reserved; ++ grub_efi_uint32_t mtu; ++ grub_efi_uint32_t pointer; ++ struct ++ { ++ grub_efi_uint16_t identifier; ++ grub_efi_uint16_t sequence; ++ } echo; ++ } u; ++ grub_efi_uint8_t data[494]; ++} grub_efi_pxe_icmp_error_t; ++ ++typedef struct grub_efi_pxe_tftp_error ++{ ++ grub_efi_uint8_t error_code; ++ grub_efi_char8_t error_string[127]; ++} grub_efi_pxe_tftp_error_t; + + typedef struct grub_efi_pxe_mode + { +- grub_uint8_t unused[52]; ++ grub_efi_boolean_t started; ++ grub_efi_boolean_t ipv6_available; ++ grub_efi_boolean_t ipv6_supported; ++ grub_efi_boolean_t using_ipv6; ++ grub_efi_boolean_t bis_supported; ++ grub_efi_boolean_t bis_detected; ++ grub_efi_boolean_t auto_arp; ++ grub_efi_boolean_t send_guid; ++ grub_efi_boolean_t dhcp_discover_valid; ++ grub_efi_boolean_t dhcp_ack_received; ++ grub_efi_boolean_t proxy_offer_received; ++ grub_efi_boolean_t pxe_discover_valid; ++ grub_efi_boolean_t pxe_reply_received; ++ grub_efi_boolean_t pxe_bis_reply_received; ++ grub_efi_boolean_t icmp_error_received; ++ grub_efi_boolean_t tftp_error_received; ++ grub_efi_boolean_t make_callbacks; ++ grub_efi_uint8_t ttl; ++ grub_efi_uint8_t tos; ++ grub_efi_ip_address_t station_ip; ++ grub_efi_ip_address_t subnet_mask; + grub_efi_pxe_packet_t dhcp_discover; + grub_efi_pxe_packet_t dhcp_ack; + grub_efi_pxe_packet_t proxy_offer; + grub_efi_pxe_packet_t pxe_discover; + grub_efi_pxe_packet_t pxe_reply; ++ grub_efi_pxe_packet_t pxe_bis_reply; ++ grub_efi_pxe_ip_filter_t ip_filter; ++ grub_efi_uint32_t arp_cache_entries; ++ grub_efi_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_MAX_ARP_ENTRIES]; ++ grub_efi_uint32_t route_table_entries; ++ grub_efi_pxe_route_entry_t route_table[GRUB_EFI_PXE_MAX_ROUTE_ENTRIES]; ++ grub_efi_pxe_icmp_error_t icmp_error; ++ grub_efi_pxe_tftp_error_t tftp_error; + } grub_efi_pxe_mode_t; + + typedef struct grub_efi_pxe +diff --git a/include/grub/net.h b/include/grub/net.h +index 88fc71c..fc0d721 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -417,6 +417,50 @@ struct grub_net_bootp_packet + char boot_file[128]; + grub_uint8_t vendor[0]; + } GRUB_PACKED; ++enum ++ { ++ GRUB_NET_DHCP6_IA_NA = 3, ++ GRUB_NET_DHCP6_IA_ADDRESS = 5, ++ GRUB_NET_DHCP6_BOOTFILE_URL = 59, ++ }; ++ ++struct grub_net_dhcpv6_option ++{ ++ grub_uint16_t option_num; ++ grub_uint16_t option_len; ++ grub_uint8_t option_data[]; ++} GRUB_PACKED; ++typedef struct grub_net_dhcpv6_option grub_net_dhcpv6_option_t; ++ ++struct grub_net_dhcpv6_opt_ia_na ++{ ++ grub_uint16_t option_num; ++ grub_uint16_t option_len; ++ grub_uint32_t iaid; ++ grub_uint32_t t1; ++ grub_uint32_t t2; ++ grub_uint8_t options[]; ++} GRUB_PACKED; ++typedef struct grub_net_dhcpv6_opt_ia_na grub_net_dhcpv6_opt_ia_na_t; ++ ++struct grub_net_dhcpv6_opt_ia_address ++{ ++ grub_uint16_t option_num; ++ grub_uint16_t option_len; ++ grub_uint64_t ipv6_address[2]; ++ grub_uint32_t preferred_lifetime; ++ grub_uint32_t valid_lifetime; ++ grub_uint8_t options[]; ++} GRUB_PACKED; ++typedef struct grub_net_dhcpv6_opt_ia_address grub_net_dhcpv6_opt_ia_address_t; ++ ++struct grub_net_dhcpv6_packet ++{ ++ grub_uint32_t message_type:8; ++ grub_uint32_t transaction_id:24; ++ grub_uint8_t dhcp_options[1024]; ++} GRUB_PACKED; ++typedef struct grub_net_dhcpv6_packet grub_net_dhcpv6_packet_t; + + #define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63 + #define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82 +@@ -446,6 +490,21 @@ grub_net_configure_by_dhcp_ack (const char *name, + grub_size_t size, + int is_def, char **device, char **path); + ++struct grub_net_network_level_interface * ++grub_net_configure_by_dhcpv6_ack (const char *name, ++ struct grub_net_card *card, ++ grub_net_interface_flags_t flags, ++ const grub_net_link_level_address_t *hwaddr, ++ const struct grub_net_dhcpv6_packet *packet, ++ int is_def, char **device, char **path); ++ ++int ++grub_ipv6_get_masksize(grub_uint8_t *mask); ++ ++grub_err_t ++grub_net_add_ipv6_local (struct grub_net_network_level_interface *inf, ++ int mask); ++ + grub_err_t + grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf, + int mask); +-- +1.8.3.1 + diff --git a/SOURCES/0202-ppc64le-has-no-separate-boot-mount-1261926.patch b/SOURCES/0202-ppc64le-has-no-separate-boot-mount-1261926.patch new file mode 100644 index 0000000..de5855c --- /dev/null +++ b/SOURCES/0202-ppc64le-has-no-separate-boot-mount-1261926.patch @@ -0,0 +1,44 @@ +From fdaeb030e1b5d2381692d5e2dd59c31592917ecb Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Fri, 17 Jun 2016 11:47:34 -0400 +Subject: [PATCH] ppc64le has no separate /boot mount (#1261926) + +The patch for rhbz#1212114 ensures that ppc64le systems sync grub config +changes to disk prior to grub-mkconfig completion and a reboot. + +This patch required checking for /boot as its own mount point because +issuing fsfreeze to a root partition is unwise. For administrators who +configured a ppc64le system with no separate /boot partition, the failed +check results in an error message. The file is written and would work +most of the time, however, it also introduces a corner case where the +behavior manifested in rhbz#1212114 could re-appear on these systems. + +The system call issued by fsfreeeze is being issued by methods within +the anaconda installer and can be removed from GRUB proper. + +Related: rhbz#1315468 +Resolves: rhbz#1261926 +--- + util/grub-mkconfig.in | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 7db8949..0cfe604 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -291,12 +291,3 @@ fi + + gettext "done" >&2 + echo >&2 +- +-# make sure changes make it to the disk. +-# if /boot is a mountpoint, force the meta data on disk +-# to by-pass writeback delay. +-# PPC64LE-only to deal with Petitboot issues +-ARCH=$(uname -m) +-if [ "${ARCH}" = "ppc64le" ]; then +- sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot +-fi +-- +2.5.5 + diff --git a/SOURCES/0203-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch b/SOURCES/0203-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch new file mode 100644 index 0000000..20da99a --- /dev/null +++ b/SOURCES/0203-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch @@ -0,0 +1,315 @@ +From cf6c89b53dd605a19660d1e26b9e072d0b2f7433 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 23 Jun 2016 11:01:39 -0400 +Subject: [PATCH] Add grub-get-kernel-settings and use it in 10_linux + +This patch adds grub-get-kernel-settings, which reads the system kernel +installation configuration from /etc/sysconfig/kernel, and outputs +${GRUB_...} variables suitable for evaluation by grub-mkconfig. Those +variables are then used by 10_linux to choose whether or not to create +debug stanzas. + +Resolves: rhbz#1226325 +--- + .gitignore | 1 + + Makefile.util.def | 7 ++ + configure.ac | 2 + + util/bash-completion.d/grub-completion.bash.in | 22 +++++++ + util/grub-get-kernel-settings.3 | 20 ++++++ + util/grub-get-kernel-settings.in | 91 ++++++++++++++++++++++++++ + util/grub-mkconfig.in | 3 + + util/grub.d/10_linux.in | 23 +++++-- + 8 files changed, 164 insertions(+), 5 deletions(-) + create mode 100644 util/grub-get-kernel-settings.3 + create mode 100644 util/grub-get-kernel-settings.in + +diff --git a/.gitignore b/.gitignore +index e49f76b..547ef0b 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -61,6 +61,7 @@ grub-fstest.exe + grub_fstest_init.c + grub_fstest_init.h + grub_func_test ++grub-get-kernel-settings + grub-install + grub-install.exe + grub-kbdcomp +diff --git a/Makefile.util.def b/Makefile.util.def +index e2821a2..3918e3b 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -705,6 +705,13 @@ script = { + }; + + script = { ++ name = grub-get-kernel-settings; ++ common = util/grub-get-kernel-settings.in; ++ mansection = 3; ++ installdir = sbin; ++}; ++ ++script = { + name = grub-set-default; + common = util/grub-set-default.in; + mansection = 8; +diff --git a/configure.ac b/configure.ac +index 04c052d..8b10a93 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -58,6 +58,7 @@ grub_TRANSFORM([grub-install]) + grub_TRANSFORM([grub-mkconfig]) + grub_TRANSFORM([grub-mkfont]) + grub_TRANSFORM([grub-mkimage]) ++grub_TRANSFORM([grub-get-kernel-settings]) + grub_TRANSFORM([grub-glue-efi]) + grub_TRANSFORM([grub-mklayout]) + grub_TRANSFORM([grub-mkpasswd-pbkdf2]) +@@ -75,6 +76,7 @@ grub_TRANSFORM([grub-file]) + grub_TRANSFORM([grub-bios-setup.3]) + grub_TRANSFORM([grub-editenv.1]) + grub_TRANSFORM([grub-fstest.3]) ++grub_TRANSFORM([grub-get-kernel-settings.3]) + grub_TRANSFORM([grub-glue-efi.3]) + grub_TRANSFORM([grub-install.1]) + grub_TRANSFORM([grub-kbdcomp.3]) +diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in +index 44bf135..5c4acd4 100644 +--- a/util/bash-completion.d/grub-completion.bash.in ++++ b/util/bash-completion.d/grub-completion.bash.in +@@ -265,6 +265,28 @@ unset __grub_sparc64_setup_program + + + # ++# grub-get-kernel-settings ++# ++_grub_get_kernel_settings () { ++ local cur ++ ++ COMPREPLY=() ++ cur=`_get_cword` ++ ++ if [[ "$cur" == -* ]]; then ++ __grubcomp "$(__grub_get_options_from_help)" ++ else ++ # Default complete with a filename ++ _filedir ++ fi ++} ++__grub_get_kernel_settings_program="@grub_get_kernel_settings@" ++have ${__grub_get_kernel_settings_program} && \ ++ complete -F _grub_get_kernel_settings -o filenames ${__grub_get_kernel_settings_program} ++unset __grub_get_kernel_settings_program ++ ++ ++# + # grub-install + # + _grub_install () { +diff --git a/util/grub-get-kernel-settings.3 b/util/grub-get-kernel-settings.3 +new file mode 100644 +index 0000000..ba33330 +--- /dev/null ++++ b/util/grub-get-kernel-settings.3 +@@ -0,0 +1,20 @@ ++.TH GRUB-GET-KERNEL-SETTINGS 3 "Thu Jun 25 2015" ++.SH NAME ++\fBgrub-get-kernel-settings\fR \(em Evaluate the system's kernel installation settings for use while making a grub configuration file. ++ ++.SH SYNOPSIS ++\fBgrub-get-kernel-settings\fR [OPTION] ++ ++.SH DESCRIPTION ++\fBgrub-get-kernel-settings\fR reads the kernel installation settings on the host system, and emits a set of grub settings suitable for use when creating a grub configuration file. ++ ++.SH OPTIONS ++.TP ++-h, --help ++Display program usage and exit. ++.TP ++-v, --version ++Display the current version. ++ ++.SH SEE ALSO ++.BR "info grub" +diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in +new file mode 100644 +index 0000000..ae0b469 +--- /dev/null ++++ b/util/grub-get-kernel-settings.in +@@ -0,0 +1,91 @@ ++#!/bin/sh ++set -e ++ ++# Evaluate new-kernel-pkg's configuration file. ++# Copyright (C) 2016 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 . ++ ++prefix="@prefix@" ++exec_prefix="@exec_prefix@" ++datarootdir="@datarootdir@" ++ ++prefix="@prefix@" ++exec_prefix="@exec_prefix@" ++sbindir="@sbindir@" ++bindir="@bindir@" ++sysconfdir="@sysconfdir@" ++PACKAGE_NAME=@PACKAGE_NAME@ ++PACKAGE_VERSION=@PACKAGE_VERSION@ ++host_os=@host_os@ ++datadir="@datadir@" ++if [ "x$pkgdatadir" = x ]; then ++ pkgdatadir="${datadir}/@PACKAGE@" ++fi ++grub_cfg="" ++ ++self=`basename $0` ++ ++grub_probe="${sbindir}/@grub_probe@" ++grub_file="${bindir}/@grub_file@" ++grub_editenv="${bindir}/@grub_editenv@" ++grub_script_check="${bindir}/@grub_script_check@" ++ ++export TEXTDOMAIN=@PACKAGE@ ++export TEXTDOMAINDIR="@localedir@" ++ ++. "${pkgdatadir}/grub-mkconfig_lib" ++ ++# Usage: usage ++# Print the usage. ++usage () { ++ gettext_printf "Usage: %s [OPTION]\n" "$self" ++ gettext "Evaluate new-kernel-pkg configuration"; echo ++ echo ++ print_option_help "-h, --help" "$(gettext "print this message and exit")" ++ print_option_help "-v, --version" "$(gettext "print the version information and exit")" ++ echo ++} ++ ++# Check the arguments. ++while test $# -gt 0 ++do ++ option=$1 ++ shift ++ ++ case "$option" in ++ -h | --help) ++ usage ++ exit 0 ;; ++ -v | --version) ++ echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" ++ exit 0 ;; ++ -*) ++ gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2 ++ usage ++ exit 1 ++ ;; ++ # Explicitly ignore non-option arguments, for compatibility. ++ esac ++done ++ ++if test -f /etc/sysconfig/kernel ; then ++ . /etc/sysconfig/kernel ++fi ++ ++if [ "$MAKEDEBUG" = "yes" ]; then ++ echo GRUB_LINUX_MAKE_DEBUG=true ++ echo GRUB_CMDLINE_LINUX_DEBUG=\"systemd.log_level=debug systemd.log_target=kmsg\" ++ echo GRUB_LINUX_DEBUG_TITLE_POSTFIX=\" with debugging\" ++fi +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index 0cfe604..aa4fdb8 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -42,6 +42,7 @@ grub_probe="${sbindir}/@grub_probe@" + grub_file="${bindir}/@grub_file@" + grub_editenv="${bindir}/@grub_editenv@" + grub_script_check="${bindir}/@grub_script_check@" ++grub_get_kernel_settings="${sbindir}/@grub_get_kernel_settings@" + + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" +@@ -148,6 +149,8 @@ if test -f ${sysconfdir}/default/grub ; then + . ${sysconfdir}/default/grub + fi + ++eval `${grub_get_kernel_settings}` || true ++ + if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then + GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" + fi +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index b3c460c..0d0086d 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -99,7 +99,8 @@ linux_entry () + os="$1" + version="$2" + type="$3" +- args="$4" ++ isdebug="$4" ++ args="$5" + + sixteenbit="" + linuxefi="linux" +@@ -130,6 +131,9 @@ linux_entry () + else + echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + fi ++ if [ x$isdebug = xdebug ]; then ++ title="$title${GRUB_LINUX_DEBUG_TITLE_POSTFIX}" ++ fi + if [ x$type != xrecovery ] ; then + save_default_entry | grub_add_tab + fi +@@ -281,11 +285,15 @@ while [ "x$list" != "x" ] ; do + fi + + if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; then +- linux_entry "${OS}" "${version}" simple \ ++ linux_entry "${OS}" "${version}" simple standard \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then ++ linux_entry "${OS}" "${version}" simple debug \ ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} ${GRUB_CMDLINE_LINUX_DEBUG}" ++ fi + + submenu_indentation="$grub_tab" +- ++ + if [ -z "$boot_device_id" ]; then + boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")" + fi +@@ -294,10 +302,15 @@ while [ "x$list" != "x" ] ; do + is_top_level=false + fi + +- linux_entry "${OS}" "${version}" advanced \ ++ linux_entry "${OS}" "${version}" advanced standard \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" ++ if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then ++ linux_entry "${OS}" "${version}" advanced debug \ ++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} ${GRUB_CMDLINE_LINUX_DEBUG}" ++ fi ++ + if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then +- linux_entry "${OS}" "${version}" recovery \ ++ linux_entry "${OS}" "${version}" recovery standard \ + "single ${GRUB_CMDLINE_LINUX}" + fi + +-- +2.7.4 + diff --git a/SOURCES/0204-Fix-coverity-issues-in-shell-scripts-1226325.patch b/SOURCES/0204-Fix-coverity-issues-in-shell-scripts-1226325.patch new file mode 100644 index 0000000..f64a934 --- /dev/null +++ b/SOURCES/0204-Fix-coverity-issues-in-shell-scripts-1226325.patch @@ -0,0 +1,62 @@ +From 29ff89559666ce12e55f35075de3b49c5125e9d2 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Thu, 7 Jul 2016 15:05:26 -0400 +Subject: [PATCH 204/206] Fix coverity issues in shell scripts (#1226325) + +Remove unused variables called out by coverity. Convert a non-quoted +variable to a quoted variable without use of deprecated backticks. + +Related: rhbz#1226325 +--- + util/grub-get-kernel-settings.in | 9 --------- + util/grub-mkconfig.in | 2 +- + 2 files changed, 1 insertion(+), 10 deletions(-) + +diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in +index ae0b469..cee8c20 100644 +--- a/util/grub-get-kernel-settings.in ++++ b/util/grub-get-kernel-settings.in +@@ -21,27 +21,18 @@ prefix="@prefix@" + exec_prefix="@exec_prefix@" + datarootdir="@datarootdir@" + +-prefix="@prefix@" + exec_prefix="@exec_prefix@" + sbindir="@sbindir@" + bindir="@bindir@" +-sysconfdir="@sysconfdir@" + PACKAGE_NAME=@PACKAGE_NAME@ + PACKAGE_VERSION=@PACKAGE_VERSION@ +-host_os=@host_os@ + datadir="@datadir@" + if [ "x$pkgdatadir" = x ]; then + pkgdatadir="${datadir}/@PACKAGE@" + fi +-grub_cfg="" + + self=`basename $0` + +-grub_probe="${sbindir}/@grub_probe@" +-grub_file="${bindir}/@grub_file@" +-grub_editenv="${bindir}/@grub_editenv@" +-grub_script_check="${bindir}/@grub_script_check@" +- + export TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAINDIR="@localedir@" + +diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in +index aa4fdb8..86801aa 100644 +--- a/util/grub-mkconfig.in ++++ b/util/grub-mkconfig.in +@@ -149,7 +149,7 @@ if test -f ${sysconfdir}/default/grub ; then + . ${sysconfdir}/default/grub + fi + +-eval `${grub_get_kernel_settings}` || true ++eval "$("${grub_get_kernel_settings}")" || true + + if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then + GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" +-- +2.5.5 + diff --git a/SOURCES/0205-Fix-compiler-warning-1154226.patch b/SOURCES/0205-Fix-compiler-warning-1154226.patch new file mode 100644 index 0000000..fdd0c39 --- /dev/null +++ b/SOURCES/0205-Fix-compiler-warning-1154226.patch @@ -0,0 +1,30 @@ +From 2a0f2809feead3fae444278bc52270f761e8dd8f Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Thu, 7 Jul 2016 16:30:32 -0400 +Subject: [PATCH 205/206] Fix compiler warning (#1154226) + +Coverity threw a compiler warning for an incompatible pointer type when +referencing a union. Converted the argument to pass the exact member of the +union instead of just the union itself. + +Related: rhbz#1154226 +--- + grub-core/net/drivers/efi/efinet.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index 9bab4bb..e1955bc 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -488,7 +488,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + sizeof (hwaddr.mac)); + + grub_net_configure_by_dhcpv6_ack (card->name, card, 0, +- &hwaddr, &pxe_mode->dhcp_ack, ++ &hwaddr, &pxe_mode->dhcp_ack.dhcpv6, + 1, device, path); + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); + } +-- +2.5.5 + diff --git a/SOURCES/0206-Fix-CLANG-error-from-Coverity-1154226.patch b/SOURCES/0206-Fix-CLANG-error-from-Coverity-1154226.patch new file mode 100644 index 0000000..c2a7269 --- /dev/null +++ b/SOURCES/0206-Fix-CLANG-error-from-Coverity-1154226.patch @@ -0,0 +1,33 @@ +From 5be3c46a14e86443bb58a11d1d7ca52ecf01f418 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Mon, 11 Jul 2016 10:59:48 -0400 +Subject: [PATCH 206/206] Fix CLANG error from Coverity (#1154226) + +Resolved a null pointer deference warning from coverity. + +Related: rhbz#1154226 +--- + grub-core/net/url.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/url.c b/grub-core/net/url.c +index 537019f..1468582 100644 +--- a/grub-core/net/url.c ++++ b/grub-core/net/url.c +@@ -267,7 +267,12 @@ extract_http_url_info (char *url, int ssl, + } + + l = host_end - host_off; +- c = *host_end; ++ ++ if (host_end == NULL) ++ goto fail; ++ else ++ c = *host_end; ++ + *host_end = '\0'; + *host = grub_strndup (host_off, l); + *host_end = c; +-- +2.5.5 + diff --git a/SOURCES/0207-grub_ipv6_get_masksize-fix-loop-iteration-error.patch b/SOURCES/0207-grub_ipv6_get_masksize-fix-loop-iteration-error.patch new file mode 100644 index 0000000..c5ea945 --- /dev/null +++ b/SOURCES/0207-grub_ipv6_get_masksize-fix-loop-iteration-error.patch @@ -0,0 +1,28 @@ +From 2bc6e9ee668fec40cf8b18066bee0ac8977ca345 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 11 Jul 2016 15:43:01 -0400 +Subject: [PATCH 207/208] grub_ipv6_get_masksize: fix loop iteration error + +Related: rhbz#1154226 + +Signed-off-by: Peter Jones +--- + grub-core/net/net.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 81d3b62..19a81bc 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -983,7 +983,7 @@ grub_ipv6_get_masksize(grub_uint8_t *be_mask) + + mask = (grub_uint8_t *)mask16; + +- for (x = 15; x > 0; x++) ++ for (x = 15; x > 0; x--) + { + grub_uint8_t octet = mask[x]; + while (octet & 0x80) +-- +2.5.5 + diff --git a/SOURCES/0208-efinet-fix-some-coverity-gripes.patch b/SOURCES/0208-efinet-fix-some-coverity-gripes.patch new file mode 100644 index 0000000..b813831 --- /dev/null +++ b/SOURCES/0208-efinet-fix-some-coverity-gripes.patch @@ -0,0 +1,65 @@ +From af63e7cec2c4b0bcd59ff4d8ad323635443f3054 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 11 Jul 2016 15:57:28 -0400 +Subject: [PATCH 208/208] efinet: fix some coverity gripes. + +Related: rhbz#1154226 + +Signed-off-by: Peter Jones +--- + grub-core/net/bootp.c | 9 +++++---- + grub-core/net/drivers/efi/efinet.c | 11 +++++++---- + 2 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 4793ebc..46ce813 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -349,10 +349,11 @@ grub_net_configure_by_dhcpv6_ack (const char *name, + struct grub_net_network_level_address addr; + int mask = -1; + +- if (device) +- *device = 0; +- if (path) +- *path = 0; ++ if (!device || !path) ++ return NULL; ++ ++ *device = 0; ++ *path = 0; + + grub_dprintf ("net", "mac address is %02x:%02x:%02x:%02x:%02x:%02x\n", + hwaddr->mac[0], hwaddr->mac[1], hwaddr->mac[2], +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index e1955bc..ddee4e6 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -474,6 +474,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + if (pxe_mode->using_ipv6) + { + grub_net_link_level_address_t hwaddr; ++ struct grub_net_network_level_interface *intf; + + grub_dprintf ("efinet", "using ipv6 and dhcpv6\n"); + grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n", +@@ -487,10 +488,12 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + card->efi_net->mode->current_address, + sizeof (hwaddr.mac)); + +- grub_net_configure_by_dhcpv6_ack (card->name, card, 0, +- &hwaddr, &pxe_mode->dhcp_ack.dhcpv6, +- 1, device, path); +- grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); ++ intf = grub_net_configure_by_dhcpv6_ack (card->name, card, 0, ++ &hwaddr, ++ &pxe_mode->dhcp_ack.dhcpv6, ++ 1, device, path); ++ if (intf && device && path) ++ grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); + } + else + { +-- +2.5.5 + diff --git a/SOURCES/0209-Fix-another-coverity-gripe-about-a-missing-typecast.patch b/SOURCES/0209-Fix-another-coverity-gripe-about-a-missing-typecast.patch new file mode 100644 index 0000000..ade2d13 --- /dev/null +++ b/SOURCES/0209-Fix-another-coverity-gripe-about-a-missing-typecast.patch @@ -0,0 +1,33 @@ +From e328073ce9aad50f1996bf8c9f592e9fbe6d2f85 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 12 Jul 2016 10:23:42 -0400 +Subject: [PATCH 209/211] Fix another coverity gripe about a missing typecast. + +Related: rhbz#1154226 + +Signed-off-by: Peter Jones +--- + grub-core/net/drivers/efi/efinet.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index ddee4e6..329024b 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -488,10 +488,9 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + card->efi_net->mode->current_address, + sizeof (hwaddr.mac)); + +- intf = grub_net_configure_by_dhcpv6_ack (card->name, card, 0, +- &hwaddr, +- &pxe_mode->dhcp_ack.dhcpv6, +- 1, device, path); ++ intf = grub_net_configure_by_dhcpv6_ack (card->name, card, 0, &hwaddr, ++ (const struct grub_net_dhcpv6_packet *)&pxe_mode->dhcp_ack.dhcpv6, ++ 1, device, path); + if (intf && device && path) + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); + } +-- +2.7.4 + diff --git a/SOURCES/0210-Fix-duplicate-shell-entries-1226325.patch b/SOURCES/0210-Fix-duplicate-shell-entries-1226325.patch new file mode 100644 index 0000000..9eb0c00 --- /dev/null +++ b/SOURCES/0210-Fix-duplicate-shell-entries-1226325.patch @@ -0,0 +1,34 @@ +From 39d33ba8a3bc77fd16b3183b8a6e300c0930a878 Mon Sep 17 00:00:00 2001 +From: Robert Marshall +Date: Tue, 12 Jul 2016 10:25:16 -0400 +Subject: [PATCH 210/211] Fix duplicate shell entries (#1226325) + +Coverity discovered more of the same non-used shell variables that had +appeared more than once in the file. + +Related: rhbz#1226325 +--- + util/grub-get-kernel-settings.in | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in +index cee8c20..6a68a0e 100644 +--- a/util/grub-get-kernel-settings.in ++++ b/util/grub-get-kernel-settings.in +@@ -17,13 +17,6 @@ set -e + # You should have received a copy of the GNU General Public License + # along with GRUB. If not, see . + +-prefix="@prefix@" +-exec_prefix="@exec_prefix@" +-datarootdir="@datarootdir@" +- +-exec_prefix="@exec_prefix@" +-sbindir="@sbindir@" +-bindir="@bindir@" + PACKAGE_NAME=@PACKAGE_NAME@ + PACKAGE_VERSION=@PACKAGE_VERSION@ + datadir="@datadir@" +-- +2.7.4 + diff --git a/SOURCES/0211-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch b/SOURCES/0211-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch new file mode 100644 index 0000000..431d549 --- /dev/null +++ b/SOURCES/0211-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch @@ -0,0 +1,90 @@ +From cce5625f26ac5c724710a6416fb5a0bf1bb5449c Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 12 Jul 2016 11:59:39 -0400 +Subject: [PATCH 211/211] Coverity rightly noticed that + grub_ipv6_get_masksize() was broken. + +This fixes it with a version that even seems to work. + +Related: rhbz#1154226 + +Signed-off-by: Peter Jones +--- + grub-core/net/net.c | 27 ++++++++++++++++----------- + include/grub/net.h | 2 +- + 2 files changed, 17 insertions(+), 12 deletions(-) + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 19a81bc..36fc0d8 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -970,29 +970,34 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa + } + + int +-grub_ipv6_get_masksize(grub_uint8_t *be_mask) ++grub_ipv6_get_masksize (grub_uint16_t be_mask[8]) + { + grub_uint8_t *mask; + grub_uint16_t mask16[8]; +- unsigned int x; +- int ret = 0; ++ int x, y; ++ int ret = 128; + +- grub_memcpy (mask16, be_mask, sizeof(mask16)); ++ grub_memcpy (mask16, be_mask, sizeof (mask16)); + for (x = 0; x < 8; x++) + mask16[x] = grub_be_to_cpu16 (mask16[x]); + + mask = (grub_uint8_t *)mask16; + +- for (x = 15; x > 0; x--) ++ for (x = 15; x >= 0; x--) + { + grub_uint8_t octet = mask[x]; +- while (octet & 0x80) ++ if (!octet) + { +- ret++; +- octet <<= 1; ++ ret -= 8; ++ continue; ++ } ++ for (y = 0; y < 8; y++) ++ { ++ if (octet & (1 << y)) ++ break; ++ else ++ ret--; + } +- if (ret) +- ret += 8 * (15 - x); + break; + } + +@@ -1009,7 +1014,7 @@ grub_net_add_ipv6_local (struct grub_net_network_level_interface *inter, + return 0; + + if (mask == -1) +- mask = grub_ipv6_get_masksize ((grub_uint8_t *)inter->address.ipv6); ++ mask = grub_ipv6_get_masksize ((grub_uint16_t *)inter->address.ipv6); + + if (mask == -1) + return 0; +diff --git a/include/grub/net.h b/include/grub/net.h +index c7b8e2a..bd930f4 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -500,7 +500,7 @@ grub_net_configure_by_dhcpv6_ack (const char *name, + int is_def, char **device, char **path); + + int +-grub_ipv6_get_masksize(grub_uint8_t *mask); ++grub_ipv6_get_masksize(grub_uint16_t *mask); + + grub_err_t + grub_net_add_ipv6_local (struct grub_net_network_level_interface *inf, +-- +2.7.4 + diff --git a/SOURCES/0212-Export-grub-get-kernel-settings-variables.patch b/SOURCES/0212-Export-grub-get-kernel-settings-variables.patch new file mode 100644 index 0000000..ee2c806 --- /dev/null +++ b/SOURCES/0212-Export-grub-get-kernel-settings-variables.patch @@ -0,0 +1,54 @@ +From 8bc3b1f58b41c6b5e7e88ee9a19b13573d0f9b8c Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 25 Aug 2016 14:15:29 -0400 +Subject: [PATCH] Export grub-get-kernel-settings variables + +Without this export, the generators for various configs never get the +setting. + +Related: rhbz#1226325 + +Signed-off-by: Peter Jones +--- + util/grub-get-kernel-settings.in | 3 +++ + util/grub.d/10_linux.in | 6 +++--- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in +index 6a68a0e..1204621 100644 +--- a/util/grub-get-kernel-settings.in ++++ b/util/grub-get-kernel-settings.in +@@ -70,6 +70,9 @@ fi + + if [ "$MAKEDEBUG" = "yes" ]; then + echo GRUB_LINUX_MAKE_DEBUG=true ++ echo export GRUB_LINUX_MAKE_DEBUG + echo GRUB_CMDLINE_LINUX_DEBUG=\"systemd.log_level=debug systemd.log_target=kmsg\" ++ echo export GRUB_CMDLINE_LINUX_DEBUG + echo GRUB_LINUX_DEBUG_TITLE_POSTFIX=\" with debugging\" ++ echo export GRUB_LINUX_DEBUG_TITLE_POSTFIX + fi +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 0d0086d..bf0fb72 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -127,13 +127,13 @@ linux_entry () + quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" + title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" + fi ++ if [ x$isdebug = xdebug ]; then ++ title="$title${GRUB_LINUX_DEBUG_TITLE_POSTFIX}" ++ fi + echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + else + echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/" + fi +- if [ x$isdebug = xdebug ]; then +- title="$title${GRUB_LINUX_DEBUG_TITLE_POSTFIX}" +- fi + if [ x$type != xrecovery ] ; then + save_default_entry | grub_add_tab + fi +-- +2.7.4 + diff --git a/SOURCES/0213-Normalize-slashes-in-tftp-paths.patch b/SOURCES/0213-Normalize-slashes-in-tftp-paths.patch new file mode 100644 index 0000000..55851c5 --- /dev/null +++ b/SOURCES/0213-Normalize-slashes-in-tftp-paths.patch @@ -0,0 +1,62 @@ +From 666d312cbf728d965791eade221430fb69f63d5a Mon Sep 17 00:00:00 2001 +From: Lenny Szubowicz +Date: Mon, 29 Aug 2016 11:04:48 -0400 +Subject: [PATCH] Normalize slashes in tftp paths. + +Some tftp servers do not handle multiple consecutive slashes correctly; +this patch avoids sending tftp requests with non-normalized paths. + +Signed-off-by: Peter Jones +--- + grub-core/net/tftp.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c +index 22a4deb..8632339 100644 +--- a/grub-core/net/tftp.c ++++ b/grub-core/net/tftp.c +@@ -300,6 +300,25 @@ destroy_pq (tftp_data_t data) + grub_priority_queue_destroy (data->pq); + } + ++/* Create a normalized copy of the filename. ++ Compress any string of consecutive forward slashes to a single forward ++ slash. */ ++static void ++grub_normalize_filename (char *normalized, const char *filename) ++{ ++ char *dest = normalized; ++ char *src = filename; ++ ++ while (*src != '\0') ++ { ++ if (src[0] == '/' && src[1] == '/') ++ src++; ++ else ++ *dest++ = *src++; ++ } ++ *dest = '\0'; ++} ++ + static grub_err_t + tftp_open (struct grub_file *file, const char *filename) + { +@@ -334,9 +353,12 @@ tftp_open (struct grub_file *file, const char *filename) + rrqlen = 0; + + tftph->opcode = grub_cpu_to_be16 (TFTP_RRQ); +- grub_strcpy (rrq, filename); +- rrqlen += grub_strlen (filename) + 1; +- rrq += grub_strlen (filename) + 1; ++ ++ /* Copy and normalize the filename to work-around issues on some tftp ++ servers when file names are being matched for remapping. */ ++ grub_normalize_filename (rrq, filename); ++ rrqlen += grub_strlen (rrq) + 1; ++ rrq += grub_strlen (rrq) + 1; + + grub_strcpy (rrq, "octet"); + rrqlen += grub_strlen ("octet") + 1; +-- +2.7.4 + diff --git a/SOURCES/grub.patches b/SOURCES/grub.patches new file mode 100644 index 0000000..8c7d946 --- /dev/null +++ b/SOURCES/grub.patches @@ -0,0 +1,212 @@ +Patch0001: 0001-fix-EFI-detection-on-Windows.patch +Patch0002: 0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch +Patch0003: 0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch +Patch0004: 0004-NEWS-First-draft-of-2.02-entry.patch +Patch0005: 0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch +Patch0006: 0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +Patch0007: 0007-remove-unused-error.h-from-kern-emu-misc.c.patch +Patch0008: 0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch +Patch0009: 0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch +Patch0010: 0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch +Patch0011: 0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch +Patch0012: 0012-fix-32-bit-compilation-on-MinGW-w64.patch +Patch0013: 0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch +Patch0014: 0014-arm64-set-correct-length-of-device-path-end-entry.patch +Patch0015: 0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch +Patch0016: 0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch +Patch0017: 0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch +Patch0018: 0018-Prefer-more-portable-test-1-constructs.patch +Patch0019: 0019-NEWS-Add-few-missing-entries.patch +Patch0020: 0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch +Patch0021: 0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch +Patch0022: 0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch +Patch0023: 0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch +Patch0024: 0024-Fix-ChangeLog-date.patch +Patch0025: 0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch +Patch0026: 0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch +Patch0027: 0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch +Patch0028: 0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch +Patch0029: 0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch +Patch0030: 0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch +Patch0031: 0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch +Patch0032: 0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch +Patch0033: 0033-util-grub-install.c-Fix-a-typo.patch +Patch0034: 0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch +Patch0035: 0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch +Patch0036: 0036-change-stop-condition-to-avoid-infinite-loops.patch +Patch0037: 0037-increase-network-try-interval-gradually.patch +Patch0038: 0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch +Patch0039: 0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch +Patch0040: 0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch +Patch0041: 0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch +Patch0042: 0042-util-grub-install.c-List-available-targets.patch +Patch0043: 0043-Fix-several-translatable-strings.patch +Patch0044: 0044-do-not-set-default-prefix-in-grub-mkimage.patch +Patch0045: 0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch +Patch0046: 0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch +Patch0047: 0047-grub-install-support-for-partitioned-partx-loop-devi.patch +Patch0048: 0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch +Patch0049: 0049-.gitignore-add-missing-files-and-.exe-variants.patch +Patch0050: 0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch +Patch0051: 0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch +Patch0052: 0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch +Patch0053: 0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch +Patch0054: 0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch +Patch0055: 0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch +Patch0056: 0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch +Patch0057: 0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch +Patch0058: 0058-add-grub_env_set_net_property-function.patch +Patch0059: 0059-add-bootpath-parser-for-open-firmware.patch +Patch0060: 0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch +Patch0061: 0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch +Patch0062: 0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch +Patch0063: 0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch +Patch0064: 0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch +Patch0065: 0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch +Patch0066: 0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch +Patch0067: 0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch +Patch0068: 0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch +Patch0069: 0069-Fix-grub-probe-0-option.patch +Patch0070: 0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch +Patch0071: 0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch +Patch0072: 0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch +Patch0073: 0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch +Patch0074: 0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch +Patch0075: 0075-Add-missing-endif.patch +Patch0076: 0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch +Patch0077: 0077-Improve-LVM-logical_volumes-string-matching.patch +Patch0078: 0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch +Patch0079: 0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch +Patch0080: 0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch +Patch0081: 0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch +Patch0082: 0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch +Patch0083: 0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch +Patch0084: 0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch +Patch0085: 0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch +Patch0086: 0086-util-grub-install.c-Fix-handling-of-disk-module.patch +Patch0087: 0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch +Patch0088: 0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch +Patch0089: 0089-Migrate-PPC-from-Yaboot-to-Grub2.patch +Patch0090: 0090-Add-fw_path-variable-revised.patch +Patch0091: 0091-Add-support-for-linuxefi.patch +Patch0092: 0092-Use-linuxefi-and-initrdefi-where-appropriate.patch +Patch0093: 0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch +Patch0094: 0094-Pass-x-hex-hex-straight-through-unmolested.patch +Patch0095: 0095-Fix-crash-on-http.patch +Patch0096: 0096-IBM-client-architecture-CAS-reboot-support.patch +Patch0097: 0097-Add-vlan-tag-support.patch +Patch0098: 0098-Add-X-option-to-printf-functions.patch +Patch0099: 0099-DHCP-client-ID-and-UUID-options-added.patch +Patch0100: 0100-Search-for-specific-config-file-for-netboot.patch +Patch0101: 0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch +Patch0102: 0102-Move-bash-completion-script-922997.patch +Patch0103: 0103-for-ppc-reset-console-display-attr-when-clear-screen.patch +Patch0104: 0104-Don-t-write-messages-to-the-screen.patch +Patch0105: 0105-Don-t-print-GNU-GRUB-header.patch +Patch0106: 0106-Don-t-add-to-highlighted-row.patch +Patch0107: 0107-Message-string-cleanups.patch +Patch0108: 0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch +Patch0109: 0109-Use-the-correct-indentation-for-the-term-help-text.patch +Patch0110: 0110-Indent-menu-entries.patch +Patch0111: 0111-Fix-margins.patch +Patch0112: 0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch +Patch0113: 0113-Disable-GRUB-video-support-for-IBM-power-machines.patch +Patch0114: 0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch +Patch0115: 0115-Use-linux16-when-appropriate-880840.patch +Patch0116: 0116-Enable-pager-by-default.-985860.patch +Patch0117: 0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch +Patch0118: 0118-Don-t-say-GNU-Linux-in-generated-menus.patch +Patch0119: 0119-Don-t-draw-a-border-around-the-menu.patch +Patch0120: 0120-Use-the-standard-margin-for-the-timeout-string.patch +Patch0121: 0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch +Patch0122: 0122-Add-.eh_frame-to-list-of-relocations-stripped.patch +Patch0123: 0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch +Patch0124: 0124-Don-t-print-during-fdt-loading-method.patch +Patch0125: 0125-Honor-a-symlink-when-generating-configuration-by-gru.patch +Patch0126: 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch +Patch0127: 0127-Don-t-require-a-password-to-boot-entries-generated-b.patch +Patch0128: 0128-Don-t-emit-Booting-.-message.patch +Patch0129: 0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch +Patch0130: 0130-May-as-well-try-it.patch +Patch0131: 0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch +Patch0132: 0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch +Patch0133: 0133-trim-arp-packets-with-abnormal-size.patch +Patch0134: 0134-Fix-convert-function-to-support-NVMe-devices.patch +Patch0135: 0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch +Patch0136: 0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch +Patch0137: 0137-Use-the-default-device-tree-from-the-grub-default-fi.patch +Patch0138: 0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0139: 0139-Reduce-timer-event-frequency-by-10.patch +Patch0140: 0140-always-return-error-to-UEFI.patch +Patch0141: 0141-Add-powerpc-little-endian-ppc64le-flags.patch +Patch0142: 0142-Files-reorganization-and-include-some-libgcc-fuction.patch +Patch0143: 0143-Suport-for-bi-endianess-in-elf-file.patch +Patch0144: 0144-Fix-exit-back-to-EFI-firmware.patch +Patch0145: 0145-Add-grub_util_readlink.patch +Patch0146: 0146-Make-editenv-chase-symlinks-including-those-across-d.patch +Patch0147: 0147-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch +Patch0148: 0148-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch +Patch0149: 0149-Add-GRUB_DISABLE_UUID.patch +Patch0150: 0150-Allow-fallback-to-include-entries-by-title-not-just-.patch +Patch0151: 0151-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch +Patch0152: 0152-Load-arm-with-SB-enabled.patch +Patch0153: 0153-Fix-up-some-man-pages-rpmdiff-noticed.patch +Patch0154: 0154-Try-prefix-if-fw_path-doesn-t-work.patch +Patch0155: 0155-Update-info-with-grub.cfg-netboot-selection-order-11.patch +Patch0156: 0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +Patch0157: 0157-efidisk-move-device-path-helpers-in-core-for-efinet.patch +Patch0158: 0158-efinet-Check-for-immediate-completition.patch +Patch0159: 0159-efinet-memory-leak-on-module-removal.patch +Patch0160: 0160-efinet-cannot-free-const-char-pointer.patch +Patch0161: 0161-Revert-efinet-memory-leak-on-module-removal.patch +Patch0162: 0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch +Patch0163: 0163-efinet-open-Simple-Network-Protocol-exclusively.patch +Patch0164: 0164-efinet-enable-hardware-filters-when-opening-interfac.patch +Patch0165: 0165-efinet-handle-get_status-on-buggy-firmware-properly.patch +Patch0166: 0166-Handle-rssd-storage-devices.patch +Patch0167: 0167-xfs-Fix-termination-loop-for-directory-iteration.patch +Patch0168: 0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch +Patch0169: 0169-xfs-Add-helpers-for-inode-size.patch +Patch0170: 0170-xfs-V5-filesystem-format-support.patch +Patch0171: 0171-xfs-silence-Coverity-overflow-warning.patch +Patch0172: 0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch +Patch0173: 0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch +Patch0174: 0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch +Patch0175: 0175-fix-memory-corruption-in-pubkey-filter-over-network.patch +Patch0176: 0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch +Patch0177: 0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch +Patch0178: 0178-Add-friendly-grub2-password-config-tool-985962.patch +Patch0179: 0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch +Patch0180: 0180-ppc64le-sync-mkconfig-to-disk-1212114.patch +Patch0181: 0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch +Patch0182: 0182-tcp-add-window-scaling-support.patch +Patch0183: 0183-efinet-retransmit-if-our-device-is-busy.patch +Patch0185: 0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +Patch0186: 0186-Fix-security-issue-when-reading-username-and-passwor.patch +Patch0187: 0187-01_users-Handle-GRUB_PASSWORD-better.patch +Patch0188: 0188-Failed-config-now-returns-exit-code-1252311.patch +Patch0189: 0189-Warn-if-grub-password-will-not-be-read-1290803.patch +Patch0190: 0190-Clean-up-grub-setpassword-documentation-1290799.patch +Patch0191: 0191-Fix-locale-issue-in-grub-setpassword-1294243.patch +Patch0192: 0192-efi-really-mark-memory-of-unknown-type-as-reserved.patch +Patch0193: 0193-Translate-UEFI-persistent-memory-type.patch +Patch0194: 0194-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch +Patch0195: 0195-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch +Patch0196: 0196-efiemu-Fix-compilation-failure.patch +Patch0197: 0197-devmapper-getroot-use-makedev-instead-of-direct-shif.patch +Patch0198: 0198-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch +Patch0199: 0199-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +Patch0200: 0200-Add-a-url-parser.patch +Patch0201: 0201-efinet-and-bootp-add-support-for-dhcpv6.patch +Patch0202: 0202-ppc64le-has-no-separate-boot-mount-1261926.patch +Patch0203: 0203-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +Patch0204: 0204-Fix-coverity-issues-in-shell-scripts-1226325.patch +Patch0205: 0205-Fix-compiler-warning-1154226.patch +Patch0206: 0206-Fix-CLANG-error-from-Coverity-1154226.patch +Patch0207: 0207-grub_ipv6_get_masksize-fix-loop-iteration-error.patch +Patch0208: 0208-efinet-fix-some-coverity-gripes.patch +Patch0209: 0209-Fix-another-coverity-gripe-about-a-missing-typecast.patch +Patch0210: 0210-Fix-duplicate-shell-entries-1226325.patch +Patch0211: 0211-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch +Patch0212: 0212-Export-grub-get-kernel-settings-variables.patch +Patch0213: 0213-Normalize-slashes-in-tftp-paths.patch diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec index a8a34cc..941993f 100644 --- a/SPECS/grub2.spec +++ b/SPECS/grub2.spec @@ -33,9 +33,6 @@ %if 0%{?fedora} %global efidir fedora %endif -%if 0%{?centos} -%global efidir centos -%endif %endif @@ -45,7 +42,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 0.34%{?dist} +Release: 0.44%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base @@ -54,202 +51,15 @@ URL: http://www.gnu.org/software/grub/ Obsoletes: grub < 1:0.98 Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz #Source0: ftp://ftp.gnu.org/gnu/grub/grub-%%{tarversion}.tar.xz -Source1: centos.cer -#(source removed) +Source1: securebootca.cer +Source2: secureboot.cer +Source3: grub.patches Source4: http://unifoundry.com/unifont-5.1.20080820.pcf.gz Source5: theme.tar.bz2 Source6: gitignore #Source6: grub-cd.cfg -Patch0001: 0001-fix-EFI-detection-on-Windows.patch -Patch0002: 0002-grub-core-kern-arm-cache_armv6.S-Remove-.arch-direct.patch -Patch0003: 0003-INSTALL-Cross-compiling-the-GRUB-Fix-some-spelling-m.patch -Patch0004: 0004-NEWS-First-draft-of-2.02-entry.patch -Patch0005: 0005-Merge-branch-master-of-git.sv.gnu.org-srv-git-grub.patch -Patch0006: 0006-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch -Patch0007: 0007-remove-unused-error.h-from-kern-emu-misc.c.patch -Patch0008: 0008-Don-t-abort-on-unavailable-coreboot-tables-if-not-ru.patch -Patch0009: 0009-NEWS-Add-few-missing-entries.-Correct-existing-ones.patch -Patch0010: 0010-strip-.eh_frame-section-from-arm64-efi-kernel.patch -Patch0011: 0011-use-grub-boot-aa64.efi-for-boot-images-on-AArch64.patch -Patch0012: 0012-fix-32-bit-compilation-on-MinGW-w64.patch -Patch0013: 0013-Change-grub-mkrescue-to-use-bootaa64.efi-too.patch -Patch0014: 0014-arm64-set-correct-length-of-device-path-end-entry.patch -Patch0015: 0015-Makefile.util.def-grub-macbless-Change-mansection-to.patch -Patch0016: 0016-add-part_apple-to-EFI-rescue-image-to-fix-missing-pr.patch -Patch0017: 0017-freebsd-hostdisk.c-is-only-ever-compiled-on-FreeBSD.patch -Patch0018: 0018-Prefer-more-portable-test-1-constructs.patch -Patch0019: 0019-NEWS-Add-few-missing-entries.patch -Patch0020: 0020-grub-core-kern-efi-efi.c-Ensure-that-the-result-star.patch -Patch0021: 0021-util-grub-mount.c-Extend-GCC-warning-workaround-to-g.patch -Patch0022: 0022-reintroduce-BUILD_LDFLAGS-for-the-cross-compile-case.patch -Patch0023: 0023-grub-core-term-terminfo.c-Recognize-keys-F1-F12.patch -Patch0024: 0024-Fix-ChangeLog-date.patch -Patch0025: 0025-Use-_W64-to-detect-MinGW-W64-32-instead-of-_FILE_OFF.patch -Patch0026: 0026-add-BUILD_EXEEXT-support-to-fix-make-clean-on-Window.patch -Patch0027: 0027-fix-include-loop-on-MinGW-due-to-libintl.h-pulling-s.patch -Patch0028: 0028-grub-core-commands-macbless.c-Rename-FILE-and-DIR-to.patch -Patch0029: 0029-Makefile.util.def-Link-grub-ofpathname-with-zfs-libs.patch -Patch0030: 0030-Makefile.am-default_payload.elf-Add-modules.patch -Patch0031: 0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch -Patch0032: 0032-grub-core-normal-main.c-read_config_file-Buffer-conf.patch -Patch0033: 0033-util-grub-install.c-Fix-a-typo.patch -Patch0034: 0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch -Patch0035: 0035-Ignore-EPERM-when-modifying-kern.geom.debugflags.patch -Patch0036: 0036-change-stop-condition-to-avoid-infinite-loops.patch -Patch0037: 0037-increase-network-try-interval-gradually.patch -Patch0038: 0038-look-for-DejaVu-also-in-usr-share-fonts-truetype.patch -Patch0039: 0039-Show-detected-path-to-DejaVuSans-in-configure-summar.patch -Patch0040: 0040-add-GRUB_WINDOWS_EXTRA_DIST-to-allow-shipping-runtim.patch -Patch0041: 0041-util-grub-install.c-write_to_disk-Add-an-info-messag.patch -Patch0042: 0042-util-grub-install.c-List-available-targets.patch -Patch0043: 0043-Fix-several-translatable-strings.patch -Patch0044: 0044-do-not-set-default-prefix-in-grub-mkimage.patch -Patch0045: 0045-fix-Mingw-W64-32-cross-compile-failure-due-to-printf.patch -Patch0046: 0046-grub-core-term-serial.c-grub_serial_register-Fix-inv.patch -Patch0047: 0047-grub-install-support-for-partitioned-partx-loop-devi.patch -Patch0048: 0048-grub-core-term-at_keyboard.c-Tolerate-missing-keyboa.patch -Patch0049: 0049-.gitignore-add-missing-files-and-.exe-variants.patch -Patch0050: 0050-util-grub-mkfont.c-Downgrade-warnings-about-unhandle.patch -Patch0051: 0051-grub-core-disk-ahci.c-Do-not-enable-I-O-decoding-and.patch -Patch0052: 0052-grub-core-disk-ahci.c-Allocate-and-clean-space-for-a.patch -Patch0053: 0053-grub-core-disk-ahci.c-Add-safety-cleanups.patch -Patch0054: 0054-grub-core-disk-ahci.c-Properly-handle-transactions-w.patch -Patch0055: 0055-grub-core-disk-ahci.c-Increase-timeout.-Some-SSDs-ta.patch -Patch0056: 0056-util-grub-mkfont.c-Build-fix-for-argp.h-with-older-g.patch -Patch0057: 0057-util-grub-mkrescue.c-Build-fix-for-argp.h-with-older.patch -Patch0058: 0058-add-grub_env_set_net_property-function.patch -Patch0059: 0059-add-bootpath-parser-for-open-firmware.patch -Patch0060: 0060-grub-core-disk-ahci.c-Ignore-NPORTS-field-and-rely-o.patch -Patch0061: 0061-grub-core-kern-i386-coreboot-mmap.c-Filter-out-0xa00.patch -Patch0062: 0062-grub-core-loader-i386-multiboot_mbi.c-grub_multiboot.patch -Patch0063: 0063-grub-core-mmap-i386-uppermem.c-lower_hook-COREBOOT-I.patch -Patch0064: 0064-grub-core-kern-i386-pc-mmap.c-Fallback-to-EISA-memor.patch -Patch0065: 0065-include-grub-i386-openbsd_bootarg.h-Add-addr-and-fre.patch -Patch0066: 0066-ieee1275-check-for-IBM-pseries-emulated-machine.patch -Patch0067: 0067-grub-core-loader-arm64-linux.c-Remove-redundant-0x.patch -Patch0068: 0068-grub-core-lib-relocator.c-Fix-the-case-when-end-of-l.patch -Patch0069: 0069-Fix-grub-probe-0-option.patch -Patch0070: 0070-Fix-partmap-cryptodisk-and-abstraction-handling-in-g.patch -Patch0071: 0071-btrfs-fix-get_root-key-comparison-failures-due-to-en.patch -Patch0072: 0072-grub-core-osdep-linux-getroot.c-grub_util_part_to_di.patch -Patch0073: 0073-Replace-few-instances-of-memcmp-memcpy-in-the-code-t.patch -Patch0074: 0074-include-grub-libgcc.h-Remove-ctzsi2-and-ctzdi2.-They.patch -Patch0075: 0075-Add-missing-endif.patch -Patch0076: 0076-grub-core-lib-syslinux_parse.c-Fix-timeout-quoting.patch -Patch0077: 0077-Improve-LVM-logical_volumes-string-matching.patch -Patch0078: 0078-Tolerate-devices-with-no-filesystem-UUID-returned-by.patch -Patch0079: 0079-Allow-loading-old-kernels-by-placing-GDT-in-conventi.patch -Patch0080: 0080-grub-core-kern-misc.c-__bzero-Don-t-compile-in-GRUB_.patch -Patch0081: 0081-grub-core-commands-verify.c-grub_pubkey_open-Fix-mem.patch -Patch0082: 0082-grub-core-commands-verify.c-grub_pubkey_open-Trust-p.patch -Patch0083: 0083-util-grub-gen-asciih.c-add_glyph-Fix-uninitialised-v.patch -Patch0084: 0084-grub-core-commands-efi-lsefisystab.c-grub_cmd_lsefis.patch -Patch0085: 0085-grub-core-loader-i386-bsd.c-grub_netbsd_boot-Pass-po.patch -Patch0086: 0086-util-grub-install.c-Fix-handling-of-disk-module.patch -Patch0087: 0087-grub-core-commands-loadenv.c-check_blocklists-Fix-ov.patch -Patch0088: 0088-NEWS-The-cmosclean-command-in-fact-dates-back-to-1.9.patch -Patch0089: 0089-Migrate-PPC-from-Yaboot-to-Grub2.patch -Patch0090: 0090-Add-fw_path-variable-revised.patch -Patch0091: 0091-Add-support-for-linuxefi.patch -Patch0092: 0092-Use-linuxefi-and-initrdefi-where-appropriate.patch -Patch0093: 0093-Don-t-allow-insmod-when-secure-boot-is-enabled.patch -Patch0094: 0094-Pass-x-hex-hex-straight-through-unmolested.patch -Patch0095: 0095-Fix-crash-on-http.patch -Patch0096: 0096-IBM-client-architecture-CAS-reboot-support.patch -Patch0097: 0097-Add-vlan-tag-support.patch -Patch0098: 0098-Add-X-option-to-printf-functions.patch -Patch0099: 0099-DHCP-client-ID-and-UUID-options-added.patch -Patch0100: 0100-Search-for-specific-config-file-for-netboot.patch -Patch0101: 0101-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch -Patch0102: 0102-Move-bash-completion-script-922997.patch -Patch0103: 0103-for-ppc-reset-console-display-attr-when-clear-screen.patch -Patch0104: 0104-Don-t-write-messages-to-the-screen.patch -Patch0105: 0105-Don-t-print-GNU-GRUB-header.patch -Patch0106: 0106-Don-t-add-to-highlighted-row.patch -Patch0107: 0107-Message-string-cleanups.patch -Patch0108: 0108-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch -Patch0109: 0109-Use-the-correct-indentation-for-the-term-help-text.patch -Patch0110: 0110-Indent-menu-entries.patch -Patch0111: 0111-Fix-margins.patch -Patch0112: 0112-Add-support-for-UEFI-operating-systems-returned-by-o.patch -Patch0113: 0113-Disable-GRUB-video-support-for-IBM-power-machines.patch -Patch0114: 0114-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch -Patch0115: 0115-Use-linux16-when-appropriate-880840.patch -Patch0116: 0116-Enable-pager-by-default.-985860.patch -Patch0117: 0117-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch -Patch0118: 0118-Don-t-say-GNU-Linux-in-generated-menus.patch -Patch0119: 0119-Don-t-draw-a-border-around-the-menu.patch -Patch0120: 0120-Use-the-standard-margin-for-the-timeout-string.patch -Patch0121: 0121-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch -Patch0122: 0122-Add-.eh_frame-to-list-of-relocations-stripped.patch -Patch0123: 0123-Make-10_linux-work-with-our-changes-for-linux16-and-.patch -Patch0124: 0124-Don-t-print-during-fdt-loading-method.patch -Patch0125: 0125-Honor-a-symlink-when-generating-configuration-by-gru.patch -Patch0126: 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch -Patch0127: 0127-Don-t-require-a-password-to-boot-entries-generated-b.patch -Patch0128: 0128-Don-t-emit-Booting-.-message.patch -Patch0129: 0129-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch -Patch0130: 0130-May-as-well-try-it.patch -Patch0131: 0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch -Patch0132: 0132-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch -Patch0133: 0133-trim-arp-packets-with-abnormal-size.patch -Patch0134: 0134-Fix-convert-function-to-support-NVMe-devices.patch -Patch0135: 0135-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch -Patch0136: 0136-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch -Patch0137: 0137-Use-the-default-device-tree-from-the-grub-default-fi.patch -Patch0138: 0138-reopen-SNP-protocol-for-exclusive-use-by-grub.patch -Patch0139: 0139-Reduce-timer-event-frequency-by-10.patch -Patch0140: 0140-always-return-error-to-UEFI.patch -Patch0141: 0141-Add-powerpc-little-endian-ppc64le-flags.patch -Patch0142: 0142-Files-reorganization-and-include-some-libgcc-fuction.patch -Patch0143: 0143-Suport-for-bi-endianess-in-elf-file.patch -Patch0144: 0001-Fix-exit-back-to-EFI-firmware.patch -Patch0145: 0144-Add-grub_util_readlink.patch -Patch0146: 0145-Make-editenv-chase-symlinks-including-those-across-d.patch -Patch0147: 0001-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch -Patch0148: 0001-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch -Patch0149: 0001-Add-GRUB_DISABLE_UUID.patch -Patch0150: 0001-Allow-fallback-to-include-entries-by-title-not-just-.patch -Patch0151: 0001-Initialized-initrd_ctx-so-we-don-t-free-a-random-poi.patch -Patch0152: 0002-Load-arm-with-SB-enabled.patch -Patch0153: 0001-Fix-up-some-man-pages-rpmdiff-noticed.patch -Patch0154: 0001-Try-prefix-if-fw_path-doesn-t-work.patch -Patch0155: 0001-Update-info-with-grub.cfg-netboot-selection-order-11.patch -Patch0156: 0002-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch -Patch0157: 0001-efidisk-move-device-path-helpers-in-core-for-efinet.patch -Patch0158: 0158-efinet-Check-for-immediate-completition.patch -Patch0159: 0159-efinet-memory-leak-on-module-removal.patch -Patch0160: 0160-efinet-cannot-free-const-char-pointer.patch -Patch0161: 0161-Revert-efinet-memory-leak-on-module-removal.patch -Patch0162: 0162-efinet-skip-virtual-IPv4-and-IPv6-devices-when-enume.patch -Patch0163: 0163-efinet-open-Simple-Network-Protocol-exclusively.patch -Patch0164: 0164-efinet-enable-hardware-filters-when-opening-interfac.patch -Patch0165: 0165-efinet-handle-get_status-on-buggy-firmware-properly.patch -Patch0166: 0166-Handle-rssd-storage-devices.patch -Patch0167: 0167-xfs-Fix-termination-loop-for-directory-iteration.patch -Patch0168: 0168-xfs-Convert-inode-numbers-to-cpu-endianity-immediate.patch -Patch0169: 0169-xfs-Add-helpers-for-inode-size.patch -Patch0170: 0170-xfs-V5-filesystem-format-support.patch -Patch0171: 0171-xfs-silence-Coverity-overflow-warning.patch -Patch0172: 0172-send-router-solicitation-for-ipv6-address-autoconf-v.patch -Patch0173: 0173-icmp6-fix-no-respond-to-neighbor-solicit-message.patch -Patch0174: 0174-calibrate_tsc-use-the-Stall-EFI-boot-service-on-GRUB.patch -Patch0175: 0175-fix-memory-corruption-in-pubkey-filter-over-network.patch -Patch0176: 0176-Make-grub2-mkconfig-construct-titles-that-look-like-.patch -Patch0177: 0177-don-t-strip-fw_path-twice-for-EFI-network-boot.patch -Patch0178: 0178-Add-friendly-grub2-password-config-tool-985962.patch -Patch0179: 0179-Try-to-make-sure-configure.ac-and-grub-rpm-sort-play.patch -Patch0180: 0180-ppc64le-sync-mkconfig-to-disk-1212114.patch -Patch0181: 0181-tcp-ack-when-we-get-an-OOO-lost-packet.patch -Patch0182: 0182-tcp-add-window-scaling-support.patch -Patch0183: 0183-efinet-retransmit-if-our-device-is-busy.patch -Patch0184: 0184-Be-more-aggro-about-actually-using-the-configured-ne.patch -Patch0185: 0185-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch -Patch0186: 0186-Fix-security-issue-when-reading-username-and-passwor.patch -Patch0187: 0187-01_users-Handle-GRUB_PASSWORD-better.patch - -Patch9999: 0001-centos-grub2-password-fix.patch +%include %{SOURCE3} BuildRequires: flex bison binutils python BuildRequires: ncurses-devel xz-devel bzip2-devel @@ -381,11 +191,11 @@ cd grub-efi-%{tarversion} make %{?_smp_mflags} GRUB_MODULES=" all_video boot btrfs cat chain configfile echo efifwsetup \ - efinet ext2 fat font gfxmenu gfxterm gzio halt hfsplus iso9660 \ - jpeg loadenv lvm mdraid09 mdraid1x minicmd normal part_apple \ - part_msdos part_gpt password_pbkdf2 png reboot search \ - search_fs_uuid search_fs_file search_label sleep syslinuxcfg \ - test tftp regexp video xfs" + efinet ext2 fat font gfxmenu gfxterm gzio halt hfsplus http \ + iso9660 jpeg loadenv lvm mdraid09 mdraid1x minicmd normal \ + part_apple part_msdos part_gpt password_pbkdf2 png \ + reboot search search_fs_uuid search_fs_file search_label \ + sleep syslinuxcfg test tftp regexp video xfs" %ifarch aarch64 GRUB_MODULES="${GRUB_MODULES} linux" %else @@ -399,8 +209,8 @@ GRUB_MODULES="${GRUB_MODULES} linuxefi" mv %{grubefiname}.orig %{grubefiname} mv %{grubeficdname}.orig %{grubeficdname} %else -%pesign -s -i %{grubefiname}.orig -o %{grubefiname} -a %{SOURCE1} -c %{SOURCE1} -n redhatsecureboot301 -%pesign -s -i %{grubeficdname}.orig -o %{grubeficdname} -a %{SOURCE1} -c %{SOURCE1} -n redhatsecureboot301 +%pesign -s -i %{grubefiname}.orig -o %{grubefiname} -a %{SOURCE1} -c %{SOURCE2} -n redhatsecureboot301 +%pesign -s -i %{grubeficdname}.orig -o %{grubeficdname} -a %{SOURCE1} -c %{SOURCE2} -n redhatsecureboot301 %endif cd .. %endif @@ -650,6 +460,7 @@ fi %dir %{_datarootdir}/grub/themes %{_datarootdir}/grub/* %{_sbindir}/%{name}-bios-setup +%{_sbindir}/%{name}-get-kernel-settings %{_sbindir}/%{name}-install %{_sbindir}/%{name}-macbless %{_sbindir}/%{name}-mkconfig @@ -698,37 +509,113 @@ fi %doc grub-%{tarversion}/grub.html %doc grub-%{tarversion}/grub-dev.html grub-%{tarversion}/docs/font_char_metrics.png %doc %{_mandir}/man1/* +%doc %{_mandir}/man3/* %doc %{_mandir}/man8/* %dir /boot/%{name}/themes/ %dir %{_datarootdir}/grub/themes %exclude %{_datarootdir}/grub/themes/starfield %changelog -* Tue Jan 05 2016 CentOS Sources - 2.02-0.34.el7.centos -- Roll in CentOS Secureboot keys -- Move the edidir to be CentOS, so people can co-install fedora, rhel and centos - -* Tue Dec 15 2015 Peter Jones - 2.02-0.34 -- Rebuild with the right credentials. - Related: rhbz#1290089 +* Mon Aug 29 2016 Peter Jones - 2.02-0.44 +- Work around tftp servers that don't work with multiple consecutive slashes in + file paths. + Resolves: rhbz#1217243 + +* Thu Aug 25 2016 Peter Jones - 2.02-0.42 +- Make grub2-mkconfig export grub2-get-kernel-settings variables correctly. + Related: rhbz#1226325 + +* Tue Aug 23 2016 Peter Jones - 2.02-0.42 +- Rebuild in the right build root. Again. + Related: rhbz#1273974 + +* Wed Jul 13 2016 Peter Jones - 2.02-0.41 +- Build with coverity patch I missed last time. + Related: rhbz#1226325 + +* Wed Jul 13 2016 rmarshall@redhat.com - 2.02-0.40 +- Build with coverity patches. + Related: rhbz#1226325 + +* Wed Jul 13 2016 Peter Jones +- Remove our patch to force a paricular uefi network interface + Related: rhbz#1273974 + Related: rhbz#1277599 + Related: rhbz#1298765 +- Update some more coverity issues + Related: rhbz#1226325 + Related: rhbz#1154226 + +* Mon Jul 11 2016 rmarshall@redhat.com - 2.02-0.39 +- Fix all issues discovered during coverity scan. + Related: rhbz#1154226 +- Fix a couple compiler and CLANG issues discovered during coverity scan. + Related: rhbz#1154226 +- Fix the last few CLANG issues and a deadcode issue discovered by the + coverity scan. + Related: rhbz#1154226 + +* Fri Jul 01 2016 Peter Jones - 2.02-0.38 +- Pick the right build target. Again. + Related: rhbz#1226325 + +* Tue Jun 21 2016 rmarshall@redhat.com - 2.02-0.37 +- Update fix for rhbz#1212114 to reflect the move to handling this case + in anaconda. + Related: rhbz#1315468 + Resolves: rhbz#1261926 +- Add grub2-get-kernel-settings to allow grub2-mkconfig to take grubby + configuration changes into account. + Resolves: rhbz#1226325 + +* Fri Jun 17 2016 Peter Jones - 2.02-0.36 +- Better support for EFI network booting with dhcpv6. + Resolves: rhbz#1154226 +- Back out a duplicate change resulting in some EFI network firmware drivers + not working properly. + Related: rhbz#1273974 + Related: rhbz#1277599 + Related: rhbz#1298765 + +* Mon Jun 06 2016 Peter Jones - 2.02-0.35 +- Don't use legacy methods to make device node variables. + Resolves: rhbz#1279599 +- Don't pad initramfs with zeros + Resolves: rhbz#1219864 + +* Thu Apr 28 2016 rmarshall@redhat.com 2.02-0.34 +- Exit grub-mkconfig with a proper code when the new configuration would be + invalid. + Resolves: rhbz#1252311 +- Warn users if grub-mkconfig needs to be run to add support for GRUB + passwords. + Resolves: rhbz#1290803 +- Fix the information in the --help and man pages for grub-setpassword + Resolves: rhbz#1290799 +- Fix issue where shell substitution expected non-translated output when + setting a bootloader password. + Resolves: rhbz#1294243 +- Fix an issue causing memory regions with unknown types to be marked available + through a series of backports from upstream. + Resolves: rhbz#1288608 * Thu Dec 10 2015 Peter Jones - 2.02-0.33 - Don't remove 01_users, it's the wrong thing to do. - Related:rhbz1290089 + Related: rhbz#1284370 * Wed Dec 09 2015 Peter Jones - 2.02-0.32 - Rebuild for .z so the release number is different. - Related: rhbz#1290089 + Related: rhbz#1284370 * Wed Dec 09 2015 Peter Jones - 2.02-0.31 - More work on handling of GRUB2_PASSWORD - Resolves: rhbz#1290089 + Resolves: rhbz#1284370 * Tue Dec 08 2015 Peter Jones - 2.02-0.30 - Fix security issue when reading username and password Resolves: CVE-2015-8370 - Do a better job of handling GRUB_PASSWORD - Resolves: rhbz#1290089 + Resolves: rhbz#1284370 * Fri Oct 09 2015 Peter Jones - 2.02-0.29 - Fix DHCP6 timeouts due to failed network stack once more.