From 6b3c762bfa502e435f11b8f982e379db810070a3 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Feb 05 2020 05:56:44 +0000 Subject: import grub2-2.02-0.65.el7_5.1 --- diff --git a/README.debrand b/README.debrand deleted file mode 100644 index 01c46d2..0000000 --- a/README.debrand +++ /dev/null @@ -1,2 +0,0 @@ -Warning: This package was configured for automatic debranding, but the changes -failed to apply. diff --git a/SOURCES/0001-fix-EFI-detection-on-Windows.patch b/SOURCES/0001-fix-EFI-detection-on-Windows.patch index e2f5d18..21fcf0e 100644 --- a/SOURCES/0001-fix-EFI-detection-on-Windows.patch +++ b/SOURCES/0001-fix-EFI-detection-on-Windows.patch @@ -1,32 +1,19 @@ -From 0000000000000000000000000000000000000000 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] fix EFI detection on Windows +Subject: [PATCH 001/261] fix EFI detection on Windows We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns zero) *and* extended error information is ERROR_INVALID_FUNCTION. Cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724325%28v=vs.85%29.aspx --- - grub-core/osdep/windows/platform.c | 2 +- ChangeLog | 5 +++++ + grub-core/osdep/windows/platform.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c -index f2b9d714329..d217efe1704 100644 ---- a/grub-core/osdep/windows/platform.c -+++ b/grub-core/osdep/windows/platform.c -@@ -100,7 +100,7 @@ get_platform (void) - - if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, - buffer, sizeof (buffer)) -- && GetLastError () != ERROR_INVALID_FUNCTION) -+ && GetLastError () == ERROR_INVALID_FUNCTION) - { - platform = PLAT_BIOS; - return; diff --git a/ChangeLog b/ChangeLog -index 41bcebfb321..21ec1c77c57 100644 +index 41bcebfb3..21ec1c77c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -38,3 +25,19 @@ index 41bcebfb321..21ec1c77c57 100644 2013-12-24 Vladimir Serbinenko * configure.ac: Set version to 2.02~beta2. +diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c +index f2b9d7143..d217efe17 100644 +--- a/grub-core/osdep/windows/platform.c ++++ b/grub-core/osdep/windows/platform.c +@@ -100,7 +100,7 @@ get_platform (void) + + if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR, + buffer, sizeof (buffer)) +- && GetLastError () != ERROR_INVALID_FUNCTION) ++ && GetLastError () == ERROR_INVALID_FUNCTION) + { + platform = PLAT_BIOS; + return; +-- +2.13.5 + 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 bb7a145..9f93640 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,29 +1,18 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. +Subject: [PATCH 002/261] * 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. --- - grub-core/kern/arm/cache_armv6.S | 1 - ChangeLog | 7 +++++++ + grub-core/kern/arm/cache_armv6.S | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) -diff --git a/grub-core/kern/arm/cache_armv6.S b/grub-core/kern/arm/cache_armv6.S -index 39da1dfc606..dfaded0eb30 100644 ---- a/grub-core/kern/arm/cache_armv6.S -+++ b/grub-core/kern/arm/cache_armv6.S -@@ -22,7 +22,6 @@ - .text - .syntax unified - .arm -- .arch armv6 - - # define DMB mcr p15, 0, r0, c7, c10, 5 - # define DSB mcr p15, 0, r0, c7, c10, 4 diff --git a/ChangeLog b/ChangeLog -index 21ec1c77c57..153bc43c1c5 100644 +index 21ec1c77c..153bc43c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ @@ -37,3 +26,18 @@ index 21ec1c77c57..153bc43c1c5 100644 2013-12-25 Andrey Borzenkov * grub-core/osdep/windows/platform.c (get_platform): Fix EFI +diff --git a/grub-core/kern/arm/cache_armv6.S b/grub-core/kern/arm/cache_armv6.S +index 39da1dfc6..dfaded0eb 100644 +--- a/grub-core/kern/arm/cache_armv6.S ++++ b/grub-core/kern/arm/cache_armv6.S +@@ -22,7 +22,6 @@ + .text + .syntax unified + .arm +- .arch armv6 + + # define DMB mcr p15, 0, r0, c7, c10, 5 + # define DSB mcr p15, 0, r0, c7, c10, 4 +-- +2.13.5 + 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 e4d3972..92e7d4c 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] * INSTALL (Cross-compiling the GRUB): Fix some spelling - mistakes. * docs/grub.texi (Getting the source code): Likewise. +Subject: [PATCH 003/261] * INSTALL (Cross-compiling the GRUB): Fix some + spelling mistakes. * docs/grub.texi (Getting the source code): Likewise. --- ChangeLog | 5 +++++ @@ -11,7 +11,7 @@ Subject: [PATCH] * INSTALL (Cross-compiling the GRUB): Fix some spelling 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 153bc43c1c5..bbb0f31532d 100644 +index 153bc43c1..bbb0f3153 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -24,7 +24,7 @@ index 153bc43c1c5..bbb0f31532d 100644 * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. diff --git a/INSTALL b/INSTALL -index afc957ca997..db12530dff3 100644 +index afc957ca9..db12530df 100644 --- a/INSTALL +++ b/INSTALL @@ -140,7 +140,7 @@ If build and host are different make check isn't available. @@ -59,7 +59,7 @@ index afc957ca997..db12530dff3 100644 - Platform-agnostic tools and data. 1. make is the tool you execute after ./configure. diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi -index c796850522a..7c6244cdb71 100644 +index c79685052..7c6244cdb 100644 --- a/docs/grub-dev.texi +++ b/docs/grub-dev.texi @@ -108,16 +108,16 @@ The branches available are: @@ -83,3 +83,6 @@ index c796850522a..7c6244cdb71 100644 @end table Once you have used @kbd{git clone} to fetch an initial copy of a branch, you +-- +2.13.5 + 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 1141167..5577a0f 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 0000000000000000000000000000000000000000 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] * NEWS: First draft of 2.02 entry. +Subject: [PATCH 004/261] * NEWS: First draft of 2.02 entry. --- ChangeLog | 4 +++ @@ -9,19 +9,21 @@ Subject: [PATCH] * NEWS: First draft of 2.02 entry. 2 files changed, 123 insertions(+) diff --git a/ChangeLog b/ChangeLog -index bbb0f31532d..82dc61d24c9 100644 +index bbb0f3153..82dc61d24 100644 --- a/ChangeLog +++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2013-12-27 Colin Watson -+ -+ * NEWS: First draft of 2.02 entry. -+ +@@ -1,5 +1,9 @@ 2013-12-27 Colin Watson ++ * NEWS: First draft of 2.02 entry. ++ ++2013-12-27 Colin Watson ++ * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. + * docs/grub.texi (Getting the source code): Likewise. + diff --git a/NEWS b/NEWS -index 4bb5f98010d..577d9fd7323 100644 +index 4bb5f9801..577d9fd73 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,122 @@ @@ -147,3 +149,6 @@ index 4bb5f98010d..577d9fd7323 100644 New in 2.00: * Appearance: +-- +2.13.5 + 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 6fd2f6f..4592b99 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,45 +1,43 @@ -From 0000000000000000000000000000000000000000 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] Merge branch 'master' of git.sv.gnu.org:/srv/git/grub +Subject: [PATCH 005/261] Merge branch 'master' of git.sv.gnu.org:/srv/git/grub Conflicts: ChangeLog --- - ChangeLog | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) + ChangeLog | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 82dc61d24c9..da3c2dfdf0a 100644 +index 82dc61d24..da3c2dfdf 100644 --- a/ChangeLog +++ b/ChangeLog -@@ -1,19 +1,19 @@ --2013-12-27 Colin Watson -- -- * NEWS: First draft of 2.02 entry. -- --2013-12-27 Colin Watson -- -- * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. -- * docs/grub.texi (Getting the source code): Likewise. -- --2013-12-25 Vladimir Serbinenko +@@ -1,3 +1,10 @@ +2013-12-27 Vladimir Serbinenko - - * 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. - -+2013-12-27 Colin Watson + -+ * NEWS: First draft of 2.02 entry. ++ * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. + -+2013-12-27 Colin Watson -+ -+ * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. -+ * docs/grub.texi (Getting the source code): Likewise. ++ 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. + + 2013-12-27 Colin Watson + + * NEWS: First draft of 2.02 entry. +@@ -7,13 +14,6 @@ + * INSTALL (Cross-compiling the GRUB): Fix some spelling mistakes. + * docs/grub.texi (Getting the source code): Likewise. + +-2013-12-25 Vladimir Serbinenko +- +- * 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. +- 2013-12-25 Andrey Borzenkov * grub-core/osdep/windows/platform.c (get_platform): Fix EFI +-- +2.13.5 + 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 01dc202..d7d0a49 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 0000000000000000000000000000000000000000 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] * NEWS: The cmosclean command in fact dates back to 1.99. - Remove mention of it from 2.02. +Subject: [PATCH 006/261] * NEWS: The cmosclean command in fact dates back to + 1.99. Remove mention of it from 2.02. --- ChangeLog | 5 +++++ @@ -10,7 +10,7 @@ Subject: [PATCH] * NEWS: The cmosclean command in fact dates back to 1.99. 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog -index da3c2dfdf0a..c33856eab8d 100644 +index da3c2dfdf..c33856eab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -23,7 +23,7 @@ index da3c2dfdf0a..c33856eab8d 100644 * grub-core/kern/arm/cache_armv6.S: Remove .arch directive. diff --git a/NEWS b/NEWS -index 577d9fd7323..b74c05f637f 100644 +index 577d9fd73..b74c05f63 100644 --- a/NEWS +++ b/NEWS @@ -46,8 +46,7 @@ New in 2.02: @@ -36,3 +36,6 @@ index 577d9fd7323..b74c05f637f 100644 * New `cbmemc', `coreboot_boottime', and `lscoreboot' commands on coreboot. * Improve opcode parsing in ACPI halt implementation. +-- +2.13.5 + 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 36b2004..586e10a 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,28 +1,16 @@ -From 0000000000000000000000000000000000000000 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] remove unused error.h from kern/emu/misc.c +Subject: [PATCH 007/261] remove unused error.h from kern/emu/misc.c Fixes compilation on mingw32, where include is apparently missing. --- - grub-core/kern/emu/misc.c | 1 - ChangeLog | 5 +++++ + grub-core/kern/emu/misc.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) -diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c -index 43471b4efe9..bb606da2803 100644 ---- a/grub-core/kern/emu/misc.c -+++ b/grub-core/kern/emu/misc.c -@@ -20,7 +20,6 @@ - #include - - #include --#include - #include - #include - #include diff --git a/ChangeLog b/ChangeLog -index c33856eab8d..0401f6154f8 100644 +index c33856eab..0401f6154 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -34,3 +22,18 @@ index c33856eab8d..0401f6154f8 100644 2013-12-28 Colin Watson * NEWS: The cmosclean command in fact dates back to 1.99. Remove +diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c +index 43471b4ef..bb606da28 100644 +--- a/grub-core/kern/emu/misc.c ++++ b/grub-core/kern/emu/misc.c +@@ -20,7 +20,6 @@ + #include + + #include +-#include + #include + #include + #include +-- +2.13.5 + 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 c900a62..22e776d 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,17 +1,29 @@ -From 0000000000000000000000000000000000000000 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] Don't abort() on unavailable coreboot tables if not running - on coreboot. +Subject: [PATCH 008/261] Don't abort() on unavailable coreboot tables if not + running on coreboot. --- + ChangeLog | 4 ++++ grub-core/kern/i386/coreboot/cbtable.c | 2 +- grub-core/kern/i386/coreboot/init.c | 5 +++++ - ChangeLog | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 0401f6154..ed6d77cc8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2013-12-28 Vladimir Serbinenko ++ ++ Don't abort() on unavailable coreboot tables if not running on coreboot. ++ + 2013-12-28 Andrey Borzenkov + + * grub-core/kern/emu/misc.c: Remove unused error.h; fixes compilation diff --git a/grub-core/kern/i386/coreboot/cbtable.c b/grub-core/kern/i386/coreboot/cbtable.c -index e3bb7b2e09d..1669bc0ca23 100644 +index e3bb7b2e0..1669bc0ca 100644 --- a/grub-core/kern/i386/coreboot/cbtable.c +++ b/grub-core/kern/i386/coreboot/cbtable.c @@ -55,7 +55,7 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t, @@ -24,7 +36,7 @@ index e3bb7b2e09d..1669bc0ca23 100644 signature_found: diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c -index 6b150b47d88..3314f027fec 100644 +index 6b150b47d..3314f027f 100644 --- a/grub-core/kern/i386/coreboot/init.c +++ b/grub-core/kern/i386/coreboot/init.c @@ -51,6 +51,7 @@ grub_exit (void) @@ -53,15 +65,6 @@ index 6b150b47d88..3314f027fec 100644 grub_video_coreboot_fb_late_init (); -diff --git a/ChangeLog b/ChangeLog -index 0401f6154f8..ed6d77cc8ea 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2013-12-28 Vladimir Serbinenko -+ -+ Don't abort() on unavailable coreboot tables if not running on coreboot. -+ - 2013-12-28 Andrey Borzenkov - - * grub-core/kern/emu/misc.c: Remove unused error.h; fixes compilation +-- +2.13.5 + 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 6d567b4..a5386c7 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,7 +1,8 @@ -From 0000000000000000000000000000000000000000 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] * NEWS: Add few missing entries. Correct existing ones. +Subject: [PATCH 009/261] * NEWS: Add few missing entries. Correct existing + ones. --- ChangeLog | 4 ++++ @@ -9,7 +10,7 @@ Subject: [PATCH] * NEWS: Add few missing entries. Correct existing ones. 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog -index ed6d77cc8ea..db843006df9 100644 +index ed6d77cc8..db843006d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -21,7 +22,7 @@ index ed6d77cc8ea..db843006df9 100644 Don't abort() on unavailable coreboot tables if not running on coreboot. diff --git a/NEWS b/NEWS -index b74c05f637f..49a2459b6a0 100644 +index b74c05f63..49a2459b6 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,8 @@ New in 2.02: @@ -115,3 +116,6 @@ index b74c05f637f..49a2459b6a0 100644 * Support ZFS up to 33. * HFS string is now treated like mac-roman and not UTF-8 * HFS mtime support. +-- +2.13.5 + 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 39b57e0..d894e18 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,16 +1,28 @@ -From 0000000000000000000000000000000000000000 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] strip .eh_frame section from arm64-efi kernel +Subject: [PATCH 010/261] strip .eh_frame section from arm64-efi kernel Fixes grub-mkimage error "relocation 0x105 is not implemented yet." --- - grub-core/Makefile.core.def | 2 +- ChangeLog | 4 ++++ + grub-core/Makefile.core.def | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index db843006d..8c1ececa1 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2013-12-30 Andrey Borzenkov ++ ++ * grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi. ++ + 2013-12-30 Vladimir Serbinenko + + * NEWS: Add few missing entries. Correct existing ones. diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index c916246de27..42443bc00b9 100644 +index c916246de..42443bc00 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -66,7 +66,7 @@ kernel = { @@ -22,15 +34,6 @@ index c916246de27..42443bc00b9 100644 i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)'; i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000'; -diff --git a/ChangeLog b/ChangeLog -index db843006df9..8c1ececa1ed 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2013-12-30 Andrey Borzenkov -+ -+ * grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi. -+ - 2013-12-30 Vladimir Serbinenko - - * NEWS: Add few missing entries. Correct existing ones. +-- +2.13.5 + 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 ba4a9c9..33c01e1 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 0000000000000000000000000000000000000000 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] use {grub,boot}aa64.efi for boot images on AArch64 +Subject: [PATCH 011/261] 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 @@ -11,7 +11,7 @@ GRUB image name to grubaa64.efi to match it. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub-install.c b/util/grub-install.c -index 8cfe0eaa2ef..4608b80fe05 100644 +index 8cfe0eaa2..4608b80fe 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1091,7 +1091,7 @@ main (int argc, char *argv[]) @@ -32,3 +32,6 @@ index 8cfe0eaa2ef..4608b80fe05 100644 break; default: efi_file = "grub.efi"; +-- +2.13.5 + 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 56f0178..b8ad4f8 100644 --- a/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch +++ b/SOURCES/0012-fix-32-bit-compilation-on-MinGW-w64.patch @@ -1,18 +1,31 @@ -From 0000000000000000000000000000000000000000 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] fix 32 bit compilation on MinGW-w64 +Subject: [PATCH 012/261] 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 redefinition which it already does in case of _FILE_OFFSET_BITS=64. --- - include/grub/osdep/hostfile_windows.h | 3 +++ ChangeLog | 5 +++++ + include/grub/osdep/hostfile_windows.h | 3 +++ 2 files changed, 8 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 8c1ececa1..e87f0a7a4 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-07 Andrey Borzenkov ++ ++ * include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello ++ on MinGW-64 when compiling for 32 bits. ++ + 2013-12-30 Andrey Borzenkov + + * grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi. diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h -index 36615b2c451..79efcfa5084 100644 +index 36615b2c4..79efcfa50 100644 --- a/include/grub/osdep/hostfile_windows.h +++ b/include/grub/osdep/hostfile_windows.h @@ -69,8 +69,11 @@ enum grub_util_fd_open_flags_t @@ -27,16 +40,6 @@ index 36615b2c451..79efcfa5084 100644 #endif -diff --git a/ChangeLog b/ChangeLog -index 8c1ececa1ed..e87f0a7a4a4 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-07 Andrey Borzenkov -+ -+ * include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello -+ on MinGW-64 when compiling for 32 bits. -+ - 2013-12-30 Andrey Borzenkov - - * grub-core/Makefile.core.def: strip .eh_frame section for arm64-efi. +-- +2.13.5 + 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 53589b5..c7450ba 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,16 +1,33 @@ -From 0000000000000000000000000000000000000000 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] Change grub-mkrescue to use bootaa64.efi too +Subject: [PATCH 013/261] Change grub-mkrescue to use bootaa64.efi too Also add ChangeLog entry for previous change. --- - util/grub-mkrescue.c | 2 +- ChangeLog | 7 +++++++ + util/grub-mkrescue.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index e87f0a7a4..0b9fa05b2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,12 @@ + 2014-01-07 Andrey Borzenkov + ++ * util/grub-install.c: Use bootaa64.efi instead of bootaarch64.efi on ++ arm64 to comply with EFI specification. Also use grubaa64.efi for ++ consistency. ++ * util/grub-mkrescue.c: Change to use bootaa64.efi too. ++ ++2014-01-07 Andrey Borzenkov ++ + * include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello + on MinGW-64 when compiling for 32 bits. + diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c -index 317879d0b50..0d03e55d20c 100644 +index 317879d0b..0d03e55d2 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -663,7 +663,7 @@ main (int argc, char *argv[]) @@ -22,18 +39,6 @@ index 317879d0b50..0d03e55d20c 100644 make_image_fwdisk_abs (GRUB_INSTALL_PLATFORM_ARM64_EFI, "arm64-efi", imgname); free (imgname); -diff --git a/ChangeLog b/ChangeLog -index e87f0a7a4a4..0b9fa05b2a0 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-07 Andrey Borzenkov -+ -+ * util/grub-install.c: Use bootaa64.efi instead of bootaarch64.efi on -+ arm64 to comply with EFI specification. Also use grubaa64.efi for -+ consistency. -+ * util/grub-mkrescue.c: Change to use bootaa64.efi too. -+ - 2014-01-07 Andrey Borzenkov - - * include/grub/osdep/hostfile_windows.h: Do not redefine fseeko/ftello +-- +2.13.5 + 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 39ed674..ed6bd60 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 0000000000000000000000000000000000000000 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] arm64: set correct length of device path end entry +Subject: [PATCH 014/261] 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 @@ -9,12 +9,24 @@ in debug builds of Tianocore. Set it to sizeof (grub_efi_device_path_t). --- - grub-core/loader/arm64/linux.c | 2 +- ChangeLog | 4 ++++ + grub-core/loader/arm64/linux.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 0b9fa05b2..4ec5517bd 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-07 Leif Lindholm ++ ++ * grub-core/loader/arm64/linux.c: correctly set device path end length. ++ + 2014-01-07 Andrey Borzenkov + + * util/grub-install.c: Use bootaa64.efi instead of bootaarch64.efi on diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 9d15aad625e..75ad871a81c 100644 +index 9d15aad62..75ad871a8 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -268,7 +268,7 @@ grub_linux_boot (void) @@ -26,15 +38,6 @@ index 9d15aad625e..75ad871a81c 100644 b = grub_efi_system_table->boot_services; status = b->load_image (0, grub_efi_image_handle, -diff --git a/ChangeLog b/ChangeLog -index 0b9fa05b2a0..4ec5517bded 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-07 Leif Lindholm -+ -+ * grub-core/loader/arm64/linux.c: correctly set device path end length. -+ - 2014-01-07 Andrey Borzenkov - - * util/grub-install.c: Use bootaa64.efi instead of bootaarch64.efi on +-- +2.13.5 + 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 90ad43c..7605a86 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * Makefile.util.def (grub-macbless): Change mansection to 8. +Subject: [PATCH 015/261] * Makefile.util.def (grub-macbless): Change + mansection to 8. --- - Makefile.util.def | 2 +- ChangeLog | 4 ++++ + Makefile.util.def | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 4ec5517bd..b445f1215 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-08 Colin Watson ++ ++ * Makefile.util.def (grub-macbless): Change mansection to 8. ++ + 2014-01-07 Leif Lindholm + + * grub-core/loader/arm64/linux.c: correctly set device path end length. diff --git a/Makefile.util.def b/Makefile.util.def -index 985e76ca4e5..3c99be2b0ca 100644 +index 985e76ca4..3c99be2b0 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -405,7 +405,7 @@ program = { @@ -21,15 +34,6 @@ index 985e76ca4e5..3c99be2b0ca 100644 common = util/grub-macbless.c; common = grub-core/osdep/init.c; common = grub-core/kern/emu/argp_common.c; -diff --git a/ChangeLog b/ChangeLog -index 4ec5517bded..b445f121586 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-08 Colin Watson -+ -+ * Makefile.util.def (grub-macbless): Change mansection to 8. -+ - 2014-01-07 Leif Lindholm - - * grub-core/loader/arm64/linux.c: correctly set device path end length. +-- +2.13.5 + 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 863584c..1657600 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,8 @@ -From 0000000000000000000000000000000000000000 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] add part_apple to EFI rescue image to fix missing prefix +Subject: [PATCH 016/261] add part_apple to EFI rescue image to fix missing + prefix On Mac rescue image is booted from HFS+ partition, so bootpath looks like /ACPI(a0341d0,0)/PCI(1,1f)/ATAPI(0,0,0)/HD(3,5d1,ca3,0000000000000000,20,0)/EndEntire @@ -13,7 +14,7 @@ table. The simplest fix is to add part_apple by default. 1 file changed, 6 insertions(+) diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c -index 0d03e55d20c..34e0b7affb1 100644 +index 0d03e55d2..34e0b7aff 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -653,11 +653,15 @@ main (int argc, char *argv[]) @@ -42,3 +43,6 @@ index 0d03e55d20c..34e0b7affb1 100644 if (source_dirs[GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275]) { +-- +2.13.5 + 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 3f346cf..dd0a201 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,17 +1,30 @@ -From 0000000000000000000000000000000000000000 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] freebsd/hostdisk.c is only ever compiled on FreeBSD +Subject: [PATCH 017/261] freebsd/hostdisk.c is only ever compiled on FreeBSD * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove redundant preprocessor conditional. --- - grub-core/osdep/freebsd/hostdisk.c | 2 -- ChangeLog | 5 +++++ + grub-core/osdep/freebsd/hostdisk.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index b445f1215..6613b4ee5 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-17 Colin Watson ++ ++ * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove ++ redundant preprocessor conditional. ++ + 2014-01-08 Colin Watson + + * Makefile.util.def (grub-macbless): Change mansection to 8. diff --git a/grub-core/osdep/freebsd/hostdisk.c b/grub-core/osdep/freebsd/hostdisk.c -index bd5fddb9150..eb202dcc831 100644 +index bd5fddb91..eb202dcc8 100644 --- a/grub-core/osdep/freebsd/hostdisk.c +++ b/grub-core/osdep/freebsd/hostdisk.c @@ -108,7 +108,6 @@ grub_util_fd_open (const char *os_dev, int flags) @@ -30,16 +43,6 @@ index bd5fddb9150..eb202dcc831 100644 return ret; } -diff --git a/ChangeLog b/ChangeLog -index b445f121586..6613b4ee52b 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-17 Colin Watson -+ -+ * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove -+ redundant preprocessor conditional. -+ - 2014-01-08 Colin Watson - - * Makefile.util.def (grub-macbless): Change mansection to 8. +-- +2.13.5 + diff --git a/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch b/SOURCES/0018-Prefer-more-portable-test-1-constructs.patch index 0fa41cd..297f16a 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 0000000000000000000000000000000000000000 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] Prefer more portable test(1) constructs +Subject: [PATCH 018/261] Prefer more portable test(1) constructs * util/grub.d/00_header.in (make_timeout): Use && rather than test -a. @@ -19,7 +19,7 @@ rather than test -o. 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 6613b4ee52b..c8e95a6b98d 100644 +index 6613b4ee5..c8e95a6b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,14 @@ @@ -39,7 +39,7 @@ index 6613b4ee52b..c8e95a6b98d 100644 * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Remove redundant preprocessor conditional. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index 0c82f231574..ce2ec819d8c 100644 +index 0c82f2315..ce2ec819d 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -285,7 +285,7 @@ make_timeout () @@ -52,7 +52,7 @@ index 0c82f231574..ce2ec819d8c 100644 timeout="${1}" if [ "x${2}" != "x0" ] ; then diff --git a/util/grub.d/10_netbsd.in b/util/grub.d/10_netbsd.in -index 29a0e41a9a5..9988a42bc50 100644 +index 29a0e41a9..9988a42bc 100644 --- a/util/grub.d/10_netbsd.in +++ b/util/grub.d/10_netbsd.in @@ -69,7 +69,7 @@ netbsd_load_fs_module () @@ -65,7 +65,7 @@ index 29a0e41a9a5..9988a42bc50 100644 fi diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in -index 9025914f6cf..48bd955464b 100644 +index 9025914f6..48bd95546 100644 --- a/util/grub.d/10_windows.in +++ b/util/grub.d/10_windows.in @@ -66,11 +66,11 @@ for drv in $drives ; do @@ -83,7 +83,7 @@ index 9025914f6cf..48bd955464b 100644 osid=ntldr needmap=t diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 0470e66853d..7cf8487d63a 100644 +index 0470e6685..7cf8487d6 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -30,7 +30,7 @@ if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then @@ -104,3 +104,6 @@ index 0470e66853d..7cf8487d63a 100644 echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2 continue fi +-- +2.13.5 + diff --git a/SOURCES/0019-NEWS-Add-few-missing-entries.patch b/SOURCES/0019-NEWS-Add-few-missing-entries.patch index 53226a5..b972210 100644 --- a/SOURCES/0019-NEWS-Add-few-missing-entries.patch +++ b/SOURCES/0019-NEWS-Add-few-missing-entries.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] * NEWS: Add few missing entries. +Subject: [PATCH 019/261] * NEWS: Add few missing entries. --- ChangeLog | 4 ++++ @@ -9,7 +9,7 @@ Subject: [PATCH] * NEWS: Add few missing entries. 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog -index c8e95a6b98d..6a19f850448 100644 +index c8e95a6b9..6a19f8504 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -21,7 +21,7 @@ index c8e95a6b98d..6a19f850448 100644 * util/grub.d/00_header.in (make_timeout): Use && rather than test diff --git a/NEWS b/NEWS -index 49a2459b6a0..a61df942a35 100644 +index 49a2459b6..a61df942a 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ New in 2.02: @@ -95,3 +95,6 @@ index 49a2459b6a0..a61df942a35 100644 * Eliminate the use of AutoGen. This allowed some performance improvements to the build system. * Remove variable length arrays. +-- +2.13.5 + 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 0c964a6..6552245 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/kern/efi/efi.c: Ensure that the result starts - with / and has no //. +Subject: [PATCH 020/261] * grub-core/kern/efi/efi.c: Ensure that the result + starts with / and has no //. --- - grub-core/kern/efi/efi.c | 25 +++++++++++++++++-------- ChangeLog | 5 +++++ + grub-core/kern/efi/efi.c | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 6a19f8504..b04a4ef70 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-18 Vladimir Serbinenko + ++ * grub-core/kern/efi/efi.c: Ensure that the result starts with / ++ and has no //. ++ ++2014-01-18 Vladimir Serbinenko ++ + * NEWS: Add few missing entries. + + 2014-01-17 Colin Watson diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index b253141f26e..b9eb1ab1e33 100644 +index b253141f2..b9eb1ab1e 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -309,7 +309,7 @@ grub_efi_modules_addr (void) @@ -70,16 +85,6 @@ index b253141f26e..b9eb1ab1e33 100644 return name; } -diff --git a/ChangeLog b/ChangeLog -index 6a19f850448..b04a4ef70b9 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * grub-core/kern/efi/efi.c: Ensure that the result starts with / -+ and has no //. -+ - 2014-01-18 Vladimir Serbinenko - - * NEWS: Add few missing entries. +-- +2.13.5 + 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 c406ede..67938c0 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,16 +1,30 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-mount.c: Extend GCC warning workaround to +Subject: [PATCH 021/261] * util/grub-mount.c: Extend GCC warning workaround to grub-mount. --- - util/grub-mount.c | 7 ++++++- ChangeLog | 4 ++++ + util/grub-mount.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index b04a4ef70..8534158b6 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-01-18 Vladimir Serbinenko + ++ * util/grub-mount.c: Extend GCC warning workaround to grub-mount. ++ ++2014-01-18 Vladimir Serbinenko ++ + * grub-core/kern/efi/efi.c: Ensure that the result starts with / + and has no //. + diff --git a/util/grub-mount.c b/util/grub-mount.c -index 118881e0d9d..19de2e62057 100644 +index 118881e0d..19de2e620 100644 --- a/util/grub-mount.c +++ b/util/grub-mount.c @@ -41,8 +41,13 @@ @@ -28,15 +42,6 @@ index 118881e0d9d..19de2e62057 100644 static const char *root = NULL; grub_device_t dev = NULL; -diff --git a/ChangeLog b/ChangeLog -index b04a4ef70b9..8534158b6c0 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * util/grub-mount.c: Extend GCC warning workaround to grub-mount. -+ - 2014-01-18 Vladimir Serbinenko - - * grub-core/kern/efi/efi.c: Ensure that the result starts with / +-- +2.13.5 + 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 aff34c5..0d995c3 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 0000000000000000000000000000000000000000 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] reintroduce BUILD_LDFLAGS for the cross-compile case +Subject: [PATCH 022/261] 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 @@ -12,15 +12,73 @@ linking at build time. Also fix obsolete comments in confgure.ac - we do use different environment for build and host now. --- - configure.ac | 13 ++++++++----- - Makefile.am | 8 ++++---- ChangeLog | 7 +++++++ INSTALL | 3 ++- + Makefile.am | 8 ++++---- + configure.ac | 13 ++++++++----- grub-core/Makefile.am | 6 +++--- 5 files changed, 24 insertions(+), 13 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 8534158b6..9c3ef2e21 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++2014-01-07 Andrey Borzenkov ++ ++ * configure.ac: Add support for BUILD_LDFLAGS. ++ * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... ++ * grub-core/Makefile.am: ... and here. ++ * INSTALL: Mention BUILD_LDFLAGS. ++ + 2014-01-18 Vladimir Serbinenko + + * util/grub-mount.c: Extend GCC warning workaround to grub-mount. +diff --git a/INSTALL b/INSTALL +index db12530df..b67cd7f34 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -168,7 +168,8 @@ corresponding platform are not needed for the platform in question. + generate sin and cos tables. + 2. BUILD_CFLAGS= for C options for build. + 3. BUILD_CPPFLAGS= for C preprocessor options for build. +- 4. BUILD_FREETYPE= for freetype-config for build (optional). ++ 4. BUILD_LDFLAGS= for linker options for build. ++ 5. BUILD_FREETYPE= for freetype-config for build (optional). + + - For host + 1. --host= to autoconf name of host. +diff --git a/Makefile.am b/Makefile.am +index 320e86f8f..1bbec0e79 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -67,20 +67,20 @@ endif + starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 + + build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) + CLEANFILES += build-grub-mkfont + + garbage-gen: util/garbage-gen.c +- $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $^ ++ $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ + CLEANFILES += garbage-gen + EXTRA_DIST += util/garbage-gen.c + + build-grub-gen-asciih: util/grub-gen-asciih.c +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror + CLEANFILES += build-grub-gen-asciih + + build-grub-gen-widthspec: util/grub-gen-widthspec.c +- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror ++ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror + CLEANFILES += build-grub-gen-widthspec + + if COND_STARFIELD diff --git a/configure.ac b/configure.ac -index 7c5d080b8a2..2e4cf3c2e22 100644 +index 7c5d080b8..2e4cf3c2e 100644 --- a/configure.ac +++ b/configure.ac @@ -26,11 +26,10 @@ dnl This is necessary because the target type in autoconf does not @@ -68,66 +126,8 @@ index 7c5d080b8a2..2e4cf3c2e22 100644 DJVU_FONT_SOURCE= -diff --git a/Makefile.am b/Makefile.am -index 320e86f8f55..1bbec0e79d3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -67,20 +67,20 @@ endif - starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 - - build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) - CLEANFILES += build-grub-mkfont - - garbage-gen: util/garbage-gen.c -- $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $^ -+ $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ - CLEANFILES += garbage-gen - EXTRA_DIST += util/garbage-gen.c - - build-grub-gen-asciih: util/grub-gen-asciih.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror - CLEANFILES += build-grub-gen-asciih - - build-grub-gen-widthspec: util/grub-gen-widthspec.c -- $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror - CLEANFILES += build-grub-gen-widthspec - - if COND_STARFIELD -diff --git a/ChangeLog b/ChangeLog -index 8534158b6c0..9c3ef2e2150 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-07 Andrey Borzenkov -+ -+ * configure.ac: Add support for BUILD_LDFLAGS. -+ * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... -+ * grub-core/Makefile.am: ... and here. -+ * INSTALL: Mention BUILD_LDFLAGS. -+ - 2014-01-18 Vladimir Serbinenko - - * util/grub-mount.c: Extend GCC warning workaround to grub-mount. -diff --git a/INSTALL b/INSTALL -index db12530dff3..b67cd7f3476 100644 ---- a/INSTALL -+++ b/INSTALL -@@ -168,7 +168,8 @@ corresponding platform are not needed for the platform in question. - generate sin and cos tables. - 2. BUILD_CFLAGS= for C options for build. - 3. BUILD_CPPFLAGS= for C preprocessor options for build. -- 4. BUILD_FREETYPE= for freetype-config for build (optional). -+ 4. BUILD_LDFLAGS= for linker options for build. -+ 5. BUILD_FREETYPE= for freetype-config for build (optional). - - - For host - 1. --host= to autoconf name of host. diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 1b3142d2160..13b7979106f 100644 +index 1b3142d21..13b797910 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -27,14 +27,14 @@ CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM) @@ -148,3 +148,6 @@ index 1b3142d2160..13b7979106f 100644 CLEANFILES += gentrigtables # trigtables.c +-- +2.13.5 + 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 64ecaea..d9b9154 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,15 +1,27 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/term/terminfo.c: Recognize keys F1-F12. +Subject: [PATCH 023/261] * grub-core/term/terminfo.c: Recognize keys F1-F12. --- - grub-core/term/terminfo.c | 86 +++++++++++++++++++++++++++-------------------- ChangeLog | 4 +++ + grub-core/term/terminfo.c | 86 +++++++++++++++++++++++++++-------------------- 2 files changed, 54 insertions(+), 36 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 9c3ef2e21..bdfbf44da 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-18 Vladimir Serbinenko ++ ++ * grub-core/term/terminfo.c: Recognize keys F1-F12. ++ + 2014-01-07 Andrey Borzenkov + + * configure.ac: Add support for BUILD_LDFLAGS. diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c -index 3d48b198fbd..f0d3e3debc6 100644 +index 3d48b198f..f0d3e3deb 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -460,28 +460,31 @@ grub_terminfo_readkey (struct grub_term_input *term, int *keys, int *len, @@ -137,15 +149,6 @@ index 3d48b198fbd..f0d3e3debc6 100644 } } #undef CONTINUE_READ -diff --git a/ChangeLog b/ChangeLog -index 9c3ef2e2150..bdfbf44da88 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * grub-core/term/terminfo.c: Recognize keys F1-F12. -+ - 2014-01-07 Andrey Borzenkov - - * configure.ac: Add support for BUILD_LDFLAGS. +-- +2.13.5 + diff --git a/SOURCES/0024-Fix-ChangeLog-date.patch b/SOURCES/0024-Fix-ChangeLog-date.patch index 56dbb01..22d3e8c 100644 --- a/SOURCES/0024-Fix-ChangeLog-date.patch +++ b/SOURCES/0024-Fix-ChangeLog-date.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Fix ChangeLog date +Subject: [PATCH 024/261] Fix ChangeLog date --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog -index bdfbf44da88..fcbf2207b32 100644 +index bdfbf44da..fcbf2207b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ @@ -20,3 +20,6 @@ index bdfbf44da88..fcbf2207b32 100644 * configure.ac: Add support for BUILD_LDFLAGS. * Makefile.am: Use BUILD_LDFLAGS for build time programs here ... +-- +2.13.5 + 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 fdec621..15c5f54 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,8 @@ -From 0000000000000000000000000000000000000000 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] Use _W64 to detect MinGW W64-32 instead of _FILE_OFFSET_BITS +Subject: [PATCH 025/261] Use _W64 to detect MinGW W64-32 instead of + _FILE_OFFSET_BITS In 94cee4a4c201bb506377b2c26e072eee8cb19d6f I overlooked that config.h unconditionally sets _FILE_OFFSET_BITS, so it cannot be used to detect @@ -9,12 +10,25 @@ MinGW W64 environment. It looks like Emacs folks already found solution; instead of _FILE_OFFSET_BITS use _W64 as suggested in http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00723.html --- - include/grub/osdep/hostfile_windows.h | 4 ++-- ChangeLog | 5 +++++ + include/grub/osdep/hostfile_windows.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index fcbf2207b..5aac7c1d8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-18 Andrey Borzenkov ++ ++ * include/grub/osdep/hostfile_windows.h: Use _W64 instead of ++ FILE_OFFSET_BITS to differentiate between native MinGW and Mingw W64. ++ + 2014-01-18 Vladimir Serbinenko + + * grub-core/term/terminfo.c: Recognize keys F1-F12. diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h -index 79efcfa5084..bf6451b6db4 100644 +index 79efcfa50..bf6451b6d 100644 --- a/include/grub/osdep/hostfile_windows.h +++ b/include/grub/osdep/hostfile_windows.h @@ -69,8 +69,8 @@ enum grub_util_fd_open_flags_t @@ -28,16 +42,6 @@ index 79efcfa5084..bf6451b6db4 100644 #define fseeko fseeko64 #define ftello ftello64 #endif -diff --git a/ChangeLog b/ChangeLog -index fcbf2207b32..5aac7c1d854 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-18 Andrey Borzenkov -+ -+ * include/grub/osdep/hostfile_windows.h: Use _W64 instead of -+ FILE_OFFSET_BITS to differentiate between native MinGW and Mingw W64. -+ - 2014-01-18 Vladimir Serbinenko - - * grub-core/term/terminfo.c: Recognize keys F1-F12. +-- +2.13.5 + 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 63738d5..a9d6aba 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,20 +1,85 @@ -From 0000000000000000000000000000000000000000 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] add BUILD_EXEEXT support to fix make clean on Windows +Subject: [PATCH 026/261] add BUILD_EXEEXT support to fix make clean on Windows Add $(BUILD_EXEEXT) to ensure files are removed. Also add CLEANFILES where appropriate. --- - configure.ac | 21 ++++++++++++++++----- - Makefile.util.def | 2 +- - Makefile.am | 16 ++++++++-------- ChangeLog | 7 +++++++ + Makefile.am | 16 ++++++++-------- + Makefile.util.def | 2 +- + configure.ac | 21 ++++++++++++++++----- grub-core/Makefile.am | 14 ++++++++------ 5 files changed, 40 insertions(+), 20 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 5aac7c1d8..dad2da2fa 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,12 @@ + 2014-01-18 Andrey Borzenkov + ++ * configure.ac: Add support for BUILD_EXEEXT and use it ... ++ * Makefile.am: ... here. ++ * Makefile.util.def: ... and here. ++ * grub-core/Makefile.am: ... and here. ++ ++2014-01-18 Andrey Borzenkov ++ + * include/grub/osdep/hostfile_windows.h: Use _W64 instead of + FILE_OFFSET_BITS to differentiate between native MinGW and Mingw W64. + +diff --git a/Makefile.am b/Makefile.am +index 1bbec0e79..aa526f573 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -66,22 +66,22 @@ endif + + starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 + +-build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c ++build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) +-CLEANFILES += build-grub-mkfont ++CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT) + +-garbage-gen: util/garbage-gen.c ++garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c + $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ +-CLEANFILES += garbage-gen ++CLEANFILES += garbage-gen$(BUILD_EXEEXT) + EXTRA_DIST += util/garbage-gen.c + +-build-grub-gen-asciih: util/grub-gen-asciih.c ++build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror +-CLEANFILES += build-grub-gen-asciih ++CLEANFILES += build-grub-gen-asciih$(BUILD_EXEEXT) + +-build-grub-gen-widthspec: util/grub-gen-widthspec.c ++build-grub-gen-widthspec$(BUILD_EXEEXT): util/grub-gen-widthspec.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror +-CLEANFILES += build-grub-gen-widthspec ++CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) + + if COND_STARFIELD + starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) +diff --git a/Makefile.util.def b/Makefile.util.def +index 3c99be2b0..83df212f4 100644 +--- a/Makefile.util.def ++++ b/Makefile.util.def +@@ -708,7 +708,7 @@ script = { + name = grub-fs-tester; + common = tests/util/grub-fs-tester.in; + installdir = noinst; +- dependencies = garbage-gen; ++ dependencies = 'garbage-gen$(BUILD_EXEEXT)'; + }; + + script = { diff --git a/configure.ac b/configure.ac -index 2e4cf3c2e22..cf3de3be1fc 100644 +index 2e4cf3c2e..cf3de3be1 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,8 @@ AC_CONFIG_AUX_DIR([build-aux]) @@ -71,71 +136,8 @@ index 2e4cf3c2e22..cf3de3be1fc 100644 fi fi -diff --git a/Makefile.util.def b/Makefile.util.def -index 3c99be2b0ca..83df212f412 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -708,7 +708,7 @@ script = { - name = grub-fs-tester; - common = tests/util/grub-fs-tester.in; - installdir = noinst; -- dependencies = garbage-gen; -+ dependencies = 'garbage-gen$(BUILD_EXEEXT)'; - }; - - script = { -diff --git a/Makefile.am b/Makefile.am -index 1bbec0e79d3..aa526f573c3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -66,22 +66,22 @@ endif - - starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0 - --build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c -+build-grub-mkfont$(BUILD_EXEEXT): util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs) --CLEANFILES += build-grub-mkfont -+CLEANFILES += build-grub-mkfont$(BUILD_EXEEXT) - --garbage-gen: util/garbage-gen.c -+garbage-gen$(BUILD_EXEEXT): util/garbage-gen.c - $(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $^ --CLEANFILES += garbage-gen -+CLEANFILES += garbage-gen$(BUILD_EXEEXT) - EXTRA_DIST += util/garbage-gen.c - --build-grub-gen-asciih: util/grub-gen-asciih.c -+build-grub-gen-asciih$(BUILD_EXEEXT): util/grub-gen-asciih.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror --CLEANFILES += build-grub-gen-asciih -+CLEANFILES += build-grub-gen-asciih$(BUILD_EXEEXT) - --build-grub-gen-widthspec: util/grub-gen-widthspec.c -+build-grub-gen-widthspec$(BUILD_EXEEXT): util/grub-gen-widthspec.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror --CLEANFILES += build-grub-gen-widthspec -+CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) - - if COND_STARFIELD - starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) -diff --git a/ChangeLog b/ChangeLog -index 5aac7c1d854..dad2da2faef 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-18 Andrey Borzenkov -+ -+ * configure.ac: Add support for BUILD_EXEEXT and use it ... -+ * Makefile.am: ... here. -+ * Makefile.util.def: ... and here. -+ * grub-core/Makefile.am: ... and here. -+ - 2014-01-18 Andrey Borzenkov - - * include/grub/osdep/hostfile_windows.h: Use _W64 instead of diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 13b7979106f..826b3dd7c1a 100644 +index 13b797910..826b3dd7c 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -26,20 +26,22 @@ CFLAGS_LIBRARY += $(CFLAGS_PLATFORM) -fno-builtin @@ -167,3 +169,6 @@ index 13b7979106f..826b3dd7c1a 100644 CLEANFILES += trigtables.c # XXX Use Automake's LEX & YACC support +-- +2.13.5 + 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 796a9b9..fbb70ce 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,8 @@ -From 0000000000000000000000000000000000000000 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] fix include loop on MinGW due to libintl.h pulling stdio.h +Subject: [PATCH 027/261] fix include loop on MinGW due to libintl.h pulling + stdio.h In file included from ./include/grub/dl.h:23:0, from grub-core/lib/libgcrypt-grub/cipher/rfc2268.c:3: @@ -28,6 +29,7 @@ ist_push' was here list.h needs just ATTRIBUTE_ERROR from misc.h; split compiler features into separate file grub/compiler.h and include it instead. --- + ChangeLog | 14 +++++++++++ grub-core/commands/fileXX.c | 1 + grub-core/efiemu/prepare.c | 1 + grub-core/loader/i386/xen_file.c | 1 + @@ -39,12 +41,35 @@ into separate file grub/compiler.h and include it instead. include/grub/list.h | 4 +-- include/grub/misc.h | 29 +--------------------- include/grub/procfs.h | 1 + - ChangeLog | 14 +++++++++++ 12 files changed, 76 insertions(+), 30 deletions(-) create mode 100644 include/grub/compiler.h +diff --git a/ChangeLog b/ChangeLog +index dad2da2fa..dad469b43 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,19 @@ + 2014-01-18 Andrey Borzenkov + ++ * include/grub/misc.h: Move macros for compiler features to ... ++ * include/grub/compiler.h: ... new file. ++ * include/grub/list.h: Include instead of . ++ * grub-core/commands/fileXX.c: Include . ++ * grub-core/efiemu/prepare.c: Include . ++ * grub-core/loader/i386/xen_file.c: Include . ++ * grub-core/loader/i386/xen_fileXX.c: Include . ++ * grub-core/video/capture.c: Include . ++ * include/grub/command.h: Include . ++ * include/grub/dl.h: Include . ++ * include/grub/procfs.h: Include . ++ ++2014-01-18 Andrey Borzenkov ++ + * configure.ac: Add support for BUILD_EXEEXT and use it ... + * Makefile.am: ... here. + * Makefile.util.def: ... and here. diff --git a/grub-core/commands/fileXX.c b/grub-core/commands/fileXX.c -index c9857ff67b1..58e1094c68b 100644 +index c9857ff67..58e1094c6 100644 --- a/grub-core/commands/fileXX.c +++ b/grub-core/commands/fileXX.c @@ -18,6 +18,7 @@ @@ -56,7 +81,7 @@ index c9857ff67b1..58e1094c68b 100644 #pragma GCC diagnostic ignored "-Wcast-align" diff --git a/grub-core/efiemu/prepare.c b/grub-core/efiemu/prepare.c -index fb1b25d17f2..84c3368a82c 100644 +index fb1b25d17..84c3368a8 100644 --- a/grub-core/efiemu/prepare.c +++ b/grub-core/efiemu/prepare.c @@ -21,6 +21,7 @@ @@ -68,7 +93,7 @@ index fb1b25d17f2..84c3368a82c 100644 #include diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c -index ebbf6aa11ba..ff23235f064 100644 +index ebbf6aa11..ff23235f0 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -18,6 +18,7 @@ @@ -80,7 +105,7 @@ index ebbf6aa11ba..ff23235f064 100644 grub_elf_t grub_xen_file (grub_file_t file) diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c -index 6df00157629..73a5f90fdb9 100644 +index 6df001576..73a5f90fd 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -17,6 +17,7 @@ @@ -92,7 +117,7 @@ index 6df00157629..73a5f90fdb9 100644 static grub_err_t parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, diff --git a/grub-core/video/capture.c b/grub-core/video/capture.c -index 67c8edde824..4f83c744116 100644 +index 67c8edde8..4f83c7441 100644 --- a/grub-core/video/capture.c +++ b/grub-core/video/capture.c @@ -4,6 +4,7 @@ @@ -104,7 +129,7 @@ index 67c8edde824..4f83c744116 100644 static struct { diff --git a/include/grub/command.h b/include/grub/command.h -index 8705a635519..eee4e847ee4 100644 +index 8705a6355..eee4e847e 100644 --- a/include/grub/command.h +++ b/include/grub/command.h @@ -22,6 +22,7 @@ @@ -117,7 +142,7 @@ index 8705a635519..eee4e847ee4 100644 { diff --git a/include/grub/compiler.h b/include/grub/compiler.h new file mode 100644 -index 00000000000..c9e1d7a73dc +index 000000000..c9e1d7a73 --- /dev/null +++ b/include/grub/compiler.h @@ -0,0 +1,51 @@ @@ -173,7 +198,7 @@ index 00000000000..c9e1d7a73dc + +#endif /* ! GRUB_COMPILER_HEADER */ diff --git a/include/grub/dl.h b/include/grub/dl.h -index d29a899f52c..9562fa6634c 100644 +index d29a899f5..9562fa663 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -26,6 +26,7 @@ @@ -185,7 +210,7 @@ index d29a899f52c..9562fa6634c 100644 /* diff --git a/include/grub/list.h b/include/grub/list.h -index edd20adfdb2..d170ff6da02 100644 +index edd20adfd..d170ff6da 100644 --- a/include/grub/list.h +++ b/include/grub/list.h @@ -21,8 +21,8 @@ @@ -200,7 +225,7 @@ index edd20adfdb2..d170ff6da02 100644 struct grub_list { diff --git a/include/grub/misc.h b/include/grub/misc.h -index 2cf74b55006..c6cd4564d86 100644 +index 2cf74b550..c6cd4564d 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -25,34 +25,7 @@ @@ -240,7 +265,7 @@ index 2cf74b55006..c6cd4564d86 100644 #define ALIGN_UP(addr, align) \ ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1)) diff --git a/include/grub/procfs.h b/include/grub/procfs.h -index d393da77f91..8cc331d946f 100644 +index d393da77f..8cc331d94 100644 --- a/include/grub/procfs.h +++ b/include/grub/procfs.h @@ -20,6 +20,7 @@ @@ -251,25 +276,6 @@ index d393da77f91..8cc331d946f 100644 struct grub_procfs_entry { -diff --git a/ChangeLog b/ChangeLog -index dad2da2faef..dad469b43b1 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,17 @@ -+2014-01-18 Andrey Borzenkov -+ -+ * include/grub/misc.h: Move macros for compiler features to ... -+ * include/grub/compiler.h: ... new file. -+ * include/grub/list.h: Include instead of . -+ * grub-core/commands/fileXX.c: Include . -+ * grub-core/efiemu/prepare.c: Include . -+ * grub-core/loader/i386/xen_file.c: Include . -+ * grub-core/loader/i386/xen_fileXX.c: Include . -+ * grub-core/video/capture.c: Include . -+ * include/grub/command.h: Include . -+ * include/grub/dl.h: Include . -+ * include/grub/procfs.h: Include . -+ - 2014-01-18 Andrey Borzenkov - - * configure.ac: Add support for BUILD_EXEEXT and use it ... +-- +2.13.5 + 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 88122a7..5a60a1c 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,17 +1,32 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/commands/macbless.c: Rename FILE and DIR to avoid - conflicts. +Subject: [PATCH 028/261] * grub-core/commands/macbless.c: Rename FILE and DIR + to avoid conflicts. Reported by: Andrey Borzenkov. --- - grub-core/commands/macbless.c | 6 +++--- ChangeLog | 7 +++++++ + grub-core/commands/macbless.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index dad469b43..9d1a3f051 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++2014-01-18 Vladimir Serbinenko ++ ++ * grub-core/commands/macbless.c: Rename FILE and DIR to avoid ++ conflicts. ++ ++ Reported by: Andrey Borzenkov. ++ + 2014-01-18 Andrey Borzenkov + + * include/grub/misc.h: Move macros for compiler features to ... diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c -index c5210833ed0..4724edd7709 100644 +index c5210833e..4724edd77 100644 --- a/grub-core/commands/macbless.c +++ b/grub-core/commands/macbless.c @@ -37,7 +37,7 @@ struct find_node_context @@ -41,18 +56,6 @@ index c5210833ed0..4724edd7709 100644 } static grub_err_t -diff --git a/ChangeLog b/ChangeLog -index dad469b43b1..9d1a3f051c1 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * grub-core/commands/macbless.c: Rename FILE and DIR to avoid -+ conflicts. -+ -+ Reported by: Andrey Borzenkov. -+ - 2014-01-18 Andrey Borzenkov - - * include/grub/misc.h: Move macros for compiler features to ... +-- +2.13.5 + 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 4bf38f3..27d172a 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * Makefile.util.def: Link grub-ofpathname with zfs libs. +Subject: [PATCH 029/261] * Makefile.util.def: Link grub-ofpathname with zfs + libs. --- - Makefile.util.def | 2 +- ChangeLog | 4 ++++ + Makefile.util.def | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 9d1a3f051..edceb66db 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-01 Mike Gilbert ++ ++ * Makefile.util.def: Link grub-ofpathname with zfs libs. ++ + 2014-01-18 Vladimir Serbinenko + + * grub-core/commands/macbless.c: Rename FILE and DIR to avoid diff --git a/Makefile.util.def b/Makefile.util.def -index 83df212f412..a286a89cd8d 100644 +index 83df212f4..a286a89cd 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -384,7 +384,7 @@ program = { @@ -21,15 +34,6 @@ index 83df212f412..a286a89cd8d 100644 }; program = { -diff --git a/ChangeLog b/ChangeLog -index 9d1a3f051c1..edceb66dbcc 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-01 Mike Gilbert -+ -+ * Makefile.util.def: Link grub-ofpathname with zfs libs. -+ - 2014-01-18 Vladimir Serbinenko - - * grub-core/commands/macbless.c: Rename FILE and DIR to avoid +-- +2.13.5 + 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 index b5781c4..5fdb41c 100644 --- a/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch +++ b/SOURCES/0030-Makefile.am-default_payload.elf-Add-modules-multiboo.patch @@ -1,29 +1,16 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 62d74eb68cebd48250469a1bfd4a042267fb04c9 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 18 Jan 2014 19:43:19 +0100 -Subject: [PATCH] * Makefile.am (default_payload.elf): Add modules multiboot - cbmemc linux16 gzio echo help. +Subject: [PATCH 030/261] * Makefile.am (default_payload.elf): Add modules + multiboot cbmemc linux16 gzio echo help. --- - Makefile.am | 2 +- ChangeLog | 7 ++++++- + Makefile.am | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) -diff --git a/Makefile.am b/Makefile.am -index aa526f573c3..97c062d7d35 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 diff --git a/ChangeLog b/ChangeLog -index edceb66dbcc..cff9386d3d2 100644 +index edceb66db..cff9386d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ @@ -37,3 +24,19 @@ index edceb66dbcc..cff9386d3d2 100644 * Makefile.util.def: Link grub-ofpathname with zfs libs. +diff --git a/Makefile.am b/Makefile.am +index aa526f573..97c062d7d 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.13.5 + 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 ae23226..a22ac7f 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 0000000000000000000000000000000000000000 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] fix removal of {cpu,machine} links on mingw/msys +Subject: [PATCH 031/261] 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. @@ -15,7 +15,7 @@ Make it more clear in message that we are checking "ln -s". 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog -index cff9386d3d2..c3bfa9fcb1b 100644 +index cff9386d3..c3bfa9fcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -28,7 +28,7 @@ index cff9386d3d2..c3bfa9fcb1b 100644 * Makefile.am (default_payload.elf): Add modules diff --git a/acinclude.m4 b/acinclude.m4 -index 32d5477d100..b2bb88d838e 100644 +index 32d5477d1..b2bb88d83 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -418,15 +418,15 @@ else @@ -50,3 +50,6 @@ index 32d5477d100..b2bb88d838e 100644 AC_MSG_RESULT([yes]) [link_dir=yes else +-- +2.13.5 + 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 c019a8e..f543031 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,16 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/normal/main.c (read_config_file): Buffer config - file. Reduces boot time. +Subject: [PATCH 032/261] * grub-core/normal/main.c (read_config_file): Buffer + config file. Reduces boot time. --- - grub-core/normal/main.c | 14 +++++++++++--- ChangeLog | 5 +++++ + grub-core/normal/main.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index c3bfa9fcb..c84f7e7cc 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-18 Vladimir Serbinenko ++ ++ * grub-core/normal/main.c (read_config_file): Buffer config file. ++ Reduces boot time. ++ + 2014-01-18 Andrey Borzenkov + + * acinclude.m4 (grub_CHECK_LINK_DIR): Check that we can also remove diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index c36663f738c..3a926fc5fa9 100644 +index c36663f73..3a926fc5f 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -32,6 +32,7 @@ @@ -50,16 +63,6 @@ index c36663f738c..3a926fc5fa9 100644 ctmp = grub_env_get ("config_file"); if (ctmp) old_file = grub_strdup (ctmp); -diff --git a/ChangeLog b/ChangeLog -index c3bfa9fcb1b..c84f7e7cc00 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * grub-core/normal/main.c (read_config_file): Buffer config file. -+ Reduces boot time. -+ - 2014-01-18 Andrey Borzenkov - - * acinclude.m4 (grub_CHECK_LINK_DIR): Check that we can also remove +-- +2.13.5 + 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 f4eb803..07894b0 100644 --- a/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch +++ b/SOURCES/0033-util-grub-install.c-Fix-a-typo.patch @@ -1,15 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-install.c: Fix a typo. +Subject: [PATCH 033/261] * util/grub-install.c: Fix a typo. --- - util/grub-install.c | 2 +- ChangeLog | 4 ++++ + util/grub-install.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index c84f7e7cc..9360345ef 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-01-18 Vladimir Serbinenko + ++ * util/grub-install.c: Fix a typo. ++ ++2014-01-18 Vladimir Serbinenko ++ + * grub-core/normal/main.c (read_config_file): Buffer config file. + Reduces boot time. + diff --git a/util/grub-install.c b/util/grub-install.c -index 4608b80fe05..5903f340a61 100644 +index 4608b80fe..5903f340a 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1259,7 +1259,7 @@ main (int argc, char *argv[]) @@ -21,15 +35,6 @@ index 4608b80fe05..5903f340a61 100644 grub_util_get_config_filename ()); if (disk_module && grub_strcmp (disk_module, "ata") == 0) -diff --git a/ChangeLog b/ChangeLog -index c84f7e7cc00..9360345efc2 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-18 Vladimir Serbinenko -+ -+ * util/grub-install.c: Fix a typo. -+ - 2014-01-18 Vladimir Serbinenko - - * grub-core/normal/main.c (read_config_file): Buffer config file. +-- +2.13.5 + 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 b4fd228..757c6ab 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 0000000000000000000000000000000000000000 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] use MODULE_FILES for genemuinit* instead of MOD_FILES +Subject: [PATCH 034/261] use MODULE_FILES for genemuinit* instead of MOD_FILES MinGW native nm does not support ELF binaries. --- @@ -12,7 +12,7 @@ MinGW native nm does not support ELF binaries. 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 9360345efc2..4688ff4e6d3 100644 +index 9360345ef..4688ff4e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ @@ -28,7 +28,7 @@ index 9360345efc2..4688ff4e6d3 100644 * util/grub-install.c: Fix a typo. diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 826b3dd7c1a..5c087c83b8f 100644 +index 826b3dd7c..5c087c83b 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -294,12 +294,12 @@ grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h @@ -49,7 +49,7 @@ index 826b3dd7c1a..5c087c83b8f 100644 endif diff --git a/grub-core/genemuinit.sh b/grub-core/genemuinit.sh -index 45c15ecb9f4..8c6bb1c18ff 100644 +index 45c15ecb9..8c6bb1c18 100644 --- a/grub-core/genemuinit.sh +++ b/grub-core/genemuinit.sh @@ -47,7 +47,7 @@ EOF @@ -71,7 +71,7 @@ index 45c15ecb9f4..8c6bb1c18ff 100644 done diff --git a/grub-core/genemuinitheader.sh b/grub-core/genemuinitheader.sh -index 6b83f599317..a99a15d06f1 100644 +index 6b83f5993..a99a15d06 100644 --- a/grub-core/genemuinitheader.sh +++ b/grub-core/genemuinitheader.sh @@ -44,9 +44,9 @@ EOF @@ -86,3 +86,6 @@ index 6b83f599317..a99a15d06f1 100644 + echo "void grub_${line%%.*}_fini (void);" fi done +-- +2.13.5 + 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 0c2043c..413b675 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 0000000000000000000000000000000000000000 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] Ignore EPERM when modifying kern.geom.debugflags +Subject: [PATCH 035/261] 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, @@ -11,12 +11,27 @@ MBR, but if we need to do that and can't then we will get an error later. Enforcing it here is unnecessary and prevents otherwise perfectly reasonable operations. --- - grub-core/osdep/freebsd/hostdisk.c | 12 ++++++++++-- ChangeLog | 7 +++++++ + grub-core/osdep/freebsd/hostdisk.c | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 4688ff4e6..10abfe28f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++2014-01-19 Colin Watson ++ ++ * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore ++ EPERM when modifying kern.geom.debugflags. It is only a problem for ++ such things as installing GRUB to the MBR, in which case there'll be ++ an error later anyway, not for opening files during tests. ++ + 2014-01-18 Andrey Borzenkov + + * grub-core/Makefile.am: Build grub_emu_init.[ch] from MODULE_FILES diff --git a/grub-core/osdep/freebsd/hostdisk.c b/grub-core/osdep/freebsd/hostdisk.c -index eb202dcc831..6145d073555 100644 +index eb202dcc8..6145d0735 100644 --- a/grub-core/osdep/freebsd/hostdisk.c +++ b/grub-core/osdep/freebsd/hostdisk.c @@ -102,8 +102,16 @@ grub_util_fd_open (const char *os_dev, int flags) @@ -38,18 +53,6 @@ index eb202dcc831..6145d073555 100644 } ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR); -diff --git a/ChangeLog b/ChangeLog -index 4688ff4e6d3..10abfe28f20 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-19 Colin Watson -+ -+ * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore -+ EPERM when modifying kern.geom.debugflags. It is only a problem for -+ such things as installing GRUB to the MBR, in which case there'll be -+ an error later anyway, not for opening files during tests. -+ - 2014-01-18 Andrey Borzenkov - - * grub-core/Makefile.am: Build grub_emu_init.[ch] from MODULE_FILES +-- +2.13.5 + 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 e16c2d1..a960e3d 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 0000000000000000000000000000000000000000 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] change stop condition to avoid infinite loops +Subject: [PATCH 036/261] 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. @@ -10,25 +10,12 @@ If GRUB is idle and enter in this loop, the only condition to leave is if it doesn't have incoming packages. In a network with heavy traffic this never happens. --- - grub-core/net/net.c | 2 +- ChangeLog | 12 ++++++++++++ + grub-core/net/net.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) -diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 0e57e93e821..56355f3c98c 100644 ---- a/grub-core/net/net.c -+++ b/grub-core/net/net.c -@@ -1453,7 +1453,7 @@ receive_packets (struct grub_net_card *card, int *stop_condition) - } - card->opened = 1; - } -- while (1) -+ while (received < 100) - { - /* Maybe should be better have a fixed number of packets for each card - and just mark them as used and not used. */ diff --git a/ChangeLog b/ChangeLog -index 10abfe28f20..f69d8c7e042 100644 +index 10abfe28f..f69d8c7e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ @@ -47,3 +34,19 @@ index 10abfe28f20..f69d8c7e042 100644 2014-01-19 Colin Watson * grub-core/osdep/freebsd/hostdisk.c (grub_util_fd_open): Ignore +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 0e57e93e8..56355f3c9 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -1453,7 +1453,7 @@ receive_packets (struct grub_net_card *card, int *stop_condition) + } + card->opened = 1; + } +- while (1) ++ while (received < 100) + { + /* Maybe should be better have a fixed number of packets for each card + and just mark them as used and not used. */ +-- +2.13.5 + diff --git a/SOURCES/0037-increase-network-try-interval-gradually.patch b/SOURCES/0037-increase-network-try-interval-gradually.patch index f3ddc4c..322d079 100644 --- a/SOURCES/0037-increase-network-try-interval-gradually.patch +++ b/SOURCES/0037-increase-network-try-interval-gradually.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] increase network try interval gradually +Subject: [PATCH 037/261] increase network try interval gradually * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try interval gradually. @@ -10,16 +10,35 @@ interval gradually. * grub-core/net/tftp.c (tftp_open): Likewise. * include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define. --- + ChangeLog | 9 +++++++++ grub-core/net/arp.c | 3 ++- grub-core/net/icmp6.c | 3 ++- grub-core/net/net.c | 5 +++-- grub-core/net/tftp.c | 3 ++- include/grub/net.h | 1 + - ChangeLog | 9 +++++++++ 6 files changed, 19 insertions(+), 5 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index f69d8c7e0..f5618a6eb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,14 @@ + 2014-01-21 Paulo Flabiano Smorigo + ++ * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try ++ interval gradually. ++ * grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise. ++ * grub-core/net/net.c (grub_net_fs_read_real): Likewise. ++ * grub-core/net/tftp.c (tftp_open): Likewise. ++ * include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define. ++ ++2014-01-21 Paulo Flabiano Smorigo ++ + * grub-core/net/net.c (receive_packets): Change stop condition to avoid + infinite loops. + diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index e92c7e7daec..d62d0cc1e01 100644 +index e92c7e7da..d62d0cc1e 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -110,7 +110,8 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, @@ -33,7 +52,7 @@ index e92c7e7daec..d62d0cc1e01 100644 return GRUB_ERR_NONE; nb.data = nbd; diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index 2741e6f11fb..bbc902014fe 100644 +index 2741e6f11..bbc902014 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -518,7 +518,8 @@ grub_net_icmp6_send_request (struct grub_net_network_level_interface *inf, @@ -47,7 +66,7 @@ index 2741e6f11fb..bbc902014fe 100644 break; nb->data = nbd; diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 56355f3c98c..1521d8d2c87 100644 +index 56355f3c9..1521d8d2c 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1558,8 +1558,9 @@ grub_net_fs_read_real (grub_file_t file, char *buf, grub_size_t len) @@ -63,7 +82,7 @@ index 56355f3c98c..1521d8d2c87 100644 return total; } diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 9c489f1fc94..51736142764 100644 +index 9c489f1fc..517361427 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -398,7 +398,8 @@ tftp_open (struct grub_file *file, const char *filename) @@ -77,7 +96,7 @@ index 9c489f1fc94..51736142764 100644 break; } diff --git a/include/grub/net.h b/include/grub/net.h -index de6259ee1a0..0e0a605c5a6 100644 +index de6259ee1..0e0a605c5 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -532,5 +532,6 @@ extern char *grub_net_default_server; @@ -87,20 +106,6 @@ index de6259ee1a0..0e0a605c5a6 100644 +#define GRUB_NET_INTERVAL_ADDITION 20 #endif /* ! GRUB_NET_HEADER */ -diff --git a/ChangeLog b/ChangeLog -index f69d8c7e042..f5618a6eb70 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,12 @@ -+2014-01-21 Paulo Flabiano Smorigo -+ -+ * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try -+ interval gradually. -+ * grub-core/net/icmp6.c (grub_net_icmp6_send_request): Likewise. -+ * grub-core/net/net.c (grub_net_fs_read_real): Likewise. -+ * grub-core/net/tftp.c (tftp_open): Likewise. -+ * include/grub/net.h (GRUB_NET_INTERVAL_ADDITION): New define. -+ - 2014-01-21 Paulo Flabiano Smorigo - - * grub-core/net/net.c (receive_packets): Change stop condition to avoid +-- +2.13.5 + 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 72a51a0..7e8506b 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,16 +1,28 @@ -From 0000000000000000000000000000000000000000 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] look for DejaVu also in /usr/share/fonts/truetype +Subject: [PATCH 038/261] look for DejaVu also in /usr/share/fonts/truetype It is installed in this path on openSUSE. --- - configure.ac | 2 +- ChangeLog | 4 ++++ + configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index f5618a6eb..9f5d81dfb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-21 Andrey Borzenkov ++ ++ * configure.ac: Look for DejaVuSans also in /usr/share/fonts/truetype. ++ + 2014-01-21 Paulo Flabiano Smorigo + + * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try diff --git a/configure.ac b/configure.ac -index cf3de3be1fc..120263e9c58 100644 +index cf3de3be1..120263e9c 100644 --- a/configure.ac +++ b/configure.ac @@ -1389,7 +1389,7 @@ fi @@ -22,15 +34,6 @@ index cf3de3be1fc..120263e9c58 100644 if test -f "$dir/DejaVuSans.$ext"; then DJVU_FONT_SOURCE="$dir/DejaVuSans.$ext" break 2 -diff --git a/ChangeLog b/ChangeLog -index f5618a6eb70..9f5d81dfbac 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-21 Andrey Borzenkov -+ -+ * configure.ac: Look for DejaVuSans also in /usr/share/fonts/truetype. -+ - 2014-01-21 Paulo Flabiano Smorigo - - * grub-core/net/arp.c (grub_net_arp_send_request): Increase network try +-- +2.13.5 + 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 9162ce2..c6cefdc 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,27 +1,15 @@ -From 0000000000000000000000000000000000000000 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] Show detected path to DejaVuSans in configure summary +Subject: [PATCH 039/261] Show detected path to DejaVuSans in configure summary --- - configure.ac | 1 + ChangeLog | 1 + + configure.ac | 1 + 2 files changed, 2 insertions(+) -diff --git a/configure.ac b/configure.ac -index 120263e9c58..8888c2ff29c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1816,6 +1816,7 @@ echo grub-mount: No "($grub_mount_excuse)" - fi - if [ x"$starfield_excuse" = x ]; then - echo starfield theme: Yes -+echo With DejaVuSans font from $DJVU_FONT_SOURCE - else - echo starfield theme: No "($starfield_excuse)" - fi diff --git a/ChangeLog b/ChangeLog -index 9f5d81dfbac..3ba57aed842 100644 +index 9f5d81dfb..3ba57aed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ @@ -32,3 +20,18 @@ index 9f5d81dfbac..3ba57aed842 100644 2014-01-21 Paulo Flabiano Smorigo +diff --git a/configure.ac b/configure.ac +index 120263e9c..8888c2ff2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1816,6 +1816,7 @@ echo grub-mount: No "($grub_mount_excuse)" + fi + if [ x"$starfield_excuse" = x ]; then + echo starfield theme: Yes ++echo With DejaVuSans font from $DJVU_FONT_SOURCE + else + echo starfield theme: No "($starfield_excuse)" + fi +-- +2.13.5 + 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 832f2f1..73d5212 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,8 @@ -From 0000000000000000000000000000000000000000 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] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime files +Subject: [PATCH 040/261] add GRUB_WINDOWS_EXTRA_DIST to allow shipping runtime + files Not all toolkits provide static libraries. This patch enables creation of self contained distribution that does not require pre-existing runtime libraries. @@ -18,12 +19,27 @@ package everything in one step. Also remove $(windowsdir) after ZIP was created same as other "make dist" targets. --- - Makefile.am | 4 ++++ ChangeLog | 5 +++++ + Makefile.am | 4 ++++ 2 files changed, 9 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 3ba57aed8..1ede37091 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-21 Andrey Borzenkov + ++ * Makefile.am: Allow adding extra files to generated Windows ZIP ++ archive by setting GRUB_WINDOWS_EXTRA_DIST. ++ ++2014-01-21 Andrey Borzenkov ++ + * configure.ac: Look for DejaVuSans also in /usr/share/fonts/truetype. + Show detected font path in summary. + diff --git a/Makefile.am b/Makefile.am -index 97c062d7d35..f02ae0a393c 100644 +index 97c062d7d..f02ae0a39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -420,10 +420,14 @@ windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA) @@ -41,16 +57,6 @@ index 97c062d7d35..f02ae0a393c 100644 + rm -rf $(windowsdir) EXTRA_DIST += linguas.sh -diff --git a/ChangeLog b/ChangeLog -index 3ba57aed842..1ede3709165 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-21 Andrey Borzenkov -+ -+ * Makefile.am: Allow adding extra files to generated Windows ZIP -+ archive by setting GRUB_WINDOWS_EXTRA_DIST. -+ - 2014-01-21 Andrey Borzenkov - - * configure.ac: Look for DejaVuSans also in /usr/share/fonts/truetype. +-- +2.13.5 + 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 003b15f..091f858 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,27 +1,16 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-install.c (write_to_disk): Add an info message. +Subject: [PATCH 041/261] * util/grub-install.c (write_to_disk): Add an info + message. --- - util/grub-install.c | 1 + ChangeLog | 4 ++++ + util/grub-install.c | 1 + 2 files changed, 5 insertions(+) -diff --git a/util/grub-install.c b/util/grub-install.c -index 5903f340a61..787dc90fce5 100644 ---- a/util/grub-install.c -+++ b/util/grub-install.c -@@ -675,6 +675,7 @@ write_to_disk (grub_device_t dev, const char *fn) - - core_img = grub_util_read_image (fn); - -+ grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name); - err = grub_disk_write (dev->disk, 0, 0, - core_size, core_img); - free (core_img); diff --git a/ChangeLog b/ChangeLog -index 1ede3709165..eee8e78a726 100644 +index 1ede37091..eee8e78a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -32,3 +21,18 @@ index 1ede3709165..eee8e78a726 100644 2014-01-21 Andrey Borzenkov * Makefile.am: Allow adding extra files to generated Windows ZIP +diff --git a/util/grub-install.c b/util/grub-install.c +index 5903f340a..787dc90fc 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -675,6 +675,7 @@ write_to_disk (grub_device_t dev, const char *fn) + + core_img = grub_util_read_image (fn); + ++ grub_util_info ("writing `%s' to `%s'", fn, dev->disk->name); + err = grub_disk_write (dev->disk, 0, 0, + core_size, core_img); + free (core_img); +-- +2.13.5 + 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 364f5af..a8e56cc 100644 --- a/SOURCES/0042-util-grub-install.c-List-available-targets.patch +++ b/SOURCES/0042-util-grub-install.c-List-available-targets.patch @@ -1,24 +1,48 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-install.c: List available targets. +Subject: [PATCH 042/261] * util/grub-install.c: List available targets. --- + ChangeLog | 4 ++++ + include/grub/util/install.h | 2 ++ util/grub-install-common.c | 30 ++++++++++++++++++++++++++++++ util/grub-install.c | 10 ++++++++-- - include/grub/util/install.h | 2 ++ - ChangeLog | 4 ++++ 4 files changed, 44 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index eee8e78a7..20e8baaa2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-24 Vladimir Serbinenko ++ ++ * util/grub-install.c: List available targets. ++ + 2014-01-23 Colin Watson + + * util/grub-install.c (write_to_disk): Add an info message. +diff --git a/include/grub/util/install.h b/include/grub/util/install.h +index bc987aadc..aedcd29f9 100644 +--- a/include/grub/util/install.h ++++ b/include/grub/util/install.h +@@ -138,6 +138,8 @@ grub_install_get_platform_cpu (enum grub_install_plat platid); + const char * + grub_install_get_platform_platform (enum grub_install_plat platid); + ++char * ++grub_install_get_platforms_string (void); + + typedef enum { + GRUB_COMPRESSION_AUTO, diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index 6ea0a8e1795..c8bedcb2e59 100644 +index 6ea0a8e17..c8bedcb2e 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c -@@ -667,6 +667,36 @@ static struct - [GRUB_INSTALL_PLATFORM_ARM_UBOOT] = { "arm", "uboot" }, +@@ -668,6 +668,36 @@ static struct }; -+char * + char * +grub_install_get_platforms_string (void) +{ + char **arr = xmalloc (sizeof (char *) * ARRAY_SIZE (platforms)); @@ -48,11 +72,12 @@ index 6ea0a8e1795..c8bedcb2e59 100644 + return platforms_string; +} + - char * ++char * grub_install_get_platform_name (enum grub_install_plat platid) { + return xasprintf ("%s-%s", platforms[platid].cpu, diff --git a/util/grub-install.c b/util/grub-install.c -index 787dc90fce5..2e6226a3716 100644 +index 787dc90fc..2e6226a37 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -256,7 +256,7 @@ static struct argp_option options[] = { @@ -79,28 +104,6 @@ index 787dc90fce5..2e6226a3716 100644 case ARGP_KEY_HELP_POST_DOC: return xasprintf (text, program_name, GRUB_BOOT_DIR_NAME "/" GRUB_DIR_NAME); default: -diff --git a/include/grub/util/install.h b/include/grub/util/install.h -index bc987aadc16..aedcd29f905 100644 ---- a/include/grub/util/install.h -+++ b/include/grub/util/install.h -@@ -138,6 +138,8 @@ grub_install_get_platform_cpu (enum grub_install_plat platid); - const char * - grub_install_get_platform_platform (enum grub_install_plat platid); - -+char * -+grub_install_get_platforms_string (void); - - typedef enum { - GRUB_COMPRESSION_AUTO, -diff --git a/ChangeLog b/ChangeLog -index eee8e78a726..20e8baaa23e 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-24 Vladimir Serbinenko -+ -+ * util/grub-install.c: List available targets. -+ - 2014-01-23 Colin Watson - - * util/grub-install.c (write_to_disk): Add an info message. +-- +2.13.5 + diff --git a/SOURCES/0043-Fix-several-translatable-strings.patch b/SOURCES/0043-Fix-several-translatable-strings.patch index 7cbc73f..d0be06c 100644 --- a/SOURCES/0043-Fix-several-translatable-strings.patch +++ b/SOURCES/0043-Fix-several-translatable-strings.patch @@ -1,21 +1,37 @@ -From 0000000000000000000000000000000000000000 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] Fix several translatable strings. +Subject: [PATCH 043/261] Fix several translatable strings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by: D. Prévot. --- + ChangeLog | 6 ++++++ grub-core/commands/syslinuxcfg.c | 2 +- grub-core/loader/arm64/linux.c | 2 +- util/grub-syslinux2cfg.c | 4 ++-- - ChangeLog | 6 ++++++ 4 files changed, 10 insertions(+), 4 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 20e8baaa2..e149d8ef3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,11 @@ + 2014-01-24 Vladimir Serbinenko + ++ Fix several translatable strings. ++ ++ Suggested by: D. Prévot. ++ ++2014-01-24 Vladimir Serbinenko ++ + * util/grub-install.c: List available targets. + + 2014-01-23 Colin Watson diff --git a/grub-core/commands/syslinuxcfg.c b/grub-core/commands/syslinuxcfg.c -index a4bfc40b6d2..00ae113c5a7 100644 +index a4bfc40b6..00ae113c5 100644 --- a/grub-core/commands/syslinuxcfg.c +++ b/grub-core/commands/syslinuxcfg.c @@ -50,7 +50,7 @@ static const struct grub_arg_option options[] = @@ -28,7 +44,7 @@ index a4bfc40b6d2..00ae113c5a7 100644 {"isolinux", 'i', 0, N_("assume input is an isolinux configuration file."), 0, 0}, {"pxelinux", 'p', 0, N_("assume input is a pxelinux configuration file."), 0, 0}, diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 75ad871a81c..65129c21a8d 100644 +index 75ad871a8..65129c21a 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -120,7 +120,7 @@ check_kernel (struct grub_arm64_linux_kernel_header *lh) @@ -41,7 +57,7 @@ index 75ad871a81c..65129c21a8d 100644 grub_dprintf ("linux", "UEFI stub kernel:\n"); grub_dprintf ("linux", "text_offset = 0x%012llx\n", diff --git a/util/grub-syslinux2cfg.c b/util/grub-syslinux2cfg.c -index 5e944c20a83..f4fda6db9bb 100644 +index 5e944c20a..f4fda6db9 100644 --- a/util/grub-syslinux2cfg.c +++ b/util/grub-syslinux2cfg.c @@ -66,10 +66,10 @@ static struct argp_option options[] = { @@ -57,17 +73,6 @@ index 5e944c20a83..f4fda6db9bb 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}, -diff --git a/ChangeLog b/ChangeLog -index 20e8baaa23e..e149d8ef33d 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,9 @@ -+2014-01-24 Vladimir Serbinenko -+ -+ Fix several translatable strings. -+ -+ Suggested by: D. Prévot. -+ - 2014-01-24 Vladimir Serbinenko - - * util/grub-install.c: List available targets. +-- +2.13.5 + 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 3a6d430..591545d 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,17 +1,29 @@ -From 0000000000000000000000000000000000000000 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] do not set default prefix in grub-mkimage +Subject: [PATCH 044/261] 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. --- - util/grub-mkimage.c | 16 +++++++++++----- ChangeLog | 4 ++++ + util/grub-mkimage.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index e149d8ef3..b405b7ee5 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-25 Andrey Borzenkov ++ ++ * util/grub-mkimage.c: Make prefix argument mandatory. ++ + 2014-01-24 Vladimir Serbinenko + + Fix several translatable strings. diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c -index a2bd4c196e5..1e0bcf1bf4f 100644 +index a2bd4c196..1e0bcf1bf 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -64,7 +64,7 @@ static struct argp_option options[] = { @@ -58,15 +70,6 @@ index a2bd4c196e5..1e0bcf1bf4f 100644 arguments.output, arguments.modules, arguments.memdisk, arguments.pubkeys, arguments.npubkeys, arguments.config, -diff --git a/ChangeLog b/ChangeLog -index e149d8ef33d..b405b7ee5bd 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-25 Andrey Borzenkov -+ -+ * util/grub-mkimage.c: Make prefix argument mandatory. -+ - 2014-01-24 Vladimir Serbinenko - - Fix several translatable strings. +-- +2.13.5 + 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 cbd9868..b3fd397 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 0000000000000000000000000000000000000000 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] fix Mingw W64-32 cross compile failure due to printf +Subject: [PATCH 045/261] fix Mingw W64-32 cross compile failure due to printf redefinition in libintl.h In file included from util/misc.c:36:0: @@ -17,15 +17,32 @@ is not present in native MinGW build which avoids redefinition. Use v2: add grub-core/lib/libgcrypt/src/g10lib.h v3: modify g10lib.h during import --- + ChangeLog | 9 +++++++++ include/grub/crypto.h | 2 +- include/grub/emu/misc.h | 8 ++++---- include/grub/err.h | 2 +- - ChangeLog | 9 +++++++++ util/import_gcry.py | 6 ++++++ 5 files changed, 21 insertions(+), 6 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index b405b7ee5..c93f11fbb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,12 @@ ++ ++2014-01-25 Andrey Borzenkov ++ ++ * include/grub/crypto.h: Replace __attribute__ ((format (printf)) with ++ __attribute__ ((format (__printf__)) to fix compilation under MinGW-w64. ++ * include/grub/emu/misc.h: ... and here. ++ * include/grub/err.h: ... and here. ++ * util/import_gcry.py: ... and here (in files g10lib.h). ++ + 2014-01-25 Andrey Borzenkov + + * util/grub-mkimage.c: Make prefix argument mandatory. diff --git a/include/grub/crypto.h b/include/grub/crypto.h -index ec1b980d2ec..a24e89dd9cd 100644 +index ec1b980d2..a24e89dd9 100644 --- a/include/grub/crypto.h +++ b/include/grub/crypto.h @@ -408,7 +408,7 @@ void _gcry_assert_failed (const char *expr, const char *file, int line, @@ -38,7 +55,7 @@ index ec1b980d2ec..a24e89dd9cd 100644 #ifdef GRUB_UTIL diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h -index dde48c192d3..a588ba21da2 100644 +index dde48c192..a588ba21d 100644 --- a/include/grub/emu/misc.h +++ b/include/grub/emu/misc.h @@ -53,11 +53,11 @@ grub_util_device_is_mapped (const char *dev); @@ -58,7 +75,7 @@ index dde48c192d3..a588ba21da2 100644 grub_uint64_t EXPORT_FUNC (grub_util_get_cpu_time_ms) (void); diff --git a/include/grub/err.h b/include/grub/err.h -index 9896fccf98a..1590c688e1d 100644 +index 9896fccf9..1590c688e 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -91,6 +91,6 @@ int EXPORT_FUNC(grub_error_pop) (void); @@ -69,25 +86,8 @@ index 9896fccf98a..1590c688e1d 100644 + __attribute__ ((format (__printf__, 1, 2))); #endif /* ! GRUB_ERR_HEADER */ -diff --git a/ChangeLog b/ChangeLog -index b405b7ee5bd..c93f11fbb20 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,12 @@ -+ -+2014-01-25 Andrey Borzenkov -+ -+ * include/grub/crypto.h: Replace __attribute__ ((format (printf)) with -+ __attribute__ ((format (__printf__)) to fix compilation under MinGW-w64. -+ * include/grub/emu/misc.h: ... and here. -+ * include/grub/err.h: ... and here. -+ * util/import_gcry.py: ... and here (in files g10lib.h). -+ - 2014-01-25 Andrey Borzenkov - - * util/grub-mkimage.c: Make prefix argument mandatory. diff --git a/util/import_gcry.py b/util/import_gcry.py -index 63ebb90f1fe..2b3322d3a12 100644 +index 63ebb90f1..2b3322d3a 100644 --- a/util/import_gcry.py +++ b/util/import_gcry.py @@ -534,6 +534,12 @@ for src in sorted (os.listdir (os.path.join (indir, "src"))): @@ -103,3 +103,6 @@ index 63ebb90f1fe..2b3322d3a12 100644 fw.write (f.read ()) f.close () fw.close () +-- +2.13.5 + 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 2f0d133..17c11db 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,17 +1,30 @@ -From 0000000000000000000000000000000000000000 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] * 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/261] * 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. --- - grub-core/term/serial.c | 8 ++++---- ChangeLog | 5 +++++ + grub-core/term/serial.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index c93f11fbb..67b4d5c2a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-01-26 Vladimir Serbinenko ++ ++ * 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. + + 2014-01-25 Andrey Borzenkov + diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c -index b581a763ed0..c9b5574ae3c 100644 +index b581a763e..c9b5574ae 100644 --- a/grub-core/term/serial.c +++ b/grub-core/term/serial.c @@ -338,23 +338,23 @@ grub_serial_register (struct grub_serial_port *port) @@ -42,16 +55,6 @@ index b581a763ed0..c9b5574ae3c 100644 return grub_errno; } -diff --git a/ChangeLog b/ChangeLog -index c93f11fbb20..67b4d5c2add 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-26 Vladimir Serbinenko -+ -+ * 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. - - 2014-01-25 Andrey Borzenkov - +-- +2.13.5 + 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 76f1a8e..9977a18 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,17 +1,33 @@ -From 0000000000000000000000000000000000000000 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] grub-install: support for partitioned partx loop devices. +Subject: [PATCH 047/261] 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. --- - grub-core/osdep/linux/getroot.c | 13 +++++++++++++ ChangeLog | 7 +++++++ + grub-core/osdep/linux/getroot.c | 13 +++++++++++++ 2 files changed, 20 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 67b4d5c2a..bbec1e70b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++2014-01-26 Mike Gilbert ++ ++ 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. ++ + 2014-01-26 Vladimir Serbinenko + + * grub-core/term/serial.c (grub_serial_register): Fix invalid free. diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 772de0a9bc4..19581d32997 100644 +index 772de0a9b..19581d329 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, @@ -34,18 +50,6 @@ index 772de0a9bc4..19581d32997 100644 } return path; -diff --git a/ChangeLog b/ChangeLog -index 67b4d5c2add..bbec1e70bbd 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-01-26 Mike Gilbert -+ -+ 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. -+ - 2014-01-26 Vladimir Serbinenko - - * grub-core/term/serial.c (grub_serial_register): Fix invalid free. +-- +2.13.5 + 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 cf332c0..75e3943 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/term/at_keyboard.c: Tolerate missing keyboard. +Subject: [PATCH 048/261] * grub-core/term/at_keyboard.c: Tolerate missing + keyboard. --- - grub-core/term/at_keyboard.c | 3 +++ ChangeLog | 4 ++++ + grub-core/term/at_keyboard.c | 3 +++ 2 files changed, 7 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index bbec1e70b..d37d4a6fc 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-01-26 Vladimir Serbinenko ++ ++ * grub-core/term/at_keyboard.c: Tolerate missing keyboard. ++ + 2014-01-26 Mike Gilbert + + grub-install: support for partitioned partx loop devices. diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c -index f5071ce69e8..b4257e84a04 100644 +index f5071ce69..b4257e84a 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -396,6 +396,9 @@ fetch_key (int *is_break) @@ -22,15 +35,6 @@ index f5071ce69e8..b4257e84a04 100644 if (at_key == 0xe0) { e0_received = 1; -diff --git a/ChangeLog b/ChangeLog -index bbec1e70bbd..d37d4a6fc16 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-26 Vladimir Serbinenko -+ -+ * grub-core/term/at_keyboard.c: Tolerate missing keyboard. -+ - 2014-01-26 Mike Gilbert - - grub-install: support for partitioned partx loop devices. +-- +2.13.5 + 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 267ab1e..75d5714 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 0000000000000000000000000000000000000000 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] .gitignore: add missing files and .exe variants. +Subject: [PATCH 049/261] .gitignore: add missing files and .exe variants. --- .gitignore | 7 +++++++ @@ -9,7 +9,7 @@ Subject: [PATCH] .gitignore: add missing files and .exe variants. 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore -index 2b0156acd7c..18ab8e81278 100644 +index 2b0156acd..18ab8e812 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,8 @@ grub-emu.exe @@ -48,7 +48,7 @@ index 2b0156acd7c..18ab8e81278 100644 grub-core/gnulib/alloca.h grub-core/gnulib/arg-nonnull.h diff --git a/ChangeLog b/ChangeLog -index d37d4a6fc16..a49f5f1f48f 100644 +index d37d4a6fc..a49f5f1f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ @@ -68,3 +68,6 @@ index d37d4a6fc16..a49f5f1f48f 100644 entries. 2013-12-14 Vladimir Serbinenko +-- +2.13.5 + 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 83a6b08..c58fc97 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,16 +1,33 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-mkfont.c: Downgrade warnings about unhandled - features to debug. +Subject: [PATCH 050/261] * util/grub-mkfont.c: Downgrade warnings about + unhandled features to debug. --- - util/grub-mkfont.c | 14 ++++++++------ ChangeLog | 9 +++++++++ + util/grub-mkfont.c | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index a49f5f1f4..9837c7f8d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,12 @@ ++2014-01-29 Vladimir Serbinenko ++ ++ * util/grub-mkfont.c: Downgrade warnings about unhandled features ++ to debug. ++ ++2014-01-29 Vladimir Serbinenko ++ ++ * grub-core/term/at_keyboard.c: Tolerate missing keyboard. ++ + 2014-01-29 Paulo Flabiano Smorigo + + * .gitignore: add missing files and .exe variants. diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c -index 3cb02ad5c45..3de07ee9c06 100644 +index 3cb02ad5c..3de07ee9c 100644 --- a/util/grub-mkfont.c +++ b/util/grub-mkfont.c @@ -516,8 +516,8 @@ process_cursive (struct gsub_feature *feature, @@ -55,20 +72,6 @@ index 3cb02ad5c45..3de07ee9c06 100644 } } } -diff --git a/ChangeLog b/ChangeLog -index a49f5f1f48f..9837c7f8d38 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,12 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * util/grub-mkfont.c: Downgrade warnings about unhandled features -+ to debug. -+ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/term/at_keyboard.c: Tolerate missing keyboard. -+ - 2014-01-29 Paulo Flabiano Smorigo - - * .gitignore: add missing files and .exe variants. +-- +2.13.5 + 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 1d852b3..94a22bb 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Do not enable I/O decoding and keep - enabling busmaster for the end. +Subject: [PATCH 051/261] * grub-core/disk/ahci.c: Do not enable I/O decoding + and keep enabling busmaster for the end. --- - grub-core/disk/ahci.c | 10 ++++++---- ChangeLog | 5 +++++ + grub-core/disk/ahci.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 9837c7f8d..51eba95f3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-29 Vladimir Serbinenko + ++ * grub-core/disk/ahci.c: Do not enable I/O decoding and keep ++ enabling busmaster for the end. ++ ++2014-01-29 Vladimir Serbinenko ++ + * util/grub-mkfont.c: Downgrade warnings about unhandled features + to debug. + diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index 0b13fb8ebed..18c13270c65 100644 +index 0b13fb8eb..18c13270c 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -194,10 +194,8 @@ grub_ahci_pciinit (grub_pci_device_t dev, @@ -37,16 +52,6 @@ index 0b13fb8ebed..18c13270c65 100644 for (i = 0; i < nports; i++) if (adevs[i]) { -diff --git a/ChangeLog b/ChangeLog -index 9837c7f8d38..51eba95f36f 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/disk/ahci.c: Do not enable I/O decoding and keep -+ enabling busmaster for the end. -+ - 2014-01-29 Vladimir Serbinenko - - * util/grub-mkfont.c: Downgrade warnings about unhandled features +-- +2.13.5 + 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 d1a4ef9..77bf6bb 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Allocate and clean space for all - possible 32 slots to avoid pointing to uninited area. +Subject: [PATCH 052/261] * grub-core/disk/ahci.c: Allocate and clean space for + all possible 32 slots to avoid pointing to uninited area. --- - grub-core/disk/ahci.c | 8 +++++++- ChangeLog | 5 +++++ + grub-core/disk/ahci.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 51eba95f3..9bb181777 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-29 Vladimir Serbinenko + ++ * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 ++ slots to avoid pointing to uninited area. ++ ++2014-01-29 Vladimir Serbinenko ++ + * grub-core/disk/ahci.c: Do not enable I/O decoding and keep + enabling busmaster for the end. + diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index 18c13270c65..d63fd09fdc6 100644 +index 18c13270c..d63fd09fd 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -358,7 +358,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, @@ -35,16 +50,6 @@ index 18c13270c65..d63fd09fdc6 100644 adevs[i]->command_list->command_table_base = grub_dma_get_phys (adevs[i]->command_table_chunk); -diff --git a/ChangeLog b/ChangeLog -index 51eba95f36f..9bb18177793 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 -+ slots to avoid pointing to uninited area. -+ - 2014-01-29 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Do not enable I/O decoding and keep +-- +2.13.5 + 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 7a1172a..0558f0e 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,15 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Add safety cleanups. +Subject: [PATCH 053/261] * grub-core/disk/ahci.c: Add safety cleanups. --- - grub-core/disk/ahci.c | 10 ++++++++++ ChangeLog | 4 ++++ + grub-core/disk/ahci.c | 10 ++++++++++ 2 files changed, 14 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 9bb181777..15300b020 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-01-29 Vladimir Serbinenko + ++ * grub-core/disk/ahci.c: Add safety cleanups. ++ ++2014-01-29 Vladimir Serbinenko ++ + * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 + slots to avoid pointing to uninited area. + diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index d63fd09fdc6..643e691ef80 100644 +index d63fd09fd..643e691ef 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -454,6 +454,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, @@ -43,15 +57,6 @@ index d63fd09fdc6..643e691ef80 100644 endtime = grub_get_time_ms () + 1000; while ((dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT_CMD_CR)) if (grub_get_time_ms () > endtime) -diff --git a/ChangeLog b/ChangeLog -index 9bb18177793..15300b020c6 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/disk/ahci.c: Add safety cleanups. -+ - 2014-01-29 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Allocate and clean space for all possible 32 +-- +2.13.5 + 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 11a7c59..5870f73 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Properly handle transactions with no - transferred data. +Subject: [PATCH 054/261] * grub-core/disk/ahci.c: Properly handle transactions + with no transferred data. --- - grub-core/disk/ahci.c | 7 +++++-- ChangeLog | 5 +++++ + grub-core/disk/ahci.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 15300b020..bc1ab231b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-29 Vladimir Serbinenko + ++ * grub-core/disk/ahci.c: Properly handle transactions with no ++ transferred data. ++ ++2014-01-29 Vladimir Serbinenko ++ + * grub-core/disk/ahci.c: Add safety cleanups. + + 2014-01-29 Vladimir Serbinenko diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index 643e691ef80..fdd40c64dd9 100644 +index 643e691ef..fdd40c64d 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -932,7 +932,10 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, @@ -34,16 +49,6 @@ index 643e691ef80..fdd40c64dd9 100644 | (parms->cmdsize ? GRUB_AHCI_CONFIG_ATAPI : 0) | (parms->write ? GRUB_AHCI_CONFIG_WRITE : GRUB_AHCI_CONFIG_READ) | (parms->taskfile.cmd == 8 ? (1 << 8) : 0); -diff --git a/ChangeLog b/ChangeLog -index 15300b020c6..bc1ab231b02 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/disk/ahci.c: Properly handle transactions with no -+ transferred data. -+ - 2014-01-29 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Add safety cleanups. +-- +2.13.5 + 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 3430836..caa300a 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up - to 7 seconds to recover if last poweroff was bad. +Subject: [PATCH 055/261] * grub-core/disk/ahci.c: Increase timeout. Some SSDs + take up to 7 seconds to recover if last poweroff was bad. --- - grub-core/disk/ahci.c | 2 +- ChangeLog | 5 +++++ + grub-core/disk/ahci.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index bc1ab231b..1a822f3d2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-01-29 Vladimir Serbinenko + ++ * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to ++ 7 seconds to recover if last poweroff was bad. ++ ++2014-01-29 Vladimir Serbinenko ++ + * grub-core/disk/ahci.c: Properly handle transactions with no + transferred data. + diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index fdd40c64dd9..5e4a6397a49 100644 +index fdd40c64d..5e4a6397a 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -1022,7 +1022,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, @@ -22,16 +37,6 @@ index fdd40c64dd9..5e4a6397a49 100644 while ((dev->hba->ports[dev->port].command_issue & 1)) if (grub_get_time_ms () > endtime) { -diff --git a/ChangeLog b/ChangeLog -index bc1ab231b02..1a822f3d2f2 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-01-29 Vladimir Serbinenko -+ -+ * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to -+ 7 seconds to recover if last poweroff was bad. -+ - 2014-01-29 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Properly handle transactions with no +-- +2.13.5 + 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 bfdec61..f851737 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-mkfont.c: Build fix for argp.h with older gcc. +Subject: [PATCH 056/261] * util/grub-mkfont.c: Build fix for argp.h with older + gcc. --- - util/grub-mkfont.c | 4 ++++ ChangeLog | 4 ++++ + util/grub-mkfont.c | 4 ++++ 2 files changed, 8 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 1a822f3d2..f2bba8402 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-02-03 Vladimir Serbinenko ++ ++ * util/grub-mkfont.c: Build fix for argp.h with older gcc. ++ + 2014-01-29 Vladimir Serbinenko + + * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c -index 3de07ee9c06..e6485b40f28 100644 +index 3de07ee9c..e6485b40f 100644 --- a/util/grub-mkfont.c +++ b/util/grub-mkfont.c @@ -33,7 +33,11 @@ @@ -24,15 +37,6 @@ index 3de07ee9c06..e6485b40f28 100644 #endif #include -diff --git a/ChangeLog b/ChangeLog -index 1a822f3d2f2..f2bba8402c5 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-02-03 Vladimir Serbinenko -+ -+ * util/grub-mkfont.c: Build fix for argp.h with older gcc. -+ - 2014-01-29 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Increase timeout. Some SSDs take up to +-- +2.13.5 + 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 441b0e4..bd154c8 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,15 +1,30 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-mkrescue.c: Build fix for argp.h with older gcc. +Subject: [PATCH 057/261] * util/grub-mkrescue.c: Build fix for argp.h with + older gcc. --- - util/grub-mkrescue.c | 4 ++++ ChangeLog | 4 ++++ + util/grub-mkrescue.c | 4 ++++ 2 files changed, 8 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index f2bba8402..f4a472144 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-02-03 Vladimir Serbinenko + ++ * util/grub-mkrescue.c: Build fix for argp.h with older gcc. ++ ++2014-02-03 Vladimir Serbinenko ++ + * util/grub-mkfont.c: Build fix for argp.h with older gcc. + + 2014-01-29 Vladimir Serbinenko diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c -index 34e0b7affb1..e719839820b 100644 +index 34e0b7aff..e71983982 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -25,7 +25,11 @@ @@ -24,15 +39,6 @@ index 34e0b7affb1..e719839820b 100644 #include #include -diff --git a/ChangeLog b/ChangeLog -index f2bba8402c5..f4a472144b1 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-02-03 Vladimir Serbinenko -+ -+ * util/grub-mkrescue.c: Build fix for argp.h with older gcc. -+ - 2014-02-03 Vladimir Serbinenko - - * util/grub-mkfont.c: Build fix for argp.h with older gcc. +-- +2.13.5 + 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 10e37d0..9c6875e 100644 --- a/SOURCES/0058-add-grub_env_set_net_property-function.patch +++ b/SOURCES/0058-add-grub_env_set_net_property-function.patch @@ -1,20 +1,36 @@ -From 0000000000000000000000000000000000000000 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] add grub_env_set_net_property function +Subject: [PATCH 058/261] 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. * include/grub/net.h: Likewise. --- + ChangeLog | 8 +++++++ grub-core/net/bootp.c | 63 +++++++++++++-------------------------------------- grub-core/net/net.c | 38 +++++++++++++++++++++++++++++++ include/grub/net.h | 4 ++++ - ChangeLog | 8 +++++++ 4 files changed, 66 insertions(+), 47 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index f4a472144..63f5aa322 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,11 @@ ++2014-02-04 Paulo Flabiano Smorigo ++ ++ 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. ++ * include/grub/net.h: Likewise. ++ + 2014-02-03 Vladimir Serbinenko + + * util/grub-mkrescue.c: Build fix for argp.h with older gcc. diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index c14e9de57a4..6310ed447e8 100644 +index c14e9de57..6310ed447 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -25,41 +25,6 @@ @@ -115,7 +131,7 @@ index c14e9de57a4..6310ed447e8 100644 { grub_net_default_server = grub_strdup (bp->server_name); diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 1521d8d2c87..f2e723bd409 100644 +index 1521d8d2c..f2e723bd4 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1480,6 +1480,44 @@ receive_packets (struct grub_net_card *card, int *stop_condition) @@ -164,7 +180,7 @@ index 1521d8d2c87..f2e723bd409 100644 grub_net_poll_cards (unsigned time, int *stop_condition) { diff --git a/include/grub/net.h b/include/grub/net.h -index 0e0a605c5a6..538baa33eca 100644 +index 0e0a605c5..538baa33e 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -480,6 +480,10 @@ grub_net_addr_to_str (const grub_net_network_level_address_t *target, @@ -178,19 +194,6 @@ index 0e0a605c5a6..538baa33eca 100644 void grub_net_poll_cards (unsigned time, int *stop_condition); -diff --git a/ChangeLog b/ChangeLog -index f4a472144b1..63f5aa322c3 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,11 @@ -+2014-02-04 Paulo Flabiano Smorigo -+ -+ 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. -+ * include/grub/net.h: Likewise. -+ - 2014-02-03 Vladimir Serbinenko - - * util/grub-mkrescue.c: Build fix for argp.h with older gcc. +-- +2.13.5 + diff --git a/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch b/SOURCES/0059-add-bootpath-parser-for-open-firmware.patch index 51e6cf7..6da1360 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 0000000000000000000000000000000000000000 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] add bootpath parser for open firmware +Subject: [PATCH 059/261] add bootpath parser for open firmware It enables net boot even when there is no bootp/dhcp server. @@ -10,14 +10,37 @@ call it at grub_ieee1275_net_config_real. * grub-core/kern/ieee1275/init.c: Add bootpath to grub_ieee1275_net_config. * include/grub/ieee1275/ieee1275.h: Likewise. --- + ChangeLog | 13 ++++ grub-core/kern/ieee1275/init.c | 7 +-- grub-core/net/drivers/ieee1275/ofnet.c | 107 ++++++++++++++++++++++++++++++++- include/grub/ieee1275/ieee1275.h | 5 +- - ChangeLog | 13 ++++ 4 files changed, 125 insertions(+), 7 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 63f5aa322..523763158 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,18 @@ + 2014-02-04 Paulo Flabiano Smorigo + ++ Add bootpath parser for open firmware. ++ ++ It enables net boot even when there is no bootp/dhcp server. ++ ++ * grub-core/net/drivers/ieee1275/ofnet.c: Add grub_ieee1275_parse_bootpath ++ and call it at grub_ieee1275_net_config_real. ++ * grub-core/kern/ieee1275/init.c: Add bootpath to ++ grub_ieee1275_net_config. ++ * include/grub/ieee1275/ieee1275.h: Likewise. ++ ++ ++2014-02-04 Paulo Flabiano Smorigo ++ + Add grub_env_set_net_property function. + + * grub-core/net/bootp.c: Remove set_env_limn_ro. diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 89b2822e14d..d5bd74d3552 100644 +index 89b2822e1..d5bd74d35 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -80,9 +80,8 @@ grub_translate_ieee1275_path (char *filepath) @@ -42,7 +65,7 @@ index 89b2822e14d..d5bd74d3552 100644 grub_free (canon); } diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index 4483c9122f7..eea8e71d300 100644 +index 4483c9122..eea8e71d3 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -127,8 +127,111 @@ bootp_response_properties[] = @@ -168,7 +191,7 @@ index 4483c9122f7..eea8e71d300 100644 if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, bootp_response_properties[i].name, diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index dc54beabb4b..8e425130327 100644 +index dc54beabb..8e4251303 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -70,8 +70,9 @@ struct grub_ieee1275_devalias @@ -183,24 +206,6 @@ index dc54beabb4b..8e425130327 100644 /* Maps a device alias to a pathname. */ extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen); -diff --git a/ChangeLog b/ChangeLog -index 63f5aa322c3..5237631583a 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,16 @@ -+2014-02-04 Paulo Flabiano Smorigo -+ -+ Add bootpath parser for open firmware. -+ -+ It enables net boot even when there is no bootp/dhcp server. -+ -+ * grub-core/net/drivers/ieee1275/ofnet.c: Add grub_ieee1275_parse_bootpath -+ and call it at grub_ieee1275_net_config_real. -+ * grub-core/kern/ieee1275/init.c: Add bootpath to -+ grub_ieee1275_net_config. -+ * include/grub/ieee1275/ieee1275.h: Likewise. -+ -+ - 2014-02-04 Paulo Flabiano Smorigo - - Add grub_env_set_net_property function. +-- +2.13.5 + 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 6875b14..bdf2273 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,29 +1,16 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/disk/ahci.c: Ignore NPORTS field and rely on PI - exclusively. +Subject: [PATCH 060/261] * grub-core/disk/ahci.c: Ignore NPORTS field and rely + on PI exclusively. --- - grub-core/disk/ahci.c | 2 +- ChangeLog | 5 +++++ + grub-core/disk/ahci.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c -index 5e4a6397a49..89365cd0925 100644 ---- a/grub-core/disk/ahci.c -+++ b/grub-core/disk/ahci.c -@@ -322,7 +322,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, - - grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); - -- nports = (hba->cap & GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1; -+ nports = (GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1; - - grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, - hba->ports_implemented); diff --git a/ChangeLog b/ChangeLog -index 5237631583a..be41aa51f65 100644 +index 523763158..be41aa51f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -35,3 +22,19 @@ index 5237631583a..be41aa51f65 100644 2014-02-04 Paulo Flabiano Smorigo Add bootpath parser for open firmware. +diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c +index 5e4a6397a..89365cd09 100644 +--- a/grub-core/disk/ahci.c ++++ b/grub-core/disk/ahci.c +@@ -322,7 +322,7 @@ grub_ahci_pciinit (grub_pci_device_t dev, + + grub_dprintf ("ahci", "GLC:%x\n", hba->global_control); + +- nports = (hba->cap & GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1; ++ nports = (GRUB_AHCI_HBA_CAP_NPORTS_MASK) + 1; + + grub_dprintf ("ahci", "%d AHCI ports, PI = 0x%x\n", nports, + hba->ports_implemented); +-- +2.13.5 + 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 e3839f4..acd081c 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,16 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/kern/i386/coreboot/mmap.c: Filter out +Subject: [PATCH 061/261] * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 region. --- - grub-core/kern/i386/coreboot/mmap.c | 38 +++++++++++++++++++++++++++++++------ ChangeLog | 5 +++++ + grub-core/kern/i386/coreboot/mmap.c | 38 +++++++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 6 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index be41aa51f..4f6f6d6d3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-02-28 Vladimir Serbinenko ++ ++ * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 ++ region. ++ + 2014-02-20 Vladimir Serbinenko + + * grub-core/disk/ahci.c: Ignore NPORTS field and rely on PI diff --git a/grub-core/kern/i386/coreboot/mmap.c b/grub-core/kern/i386/coreboot/mmap.c -index 11979755144..4d29f6b7d90 100644 +index 119797551..4d29f6b7d 100644 --- a/grub-core/kern/i386/coreboot/mmap.c +++ b/grub-core/kern/i386/coreboot/mmap.c @@ -44,18 +44,44 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) @@ -64,16 +77,6 @@ index 11979755144..4d29f6b7d90 100644 } return 0; -diff --git a/ChangeLog b/ChangeLog -index be41aa51f65..4f6f6d6d35a 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-02-28 Vladimir Serbinenko -+ -+ * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 -+ region. -+ - 2014-02-20 Vladimir Serbinenko - - * grub-core/disk/ahci.c: Ignore NPORTS field and rely on PI +-- +2.13.5 + 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 3319170..6fd0363 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/loader/i386/multiboot_mbi.c +Subject: [PATCH 062/261] * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit location to 640K. --- - grub-core/loader/i386/multiboot_mbi.c | 2 +- ChangeLog | 5 +++++ + grub-core/loader/i386/multiboot_mbi.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 4f6f6d6d3..bbaed2691 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-02-28 Vladimir Serbinenko + ++ * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit ++ location to 640K. ++ ++2014-02-28 Vladimir Serbinenko ++ + * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 + region. + diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c -index 7431aa49bbe..f10c087f724 100644 +index 7431aa49b..f10c087f7 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -446,7 +446,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target) @@ -22,16 +37,6 @@ index 7431aa49bbe..f10c087f724 100644 bufsize, 4, GRUB_RELOCATOR_PREFERENCE_NONE, 0); if (err) -diff --git a/ChangeLog b/ChangeLog -index 4f6f6d6d35a..bbaed2691c7 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-02-28 Vladimir Serbinenko -+ -+ * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit -+ location to 640K. -+ - 2014-02-28 Vladimir Serbinenko - - * grub-core/kern/i386/coreboot/mmap.c: Filter out 0xa0000-0x100000 +-- +2.13.5 + 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 78c780e..be1bdb1 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: - Ignore low tables for low memory calculations. +Subject: [PATCH 063/261] * grub-core/mmap/i386/uppermem.c (lower_hook) + [COREBOOT]: Ignore low tables for low memory calculations. --- - grub-core/mmap/i386/uppermem.c | 6 +++++- ChangeLog | 5 +++++ + grub-core/mmap/i386/uppermem.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index bbaed2691..6ed6cf4ec 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-02-28 Vladimir Serbinenko + ++ * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low ++ tables for low memory calculations. ++ ++2014-02-28 Vladimir Serbinenko ++ + * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit + location to 640K. + diff --git a/grub-core/mmap/i386/uppermem.c b/grub-core/mmap/i386/uppermem.c -index bd8b429c4be..a6be9896d82 100644 +index bd8b429c4..a6be9896d 100644 --- a/grub-core/mmap/i386/uppermem.c +++ b/grub-core/mmap/i386/uppermem.c @@ -31,8 +31,12 @@ lower_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, @@ -27,16 +42,6 @@ index bd8b429c4be..a6be9896d82 100644 return 0; } -diff --git a/ChangeLog b/ChangeLog -index bbaed2691c7..6ed6cf4ec2b 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-02-28 Vladimir Serbinenko -+ -+ * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low -+ tables for low memory calculations. -+ - 2014-02-28 Vladimir Serbinenko - - * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi): Limit +-- +2.13.5 + 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 933e08c..478d244 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map - if E820 failed to return any regions. +Subject: [PATCH 064/261] * grub-core/kern/i386/pc/mmap.c: Fallback to EISA + memory map if E820 failed to return any regions. --- - grub-core/kern/i386/pc/mmap.c | 40 +++++++++++++++++++++------------------- ChangeLog | 5 +++++ + grub-core/kern/i386/pc/mmap.c | 40 +++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 19 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 6ed6cf4ec..97cf57e25 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-02-28 Vladimir Serbinenko + ++ * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map ++ if E820 failed to return any regions. ++ ++2014-02-28 Vladimir Serbinenko ++ + * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low + tables for low memory calculations. + diff --git a/grub-core/kern/i386/pc/mmap.c b/grub-core/kern/i386/pc/mmap.c -index 8009e833c1a..f1375f3e12d 100644 +index 8009e833c..f1375f3e1 100644 --- a/grub-core/kern/i386/pc/mmap.c +++ b/grub-core/kern/i386/pc/mmap.c @@ -141,33 +141,35 @@ grub_get_mmap_entry (struct grub_machine_mmap_entry *entry, @@ -68,16 +83,6 @@ index 8009e833c1a..f1375f3e12d 100644 { grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); -diff --git a/ChangeLog b/ChangeLog -index 6ed6cf4ec2b..97cf57e253d 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-02-28 Vladimir Serbinenko -+ -+ * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map -+ if E820 failed to return any regions. -+ - 2014-02-28 Vladimir Serbinenko - - * grub-core/mmap/i386/uppermem.c (lower_hook) [COREBOOT]: Ignore low +-- +2.13.5 + 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 f6b2546..db2f237 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,21 +1,39 @@ -From 0000000000000000000000000000000000000000 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] * 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/261] * 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 Suggested by: Markus Müller. --- + ChangeLog | 7 +++++++ grub-core/loader/i386/bsd.c | 2 ++ include/grub/i386/openbsd_bootarg.h | 2 ++ - ChangeLog | 7 +++++++ 3 files changed, 11 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 97cf57e25..f571f6653 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,12 @@ + 2014-02-28 Vladimir Serbinenko + ++ * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. ++ * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr field. ++ ++ Suggested by: Markus Müller. ++ ++2014-02-28 Vladimir Serbinenko ++ + * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map + if E820 failed to return any regions. + diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c -index ea0edfafe57..19985f03e65 100644 +index ea0edfafe..19985f03e 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -1646,6 +1646,7 @@ grub_cmd_openbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) @@ -35,7 +53,7 @@ index ea0edfafe57..19985f03e65 100644 bootflags &= ~OPENBSD_RB_SERCONS; } diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h -index 01ca4868b25..9ebe6b4e4b1 100644 +index 01ca4868b..9ebe6b4e4 100644 --- a/include/grub/i386/openbsd_bootarg.h +++ b/include/grub/i386/openbsd_bootarg.h @@ -75,6 +75,8 @@ struct grub_openbsd_bootarg_console @@ -47,18 +65,6 @@ index 01ca4868b25..9ebe6b4e4b1 100644 }; struct grub_openbsd_bootarg_pcibios -diff --git a/ChangeLog b/ChangeLog -index 97cf57e253d..f571f66533b 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,10 @@ -+2014-02-28 Vladimir Serbinenko -+ -+ * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. -+ * grub-core/loader/i386/bsd.c (grub_cmd_openbsd): Fill addr field. -+ -+ Suggested by: Markus Müller. -+ - 2014-02-28 Vladimir Serbinenko - - * grub-core/kern/i386/pc/mmap.c: Fallback to EISA memory map +-- +2.13.5 + 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 2952449..d7e7050 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 0000000000000000000000000000000000000000 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] ieee1275: check for IBM pseries emulated machine +Subject: [PATCH 066/261] 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 @@ -13,7 +13,7 @@ Signed-off-by: Nikunj A Dadhania 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index d92ae14f53e..3e12e6b24e1 100644 +index d92ae14f5..3e12e6b24 100644 --- a/grub-core/kern/ieee1275/cmain.c +++ b/grub-core/kern/ieee1275/cmain.c @@ -84,8 +84,10 @@ grub_ieee1275_find_options (void) @@ -28,3 +28,6 @@ index d92ae14f53e..3e12e6b24e1 100644 if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0) grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS); +-- +2.13.5 + 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 1188a42..cd4e0c2 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/loader/arm64/linux.c: Remove redundant "0x". +Subject: [PATCH 067/261] * grub-core/loader/arm64/linux.c: Remove redundant + "0x". --- - grub-core/loader/arm64/linux.c | 2 +- ChangeLog | 4 ++++ + grub-core/loader/arm64/linux.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index f571f6653..091535beb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-03-26 Fu Wei ++ ++ * grub-core/loader/arm64/linux.c: Remove redundant "0x". ++ + 2014-02-28 Vladimir Serbinenko + + * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 65129c21a8d..f1d10a16492 100644 +index 65129c21a..f1d10a164 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -68,7 +68,7 @@ get_firmware_fdt (void) @@ -21,15 +34,6 @@ index 65129c21a8d..f1d10a16492 100644 break; } -diff --git a/ChangeLog b/ChangeLog -index f571f66533b..091535beb5c 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-03-26 Fu Wei -+ -+ * grub-core/loader/arm64/linux.c: Remove redundant "0x". -+ - 2014-02-28 Vladimir Serbinenko - - * include/grub/i386/openbsd_bootarg.h: Add addr and frequency fields. +-- +2.13.5 + 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 9f0d9c3..b3ddd64 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,16 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/lib/relocator.c: Fix the case when end of +Subject: [PATCH 068/261] * grub-core/lib/relocator.c: Fix the case when end of leftover is used. --- - grub-core/lib/relocator.c | 2 ++ ChangeLog | 4 ++++ + grub-core/lib/relocator.c | 2 ++ 2 files changed, 6 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index 091535beb..9404edab8 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-03-26 Vladimir Serbinenko ++ ++ * grub-core/lib/relocator.c: Fix the case when end of leftover is used. ++ + 2014-03-26 Fu Wei + + * grub-core/loader/arm64/linux.c: Remove redundant "0x". diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c -index 9f9770bc48d..cb11ea5fa27 100644 +index 9f9770bc4..cb11ea5fa 100644 --- a/grub-core/lib/relocator.c +++ b/grub-core/lib/relocator.c @@ -865,6 +865,8 @@ malloc_in_range (struct grub_relocator *rel, @@ -22,15 +34,6 @@ index 9f9770bc48d..cb11ea5fa27 100644 lo->freebytes[offstart / 8] &= ((1 << (8 - (start % 8))) - 1); grub_memset (lo->freebytes + (offstart + 7) / 8, 0, -diff --git a/ChangeLog b/ChangeLog -index 091535beb5c..9404edab8e1 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-03-26 Vladimir Serbinenko -+ -+ * grub-core/lib/relocator.c: Fix the case when end of leftover is used. -+ - 2014-03-26 Fu Wei - - * grub-core/loader/arm64/linux.c: Remove redundant "0x". +-- +2.13.5 + diff --git a/SOURCES/0069-Fix-grub-probe-0-option.patch b/SOURCES/0069-Fix-grub-probe-0-option.patch index 6727c9d..7a031ac 100644 --- a/SOURCES/0069-Fix-grub-probe-0-option.patch +++ b/SOURCES/0069-Fix-grub-probe-0-option.patch @@ -1,18 +1,32 @@ -From 0000000000000000000000000000000000000000 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] Fix grub-probe -0 option +Subject: [PATCH 069/261] Fix grub-probe -0 option * util/grub-probe,c (options): Make -0 work again (broken by conversion to argp). (main): Simplify logic. --- - util/grub-probe.c | 7 ++----- ChangeLog | 6 ++++++ + util/grub-probe.c | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 9404edab8..efbed8ccb 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++2014-03-31 Colin Watson ++ ++ * util/grub-probe,c (options): Make -0 work again (broken by ++ conversion to argp). ++ (main): Simplify logic. ++ + 2014-03-26 Vladimir Serbinenko + + * grub-core/lib/relocator.c: Fix the case when end of leftover is used. diff --git a/util/grub-probe.c b/util/grub-probe.c -index 1f3b59f05b9..80509be8aa7 100644 +index 1f3b59f05..80509be8a 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -711,6 +711,7 @@ static struct argp_option options[] = { @@ -36,17 +50,6 @@ index 1f3b59f05b9..80509be8aa7 100644 putchar ('\n'); /* Free resources. */ -diff --git a/ChangeLog b/ChangeLog -index 9404edab8e1..efbed8ccbf6 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,9 @@ -+2014-03-31 Colin Watson -+ -+ * util/grub-probe,c (options): Make -0 work again (broken by -+ conversion to argp). -+ (main): Simplify logic. -+ - 2014-03-26 Vladimir Serbinenko - - * grub-core/lib/relocator.c: Fix the case when end of leftover is used. +-- +2.13.5 + 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 55939c1..f861d1b 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 0000000000000000000000000000000000000000 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] Fix partmap, cryptodisk, and abstraction handling in +Subject: [PATCH 070/261] Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig @@ -25,17 +25,52 @@ probe_mods): Adjust for extra user-data arguments. * util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid, probe_abstraction): Use configured delimiter. Update callers. --- + ChangeLog | 25 ++++++++++++++++++++++++ grub-core/disk/cryptodisk.c | 19 ++++++++++--------- grub-core/disk/diskfilter.c | 5 +++-- - util/grub-install.c | 14 ++++++++++---- - util/grub-probe.c | 46 ++++++++++++++++++++++----------------------- include/grub/cryptodisk.h | 3 ++- include/grub/diskfilter.h | 3 ++- - ChangeLog | 25 ++++++++++++++++++++++++ + util/grub-install.c | 14 ++++++++++---- + util/grub-probe.c | 46 ++++++++++++++++++++++----------------------- 7 files changed, 74 insertions(+), 41 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index efbed8ccb..1cb3b683f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,30 @@ + 2014-03-31 Colin Watson + ++ Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. ++ ++ Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig ++ no longer to be forgiving of trailing spaces on grub-probe output ++ lines, which among other things means that util/grub.d/10_linux.in ++ no longer detects LVM. To fix this, make grub-probe's output ++ delimiting more consistent. As a bonus, this improves the coverage ++ of the -0 option. ++ ++ Fixes Debian bug #735935. ++ ++ * grub-core/disk/cryptodisk.c ++ (grub_util_cryptodisk_get_abstraction): Add a user-data argument. ++ * grub-core/disk/diskfilter.c (grub_diskfilter_get_partmap): ++ Likewise. ++ * include/grub/cryptodisk.h (grub_util_cryptodisk_get_abstraction): ++ Update prototype. ++ * include/grub/diskfilter.h (grub_diskfilter_get_partmap): Likewise. ++ * util/grub-install.c (push_partmap_module, push_cryptodisk_module, ++ probe_mods): Adjust for extra user-data arguments. ++ * util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid, ++ probe_abstraction): Use configured delimiter. Update callers. ++ ++2014-03-31 Colin Watson ++ + * util/grub-probe,c (options): Make -0 work again (broken by + conversion to argp). + (main): Simplify logic. diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c -index 75c6e1f91ac..f0e3a900ae3 100644 +index 75c6e1f91..f0e3a900a 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -762,25 +762,26 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, @@ -75,7 +110,7 @@ index 75c6e1f91ac..f0e3a900ae3 100644 const char * diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c -index 28b70c666d4..e8a3bcbd138 100644 +index 28b70c666..e8a3bcbd1 100644 --- a/grub-core/disk/diskfilter.c +++ b/grub-core/disk/diskfilter.c @@ -354,7 +354,8 @@ grub_diskfilter_memberlist (grub_disk_t disk) @@ -97,8 +132,36 @@ index 28b70c666d4..e8a3bcbd138 100644 } } +diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h +index 66f3e1e22..f2ad2a79a 100644 +--- a/include/grub/cryptodisk.h ++++ b/include/grub/cryptodisk.h +@@ -145,7 +145,8 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, + grub_disk_t source, const char *cheat); + void + grub_util_cryptodisk_get_abstraction (grub_disk_t disk, +- void (*cb) (const char *val)); ++ void (*cb) (const char *val, void *data), ++ void *data); + + char * + grub_util_get_geli_uuid (const char *dev); +diff --git a/include/grub/diskfilter.h b/include/grub/diskfilter.h +index 042fe04a5..1aedcd3df 100644 +--- a/include/grub/diskfilter.h ++++ b/include/grub/diskfilter.h +@@ -202,7 +202,8 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk, + struct grub_diskfilter_vg **vg); + void + grub_diskfilter_get_partmap (grub_disk_t disk, +- void (*cb) (const char *val)); ++ void (*cb) (const char *val, void *data), ++ void *data); + #endif + + #endif /* ! GRUB_RAID_H */ diff --git a/util/grub-install.c b/util/grub-install.c -index 2e6226a3716..e9c6a4656ef 100644 +index 2e6226a37..e9c6a4656 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -387,7 +387,7 @@ probe_raid_level (grub_disk_t disk) @@ -110,19 +173,19 @@ index 2e6226a3716..e9c6a4656ef 100644 { char buf[50]; -@@ -401,6 +401,12 @@ push_partmap_module (const char *map) - grub_install_push_module (buf); +@@ -402,6 +402,12 @@ push_partmap_module (const char *map) } -+static void + static void +push_cryptodisk_module (const char *mod, void *data __attribute__ ((unused))) +{ + grub_install_push_module (mod); +} + - static void ++static void probe_mods (grub_disk_t disk) { + grub_partition_t part; @@ -412,11 +418,11 @@ probe_mods (grub_disk_t disk) grub_util_info ("no partition map found for %s", disk->name); @@ -147,7 +210,7 @@ index 2e6226a3716..e9c6a4656ef 100644 have_cryptodisk = 1; } diff --git a/util/grub-probe.c b/util/grub-probe.c -index 80509be8aa7..ecb7b6bbdf2 100644 +index 80509be8a..ecb7b6bbd 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -130,13 +130,14 @@ get_targets_string (void) @@ -298,64 +361,6 @@ index 80509be8aa7..ecb7b6bbdf2 100644 grub_device_close (dev); continue; } -diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h -index 66f3e1e221b..f2ad2a79ab2 100644 ---- a/include/grub/cryptodisk.h -+++ b/include/grub/cryptodisk.h -@@ -145,7 +145,8 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, - grub_disk_t source, const char *cheat); - void - grub_util_cryptodisk_get_abstraction (grub_disk_t disk, -- void (*cb) (const char *val)); -+ void (*cb) (const char *val, void *data), -+ void *data); - - char * - grub_util_get_geli_uuid (const char *dev); -diff --git a/include/grub/diskfilter.h b/include/grub/diskfilter.h -index 042fe04a5a4..1aedcd3dffb 100644 ---- a/include/grub/diskfilter.h -+++ b/include/grub/diskfilter.h -@@ -202,7 +202,8 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk, - struct grub_diskfilter_vg **vg); - void - grub_diskfilter_get_partmap (grub_disk_t disk, -- void (*cb) (const char *val)); -+ void (*cb) (const char *val, void *data), -+ void *data); - #endif - - #endif /* ! GRUB_RAID_H */ -diff --git a/ChangeLog b/ChangeLog -index efbed8ccbf6..1cb3b683fcf 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,28 @@ -+2014-03-31 Colin Watson -+ -+ Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. -+ -+ Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig -+ no longer to be forgiving of trailing spaces on grub-probe output -+ lines, which among other things means that util/grub.d/10_linux.in -+ no longer detects LVM. To fix this, make grub-probe's output -+ delimiting more consistent. As a bonus, this improves the coverage -+ of the -0 option. -+ -+ Fixes Debian bug #735935. -+ -+ * grub-core/disk/cryptodisk.c -+ (grub_util_cryptodisk_get_abstraction): Add a user-data argument. -+ * grub-core/disk/diskfilter.c (grub_diskfilter_get_partmap): -+ Likewise. -+ * include/grub/cryptodisk.h (grub_util_cryptodisk_get_abstraction): -+ Update prototype. -+ * include/grub/diskfilter.h (grub_diskfilter_get_partmap): Likewise. -+ * util/grub-install.c (push_partmap_module, push_cryptodisk_module, -+ probe_mods): Adjust for extra user-data arguments. -+ * util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid, -+ probe_abstraction): Use configured delimiter. Update callers. -+ - 2014-03-31 Colin Watson - - * util/grub-probe,c (options): Make -0 work again (broken by +-- +2.13.5 + 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 9d091a0..e98538d 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,30 +1,18 @@ -From 0000000000000000000000000000000000000000 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] btrfs: fix get_root key comparison failures due to endianness +Subject: [PATCH 071/261] btrfs: fix get_root key comparison failures due to + endianness * grub-core/fs/btrfs.c (get_root): Convert GRUB_BTRFS_ROOT_VOL_OBJECTID to little-endian. --- - grub-core/fs/btrfs.c | 2 +- ChangeLog | 7 +++++++ + grub-core/fs/btrfs.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 89666b6fd59..f7b6c152037 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -1201,7 +1201,7 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key, - struct grub_btrfs_key key_out, key_in; - struct grub_btrfs_root_item ri; - -- key_in.object_id = GRUB_BTRFS_ROOT_VOL_OBJECTID; -+ key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID); - key_in.offset = 0; - key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM; - err = lower_bound (data, &key_in, &key_out, diff --git a/ChangeLog b/ChangeLog -index 1cb3b683fcf..accffade86b 100644 +index 1cb3b683f..accffade8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ @@ -38,3 +26,19 @@ index 1cb3b683fcf..accffade86b 100644 2014-03-31 Colin Watson Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig. +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 89666b6fd..f7b6c1520 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -1201,7 +1201,7 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key, + struct grub_btrfs_key key_out, key_in; + struct grub_btrfs_root_item ri; + +- key_in.object_id = GRUB_BTRFS_ROOT_VOL_OBJECTID; ++ key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_ROOT_VOL_OBJECTID); + key_in.offset = 0; + key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM; + err = lower_bound (data, &key_in, &key_out, +-- +2.13.5 + 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 c98e586..6dda4de 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,16 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): - Support NVMe device names. +Subject: [PATCH 072/261] * grub-core/osdep/linux/getroot.c + (grub_util_part_to_disk): Support NVMe device names. --- - grub-core/osdep/linux/getroot.c | 17 +++++++++++++++++ ChangeLog | 5 +++++ + grub-core/osdep/linux/getroot.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index accffade8..4a484092a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-04-03 Vladimir Serbinenko ++ ++ * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe ++ device names. ++ + 2014-03-31 Thomas Falcon + + btrfs: fix get_root key comparison failures due to endianness diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 19581d32997..7007193d9c7 100644 +index 19581d329..7007193d9 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -896,6 +896,23 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, @@ -37,16 +50,6 @@ index 19581d32997..7007193d9c7 100644 } return path; -diff --git a/ChangeLog b/ChangeLog -index accffade86b..4a484092a6f 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-04-03 Vladimir Serbinenko -+ -+ * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe -+ device names. -+ - 2014-03-31 Thomas Falcon - - btrfs: fix get_root key comparison failures due to endianness +-- +2.13.5 + 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 3627cff..8f8ebea 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,19 +1,32 @@ -From 0000000000000000000000000000000000000000 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] Replace few instances of memcmp/memcpy in the code that - should be grub_memcmp/grub_memcpy. +Subject: [PATCH 073/261] Replace few instances of memcmp/memcpy in the code + that should be grub_memcmp/grub_memcpy. --- + ChangeLog | 5 +++++ grub-core/commands/acpihalt.c | 4 ++-- grub-core/commands/legacycfg.c | 4 ++-- grub-core/lib/relocator.c | 2 +- grub-core/loader/i386/bsd.c | 4 ++-- - ChangeLog | 5 +++++ 5 files changed, 12 insertions(+), 7 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 4a484092a..f18cdba90 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-04-04 Vladimir Serbinenko ++ ++ Replace few instances of memcmp/memcpy in the code that should be ++ grub_memcmp/grub_memcpy. ++ + 2014-04-03 Vladimir Serbinenko + + * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe diff --git a/grub-core/commands/acpihalt.c b/grub-core/commands/acpihalt.c -index 09421a6c69d..83bdfe1f23c 100644 +index 09421a6c6..83bdfe1f2 100644 --- a/grub-core/commands/acpihalt.c +++ b/grub-core/commands/acpihalt.c @@ -214,8 +214,8 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, @@ -28,7 +41,7 @@ index 09421a6c69d..83bdfe1f23c 100644 int ll; grub_uint8_t *ptr2 = ptr; diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c -index e42a9d83ebb..2c09fb7dd78 100644 +index e42a9d83e..2c09fb7dd 100644 --- a/grub-core/commands/legacycfg.c +++ b/grub-core/commands/legacycfg.c @@ -580,7 +580,7 @@ check_password_md5_real (const char *entered, @@ -50,7 +63,7 @@ index e42a9d83ebb..2c09fb7dd78 100644 GRUB_MD_MD5->init (ctx); if ((i & 1) != 0) diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c -index cb11ea5fa27..f759c7f41f4 100644 +index cb11ea5fa..f759c7f41 100644 --- a/grub-core/lib/relocator.c +++ b/grub-core/lib/relocator.c @@ -652,7 +652,7 @@ malloc_in_range (struct grub_relocator *rel, @@ -63,7 +76,7 @@ index cb11ea5fa27..f759c7f41f4 100644 counter[((events[j].pos >> (DIGITSORT_BITS * i)) & DIGITSORT_MASK) + 1]++; diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c -index 19985f03e65..41ef9109ee1 100644 +index 19985f03e..41ef9109e 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -1082,7 +1082,7 @@ grub_netbsd_add_boot_disk_and_wedge (void) @@ -84,16 +97,6 @@ index 19985f03e65..41ef9109ee1 100644 } else { -diff --git a/ChangeLog b/ChangeLog -index 4a484092a6f..f18cdba90ce 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-04-04 Vladimir Serbinenko -+ -+ Replace few instances of memcmp/memcpy in the code that should be -+ grub_memcmp/grub_memcpy. -+ - 2014-04-03 Vladimir Serbinenko - - * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe +-- +2.13.5 + 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 fce04da..45ad2a6 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,16 +1,31 @@ -From 0000000000000000000000000000000000000000 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] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no - longer pulled from libgcc. +Subject: [PATCH 074/261] * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. + They're no longer pulled from libgcc. --- - include/grub/libgcc.h | 7 ------- ChangeLog | 5 +++++ + include/grub/libgcc.h | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index f18cdba90..90e41bdad 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-04-04 Vladimir Serbinenko + ++ * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer ++ pulled from libgcc. ++ ++2014-04-04 Vladimir Serbinenko ++ + Replace few instances of memcmp/memcpy in the code that should be + grub_memcmp/grub_memcpy. + diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h -index fdc6611a04c..97233d79e4c 100644 +index fdc6611a0..97233d79e 100644 --- a/include/grub/libgcc.h +++ b/include/grub/libgcc.h @@ -42,13 +42,6 @@ void EXPORT_FUNC (__bswapsi2) (void); @@ -27,16 +42,6 @@ index fdc6611a04c..97233d79e4c 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); -diff --git a/ChangeLog b/ChangeLog -index f18cdba90ce..90e41bdadb3 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-04-04 Vladimir Serbinenko -+ -+ * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer -+ pulled from libgcc. -+ - 2014-04-04 Vladimir Serbinenko - - Replace few instances of memcmp/memcpy in the code that should be +-- +2.13.5 + diff --git a/SOURCES/0075-Add-missing-endif.patch b/SOURCES/0075-Add-missing-endif.patch index f2a1037..fb7f3ec 100644 --- a/SOURCES/0075-Add-missing-endif.patch +++ b/SOURCES/0075-Add-missing-endif.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Add missing #endif +Subject: [PATCH 075/261] Add missing #endif --- include/grub/libgcc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h -index 97233d79e4c..8e93b6792d9 100644 +index 97233d79e..8e93b6792 100644 --- a/include/grub/libgcc.h +++ b/include/grub/libgcc.h @@ -42,6 +42,7 @@ void EXPORT_FUNC (__bswapsi2) (void); @@ -19,3 +19,6 @@ index 97233d79e4c..8e93b6792d9 100644 #ifdef HAVE__RESTGPR_14_X void EXPORT_FUNC (_restgpr_14_x) (void); +-- +2.13.5 + 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 b738f38..e28ae74 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,15 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/lib/syslinux_parse.c: Fix timeout quoting. +Subject: [PATCH 076/261] * grub-core/lib/syslinux_parse.c: Fix timeout + quoting. --- - grub-core/lib/syslinux_parse.c | 2 +- ChangeLog | 4 ++++ + grub-core/lib/syslinux_parse.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index 90e41bdad..50d929162 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-04-06 Vladimir Serbinenko ++ ++ * grub-core/lib/syslinux_parse.c: Fix timeout quoting. ++ + 2014-04-04 Vladimir Serbinenko + + * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c -index 21fa17504aa..6bc504b7c58 100644 +index 21fa17504..6bc504b7c 100644 --- a/grub-core/lib/syslinux_parse.c +++ b/grub-core/lib/syslinux_parse.c @@ -1432,7 +1432,7 @@ config_file (struct output_buffer *outbuf, @@ -21,15 +34,6 @@ index 21fa17504aa..6bc504b7c58 100644 err = print_num (outbuf, (menu.timeout + 9) / 10); if (err) return err; -diff --git a/ChangeLog b/ChangeLog -index 90e41bdadb3..50d9291624a 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-04-06 Vladimir Serbinenko -+ -+ * grub-core/lib/syslinux_parse.c: Fix timeout quoting. -+ - 2014-04-04 Vladimir Serbinenko - - * include/grub/libgcc.h: Remove ctzsi2 and ctzdi2. They're no longer +-- +2.13.5 + diff --git a/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch b/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch index c5c603d..34f5794 100644 --- a/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch +++ b/SOURCES/0077-Improve-LVM-logical_volumes-string-matching.patch @@ -1,17 +1,30 @@ -From 0000000000000000000000000000000000000000 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] Improve LVM "logical_volumes" string matching +Subject: [PATCH 077/261] Improve LVM "logical_volumes" string matching * grub-core/disk/lvm.c (grub_lvm_detect): Search for "logical_volumes" block a little more accurately. --- - grub-core/disk/lvm.c | 4 ++-- ChangeLog | 5 +++++ + grub-core/disk/lvm.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 50d929162..7f0c57dc0 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-04-10 Colin Watson ++ ++ * grub-core/disk/lvm.c (grub_lvm_detect): Search for ++ "logical_volumes" block a little more accurately. ++ + 2014-04-06 Vladimir Serbinenko + + * grub-core/lib/syslinux_parse.c: Fix timeout quoting. diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c -index 483c17eb5f6..862a9664f2c 100644 +index 483c17eb5..862a9664f 100644 --- a/grub-core/disk/lvm.c +++ b/grub-core/disk/lvm.c @@ -333,10 +333,10 @@ grub_lvm_detect (grub_disk_t disk, @@ -27,16 +40,6 @@ index 483c17eb5f6..862a9664f2c 100644 /* And add all the lvs to the volume group. */ while (1) -diff --git a/ChangeLog b/ChangeLog -index 50d9291624a..7f0c57dc0ae 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-04-10 Colin Watson -+ -+ * grub-core/disk/lvm.c (grub_lvm_detect): Search for -+ "logical_volumes" block a little more accurately. -+ - 2014-04-06 Vladimir Serbinenko - - * grub-core/lib/syslinux_parse.c: Fix timeout quoting. +-- +2.13.5 + 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 1633534..45e48d0 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 0000000000000000000000000000000000000000 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] Tolerate devices with no filesystem UUID returned by +Subject: [PATCH 078/261] Tolerate devices with no filesystem UUID returned by os-prober * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem @@ -16,12 +16,12 @@ Fixes Ubuntu bug #1287436. 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog -index 7f0c57dc0ae..35564681a4d 100644 +index 7f0c57dc0..35564681a 100644 --- a/ChangeLog +++ b/ChangeLog -@@ -1,3 +1,12 @@ -+2014-04-10 Colin Watson -+ +@@ -1,5 +1,14 @@ + 2014-04-10 Colin Watson + + * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem + UUID. Other parts of grub-mkconfig tolerate these, they were + previously allowed here up to commit @@ -29,11 +29,13 @@ index 7f0c57dc0ae..35564681a4d 100644 + practice when the system has active LVM snapshots. + Fixes Ubuntu bug #1287436. + - 2014-04-10 Colin Watson - ++2014-04-10 Colin Watson ++ * grub-core/disk/lvm.c (grub_lvm_detect): Search for + "logical_volumes" block a little more accurately. + diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 7cf8487d63a..6f38c82a554 100644 +index 7cf8487d6..6f38c82a5 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -112,16 +112,17 @@ for OS in ${OSPROBED} ; do @@ -76,3 +78,6 @@ index 7cf8487d63a..6f38c82a554 100644 ;; hurd) onstr="$(gettext_printf "(on %s)" "${DEVICE}")" +-- +2.13.5 + 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 bb34f1c..c2e5844 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,16 +1,29 @@ -From 0000000000000000000000000000000000000000 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] Allow loading old kernels by placing GDT in conventional - memory. +Subject: [PATCH 079/261] Allow loading old kernels by placing GDT in + conventional memory. --- - grub-core/lib/i386/relocator.c | 11 +++++++---- ChangeLog | 5 +++++ + grub-core/lib/i386/relocator.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 35564681a..73a892899 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2014-04-20 Piotr Krysiuk ++ ++ * grub-core/lib/i386/relocator.c: Allow loading old kernels by placing ++ GDT in conventional memory. ++ + 2014-04-10 Colin Watson + + * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i386/relocator.c -index d2a1b27ae0e..ffaf25f088d 100644 +index d2a1b27ae..ffaf25f08 100644 --- a/grub-core/lib/i386/relocator.c +++ b/grub-core/lib/i386/relocator.c @@ -81,10 +81,13 @@ grub_relocator32_boot (struct grub_relocator *rel, @@ -31,16 +44,6 @@ index d2a1b27ae0e..ffaf25f088d 100644 avoid_efi_bootservices); if (err) return err; -diff --git a/ChangeLog b/ChangeLog -index 35564681a4d..73a89289945 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-04-20 Piotr Krysiuk -+ -+ * grub-core/lib/i386/relocator.c: Allow loading old kernels by placing -+ GDT in conventional memory. -+ - 2014-04-10 Colin Watson - - * util/grub.d/30_os-prober.in: Tolerate devices with no filesystem +-- +2.13.5 + 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 3aeb75c..c8b3ef1 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,31 +1,17 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/kern/misc.c (__bzero): Don't compile in +Subject: [PATCH 080/261] * grub-core/kern/misc.c (__bzero): Don't compile in GRUB_UTIL. Reported by: Yves Blusseau . --- - grub-core/kern/misc.c | 3 +++ ChangeLog | 6 ++++++ + grub-core/kern/misc.c | 3 +++ 2 files changed, 9 insertions(+) -diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 54db2e1254e..c5c815d8d13 100644 ---- a/grub-core/kern/misc.c -+++ b/grub-core/kern/misc.c -@@ -542,6 +542,9 @@ memset (void *s, int c, grub_size_t n) - return grub_memset (s, c, n); - } - -+#endif -+ -+#if !defined(GRUB_UTIL) && defined(__APPLE__) - void GRUB_BUILTIN_ATTR - __bzero (void *s, grub_size_t n) - { diff --git a/ChangeLog b/ChangeLog -index 73a89289945..3b61c0a996d 100644 +index 73a892899..3b61c0a99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ @@ -38,3 +24,20 @@ index 73a89289945..3b61c0a996d 100644 2014-04-20 Piotr Krysiuk * grub-core/lib/i386/relocator.c: Allow loading old kernels by placing +diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c +index 54db2e125..c5c815d8d 100644 +--- a/grub-core/kern/misc.c ++++ b/grub-core/kern/misc.c +@@ -542,6 +542,9 @@ memset (void *s, int c, grub_size_t n) + return grub_memset (s, c, n); + } + ++#endif ++ ++#if !defined(GRUB_UTIL) && defined(__APPLE__) + void GRUB_BUILTIN_ATTR + __bzero (void *s, grub_size_t n) + { +-- +2.13.5 + 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 f941491..a61668c 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,29 +1,16 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/commands/verify.c (grub_pubkey_open): Fix memdisk - check. +Subject: [PATCH 081/261] * grub-core/commands/verify.c (grub_pubkey_open): Fix + memdisk check. --- - grub-core/commands/verify.c | 2 +- ChangeLog | 5 +++++ + grub-core/commands/verify.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c -index a9dfd885247..6349ccfbaea 100644 ---- a/grub-core/commands/verify.c -+++ b/grub-core/commands/verify.c -@@ -835,7 +835,7 @@ grub_pubkey_open (grub_file_t io, const char *filename) - - if (!sec) - return io; -- if (io->device->disk && io->device->disk->id == GRUB_DISK_DEVICE_MEMDISK_ID) -+ if (io->device->disk && io->device->disk->dev->id == GRUB_DISK_DEVICE_MEMDISK_ID) - return io; - fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); - if (!fsuf) diff --git a/ChangeLog b/ChangeLog -index 3b61c0a996d..d0896d89e53 100644 +index 3b61c0a99..d0896d89e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -35,3 +22,19 @@ index 3b61c0a996d..d0896d89e53 100644 2014-04-20 Vladimir Serbinenko * grub-core/kern/misc.c (__bzero): Don't compile in GRUB_UTIL. +diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c +index a9dfd8852..6349ccfba 100644 +--- a/grub-core/commands/verify.c ++++ b/grub-core/commands/verify.c +@@ -835,7 +835,7 @@ grub_pubkey_open (grub_file_t io, const char *filename) + + if (!sec) + return io; +- if (io->device->disk && io->device->disk->id == GRUB_DISK_DEVICE_MEMDISK_ID) ++ if (io->device->disk && io->device->disk->dev->id == GRUB_DISK_DEVICE_MEMDISK_ID) + return io; + fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); + if (!fsuf) +-- +2.13.5 + 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 c86aea0..2def0a6 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,16 +1,30 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/commands/verify.c (grub_pubkey_open): Trust - procfs. +Subject: [PATCH 082/261] * grub-core/commands/verify.c (grub_pubkey_open): + Trust procfs. --- - grub-core/commands/verify.c | 4 +++- ChangeLog | 4 ++++ + grub-core/commands/verify.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) +diff --git a/ChangeLog b/ChangeLog +index d0896d89e..2a94ad979 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,9 @@ + 2014-06-21 Vladimir Serbinenko + ++ * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. ++ ++2014-06-21 Vladimir Serbinenko ++ + * grub-core/commands/verify.c (grub_pubkey_open): Fix memdisk + check. + diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c -index 6349ccfbaea..525bdd18737 100644 +index 6349ccfba..525bdd187 100644 --- a/grub-core/commands/verify.c +++ b/grub-core/commands/verify.c @@ -835,7 +835,9 @@ grub_pubkey_open (grub_file_t io, const char *filename) @@ -24,15 +38,6 @@ index 6349ccfbaea..525bdd18737 100644 return io; fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig")); if (!fsuf) -diff --git a/ChangeLog b/ChangeLog -index d0896d89e53..2a94ad979b3 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-06-21 Vladimir Serbinenko -+ -+ * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. -+ - 2014-06-21 Vladimir Serbinenko - - * grub-core/commands/verify.c (grub_pubkey_open): Fix memdisk +-- +2.13.5 + 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 3933381..eb184c2 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,16 +1,28 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-gen-asciih.c (add_glyph): Fix uninitialised - variable. +Subject: [PATCH 083/261] * util/grub-gen-asciih.c (add_glyph): Fix + uninitialised variable. --- - util/grub-gen-asciih.c | 15 +++++++++------ ChangeLog | 4 ++++ + util/grub-gen-asciih.c | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 2a94ad979..b55211308 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-06-21 Trevor Woerner ++ ++ * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. ++ + 2014-06-21 Vladimir Serbinenko + + * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. diff --git a/util/grub-gen-asciih.c b/util/grub-gen-asciih.c -index e01447ae94f..e35dcb78fe6 100644 +index e01447ae9..e35dcb78f 100644 --- a/util/grub-gen-asciih.c +++ b/util/grub-gen-asciih.c @@ -81,14 +81,14 @@ add_glyph (FT_UInt glyph_idx, FT_Face face, @@ -56,15 +68,6 @@ index e01447ae94f..e35dcb78fe6 100644 add_glyph (glyph_idx, face, char_code, &glyph); if (glyph.width == 8 && glyph.height == 16 -diff --git a/ChangeLog b/ChangeLog -index 2a94ad979b3..b5521130874 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-06-21 Trevor Woerner -+ -+ * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. -+ - 2014-06-21 Vladimir Serbinenko - - * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. +-- +2.13.5 + 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 1a1d5f7..5e11196 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,28 +1,16 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/commands/efi/lsefisystab.c +Subject: [PATCH 084/261] * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show EFI system table physical address. --- - grub-core/commands/efi/lsefisystab.c | 1 + ChangeLog | 5 +++++ + grub-core/commands/efi/lsefisystab.c | 1 + 2 files changed, 6 insertions(+) -diff --git a/grub-core/commands/efi/lsefisystab.c b/grub-core/commands/efi/lsefisystab.c -index eda8c5ff3f3..8717db91ea2 100644 ---- a/grub-core/commands/efi/lsefisystab.c -+++ b/grub-core/commands/efi/lsefisystab.c -@@ -52,6 +52,7 @@ grub_cmd_lsefisystab (struct grub_command *cmd __attribute__ ((unused)), - grub_efi_configuration_table_t *t; - unsigned int i; - -+ grub_printf ("Address: %p\n", st); - grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %08x\n", - st->hdr.signature, st->hdr.revision); - { diff --git a/ChangeLog b/ChangeLog -index b5521130874..abf8f4b2716 100644 +index b55211308..abf8f4b27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ @@ -34,3 +22,18 @@ index b5521130874..abf8f4b2716 100644 2014-06-21 Trevor Woerner * util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable. +diff --git a/grub-core/commands/efi/lsefisystab.c b/grub-core/commands/efi/lsefisystab.c +index eda8c5ff3..8717db91e 100644 +--- a/grub-core/commands/efi/lsefisystab.c ++++ b/grub-core/commands/efi/lsefisystab.c +@@ -52,6 +52,7 @@ grub_cmd_lsefisystab (struct grub_command *cmd __attribute__ ((unused)), + grub_efi_configuration_table_t *t; + unsigned int i; + ++ grub_printf ("Address: %p\n", st); + grub_printf ("Signature: %016" PRIxGRUB_UINT64_T " revision: %08x\n", + st->hdr.signature, st->hdr.revision); + { +-- +2.13.5 + 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 bfb63cc..8fdbba6 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,17 +1,32 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass - pointer to EFI system table. +Subject: [PATCH 085/261] * grub-core/loader/i386/bsd.c (grub_netbsd_boot): + Pass pointer to EFI system table. --- + ChangeLog | 5 +++++ grub-core/loader/i386/bsd.c | 8 ++++++++ include/grub/i386/netbsd_bootinfo.h | 7 +++++++ - ChangeLog | 5 +++++ 3 files changed, 20 insertions(+) +diff --git a/ChangeLog b/ChangeLog +index abf8f4b27..0cdd095a4 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,10 @@ + 2014-06-21 Stephane Rochoy + ++ * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to ++ EFI system table. ++ ++2014-06-21 Stephane Rochoy ++ + * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show + EFI system table physical address. + diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c -index 41ef9109ee1..8f691e0e2d1 100644 +index 41ef9109e..8f691e0e2 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -1145,6 +1145,14 @@ grub_netbsd_boot (void) @@ -30,7 +45,7 @@ index 41ef9109ee1..8f691e0e2d1 100644 struct bsd_tag *tag; tag_buf_len = 0; diff --git a/include/grub/i386/netbsd_bootinfo.h b/include/grub/i386/netbsd_bootinfo.h -index e48c19b4089..9b4f4604103 100644 +index e48c19b40..9b4f46041 100644 --- a/include/grub/i386/netbsd_bootinfo.h +++ b/include/grub/i386/netbsd_bootinfo.h @@ -58,6 +58,8 @@ @@ -52,16 +67,6 @@ index e48c19b4089..9b4f4604103 100644 +}; + #endif -diff --git a/ChangeLog b/ChangeLog -index abf8f4b2716..0cdd095a498 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,8 @@ -+2014-06-21 Stephane Rochoy -+ -+ * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to -+ EFI system table. -+ - 2014-06-21 Stephane Rochoy - - * grub-core/commands/efi/lsefisystab.c (grub_cmd_lsefisystab): Show +-- +2.13.5 + 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 ab838fa..1ee1a69 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,15 +1,27 @@ -From 0000000000000000000000000000000000000000 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] * util/grub-install.c: Fix handling of --disk-module. +Subject: [PATCH 086/261] * util/grub-install.c: Fix handling of --disk-module. --- - util/grub-install.c | 3 +-- ChangeLog | 4 ++++ + util/grub-install.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 0cdd095a4..4ce664327 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-06-21 Glenn Washburn ++ ++ * util/grub-install.c: Fix handling of --disk-module. ++ + 2014-06-21 Stephane Rochoy + + * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to diff --git a/util/grub-install.c b/util/grub-install.c -index e9c6a4656ef..7d61c32be2f 100644 +index e9c6a4656..7d61c32be 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -94,7 +94,6 @@ enum @@ -29,15 +41,6 @@ index e9c6a4656ef..7d61c32be2f 100644 N_("disk module to use (biosdisk or native). " "This option is only available on BIOS target."), 2}, {"no-nvram", OPTION_NO_NVRAM, 0, 0, -diff --git a/ChangeLog b/ChangeLog -index 0cdd095a498..4ce664327f9 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-06-21 Glenn Washburn -+ -+ * util/grub-install.c: Fix handling of --disk-module. -+ - 2014-06-21 Stephane Rochoy - - * grub-core/loader/i386/bsd.c (grub_netbsd_boot): Pass pointer to +-- +2.13.5 + 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 994ad08..88eea4f 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,17 +1,29 @@ -From 0000000000000000000000000000000000000000 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] * grub-core/commands/loadenv.c (check_blocklists): Fix - overlap check. +Subject: [PATCH 087/261] * grub-core/commands/loadenv.c (check_blocklists): + Fix overlap check. --- - grub-core/commands/loadenv.c | 13 ++----------- ChangeLog | 4 ++++ + grub-core/commands/loadenv.c | 13 ++----------- 2 files changed, 6 insertions(+), 11 deletions(-) +diff --git a/ChangeLog b/ChangeLog +index 4ce664327..a2da97432 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2014-06-21 Роман Пехов ++ ++ * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. ++ + 2014-06-21 Glenn Washburn + + * util/grub-install.c: Fix handling of --disk-module. diff --git a/grub-core/commands/loadenv.c b/grub-core/commands/loadenv.c -index 6af81120745..acd93d123ed 100644 +index 6af811207..acd93d123 100644 --- a/grub-core/commands/loadenv.c +++ b/grub-core/commands/loadenv.c @@ -263,7 +263,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, @@ -41,15 +53,6 @@ index 6af81120745..acd93d123ed 100644 { /* This might be actually valid, but it is unbelievable that any filesystem makes such a silly allocation. */ -diff --git a/ChangeLog b/ChangeLog -index 4ce664327f9..a2da9743231 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -1,3 +1,7 @@ -+2014-06-21 Роман Пехов -+ -+ * grub-core/commands/loadenv.c (check_blocklists): Fix overlap check. -+ - 2014-06-21 Glenn Washburn - - * util/grub-install.c: Fix handling of --disk-module. +-- +2.13.5 + 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 b3bde1e..98332ad 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,15 +1,15 @@ -From 0000000000000000000000000000000000000000 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] * NEWS: The cmosclean command in fact dates back to 1.99. - Remove mention of it from 2.02. +Subject: [PATCH 088/261] * NEWS: The cmosclean command in fact dates back to + 1.99. Remove mention of it from 2.02. --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS -index a61df942a35..f621c65de06 100644 +index a61df942a..f621c65de 100644 --- a/NEWS +++ b/NEWS @@ -63,6 +63,8 @@ New in 2.02: @@ -21,3 +21,6 @@ index a61df942a35..f621c65de06 100644 * Improve opcode parsing in ACPI halt implementation. * Use the TSC as a possible time source on i386-ieee1275. * Merge PowerPC grub-mkrescue implementation with the common one. +-- +2.13.5 + diff --git a/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch b/SOURCES/0089-Migrate-PPC-from-Yaboot-to-Grub2.patch index 68086cd..11e5dd8 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 0000000000000000000000000000000000000000 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] Migrate PPC from Yaboot to Grub2 +Subject: [PATCH 089/261] 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. @@ -12,26 +12,26 @@ maximum screen size so that text is not overwritten. create mode 100644 util/grub.d/20_ppc_terminfo.in diff --git a/Makefile.util.def b/Makefile.util.def -index a286a89cd8d..8f40e78332a 100644 +index a286a89cd..8f40e7833 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -484,6 +484,13 @@ script = { - condition = COND_HOST_LINUX; +@@ -485,6 +485,13 @@ script = { }; -+script = { + script = { + name = '20_ppc_terminfo'; + common = util/grub.d/20_ppc_terminfo.in; + installdir = grubconf; + condition = COND_HOST_LINUX; +}; + - script = { ++script = { name = '30_os-prober'; common = util/grub.d/30_os-prober.in; + installdir = grubconf; diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in new file mode 100644 -index 00000000000..10d66586820 +index 000000000..10d665868 --- /dev/null +++ b/util/grub.d/20_ppc_terminfo.in @@ -0,0 +1,114 @@ @@ -149,3 +149,6 @@ index 00000000000..10d66586820 +cat << EOF + terminfo -g ${X}x${Y} ${TERMINAL} +EOF +-- +2.13.5 + diff --git a/SOURCES/0090-Add-fw_path-variable-revised.patch b/SOURCES/0090-Add-fw_path-variable-revised.patch index 80510db..6fcd581 100644 --- a/SOURCES/0090-Add-fw_path-variable-revised.patch +++ b/SOURCES/0090-Add-fw_path-variable-revised.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Add fw_path variable (revised) +Subject: [PATCH 090/261] 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 @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=857936 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 9cad0c4485c..8ab7794c47b 100644 +index 9cad0c448..8ab7794c4 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -127,16 +127,15 @@ grub_set_prefix_and_root (void) @@ -41,7 +41,7 @@ index 9cad0c4485c..8ab7794c47b 100644 } diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 3a926fc5fa9..6f4970f71c1 100644 +index 3a926fc5f..6f4970f71 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -319,7 +319,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -76,3 +76,6 @@ index 3a926fc5fa9..6f4970f71c1 100644 prefix = grub_env_get ("prefix"); if (prefix) +-- +2.13.5 + diff --git a/SOURCES/0091-Add-support-for-linuxefi.patch b/SOURCES/0091-Add-support-for-linuxefi.patch index 4738452..5213c7e 100644 --- a/SOURCES/0091-Add-support-for-linuxefi.patch +++ b/SOURCES/0091-Add-support-for-linuxefi.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Add support for linuxefi +Subject: [PATCH 091/261] Add support for linuxefi --- grub-core/Makefile.core.def | 8 + @@ -13,14 +13,13 @@ Subject: [PATCH] Add support for linuxefi create mode 100644 grub-core/loader/i386/efi/linux.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 42443bc00b9..ec46506e39e 100644 +index 42443bc00..ec46506e3 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1705,6 +1705,14 @@ module = { - enable = x86_64_efi; +@@ -1706,6 +1706,14 @@ module = { }; -+module = { + module = { + name = linuxefi; + efi = loader/i386/efi/linux.c; + efi = lib/cmdline.c; @@ -28,11 +27,12 @@ index 42443bc00b9..ec46506e39e 100644 + enable = x86_64_efi; +}; + - module = { ++module = { name = chain; efi = loader/efi/chainloader.c; + i386_pc = loader/i386/pc/chainloader.c; diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c -index be37afd9dc4..ddeca6073f6 100644 +index be37afd9d..ddeca6073 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -49,6 +49,38 @@ static grub_efi_uintn_t finish_desc_size; @@ -76,7 +76,7 @@ index be37afd9dc4..ddeca6073f6 100644 grub_efi_allocate_pages (grub_efi_physical_address_t address, diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c new file mode 100644 -index 00000000000..b79e6320ba9 +index 000000000..b79e6320b --- /dev/null +++ b/grub-core/loader/i386/efi/linux.c @@ -0,0 +1,371 @@ @@ -452,7 +452,7 @@ index 00000000000..b79e6320ba9 + grub_unregister_command (cmd_initrd); +} diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 489cf9e6da7..9370fd53096 100644 +index 489cf9e6d..9370fd530 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -40,6 +40,9 @@ void EXPORT_FUNC(grub_efi_stall) (grub_efi_uintn_t microseconds); @@ -466,7 +466,7 @@ index 489cf9e6da7..9370fd53096 100644 grub_efi_uintn_t pages); int diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index da0ca3b83cd..fc36bdaf367 100644 +index da0ca3b83..fc36bdaf3 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -139,6 +139,7 @@ struct linux_kernel_header @@ -477,3 +477,6 @@ index da0ca3b83cd..fc36bdaf367 100644 } GRUB_PACKED; /* Boot parameters for Linux based on 2.6.12. This is used by the setup +-- +2.13.5 + diff --git a/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch b/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch index 99a024d..0acf817 100644 --- a/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch +++ b/SOURCES/0092-Use-linuxefi-and-initrdefi-where-appropriate.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Use "linuxefi" and "initrdefi" where appropriate. +Subject: [PATCH 092/261] Use "linuxefi" and "initrdefi" where appropriate. --- util/grub.d/10_linux.in | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 00d193159e9..ad34cc02d36 100644 +index 00d193159..ad34cc02d 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -127,17 +127,31 @@ linux_entry () @@ -45,3 +45,6 @@ index 00d193159e9..ad34cc02d36 100644 fi sed "s/^/$submenu_indentation/" << EOF } +-- +2.13.5 + 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 78b6685..f4a58a1 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 0000000000000000000000000000000000000000 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] Don't allow insmod when secure boot is enabled. +Subject: [PATCH 093/261] Don't allow insmod when secure boot is enabled. Hi, @@ -23,7 +23,7 @@ moves the check into grub_dl_load_file. 3 files changed, 50 insertions(+) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index 6850e049741..b0b0405fcbe 100644 +index 6850e0497..b0b0405fc 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -38,6 +38,14 @@ @@ -62,7 +62,7 @@ index 6850e049741..b0b0405fcbe 100644 file = grub_file_open (filename); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index b9eb1ab1e33..cd839cc988a 100644 +index b9eb1ab1e..cd839cc98 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -259,6 +259,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -101,7 +101,7 @@ index b9eb1ab1e33..cd839cc988a 100644 /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 9370fd53096..a000c383e81 100644 +index 9370fd530..a000c383e 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -72,6 +72,7 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, @@ -112,3 +112,6 @@ index 9370fd53096..a000c383e81 100644 int EXPORT_FUNC (grub_efi_compare_device_paths) (const grub_efi_device_path_t *dp1, const grub_efi_device_path_t *dp2); +-- +2.13.5 + 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 c51c06a..8a7b9fc 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,8 @@ -From 0000000000000000000000000000000000000000 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] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. +Subject: [PATCH 094/261] Pass "\x[[:hex:]][[:hex:]]" straight through + unmolested. --- grub-core/commands/wildcard.c | 16 +++++++++++++++- @@ -10,7 +11,7 @@ Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested. 3 files changed, 84 insertions(+), 9 deletions(-) diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c -index 2807f806bd4..0f40e041541 100644 +index 2807f806b..0f40e0415 100644 --- a/grub-core/commands/wildcard.c +++ b/grub-core/commands/wildcard.c @@ -458,6 +458,12 @@ check_file (const char *dir, const char *basename) @@ -44,7 +45,7 @@ index 2807f806bd4..0f40e041541 100644 *optr++ = iptr[1]; iptr += 2; diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c -index d5e10ee8798..0a5b2afb94b 100644 +index d5e10ee87..0a5b2afb9 100644 --- a/grub-core/lib/cmdline.c +++ b/grub-core/lib/cmdline.c @@ -20,6 +20,12 @@ @@ -103,7 +104,7 @@ index d5e10ee8798..0a5b2afb94b 100644 *buf++ = *c; diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index afd551320f7..8f01c1bbfa2 100644 +index afd551320..8f01c1bbf 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -52,6 +52,12 @@ static struct grub_script_scope *scope = 0; @@ -177,3 +178,6 @@ index afd551320f7..8f01c1bbfa2 100644 break; case '$': if (escaped) +-- +2.13.5 + diff --git a/SOURCES/0095-Fix-crash-on-http.patch b/SOURCES/0095-Fix-crash-on-http.patch index a691528..534a738 100644 --- a/SOURCES/0095-Fix-crash-on-http.patch +++ b/SOURCES/0095-Fix-crash-on-http.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Fix crash on http +Subject: [PATCH 095/261] 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. @@ -11,7 +11,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=860834 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index 4684f8b333c..ef9538c539c 100644 +index 4684f8b33..ef9538c53 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -393,7 +393,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) @@ -23,3 +23,6 @@ index 4684f8b333c..ef9538c539c 100644 file); if (!data->sock) { +-- +2.13.5 + diff --git a/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch b/SOURCES/0096-IBM-client-architecture-CAS-reboot-support.patch index 1326fff..696a237 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 0000000000000000000000000000000000000000 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] IBM client architecture (CAS) reboot support +Subject: [PATCH 096/261] IBM client architecture (CAS) reboot support This is an implementation of IBM client architecture (CAS) reboot for GRUB. @@ -25,7 +25,7 @@ parameters 4 files changed, 90 insertions(+) diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index ddb778340e4..6db8b986551 100644 +index ddb778340..6db8b9865 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c @@ -561,3 +561,65 @@ grub_ieee1275_canonicalise_devname (const char *path) @@ -95,7 +95,7 @@ index ddb778340e4..6db8b986551 100644 + return 0; +} diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 6f4970f71c1..f72844c9f37 100644 +index 6f4970f71..f72844c9f 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,9 @@ @@ -132,7 +132,7 @@ index 6f4970f71c1..f72844c9f37 100644 grub_errno = GRUB_ERR_NONE; } diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c -index 8f01c1bbfa2..cec9539a47c 100644 +index 8f01c1bbf..cec9539a4 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -27,6 +27,9 @@ @@ -157,7 +157,7 @@ index 8f01c1bbfa2..cec9539a47c 100644 { char *line; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 8e425130327..9f26c69a2df 100644 +index 8e4251303..9f26c69a2 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -234,6 +234,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali @@ -169,3 +169,6 @@ index 8e425130327..9f26c69a2df 100644 #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) +-- +2.13.5 + diff --git a/SOURCES/0097-Add-vlan-tag-support.patch b/SOURCES/0097-Add-vlan-tag-support.patch index 6181b62..35128d4 100644 --- a/SOURCES/0097-Add-vlan-tag-support.patch +++ b/SOURCES/0097-Add-vlan-tag-support.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Add vlan-tag support +Subject: [PATCH 097/261] 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 @@ -20,7 +20,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=871563 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index d5bd74d3552..8191f8cd658 100644 +index d5bd74d35..8191f8cd6 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -117,6 +117,7 @@ grub_machine_get_bootlocation (char **device, char **path) @@ -32,7 +32,7 @@ index d5bd74d3552..8191f8cd658 100644 ptr = canon + grub_strlen (canon) - 1; while (ptr > canon && (*ptr == ',' || *ptr == ':')) diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c -index 6db8b986551..81276fae7b7 100644 +index 6db8b9865..81276fae7 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c @@ -23,6 +23,7 @@ @@ -80,7 +80,7 @@ index 6db8b986551..81276fae7b7 100644 grub_ieee1275_get_device_type (const char *path) { diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c -index c397b1b348c..faaca67c50e 100644 +index c397b1b34..faaca67c5 100644 --- a/grub-core/net/ethernet.c +++ b/grub-core/net/ethernet.c @@ -23,6 +23,7 @@ @@ -159,7 +159,7 @@ index c397b1b348c..faaca67c50e 100644 return err; diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 9f26c69a2df..6a21f5d6de8 100644 +index 9f26c69a2..6a21f5d6d 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -236,6 +236,7 @@ void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath, @@ -171,7 +171,7 @@ index 9f26c69a2df..6a21f5d6de8 100644 #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));) diff --git a/include/grub/net.h b/include/grub/net.h -index 538baa33eca..a799e6b8b69 100644 +index 538baa33e..a799e6b8b 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -538,4 +538,6 @@ extern char *grub_net_default_server; @@ -181,3 +181,6 @@ index 538baa33eca..a799e6b8b69 100644 +#define VLANTAG_IDENTIFIER 0x8100 + #endif /* ! GRUB_NET_HEADER */ +-- +2.13.5 + diff --git a/SOURCES/0098-Add-X-option-to-printf-functions.patch b/SOURCES/0098-Add-X-option-to-printf-functions.patch index 9631a38..e709355 100644 --- a/SOURCES/0098-Add-X-option-to-printf-functions.patch +++ b/SOURCES/0098-Add-X-option-to-printf-functions.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Add %X option to printf functions. +Subject: [PATCH 098/261] Add %X option to printf functions. --- grub-core/kern/misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index c5c815d8d13..a56cfe78994 100644 +index c5c815d8d..a56cfe789 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -762,7 +762,7 @@ __umoddi3 (grub_uint64_t a, grub_uint64_t b) @@ -53,3 +53,6 @@ index c5c815d8d13..a56cfe78994 100644 case 'u': case 'd': { +-- +2.13.5 + 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 16053af..390daea 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 0000000000000000000000000000000000000000 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] DHCP client ID and UUID options added. +Subject: [PATCH 099/261] DHCP client ID and UUID options added. --- grub-core/net/bootp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++----- @@ -9,7 +9,7 @@ Subject: [PATCH] DHCP client ID and UUID options added. 2 files changed, 81 insertions(+), 8 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 6310ed447e8..88f20568914 100644 +index 6310ed447..88f205689 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -25,6 +25,49 @@ @@ -128,7 +128,7 @@ index 6310ed447e8..88f20568914 100644 grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), int argc, char **args) diff --git a/include/grub/net.h b/include/grub/net.h -index a799e6b8b69..59e5975b11f 100644 +index a799e6b8b..59e5975b1 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -433,6 +433,8 @@ enum @@ -140,3 +140,6 @@ index a799e6b8b69..59e5975b11f 100644 GRUB_NET_BOOTP_END = 0xff }; +-- +2.13.5 + 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 b72bea3..e5898c8 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 0000000000000000000000000000000000000000 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] Search for specific config file for netboot +Subject: [PATCH 100/261] 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: @@ -22,7 +22,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=873406 3 files changed, 135 insertions(+), 4 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index f2e723bd409..578e057e18f 100644 +index f2e723bd4..578e057e1 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1702,6 +1702,124 @@ grub_net_restore_hw (void) @@ -151,7 +151,7 @@ index f2e723bd409..578e057e18f 100644 static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f72844c9f37..85d2a2862d4 100644 +index f72844c9f..85d2a2862 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -33,6 +33,7 @@ @@ -187,7 +187,7 @@ index f72844c9f37..85d2a2862d4 100644 grub_enter_normal_mode (config); grub_free (config); diff --git a/include/grub/net.h b/include/grub/net.h -index 59e5975b11f..88fc71ceffe 100644 +index 59e5975b1..88fc71cef 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -542,4 +542,7 @@ extern char *grub_net_default_server; @@ -198,3 +198,6 @@ index 59e5975b11f..88fc71ceffe 100644 +grub_net_search_configfile (char *config); + #endif /* ! GRUB_NET_HEADER */ +-- +2.13.5 + 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 9889d72..a693250 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] blscfg: add blscfg module to parse Boot Loader Specification - snippets +Subject: [PATCH 101/261] blscfg: add blscfg module to parse Boot Loader + Specification snippets http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec @@ -21,14 +21,13 @@ Signed-off-by: Peter Jones create mode 100644 grub-core/commands/blscfg.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index ec46506e39e..7bf1c8a5880 100644 +index ec46506e3..7bf1c8a58 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -746,6 +746,14 @@ module = { - common = commands/blocklist.c; +@@ -747,6 +747,14 @@ module = { }; -+module = { + module = { + name = blscfg; + common = commands/blscfg.c; + enable = i386_efi; @@ -36,12 +35,13 @@ index ec46506e39e..7bf1c8a5880 100644 + enable = i386_pc; +}; + - module = { ++module = { name = boot; common = commands/boot.c; + i386_pc = lib/i386/pc/biosnum.c; diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c new file mode 100644 -index 00000000000..4274aca5a9d +index 000000000..4274aca5a --- /dev/null +++ b/grub-core/commands/blscfg.c @@ -0,0 +1,201 @@ @@ -246,3 +246,6 @@ index 00000000000..4274aca5a9d +{ + grub_unregister_extcmd (cmd); +} +-- +2.13.5 + diff --git a/SOURCES/0102-Move-bash-completion-script-922997.patch b/SOURCES/0102-Move-bash-completion-script-922997.patch index 1da0068..f65851d 100644 --- a/SOURCES/0102-Move-bash-completion-script-922997.patch +++ b/SOURCES/0102-Move-bash-completion-script-922997.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Move bash completion script (#922997) +Subject: [PATCH 102/261] Move bash completion script (#922997) Apparently these go in a new place now. --- @@ -9,7 +9,7 @@ Apparently these go in a new place now. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/bash-completion.d/Makefile.am b/util/bash-completion.d/Makefile.am -index 136287cf1bf..0bcdb060e84 100644 +index 136287cf1..0bcdb060e 100644 --- a/util/bash-completion.d/Makefile.am +++ b/util/bash-completion.d/Makefile.am @@ -6,7 +6,7 @@ EXTRA_DIST = $(bash_completion_source) @@ -21,3 +21,6 @@ index 136287cf1bf..0bcdb060e84 100644 bashcompletion_DATA = $(bash_completion_script) $(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status +-- +2.13.5 + 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 853c150..9ea83e5 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 0000000000000000000000000000000000000000 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] for ppc, reset console display attr when clear screen +Subject: [PATCH 103/261] for ppc, reset console display attr when clear screen This should fix this bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=908519 @@ -10,7 +10,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=908519 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c -index f0d3e3debc6..7cb7909c8cf 100644 +index f0d3e3deb..7cb7909c8 100644 --- a/grub-core/term/terminfo.c +++ b/grub-core/term/terminfo.c @@ -151,7 +151,7 @@ grub_terminfo_set_current (struct grub_term_output *term, @@ -22,3 +22,6 @@ index f0d3e3debc6..7cb7909c8cf 100644 data->reverse_video_on = grub_strdup ("\e[7m"); data->reverse_video_off = grub_strdup ("\e[m"); if (grub_strcmp ("ieee1275", str) == 0) +-- +2.13.5 + 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 c4d8945..bf320e5 100644 --- a/SOURCES/0104-Don-t-write-messages-to-the-screen.patch +++ b/SOURCES/0104-Don-t-write-messages-to-the-screen.patch @@ -1,21 +1,51 @@ -From 0000000000000000000000000000000000000000 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] Don't write messages to the screen +Subject: [PATCH 104/261] 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 very appealing. --- - grub-core/gettext/gettext.c | 15 --------------- - grub-core/kern/main.c | 5 ----- grub-core/boot/i386/pc/boot.S | 3 --- grub-core/boot/i386/pc/diskboot.S | 5 ----- + grub-core/gettext/gettext.c | 15 --------------- + grub-core/kern/main.c | 5 ----- util/grub.d/10_linux.in | 7 ------- 5 files changed, 35 deletions(-) +diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S +index b4975e2d0..432a472d5 100644 +--- a/grub-core/boot/i386/pc/boot.S ++++ b/grub-core/boot/i386/pc/boot.S +@@ -249,9 +249,6 @@ real_start: + /* save drive reference first thing! */ + pushw %dx + +- /* print a notification message on the screen */ +- MSG(notification_string) +- + /* set %si to the disk address packet */ + movw $disk_address_packet, %si + +diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S +index d030a14c9..a494d029c 100644 +--- a/grub-core/boot/i386/pc/diskboot.S ++++ b/grub-core/boot/i386/pc/diskboot.S +@@ -50,11 +50,6 @@ _start: + /* save drive reference first thing! */ + pushw %dx + +- /* print a notification message on the screen */ +- pushw %si +- MSG(notification_string) +- popw %si +- + /* this sets up for the first run through "bootloop" */ + movw $LOCAL(firstlist), %di + diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c -index 4880cefe3f8..1e5c21d7ef2 100644 +index 4880cefe3..1e5c21d7e 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -437,13 +437,9 @@ grub_gettext_env_write_lang (struct grub_env_var *var @@ -74,7 +104,7 @@ index 4880cefe3f8..1e5c21d7ef2 100644 grub_register_variable_hook ("locale_dir", NULL, read_main); grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 8ab7794c47b..da47b18b50e 100644 +index 8ab7794c4..da47b18b5 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -268,11 +268,6 @@ grub_main (void) @@ -89,38 +119,8 @@ index 8ab7794c47b..da47b18b50e 100644 grub_load_config (); grub_boot_time ("Before loading embedded modules."); -diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S -index b4975e2d029..432a472d529 100644 ---- a/grub-core/boot/i386/pc/boot.S -+++ b/grub-core/boot/i386/pc/boot.S -@@ -249,9 +249,6 @@ real_start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- MSG(notification_string) -- - /* set %si to the disk address packet */ - movw $disk_address_packet, %si - -diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S -index d030a14c916..a494d029c61 100644 ---- a/grub-core/boot/i386/pc/diskboot.S -+++ b/grub-core/boot/i386/pc/diskboot.S -@@ -50,11 +50,6 @@ _start: - /* save drive reference first thing! */ - pushw %dx - -- /* print a notification message on the screen */ -- pushw %si -- MSG(notification_string) -- popw %si -- - /* this sets up for the first run through "bootloop" */ - movw $LOCAL(firstlist), %di - diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index ad34cc02d36..e762e1f4e37 100644 +index ad34cc02d..e762e1f4e 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -126,29 +126,22 @@ linux_entry () @@ -153,3 +153,6 @@ index ad34cc02d36..e762e1f4e37 100644 initrd ${rel_dirname}/${initrd} EOF fi +-- +2.13.5 + diff --git a/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch b/SOURCES/0105-Don-t-print-GNU-GRUB-header.patch index 2ee1c91..26018f2 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 0000000000000000000000000000000000000000 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] Don't print GNU GRUB header +Subject: [PATCH 105/261] Don't print GNU GRUB header No one cares. --- @@ -9,7 +9,7 @@ No one cares. 1 file changed, 2 insertions(+) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 85d2a2862d4..3777cd22ce3 100644 +index 85d2a2862..3777cd22c 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -212,6 +212,7 @@ grub_normal_init_page (struct grub_term_output *term, @@ -28,3 +28,6 @@ index 85d2a2862d4..3777cd22ce3 100644 } static void +-- +2.13.5 + diff --git a/SOURCES/0106-Don-t-add-to-highlighted-row.patch b/SOURCES/0106-Don-t-add-to-highlighted-row.patch index ef6dc25..f7e8904 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 0000000000000000000000000000000000000000 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] Don't add '*' to highlighted row +Subject: [PATCH 106/261] Don't add '*' to highlighted row It is already highlighted. --- @@ -9,7 +9,7 @@ It is already highlighted. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 2ff294101d8..2f84fccb6fe 100644 +index 2ff294101..2f84fccb6 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -242,7 +242,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -21,3 +21,6 @@ index 2ff294101d8..2f84fccb6fe 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, +-- +2.13.5 + diff --git a/SOURCES/0107-Message-string-cleanups.patch b/SOURCES/0107-Message-string-cleanups.patch index 42502c1..9b8e201 100644 --- a/SOURCES/0107-Message-string-cleanups.patch +++ b/SOURCES/0107-Message-string-cleanups.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Message string cleanups +Subject: [PATCH 107/261] Message string cleanups Make use of terminology consistent. Remove jargon. --- @@ -9,7 +9,7 @@ Make use of terminology consistent. Remove jargon. 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 2f84fccb6fe..9d20c6b85b2 100644 +index 2f84fccb6..9d20c6b85 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,9 +157,8 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -66,3 +66,6 @@ index 2f84fccb6fe..9d20c6b85b2 100644 if (!msg_translated) { grub_print_error (); +-- +2.13.5 + 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 0c1a9ab..9a83d09 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,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Fix border spacing now that we aren't displaying it +Subject: [PATCH 108/261] Fix border spacing now that we aren't displaying it --- grub-core/normal/menu_text.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 9d20c6b85b2..aa3454ff525 100644 +index 9d20c6b85..aa3454ff5 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -331,12 +331,12 @@ grub_menu_init_page (int nested, int edit, @@ -27,3 +27,6 @@ index 9d20c6b85b2..aa3454ff525 100644 geo->timeout_lines = 2; +-- +2.13.5 + 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 cbeb9fd..594f401 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 0000000000000000000000000000000000000000 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] Use the correct indentation for the term help text +Subject: [PATCH 109/261] Use the correct indentation for the term help text That is consistent with the menu help text --- @@ -9,7 +9,7 @@ That is consistent with the menu help text 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 3777cd22ce3..0da2a520d2d 100644 +index 3777cd22c..0da2a520d 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -426,8 +426,8 @@ grub_normal_reader_init (int nested) @@ -23,3 +23,6 @@ index 3777cd22ce3..0da2a520d2d 100644 else grub_print_message_indented (msg_formatted, 0, 0, term); grub_putcode ('\n', term); +-- +2.13.5 + diff --git a/SOURCES/0110-Indent-menu-entries.patch b/SOURCES/0110-Indent-menu-entries.patch index 98c3b7d..8779a5c 100644 --- a/SOURCES/0110-Indent-menu-entries.patch +++ b/SOURCES/0110-Indent-menu-entries.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Indent menu entries +Subject: [PATCH 110/261] Indent menu entries --- grub-core/normal/menu_text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index aa3454ff525..01b6f1c739f 100644 +index aa3454ff5..01b6f1c73 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -239,7 +239,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry, @@ -21,3 +21,6 @@ index aa3454ff525..01b6f1c739f 100644 grub_print_ucs4_menu (unicode_title, unicode_title + len, +-- +2.13.5 + diff --git a/SOURCES/0111-Fix-margins.patch b/SOURCES/0111-Fix-margins.patch index 5c5ae10..e1a3296 100644 --- a/SOURCES/0111-Fix-margins.patch +++ b/SOURCES/0111-Fix-margins.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Fix margins +Subject: [PATCH 111/261] Fix margins --- grub-core/normal/menu_text.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 01b6f1c739f..ead3391b7bb 100644 +index 01b6f1c73..ead3391b7 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -333,17 +333,15 @@ grub_menu_init_page (int nested, int edit, @@ -32,3 +32,6 @@ index 01b6f1c739f..ead3391b7bb 100644 - 1 /* empty line before info message*/ - geo->timeout_lines /* timeout */ - 1 /* empty final line */; +-- +2.13.5 + 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 f093824..d6d1f82 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,8 @@ -From 0000000000000000000000000000000000000000 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] Add support for UEFI operating systems returned by os-prober +Subject: [PATCH 112/261] Add support for UEFI operating systems returned by + os-prober os-prober returns UEFI operating systems in the form: @@ -14,7 +15,7 @@ contrast to legacy OSes, where path is the device string. Handle this case. 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in -index 6f38c82a554..9f955abb788 100644 +index 6f38c82a5..9f955abb7 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -322,9 +322,23 @@ EOF @@ -45,3 +46,6 @@ index 6f38c82a554..9f955abb788 100644 + esac esac done +-- +2.13.5 + 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 32f4c3a..db4141e 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 0000000000000000000000000000000000000000 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] Disable GRUB video support for IBM power machines +Subject: [PATCH 113/261] Disable GRUB video support for IBM power machines Should fix the problem in bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=973205 @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=973205 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 3e12e6b24e1..3e14f539368 100644 +index 3e12e6b24..3e14f5393 100644 --- a/grub-core/kern/ieee1275/cmain.c +++ b/grub-core/kern/ieee1275/cmain.c @@ -90,7 +90,10 @@ grub_ieee1275_find_options (void) @@ -28,7 +28,7 @@ index 3e12e6b24e1..3e14f539368 100644 /* Old Macs have no key repeat, newer ones have fully working one. The ones inbetween when repeated key generates an escaoe sequence diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c -index 0b150ec2406..813ab38e1e0 100644 +index 0b150ec24..813ab38e1 100644 --- a/grub-core/video/ieee1275.c +++ b/grub-core/video/ieee1275.c @@ -351,9 +351,12 @@ static struct grub_video_adapter grub_video_ieee1275_adapter = @@ -48,7 +48,7 @@ index 0b150ec2406..813ab38e1e0 100644 GRUB_MOD_FINI(ieee1275_fb) diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 6a21f5d6de8..663935da7a5 100644 +index 6a21f5d6d..663935da7 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -146,6 +146,8 @@ enum grub_ieee1275_flag @@ -60,3 +60,6 @@ index 6a21f5d6de8..663935da7a5 100644 }; extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); +-- +2.13.5 + 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 2f81996..f9809ac 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 0000000000000000000000000000000000000000 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] Use -2 instead of -1 for our right-hand margin, so +Subject: [PATCH 114/261] Use -2 instead of -1 for our right-hand margin, so linewrapping works (#976643). Signed-off-by: Peter Jones @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index ead3391b7bb..bc1fc718fc0 100644 +index ead3391b7..bc1fc718f 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -334,7 +334,7 @@ grub_menu_init_page (int nested, int edit, @@ -22,3 +22,6 @@ index ead3391b7bb..bc1fc718fc0 100644 geo->first_entry_y = 3; /* three empty lines*/ +-- +2.13.5 + diff --git a/SOURCES/0115-Use-linux16-when-appropriate-880840.patch b/SOURCES/0115-Use-linux16-when-appropriate-880840.patch index 2bbab63..11ba477 100644 --- a/SOURCES/0115-Use-linux16-when-appropriate-880840.patch +++ b/SOURCES/0115-Use-linux16-when-appropriate-880840.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Use linux16 when appropriate (#880840) +Subject: [PATCH 115/261] Use linux16 when appropriate (#880840) The kernel group really would prefer that we use the 16 bit entry point on x86 bios machines. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index e762e1f4e37..600bfd29dc7 100644 +index e762e1f4e..600bfd29d 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -74,6 +74,11 @@ linux_entry () @@ -47,3 +47,6 @@ index e762e1f4e37..600bfd29dc7 100644 EOF fi fi +-- +2.13.5 + diff --git a/SOURCES/0116-Enable-pager-by-default.-985860.patch b/SOURCES/0116-Enable-pager-by-default.-985860.patch index 8c545b7..9aed459 100644 --- a/SOURCES/0116-Enable-pager-by-default.-985860.patch +++ b/SOURCES/0116-Enable-pager-by-default.-985860.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Enable pager by default. (#985860) +Subject: [PATCH 116/261] Enable pager by default. (#985860) Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in -index ce2ec819d8c..fefa7ddfcc0 100644 +index ce2ec819d..fefa7ddfc 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -43,6 +43,8 @@ if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_ @@ -21,3 +21,6 @@ index ce2ec819d8c..fefa7ddfcc0 100644 if [ -s \$prefix/grubenv ]; then load_env fi +-- +2.13.5 + 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 82f00d6..05153b9 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] F10 doesn't work on serial, so don't tell the user to hit it - (#987443) +Subject: [PATCH 117/261] F10 doesn't work on serial, so don't tell the user to + hit it (#987443) Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index bc1fc718fc0..6202c2a16c9 100644 +index bc1fc718f..6202c2a16 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -157,7 +157,7 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run) @@ -22,3 +22,6 @@ index bc1fc718fc0..6202c2a16c9 100644 command prompt or Escape to discard edits and return to the menu. Pressing Tab lists possible completions."), STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run); +-- +2.13.5 + 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 9210b89..fcbb14c 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 0000000000000000000000000000000000000000 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] Don't say "GNU/Linux" in generated menus. +Subject: [PATCH 118/261] Don't say "GNU/Linux" in generated menus. --- util/grub.d/10_linux.in | 4 ++-- @@ -9,7 +9,7 @@ Subject: [PATCH] Don't say "GNU/Linux" in generated menus. 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 600bfd29dc7..c943a1e403e 100644 +index 600bfd29d..c943a1e40 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -25,7 +25,7 @@ index 600bfd29dc7..c943a1e403e 100644 fi diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in -index a60843500ed..79d4e38d643 100644 +index a60843500..79d4e38d6 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@" @@ -40,3 +40,6 @@ index a60843500ed..79d4e38d643 100644 CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}" fi +-- +2.13.5 + 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 409c472..07fe72f 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 0000000000000000000000000000000000000000 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] Don't draw a border around the menu +Subject: [PATCH 119/261] Don't draw a border around the menu It looks cleaner without it. --- @@ -9,7 +9,7 @@ It looks cleaner without it. 1 file changed, 43 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index 6202c2a16c9..beddd7f81c1 100644 +index 6202c2a16..beddd7f81 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right, @@ -69,3 +69,6 @@ index 6202c2a16c9..beddd7f81c1 100644 grub_term_normal_color = old_color_normal; grub_term_highlight_color = old_color_highlight; geo->timeout_y = geo->first_entry_y + geo->num_entries +-- +2.13.5 + 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 046af91..aae51b2 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 0000000000000000000000000000000000000000 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] Use the standard margin for the timeout string +Subject: [PATCH 120/261] Use the standard margin for the timeout string So that it aligns with the other messages --- @@ -9,7 +9,7 @@ So that it aligns with the other messages 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c -index beddd7f81c1..33b208bcf44 100644 +index beddd7f81..33b208bcf 100644 --- a/grub-core/normal/menu_text.c +++ b/grub-core/normal/menu_text.c @@ -369,7 +369,7 @@ grub_menu_init_page (int nested, int edit, @@ -38,3 +38,6 @@ index beddd7f81c1..33b208bcf44 100644 } } +-- +2.13.5 + 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 d4d88d2..0d7b1de 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 0000000000000000000000000000000000000000 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] Fix grub_script_execute_sourcecode() usage on ppc. +Subject: [PATCH 121/261] Fix grub_script_execute_sourcecode() usage on ppc. 593e430c made it not take the extra argc/argv that this code still passes it. @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 0da2a520d2d..f66c03c4c6e 100644 +index 0da2a520d..f66c03c4c 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -289,7 +289,7 @@ grub_normal_execute (const char *config, int nested, int batch) @@ -24,3 +24,6 @@ index 0da2a520d2d..f66c03c4c6e 100644 boot = 1; } grub_free (script); +-- +2.13.5 + 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 68d6089..77f847b 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,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] Add .eh_frame to list of relocations stripped +Subject: [PATCH 122/261] Add .eh_frame to list of relocations stripped --- conf/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/Makefile.common b/conf/Makefile.common -index e4c301fb6b6..6f836d82771 100644 +index e4c301fb6..6f836d827 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -45,7 +45,7 @@ CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding @@ -20,3 +20,6 @@ index e4c301fb6b6..6f836d82771 100644 CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d +-- +2.13.5 + 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 8b30f95..6581b7e 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] Make 10_linux work with our changes for linux16 and linuxefi - on aarch64 +Subject: [PATCH 123/261] Make 10_linux work with our changes for linux16 and + linuxefi on aarch64 Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c943a1e403e..2b8c561ff7b 100644 +index c943a1e40..2b8c561ff 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -75,8 +75,18 @@ linux_entry () @@ -80,3 +80,6 @@ index c943a1e403e..2b8c561ff7b 100644 config= for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do if test -e "${i}" ; then +-- +2.13.5 + 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 d826d5e..cb573a8 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 0000000000000000000000000000000000000000 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] Don't print during fdt loading method. +Subject: [PATCH 124/261] Don't print during fdt loading method. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 2b8c561ff7b..acf2e0e2d37 100644 +index 2b8c561ff..acf2e0e2d 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -162,9 +162,7 @@ EOF @@ -22,3 +22,6 @@ index 2b8c561ff7b..acf2e0e2d37 100644 devicetree ${rel_dirname}/${fdt} EOF fi +-- +2.13.5 + 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 36735ab..b76c85d 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 0000000000000000000000000000000000000000 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] Honor a symlink when generating configuration by +Subject: [PATCH 125/261] Honor a symlink when generating configuration by grub2-mkconfig Honor a symlink when generating configuration by grub2-mkconfig, so that @@ -11,7 +11,7 @@ the -o option follows it rather than overwriting it with a regular file. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index ca040dd776c..b00f9e61f40 100644 +index ca040dd77..b00f9e61f 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -272,7 +272,8 @@ and /etc/grub.d/* files or please file a bug report with @@ -24,3 +24,6 @@ index ca040dd776c..b00f9e61f40 100644 fi fi +-- +2.13.5 + 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 33bdad2..e6e534c 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] Don't munge raw spaces when we're doing our cmdline escaping - (#923374) +Subject: [PATCH 126/261] Don't munge raw spaces when we're doing our cmdline + escaping (#923374) Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c -index 0a5b2afb94b..970ea868c14 100644 +index 0a5b2afb9..970ea868c 100644 --- a/grub-core/lib/cmdline.c +++ b/grub-core/lib/cmdline.c @@ -97,16 +97,7 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf, @@ -31,3 +31,6 @@ index 0a5b2afb94b..970ea868c14 100644 is_hex(*(c+2)) && is_hex(*(c+3))) { *buf++ = *c++; +-- +2.13.5 + 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 f907ad8..5d3eb03 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 0000000000000000000000000000000000000000 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] Don't require a password to boot entries generated by +Subject: [PATCH 127/261] 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. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index acf2e0e2d37..136abd7a6e3 100644 +index acf2e0e2d..136abd7a6 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -26,7 +26,7 @@ datarootdir="@datarootdir@" @@ -26,3 +26,6 @@ index acf2e0e2d37..136abd7a6e3 100644 if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS="$(sed 's, release .*$,,g' /etc/system-release)" +-- +2.13.5 + diff --git a/SOURCES/0128-Don-t-emit-Booting-.-message.patch b/SOURCES/0128-Don-t-emit-Booting-.-message.patch index a39e7b2..160aa43 100644 --- a/SOURCES/0128-Don-t-emit-Booting-.-message.patch +++ b/SOURCES/0128-Don-t-emit-Booting-.-message.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 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] Don't emit "Booting ..." message. +Subject: [PATCH 128/261] Don't emit "Booting ..." message. UI team still hates this stuff, so we're disabling it for RHEL 7. @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index b47991ababa..cc27c370776 100644 +index b47991aba..cc27c3707 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -810,9 +810,11 @@ static void @@ -30,7 +30,7 @@ index b47991ababa..cc27c370776 100644 /* Callback invoked when a default menu entry executed because of a timeout diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c -index b485df82122..62e5db1fef8 100644 +index b485df821..62e5db1fe 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -1156,9 +1156,6 @@ run (struct screen *screen) @@ -43,3 +43,6 @@ index b485df82122..62e5db1fef8 100644 errs_before = grub_err_printed_errors; +-- +2.13.5 + 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 140c207..1a6de5a 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 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] Make CTRL and ALT keys work as expected on EFI systems - (version 5). +Subject: [PATCH 129/261] Make CTRL and ALT keys work as expected on EFI + systems (version 5). This is version 4. @@ -33,7 +33,7 @@ Signed-off-by: Peter Jones 2 files changed, 161 insertions(+), 22 deletions(-) diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c -index a37eb841c72..677eab5820f 100644 +index a37eb841c..677eab582 100644 --- a/grub-core/term/efi/console.c +++ b/grub-core/term/efi/console.c @@ -104,26 +104,12 @@ const unsigned efi_codes[] = @@ -210,7 +210,7 @@ index a37eb841c72..677eab5820f 100644 void diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index e5dd543a801..142340372e1 100644 +index e5dd543a8..142340372 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -111,7 +111,7 @@ @@ -299,3 +299,6 @@ index e5dd543a801..142340372e1 100644 struct grub_efi_simple_text_output_interface { grub_efi_status_t +-- +2.13.5 + diff --git a/SOURCES/0130-May-as-well-try-it.patch b/SOURCES/0130-May-as-well-try-it.patch index 73d2b16..95e57fa 100644 --- a/SOURCES/0130-May-as-well-try-it.patch +++ b/SOURCES/0130-May-as-well-try-it.patch @@ -1,11 +1,11 @@ -From 0000000000000000000000000000000000000000 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] May as well try it. +Subject: [PATCH 130/261] May as well try it. --- - configure.ac | 23 ++++++ conf/Makefile.extra-dist | 1 - + configure.ac | 23 ++++++ docs/Makefile.am | 2 - docs/man/grub-bios-setup.h2m | 6 -- docs/man/grub-editenv.h2m | 5 -- @@ -120,8 +120,20 @@ Subject: [PATCH] May as well try it. create mode 100644 util/grub-set-default.8 create mode 100644 util/grub-sparc64-setup.8 +diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist +index 51f08c1f9..e914dfd89 100644 +--- a/conf/Makefile.extra-dist ++++ b/conf/Makefile.extra-dist +@@ -10,7 +10,6 @@ EXTRA_DIST += unicode + EXTRA_DIST += util/import_gcry.py + EXTRA_DIST += util/import_unicode.py + +-EXTRA_DIST += docs/man + EXTRA_DIST += docs/autoiso.cfg + EXTRA_DIST += docs/grub.cfg + EXTRA_DIST += docs/osdetect.cfg diff --git a/configure.ac b/configure.ac -index 8888c2ff29c..2632e2dad9b 100644 +index 8888c2ff2..2632e2dad 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,29 @@ grub_TRANSFORM([grub-set-default]) @@ -154,20 +166,8 @@ index 8888c2ff29c..2632e2dad9b 100644 # Optimization flag. Allow user to override. if test "x$TARGET_CFLAGS" = x; then -diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist -index 51f08c1f901..e914dfd897e 100644 ---- a/conf/Makefile.extra-dist -+++ b/conf/Makefile.extra-dist -@@ -10,7 +10,6 @@ EXTRA_DIST += unicode - EXTRA_DIST += util/import_gcry.py - EXTRA_DIST += util/import_unicode.py - --EXTRA_DIST += docs/man - EXTRA_DIST += docs/autoiso.cfg - EXTRA_DIST += docs/grub.cfg - EXTRA_DIST += docs/osdetect.cfg diff --git a/docs/Makefile.am b/docs/Makefile.am -index 93eb3962765..ab28f199694 100644 +index 93eb39627..ab28f1996 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -5,5 +5,3 @@ info_TEXINFOS = grub.texi grub-dev.texi @@ -178,7 +178,7 @@ index 93eb3962765..ab28f199694 100644 - diff --git a/docs/man/grub-bios-setup.h2m b/docs/man/grub-bios-setup.h2m deleted file mode 100644 -index ac6ede36296..00000000000 +index ac6ede362..000000000 --- a/docs/man/grub-bios-setup.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -190,7 +190,7 @@ index ac6ede36296..00000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-editenv.h2m b/docs/man/grub-editenv.h2m deleted file mode 100644 -index 3859d3d4c4f..00000000000 +index 3859d3d4c..000000000 --- a/docs/man/grub-editenv.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -201,7 +201,7 @@ index 3859d3d4c4f..00000000000 -.BR grub-set-default (8) diff --git a/docs/man/grub-emu.h2m b/docs/man/grub-emu.h2m deleted file mode 100644 -index ef1c000656a..00000000000 +index ef1c00065..000000000 --- a/docs/man/grub-emu.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -213,7 +213,7 @@ index ef1c000656a..00000000000 -rather than this program. diff --git a/docs/man/grub-file.h2m b/docs/man/grub-file.h2m deleted file mode 100644 -index e09bb4d3101..00000000000 +index e09bb4d31..000000000 --- a/docs/man/grub-file.h2m +++ /dev/null @@ -1,2 +0,0 @@ @@ -221,7 +221,7 @@ index e09bb4d3101..00000000000 -grub-file \- check file type diff --git a/docs/man/grub-fstest.h2m b/docs/man/grub-fstest.h2m deleted file mode 100644 -index 9676b159afd..00000000000 +index 9676b159a..000000000 --- a/docs/man/grub-fstest.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -231,7 +231,7 @@ index 9676b159afd..00000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-glue-efi.h2m b/docs/man/grub-glue-efi.h2m deleted file mode 100644 -index c1c6ded49ff..00000000000 +index c1c6ded49..000000000 --- a/docs/man/grub-glue-efi.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -241,7 +241,7 @@ index c1c6ded49ff..00000000000 -grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format. diff --git a/docs/man/grub-install.h2m b/docs/man/grub-install.h2m deleted file mode 100644 -index 8cbbc87a0f2..00000000000 +index 8cbbc87a0..000000000 --- a/docs/man/grub-install.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -253,7 +253,7 @@ index 8cbbc87a0f2..00000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-kbdcomp.h2m b/docs/man/grub-kbdcomp.h2m deleted file mode 100644 -index d81f9157e01..00000000000 +index d81f9157e..000000000 --- a/docs/man/grub-kbdcomp.h2m +++ /dev/null @@ -1,10 +0,0 @@ @@ -269,7 +269,7 @@ index d81f9157e01..00000000000 -.BR grub-mklayout (8) diff --git a/docs/man/grub-macbless.h2m b/docs/man/grub-macbless.h2m deleted file mode 100644 -index 0197c0087d7..00000000000 +index 0197c0087..000000000 --- a/docs/man/grub-macbless.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -279,7 +279,7 @@ index 0197c0087d7..00000000000 -.BR grub-install (1) diff --git a/docs/man/grub-macho2img.h2m b/docs/man/grub-macho2img.h2m deleted file mode 100644 -index d79aaeed8f9..00000000000 +index d79aaeed8..000000000 --- a/docs/man/grub-macho2img.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -289,7 +289,7 @@ index d79aaeed8f9..00000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-menulst2cfg.h2m b/docs/man/grub-menulst2cfg.h2m deleted file mode 100644 -index c2e0055ed7e..00000000000 +index c2e0055ed..000000000 --- a/docs/man/grub-menulst2cfg.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -299,7 +299,7 @@ index c2e0055ed7e..00000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkconfig.h2m b/docs/man/grub-mkconfig.h2m deleted file mode 100644 -index 9b42f813010..00000000000 +index 9b42f8130..000000000 --- a/docs/man/grub-mkconfig.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -309,7 +309,7 @@ index 9b42f813010..00000000000 -.BR grub-install (8) diff --git a/docs/man/grub-mkfont.h2m b/docs/man/grub-mkfont.h2m deleted file mode 100644 -index d46fe600eca..00000000000 +index d46fe600e..000000000 --- a/docs/man/grub-mkfont.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -319,7 +319,7 @@ index d46fe600eca..00000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkimage.h2m b/docs/man/grub-mkimage.h2m deleted file mode 100644 -index f0fbc2bb197..00000000000 +index f0fbc2bb1..000000000 --- a/docs/man/grub-mkimage.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -331,7 +331,7 @@ index f0fbc2bb197..00000000000 -.BR grub-mknetdir (8) diff --git a/docs/man/grub-mklayout.h2m b/docs/man/grub-mklayout.h2m deleted file mode 100644 -index 1e43409c0ab..00000000000 +index 1e43409c0..000000000 --- a/docs/man/grub-mklayout.h2m +++ /dev/null @@ -1,10 +0,0 @@ @@ -347,7 +347,7 @@ index 1e43409c0ab..00000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mknetdir.h2m b/docs/man/grub-mknetdir.h2m deleted file mode 100644 -index a2ef13ec111..00000000000 +index a2ef13ec1..000000000 --- a/docs/man/grub-mknetdir.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -357,7 +357,7 @@ index a2ef13ec111..00000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mkpasswd-pbkdf2.h2m b/docs/man/grub-mkpasswd-pbkdf2.h2m deleted file mode 100644 -index 4d202f3da7e..00000000000 +index 4d202f3da..000000000 --- a/docs/man/grub-mkpasswd-pbkdf2.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -367,7 +367,7 @@ index 4d202f3da7e..00000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-mkrelpath.h2m b/docs/man/grub-mkrelpath.h2m deleted file mode 100644 -index d01f3961e3f..00000000000 +index d01f3961e..000000000 --- a/docs/man/grub-mkrelpath.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -377,7 +377,7 @@ index d01f3961e3f..00000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-mkrescue.h2m b/docs/man/grub-mkrescue.h2m deleted file mode 100644 -index a427f02e3c6..00000000000 +index a427f02e3..000000000 --- a/docs/man/grub-mkrescue.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -387,7 +387,7 @@ index a427f02e3c6..00000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mkstandalone.h2m b/docs/man/grub-mkstandalone.h2m deleted file mode 100644 -index c77313978ad..00000000000 +index c77313978..000000000 --- a/docs/man/grub-mkstandalone.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -397,7 +397,7 @@ index c77313978ad..00000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-mount.h2m b/docs/man/grub-mount.h2m deleted file mode 100644 -index 8d168982d72..00000000000 +index 8d168982d..000000000 --- a/docs/man/grub-mount.h2m +++ /dev/null @@ -1,2 +0,0 @@ @@ -405,7 +405,7 @@ index 8d168982d72..00000000000 -grub-mount \- export GRUB filesystem with FUSE diff --git a/docs/man/grub-ofpathname.h2m b/docs/man/grub-ofpathname.h2m deleted file mode 100644 -index 74b43eea039..00000000000 +index 74b43eea0..000000000 --- a/docs/man/grub-ofpathname.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -415,7 +415,7 @@ index 74b43eea039..00000000000 -.BR grub-probe (8) diff --git a/docs/man/grub-pe2elf.h2m b/docs/man/grub-pe2elf.h2m deleted file mode 100644 -index 7ca29bd703c..00000000000 +index 7ca29bd70..000000000 --- a/docs/man/grub-pe2elf.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -425,7 +425,7 @@ index 7ca29bd703c..00000000000 -.BR grub-mkimage (1) diff --git a/docs/man/grub-probe.h2m b/docs/man/grub-probe.h2m deleted file mode 100644 -index 6e1ffdcf937..00000000000 +index 6e1ffdcf9..000000000 --- a/docs/man/grub-probe.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -435,7 +435,7 @@ index 6e1ffdcf937..00000000000 -.BR grub-fstest (1) diff --git a/docs/man/grub-reboot.h2m b/docs/man/grub-reboot.h2m deleted file mode 100644 -index e4acace65ce..00000000000 +index e4acace65..000000000 --- a/docs/man/grub-reboot.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -446,7 +446,7 @@ index e4acace65ce..00000000000 -.BR grub-editenv (1) diff --git a/docs/man/grub-render-label.h2m b/docs/man/grub-render-label.h2m deleted file mode 100644 -index 50ae5247c05..00000000000 +index 50ae5247c..000000000 --- a/docs/man/grub-render-label.h2m +++ /dev/null @@ -1,3 +0,0 @@ @@ -455,7 +455,7 @@ index 50ae5247c05..00000000000 - diff --git a/docs/man/grub-script-check.h2m b/docs/man/grub-script-check.h2m deleted file mode 100644 -index 3653682671a..00000000000 +index 365368267..000000000 --- a/docs/man/grub-script-check.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -465,7 +465,7 @@ index 3653682671a..00000000000 -.BR grub-mkconfig (8) diff --git a/docs/man/grub-set-default.h2m b/docs/man/grub-set-default.h2m deleted file mode 100644 -index 7945001c154..00000000000 +index 7945001c1..000000000 --- a/docs/man/grub-set-default.h2m +++ /dev/null @@ -1,5 +0,0 @@ @@ -476,7 +476,7 @@ index 7945001c154..00000000000 -.BR grub-editenv (1) diff --git a/docs/man/grub-sparc64-setup.h2m b/docs/man/grub-sparc64-setup.h2m deleted file mode 100644 -index 18f803a50db..00000000000 +index 18f803a50..000000000 --- a/docs/man/grub-sparc64-setup.h2m +++ /dev/null @@ -1,6 +0,0 @@ @@ -488,7 +488,7 @@ index 18f803a50db..00000000000 -.BR grub-mkrescue (1) diff --git a/docs/man/grub-syslinux2cfg.h2m b/docs/man/grub-syslinux2cfg.h2m deleted file mode 100644 -index ad25c8ab753..00000000000 +index ad25c8ab7..000000000 --- a/docs/man/grub-syslinux2cfg.h2m +++ /dev/null @@ -1,4 +0,0 @@ @@ -497,7 +497,7 @@ index ad25c8ab753..00000000000 -[SEE ALSO] -.BR grub-menulst2cfg (8) diff --git a/gentpl.py b/gentpl.py -index bdcae1a1c1b..889cc91d39c 100644 +index bdcae1a1c..889cc91d3 100644 --- a/gentpl.py +++ b/gentpl.py @@ -792,10 +792,7 @@ def manpage(defn, adddeps): @@ -514,7 +514,7 @@ index bdcae1a1c1b..889cc91d39c 100644 diff --git a/util/grub-bios-setup.8 b/util/grub-bios-setup.8 new file mode 100644 -index 00000000000..56f582b3d75 +index 000000000..56f582b3d --- /dev/null +++ b/util/grub-bios-setup.8 @@ -0,0 +1,54 @@ @@ -574,7 +574,7 @@ index 00000000000..56f582b3d75 +.BR "info grub" diff --git a/util/grub-editenv.1 b/util/grub-editenv.1 new file mode 100644 -index 00000000000..8dad33f8db6 +index 000000000..8dad33f8d --- /dev/null +++ b/util/grub-editenv.1 @@ -0,0 +1,46 @@ @@ -626,7 +626,7 @@ index 00000000000..8dad33f8db6 +.BR "info grub" diff --git a/util/grub-file.1 b/util/grub-file.1 new file mode 100644 -index 00000000000..b29cb327889 +index 000000000..b29cb3278 --- /dev/null +++ b/util/grub-file.1 @@ -0,0 +1,165 @@ @@ -797,7 +797,7 @@ index 00000000000..b29cb327889 +.BR "info grub" diff --git a/util/grub-fstest.1 b/util/grub-fstest.1 new file mode 100644 -index 00000000000..792fa78634c +index 000000000..792fa7863 --- /dev/null +++ b/util/grub-fstest.1 @@ -0,0 +1,99 @@ @@ -902,7 +902,7 @@ index 00000000000..792fa78634c +.BR "info grub" diff --git a/util/grub-glue-efi.1 b/util/grub-glue-efi.1 new file mode 100644 -index 00000000000..72bd555d577 +index 000000000..72bd555d5 --- /dev/null +++ b/util/grub-glue-efi.1 @@ -0,0 +1,31 @@ @@ -939,7 +939,7 @@ index 00000000000..72bd555d577 +.BR "info grub" diff --git a/util/grub-install.8 b/util/grub-install.8 new file mode 100644 -index 00000000000..76272a39d2e +index 000000000..76272a39d --- /dev/null +++ b/util/grub-install.8 @@ -0,0 +1,129 @@ @@ -1074,7 +1074,7 @@ index 00000000000..76272a39d2e +.BR "info grub" diff --git a/util/grub-kbdcomp.1 b/util/grub-kbdcomp.1 new file mode 100644 -index 00000000000..0bb969a5b43 +index 000000000..0bb969a5b --- /dev/null +++ b/util/grub-kbdcomp.1 @@ -0,0 +1,19 @@ @@ -1099,7 +1099,7 @@ index 00000000000..0bb969a5b43 +.BR "info grub" diff --git a/util/grub-macbless.1 b/util/grub-macbless.1 new file mode 100644 -index 00000000000..41a96186f70 +index 000000000..41a96186f --- /dev/null +++ b/util/grub-macbless.1 @@ -0,0 +1,22 @@ @@ -1127,7 +1127,7 @@ index 00000000000..41a96186f70 +.BR "info grub" diff --git a/util/grub-menulst2cfg.1 b/util/grub-menulst2cfg.1 new file mode 100644 -index 00000000000..91e2ef87113 +index 000000000..91e2ef871 --- /dev/null +++ b/util/grub-menulst2cfg.1 @@ -0,0 +1,12 @@ @@ -1145,7 +1145,7 @@ index 00000000000..91e2ef87113 +.BR "info grub" diff --git a/util/grub-mkconfig.8 b/util/grub-mkconfig.8 new file mode 100644 -index 00000000000..a2d1f577b9b +index 000000000..a2d1f577b --- /dev/null +++ b/util/grub-mkconfig.8 @@ -0,0 +1,17 @@ @@ -1168,7 +1168,7 @@ index 00000000000..a2d1f577b9b +.BR "info grub" diff --git a/util/grub-mkfont.1 b/util/grub-mkfont.1 new file mode 100644 -index 00000000000..3494857987d +index 000000000..349485798 --- /dev/null +++ b/util/grub-mkfont.1 @@ -0,0 +1,87 @@ @@ -1261,7 +1261,7 @@ index 00000000000..3494857987d +.BR "info grub" diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 new file mode 100644 -index 00000000000..4dea4f54597 +index 000000000..4dea4f545 --- /dev/null +++ b/util/grub-mkimage.1 @@ -0,0 +1,95 @@ @@ -1362,7 +1362,7 @@ index 00000000000..4dea4f54597 +.BR "info grub" diff --git a/util/grub-mklayout.1 b/util/grub-mklayout.1 new file mode 100644 -index 00000000000..d1bbc2ec515 +index 000000000..d1bbc2ec5 --- /dev/null +++ b/util/grub-mklayout.1 @@ -0,0 +1,27 @@ @@ -1395,7 +1395,7 @@ index 00000000000..d1bbc2ec515 +.BR "info grub" diff --git a/util/grub-mknetdir.1 b/util/grub-mknetdir.1 new file mode 100644 -index 00000000000..69c22628f82 +index 000000000..69c22628f --- /dev/null +++ b/util/grub-mknetdir.1 @@ -0,0 +1,12 @@ @@ -1413,7 +1413,7 @@ index 00000000000..69c22628f82 +.BR "info grub" diff --git a/util/grub-mkpasswd-pbkdf2.1 b/util/grub-mkpasswd-pbkdf2.1 new file mode 100644 -index 00000000000..73c437c15d8 +index 000000000..73c437c15 --- /dev/null +++ b/util/grub-mkpasswd-pbkdf2.1 @@ -0,0 +1,27 @@ @@ -1446,7 +1446,7 @@ index 00000000000..73c437c15d8 +.BR "info grub" diff --git a/util/grub-mkrelpath.1 b/util/grub-mkrelpath.1 new file mode 100644 -index 00000000000..85f1113621d +index 000000000..85f111362 --- /dev/null +++ b/util/grub-mkrelpath.1 @@ -0,0 +1,12 @@ @@ -1464,7 +1464,7 @@ index 00000000000..85f1113621d +.BR "info grub" diff --git a/util/grub-mkrescue.1 b/util/grub-mkrescue.1 new file mode 100644 -index 00000000000..4ed9fc723fd +index 000000000..4ed9fc723 --- /dev/null +++ b/util/grub-mkrescue.1 @@ -0,0 +1,123 @@ @@ -1593,7 +1593,7 @@ index 00000000000..4ed9fc723fd +.BR "info grub" diff --git a/util/grub-mkstandalone.1 b/util/grub-mkstandalone.1 new file mode 100644 -index 00000000000..ba2d2bdf279 +index 000000000..ba2d2bdf2 --- /dev/null +++ b/util/grub-mkstandalone.1 @@ -0,0 +1,100 @@ @@ -1699,7 +1699,7 @@ index 00000000000..ba2d2bdf279 +.BR "info grub" diff --git a/util/grub-ofpathname.8 b/util/grub-ofpathname.8 new file mode 100644 -index 00000000000..bf3743aeba1 +index 000000000..bf3743aeb --- /dev/null +++ b/util/grub-ofpathname.8 @@ -0,0 +1,12 @@ @@ -1717,7 +1717,7 @@ index 00000000000..bf3743aeba1 +.BR "info grub" diff --git a/util/grub-probe.8 b/util/grub-probe.8 new file mode 100644 -index 00000000000..04e26c832bb +index 000000000..04e26c832 --- /dev/null +++ b/util/grub-probe.8 @@ -0,0 +1,80 @@ @@ -1803,7 +1803,7 @@ index 00000000000..04e26c832bb +.BR "info grub" diff --git a/util/grub-reboot.8 b/util/grub-reboot.8 new file mode 100644 -index 00000000000..faa5e4eece2 +index 000000000..faa5e4eec --- /dev/null +++ b/util/grub-reboot.8 @@ -0,0 +1,21 @@ @@ -1830,7 +1830,7 @@ index 00000000000..faa5e4eece2 +.BR "info grub" diff --git a/util/grub-render-label.1 b/util/grub-render-label.1 new file mode 100644 -index 00000000000..4d51c8abf01 +index 000000000..4d51c8abf --- /dev/null +++ b/util/grub-render-label.1 @@ -0,0 +1,51 @@ @@ -1887,7 +1887,7 @@ index 00000000000..4d51c8abf01 +.BR "info grub" diff --git a/util/grub-script-check.1 b/util/grub-script-check.1 new file mode 100644 -index 00000000000..0f1f625b05d +index 000000000..0f1f625b0 --- /dev/null +++ b/util/grub-script-check.1 @@ -0,0 +1,21 @@ @@ -1914,7 +1914,7 @@ index 00000000000..0f1f625b05d +.BR "info grub" diff --git a/util/grub-set-default.8 b/util/grub-set-default.8 new file mode 100644 -index 00000000000..a96265a1509 +index 000000000..a96265a15 --- /dev/null +++ b/util/grub-set-default.8 @@ -0,0 +1,21 @@ @@ -1941,7 +1941,7 @@ index 00000000000..a96265a1509 +.BR "info grub" diff --git a/util/grub-sparc64-setup.8 b/util/grub-sparc64-setup.8 new file mode 100644 -index 00000000000..37ea2dd5eaa +index 000000000..37ea2dd5e --- /dev/null +++ b/util/grub-sparc64-setup.8 @@ -0,0 +1,12 @@ @@ -1957,3 +1957,6 @@ index 00000000000..37ea2dd5eaa + +.SH SEE ALSO +.BR "info grub" +-- +2.13.5 + 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 c5899aa..25a62d4 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,8 @@ -From 0000000000000000000000000000000000000000 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] use fw_path prefix when fallback searching for grub config +Subject: [PATCH 131/261] use fw_path prefix when fallback searching for grub + config When PXE booting via UEFI firmware, grub was searching for grub.cfg in the fw_path directory where the grub application was found. If @@ -17,7 +18,7 @@ Signed-off-by: Mark Salter 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index f66c03c4c6e..5e2ac150e12 100644 +index f66c03c4c..5e2ac150e 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -343,7 +343,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -39,3 +40,6 @@ index f66c03c4c6e..5e2ac150e12 100644 if (prefix) { grub_size_t config_len; +-- +2.13.5 + 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 31bd38c..1bf68b9 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,8 @@ -From 0000000000000000000000000000000000000000 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] Try mac/guid/etc before grub.cfg on tftp config files. +Subject: [PATCH 132/261] Try mac/guid/etc before grub.cfg on tftp config + files. Signed-off-by: Peter Jones --- @@ -9,7 +10,7 @@ Signed-off-by: Peter Jones 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 5e2ac150e12..4190985ad37 100644 +index 5e2ac150e..4190985ad 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -341,53 +341,59 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), @@ -59,26 +60,26 @@ index 5e2ac150e12..4190985ad37 100644 + config_len = grub_strlen (prefix) + + sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); + config = grub_malloc (config_len); ++ ++ if (! config) ++ goto quit; - if (! config) - goto quit; -+ if (! config) -+ goto quit; ++ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); - grub_snprintf (config, config_len, "%s/grub.cfg", prefix); -+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix); ++ grub_net_search_configfile (config); - if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0) - grub_net_search_configfile (config); -+ grub_net_search_configfile (config); - -- grub_enter_normal_mode (config); -- grub_free (config); + grub_enter_normal_mode (config); + grub_free (config); + config = NULL; + } -+ + +- grub_enter_normal_mode (config); +- grub_free (config); + if (!config) + { + config = grub_xasprintf ("%s/grub.cfg", prefix); @@ -109,3 +110,6 @@ index 5e2ac150e12..4190985ad37 100644 } else grub_enter_normal_mode (argv[0]); +-- +2.13.5 + diff --git a/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch b/SOURCES/0133-trim-arp-packets-with-abnormal-size.patch index 944050f..c49d038 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 0000000000000000000000000000000000000000 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] trim arp packets with abnormal size +Subject: [PATCH 133/261] 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. @@ -10,7 +10,7 @@ is foobared, GRUB needs to trim the arp response packet before sending it. 1 file changed, 6 insertions(+) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index d62d0cc1e01..77581f4b29a 100644 +index d62d0cc1e..77581f4b2 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -162,6 +162,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, @@ -26,3 +26,6 @@ index d62d0cc1e01..77581f4b29a 100644 grub_net_link_level_address_t target; /* We've already checked that pln is either 4 or 16. */ char tmp[16]; +-- +2.13.5 + 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 d3dc3d3..feb8775 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 0000000000000000000000000000000000000000 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] Fix convert function to support NVMe devices +Subject: [PATCH 134/261] 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 @@ -18,7 +18,7 @@ Signed-off-by: Peter Jones 1 file changed, 19 insertions(+) diff --git a/util/getroot.c b/util/getroot.c -index 3958105d819..e70061099b3 100644 +index 3958105d8..e70061099 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -152,6 +152,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part) @@ -54,3 +54,6 @@ index 3958105d819..e70061099b3 100644 if (grub_util_device_is_mapped_stat (&st)) return grub_util_devmapper_part_to_disk (&st, is_part, os_dev); +-- +2.13.5 + 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 3e50793..54a9803 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 0000000000000000000000000000000000000000 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] Fix bad test on GRUB_DISABLE_SUBMENU. +Subject: [PATCH 135/261] 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 136abd7a6e3..767093c636a 100644 +index 136abd7a6..767093c63 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -255,7 +255,11 @@ while [ "x$list" != "x" ] ; do @@ -36,3 +36,6 @@ index 136abd7a6e3..767093c636a 100644 linux_entry "${OS}" "${version}" simple \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" +-- +2.13.5 + 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 2c2a1c3..685c810 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,8 @@ -From 0000000000000000000000000000000000000000 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] Switch to use APM Mustang device tree, for hardware testing. +Subject: [PATCH 136/261] Switch to use APM Mustang device tree, for hardware + testing. Signed-off-by: David A. Marlin --- @@ -9,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 767093c636a..3722c1ea263 100644 +index 767093c63..3722c1ea2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do @@ -23,3 +24,6 @@ index 767093c636a..3722c1ea263 100644 break fi done +-- +2.13.5 + 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 418a3a6..ce44f80 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,8 @@ -From 0000000000000000000000000000000000000000 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] Use the default device tree from the grub default file +Subject: [PATCH 137/261] Use the default device tree from the grub default + file instead of hardcoding a value. @@ -12,7 +13,7 @@ Signed-off-by: David A. Marlin 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index b00f9e61f40..beb22deee79 100644 +index b00f9e61f..beb22deee 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -224,7 +224,8 @@ export GRUB_DEFAULT \ @@ -26,7 +27,7 @@ index b00f9e61f40..beb22deee79 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 3722c1ea263..8782d8c67cf 100644 +index 3722c1ea2..8782d8c67 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -228,8 +228,8 @@ while [ "x$list" != "x" ] ; do @@ -40,3 +41,6 @@ index 3722c1ea263..8782d8c67cf 100644 break fi done +-- +2.13.5 + 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 09f60d8..a73295f 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,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] reopen SNP protocol for exclusive use by grub +Subject: [PATCH 138/261] reopen SNP protocol for exclusive use by grub --- grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 2b344d6ef78..a6e4c7992f7 100644 +index 2b344d6ef..a6e4c7992 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -223,6 +223,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -41,3 +41,6 @@ index 2b344d6ef78..a6e4c7992f7 100644 return; } } +-- +2.13.5 + diff --git a/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch b/SOURCES/0139-Reduce-timer-event-frequency-by-10.patch index bb614d3..a2a6da9 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 0000000000000000000000000000000000000000 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] Reduce timer event frequency by 10 +Subject: [PATCH 139/261] 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 @@ -14,7 +14,7 @@ Signed-off-by: Mark Salter 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c -index a6ae03475cc..0c17d8390fa 100644 +index a6ae03475..0c17d8390 100644 --- a/grub-core/kern/arm/efi/init.c +++ b/grub-core/kern/arm/efi/init.c @@ -38,7 +38,7 @@ static void @@ -35,3 +35,6 @@ index a6ae03475cc..0c17d8390fa 100644 grub_install_get_time_ms (grub_efi_get_time_ms); } +-- +2.13.5 + diff --git a/SOURCES/0140-always-return-error-to-UEFI.patch b/SOURCES/0140-always-return-error-to-UEFI.patch index 4720fba..576b674 100644 --- a/SOURCES/0140-always-return-error-to-UEFI.patch +++ b/SOURCES/0140-always-return-error-to-UEFI.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 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] always return error to UEFI +Subject: [PATCH 140/261] always return error to UEFI --- grub-core/kern/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index cd839cc988a..1a8dba531b6 100644 +index cd839cc98..1a8dba531 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -158,7 +158,7 @@ grub_exit (void) @@ -20,3 +20,6 @@ index cd839cc988a..1a8dba531b6 100644 for (;;) ; } +-- +2.13.5 + diff --git a/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch b/SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch index 7920668..96de297 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 0000000000000000000000000000000000000000 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] Add powerpc little-endian (ppc64le) flags +Subject: [PATCH 141/261] 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. @@ -14,7 +14,7 @@ the distros that use ppc64el doesn't have 32-bit support on it. 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac -index 2632e2dad9b..53fd7c73ee6 100644 +index 2632e2dad..53fd7c73e 100644 --- a/configure.ac +++ b/configure.ac @@ -142,6 +142,7 @@ if test "x$with_platform" = x; then @@ -77,7 +77,7 @@ index 2632e2dad9b..53fd7c73ee6 100644 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel]) AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips]) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 5c087c83b8f..cb7fd9f98e8 100644 +index 5c087c83b..cb7fd9f98 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -84,8 +84,10 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h @@ -91,3 +91,6 @@ index 5c087c83b8f..cb7fd9f98e8 100644 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h if COND_i386_pc +-- +2.13.5 + 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 05cbdd3..352ae6f 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 0000000000000000000000000000000000000000 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] Files reorganization and include some libgcc fuctions +Subject: [PATCH 142/261] 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. @@ -17,14 +17,14 @@ Also-By: Vladimir 'phcoder' Serbinenko --- grub-core/Makefile.core.def | 1 + grub-core/kern/misc.c | 107 ++++++++++++++++++++++++++++ + grub-core/kern/powerpc/compiler-rt.S | 130 +++++++++++++++++++++++++++++++++++ include/grub/compiler.h | 61 ++++++++++++++++ include/grub/libgcc.h | 67 ------------------ - grub-core/kern/powerpc/compiler-rt.S | 130 +++++++++++++++++++++++++++++++++++ 5 files changed, 299 insertions(+), 67 deletions(-) create mode 100644 grub-core/kern/powerpc/compiler-rt.S diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 7bf1c8a5880..9ff9ae5a311 100644 +index 7bf1c8a58..9ff9ae5a3 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -252,6 +252,7 @@ kernel = { @@ -36,7 +36,7 @@ index 7bf1c8a5880..9ff9ae5a311 100644 sparc64_ieee1275 = kern/sparc64/cache.S; sparc64_ieee1275 = kern/sparc64/dl.c; diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index a56cfe78994..a3e5056db3f 100644 +index a56cfe789..a3e5056db 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1345,3 +1345,110 @@ grub_real_boot_time (const char *file, @@ -150,8 +150,144 @@ index a56cfe78994..a3e5056db3f 100644 +} + +#endif +diff --git a/grub-core/kern/powerpc/compiler-rt.S b/grub-core/kern/powerpc/compiler-rt.S +new file mode 100644 +index 000000000..63e3a0d4e +--- /dev/null ++++ b/grub-core/kern/powerpc/compiler-rt.S +@@ -0,0 +1,130 @@ ++/* ++ * Special support for eabi and SVR4 ++ * ++ * Copyright (C) 1995-2014 Free Software Foundation, Inc. ++ * Written By Michael Meissner ++ * 64-bit support written by David Edelsohn ++ * ++ * This file 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 file 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. ++ * ++ * Under Section 7 of GPL version 3, you are granted additional ++ * permissions described in the GCC Runtime Library Exception, version ++ * 3.1, as published by the Free Software Foundation. ++ * ++ * You should have received a copy of the GNU General Public License and ++ * a copy of the GCC Runtime Library Exception along with this program; ++ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++ * . ++ */ ++ ++/* Do any initializations needed for the eabi environment */ ++ ++#include ++#include ++ ++ .section ".text" ++ ++#define CFI_RESTORE(reg) .cfi_restore reg ++#define CFI_OFFSET(reg, off) .cfi_offset reg, off ++#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg ++#define CFI_STARTPROC .cfi_startproc ++#define CFI_ENDPROC .cfi_endproc ++ ++/* Routines for restoring integer registers, called by the compiler. */ ++/* Called with r11 pointing to the stack header word of the caller of the */ ++/* function, just beyond the end of the integer restore area. */ ++ ++CFI_STARTPROC ++CFI_DEF_CFA_REGISTER (11) ++CFI_OFFSET (65, 4) ++CFI_OFFSET (14, -72) ++CFI_OFFSET (15, -68) ++CFI_OFFSET (16, -64) ++CFI_OFFSET (17, -60) ++CFI_OFFSET (18, -56) ++CFI_OFFSET (19, -52) ++CFI_OFFSET (20, -48) ++CFI_OFFSET (21, -44) ++CFI_OFFSET (22, -40) ++CFI_OFFSET (23, -36) ++CFI_OFFSET (24, -32) ++CFI_OFFSET (25, -28) ++CFI_OFFSET (26, -24) ++CFI_OFFSET (27, -20) ++CFI_OFFSET (28, -16) ++CFI_OFFSET (29, -12) ++CFI_OFFSET (30, -8) ++CFI_OFFSET (31, -4) ++FUNCTION(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */ ++CFI_RESTORE (14) ++FUNCTION(_restgpr_15_x) lwz 15,-68(11) ++CFI_RESTORE (15) ++FUNCTION(_restgpr_16_x) lwz 16,-64(11) ++CFI_RESTORE (16) ++FUNCTION(_restgpr_17_x) lwz 17,-60(11) ++CFI_RESTORE (17) ++FUNCTION(_restgpr_18_x) lwz 18,-56(11) ++CFI_RESTORE (18) ++FUNCTION(_restgpr_19_x) lwz 19,-52(11) ++CFI_RESTORE (19) ++FUNCTION(_restgpr_20_x) lwz 20,-48(11) ++CFI_RESTORE (20) ++FUNCTION(_restgpr_21_x) lwz 21,-44(11) ++CFI_RESTORE (21) ++FUNCTION(_restgpr_22_x) lwz 22,-40(11) ++CFI_RESTORE (22) ++FUNCTION(_restgpr_23_x) lwz 23,-36(11) ++CFI_RESTORE (23) ++FUNCTION(_restgpr_24_x) lwz 24,-32(11) ++CFI_RESTORE (24) ++FUNCTION(_restgpr_25_x) lwz 25,-28(11) ++CFI_RESTORE (25) ++FUNCTION(_restgpr_26_x) lwz 26,-24(11) ++CFI_RESTORE (26) ++FUNCTION(_restgpr_27_x) lwz 27,-20(11) ++CFI_RESTORE (27) ++FUNCTION(_restgpr_28_x) lwz 28,-16(11) ++CFI_RESTORE (28) ++FUNCTION(_restgpr_29_x) lwz 29,-12(11) ++CFI_RESTORE (29) ++FUNCTION(_restgpr_30_x) lwz 30,-8(11) ++CFI_RESTORE (30) ++FUNCTION(_restgpr_31_x) lwz 0,4(11) ++ lwz 31,-4(11) ++CFI_RESTORE (31) ++ mtlr 0 ++CFI_RESTORE (65) ++ mr 1,11 ++CFI_DEF_CFA_REGISTER (1) ++ blr ++CFI_ENDPROC ++ ++CFI_STARTPROC ++FUNCTION(_savegpr_14) stw 14,-72(11) /* save gp registers */ ++FUNCTION(_savegpr_15) stw 15,-68(11) ++FUNCTION(_savegpr_16) stw 16,-64(11) ++FUNCTION(_savegpr_17) stw 17,-60(11) ++FUNCTION(_savegpr_18) stw 18,-56(11) ++FUNCTION(_savegpr_19) stw 19,-52(11) ++FUNCTION(_savegpr_20) stw 20,-48(11) ++FUNCTION(_savegpr_21) stw 21,-44(11) ++FUNCTION(_savegpr_22) stw 22,-40(11) ++FUNCTION(_savegpr_23) stw 23,-36(11) ++FUNCTION(_savegpr_24) stw 24,-32(11) ++FUNCTION(_savegpr_25) stw 25,-28(11) ++FUNCTION(_savegpr_26) stw 26,-24(11) ++FUNCTION(_savegpr_27) stw 27,-20(11) ++FUNCTION(_savegpr_28) stw 28,-16(11) ++FUNCTION(_savegpr_29) stw 29,-12(11) ++FUNCTION(_savegpr_30) stw 30,-8(11) ++FUNCTION(_savegpr_31) stw 31,-4(11) ++ blr ++CFI_ENDPROC diff --git a/include/grub/compiler.h b/include/grub/compiler.h -index c9e1d7a73dc..a9a684ccba6 100644 +index c9e1d7a73..a9a684ccb 100644 --- a/include/grub/compiler.h +++ b/include/grub/compiler.h @@ -48,4 +48,65 @@ @@ -221,7 +357,7 @@ index c9e1d7a73dc..a9a684ccba6 100644 + #endif /* ! GRUB_COMPILER_HEADER */ diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h -index 8e93b6792d9..5bdb8fb5cb9 100644 +index 8e93b6792..5bdb8fb5c 100644 --- a/include/grub/libgcc.h +++ b/include/grub/libgcc.h @@ -16,73 +16,6 @@ @@ -298,139 +434,6 @@ index 8e93b6792d9..5bdb8fb5cb9 100644 #if defined (__arm__) void EXPORT_FUNC (__aeabi_lasr) (void); void EXPORT_FUNC (__aeabi_llsl) (void); -diff --git a/grub-core/kern/powerpc/compiler-rt.S b/grub-core/kern/powerpc/compiler-rt.S -new file mode 100644 -index 00000000000..63e3a0d4e89 ---- /dev/null -+++ b/grub-core/kern/powerpc/compiler-rt.S -@@ -0,0 +1,130 @@ -+/* -+ * Special support for eabi and SVR4 -+ * -+ * Copyright (C) 1995-2014 Free Software Foundation, Inc. -+ * Written By Michael Meissner -+ * 64-bit support written by David Edelsohn -+ * -+ * This file 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 file 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. -+ * -+ * Under Section 7 of GPL version 3, you are granted additional -+ * permissions described in the GCC Runtime Library Exception, version -+ * 3.1, as published by the Free Software Foundation. -+ * -+ * You should have received a copy of the GNU General Public License and -+ * a copy of the GCC Runtime Library Exception along with this program; -+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -+ * . -+ */ -+ -+/* Do any initializations needed for the eabi environment */ -+ -+#include -+#include -+ -+ .section ".text" -+ -+#define CFI_RESTORE(reg) .cfi_restore reg -+#define CFI_OFFSET(reg, off) .cfi_offset reg, off -+#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg -+#define CFI_STARTPROC .cfi_startproc -+#define CFI_ENDPROC .cfi_endproc -+ -+/* Routines for restoring integer registers, called by the compiler. */ -+/* Called with r11 pointing to the stack header word of the caller of the */ -+/* function, just beyond the end of the integer restore area. */ -+ -+CFI_STARTPROC -+CFI_DEF_CFA_REGISTER (11) -+CFI_OFFSET (65, 4) -+CFI_OFFSET (14, -72) -+CFI_OFFSET (15, -68) -+CFI_OFFSET (16, -64) -+CFI_OFFSET (17, -60) -+CFI_OFFSET (18, -56) -+CFI_OFFSET (19, -52) -+CFI_OFFSET (20, -48) -+CFI_OFFSET (21, -44) -+CFI_OFFSET (22, -40) -+CFI_OFFSET (23, -36) -+CFI_OFFSET (24, -32) -+CFI_OFFSET (25, -28) -+CFI_OFFSET (26, -24) -+CFI_OFFSET (27, -20) -+CFI_OFFSET (28, -16) -+CFI_OFFSET (29, -12) -+CFI_OFFSET (30, -8) -+CFI_OFFSET (31, -4) -+FUNCTION(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */ -+CFI_RESTORE (14) -+FUNCTION(_restgpr_15_x) lwz 15,-68(11) -+CFI_RESTORE (15) -+FUNCTION(_restgpr_16_x) lwz 16,-64(11) -+CFI_RESTORE (16) -+FUNCTION(_restgpr_17_x) lwz 17,-60(11) -+CFI_RESTORE (17) -+FUNCTION(_restgpr_18_x) lwz 18,-56(11) -+CFI_RESTORE (18) -+FUNCTION(_restgpr_19_x) lwz 19,-52(11) -+CFI_RESTORE (19) -+FUNCTION(_restgpr_20_x) lwz 20,-48(11) -+CFI_RESTORE (20) -+FUNCTION(_restgpr_21_x) lwz 21,-44(11) -+CFI_RESTORE (21) -+FUNCTION(_restgpr_22_x) lwz 22,-40(11) -+CFI_RESTORE (22) -+FUNCTION(_restgpr_23_x) lwz 23,-36(11) -+CFI_RESTORE (23) -+FUNCTION(_restgpr_24_x) lwz 24,-32(11) -+CFI_RESTORE (24) -+FUNCTION(_restgpr_25_x) lwz 25,-28(11) -+CFI_RESTORE (25) -+FUNCTION(_restgpr_26_x) lwz 26,-24(11) -+CFI_RESTORE (26) -+FUNCTION(_restgpr_27_x) lwz 27,-20(11) -+CFI_RESTORE (27) -+FUNCTION(_restgpr_28_x) lwz 28,-16(11) -+CFI_RESTORE (28) -+FUNCTION(_restgpr_29_x) lwz 29,-12(11) -+CFI_RESTORE (29) -+FUNCTION(_restgpr_30_x) lwz 30,-8(11) -+CFI_RESTORE (30) -+FUNCTION(_restgpr_31_x) lwz 0,4(11) -+ lwz 31,-4(11) -+CFI_RESTORE (31) -+ mtlr 0 -+CFI_RESTORE (65) -+ mr 1,11 -+CFI_DEF_CFA_REGISTER (1) -+ blr -+CFI_ENDPROC -+ -+CFI_STARTPROC -+FUNCTION(_savegpr_14) stw 14,-72(11) /* save gp registers */ -+FUNCTION(_savegpr_15) stw 15,-68(11) -+FUNCTION(_savegpr_16) stw 16,-64(11) -+FUNCTION(_savegpr_17) stw 17,-60(11) -+FUNCTION(_savegpr_18) stw 18,-56(11) -+FUNCTION(_savegpr_19) stw 19,-52(11) -+FUNCTION(_savegpr_20) stw 20,-48(11) -+FUNCTION(_savegpr_21) stw 21,-44(11) -+FUNCTION(_savegpr_22) stw 22,-40(11) -+FUNCTION(_savegpr_23) stw 23,-36(11) -+FUNCTION(_savegpr_24) stw 24,-32(11) -+FUNCTION(_savegpr_25) stw 25,-28(11) -+FUNCTION(_savegpr_26) stw 26,-24(11) -+FUNCTION(_savegpr_27) stw 27,-20(11) -+FUNCTION(_savegpr_28) stw 28,-16(11) -+FUNCTION(_savegpr_29) stw 29,-12(11) -+FUNCTION(_savegpr_30) stw 30,-8(11) -+FUNCTION(_savegpr_31) stw 31,-4(11) -+ blr -+CFI_ENDPROC +-- +2.13.5 + 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 e7089ab..54537a9 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 0000000000000000000000000000000000000000 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] Suport for bi-endianess in elf file +Subject: [PATCH 143/261] Suport for bi-endianess in elf file * grub-core/kern/elf.c: check and switch endianess with grub_{be,le}_to cpu functions. @@ -14,7 +14,7 @@ Also-by: Tomohiro B Berry 2 files changed, 131 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/elf.c b/grub-core/kern/elf.c -index 5f99c43cc81..de9081180f0 100644 +index 5f99c43cc..de9081180 100644 --- a/grub-core/kern/elf.c +++ b/grub-core/kern/elf.c @@ -28,6 +28,11 @@ @@ -117,7 +117,7 @@ index 5f99c43cc81..de9081180f0 100644 #include "elfXX.c" diff --git a/grub-core/kern/elfXX.c b/grub-core/kern/elfXX.c -index 1d0997186f7..ecf9df63a5e 100644 +index 1d0997186..ecf9df63a 100644 --- a/grub-core/kern/elfXX.c +++ b/grub-core/kern/elfXX.c @@ -154,3 +154,76 @@ grub_elfXX_load (grub_elf_t elf, const char *filename, @@ -197,3 +197,6 @@ index 1d0997186f7..ecf9df63a5e 100644 + + return GRUB_ERR_NONE; +} +-- +2.13.5 + diff --git a/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch b/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch index 5478dd2..85dd40d 100644 --- a/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch +++ b/SOURCES/0144-Fix-exit-back-to-EFI-firmware.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From d4c213d4c71336cefdc0419de510ac19665b5d32 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 +Subject: [PATCH 144/261] 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() @@ -14,7 +14,7 @@ well as make the call to grub_efi_fini(). 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 0c17d8390fa..06df60e2f0e 100644 +index 0c17d8390..06df60e2f 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) @@ -27,7 +27,7 @@ index 0c17d8390fa..06df60e2f0e 100644 grub_efi_fini (); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 1a8dba531b6..d99a6fbdf0d 100644 +index 1a8dba531..d99a6fbdf 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -27,6 +27,7 @@ @@ -47,3 +47,6 @@ index 1a8dba531b6..d99a6fbdf0d 100644 efi_call_4 (grub_efi_system_table->boot_services->exit, grub_efi_image_handle, GRUB_EFI_LOAD_ERROR, 0, 0); for (;;) ; +-- +2.13.5 + diff --git a/SOURCES/0145-Add-grub_util_readlink.patch b/SOURCES/0145-Add-grub_util_readlink.patch index 122f799..323f88f 100644 --- a/SOURCES/0145-Add-grub_util_readlink.patch +++ b/SOURCES/0145-Add-grub_util_readlink.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 70ab42b16aa19b381262dc7a75a045d5ef6b2495 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:01:03 -0400 -Subject: [PATCH] Add grub_util_readlink() +Subject: [PATCH 145/261] 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 @@ -10,20 +10,20 @@ 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/osdep/windows/hostdisk.c | 6 + - grub-core/gnulib/pathmax.h | 83 ++++ 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 + - grub-core/gnulib/Makefile.am | 177 +++++++- m4/gettimeofday.m4 | 138 +++++++ m4/gnulib-cache.m4 | 3 +- m4/gnulib-comp.m4 | 49 +++ @@ -36,9 +36,9 @@ Reviewed-by: Adam Jackson 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/pathmax.h 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 @@ -52,9 +52,239 @@ Reviewed-by: Adam Jackson 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 3444397fe..b7c5e60e1 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 00000000000..8b2058e8c87 +index 000000000..8b2058e8c --- /dev/null +++ b/grub-core/gnulib/gettimeofday.c @@ -0,0 +1,154 @@ @@ -212,9 +442,98 @@ index 00000000000..8b2058e8c87 + +#endif +} +diff --git a/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h +new file mode 100644 +index 000000000..33fc3553d +--- /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 00000000000..4c496395176 +index 000000000..4c4963951 --- /dev/null +++ b/grub-core/gnulib/readlink.c @@ -0,0 +1,74 @@ @@ -294,7 +613,7 @@ index 00000000000..4c496395176 +#endif /* HAVE_READLINK */ diff --git a/grub-core/gnulib/stat.c b/grub-core/gnulib/stat.c new file mode 100644 -index 00000000000..35f4b0b1a51 +index 000000000..35f4b0b1a --- /dev/null +++ b/grub-core/gnulib/stat.c @@ -0,0 +1,138 @@ @@ -426,125 +745,19 @@ index 00000000000..35f4b0b1a51 + 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/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c -index d390b25fcbe..9127e9263b1 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/grub-core/gnulib/pathmax.h b/grub-core/gnulib/pathmax.h -new file mode 100644 -index 00000000000..33fc3553d75 ---- /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 */ ++ 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 00000000000..b47a7ff0ae7 +index 000000000..b47a7ff0a --- /dev/null +++ b/grub-core/gnulib/sys_stat.in.h @@ -0,0 +1,732 @@ @@ -1282,7 +1495,7 @@ index 00000000000..b47a7ff0ae7 +#endif diff --git a/grub-core/gnulib/sys_time.in.h b/grub-core/gnulib/sys_time.in.h new file mode 100644 -index 00000000000..30057ad49fd +index 000000000..30057ad49 --- /dev/null +++ b/grub-core/gnulib/sys_time.in.h @@ -0,0 +1,213 @@ @@ -1500,7 +1713,7 @@ index 00000000000..30057ad49fd +#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 d7da35623b1..9520c09030c 100644 +index d7da35623..9520c0903 100644 --- a/grub-core/gnulib/sys_types.in.h +++ b/grub-core/gnulib/sys_types.in.h @@ -23,7 +23,9 @@ @@ -1515,7 +1728,7 @@ index d7da35623b1..9520c09030c 100644 #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 00000000000..b9203d5569a +index 000000000..b9203d556 --- /dev/null +++ b/grub-core/gnulib/time.h @@ -0,0 +1,586 @@ @@ -2107,7 +2320,7 @@ index 00000000000..b9203d5569a +#endif diff --git a/grub-core/gnulib/time.in.h b/grub-core/gnulib/time.in.h new file mode 100644 -index 00000000000..81abdf46e0b +index 000000000..81abdf46e --- /dev/null +++ b/grub-core/gnulib/time.in.h @@ -0,0 +1,274 @@ @@ -2385,8 +2598,25 @@ index 00000000000..81abdf46e0b +# endif + +#endif +diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c +index d390b25fc..9127e9263 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 a059c0fa40a..161fbb7bdfd 100644 +index a059c0fa4..161fbb7bd 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) @@ -2403,7 +2633,7 @@ index a059c0fa40a..161fbb7bdfd 100644 struct grub_util_fd diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/hostfile_unix.h -index 9ffe46fa3ca..17cd3aa8b30 100644 +index 9ffe46fa3..17cd3aa8b 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) @@ -2420,7 +2650,7 @@ index 9ffe46fa3ca..17cd3aa8b30 100644 #if defined (__NetBSD__) diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h -index bf6451b6db4..8c92d0591bb 100644 +index bf6451b6d..8c92d0591 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; @@ -2432,239 +2662,9 @@ index bf6451b6db4..8c92d0591bb 100644 int grub_util_unlink (const char *name); void -diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am -index 3444397fe37..b7c5e60e1c3 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/m4/gettimeofday.m4 b/m4/gettimeofday.m4 new file mode 100644 -index 00000000000..1c2d66ee261 +index 000000000..1c2d66ee2 --- /dev/null +++ b/m4/gettimeofday.m4 @@ -0,0 +1,138 @@ @@ -2807,7 +2807,7 @@ index 00000000000..1c2d66ee261 + AC_CHECK_FUNCS([_ftime]) +]) diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 -index 408918440b6..ef2ec5bcce0 100644 +index 408918440..ef2ec5bcc 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ @@ -2828,7 +2828,7 @@ index 408918440b6..ef2ec5bcce0 100644 ]) gl_AVOID([]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 -index 7a19f60d85e..66fd0eda901 100644 +index 7a19f60d8..66fd0eda9 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -60,10 +60,13 @@ AC_DEFUN([gl_EARLY], @@ -3035,7 +3035,7 @@ index 7a19f60d85e..66fd0eda901 100644 m4/vasnprintf.m4 diff --git a/m4/largefile.m4 b/m4/largefile.m4 new file mode 100644 -index 00000000000..a1b564ad9af +index 000000000..a1b564ad9 --- /dev/null +++ b/m4/largefile.m4 @@ -0,0 +1,146 @@ @@ -3187,7 +3187,7 @@ index 00000000000..a1b564ad9af +]) diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 new file mode 100644 -index 00000000000..114f91f04b5 +index 000000000..114f91f04 --- /dev/null +++ b/m4/pathmax.m4 @@ -0,0 +1,42 @@ @@ -3235,7 +3235,7 @@ index 00000000000..114f91f04b5 +]) diff --git a/m4/readlink.m4 b/m4/readlink.m4 new file mode 100644 -index 00000000000..f9ce868c2e4 +index 000000000..f9ce868c2 --- /dev/null +++ b/m4/readlink.m4 @@ -0,0 +1,71 @@ @@ -3312,7 +3312,7 @@ index 00000000000..f9ce868c2e4 +]) diff --git a/m4/stat.m4 b/m4/stat.m4 new file mode 100644 -index 00000000000..1ae327b3684 +index 000000000..1ae327b36 --- /dev/null +++ b/m4/stat.m4 @@ -0,0 +1,71 @@ @@ -3389,7 +3389,7 @@ index 00000000000..1ae327b3684 +AC_DEFUN([gl_PREREQ_STAT], [:]) diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 new file mode 100644 -index 00000000000..eaa7642ba31 +index 000000000..eaa7642ba --- /dev/null +++ b/m4/sys_stat_h.m4 @@ -0,0 +1,96 @@ @@ -3491,7 +3491,7 @@ index 00000000000..eaa7642ba31 +]) diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 new file mode 100644 -index 00000000000..5c79300f8ec +index 000000000..5c79300f8 --- /dev/null +++ b/m4/sys_time_h.m4 @@ -0,0 +1,110 @@ @@ -3607,7 +3607,7 @@ index 00000000000..5c79300f8ec +]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 new file mode 100644 -index 00000000000..9852778f9a5 +index 000000000..9852778f9 --- /dev/null +++ b/m4/time_h.m4 @@ -0,0 +1,118 @@ @@ -3729,3 +3729,6 @@ index 00000000000..9852778f9a5 + REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) + REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) +]) +-- +2.13.5 + 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 index a76154a..5cec7c0 100644 --- a/SOURCES/0146-Make-editenv-chase-symlinks-including-those-across-d.patch +++ b/SOURCES/0146-Make-editenv-chase-symlinks-including-those-across-d.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 1c5b023056beece6e9eec0270212b88a62d28057 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 3 Sep 2014 10:38:00 -0400 -Subject: [PATCH] Make editenv chase symlinks including those across devices. +Subject: [PATCH 146/261] 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, @@ -16,7 +17,7 @@ Reviewed-by: Adam Jackson 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Makefile.util.def b/Makefile.util.def -index 8f40e78332a..87029a10dfb 100644 +index 8f40e7833..87029a10d 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -228,8 +228,17 @@ program = { @@ -38,7 +39,7 @@ index 8f40e78332a..87029a10dfb 100644 ldadd = libgrubgcry.a; ldadd = libgrubkern.a; diff --git a/util/editenv.c b/util/editenv.c -index c6f8d2298c3..d8d1dad6ab9 100644 +index c6f8d2298..d8d1dad6a 100644 --- a/util/editenv.c +++ b/util/editenv.c @@ -37,6 +37,7 @@ grub_util_create_envblk_file (const char *name) @@ -100,3 +101,6 @@ index c6f8d2298c3..d8d1dad6ab9 100644 free (namenew); + free (rename_target); } +-- +2.13.5 + 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 index e30aa62..b6ff25e 100644 --- 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 @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From c34b472bcc4b11f00a6cf699016aeec464a77d1d 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 +Subject: [PATCH 147/261] 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. @@ -14,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 8782d8c67cf..e8088a18160 100644 +index 8782d8c67..e8088a181 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@" @@ -27,3 +28,6 @@ index 8782d8c67cf..e8088a18160 100644 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.13.5 + 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 index 717af81..7753eb5 100644 --- 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 @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6fdf50141a37a6af9df041daf577f6dca2479155 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. +Subject: [PATCH 148/261] Minimize the sort ordering for .debug and -rescue- + kernels. Resolves: rhbz#1065360 Signed-off-by: Peter Jones @@ -10,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 8 insertions(+) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 14fadbcbbbd..7ac0bbed0d3 100644 +index 14fadbcbb..7ac0bbed0 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -248,6 +248,14 @@ version_test_gt () @@ -28,3 +29,6 @@ index 14fadbcbbbd..7ac0bbed0d3 100644 esac version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b" return "$?" +-- +2.13.5 + diff --git a/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch b/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch index 7804329..671b2a1 100644 --- a/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch +++ b/SOURCES/0149-Add-GRUB_DISABLE_UUID.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6d6f8893adbe2b61ef2cc47980a3b34298bb600c 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. +Subject: [PATCH 149/261] 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 @@ -18,7 +18,7 @@ Signed-off-by: Peter Jones 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi -index 46b9e7f8e31..6b112c18804 100644 +index 46b9e7f8e..6b112c188 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1409,6 +1409,13 @@ disable the use of UUIDs, set this option to @samp{true}. @@ -36,7 +36,7 @@ index 46b9e7f8e31..6b112c18804 100644 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 beb22deee79..bc26e7c109e 100644 +index beb22deee..bc26e7c10 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -130,11 +130,11 @@ fi @@ -76,7 +76,7 @@ index beb22deee79..bc26e7c109e 100644 GRUB_GFXMODE \ GRUB_BACKGROUND \ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 7ac0bbed0d3..5c9ed84a5e7 100644 +index 7ac0bbed0..5c9ed84a5 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -156,7 +156,7 @@ prepare_grub_to_access_device () @@ -97,3 +97,6 @@ index 7ac0bbed0d3..5c9ed84a5e7 100644 echo "$fs_uuid"; else echo $device |sed 's, ,_,g' +-- +2.13.5 + 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 index be4c654..1db6a1d 100644 --- 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 @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 15e18b7beca626007718183d25c626272f689a5c 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. +Subject: [PATCH 150/261] Allow "fallback" to include entries by title, not + just number. Resolves: rhbz#1026084 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c -index cc27c370776..a446d9ae746 100644 +index cc27c3707..a446d9ae7 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -163,12 +163,35 @@ grub_menu_set_timeout (int timeout) @@ -126,3 +126,6 @@ index cc27c370776..a446d9ae746 100644 /* Get the entry number from the variable NAME. */ static int get_entry_number (grub_menu_t menu, const char *name) +-- +2.13.5 + 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 index da73645..bdd83e4 100644 --- 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 @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 22107f5857dd95a55f14fbdf8a78c6b26e9a134e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 17 Sep 2014 15:13:14 -0500 -Subject: [PATCH] Initialized initrd_ctx so we don't free a random pointer from - the stack. +Subject: [PATCH 151/261] 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 @@ -26,7 +26,7 @@ Signed-off-by: Peter Jones 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c -index e6770d96d29..62cbe75d34e 100644 +index e6770d96d..62cbe75d3 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)), @@ -39,7 +39,7 @@ index e6770d96d29..62cbe75d34e 100644 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 f1d10a16492..0dc144e5da0 100644 +index f1d10a164..0dc144e5d 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -328,7 +328,7 @@ static grub_err_t @@ -52,7 +52,7 @@ index f1d10a16492..0dc144e5da0 100644 void *initrd_mem = NULL; diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 31fb91e2c73..2ae176315b6 100644 +index 31fb91e2c..2ae176315 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)), @@ -65,7 +65,7 @@ index 31fb91e2c73..2ae176315b6 100644 if (argc == 0) { diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 672c013e74d..b481e466846 100644 +index 672c013e7..b481e4668 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)), @@ -78,7 +78,7 @@ index 672c013e74d..b481e466846 100644 if (argc == 0) { diff --git a/grub-core/loader/ia64/efi/linux.c b/grub-core/loader/ia64/efi/linux.c -index 87ac49f8c3b..eb78e6e626b 100644 +index 87ac49f8c..eb78e6e62 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 @@ -91,7 +91,7 @@ index 87ac49f8c3b..eb78e6e626b 100644 if (argc == 0) { diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c -index ef64a5b1d36..4a3e8c5dfa2 100644 +index ef64a5b1d..4a3e8c5df 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)), @@ -104,7 +104,7 @@ index ef64a5b1d36..4a3e8c5dfa2 100644 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 4a14f66dee5..787d7dc2af3 100644 +index 4a14f66de..787d7dc2a 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)), @@ -117,7 +117,7 @@ index 4a14f66dee5..787d7dc2af3 100644 if (argc == 0) { diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c -index de6ee2f75ed..c5e8dfab234 100644 +index de6ee2f75..c5e8dfab2 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)), @@ -129,3 +129,6 @@ index de6ee2f75ed..c5e8dfab234 100644 if (argc == 0) { +-- +2.13.5 + diff --git a/SOURCES/0152-Load-arm-with-SB-enabled.patch b/SOURCES/0152-Load-arm-with-SB-enabled.patch index cc0fa4c..f679a2c 100644 --- a/SOURCES/0152-Load-arm-with-SB-enabled.patch +++ b/SOURCES/0152-Load-arm-with-SB-enabled.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0c0ca3a51e6edda6900a3f812c3a442a57b9c8d1 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. +Subject: [PATCH 152/261] 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.) @@ -21,7 +21,7 @@ is enabled. create mode 100644 include/grub/efi/linux.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 9ff9ae5a311..9378c732981 100644 +index 9ff9ae5a3..9378c7329 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1682,6 +1682,7 @@ module = { @@ -41,7 +41,7 @@ index 9ff9ae5a311..9378c732981 100644 enable = x86_64_efi; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 0dc144e5da0..bdd9c9b4968 100644 +index 0dc144e5d..bdd9c9b49 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -27,6 +27,7 @@ @@ -234,7 +234,7 @@ index 0dc144e5da0..bdd9c9b4968 100644 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 00000000000..aea378adf5c +index 000000000..aea378adf --- /dev/null +++ b/grub-core/loader/efi/linux.c @@ -0,0 +1,65 @@ @@ -304,7 +304,7 @@ index 00000000000..aea378adf5c + return GRUB_ERR_BUG; +} diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index b79e6320ba9..e5b778577f9 100644 +index b79e6320b..e5b778577 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -26,6 +26,7 @@ @@ -371,7 +371,7 @@ index b79e6320ba9..e5b778577f9 100644 static grub_err_t diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index 864e5dc363a..2cbd64f8c55 100644 +index 864e5dc36..2cbd64f8c 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -20,6 +20,7 @@ @@ -396,7 +396,7 @@ index 864e5dc363a..2cbd64f8c55 100644 #endif /* ! GRUB_LINUX_CPU_HEADER */ diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h new file mode 100644 -index 00000000000..d9ede36773b +index 000000000..d9ede3677 --- /dev/null +++ b/include/grub/efi/linux.h @@ -0,0 +1,31 @@ @@ -431,3 +431,6 @@ index 00000000000..d9ede36773b + void *kernel_param); + +#endif /* ! GRUB_EFI_LINUX_HEADER */ +-- +2.13.5 + diff --git a/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch b/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch index 258a63f..89e86a9 100644 --- a/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch +++ b/SOURCES/0153-Fix-up-some-man-pages-rpmdiff-noticed.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From b1c4268fc7b10a8febe2800256b6a6cbc1caf437 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. +Subject: [PATCH 153/261] Fix up some man pages rpmdiff noticed. --- configure.ac | 2 ++ @@ -13,7 +13,7 @@ Subject: [PATCH] Fix up some man pages rpmdiff noticed. create mode 100644 util/grub-syslinux2cfg.1 diff --git a/configure.ac b/configure.ac -index 53fd7c73ee6..048ce7c89fa 100644 +index 53fd7c73e..048ce7c89 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,7 @@ grub_TRANSFORM([grub-fstest.3]) @@ -34,7 +34,7 @@ index 53fd7c73ee6..048ce7c89fa 100644 if test "x$TARGET_CFLAGS" = x; then diff --git a/util/grub-macbless.8 b/util/grub-macbless.8 new file mode 100644 -index 00000000000..ae842f3a606 +index 000000000..ae842f3a6 --- /dev/null +++ b/util/grub-macbless.8 @@ -0,0 +1,26 @@ @@ -65,7 +65,7 @@ index 00000000000..ae842f3a606 +.SH SEE ALSO +.BR "info grub" diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1 -index 4dea4f54597..0eaaafe505b 100644 +index 4dea4f545..0eaaafe50 100644 --- a/util/grub-mkimage.1 +++ b/util/grub-mkimage.1 @@ -17,7 +17,7 @@ @@ -79,7 +79,7 @@ index 4dea4f54597..0eaaafe505b 100644 .TP diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1 new file mode 100644 -index 00000000000..85309482718 +index 000000000..853094827 --- /dev/null +++ b/util/grub-syslinux2cfg.1 @@ -0,0 +1,65 @@ @@ -148,3 +148,6 @@ index 00000000000..85309482718 + +.SH SEE ALSO +.BR "info grub" +-- +2.13.5 + 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 index 5a99a8e..632e3b2 100644 --- a/SOURCES/0154-Try-prefix-if-fw_path-doesn-t-work.patch +++ b/SOURCES/0154-Try-prefix-if-fw_path-doesn-t-work.patch @@ -1,19 +1,19 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6d94c560ac4fa7bf0b8db3a37b414cc188fe4376 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. +Subject: [PATCH 154/261] Try $prefix if $fw_path doesn't work. Related: rhbz#1148652 Signed-off-by: Peter Jones --- - grub-core/kern/ieee1275/init.c | 28 +++++----- + grub-core/kern/ieee1275/init.c | 30 ++++++----- grub-core/net/net.c | 2 +- - grub-core/normal/main.c | 120 ++++++++++++++++++++--------------------- + 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 8191f8cd658..8ca4bf79f09 100644 +index 8191f8cd6..8ca4bf79f 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) @@ -35,10 +35,11 @@ index 8191f8cd658..8ca4bf79f09 100644 { - *lastslash = '\0'; - grub_translate_ieee1275_path (filename); -+ char *lastslash = grub_strrchr (filename, '\\'); - +- - *path = filename; - } ++ char *lastslash = grub_strrchr (filename, '\\'); ++ + /* Truncate at last directory. */ + if (lastslash) + { @@ -56,7 +57,7 @@ index 8191f8cd658..8ca4bf79f09 100644 } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 578e057e18f..10bfed31b2b 100644 +index 578e057e1..10bfed31b 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -1817,7 +1817,7 @@ grub_net_search_configfile (char *config) @@ -69,7 +70,7 @@ index 578e057e18f..10bfed31b2b 100644 static struct grub_preboot *fini_hnd; diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 4190985ad37..aa14499996b 100644 +index 4190985ad..aa1449999 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config) @@ -130,7 +131,10 @@ index 4190985ad37..aa14499996b 100644 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; @@ -187,12 +191,6 @@ index 4190985ad37..aa14499996b 100644 - { - grub_enter_normal_mode (0); - } -- } -- else -+ if (argc) - grub_enter_normal_mode (argv[0]); -+ else -+ { + /* Guess the config filename. */ + grub_err_t err; + err = grub_try_normal ("fw_path"); @@ -200,9 +198,14 @@ index 4190985ad37..aa14499996b 100644 + 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.13.5 + 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 index b621d5a..239a83d 100644 --- 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 @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 24f034631df06b2f33d0721b8cd5126906aa7b34 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 16 Mar 2015 16:34:51 -0400 -Subject: [PATCH] Update info with grub.cfg netboot selection order (#1148650) +Subject: [PATCH 155/261] 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. @@ -12,7 +13,7 @@ Resolves rhbz#1148650 1 file changed, 42 insertions(+) diff --git a/docs/grub.texi b/docs/grub.texi -index 6b112c18804..ef09c832482 100644 +index 6b112c188..ef09c8324 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 @@ -64,3 +65,6 @@ index 6b112c18804..ef09c832482 100644 After GRUB has started, files on the TFTP server will be accessible via the @samp{(tftp)} device. +-- +2.13.5 + 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 index 5406f63..bc2768a 100644 --- a/SOURCES/0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch +++ b/SOURCES/0156-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 57df7233ae3789f525b8d7e910bf1e3ffe50ac87 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 16 Mar 2015 14:14:19 -0400 -Subject: [PATCH] Use Distribution Package Sort for grub2-mkconfig (#1124074) +Subject: [PATCH 156/261] 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 @@ -10,18 +11,57 @@ use the rpm-sort library to sort kernels instead. Resolves rhbz#1124074 --- - configure.ac | 29 +++++ - Makefile.util.def | 16 +++ - util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++ .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.c create mode 100644 util/grub-rpm-sort.8 + create mode 100644 util/grub-rpm-sort.c +diff --git a/.gitignore b/.gitignore +index 18ab8e812..b6c45776a 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 87029a10d..3ac757204 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 048ce7c89fa..de17e65c4b7 100644 +index 048ce7c89..de17e65c4 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath]) @@ -74,36 +114,53 @@ index 048ce7c89fa..de17e65c4b7 100644 LIBGEOM= if test x$host_kernel = xkfreebsd; then AC_CHECK_LIB([geom], [geom_gettree], [], -diff --git a/Makefile.util.def b/Makefile.util.def -index 87029a10dfb..3ac75720466 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -675,6 +675,22 @@ program = { - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; - }; +diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in +index 5c9ed84a5..e85b60c32 100644 +--- a/util/grub-mkconfig_lib.in ++++ b/util/grub-mkconfig_lib.in +@@ -213,6 +213,12 @@ version_sort () + esac + } -+program = { -+ name = grub-rpm-sort; -+ mansection = 8; -+ installdir = sbin; ++if [ "x$RPMLIB" = x ]; then ++ kernel_sort=version_sort ++else ++ kernel_sort="${sbindir}/grub-rpm-sort" ++fi + -+ 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; + 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 000000000..8ce214884 +--- /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. + -+ ldadd = grub-core/gnulib/libgnu.a; -+ ldadd = libgrubkern.a; -+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)'; -+}; ++.SH SYNOPSIS ++\fBgrub-rpm-sort\fR [OPTIONS]. + - script = { - name = grub-mkconfig; - common = util/grub-mkconfig.in; ++.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 00000000000..f33bd1ed568 +index 000000000..f33bd1ed5 --- /dev/null +++ b/util/grub-rpm-sort.c @@ -0,0 +1,281 @@ @@ -388,59 +445,6 @@ index 00000000000..f33bd1ed568 + + return 0; +} -diff --git a/.gitignore b/.gitignore -index 18ab8e81278..b6c45776a4d 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/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index 5c9ed84a5e7..e85b60c322a 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 00000000000..8ce21488448 ---- /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" +-- +2.13.5 + 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 index e57c685..194bca5 100644 --- 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 @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 559b04c2e29643b73f238cf95add8cef9a192a00 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:37:16 +0300 -Subject: [PATCH] efidisk: move device path helpers in core for efinet +Subject: [PATCH 157/261] efidisk: move device path helpers in core for efinet --- grub-core/disk/efi/efidisk.c | 61 ++++++++------------------------------------ @@ -10,7 +10,7 @@ Subject: [PATCH] efidisk: move device path helpers in core for efinet 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index 3b12c349923..845c66fa9ab 100644 +index 3b12c3499..845c66fa9 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; @@ -136,7 +136,7 @@ index 3b12c349923..845c66fa9ab 100644 && (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 d99a6fbdf0d..c80d85b677e 100644 +index d99a6fbdf..c80d85b67 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) @@ -188,7 +188,7 @@ index d99a6fbdf0d..c80d85b677e 100644 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 a000c383e81..22456327e13 100644 +index a000c383e..22456327e 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); @@ -202,3 +202,6 @@ index a000c383e81..22456327e13 100644 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.13.5 + diff --git a/SOURCES/0158-efinet-Check-for-immediate-completition.patch b/SOURCES/0158-efinet-Check-for-immediate-completition.patch index b337ffc..000efbf 100644 --- a/SOURCES/0158-efinet-Check-for-immediate-completition.patch +++ b/SOURCES/0158-efinet-Check-for-immediate-completition.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 763eff26748ca3d2ae8b178aef15da54a70527a5 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Fri, 27 Mar 2015 14:27:56 +0100 -Subject: [PATCH] efinet: Check for immediate completition. +Subject: [PATCH 158/261] efinet: Check for immediate completition. This both speeds GRUB up and workarounds unexpected EFI behaviour. --- @@ -9,7 +9,7 @@ This both speeds GRUB up and workarounds unexpected EFI behaviour. 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index a6e4c7992f7..78df215be12 100644 +index a6e4c7992..78df215be 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -37,11 +37,12 @@ send_card_buffer (struct grub_net_card *dev, @@ -46,3 +46,6 @@ index a6e4c7992f7..78df215be12 100644 return GRUB_ERR_NONE; } +-- +2.13.5 + diff --git a/SOURCES/0159-efinet-memory-leak-on-module-removal.patch b/SOURCES/0159-efinet-memory-leak-on-module-removal.patch index 022222a..c1a0790 100644 --- a/SOURCES/0159-efinet-memory-leak-on-module-removal.patch +++ b/SOURCES/0159-efinet-memory-leak-on-module-removal.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8471c374d9379ba80e4b3bbcacb4813a2d04f008 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 08:08:57 +0300 -Subject: [PATCH] efinet: memory leak on module removal +Subject: [PATCH 159/261] efinet: memory leak on module removal --- grub-core/net/drivers/efi/efinet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 78df215be12..810adf38fe6 100644 +index 78df215be..810adf38f 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -294,6 +294,12 @@ GRUB_MOD_FINI(efinet) @@ -25,3 +25,6 @@ index 78df215be12..810adf38fe6 100644 + } } +-- +2.13.5 + diff --git a/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch b/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch index 865ccd9..656e32e 100644 --- a/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch +++ b/SOURCES/0160-efinet-cannot-free-const-char-pointer.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From fe8c0ca495c7225682e2af47d0d77b4ad0077f34 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 08:39:29 +0300 -Subject: [PATCH] efinet: cannot free const char * pointer +Subject: [PATCH 160/261] efinet: cannot free const char * pointer --- 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 810adf38fe6..bb863e65a38 100644 +index 810adf38f..bb863e65a 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -298,7 +298,7 @@ GRUB_MOD_FINI(efinet) @@ -20,3 +20,6 @@ index 810adf38fe6..bb863e65a38 100644 grub_free (card); } } +-- +2.13.5 + 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 f1cf7e0..ec3da8d 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 41772bb7633fab5e38f0dac90e1e04538a066a3d Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Mon, 4 May 2015 09:13:53 +0300 -Subject: [PATCH] Revert "efinet: memory leak on module removal" +Subject: [PATCH 161/261] Revert "efinet: memory leak on module removal" This reverts commits 47b2bee3ef0ea60fc3f5bfc37f3784e559385297 and 8d3c4544ffdd0289a4b0bdeb0cdc6355f801a4b3. It is not safe @@ -12,7 +12,7 @@ cleanup requires more changes in net core. 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index bb863e65a38..78df215be12 100644 +index bb863e65a..78df215be 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -294,12 +294,6 @@ GRUB_MOD_FINI(efinet) @@ -29,3 +29,6 @@ index bb863e65a38..78df215be12 100644 + grub_net_card_unregister (card); } +-- +2.13.5 + 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 f21a921..92ea4f0 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,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0faa80b06bc1e9956d7ee6aa3b23574b7c4c18c8 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:37:17 +0300 -Subject: [PATCH] efinet: skip virtual IPv4 and IPv6 devices when enumerating - cards +Subject: [PATCH 162/261] efinet: skip virtual IPv4 and IPv6 devices when + enumerating cards EDK2 PXE driver creates two child devices - IPv4 and IPv6 - with bound SNP instance. This means we get three cards for every physical @@ -24,7 +24,7 @@ this information is associated with one of child devices. 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 78df215be12..caa7b50228b 100644 +index 78df215be..caa7b5022 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -174,6 +174,29 @@ grub_efinet_findcards (void) @@ -92,3 +92,6 @@ index 78df215be12..caa7b50228b 100644 pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (! pxe) +-- +2.13.5 + diff --git a/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch b/SOURCES/0163-efinet-open-Simple-Network-Protocol-exclusively.patch index c26954d..155120a 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0a84c5c3f0a50115372a61c68cc752367d669b07 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:37:17 +0300 -Subject: [PATCH] efinet: open Simple Network Protocol exclusively +Subject: [PATCH 163/261] 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 @@ -25,7 +25,7 @@ Closes: 41731 1 file changed, 46 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index caa7b50228b..6a1dd1f9dff 100644 +index caa7b5022..6a1dd1f9d 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -142,9 +142,55 @@ get_card_packet (struct grub_net_card *dev) @@ -84,3 +84,6 @@ index caa7b50228b..6a1dd1f9dff 100644 .send = send_card_buffer, .recv = get_card_packet }; +-- +2.13.5 + 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 e914ac4..3b92d68 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 2c38daa48daebd9b5ebfbb94a9c451b00c9f251c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Tue, 16 Jun 2015 19:52:45 +0300 -Subject: [PATCH] efinet: enable hardware filters when opening interface +Subject: [PATCH 164/261] 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 @@ -21,7 +22,7 @@ Closes: 45204 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 6a1dd1f9dff..7b8c4a59d10 100644 +index 6a1dd1f9d..7b8c4a59d 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -168,6 +168,29 @@ open_card (struct grub_net_card *dev) @@ -64,7 +65,7 @@ index 6a1dd1f9dff..7b8c4a59d10 100644 dev->efi_net, &net_io_guid, grub_efi_image_handle, dev->efi_handle); diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 142340372e1..029ee92f5d0 100644 +index 142340372..029ee92f5 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1564,17 +1564,31 @@ enum @@ -102,3 +103,6 @@ index 142340372e1..029ee92f5d0 100644 void (*station_address) (void); void (*statistics) (void); void (*mcastiptomac) (void); +-- +2.13.5 + 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 22e2bcc..2302a2f 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 17bd27e298d2b27859c8c6ee2e654d8f03988c42 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 6 Aug 2015 10:49:46 -0700 -Subject: [PATCH] efinet: handle get_status() on buggy firmware properly +Subject: [PATCH 165/261] 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 @@ -18,7 +19,7 @@ Signed-off-by: Josef Bacik 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 7b8c4a59d10..ea0e0ca360e 100644 +index 7b8c4a59d..ea0e0ca36 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -47,19 +47,19 @@ send_card_buffer (struct grub_net_card *dev, @@ -61,3 +62,6 @@ index 7b8c4a59d10..ea0e0ca360e 100644 return GRUB_ERR_NONE; } +-- +2.13.5 + diff --git a/SOURCES/0166-Handle-rssd-storage-devices.patch b/SOURCES/0166-Handle-rssd-storage-devices.patch index cc012e0..a54aeea 100644 --- a/SOURCES/0166-Handle-rssd-storage-devices.patch +++ b/SOURCES/0166-Handle-rssd-storage-devices.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 1ab087435c259702c62fdfe85e28f3e3f2459266 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 30 Jun 2015 15:50:41 -0400 -Subject: [PATCH] Handle rssd storage devices. +Subject: [PATCH 166/261] Handle rssd storage devices. Resolves: rhbz#1087962 @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 13 insertions(+) diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c -index 7007193d9c7..5987d078a2f 100644 +index 7007193d9..5987d078a 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -884,6 +884,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, @@ -34,3 +34,6 @@ index 7007193d9c7..5987d078a2f 100644 /* If this is a loop device */ if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9') { +-- +2.13.5 + 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 a8476c2..49e8b33 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6afb93f24d48ff10d4266396b079b79033e05b0a Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 14 Jul 2014 17:21:29 +0200 -Subject: [PATCH] xfs: Fix termination loop for directory iteration +Subject: [PATCH 167/261] 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 @@ -14,7 +14,7 @@ Signed-off-by: Jan Kara 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 16ffd3f1ebd..4bd52d1e081 100644 +index 16ffd3f1e..4bd52d1e0 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -603,8 +603,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, @@ -27,3 +27,6 @@ index 16ffd3f1ebd..4bd52d1e081 100644 { struct grub_xfs_dir2_entry *direntry; grub_uint8_t *freetag; +-- +2.13.5 + 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 f381d9b..9ed8d5a 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 54a4f53f9ecae2378195e4e66a8410d3862a0be2 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 14 Jul 2014 17:21:30 +0200 -Subject: [PATCH] xfs: Convert inode numbers to cpu endianity immediately after - reading +Subject: [PATCH 168/261] 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 @@ -15,7 +15,7 @@ Signed-off-by: Jan Kara 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 4bd52d1e081..0d704e9a4d4 100644 +index 4bd52d1e0..0d704e9a4 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -180,14 +180,14 @@ static inline grub_uint64_t @@ -77,3 +77,6 @@ index 4bd52d1e081..0d704e9a4d4 100644 data->diropen.inode_read = 1; data->bsize = grub_be_to_cpu32 (data->sblock.bsize); data->agsize = grub_be_to_cpu32 (data->sblock.agsize); +-- +2.13.5 + diff --git a/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch b/SOURCES/0169-xfs-Add-helpers-for-inode-size.patch index ea3f241..8535553 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From bc7e3f1e508c91b9ad7d3459998c5cd31d1caca0 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 1 Jun 2015 14:28:45 +0200 -Subject: [PATCH] xfs: Add helpers for inode size +Subject: [PATCH 169/261] xfs: Add helpers for inode size Add helpers to return size of XFS inode on disk and when loaded in memory. @@ -12,7 +12,7 @@ Signed-off-by: Jan Kara 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 0d704e9a4d4..26d8147a92e 100644 +index 0d704e9a4..26d8147a9 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -255,6 +255,24 @@ grub_xfs_inode_offset (struct grub_xfs_data *data, @@ -92,3 +92,6 @@ index 0d704e9a4d4..26d8147a92e 100644 grub_free (fdiro); } +-- +2.13.5 + diff --git a/SOURCES/0170-xfs-V5-filesystem-format-support.patch b/SOURCES/0170-xfs-V5-filesystem-format-support.patch index 2d80632..a058133 100644 --- a/SOURCES/0170-xfs-V5-filesystem-format-support.patch +++ b/SOURCES/0170-xfs-V5-filesystem-format-support.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f9187f5eef9776ba51dca88e347bfd6675787cb6 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 1 Jun 2015 14:28:46 +0200 -Subject: [PATCH] xfs: V5 filesystem format support +Subject: [PATCH 170/261] 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 @@ -13,7 +13,7 @@ Signed-off-by: Jan Kara 1 file changed, 252 insertions(+), 80 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 26d8147a92e..f00e43e7dc3 100644 +index 26d8147a9..f00e43e7d 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -34,6 +34,50 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -574,3 +574,6 @@ index 26d8147a92e..f00e43e7dc3 100644 grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); +-- +2.13.5 + diff --git a/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch b/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch index b65a692..1fe6620 100644 --- a/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch +++ b/SOURCES/0171-xfs-silence-Coverity-overflow-warning.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 4ac2b84fea9a90d68970c0729a02895d47a8b40c Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 19 Jun 2015 18:38:25 +0300 -Subject: [PATCH] xfs: silence Coverity overflow warning +Subject: [PATCH 171/261] xfs: silence Coverity overflow warning inode size cannot really overflow integer, but Coverity does not know it. CID: 96602 @@ -10,7 +10,7 @@ CID: 96602 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index f00e43e7dc3..72492915533 100644 +index f00e43e7d..724929155 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -361,7 +361,7 @@ grub_xfs_inode_offset (struct grub_xfs_data *data, @@ -22,3 +22,6 @@ index f00e43e7dc3..72492915533 100644 } /* +-- +2.13.5 + 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 332a464..dab0514 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From a1f8402056e13cadab252dd64d7dc28ccdf6fda0 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Tue, 18 Nov 2014 16:03:08 +0800 -Subject: [PATCH] send router solicitation for ipv6 address autoconf v2 +Subject: [PATCH 172/261] 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 @@ -23,7 +23,7 @@ add missing error handling 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index bbc902014fe..0843a15afda 100644 +index bbc902014..0843a15af 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -72,6 +72,11 @@ struct neighbour_advertise @@ -128,7 +128,7 @@ index bbc902014fe..0843a15afda 100644 + return err; +} diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 10bfed31b2b..b10addbe27b 100644 +index 10bfed31b..b10addbe2 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -380,12 +380,14 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), @@ -148,7 +148,7 @@ index 10bfed31b2b..b10addbe27b 100644 } if (done) diff --git a/include/grub/net/ip.h b/include/grub/net/ip.h -index 7a8e614794d..dcceaa56894 100644 +index 7a8e61479..dcceaa568 100644 --- a/include/grub/net/ip.h +++ b/include/grub/net/ip.h @@ -92,4 +92,6 @@ grub_err_t @@ -158,3 +158,6 @@ index 7a8e614794d..dcceaa56894 100644 +grub_err_t +grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf); #endif +-- +2.13.5 + 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 0968619..3e498d1 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 70717c72f114860c25908eabc4cb18a15ed2680e Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Mon, 3 Nov 2014 16:27:45 +0800 -Subject: [PATCH] icmp6 fix no respond to neighbor solicit message +Subject: [PATCH 173/261] 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 @@ -12,7 +12,7 @@ testing. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index 0843a15afda..78223946031 100644 +index 0843a15af..782239460 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -211,7 +211,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, @@ -24,3 +24,6 @@ index 0843a15afda..78223946031 100644 if (err) { grub_netbuff_free (nb); +-- +2.13.5 + 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 defe185..f8d5e44 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From af355a7fe160c6c798e416f8f14e059aaf16ea13 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Fri, 10 Oct 2014 11:11:09 +0200 -Subject: [PATCH] calibrate_tsc(): use the Stall() EFI boot service on +Subject: [PATCH 174/261] calibrate_tsc(): use the Stall() EFI boot service on GRUB_MACHINE_EFI Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1150698 @@ -15,7 +15,7 @@ Signed-off-by: RHEL Ninjas 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c -index 3a4cae601d0..e49964833ca 100644 +index 3a4cae601..e49964833 100644 --- a/grub-core/kern/i386/tsc.c +++ b/grub-core/kern/i386/tsc.c @@ -26,9 +26,14 @@ @@ -68,3 +68,6 @@ index 3a4cae601d0..e49964833ca 100644 end_tsc = grub_get_tsc (); grub_tsc_rate = grub_divmod64 ((55ULL << 32), end_tsc - tsc_boot_time, 0); +-- +2.13.5 + 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 0b95ffe..2d3938d 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 27d2434ea9aed09b6cefdcc8600e191fa6d1c2fb Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 5 Dec 2014 21:17:08 +0300 -Subject: [PATCH] fix memory corruption in pubkey filter over network +Subject: [PATCH 175/261] 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. @@ -27,7 +27,7 @@ Closes: bug #43601 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c -index 525bdd18737..d5995766b4c 100644 +index 525bdd187..d5995766b 100644 --- a/grub-core/commands/verify.c +++ b/grub-core/commands/verify.c @@ -33,6 +33,13 @@ @@ -162,3 +162,6 @@ index 525bdd18737..d5995766b4c 100644 return ret; } +-- +2.13.5 + 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 1c5edf2..5928fc6 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 204d0616ba497656d21e65f1b26561c539ea1a21 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 28 Apr 2015 11:15:03 -0400 -Subject: [PATCH] Make grub2-mkconfig construct titles that look like the ones - we want elsewhere. +Subject: [PATCH 176/261] Make grub2-mkconfig construct titles that look like + the ones we want elsewhere. Resolves: rhbz#1215839 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index e8088a18160..b3c460cb266 100644 +index e8088a181..b3c460cb2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -66,6 +66,32 @@ case x"$GRUB_FS" in @@ -67,3 +67,6 @@ index e8088a18160..b3c460cb266 100644 fi echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/" else +-- +2.13.5 + 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 622955e..f9ec3ba 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,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 224bdbee2e9cc9a9aaa198cec9b984bb1fa0ee73 Mon Sep 17 00:00:00 2001 From: RHEL Ninjas Date: Mon, 13 Apr 2015 12:42:53 +1000 -Subject: [PATCH] don't strip fw_path twice for EFI network boot +Subject: [PATCH 177/261] don't strip fw_path twice for EFI network boot --- grub-core/kern/efi/init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index 942ab0256b9..c391df48236 100644 +index 942ab0256..c391df482 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -61,7 +61,12 @@ grub_machine_get_bootlocation (char **device, char **path) @@ -25,3 +25,6 @@ index 942ab0256b9..c391df48236 100644 /* Get the directory. */ p = grub_strrchr (*path, '/'); +-- +2.13.5 + 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 d53e093..0d6ec1c 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From bde7036b706857aff32a025e82da5bc32473e439 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 25 Jun 2015 11:13:11 -0400 -Subject: [PATCH] Add friendly grub2 password config tool (#985962) +Subject: [PATCH 178/261] 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 @@ -9,9 +9,9 @@ lives in a root-only-readable configuration file. Resolves: rhbz#985962 --- - configure.ac | 1 + - Makefile.util.def | 13 +++++ .gitignore | 12 ++--- + Makefile.util.def | 13 +++++ + configure.ac | 1 + util/grub-mkconfig.in | 2 + util/grub-setpassword.8 | 28 +++++++++++ util/grub-setpassword.in | 123 +++++++++++++++++++++++++++++++++++++++++++++++ @@ -21,71 +21,71 @@ Resolves: rhbz#985962 create mode 100755 util/grub-setpassword.in create mode 100644 util/grub.d/01_users.in -diff --git a/configure.ac b/configure.ac -index de17e65c4b7..273da6cb906 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-setpassword]) - grub_TRANSFORM([grub-rpm-sort]) - grub_TRANSFORM([grub-script-check]) - grub_TRANSFORM([grub-set-default]) +diff --git a/.gitignore b/.gitignore +index b6c45776a..e49f76b11 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,11 +1,7 @@ +-00_header +-10_* +-20_linux_xen +-30_os-prober +-40_custom +-41_custom +-*.1 +-*.8 ++[[:digit:]][[:digit:]]_* ++!util/[[:digit:]][[:digit:]]_*.in ++*.[[:digit:]] ++!util/*.[[:digit:]] + aclocal.m4 + ahci_test + ascii.bitmaps diff --git a/Makefile.util.def b/Makefile.util.def -index 3ac75720466..e2821a2f3a5 100644 +index 3ac757204..e2821a2f3 100644 --- a/Makefile.util.def +++ b/Makefile.util.def -@@ -437,6 +437,12 @@ script = { - installdir = grubconf; +@@ -438,6 +438,12 @@ script = { }; -+script = { + script = { + name = '01_users'; + common = util/grub.d/01_users.in; + installdir = grubconf; +}; + - script = { ++script = { name = '10_windows'; common = util/grub.d/10_windows.in; -@@ -712,6 +718,13 @@ script = { - installdir = sbin; + installdir = grubconf; +@@ -713,6 +719,13 @@ script = { }; -+script = { + script = { + name = grub-setpassword; + common = util/grub-setpassword.in; + mansection = 8; + installdir = sbin; +}; + - script = { ++script = { name = grub-mkconfig_lib; common = util/grub-mkconfig_lib.in; -diff --git a/.gitignore b/.gitignore -index b6c45776a4d..e49f76b114a 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,11 +1,7 @@ --00_header --10_* --20_linux_xen --30_os-prober --40_custom --41_custom --*.1 --*.8 -+[[:digit:]][[:digit:]]_* -+!util/[[:digit:]][[:digit:]]_*.in -+*.[[:digit:]] -+!util/*.[[:digit:]] - aclocal.m4 - ahci_test - ascii.bitmaps + installdir = noinst; +diff --git a/configure.ac b/configure.ac +index de17e65c4..273da6cb9 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-setpassword]) + grub_TRANSFORM([grub-rpm-sort]) + grub_TRANSFORM([grub-script-check]) + grub_TRANSFORM([grub-set-default]) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index bc26e7c109e..e029d0d5ea9 100644 +index bc26e7c10..e029d0d5e 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -260,6 +260,8 @@ for i in "${grub_mkconfig_dir}"/* ; do @@ -99,7 +99,7 @@ index bc26e7c109e..e029d0d5ea9 100644 echo diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 new file mode 100644 -index 00000000000..5973abef4ab +index 000000000..5973abef4 --- /dev/null +++ b/util/grub-setpassword.8 @@ -0,0 +1,28 @@ @@ -133,7 +133,7 @@ index 00000000000..5973abef4ab +.BR "info grub2-mkpasswd-pbkdf2" diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in new file mode 100755 -index 00000000000..dd76f00fc0e +index 000000000..dd76f00fc --- /dev/null +++ b/util/grub-setpassword.in @@ -0,0 +1,123 @@ @@ -262,7 +262,7 @@ index 00000000000..dd76f00fc0e +echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg" diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in new file mode 100644 -index 00000000000..facd409e722 +index 000000000..facd409e7 --- /dev/null +++ b/util/grub.d/01_users.in @@ -0,0 +1,11 @@ @@ -277,3 +277,6 @@ index 00000000000..facd409e722 + fi +fi +EOF +-- +2.13.5 + 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 eba3892..dba74dc 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,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f742724d51dc84b32a1298cd6bab62f12d887052 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 3 Aug 2015 11:46:42 -0400 -Subject: [PATCH] Try to make sure configure.ac and grub-rpm-sort play nice. +Subject: [PATCH 179/261] 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 renaming of it to grub2-rpm-sort on the runtime side weren't right. @@ -15,7 +16,7 @@ Signed-off-by: Peter Jones 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac -index 273da6cb906..04c052dc610 100644 +index 273da6cb9..04c052dc6 100644 --- a/configure.ac +++ b/configure.ac @@ -1549,7 +1549,7 @@ AC_SUBST([LIBDEVMAPPER]) @@ -28,7 +29,7 @@ index 273da6cb906..04c052dc610 100644 fi diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in -index e85b60c322a..c67a319916a 100644 +index e85b60c32..c67a31991 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -33,6 +33,9 @@ fi @@ -46,12 +47,15 @@ index e85b60c322a..c67a319916a 100644 } -if [ "x$RPMLIB" = x ]; then +- kernel_sort=version_sort +if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then + kernel_sort="$grub_rpm_sort" -+else - kernel_sort=version_sort --else + else - kernel_sort="${sbindir}/grub-rpm-sort" ++ kernel_sort=version_sort fi version_test_numeric () +-- +2.13.5 + diff --git a/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch b/SOURCES/0180-ppc64le-sync-mkconfig-to-disk-1212114.patch index 27a337b..1b43535 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f1edaeeeffdfc291e0b17d87f8727baaecbfaf63 Mon Sep 17 00:00:00 2001 From: Don Zickus Date: Wed, 22 Jul 2015 13:59:55 -0400 -Subject: [PATCH] ppc64le sync mkconfig to disk (#1212114) +Subject: [PATCH 180/261] 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, @@ -21,7 +21,7 @@ Resolves: rhbz#1212114 1 file changed, 9 insertions(+) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index e029d0d5ea9..cf315e241f6 100644 +index e029d0d5e..cf315e241 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -290,3 +290,12 @@ fi @@ -37,3 +37,6 @@ index e029d0d5ea9..cf315e241f6 100644 +if [ "${ARCH}" = "ppc64le" ]; then + sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot +fi +-- +2.13.5 + 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 071bcbe..82bb5b1 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 66804a1e21978713902da654ec890574efe25e7d Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:16:22 -0700 -Subject: [PATCH] tcp: ack when we get an OOO/lost packet +Subject: [PATCH 181/261] 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 @@ -17,7 +17,7 @@ Signed-off-by: Josef Bacik 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c -index 2077f5519b2..fa29a2afc6c 100644 +index 2077f5519..fa29a2afc 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -882,7 +882,10 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, @@ -32,3 +32,6 @@ index 2077f5519b2..fa29a2afc6c 100644 while (1) { nb_top_p = grub_priority_queue_top (sock->pq); +-- +2.13.5 + diff --git a/SOURCES/0182-tcp-add-window-scaling-support.patch b/SOURCES/0182-tcp-add-window-scaling-support.patch index 4455fce..c7a1b03 100644 --- a/SOURCES/0182-tcp-add-window-scaling-support.patch +++ b/SOURCES/0182-tcp-add-window-scaling-support.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8e86a32160008b34796f597016cc335680bb3486 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 12 Aug 2015 08:57:55 -0700 -Subject: [PATCH] tcp: add window scaling support +Subject: [PATCH 182/261] 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 @@ -17,7 +17,7 @@ Signed-off-by: Josef Bacik 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c -index fa29a2afc6c..c22ef033d6e 100644 +index fa29a2afc..c22ef033d 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -106,6 +106,18 @@ struct tcphdr @@ -85,3 +85,6 @@ index fa29a2afc6c..c22ef033d6e 100644 tcp_socket_register (socket); +-- +2.13.5 + 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 f932d7d..2d52844 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 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 1b9767c1360827639927ab9bd337d1344d3b2d68 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 31 Aug 2015 13:34:35 -0400 -Subject: [PATCH] efinet: retransmit if our device is busy +Subject: [PATCH 183/261] 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 @@ -16,7 +16,7 @@ Signed-off-by: Josef Bacik 1 file changed, 10 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index ea0e0ca360e..c3a128cd1dc 100644 +index ea0e0ca36..c3a128cd1 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -38,6 +38,7 @@ send_card_buffer (struct grub_net_card *dev, @@ -43,3 +43,6 @@ index ea0e0ca360e..c3a128cd1dc 100644 if (limit_time < grub_get_time_ms ()) return grub_error (GRUB_ERR_TIMEOUT, N_("couldn't send network packet")); +-- +2.13.5 + diff --git a/SOURCES/0184-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch b/SOURCES/0184-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch index 8078da6..dc9555e 100644 --- a/SOURCES/0184-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch +++ b/SOURCES/0184-efinet-add-filter-for-the-first-exclusive-reopen-of-.patch @@ -1,14 +1,15 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 3f83a59f17fef591cf5e4804f6b26ca9a9c1fe35 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 184/261] efinet: add filter for the first exclusive reopen of + SNP --- grub-core/net/drivers/efi/efinet.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index c3a128cd1dc..d8099a59855 100644 +index c3a128cd1..d8099a598 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -407,6 +407,30 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -42,3 +43,6 @@ index c3a128cd1dc..d8099a59855 100644 card->efi_net = net; } return; +-- +2.13.5 + diff --git a/SOURCES/0185-Fix-security-issue-when-reading-username-and-passwor.patch b/SOURCES/0185-Fix-security-issue-when-reading-username-and-passwor.patch index d000899..2fb814f 100644 --- a/SOURCES/0185-Fix-security-issue-when-reading-username-and-passwor.patch +++ b/SOURCES/0185-Fix-security-issue-when-reading-username-and-passwor.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8e0cdc0c0cdb3be1ed0e3ed0abd382c924b56a9e Mon Sep 17 00:00:00 2001 From: Hector Marco-Gisbert Date: Fri, 13 Nov 2015 16:21:09 +0100 -Subject: [PATCH] Fix security issue when reading username and password +Subject: [PATCH 185/261] Fix security issue when reading username and password This patch fixes two integer underflows at: * grub-core/lib/crypto.c @@ -17,7 +17,7 @@ Signed-off-by: Ismael Ripoll-Ripoll 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c -index 8e8426c4ab4..a23519cb3bd 100644 +index 8e8426c4a..a23519cb3 100644 --- a/grub-core/lib/crypto.c +++ b/grub-core/lib/crypto.c @@ -456,7 +456,7 @@ grub_password_get (char buf[], unsigned buf_size) @@ -30,7 +30,7 @@ index 8e8426c4ab4..a23519cb3bd 100644 cur_len--; continue; diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c -index c6bd96e28ec..5782ec5a940 100644 +index c6bd96e28..5782ec5a9 100644 --- a/grub-core/normal/auth.c +++ b/grub-core/normal/auth.c @@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size) @@ -42,3 +42,6 @@ index c6bd96e28ec..5782ec5a940 100644 { cur_len--; grub_printf ("\b"); +-- +2.13.5 + diff --git a/SOURCES/0186-01_users-Handle-GRUB_PASSWORD-better.patch b/SOURCES/0186-01_users-Handle-GRUB_PASSWORD-better.patch index 88ef564..3521e5d 100644 --- a/SOURCES/0186-01_users-Handle-GRUB_PASSWORD-better.patch +++ b/SOURCES/0186-01_users-Handle-GRUB_PASSWORD-better.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f9e2d5c67571714b37f17526a53ef979bd4af7bf Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 4 Dec 2015 09:28:38 -0500 -Subject: [PATCH] 01_users: Handle GRUB_PASSWORD better. +Subject: [PATCH 186/261] 01_users: Handle GRUB_PASSWORD better. Only handle GRUB_PASSWORD not GRUB2_PASSWORD (as that's more likely to be acceptable upstream). @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 -index 5973abef4ab..49200a848b7 100644 +index 5973abef4..49200a848 100644 --- a/util/grub-setpassword.8 +++ b/util/grub-setpassword.8 @@ -9,7 +9,7 @@ @@ -28,7 +28,7 @@ index 5973abef4ab..49200a848b7 100644 .SH OPTIONS .TP diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in -index facd409e722..db2f44bfb78 100644 +index facd409e7..db2f44bfb 100644 --- a/util/grub.d/01_users.in +++ b/util/grub.d/01_users.in @@ -2,7 +2,7 @@ @@ -40,3 +40,6 @@ index facd409e722..db2f44bfb78 100644 set superusers="root" export superusers password_pbkdf2 root \${GRUB2_PASSWORD} +-- +2.13.5 + diff --git a/SOURCES/0187-Failed-config-now-returns-exit-code-1252311.patch b/SOURCES/0187-Failed-config-now-returns-exit-code-1252311.patch index f82c897..035b295 100644 --- a/SOURCES/0187-Failed-config-now-returns-exit-code-1252311.patch +++ b/SOURCES/0187-Failed-config-now-returns-exit-code-1252311.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 498ca1d546fd1ba0970c2beadf01382be85d32e5 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Fri, 29 Jan 2016 14:49:24 -0500 -Subject: [PATCH] Failed config now returns exit code (#1252311) +Subject: [PATCH 187/261] 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. @@ -12,7 +12,7 @@ Resolves: rhbz#1252311 1 file changed, 1 insertion(+) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index cf315e241f6..7db89499949 100644 +index cf315e241..7db894999 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 @@ -23,3 +23,6 @@ index cf315e241f6..7db89499949 100644 else # none of the children aborted with error, install the new grub.cfg cat ${grub_cfg}.new > ${grub_cfg} +-- +2.13.5 + diff --git a/SOURCES/0188-Warn-if-grub-password-will-not-be-read-1290803.patch b/SOURCES/0188-Warn-if-grub-password-will-not-be-read-1290803.patch index 4baf91a..57c4905 100644 --- a/SOURCES/0188-Warn-if-grub-password-will-not-be-read-1290803.patch +++ b/SOURCES/0188-Warn-if-grub-password-will-not-be-read-1290803.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f611a1e2fac218dcae62dbde553045b25b12c724 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 22 Feb 2016 15:30:05 -0500 -Subject: [PATCH] Warn if grub password will not be read (#1290803) +Subject: [PATCH 188/261] 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 @@ -14,7 +14,7 @@ Resolves: rhbz#1290803 1 file changed, 5 insertions(+) diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index dd76f00fc0e..fb9d3a3b6f9 100755 +index dd76f00fc..fb9d3a3b6 100755 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -121,3 +121,8 @@ fi @@ -26,3 +26,6 @@ index dd76f00fc0e..fb9d3a3b6f9 100755 + echo "WARNING: The current configuration lacks password support!" + echo "Update your configuration with @grub_mkconfig@ to support this feature." +fi +-- +2.13.5 + diff --git a/SOURCES/0189-Clean-up-grub-setpassword-documentation-1290799.patch b/SOURCES/0189-Clean-up-grub-setpassword-documentation-1290799.patch index b5ad6ec..07a754a 100644 --- a/SOURCES/0189-Clean-up-grub-setpassword-documentation-1290799.patch +++ b/SOURCES/0189-Clean-up-grub-setpassword-documentation-1290799.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From a7211e0dec4a19dfe7ec32113aa1f40c5bdac970 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Tue, 26 Jan 2016 10:28:35 -0500 -Subject: [PATCH] Clean up grub-setpassword documentation (#1290799) +Subject: [PATCH 189/261] 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 @@ -14,7 +14,7 @@ Resolves: rhbz#1290799 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8 -index 49200a848b7..dc91dd6697b 100644 +index 49200a848..dc91dd669 100644 --- a/util/grub-setpassword.8 +++ b/util/grub-setpassword.8 @@ -19,7 +19,7 @@ Display program usage and exit. @@ -27,7 +27,7 @@ index 49200a848b7..dc91dd6697b 100644 .SH SEE ALSO diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index fb9d3a3b6f9..c8c0fa4199d 100755 +index fb9d3a3b6..c8c0fa419 100755 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -16,15 +16,14 @@ grub_mkpasswd="${bindir}/@grub_mkpasswd_pbkdf2@" @@ -53,3 +53,6 @@ index fb9d3a3b6f9..c8c0fa4199d 100755 Report bugs at https://bugzilla.redhat.com. EOF +-- +2.13.5 + diff --git a/SOURCES/0190-Fix-locale-issue-in-grub-setpassword-1294243.patch b/SOURCES/0190-Fix-locale-issue-in-grub-setpassword-1294243.patch index 4ab663d..9add2b6 100644 --- a/SOURCES/0190-Fix-locale-issue-in-grub-setpassword-1294243.patch +++ b/SOURCES/0190-Fix-locale-issue-in-grub-setpassword-1294243.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 05eb9c82728b28152703365123ac72181f965313 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Fri, 29 Jan 2016 16:56:11 -0500 -Subject: [PATCH] Fix locale issue in grub-setpassword (#1294243) +Subject: [PATCH 190/261] 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 @@ -13,7 +13,7 @@ Resolves: rhbz#1294243 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index c8c0fa4199d..d7924af5192 100755 +index c8c0fa419..d7924af51 100755 --- a/util/grub-setpassword.in +++ b/util/grub-setpassword.in @@ -104,7 +104,7 @@ getpass() { @@ -25,3 +25,6 @@ index c8c0fa4199d..d7924af5192 100755 grep -v '[eE]nter password:' | \ sed -e "s/PBKDF2 hash of your password is //" } +-- +2.13.5 + diff --git a/SOURCES/0191-efi-really-mark-memory-of-unknown-type-as-reserved.patch b/SOURCES/0191-efi-really-mark-memory-of-unknown-type-as-reserved.patch index 70dfa71..392b73f 100644 --- a/SOURCES/0191-efi-really-mark-memory-of-unknown-type-as-reserved.patch +++ b/SOURCES/0191-efi-really-mark-memory-of-unknown-type-as-reserved.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f378785ec7a8e67d719a4268f2fd44f8639fe0a6 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 26 Nov 2015 19:50:42 +0300 -Subject: [PATCH] efi: really mark memory of unknown type as reserved +Subject: [PATCH 191/261] 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 @@ -20,7 +20,7 @@ Resolves: rhbz#1288608 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c -index a77efe81d0c..900a4d6598c 100644 +index a77efe81d..900a4d659 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, @@ -64,3 +64,6 @@ index a77efe81d0c..900a4d6598c 100644 } } +-- +2.13.5 + diff --git a/SOURCES/0192-Translate-UEFI-persistent-memory-type.patch b/SOURCES/0192-Translate-UEFI-persistent-memory-type.patch index 20d2adc..976cc5d 100644 --- a/SOURCES/0192-Translate-UEFI-persistent-memory-type.patch +++ b/SOURCES/0192-Translate-UEFI-persistent-memory-type.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 378daa8a4be1f8789d53a0656e511f72df01a423 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Thu, 3 Dec 2015 11:38:36 -0600 -Subject: [PATCH] Translate UEFI persistent memory type +Subject: [PATCH 192/261] Translate UEFI persistent memory type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -31,7 +31,7 @@ Resolves: rhbz#1288608 4 files changed, 17 insertions(+) diff --git a/grub-core/commands/lsmmap.c b/grub-core/commands/lsmmap.c -index 4b504fd28f8..816ee47d1ed 100644 +index 4b504fd28..816ee47d1 100644 --- a/grub-core/commands/lsmmap.c +++ b/grub-core/commands/lsmmap.c @@ -37,6 +37,8 @@ static const char *names[] = @@ -44,7 +44,7 @@ index 4b504fd28f8..816ee47d1ed 100644 [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 900a4d6598c..bd495a18481 100644 +index 900a4d659..bd495a184 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, @@ -74,7 +74,7 @@ index 900a4d6598c..bd495a18481 100644 return GRUB_EFI_UNUSABLE_MEMORY; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 029ee92f5d0..551d93e50a3 100644 +index 029ee92f5..551d93e50 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -431,6 +431,7 @@ enum grub_efi_memory_type @@ -86,7 +86,7 @@ index 029ee92f5d0..551d93e50a3 100644 }; typedef enum grub_efi_memory_type grub_efi_memory_type_t; diff --git a/include/grub/memory.h b/include/grub/memory.h -index 083cfb6802e..6da114a1bdc 100644 +index 083cfb680..6da114a1b 100644 --- a/include/grub/memory.h +++ b/include/grub/memory.h @@ -30,6 +30,8 @@ typedef enum grub_memory_type @@ -98,3 +98,6 @@ index 083cfb6802e..6da114a1bdc 100644 GRUB_MEMORY_COREBOOT_TABLES = 16, GRUB_MEMORY_CODE = 20, /* This one is special: it's used internally but is never reported +-- +2.13.5 + diff --git a/SOURCES/0193-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch b/SOURCES/0193-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch index 0d4791d..3cc47f5 100644 --- a/SOURCES/0193-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch +++ b/SOURCES/0193-lsefimmap-support-persistent-memory-and-other-UEFI-2.patch @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0bd066063de67219dcf8f3d8d698f7b798e709d9 Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Thu, 17 Dec 2015 10:53:32 -0600 -Subject: [PATCH] lsefimmap: support persistent memory and other UEFI 2.5 - features +Subject: [PATCH 193/261] lsefimmap: support persistent memory and other UEFI + 2.5 features This should accompany 76ce1de740 Translate UEFI persistent memory type @@ -86,7 +86,7 @@ Resolves: rhbz#1288608 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/grub-core/commands/efi/lsefimmap.c b/grub-core/commands/efi/lsefimmap.c -index 215b45bff80..c85ff7f366d 100644 +index 215b45bff..c85ff7f36 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)), @@ -166,7 +166,7 @@ index 215b45bff80..c85ff7f366d 100644 grub_printf ("\n"); } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 551d93e50a3..a6cce6e3395 100644 +index 551d93e50..a6cce6e33 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -49,6 +49,9 @@ @@ -179,3 +179,6 @@ index 551d93e50a3..a6cce6e3395 100644 #define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL #define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 +-- +2.13.5 + diff --git a/SOURCES/0194-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch b/SOURCES/0194-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch index 4f4b7f9..02c070b 100644 --- a/SOURCES/0194-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch +++ b/SOURCES/0194-efiemu-Handle-persistent-RAM-and-unknown-possible-fu.patch @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 178c4edc23c209630f22fbd3c6397c49284b4bad Mon Sep 17 00:00:00 2001 From: Robert Elliott Date: Fri, 22 Jan 2016 13:32:30 +0100 -Subject: [PATCH] efiemu: Handle persistent RAM and unknown possible future - additions. +Subject: [PATCH 194/261] efiemu: Handle persistent RAM and unknown possible + future additions. (cherry picked from commit ae3b83a4d4df75a01198a2fed7542391e7c449e0) @@ -12,7 +12,7 @@ Resolves: rhbz#1288608 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c -index d4a4f3aad6d..13af4ad0dd8 100644 +index d4a4f3aad..13af4ad0d 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, @@ -82,3 +82,6 @@ index d4a4f3aad6d..13af4ad0dd8 100644 }; int i, j, k, done; +-- +2.13.5 + diff --git a/SOURCES/0195-efiemu-Fix-compilation-failure.patch b/SOURCES/0195-efiemu-Fix-compilation-failure.patch index 40d83ed..d43b594 100644 --- a/SOURCES/0195-efiemu-Fix-compilation-failure.patch +++ b/SOURCES/0195-efiemu-Fix-compilation-failure.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From bbe2526e1df870813b8e787cb2528c24f28907c1 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Jan 2016 14:10:30 +0100 -Subject: [PATCH] efiemu: Fix compilation failure +Subject: [PATCH 195/261] efiemu: Fix compilation failure (cherry picked from commit b6a03dfd327489d53ee07c6d7d593b99c7b7cb62) @@ -11,7 +11,7 @@ Resolves: rhbz#1288608 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c -index 13af4ad0dd8..e606dbffc92 100644 +index 13af4ad0d..e606dbffc 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, @@ -34,3 +34,6 @@ index 13af4ad0dd8..e606dbffc92 100644 break; } +-- +2.13.5 + diff --git a/SOURCES/0196-devmapper-getroot-use-makedev-instead-of-direct-shif.patch b/SOURCES/0196-devmapper-getroot-use-makedev-instead-of-direct-shif.patch index fe265df..4ccb2fc 100644 --- a/SOURCES/0196-devmapper-getroot-use-makedev-instead-of-direct-shif.patch +++ b/SOURCES/0196-devmapper-getroot-use-makedev-instead-of-direct-shif.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 5317bbcd5aa96b1c38d888ead78d640ec58d91a4 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 7 Nov 2015 09:46:46 +0300 -Subject: [PATCH] devmapper/getroot: use makedev instead of direct shift +Subject: [PATCH 196/261] devmapper/getroot: use makedev instead of direct + shift Fixes device detection with large number of devices. @@ -15,7 +16,7 @@ Resolves: rhbz#1279599 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c -index d02386b3498..de32102322b 100644 +index d02386b34..de3210232 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, @@ -28,3 +29,6 @@ index d02386b3498..de32102322b 100644 } *is_part = 0; return xstrdup (path); +-- +2.13.5 + diff --git a/SOURCES/0197-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch b/SOURCES/0197-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch index 429a49c..58e707d 100644 --- a/SOURCES/0197-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch +++ b/SOURCES/0197-loader-linux-do-not-pad-initrd-with-zeroes-at-the-en.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From d0bf58c1c71a1e192fa955e9786432bcdcb31bf1 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 7 May 2015 20:24:24 +0300 -Subject: [PATCH] loader/linux: do not pad initrd with zeroes at the end +Subject: [PATCH 197/261] 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 @@ -22,7 +23,7 @@ Resolves: rhbz#1219864 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c -index 117232f0c95..d2cd591f604 100644 +index 117232f0c..d2cd591f6 100644 --- a/grub-core/loader/linux.c +++ b/grub-core/loader/linux.c @@ -161,6 +161,9 @@ grub_initrd_init (int argc, char *argv[], @@ -67,3 +68,6 @@ index 117232f0c95..d2cd591f604 100644 } if (newc) ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); +-- +2.13.5 + diff --git a/SOURCES/0198-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch b/SOURCES/0198-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch index 11ffa6d..32332c7 100644 --- a/SOURCES/0198-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch +++ b/SOURCES/0198-Revert-reopen-SNP-protocol-for-exclusive-use-by-grub.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From cb6434fe9664ec06611ae2a7aff492b209da038e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 7 Apr 2016 10:58:06 -0400 -Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by grub" +Subject: [PATCH 198/261] 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. @@ -14,7 +15,7 @@ This reverts commit 147daeab22db793978f952b6f0d832919a1b0081. 1 file changed, 40 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index d8099a59855..3f112438a93 100644 +index d8099a598..3f112438a 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -340,7 +340,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -71,3 +72,6 @@ index d8099a59855..3f112438a93 100644 return; } } +-- +2.13.5 + diff --git a/SOURCES/0199-Add-a-url-parser.patch b/SOURCES/0199-Add-a-url-parser.patch index f04ab41..f9cafe1 100644 --- a/SOURCES/0199-Add-a-url-parser.patch +++ b/SOURCES/0199-Add-a-url-parser.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From d6fd74e8fd4180d7875c766884610809c546fc13 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 16:18:44 -0400 -Subject: [PATCH] Add a url parser. +Subject: [PATCH 199/261] 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. @@ -20,7 +20,7 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/net/url.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 9378c732981..d73ea6f6c51 100644 +index 9378c7329..d73ea6f6c 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -2103,6 +2103,7 @@ module = { @@ -32,7 +32,7 @@ index 9378c732981..d73ea6f6c51 100644 module = { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index a3e5056db3f..392c697db03 100644 +index a3e5056db..392c697db 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -325,6 +325,19 @@ grub_strrchr (const char *s, int c) @@ -57,7 +57,7 @@ index a3e5056db3f..392c697db03 100644 { diff --git a/grub-core/net/url.c b/grub-core/net/url.c new file mode 100644 -index 00000000000..537019f2c78 +index 000000000..537019f2c --- /dev/null +++ b/grub-core/net/url.c @@ -0,0 +1,856 @@ @@ -918,7 +918,7 @@ index 00000000000..537019f2c78 +} +#endif diff --git a/include/grub/misc.h b/include/grub/misc.h -index c6cd4564d86..34250291908 100644 +index c6cd4564d..342502919 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); @@ -982,7 +982,7 @@ index c6cd4564d86..34250291908 100644 { diff --git a/include/grub/net/url.h b/include/grub/net/url.h new file mode 100644 -index 00000000000..a215fa27d0a +index 000000000..a215fa27d --- /dev/null +++ b/include/grub/net/url.h @@ -0,0 +1,28 @@ @@ -1014,3 +1014,6 @@ index 00000000000..a215fa27d0a + char **host, int *port, char **file); + +#endif /* GRUB_URL_HEADER */ +-- +2.13.5 + diff --git a/SOURCES/0200-efinet-and-bootp-add-support-for-dhcpv6.patch b/SOURCES/0200-efinet-and-bootp-add-support-for-dhcpv6.patch index b2a0d52..65daadb 100644 --- a/SOURCES/0200-efinet-and-bootp-add-support-for-dhcpv6.patch +++ b/SOURCES/0200-efinet-and-bootp-add-support-for-dhcpv6.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 639509df0b3607b9fbd57ad4ad24ceb0913c8bda 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 +Subject: [PATCH 200/261] efinet and bootp: add support for dhcpv6 Signed-off-by: Peter Jones --- @@ -14,7 +14,7 @@ Signed-off-by: Peter Jones 6 files changed, 471 insertions(+), 14 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 88f20568914..4793ebc434e 100644 +index 88f205689..4793ebc43 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -23,6 +23,7 @@ @@ -205,7 +205,7 @@ index 88f20568914..4793ebc434e 100644 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 3f112438a93..d7befb2ba9b 100644 +index 3f112438a..d7befb2ba 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -18,11 +18,15 @@ @@ -313,7 +313,7 @@ index 3f112438a93..d7befb2ba9b 100644 } } diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index b10addbe27b..81d3b6208cb 100644 +index b10addbe2..81d3b6208 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 @@ -391,7 +391,7 @@ index b10addbe27b..81d3b6208cb 100644 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 51736142764..22a4debdcd4 100644 +index 517361427..22a4debdc 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) @@ -418,7 +418,7 @@ index 51736142764..22a4debdcd4 100644 return grub_errno; } diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index a6cce6e3395..9422ba9a9db 100644 +index a6cce6e33..9422ba9a9 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -527,10 +527,16 @@ typedef void *grub_efi_handle_t; @@ -573,7 +573,7 @@ index a6cce6e3395..9422ba9a9db 100644 typedef struct grub_efi_pxe diff --git a/include/grub/net.h b/include/grub/net.h -index 88fc71ceffe..c7b8e2ac885 100644 +index 88fc71cef..c7b8e2ac8 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -418,6 +418,51 @@ struct grub_net_bootp_packet @@ -650,3 +650,6 @@ index 88fc71ceffe..c7b8e2ac885 100644 grub_err_t grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf, int mask); +-- +2.13.5 + diff --git a/SOURCES/0201-ppc64le-has-no-separate-boot-mount-1261926.patch b/SOURCES/0201-ppc64le-has-no-separate-boot-mount-1261926.patch index 10cf282..ba73c3f 100644 --- a/SOURCES/0201-ppc64le-has-no-separate-boot-mount-1261926.patch +++ b/SOURCES/0201-ppc64le-has-no-separate-boot-mount-1261926.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 17a76a878a6843cbd5d62477caa93b0628d222cd 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) +Subject: [PATCH 201/261] 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. @@ -23,7 +23,7 @@ Resolves: rhbz#1261926 1 file changed, 9 deletions(-) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 7db89499949..0cfe6047539 100644 +index 7db894999..0cfe60475 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -291,12 +291,3 @@ fi @@ -39,3 +39,6 @@ index 7db89499949..0cfe6047539 100644 -if [ "${ARCH}" = "ppc64le" ]; then - sync && mountpoint -q /boot &&fsfreeze -f /boot && fsfreeze -u /boot -fi +-- +2.13.5 + diff --git a/SOURCES/0202-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch b/SOURCES/0202-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch index b9c7b05..6a6efa7 100644 --- a/SOURCES/0202-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch +++ b/SOURCES/0202-Add-grub-get-kernel-settings-and-use-it-in-10_linux.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From c299f8584bb1084916ac794a9ebed8324ae4bb10 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 +Subject: [PATCH 202/261] 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 @@ -11,9 +11,9 @@ debug stanzas. Resolves: rhbz#1226325 --- - configure.ac | 2 + - Makefile.util.def | 7 ++ .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 ++++++++++++++++++++++++++ @@ -23,8 +23,38 @@ Resolves: rhbz#1226325 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 e49f76b11..547ef0bcf 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 e2821a2f3..3918e3b52 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 04c052dc610..8b10a93cb56 100644 +index 04c052dc6..8b10a93cb 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ grub_TRANSFORM([grub-install]) @@ -43,45 +73,14 @@ index 04c052dc610..8b10a93cb56 100644 grub_TRANSFORM([grub-glue-efi.3]) grub_TRANSFORM([grub-install.1]) grub_TRANSFORM([grub-kbdcomp.3]) -diff --git a/Makefile.util.def b/Makefile.util.def -index e2821a2f3a5..3918e3b5292 100644 ---- a/Makefile.util.def -+++ b/Makefile.util.def -@@ -704,6 +704,13 @@ script = { - installdir = sbin; - }; - -+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; -diff --git a/.gitignore b/.gitignore -index e49f76b114a..547ef0bcff0 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/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in -index 44bf135b9f8..5c4acd496d4 100644 +index 44bf135b9..5c4acd496 100644 --- a/util/bash-completion.d/grub-completion.bash.in +++ b/util/bash-completion.d/grub-completion.bash.in -@@ -264,6 +264,28 @@ have ${__grub_sparc64_setup_program} && \ - unset __grub_sparc64_setup_program +@@ -265,6 +265,28 @@ unset __grub_sparc64_setup_program -+# + # +# grub-get-kernel-settings +# +_grub_get_kernel_settings () { @@ -103,12 +102,13 @@ index 44bf135b9f8..5c4acd496d4 100644 +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 00000000000..ba33330e28d +index 000000000..ba33330e2 --- /dev/null +++ b/util/grub-get-kernel-settings.3 @@ -0,0 +1,20 @@ @@ -134,7 +134,7 @@ index 00000000000..ba33330e28d +.BR "info grub" diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in new file mode 100644 -index 00000000000..ae0b4696d49 +index 000000000..ae0b4696d --- /dev/null +++ b/util/grub-get-kernel-settings.in @@ -0,0 +1,91 @@ @@ -230,7 +230,7 @@ index 00000000000..ae0b4696d49 + echo GRUB_LINUX_DEBUG_TITLE_POSTFIX=\" with debugging\" +fi diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index 0cfe6047539..aa4fdb8a3b2 100644 +index 0cfe60475..aa4fdb8a3 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -42,6 +42,7 @@ grub_probe="${sbindir}/@grub_probe@" @@ -251,7 +251,7 @@ index 0cfe6047539..aa4fdb8a3b2 100644 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 b3c460cb266..0d0086d3b6a 100644 +index b3c460cb2..0d0086d3b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -99,7 +99,8 @@ linux_entry () @@ -310,3 +310,6 @@ index b3c460cb266..0d0086d3b6a 100644 "single ${GRUB_CMDLINE_LINUX}" fi +-- +2.13.5 + diff --git a/SOURCES/0203-Fix-coverity-issues-in-shell-scripts-1226325.patch b/SOURCES/0203-Fix-coverity-issues-in-shell-scripts-1226325.patch index 7ebed51..6148153 100644 --- a/SOURCES/0203-Fix-coverity-issues-in-shell-scripts-1226325.patch +++ b/SOURCES/0203-Fix-coverity-issues-in-shell-scripts-1226325.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From de072639935e3f8a0e43f7f5c5961a919d950406 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 7 Jul 2016 15:05:26 -0400 -Subject: [PATCH] Fix coverity issues in shell scripts (#1226325) +Subject: [PATCH 203/261] 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. @@ -13,7 +13,7 @@ Related: rhbz#1226325 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in -index ae0b4696d49..cee8c209650 100644 +index ae0b4696d..cee8c2096 100644 --- a/util/grub-get-kernel-settings.in +++ b/util/grub-get-kernel-settings.in @@ -21,27 +21,18 @@ prefix="@prefix@" @@ -45,7 +45,7 @@ index ae0b4696d49..cee8c209650 100644 export TEXTDOMAINDIR="@localedir@" diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index aa4fdb8a3b2..86801aa4e5c 100644 +index aa4fdb8a3..86801aa4e 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -149,7 +149,7 @@ if test -f ${sysconfdir}/default/grub ; then @@ -57,3 +57,6 @@ index aa4fdb8a3b2..86801aa4e5c 100644 if [ "x$GRUB_DISABLE_UUID" != "xtrue" -a -z "$GRUB_DEVICE_UUID" ]; then GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED" +-- +2.13.5 + diff --git a/SOURCES/0204-Fix-compiler-warning-1154226.patch b/SOURCES/0204-Fix-compiler-warning-1154226.patch index bbc07f5..d774034 100644 --- a/SOURCES/0204-Fix-compiler-warning-1154226.patch +++ b/SOURCES/0204-Fix-compiler-warning-1154226.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 3b0de305e13b88007b1e414f656ef8de02e92e1f Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Thu, 7 Jul 2016 16:30:32 -0400 -Subject: [PATCH] Fix compiler warning (#1154226) +Subject: [PATCH 204/261] 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 @@ -13,7 +13,7 @@ Related: rhbz#1154226 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 d7befb2ba9b..ed103df7a80 100644 +index d7befb2ba..ed103df7a 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -415,7 +415,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -25,3 +25,6 @@ index d7befb2ba9b..ed103df7a80 100644 1, device, path); grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); } +-- +2.13.5 + diff --git a/SOURCES/0205-Fix-CLANG-error-from-Coverity-1154226.patch b/SOURCES/0205-Fix-CLANG-error-from-Coverity-1154226.patch index 9144313..4266124 100644 --- a/SOURCES/0205-Fix-CLANG-error-from-Coverity-1154226.patch +++ b/SOURCES/0205-Fix-CLANG-error-from-Coverity-1154226.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 3305aab87c435486dd9f83364c145577cf80e49b Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Mon, 11 Jul 2016 10:59:48 -0400 -Subject: [PATCH] Fix CLANG error from Coverity (#1154226) +Subject: [PATCH 205/261] Fix CLANG error from Coverity (#1154226) Resolved a null pointer deference warning from coverity. @@ -11,7 +11,7 @@ Related: rhbz#1154226 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/net/url.c b/grub-core/net/url.c -index 537019f2c78..146858284cd 100644 +index 537019f2c..146858284 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, @@ -28,3 +28,6 @@ index 537019f2c78..146858284cd 100644 *host_end = '\0'; *host = grub_strndup (host_off, l); *host_end = c; +-- +2.13.5 + diff --git a/SOURCES/0206-grub_ipv6_get_masksize-fix-loop-iteration-error.patch b/SOURCES/0206-grub_ipv6_get_masksize-fix-loop-iteration-error.patch index 9220c3d..de0c728 100644 --- a/SOURCES/0206-grub_ipv6_get_masksize-fix-loop-iteration-error.patch +++ b/SOURCES/0206-grub_ipv6_get_masksize-fix-loop-iteration-error.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From eeccd94f448dda6996ff4b494557c4ad5fc716c5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 11 Jul 2016 15:43:01 -0400 -Subject: [PATCH] grub_ipv6_get_masksize: fix loop iteration error +Subject: [PATCH 206/261] grub_ipv6_get_masksize: fix loop iteration error Related: rhbz#1154226 @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 81d3b6208cb..19a81bc9e78 100644 +index 81d3b6208..19a81bc9e 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) @@ -23,3 +23,6 @@ index 81d3b6208cb..19a81bc9e78 100644 { grub_uint8_t octet = mask[x]; while (octet & 0x80) +-- +2.13.5 + diff --git a/SOURCES/0207-efinet-fix-some-coverity-gripes.patch b/SOURCES/0207-efinet-fix-some-coverity-gripes.patch index 170cb6a..ac9d1cc 100644 --- a/SOURCES/0207-efinet-fix-some-coverity-gripes.patch +++ b/SOURCES/0207-efinet-fix-some-coverity-gripes.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 9bd2624ad05dc1a78a094d48f78e7a8a07deec24 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 11 Jul 2016 15:57:28 -0400 -Subject: [PATCH] efinet: fix some coverity gripes. +Subject: [PATCH 207/261] efinet: fix some coverity gripes. Related: rhbz#1154226 @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 4793ebc434e..46ce8135ac5 100644 +index 4793ebc43..46ce8135a 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, @@ -32,7 +32,7 @@ index 4793ebc434e..46ce8135ac5 100644 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 ed103df7a80..2244f14030f 100644 +index ed103df7a..2244f1403 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -401,6 +401,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -60,3 +60,6 @@ index ed103df7a80..2244f14030f 100644 } else { +-- +2.13.5 + diff --git a/SOURCES/0208-Fix-another-coverity-gripe-about-a-missing-typecast.patch b/SOURCES/0208-Fix-another-coverity-gripe-about-a-missing-typecast.patch index 91f2f30..f64f5c2 100644 --- a/SOURCES/0208-Fix-another-coverity-gripe-about-a-missing-typecast.patch +++ b/SOURCES/0208-Fix-another-coverity-gripe-about-a-missing-typecast.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 5cebfafb919ac5496ab9df734c8f33a6dc688a21 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 12 Jul 2016 10:23:42 -0400 -Subject: [PATCH] Fix another coverity gripe about a missing typecast. +Subject: [PATCH 208/261] Fix another coverity gripe about a missing typecast. Related: rhbz#1154226 @@ -11,7 +11,7 @@ Signed-off-by: Peter Jones 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 2244f14030f..69b0fc7a8fe 100644 +index 2244f1403..69b0fc7a8 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -415,10 +415,9 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, @@ -28,3 +28,6 @@ index 2244f14030f..69b0fc7a8fe 100644 if (intf && device && path) grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); } +-- +2.13.5 + diff --git a/SOURCES/0209-Fix-duplicate-shell-entries-1226325.patch b/SOURCES/0209-Fix-duplicate-shell-entries-1226325.patch index 2b036af..1a4e97e 100644 --- a/SOURCES/0209-Fix-duplicate-shell-entries-1226325.patch +++ b/SOURCES/0209-Fix-duplicate-shell-entries-1226325.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 80351cdb2246c4d213440cdee73a2284eb5fa667 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Tue, 12 Jul 2016 10:25:16 -0400 -Subject: [PATCH] Fix duplicate shell entries (#1226325) +Subject: [PATCH 209/261] Fix duplicate shell entries (#1226325) Coverity discovered more of the same non-used shell variables that had appeared more than once in the file. @@ -12,7 +12,7 @@ Related: rhbz#1226325 1 file changed, 7 deletions(-) diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in -index cee8c209650..6a68a0ef664 100644 +index cee8c2096..6a68a0ef6 100644 --- a/util/grub-get-kernel-settings.in +++ b/util/grub-get-kernel-settings.in @@ -17,13 +17,6 @@ set -e @@ -29,3 +29,6 @@ index cee8c209650..6a68a0ef664 100644 PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ datadir="@datadir@" +-- +2.13.5 + diff --git a/SOURCES/0210-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch b/SOURCES/0210-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch index 5936422..831d921 100644 --- a/SOURCES/0210-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch +++ b/SOURCES/0210-Coverity-rightly-noticed-that-grub_ipv6_get_masksize.patch @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From d9431a66b312084644186f16ba9ca2f9f21b64dd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 12 Jul 2016 11:59:39 -0400 -Subject: [PATCH] Coverity rightly noticed that grub_ipv6_get_masksize() was - broken. +Subject: [PATCH 210/261] Coverity rightly noticed that + grub_ipv6_get_masksize() was broken. This fixes it with a version that even seems to work. @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 19a81bc9e78..36fc0d8b2e8 100644 +index 19a81bc9e..36fc0d8b2 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 @@ -73,7 +73,7 @@ index 19a81bc9e78..36fc0d8b2e8 100644 if (mask == -1) return 0; diff --git a/include/grub/net.h b/include/grub/net.h -index c7b8e2ac885..bd930f4dd8c 100644 +index c7b8e2ac8..bd930f4dd 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -500,7 +500,7 @@ grub_net_configure_by_dhcpv6_ack (const char *name, @@ -85,3 +85,6 @@ index c7b8e2ac885..bd930f4dd8c 100644 grub_err_t grub_net_add_ipv6_local (struct grub_net_network_level_interface *inf, +-- +2.13.5 + diff --git a/SOURCES/0211-Export-grub-get-kernel-settings-variables.patch b/SOURCES/0211-Export-grub-get-kernel-settings-variables.patch index a2420d7..2dd9770 100644 --- a/SOURCES/0211-Export-grub-get-kernel-settings-variables.patch +++ b/SOURCES/0211-Export-grub-get-kernel-settings-variables.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From ced9279bcfc644d1b6a5e06b91974b82bdb19965 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 +Subject: [PATCH 211/261] Export grub-get-kernel-settings variables Without this export, the generators for various configs never get the setting. @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in -index 6a68a0ef664..12046219878 100644 +index 6a68a0ef6..120462198 100644 --- a/util/grub-get-kernel-settings.in +++ b/util/grub-get-kernel-settings.in @@ -70,6 +70,9 @@ fi @@ -29,7 +29,7 @@ index 6a68a0ef664..12046219878 100644 + 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 0d0086d3b6a..bf0fb727bcd 100644 +index 0d0086d3b..bf0fb727b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -127,13 +127,13 @@ linux_entry () @@ -49,3 +49,6 @@ index 0d0086d3b6a..bf0fb727bcd 100644 if [ x$type != xrecovery ] ; then save_default_entry | grub_add_tab fi +-- +2.13.5 + diff --git a/SOURCES/0212-Normalize-slashes-in-tftp-paths.patch b/SOURCES/0212-Normalize-slashes-in-tftp-paths.patch index b89abf9..894e49e 100644 --- a/SOURCES/0212-Normalize-slashes-in-tftp-paths.patch +++ b/SOURCES/0212-Normalize-slashes-in-tftp-paths.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 34dbd541e7baea7391f11377d83db707568a8d91 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. +Subject: [PATCH 212/261] 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. @@ -12,7 +12,7 @@ Signed-off-by: Peter Jones 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 22a4debdcd4..8632339de97 100644 +index 22a4debdc..8632339de 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -300,6 +300,25 @@ destroy_pq (tftp_data_t data) @@ -57,3 +57,6 @@ index 22a4debdcd4..8632339de97 100644 grub_strcpy (rrq, "octet"); rrqlen += grub_strlen ("octet") + 1; +-- +2.13.5 + diff --git a/SOURCES/0213-bz1374141-fix-incorrect-mask-for-ppc64.patch b/SOURCES/0213-bz1374141-fix-incorrect-mask-for-ppc64.patch index a0b1016..2dde05d 100644 --- a/SOURCES/0213-bz1374141-fix-incorrect-mask-for-ppc64.patch +++ b/SOURCES/0213-bz1374141-fix-incorrect-mask-for-ppc64.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 74ec6c9840a3f297c6f7d7b9efe8d86cd807800c Mon Sep 17 00:00:00 2001 From: Masahiro Matsuya Date: Sat, 29 Oct 2016 08:35:26 +0900 -Subject: [PATCH] bz1374141 fix incorrect mask for ppc64 +Subject: [PATCH 213/261] bz1374141 fix incorrect mask for ppc64 The netmask configured in firmware is not respected on ppc64 (big endian). When 255.255.252.0 is set as netmask in firmware, the following is the value of bootpath string in grub_ieee1275_parse_bootpath(). @@ -30,7 +30,7 @@ The count of zero with __builtin_clz can be 22. (clz counts the number of one bi 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index eea8e71d300..cd24ddc99c5 100644 +index eea8e71d3..cd24ddc99 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -208,7 +208,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, @@ -42,3 +42,6 @@ index eea8e71d300..cd24ddc99c5 100644 } if (gateway_addr.ipv4 != 0) +-- +2.13.5 + diff --git a/SOURCES/0214-Make-efi-machines-load-an-env-block-from-a-variable.patch b/SOURCES/0214-Make-efi-machines-load-an-env-block-from-a-variable.patch index 9f253ca..5b12a2a 100644 --- a/SOURCES/0214-Make-efi-machines-load-an-env-block-from-a-variable.patch +++ b/SOURCES/0214-Make-efi-machines-load-an-env-block-from-a-variable.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 5523aa5913effd0f93bc4ba8f8a8c1d97e747930 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 7 Dec 2015 14:20:49 -0500 -Subject: [PATCH] Make efi machines load an env block from a variable +Subject: [PATCH 214/261] Make efi machines load an env block from a variable Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index d73ea6f6c51..4fc74393335 100644 +index d73ea6f6c..4fc743933 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -173,6 +173,7 @@ kernel = { @@ -22,7 +22,7 @@ index d73ea6f6c51..4fc74393335 100644 x86 = kern/i386/tsc.c; diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c -index c391df48236..c5d8a76144a 100644 +index c391df482..c5d8a7614 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -25,9 +25,40 @@ @@ -79,3 +79,6 @@ index c391df48236..c5d8a76144a 100644 char **device, char **path); +-- +2.13.5 + diff --git a/SOURCES/0215-Fix-race-in-EFI-validation.patch b/SOURCES/0215-Fix-race-in-EFI-validation.patch index ce42a83..a9a67e6 100644 --- a/SOURCES/0215-Fix-race-in-EFI-validation.patch +++ b/SOURCES/0215-Fix-race-in-EFI-validation.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From b0c5ad48da4ee57aa56755bf0a38671de7e0dfc1 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 14 Jul 2015 16:58:51 -0700 -Subject: [PATCH] Fix race in EFI validation +Subject: [PATCH 215/261] Fix race in EFI validation --- grub-core/loader/i386/efi/linux.c | 44 ++++++++++----------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index e5b778577f9..7ccf32d9d45 100644 +index e5b778577..7ccf32d9d 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -154,7 +154,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -92,3 +92,6 @@ index e5b778577f9..7ccf32d9d45 100644 if (grub_errno != GRUB_ERR_NONE) { grub_dl_unref (my_mod); +-- +2.13.5 + diff --git a/SOURCES/0216-efi-chainloader-fix-use-after-free.patch b/SOURCES/0216-efi-chainloader-fix-use-after-free.patch index 6bbc6d5..1449b8c 100644 --- a/SOURCES/0216-efi-chainloader-fix-use-after-free.patch +++ b/SOURCES/0216-efi-chainloader-fix-use-after-free.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 2dbafd9ecd2d805385d93e0eca587d473a6bc220 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sat, 20 Jun 2015 23:38:17 +0300 -Subject: [PATCH] efi/chainloader: fix use after free +Subject: [PATCH 216/261] efi/chainloader: fix use after free Found by: Coverity scan. CID: 96714 @@ -10,7 +10,7 @@ CID: 96714 1 file changed, 1 insertion(+) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 233237018b5..ec23cf4ed66 100644 +index 233237018..ec23cf4ed 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -351,6 +351,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), @@ -21,3 +21,6 @@ index 233237018b5..ec23cf4ed66 100644 if (argc > 1) { +-- +2.13.5 + diff --git a/SOURCES/0217-chainloader-fix-resoource-leak.patch b/SOURCES/0217-chainloader-fix-resoource-leak.patch index e078f02..458bbf7 100644 --- a/SOURCES/0217-chainloader-fix-resoource-leak.patch +++ b/SOURCES/0217-chainloader-fix-resoource-leak.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 1ab98376bfb9c19fcf44f826652dbfd4ac7727e6 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 26 Jun 2015 09:25:30 +0300 -Subject: [PATCH] chainloader: fix resoource leak +Subject: [PATCH 217/261] chainloader: fix resoource leak Found by: Coverity scan. CID: 96651 @@ -10,7 +10,7 @@ CID: 96651 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index ec23cf4ed66..522a716e37d 100644 +index ec23cf4ed..522a716e3 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -350,9 +350,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), @@ -33,3 +33,6 @@ index ec23cf4ed66..522a716e37d 100644 grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); return 0; +-- +2.13.5 + diff --git a/SOURCES/0218-efi-properly-terminate-filepath-with-NULL-in-chainlo.patch b/SOURCES/0218-efi-properly-terminate-filepath-with-NULL-in-chainlo.patch index ff187f2..674d16e 100644 --- a/SOURCES/0218-efi-properly-terminate-filepath-with-NULL-in-chainlo.patch +++ b/SOURCES/0218-efi-properly-terminate-filepath-with-NULL-in-chainlo.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 3b6450b338cdc9f58c74f164e9bf0a7d55d6c9a5 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Thu, 15 Dec 2016 16:07:00 +0300 -Subject: [PATCH] efi: properly terminate filepath with NULL in chainloader +Subject: [PATCH 218/261] efi: properly terminate filepath with NULL in + chainloader EFI File Path Media Device Path is defined as NULL terminated string; but chainloader built file paths without final NULL. This caused error @@ -15,7 +16,7 @@ Reported and tested by Giovanni Santini 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 522a716e37d..adc85636633 100644 +index 522a716e3..adc856366 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -122,6 +122,8 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, @@ -39,3 +40,6 @@ index 522a716e37d..adc85636633 100644 * GRUB_MAX_UTF16_PER_UTF8 * sizeof (grub_efi_char16_t)) + sizeof (grub_efi_file_path_device_path_t) * 2); +-- +2.13.5 + diff --git a/SOURCES/0219-Use-device-part-of-chainloader-target-if-present.patch b/SOURCES/0219-Use-device-part-of-chainloader-target-if-present.patch index 28efeb0..08e8f86 100644 --- a/SOURCES/0219-Use-device-part-of-chainloader-target-if-present.patch +++ b/SOURCES/0219-Use-device-part-of-chainloader-target-if-present.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6dcd783f22fd6253c3ee0b8a19fc6e3ea37a1cc9 Mon Sep 17 00:00:00 2001 From: Raymund Will Date: Fri, 10 Apr 2015 01:45:02 -0400 -Subject: [PATCH] Use device part of chainloader target, if present. +Subject: [PATCH 219/261] Use device part of chainloader target, if present. Otherwise chainloading is restricted to '$root', which might not even be readable by EFI! @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index adc85636633..14ce6ddd7ad 100644 +index adc856366..14ce6ddd7 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -223,8 +223,11 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), @@ -32,3 +32,6 @@ index adc85636633..14ce6ddd7ad 100644 if (! dev) goto fail; +-- +2.13.5 + diff --git a/SOURCES/0220-Add-secureboot-support-on-efi-chainloader.patch b/SOURCES/0220-Add-secureboot-support-on-efi-chainloader.patch index 15f2968..6669cc8 100644 --- a/SOURCES/0220-Add-secureboot-support-on-efi-chainloader.patch +++ b/SOURCES/0220-Add-secureboot-support-on-efi-chainloader.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8ffcc1083fd421756da76783df83b81d4bdbfb52 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 13:04:37 -0400 -Subject: [PATCH] Add secureboot support on efi chainloader +Subject: [PATCH 220/261] Add secureboot support on efi chainloader Expand the chainloader to be able to verify the image by means of shim lock protocol. The PE/COFF image is loaded and relocated by the @@ -22,7 +22,7 @@ Signed-off-by: Peter Jones 2 files changed, 595 insertions(+), 37 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 14ce6ddd7ad..87a91e16f17 100644 +index 14ce6ddd7..87a91e16f 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -32,6 +32,8 @@ @@ -758,7 +758,7 @@ index 14ce6ddd7ad..87a91e16f17 100644 return grub_errno; diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index f79c36c026e..f79782e1bde 100644 +index f79c36c02..f79782e1b 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -212,7 +212,11 @@ struct grub_pe64_optional_header @@ -795,3 +795,6 @@ index f79c36c026e..f79782e1bde 100644 struct grub_pe32_fixup_block { grub_uint32_t page_rva; +-- +2.13.5 + diff --git a/SOURCES/0221-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch b/SOURCES/0221-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch index 7b98145..114157c 100644 --- a/SOURCES/0221-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch +++ b/SOURCES/0221-Make-any-of-the-loaders-that-link-in-efi-mode-honor-.patch @@ -1,14 +1,15 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From a28fc78d531ea309d59d085ce89bcc292f35774e Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 6 Oct 2015 16:09:25 -0400 -Subject: [PATCH] Make any of the loaders that link in efi mode honor secure - boot. +Subject: [PATCH 221/261] Make any of the loaders that link in efi mode honor + secure boot. And in this case "honor" means "even if somebody does link this in, they won't register commands if SB is enabled." Signed-off-by: Peter Jones --- + grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 2 ++ grub-core/commands/iorw.c | 7 +++++ grub-core/commands/memrw.c | 7 +++++ @@ -27,7 +28,6 @@ Signed-off-by: Peter Jones include/grub/mips/linux.h | 0 include/grub/powerpc/linux.h | 0 include/grub/sparc64/linux.h | 0 - grub-core/Makefile.am | 1 + 19 files changed, 147 insertions(+), 29 deletions(-) create mode 100644 grub-core/kern/efi/sb.c create mode 100644 include/grub/efi/sb.h @@ -36,8 +36,20 @@ Signed-off-by: Peter Jones create mode 100644 include/grub/powerpc/linux.h create mode 100644 include/grub/sparc64/linux.h +diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am +index cb7fd9f98..be29e327f 100644 +--- a/grub-core/Makefile.am ++++ b/grub-core/Makefile.am +@@ -67,6 +67,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h ++KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h + KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 4fc74393335..b340ceeec7f 100644 +index 4fc743933..b340ceeec 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -175,6 +175,8 @@ kernel = { @@ -50,7 +62,7 @@ index 4fc74393335..b340ceeec7f 100644 i386_efi = kern/i386/efi/init.c; diff --git a/grub-core/commands/iorw.c b/grub-core/commands/iorw.c -index a0c164e54f0..41a7f3f0466 100644 +index a0c164e54..41a7f3f04 100644 --- a/grub-core/commands/iorw.c +++ b/grub-core/commands/iorw.c @@ -23,6 +23,7 @@ @@ -82,7 +94,7 @@ index a0c164e54f0..41a7f3f0466 100644 grub_unregister_extcmd (cmd_read_word); grub_unregister_extcmd (cmd_read_dword); diff --git a/grub-core/commands/memrw.c b/grub-core/commands/memrw.c -index 98769eadb34..088cbe9e2bc 100644 +index 98769eadb..088cbe9e2 100644 --- a/grub-core/commands/memrw.c +++ b/grub-core/commands/memrw.c @@ -22,6 +22,7 @@ @@ -114,7 +126,7 @@ index 98769eadb34..088cbe9e2bc 100644 grub_unregister_extcmd (cmd_read_word); grub_unregister_extcmd (cmd_read_dword); diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index c80d85b677e..7dfe2ef1455 100644 +index c80d85b67..7dfe2ef14 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -260,34 +260,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -154,7 +166,7 @@ index c80d85b677e..7dfe2ef1455 100644 /* Search the mods section from the PE32/PE32+ image. This code uses diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c new file mode 100644 -index 00000000000..a41b6c5b851 +index 000000000..a41b6c5b8 --- /dev/null +++ b/grub-core/kern/efi/sb.c @@ -0,0 +1,58 @@ @@ -217,7 +229,7 @@ index 00000000000..a41b6c5b851 +#endif +} diff --git a/grub-core/loader/efi/appleloader.c b/grub-core/loader/efi/appleloader.c -index 74888c463ba..69c2a10d351 100644 +index 74888c463..69c2a10d3 100644 --- a/grub-core/loader/efi/appleloader.c +++ b/grub-core/loader/efi/appleloader.c @@ -24,6 +24,7 @@ @@ -248,7 +260,7 @@ index 74888c463ba..69c2a10d351 100644 grub_unregister_command (cmd); } diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 87a91e16f17..aee8e6becf6 100644 +index 87a91e16f..aee8e6bec 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -34,6 +34,7 @@ @@ -260,7 +272,7 @@ index 87a91e16f17..aee8e6becf6 100644 #include #include diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c -index 8f691e0e2d1..b671f59b62a 100644 +index 8f691e0e2..b671f59b6 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -38,6 +38,7 @@ @@ -292,7 +304,7 @@ index 8f691e0e2d1..b671f59b62a 100644 grub_unregister_extcmd (cmd_openbsd); grub_unregister_extcmd (cmd_netbsd); diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 2ae176315b6..bd37c69b5d0 100644 +index 2ae176315..bd37c69b5 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -35,6 +35,7 @@ @@ -324,7 +336,7 @@ index 2ae176315b6..bd37c69b5d0 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index b481e466846..b19527e8e17 100644 +index b481e4668..b19527e8e 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -35,6 +35,7 @@ @@ -356,7 +368,7 @@ index b481e466846..b19527e8e17 100644 grub_unregister_command (cmd_initrd); } diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c -index 4b71f336353..e4e696e8f89 100644 +index 4b71f3363..e4e696e8f 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c @@ -42,6 +42,7 @@ @@ -388,7 +400,7 @@ index 4b71f336353..e4e696e8f89 100644 grub_unregister_command (cmd_module); } diff --git a/grub-core/loader/xnu.c b/grub-core/loader/xnu.c -index cdd9715cedd..faffccc9744 100644 +index cdd9715ce..faffccc97 100644 --- a/grub-core/loader/xnu.c +++ b/grub-core/loader/xnu.c @@ -33,6 +33,7 @@ @@ -420,7 +432,7 @@ index cdd9715cedd..faffccc9744 100644 grub_unregister_command (cmd_resume); #endif diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 22456327e13..9a2da0eb38d 100644 +index 22456327e..9a2da0eb3 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -76,7 +76,6 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var, @@ -433,7 +445,7 @@ index 22456327e13..9a2da0eb38d 100644 const grub_efi_device_path_t *dp2); diff --git a/include/grub/efi/sb.h b/include/grub/efi/sb.h new file mode 100644 -index 00000000000..9629fbb0f9e +index 000000000..9629fbb0f --- /dev/null +++ b/include/grub/efi/sb.h @@ -0,0 +1,29 @@ @@ -468,25 +480,16 @@ index 00000000000..9629fbb0f9e +#endif /* ! GRUB_EFI_SB_HEADER */ diff --git a/include/grub/ia64/linux.h b/include/grub/ia64/linux.h new file mode 100644 -index 00000000000..e69de29bb2d +index 000000000..e69de29bb diff --git a/include/grub/mips/linux.h b/include/grub/mips/linux.h new file mode 100644 -index 00000000000..e69de29bb2d +index 000000000..e69de29bb diff --git a/include/grub/powerpc/linux.h b/include/grub/powerpc/linux.h new file mode 100644 -index 00000000000..e69de29bb2d +index 000000000..e69de29bb diff --git a/include/grub/sparc64/linux.h b/include/grub/sparc64/linux.h new file mode 100644 -index 00000000000..e69de29bb2d -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index cb7fd9f98e8..be29e327f77 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -67,6 +67,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h -+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h - KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h +index 000000000..e69de29bb +-- +2.13.5 + diff --git a/SOURCES/0222-Rework-linux-command.patch b/SOURCES/0222-Rework-linux-command.patch index faab6c2..f397239 100644 --- a/SOURCES/0222-Rework-linux-command.patch +++ b/SOURCES/0222-Rework-linux-command.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8fab682a279979b48f7aa8c665aad7af1f38f6ea Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:12:39 -0700 -Subject: [PATCH] Rework linux command +Subject: [PATCH 222/261] Rework linux command We want a single buffer that contains the entire kernel image in order to perform a TPM measurement. Allocate one and copy the entire kernel into it @@ -11,7 +11,7 @@ before pulling out the individual blocks later on. 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index bd37c69b5d0..53f74ae0685 100644 +index bd37c69b5..53f74ae06 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -682,12 +682,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -102,3 +102,6 @@ index bd37c69b5d0..53f74ae0685 100644 if (file) grub_file_close (file); +-- +2.13.5 + diff --git a/SOURCES/0223-Rework-linux16-command.patch b/SOURCES/0223-Rework-linux16-command.patch index 37c7671..9a8f567 100644 --- a/SOURCES/0223-Rework-linux16-command.patch +++ b/SOURCES/0223-Rework-linux16-command.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 704890aaa1d5ba485f538cdf20b1030798253c87 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Sun, 9 Aug 2015 16:20:58 -0700 -Subject: [PATCH] Rework linux16 command +Subject: [PATCH 223/261] Rework linux16 command We want a single buffer that contains the entire kernel image in order to perform a TPM measurement. Allocate one and copy the entire kernel int it @@ -11,7 +11,7 @@ before pulling out the individual blocks later on. 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index b19527e8e17..60bb31fbf0d 100644 +index b19527e8e..60bb31fbf 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -124,13 +124,14 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -151,3 +151,6 @@ index b19527e8e17..60bb31fbf0d 100644 && grub_le_to_cpu16 (lh->version) >= 0x0200)) { grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd"); +-- +2.13.5 + diff --git a/SOURCES/0224-Re-work-some-intricacies-of-PE-loading.patch b/SOURCES/0224-Re-work-some-intricacies-of-PE-loading.patch index cce6e3c..116ed21 100644 --- a/SOURCES/0224-Re-work-some-intricacies-of-PE-loading.patch +++ b/SOURCES/0224-Re-work-some-intricacies-of-PE-loading.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From c4b5674831842e954f261a99c260866ea69361c9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 9 Jun 2016 12:22:29 -0400 -Subject: [PATCH] Re-work some intricacies of PE loading. +Subject: [PATCH 224/261] Re-work some intricacies of PE loading. The PE spec is not a well written document, and awesomely every place where there's an ambiguous way to read something, Windows' bootmgfw.efi @@ -12,7 +12,7 @@ takes a different read than either of them. 2 files changed, 152 insertions(+), 36 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index aee8e6becf6..4b77a7d5adb 100644 +index aee8e6bec..4b77a7d5a 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -301,7 +301,7 @@ image_is_64_bit (grub_pe_header_t *pe_hdr) @@ -293,7 +293,7 @@ index aee8e6becf6..4b77a7d5adb 100644 efi_call_1 (b->free_pool, buffer); diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h -index f79782e1bde..8396bde4917 100644 +index f79782e1b..8396bde49 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -227,12 +227,18 @@ struct grub_pe32_section_table @@ -348,3 +348,6 @@ index f79782e1bde..8396bde4917 100644 #define GRUB_PE32_SIGNATURE_SIZE 4 struct grub_pe32_header +-- +2.13.5 + diff --git a/SOURCES/0225-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch b/SOURCES/0225-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch index e099f5e..33536c6 100644 --- a/SOURCES/0225-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch +++ b/SOURCES/0225-Rework-even-more-of-efi-chainload-so-non-sb-cases-wo.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 73824741ad83df88b74072e18e6045b05267cc04 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 10 Jun 2016 14:06:15 -0400 -Subject: [PATCH] Rework even more of efi chainload so non-sb cases work right. +Subject: [PATCH 225/261] Rework even more of efi chainload so non-sb cases + work right. This ensures that if shim protocol is not loaded, or is loaded but shim is disabled, we will fall back to a correct load method for the efi @@ -43,14 +44,14 @@ Signed-off-by: Peter Jones --- grub-core/kern/efi/sb.c | 14 +++-- grub-core/loader/arm64/linux.c | 4 +- - grub-core/loader/efi/chainloader.c | 117 ++++++++++++++++++++++--------------- + grub-core/loader/efi/chainloader.c | 115 ++++++++++++++++++++++--------------- grub-core/loader/efi/linux.c | 13 +++-- grub-core/loader/i386/efi/linux.c | 10 +++- include/grub/efi/linux.h | 2 +- - 6 files changed, 100 insertions(+), 60 deletions(-) + 6 files changed, 99 insertions(+), 59 deletions(-) diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c -index a41b6c5b851..d74778b0cac 100644 +index a41b6c5b8..d74778b0c 100644 --- a/grub-core/kern/efi/sb.c +++ b/grub-core/kern/efi/sb.c @@ -36,14 +36,20 @@ grub_efi_secure_boot (void) @@ -79,7 +80,7 @@ index a41b6c5b851..d74778b0cac 100644 if (*secure_boot && !*setup_mode) ret = 1; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index bdd9c9b4968..0452a20e98b 100644 +index bdd9c9b49..0452a20e9 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -380,6 +380,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -101,7 +102,7 @@ index bdd9c9b4968..0452a20e98b 100644 grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]); goto fail; diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 4b77a7d5adb..3e89de9006c 100644 +index 4b77a7d5a..3e89de900 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -182,7 +182,6 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) @@ -133,7 +134,7 @@ index 4b77a7d5adb..3e89de9006c 100644 } static void* -@@ -514,18 +512,25 @@ handle_image (void *data, grub_efi_uint32_t datasize) +@@ -514,17 +512,24 @@ handle_image (void *data, grub_efi_uint32_t datasize) grub_uint32_t section_alignment; grub_uint32_t buffer_size; int found_entry_point = 0; @@ -142,33 +143,30 @@ index 4b77a7d5adb..3e89de9006c 100644 b = grub_efi_system_table->boot_services; - if (read_header (data, datasize, &context)) -- { -- grub_dprintf ("chain", "Succeed to read header\n"); -- } -- else + rc = read_header (data, datasize, &context); + if (rc < 0) { - grub_dprintf ("chain", "Failed to read header\n"); - goto error_exit; - } +- grub_dprintf ("chain", "Succeed to read header\n"); ++ grub_dprintf ("chain", "Failed to read header\n"); ++ goto error_exit; ++ } + else if (rc == 0) + { + grub_dprintf ("chain", "Secure Boot is not enabled\n"); + return 0; -+ } -+ else -+ { + } + else + { +- grub_dprintf ("chain", "Failed to read header\n"); +- goto error_exit; + grub_dprintf ("chain", "Header read without error\n"); -+ } + } /* - * The spec says, uselessly, of SectionAlignment: -@@ -796,10 +801,56 @@ grub_secureboot_chainloader_unload (void) - return GRUB_ERR_NONE; +@@ -797,9 +802,55 @@ grub_secureboot_chainloader_unload (void) } -+static grub_err_t + static grub_err_t +grub_load_and_start_image(void *boot_image) +{ + grub_efi_boot_services_t *b; @@ -208,7 +206,7 @@ index 4b77a7d5adb..3e89de9006c 100644 + return 0; +} + - static grub_err_t ++static grub_err_t grub_secureboot_chainloader_boot (void) { - handle_image ((void *)address, fsize); @@ -270,10 +268,7 @@ index 4b77a7d5adb..3e89de9006c 100644 - - goto fail; - } -+ grub_load_and_start_image(boot_image); -+ grub_file_close (file); -+ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); - +- - /* LoadImage does not set a device handler when the image is - loaded from memory, so it is necessary to set it explicitly here. - This is a mess. */ @@ -284,7 +279,10 @@ index 4b77a7d5adb..3e89de9006c 100644 - goto fail; - } - loaded_image->device_handle = dev_handle; -- ++ grub_load_and_start_image(boot_image); ++ grub_file_close (file); ++ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); + - if (cmdline) - { - loaded_image->load_options = cmdline; @@ -305,7 +303,7 @@ index 4b77a7d5adb..3e89de9006c 100644 grub_device_close (dev); diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index aea378adf5c..8890bdf059a 100644 +index aea378adf..8890bdf05 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -33,21 +33,24 @@ struct grub_efi_shim_lock @@ -339,7 +337,7 @@ index aea378adf5c..8890bdf059a 100644 typedef void (*handover_func) (void *, grub_efi_system_table_t *, void *); diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 7ccf32d9d45..82f75b7f3ab 100644 +index 7ccf32d9d..82f75b7f3 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -155,6 +155,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -371,7 +369,7 @@ index 7ccf32d9d45..82f75b7f3ab 100644 goto fail; } diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h -index d9ede36773b..0033d9305a9 100644 +index d9ede3677..0033d9305 100644 --- a/include/grub/efi/linux.h +++ b/include/grub/efi/linux.h @@ -22,7 +22,7 @@ @@ -383,3 +381,6 @@ index d9ede36773b..0033d9305a9 100644 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, +-- +2.13.5 + diff --git a/SOURCES/0226-linuxefi-fix-double-free-on-verification-failure.patch b/SOURCES/0226-linuxefi-fix-double-free-on-verification-failure.patch index 7d1b3c8..f4df944 100644 --- a/SOURCES/0226-linuxefi-fix-double-free-on-verification-failure.patch +++ b/SOURCES/0226-linuxefi-fix-double-free-on-verification-failure.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 9a07ae66ef1e3662b7fd44bb15a629dd12b0eb19 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Jun 2016 09:50:25 -0400 -Subject: [PATCH] linuxefi: fix double free on verification failure. +Subject: [PATCH 226/261] linuxefi: fix double free on verification failure. Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 deletion(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 82f75b7f3ab..010bf982d80 100644 +index 82f75b7f3..010bf982d 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -191,7 +191,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -20,3 +20,6 @@ index 82f75b7f3ab..010bf982d80 100644 goto fail; } +-- +2.13.5 + diff --git a/SOURCES/0227-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch b/SOURCES/0227-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch index 9a00fab..9789644 100644 --- a/SOURCES/0227-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch +++ b/SOURCES/0227-efi-chainloader-fix-wrong-sanity-check-in-relocate_c.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 57dd7429fb1a865f483723e865bd7e3729a299e4 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 21 Nov 2016 15:34:00 +0100 -Subject: [PATCH] efi/chainloader: fix wrong sanity check in relocate_coff() +Subject: [PATCH 227/261] efi/chainloader: fix wrong sanity check in + relocate_coff() In relocate_coff(), the relocation entries are parsed from the original image (not the section-wise copied image). The original image is @@ -21,7 +22,7 @@ Tested-by: Juan Orti 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index 3e89de9006c..ed8c364789a 100644 +index 3e89de900..ed8c36478 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -401,7 +401,7 @@ relocate_coff (pe_coff_loader_image_context_t *context, @@ -33,3 +34,6 @@ index 3e89de9006c..ed8c364789a 100644 { grub_error (GRUB_ERR_BAD_ARGUMENT, "Reloc entry %d overflows binary", n); +-- +2.13.5 + diff --git a/SOURCES/0228-efi-chainloader-truncate-overlong-relocation-section.patch b/SOURCES/0228-efi-chainloader-truncate-overlong-relocation-section.patch index 3bd7f11..58c97fd 100644 --- a/SOURCES/0228-efi-chainloader-truncate-overlong-relocation-section.patch +++ b/SOURCES/0228-efi-chainloader-truncate-overlong-relocation-section.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From b0555d888792eb21fb1aeef7d242107999a70b73 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 23 Nov 2016 06:27:09 +0100 -Subject: [PATCH] efi/chainloader: truncate overlong relocation section +Subject: [PATCH 228/261] efi/chainloader: truncate overlong relocation section The UEFI Windows 7 boot loader ("EFI/Microsoft/Boot/bootmgfw.efi", SHA1 31b410e029bba87d2068c65a80b88882f9f8ea25) has inconsistent headers. @@ -63,7 +63,7 @@ Signed-off-by: Laszlo Ersek 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index ed8c364789a..db1ffeefc93 100644 +index ed8c36478..db1ffeefc 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -596,7 +596,7 @@ handle_image (void *data, grub_efi_uint32_t datasize) @@ -108,3 +108,6 @@ index ed8c364789a..db1ffeefc93 100644 { grub_dprintf ("chain", " section is not reloc section?\n"); grub_dprintf ("chain", " rds: 0x%08x, vs: %08x\n", +-- +2.13.5 + diff --git a/SOURCES/0229-Add-some-grub_dprintf-in-the-linuxefi-path.patch b/SOURCES/0229-Add-some-grub_dprintf-in-the-linuxefi-path.patch index 4050058..a8cfc0d 100644 --- a/SOURCES/0229-Add-some-grub_dprintf-in-the-linuxefi-path.patch +++ b/SOURCES/0229-Add-some-grub_dprintf-in-the-linuxefi-path.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 81bf71f61f9cbcc1c2244788cbe5002a54be65db Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 9 May 2016 14:15:17 -0400 -Subject: [PATCH] Add some grub_dprintf() in the linuxefi path. +Subject: [PATCH 229/261] Add some grub_dprintf() in the linuxefi path. Signed-off-by: Peter Jones --- @@ -10,7 +10,7 @@ Signed-off-by: Peter Jones 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index 8890bdf059a..dbf63e20ed8 100644 +index 8890bdf05..dbf63e20e 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -43,12 +43,22 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) @@ -40,7 +40,7 @@ index 8890bdf059a..dbf63e20ed8 100644 return -1; } diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 010bf982d80..a95e29700c5 100644 +index 010bf982d..a95e29700 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -114,6 +114,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), @@ -83,3 +83,6 @@ index 010bf982d80..a95e29700c5 100644 if (file) grub_file_close (file); +-- +2.13.5 + diff --git a/SOURCES/0230-linuxefi-minor-cleanups.patch b/SOURCES/0230-linuxefi-minor-cleanups.patch index b27fd18..a02ee15 100644 --- a/SOURCES/0230-linuxefi-minor-cleanups.patch +++ b/SOURCES/0230-linuxefi-minor-cleanups.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f79921923422534c0e9be73dbe434f55bbb75996 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:31:52 -0500 -Subject: [PATCH] linuxefi: minor cleanups +Subject: [PATCH 230/261] linuxefi: minor cleanups Signed-off-by: Peter Jones --- @@ -9,7 +9,7 @@ Signed-off-by: Peter Jones 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index a95e29700c5..806031838ae 100644 +index a95e29700..806031838 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -61,13 +61,18 @@ grub_linuxefi_unload (void) @@ -84,3 +84,6 @@ index a95e29700c5..806031838ae 100644 return grub_errno; } +-- +2.13.5 + diff --git a/SOURCES/0231-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch b/SOURCES/0231-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch index a6b68e2..f0f122b 100644 --- a/SOURCES/0231-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch +++ b/SOURCES/0231-Handle-multi-arch-64-on-32-boot-in-linuxefi-loader.patch @@ -1,19 +1,19 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 810bd23ca6d069506a4fb3a54921f743b1f1624f Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 14 Feb 2017 16:18:54 -0500 -Subject: [PATCH] Handle multi-arch (64-on-32) boot in linuxefi loader. +Subject: [PATCH 231/261] Handle multi-arch (64-on-32) boot in linuxefi loader. Allow booting 64-bit kernels on 32-bit EFI on x86. Signed-off-by: Peter Jones --- grub-core/loader/efi/linux.c | 9 +++- - grub-core/loader/i386/efi/linux.c | 105 +++++++++++++++++++++++++++----------- + grub-core/loader/i386/efi/linux.c | 108 ++++++++++++++++++++++++++------------ include/grub/i386/linux.h | 7 ++- - 3 files changed, 87 insertions(+), 34 deletions(-) + 3 files changed, 88 insertions(+), 36 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c -index dbf63e20ed8..7fe7201a388 100644 +index dbf63e20e..7fe7201a3 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -66,12 +66,17 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size) @@ -37,7 +37,7 @@ index dbf63e20ed8..7fe7201a388 100644 return GRUB_ERR_BUG; diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index 806031838ae..c123afad19c 100644 +index 806031838..52dc71903 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -44,14 +44,10 @@ static char *linux_cmdline; @@ -94,16 +94,18 @@ index 806031838ae..c123afad19c 100644 } - grub_dprintf ("linuxefi", "params = %lx\n", (unsigned long) params); -+ grub_dprintf ("linuxefi", "params = %p\n", (unsigned long) params); - +- - grub_memset (params, 0, 16384); -+ grub_memset (params, 0, sizeof(*params)); - +- - grub_memcpy (&lh, kernel, sizeof (lh)); - - if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) ++ grub_dprintf ("linuxefi", "params = %p\n", (unsigned long) params); ++ ++ grub_memset (params, 0, sizeof(*params)); ++ + setup_header_end_offset = *((grub_uint8_t *)kernel + 0x201); -+ grub_dprintf ("linuxefi", "copying %lu bytes from %p to %p\n", ++ grub_dprintf ("linuxefi", "copying %d bytes from %p to %p\n", + MIN(0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1, + (grub_uint8_t *)kernel + 0x1f1, + (grub_uint8_t *)params + 0x1f1); @@ -143,6 +145,8 @@ index 806031838ae..c123afad19c 100644 goto fail; } +- linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, +- BYTES_TO_PAGES(lh.cmdline_size + 1)); +#ifdef defined(__x86_64__) || defined(__aarch64__) + grub_dprintf ("linuxefi", "checking lh->xloadflags\n"); + if (!(lh->xloadflags & LINUX_XLF_KERNEL_64)) @@ -161,16 +165,14 @@ index 806031838ae..c123afad19c 100644 + goto fail; + } +#endif -+ + + grub_dprintf ("linuxefi", "setting up cmdline\n"); - linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, -- BYTES_TO_PAGES(lh.cmdline_size + 1)); -- ++ linux_cmdline = grub_efi_allocate_pages_max(0x3fffffff, + BYTES_TO_PAGES(lh->cmdline_size + 1)); if (!linux_cmdline) { grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline")); -@@ -255,21 +288,24 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -255,21 +288,23 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE)); grub_create_loader_cmdline (argc, argv, linux_cmdline + sizeof (LINUX_IMAGE) - 1, @@ -178,7 +180,6 @@ index 806031838ae..c123afad19c 100644 + lh->cmdline_size - (sizeof (LINUX_IMAGE) - 1)); - lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline; -+ grub_dprintf ("linuxefi", "cmdline:%s\n", linux_cmdline); + grub_dprintf ("linuxefi", "setting lh->cmd_line_ptr\n"); + lh->cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline; @@ -202,7 +203,7 @@ index 806031838ae..c123afad19c 100644 if (!kernel_mem) { -@@ -277,14 +313,21 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -277,14 +312,21 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto fail; } @@ -213,22 +214,22 @@ index 806031838ae..c123afad19c 100644 loaded=1; + grub_dprintf ("linuxefi", "setting lh->code32_start to %p\n", kernel_mem); + lh->code32_start = (grub_uint32_t)(grub_addr_t) kernel_mem; ++ ++ grub_memcpy (kernel_mem, (char *)kernel + start, filelen - start); - lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem; - grub_memcpy (params, &lh, 2 * 512); -+ grub_memcpy (kernel_mem, (char *)kernel + start, filelen - start); - -- params->type_of_loader = 0x21; + grub_dprintf ("linuxefi", "setting lh->type_of_loader\n"); + lh->type_of_loader = 0x6; -+ + +- params->type_of_loader = 0x21; + grub_dprintf ("linuxefi", "setting lh->ext_loader_{type,ver}\n"); + params->ext_loader_type = 0; + params->ext_loader_ver = 2; grub_dprintf("linuxefi", "kernel_mem: %p handover_offset: %08x\n", kernel_mem, handover_offset); -@@ -304,7 +347,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -304,7 +346,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (linux_cmdline && !loaded) grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t) linux_cmdline, @@ -238,7 +239,7 @@ index 806031838ae..c123afad19c 100644 if (kernel_mem && !loaded) grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem, diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h -index fc36bdaf367..110ecf806fb 100644 +index fc36bdaf3..110ecf806 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -130,7 +130,12 @@ struct linux_kernel_header @@ -255,3 +256,6 @@ index fc36bdaf367..110ecf806fb 100644 grub_uint32_t cmdline_size; grub_uint32_t hardware_subarch; grub_uint64_t hardware_subarch_data; +-- +2.13.5 + diff --git a/SOURCES/0232-efidisk-Respect-block_io_protocol-buffer-alignment.patch b/SOURCES/0232-efidisk-Respect-block_io_protocol-buffer-alignment.patch index 255ab30..ef8d48b 100644 --- a/SOURCES/0232-efidisk-Respect-block_io_protocol-buffer-alignment.patch +++ b/SOURCES/0232-efidisk-Respect-block_io_protocol-buffer-alignment.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From c06aa36fd08d398a4ee2c05f0a8da8ee85f70e56 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Sat, 27 Feb 2016 13:44:59 +0100 -Subject: [PATCH] efidisk: Respect block_io_protocol buffer alignment +Subject: [PATCH 232/261] efidisk: Respect block_io_protocol buffer alignment Returned from the OpenProtocol operation, the grub_efi_block_io_media structure contains the io_align field, specifying the minimum alignment @@ -21,7 +21,7 @@ Resolves: rhbz#1300009 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index 845c66fa9ab..f04f20b84ff 100644 +index 845c66fa9..f04f20b84 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -487,8 +487,15 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) @@ -90,3 +90,6 @@ index 845c66fa9ab..f04f20b84ff 100644 } static grub_err_t +-- +2.13.5 + diff --git a/SOURCES/0233-loader-linux-Make-trailer-initrd-entry-aligned-again.patch b/SOURCES/0233-loader-linux-Make-trailer-initrd-entry-aligned-again.patch index e87d491..6b453b4 100644 --- a/SOURCES/0233-loader-linux-Make-trailer-initrd-entry-aligned-again.patch +++ b/SOURCES/0233-loader-linux-Make-trailer-initrd-entry-aligned-again.patch @@ -1,7 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From cab5d30d4cb182ee9dfd03079b415e1e0285de99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= Date: Mon, 20 Jul 2015 14:06:45 +0200 -Subject: [PATCH] loader/linux: Make trailer initrd entry aligned again. +Subject: [PATCH 233/261] loader/linux: Make trailer initrd entry aligned + again. Regression from commit: loader/linux: do not pad initrd with zeroes at the end @@ -16,7 +17,7 @@ entry has a not aligned size. 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c -index d2cd591f604..be6fa0f4d45 100644 +index d2cd591f6..be6fa0f4d 100644 --- a/grub-core/loader/linux.c +++ b/grub-core/loader/linux.c @@ -213,6 +213,7 @@ grub_initrd_init (int argc, char *argv[], @@ -40,3 +41,6 @@ index d2cd591f604..be6fa0f4d45 100644 free_dir (root); root = 0; return GRUB_ERR_NONE; +-- +2.13.5 + diff --git a/SOURCES/0234-Make-exit-take-a-return-code.patch b/SOURCES/0234-Make-exit-take-a-return-code.patch index 6eca76a..eb5cbfd 100644 --- a/SOURCES/0234-Make-exit-take-a-return-code.patch +++ b/SOURCES/0234-Make-exit-take-a-return-code.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 2dfde7888d4bcd31b3c88680a96e1e935f01cec6 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 26 Feb 2014 21:49:12 -0500 -Subject: [PATCH] Make "exit" take a return code. +Subject: [PATCH 234/261] Make "exit" take a return code. This adds "exit" with a return code. With this patch, any "exit" command /may/ include a return code, and on platforms that support @@ -27,7 +27,7 @@ Signed-off-by: Peter Jones 14 files changed, 44 insertions(+), 20 deletions(-) diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c -index a3a11824172..b25ca4b9f17 100644 +index a3a118241..b25ca4b9f 100644 --- a/grub-core/commands/minicmd.c +++ b/grub-core/commands/minicmd.c @@ -176,12 +176,24 @@ grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)), @@ -60,7 +60,7 @@ index a3a11824172..b25ca4b9f17 100644 } diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 7dfe2ef1455..453f97a7595 100644 +index 7dfe2ef14..453f97a75 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -155,11 +155,16 @@ grub_efi_get_loaded_image (grub_efi_handle_t image_handle) @@ -83,24 +83,24 @@ index 7dfe2ef1455..453f97a7595 100644 } diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c -index 4b509139c4a..d7c880c0c1f 100644 +index 4b509139c..d7c880c0c 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c -@@ -65,6 +65,12 @@ grub_reboot (void) - longjmp (main_env, 1); +@@ -66,6 +66,12 @@ grub_reboot (void) } -+void + void +grub_exit (int retval __attribute__((unused))) +{ + grub_reboot (); +} + - void ++void grub_machine_init (void) { + } diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c -index bb606da2803..258a5649e2d 100644 +index bb606da28..258a5649e 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -135,9 +135,10 @@ xasprintf (const char *fmt, ...) @@ -117,7 +117,7 @@ index bb606da2803..258a5649e2d 100644 grub_uint64_t diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c -index 3314f027fec..36f9134b7b7 100644 +index 3314f027f..36f9134b7 100644 --- a/grub-core/kern/i386/coreboot/init.c +++ b/grub-core/kern/i386/coreboot/init.c @@ -41,7 +41,7 @@ extern grub_uint8_t _end[]; @@ -130,7 +130,7 @@ index 3314f027fec..36f9134b7b7 100644 /* We can't use grub_fatal() in this function. This would create an infinite loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ diff --git a/grub-core/kern/i386/qemu/init.c b/grub-core/kern/i386/qemu/init.c -index 271b6fbfabd..9fafe98f015 100644 +index 271b6fbfa..9fafe98f0 100644 --- a/grub-core/kern/i386/qemu/init.c +++ b/grub-core/kern/i386/qemu/init.c @@ -42,7 +42,7 @@ extern grub_uint8_t _end[]; @@ -143,7 +143,7 @@ index 271b6fbfabd..9fafe98f015 100644 /* We can't use grub_fatal() in this function. This would create an infinite loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 8ca4bf79f09..e2540bc41ce 100644 +index 8ca4bf79f..e2540bc41 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -60,7 +60,7 @@ grub_addr_t grub_ieee1275_original_stack; @@ -156,7 +156,7 @@ index 8ca4bf79f09..e2540bc41ce 100644 grub_ieee1275_exit (); } diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/init.c -index b4f50e49642..90049cb53ce 100644 +index b4f50e496..90049cb53 100644 --- a/grub-core/kern/mips/arc/init.c +++ b/grub-core/kern/mips/arc/init.c @@ -276,7 +276,7 @@ grub_halt (void) @@ -169,7 +169,7 @@ index b4f50e49642..90049cb53ce 100644 GRUB_ARC_FIRMWARE_VECTOR->exit (); diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c -index 7b96531b983..dff598ca7b0 100644 +index 7b96531b9..dff598ca7 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -304,7 +304,7 @@ grub_halt (void) @@ -182,7 +182,7 @@ index 7b96531b983..dff598ca7b0 100644 grub_halt (); } diff --git a/grub-core/kern/mips/qemu_mips/init.c b/grub-core/kern/mips/qemu_mips/init.c -index be88b77d22d..8b6c55ffc01 100644 +index be88b77d2..8b6c55ffc 100644 --- a/grub-core/kern/mips/qemu_mips/init.c +++ b/grub-core/kern/mips/qemu_mips/init.c @@ -75,7 +75,7 @@ grub_machine_fini (int flags __attribute__ ((unused))) @@ -195,7 +195,7 @@ index be88b77d22d..8b6c55ffc01 100644 grub_halt (); } diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 392c697db03..240396c55f3 100644 +index 392c697db..240396c55 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1278,7 +1278,7 @@ grub_abort (void) @@ -208,7 +208,7 @@ index 392c697db03..240396c55f3 100644 #if defined (__clang__) && !defined (GRUB_UTIL) diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c -index 5dcc106ed9b..430c62b66e0 100644 +index 5dcc106ed..430c62b66 100644 --- a/grub-core/kern/uboot/init.c +++ b/grub-core/kern/uboot/init.c @@ -43,9 +43,9 @@ extern grub_uint32_t grub_uboot_machine_type; @@ -233,7 +233,7 @@ index 5dcc106ed9b..430c62b66e0 100644 else if (ver > API_SIG_VERSION) { diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c -index 0559c033c3d..fce526d417b 100644 +index 0559c033c..fce526d41 100644 --- a/grub-core/kern/xen/init.c +++ b/grub-core/kern/xen/init.c @@ -549,7 +549,7 @@ grub_machine_init (void) @@ -246,7 +246,7 @@ index 0559c033c3d..fce526d417b 100644 struct sched_shutdown arg; diff --git a/include/grub/misc.h b/include/grub/misc.h -index 34250291908..c6851fb9dcf 100644 +index 342502919..c6851fb9d 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -398,7 +398,7 @@ int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt, @@ -258,3 +258,6 @@ index 34250291908..c6851fb9dcf 100644 grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r); +-- +2.13.5 + diff --git a/SOURCES/0235-efi-fix-memory-leak-in-variable-handling.patch b/SOURCES/0235-efi-fix-memory-leak-in-variable-handling.patch index 7985372..96239ca 100644 --- a/SOURCES/0235-efi-fix-memory-leak-in-variable-handling.patch +++ b/SOURCES/0235-efi-fix-memory-leak-in-variable-handling.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From b2df313847417e1f9593cdcdccba488393feeff2 Mon Sep 17 00:00:00 2001 From: Ignat Korchagin Date: Thu, 23 Jul 2015 21:13:09 +0300 -Subject: [PATCH] efi: fix memory leak in variable handling +Subject: [PATCH 235/261] efi: fix memory leak in variable handling --- grub-core/kern/efi/efi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 453f97a7595..0cd64cdb59e 100644 +index 453f97a75..0cd64cdb5 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -211,6 +211,7 @@ grub_efi_set_variable(const char *var, const grub_efi_guid_t *guid, @@ -33,3 +33,6 @@ index 453f97a7595..0cd64cdb59e 100644 data = grub_malloc (datasize); if (!data) +-- +2.13.5 + diff --git a/SOURCES/0236-efi-fix-GetVariable-return-status-check-in-81ca24a.patch b/SOURCES/0236-efi-fix-GetVariable-return-status-check-in-81ca24a.patch index 786f17a..64ad8b9 100644 --- a/SOURCES/0236-efi-fix-GetVariable-return-status-check-in-81ca24a.patch +++ b/SOURCES/0236-efi-fix-GetVariable-return-status-check-in-81ca24a.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 7e5c1057944796b36d4b6683b757ba166ad047c9 Mon Sep 17 00:00:00 2001 From: Ignat Korchagin Date: Fri, 24 Jul 2015 20:46:02 +0300 -Subject: [PATCH] efi: fix GetVariable return status check in 81ca24a +Subject: [PATCH 236/261] efi: fix GetVariable return status check in 81ca24a GetVariable should return EFI_BUFFER_TOO_SMALL if given buffer of size zero; commit incorrectly checked for EFI_SUCCESS. @@ -10,7 +10,7 @@ zero; commit incorrectly checked for EFI_SUCCESS. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 0cd64cdb59e..101307fc71e 100644 +index 0cd64cdb5..101307fc7 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -243,7 +243,7 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid, @@ -22,3 +22,6 @@ index 0cd64cdb59e..101307fc71e 100644 { grub_free (var16); return NULL; +-- +2.13.5 + diff --git a/SOURCES/0237-linux.c-Ensure-that-initrd-is-page-aligned.patch b/SOURCES/0237-linux.c-Ensure-that-initrd-is-page-aligned.patch index ab1325c..c2ce4df 100644 --- a/SOURCES/0237-linux.c-Ensure-that-initrd-is-page-aligned.patch +++ b/SOURCES/0237-linux.c-Ensure-that-initrd-is-page-aligned.patch @@ -1,14 +1,14 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From f38d60a9c4bf9b695f40376d16b14da11456f59b Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Thu, 7 May 2015 16:23:39 +0200 -Subject: [PATCH] linux.c: Ensure that initrd is page-aligned. +Subject: [PATCH 237/261] linux.c: Ensure that initrd is page-aligned. --- grub-core/loader/i386/linux.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 53f74ae0685..764cde20318 100644 +index 53f74ae06..764cde203 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -70,7 +70,6 @@ static grub_addr_t prot_mode_target; @@ -57,3 +57,6 @@ index 53f74ae0685..764cde20318 100644 GRUB_RELOCATOR_PREFERENCE_HIGH, 1); if (err) +-- +2.13.5 + diff --git a/SOURCES/0238-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch b/SOURCES/0238-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch index 0511a41..6be82c0 100644 --- a/SOURCES/0238-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch +++ b/SOURCES/0238-arm64-make-sure-fdt-has-address-cells-and-size-cells.patch @@ -1,8 +1,8 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 95cb7ac06c293913408132b93f72a7030a5e78a1 Mon Sep 17 00:00:00 2001 From: Mark Salter Date: Mon, 17 Apr 2017 08:44:29 -0400 -Subject: [PATCH] arm64: make sure fdt has #address-cells and #size-cells - properties +Subject: [PATCH 238/261] arm64: make sure fdt has #address-cells and + #size-cells properties Recent upstream changes to kexec-tools relies on #address-cells and #size-cells properties in the FDT. If grub2 needs to create @@ -14,7 +14,7 @@ make sure they exist. 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 0452a20e98b..1eb332a892c 100644 +index 0452a20e9..1eb332a89 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -147,7 +147,21 @@ finalize_params (void) @@ -40,3 +40,6 @@ index 0452a20e98b..1eb332a892c 100644 if (node < 1) goto failure; +-- +2.13.5 + diff --git a/SOURCES/0239-Don-t-guess-boot-efi-as-on-ppc-machines.patch b/SOURCES/0239-Don-t-guess-boot-efi-as-on-ppc-machines.patch index 88e421e..74cf925 100644 --- a/SOURCES/0239-Don-t-guess-boot-efi-as-on-ppc-machines.patch +++ b/SOURCES/0239-Don-t-guess-boot-efi-as-on-ppc-machines.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 6a6010d2ac3123a5e7de5e6088a26bcd21ba25a5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 20 Apr 2017 13:29:06 -0400 -Subject: [PATCH] Don't guess /boot/efi/ as on ppc machines +Subject: [PATCH 239/261] Don't guess /boot/efi/ as on ppc machines This should never be trying this, and since we've consolidated the grubenv to always be on /boot/efi/EFI/redhat/, this code causes it to @@ -15,7 +15,7 @@ Signed-off-by: Peter Jones 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/util/grub-install.c b/util/grub-install.c -index 7d61c32be2f..947a2d2ddf5 100644 +index 7d61c32be..947a2d2dd 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1151,18 +1151,8 @@ main (int argc, char *argv[]) @@ -38,3 +38,6 @@ index 7d61c32be2f..947a2d2ddf5 100644 if (!grub_util_is_directory (d)) { free (d); +-- +2.13.5 + diff --git a/SOURCES/0240-Clean-up-some-errors-in-the-linuxefi-loader.patch b/SOURCES/0240-Clean-up-some-errors-in-the-linuxefi-loader.patch index d793767..600e029 100644 --- a/SOURCES/0240-Clean-up-some-errors-in-the-linuxefi-loader.patch +++ b/SOURCES/0240-Clean-up-some-errors-in-the-linuxefi-loader.patch @@ -1,15 +1,15 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 444dd65bf9b5655afd4a32d71fa9d22a5b46caa2 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 24 May 2017 15:58:18 -0400 -Subject: [PATCH] Clean up some errors in the linuxefi loader +Subject: [PATCH 240/261] Clean up some errors in the linuxefi loader Signed-off-by: Peter Jones --- - grub-core/loader/i386/efi/linux.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) + grub-core/loader/i386/efi/linux.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c -index c123afad19c..7166ec17f8f 100644 +index 52dc71903..19950d2f2 100644 --- a/grub-core/loader/i386/efi/linux.c +++ b/grub-core/loader/i386/efi/linux.c @@ -161,8 +161,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -33,8 +33,9 @@ index c123afad19c..7166ec17f8f 100644 grub_memset (params, 0, sizeof(*params)); setup_header_end_offset = *((grub_uint8_t *)kernel + 0x201); - grub_dprintf ("linuxefi", "copying %lu bytes from %p to %p\n", +- grub_dprintf ("linuxefi", "copying %d bytes from %p to %p\n", - MIN(0x202+setup_header_end_offset,sizeof (*params)) - 0x1f1, ++ grub_dprintf ("linuxefi", "copying %zu bytes from %p to %p\n", + MIN((grub_size_t)0x202+setup_header_end_offset, + sizeof (*params)) - 0x1f1, (grub_uint8_t *)kernel + 0x1f1, @@ -55,7 +56,7 @@ index c123afad19c..7166ec17f8f 100644 grub_dprintf ("linuxefi", "checking lh->xloadflags\n"); if (!(lh->xloadflags & LINUX_XLF_KERNEL_64)) { -@@ -298,7 +299,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -297,7 +298,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), handover_offset = lh->handover_offset; start = (lh->setup_sects + 1) * 512; @@ -63,7 +64,7 @@ index c123afad19c..7166ec17f8f 100644 kernel_mem = grub_efi_allocate_pages(lh->pref_address, BYTES_TO_PAGES(lh->init_size)); -@@ -344,7 +344,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), +@@ -343,7 +343,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), loaded = 0; } @@ -72,3 +73,6 @@ index c123afad19c..7166ec17f8f 100644 grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t) linux_cmdline, BYTES_TO_PAGES(lh->cmdline_size + 1)); +-- +2.13.5 + diff --git a/SOURCES/0241-Revert-trim-arp-packets-with-abnormal-size.patch b/SOURCES/0241-Revert-trim-arp-packets-with-abnormal-size.patch index 53e9303..c74fa7b 100644 --- a/SOURCES/0241-Revert-trim-arp-packets-with-abnormal-size.patch +++ b/SOURCES/0241-Revert-trim-arp-packets-with-abnormal-size.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 47ef4b72680e619d9663b51a7cf4d2b8baabff1c Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Thu, 18 May 2017 14:25:45 -0400 -Subject: [PATCH] Revert "trim arp packets with abnormal size" +Subject: [PATCH 241/261] Revert "trim arp packets with abnormal size" This reverts commit d11b2eb425d2125f67dd8d8e9b11d9be7d6f3f11. --- @@ -9,7 +9,7 @@ This reverts commit d11b2eb425d2125f67dd8d8e9b11d9be7d6f3f11. 1 file changed, 6 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 77581f4b29a..d62d0cc1e01 100644 +index 77581f4b2..d62d0cc1e 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -162,12 +162,6 @@ grub_net_arp_receive (struct grub_net_buff *nb, @@ -25,3 +25,6 @@ index 77581f4b29a..d62d0cc1e01 100644 grub_net_link_level_address_t target; /* We've already checked that pln is either 4 or 16. */ char tmp[16]; +-- +2.13.5 + diff --git a/SOURCES/0242-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch b/SOURCES/0242-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch index dbaa347..bfeac07 100644 --- a/SOURCES/0242-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch +++ b/SOURCES/0242-cleanup-grub_cpu_to_XXX_compile_time-for-constants.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 36d301077a6ea9794d9017602f87c5da2d3139f7 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Mon, 22 Sep 2014 20:47:10 +0400 -Subject: [PATCH] cleanup: grub_cpu_to_XXX_compile_time for constants +Subject: [PATCH 242/261] cleanup: grub_cpu_to_XXX_compile_time for constants This tries to catch all cases where grub_cpu_to_XXX was used for constant expressions (including sizeof). @@ -34,7 +34,7 @@ expressions (including sizeof). 25 files changed, 90 insertions(+), 89 deletions(-) diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c -index c0feefafe4a..8ece40086ec 100644 +index c0feefafe..8ece40086 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -670,23 +670,23 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, @@ -156,7 +156,7 @@ index c0feefafe4a..8ece40086ec 100644 /* Print debug data here if necessary */ diff --git a/grub-core/bus/usb/ohci.c b/grub-core/bus/usb/ohci.c -index 946a4ed7d5b..d27bfe7fb9d 100644 +index 946a4ed7d..d27bfe7fb 100644 --- a/grub-core/bus/usb/ohci.c +++ b/grub-core/bus/usb/ohci.c @@ -314,7 +314,7 @@ grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, @@ -191,7 +191,7 @@ index 946a4ed7d5b..d27bfe7fb9d 100644 /* We should wait for next SOF to be sure that all EDs are * unaccessed by OHCI. But OHCI can be non-functional, so diff --git a/grub-core/commands/gptsync.c b/grub-core/commands/gptsync.c -index 3db62887b92..16592e9bbe8 100644 +index 3db62887b..16592e9bb 100644 --- a/grub-core/commands/gptsync.c +++ b/grub-core/commands/gptsync.c @@ -101,7 +101,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), @@ -222,7 +222,7 @@ index 3db62887b92..16592e9bbe8 100644 if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr)) { diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c -index 4aa5882352e..11024ae31e0 100644 +index 4aa588235..11024ae31 100644 --- a/grub-core/disk/mdraid_linux.c +++ b/grub-core/disk/mdraid_linux.c @@ -33,16 +33,16 @@ GRUB_MOD_LICENSE ("GPLv3+"); @@ -249,7 +249,7 @@ index 4aa5882352e..11024ae31e0 100644 #define RESERVED_BYTES (64 * 1024) diff --git a/grub-core/disk/scsi.c b/grub-core/disk/scsi.c -index b6cb2f42109..92084d0f8ed 100644 +index b6cb2f421..92084d0f8 100644 --- a/grub-core/disk/scsi.c +++ b/grub-core/disk/scsi.c @@ -201,7 +201,7 @@ grub_scsi_read_capacity16 (grub_scsi_t scsi) @@ -262,7 +262,7 @@ index b6cb2f42109..92084d0f8ed 100644 rc.control = 0; diff --git a/grub-core/disk/usbms.c b/grub-core/disk/usbms.c -index 2b769bdd8e1..380ca4c4cbf 100644 +index 2b769bdd8..380ca4c4c 100644 --- a/grub-core/disk/usbms.c +++ b/grub-core/disk/usbms.c @@ -307,7 +307,7 @@ grub_usbms_transfer_bo (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, @@ -284,7 +284,7 @@ index 2b769bdd8e1..380ca4c4cbf 100644 grub_dprintf ("usb", "Bulk-only reset device - bad status\n"); grub_usbms_reset (dev); diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c -index 1e593059a74..d1dc015455d 100644 +index 1e593059a..d1dc01545 100644 --- a/grub-core/fs/hfs.c +++ b/grub-core/fs/hfs.c @@ -369,7 +369,7 @@ grub_hfs_mount (grub_disk_t disk) @@ -297,7 +297,7 @@ index 1e593059a74..d1dc015455d 100644 grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c -index ac65054d363..de3d4fa3c64 100644 +index ac65054d3..de3d4fa3c 100644 --- a/grub-core/fs/reiserfs.c +++ b/grub-core/fs/reiserfs.c @@ -365,7 +365,7 @@ grub_reiserfs_set_key_offset (struct grub_reiserfs_key *key, @@ -341,7 +341,7 @@ index ac65054d363..de3d4fa3c64 100644 grub_reiserfs_set_key_type (&root_key, GRUB_REISERFS_DIRECTORY, 2); grub_reiserfs_set_key_offset (&root_key, 1); diff --git a/grub-core/lib/fdt.c b/grub-core/lib/fdt.c -index 907a7bff61f..7e76dc06bbc 100644 +index 907a7bff6..7e76dc06b 100644 --- a/grub-core/lib/fdt.c +++ b/grub-core/lib/fdt.c @@ -164,10 +164,10 @@ static int add_subnode (void *fdt, int parentoffset, const char *name) @@ -394,7 +394,7 @@ index 907a7bff61f..7e76dc06bbc 100644 grub_fdt_set_off_dt_strings (fdt, sizeof (*et)); grub_fdt_set_off_dt_struct (fdt, diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index 764cde20318..e3906eb658f 100644 +index 764cde203..e3906eb65 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -734,7 +734,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -407,7 +407,7 @@ index 764cde20318..e3906eb658f 100644 { grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c -index 60bb31fbf0d..c2e5fa9abcc 100644 +index 60bb31fbf..c2e5fa9ab 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -201,7 +201,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), @@ -443,7 +443,7 @@ index 60bb31fbf0d..c2e5fa9abcc 100644 setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c -index ff23235f064..58362189098 100644 +index ff23235f0..583621890 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -38,8 +38,8 @@ grub_xen_file (grub_file_t file) @@ -458,7 +458,7 @@ index ff23235f064..58362189098 100644 { grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index d62d0cc1e01..8cc390b0e28 100644 +index d62d0cc1e..8cc390b0e 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -81,11 +81,11 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, @@ -476,7 +476,7 @@ index d62d0cc1e01..8cc390b0e28 100644 /* Sender hardware address. */ grub_memcpy (aux, &inf->hwaddress.mac, 6); diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 46ce8135ac5..b4b8159cdad 100644 +index 46ce8135a..b4b8159cd 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -767,8 +767,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), @@ -491,7 +491,7 @@ index 46ce8135ac5..b4b8159cdad 100644 udph->len = grub_cpu_to_be16 (nb->tail - nb->data); target.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index c6971f9fcd2..5a609544403 100644 +index c6971f9fc..5a6095444 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -611,7 +611,7 @@ grub_net_send_ip6_packet (struct grub_net_network_level_interface *inf, @@ -504,7 +504,7 @@ index c6971f9fcd2..5a609544403 100644 iph->protocol = proto; iph->ttl = 0xff; diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 36fc0d8b2e8..fc6f714bf7f 100644 +index 36fc0d8b2..fc6f714bf 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -306,7 +306,7 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, @@ -517,7 +517,7 @@ index 36fc0d8b2e8..fc6f714bf7f 100644 FOR_NET_NETWORK_LEVEL_INTERFACES (inf) diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 8632339de97..3931884c6dd 100644 +index 8632339de..3931884c6 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -149,7 +149,7 @@ ack (tftp_data_t data, grub_uint64_t block) @@ -550,7 +550,7 @@ index 8632339de97..3931884c6dd 100644 err = grub_net_send_udp_packet (data->sock, &nb_err); diff --git a/grub-core/partmap/acorn.c b/grub-core/partmap/acorn.c -index 7bb93d9bec9..c022c61ddfc 100644 +index 7bb93d9be..c022c61dd 100644 --- a/grub-core/partmap/acorn.c +++ b/grub-core/partmap/acorn.c @@ -25,8 +25,8 @@ @@ -565,7 +565,7 @@ index 7bb93d9bec9..c022c61ddfc 100644 #define NONADFS_PARTITION_TYPE_LINUX 9 diff --git a/grub-core/partmap/bsdlabel.c b/grub-core/partmap/bsdlabel.c -index cf0f967c1fa..1d785906b6a 100644 +index cf0f967c1..1d785906b 100644 --- a/grub-core/partmap/bsdlabel.c +++ b/grub-core/partmap/bsdlabel.c @@ -53,7 +53,7 @@ iterate_real (grub_disk_t disk, grub_disk_addr_t sector, int freebsd, @@ -578,7 +578,7 @@ index cf0f967c1fa..1d785906b6a 100644 /* A kludge to determine a base of be.offset. */ diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c -index 38df7b3c9b8..83bcba77914 100644 +index 38df7b3c9..83bcba779 100644 --- a/grub-core/partmap/gpt.c +++ b/grub-core/partmap/gpt.c @@ -65,7 +65,7 @@ grub_gpt_partition_map_iterate (grub_disk_t disk, @@ -591,7 +591,7 @@ index 38df7b3c9b8..83bcba77914 100644 /* Make sure the MBR is a protective MBR and not a normal MBR. */ diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c -index 1d81a53573b..46c406bff1f 100644 +index 1d81a5357..46c406bff 100644 --- a/grub-core/partmap/msdos.c +++ b/grub-core/partmap/msdos.c @@ -162,7 +162,7 @@ grub_partition_msdos_iterate (grub_disk_t disk, @@ -613,7 +613,7 @@ index 1d81a53573b..46c406bff1f 100644 for (i = 0; i < 4; i++) diff --git a/grub-core/tests/video_checksum.c b/grub-core/tests/video_checksum.c -index 491bc55731c..74d5b65e5c7 100644 +index 491bc5573..74d5b65e5 100644 --- a/grub-core/tests/video_checksum.c +++ b/grub-core/tests/video_checksum.c @@ -288,16 +288,16 @@ grub_video_capture_write_bmp (const char *fname, @@ -637,7 +637,7 @@ index 491bc55731c..74d5b65e5c7 100644 head.height = grub_cpu_to_le16 (mode_info->height); head.planes = grub_cpu_to_le16_compile_time (1); diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c -index e6485b40f28..a0cab3a93f8 100644 +index e6485b40f..a0cab3a93 100644 --- a/util/grub-mkfont.c +++ b/util/grub-mkfont.c @@ -704,7 +704,7 @@ write_be16_section (const char *name, grub_uint16_t data, int* offset, @@ -659,7 +659,7 @@ index e6485b40f28..a0cab3a93f8 100644 sizeof(FONT_FORMAT_SECTION_NAMES_FILE) - 1, file, output_file); diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c -index 692f881900b..1a4f1b4c855 100644 +index 692f88190..1a4f1b4c8 100644 --- a/util/grub-mklayout.c +++ b/util/grub-mklayout.c @@ -329,7 +329,7 @@ write_file (FILE *out, const char *fname, struct grub_keyboard_layout *layout) @@ -672,7 +672,7 @@ index 692f881900b..1a4f1b4c855 100644 for (i = 0; i < ARRAY_SIZE (layout->keyboard_map); i++) layout->keyboard_map[i] = grub_cpu_to_le32(layout->keyboard_map[i]); diff --git a/util/mkimage.c b/util/mkimage.c -index 26d9816e07e..e6b799fd73c 100644 +index 26d9816e0..e6b799fd7 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -1528,9 +1528,10 @@ grub_install_generate_image (const char *dir, const char *prefix, @@ -725,3 +725,6 @@ index 26d9816e07e..e6b799fd73c 100644 | GRUB_PE32_SCN_MEM_DISCARDABLE | GRUB_PE32_SCN_MEM_READ); free (core_img); +-- +2.13.5 + diff --git a/SOURCES/0243-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch b/SOURCES/0243-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch index 7d3faa6..f7ef7cc 100644 --- a/SOURCES/0243-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch +++ b/SOURCES/0243-arp-icmp-Fix-handling-in-case-of-oversized-or-invali.patch @@ -1,21 +1,21 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 7fb95722428db023ea5fb0a29c7711f13db90822 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 20 Mar 2015 21:14:23 +0100 -Subject: [PATCH] arp, icmp: Fix handling in case of oversized or invalid - packets. +Subject: [PATCH 243/261] arp, icmp: Fix handling in case of oversized or + invalid packets. This restrict ARP handling to MAC and IP addresses but in practice we need only this case anyway and other cases are very rar if exist at all. It makes code much simpler and less error-prone. --- - grub-core/net/arp.c | 139 ++++++++++++++++++++++----------------------- + grub-core/net/arp.c | 143 ++++++++++++++++++++++----------------------- grub-core/net/icmp.c | 14 +---- grub-core/net/netbuff.c | 20 +++++++ include/grub/net/netbuff.h | 1 + - 4 files changed, 90 insertions(+), 84 deletions(-) + 4 files changed, 92 insertions(+), 86 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 8cc390b0e28..6cc580d6f85 100644 +index 8cc390b0e..6cc580d6f 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -37,12 +37,16 @@ enum @@ -132,7 +132,7 @@ index 8cc390b0e28..6cc580d6f85 100644 + grub_net_link_level_address_t sender_mac_addr; struct grub_net_network_level_interface *inf; - grub_uint8_t *sender_protocol_address, *target_protocol_address; - +- - sender_hardware_address = - (grub_uint8_t *) arp_header + sizeof (*arp_header); - sender_protocol_address = sender_hardware_address + arp_header->hln; @@ -149,6 +149,7 @@ index 8cc390b0e28..6cc580d6f85 100644 - have_pending = 1; - } - else ++ + if (arp_packet->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) + || arp_packet->pln != 4 || arp_packet->hln != 6 + || nb->tail - nb->data < (int) sizeof (*arp_packet)) @@ -181,13 +182,14 @@ index 8cc390b0e28..6cc580d6f85 100644 - /* We've already checked that pln is either 4 or 16. */ - char tmp[16]; - grub_size_t pln = arp_header->pln; +- +- if (pln > 16) +- pln = 16; + struct grub_net_buff nb_reply; + struct arppkt *arp_reply; + grub_uint8_t arp_data[128]; + grub_err_t err; - -- if (pln > 16) -- pln = 16; ++ + nb_reply.head = arp_data; + nb_reply.end = arp_data + sizeof (arp_data); + grub_netbuff_clear (&nb_reply); @@ -228,7 +230,7 @@ index 8cc390b0e28..6cc580d6f85 100644 } return GRUB_ERR_NONE; diff --git a/grub-core/net/icmp.c b/grub-core/net/icmp.c -index 28d825ba04c..b1eef114e03 100644 +index 28d825ba0..b1eef114e 100644 --- a/grub-core/net/icmp.c +++ b/grub-core/net/icmp.c @@ -85,22 +85,13 @@ grub_net_recv_icmp_packet (struct grub_net_buff *nb, @@ -265,7 +267,7 @@ index 28d825ba04c..b1eef114e03 100644 grub_netbuff_free (nb_reply); return err; diff --git a/grub-core/net/netbuff.c b/grub-core/net/netbuff.c -index e97ecd23e9c..dbeeefe4783 100644 +index e97ecd23e..dbeeefe47 100644 --- a/grub-core/net/netbuff.c +++ b/grub-core/net/netbuff.c @@ -97,6 +97,26 @@ grub_netbuff_alloc (grub_size_t len) @@ -296,7 +298,7 @@ index e97ecd23e9c..dbeeefe4783 100644 grub_netbuff_free (struct grub_net_buff *nb) { diff --git a/include/grub/net/netbuff.h b/include/grub/net/netbuff.h -index 9ac168c897c..1177c122051 100644 +index 9ac168c89..1177c1220 100644 --- a/include/grub/net/netbuff.h +++ b/include/grub/net/netbuff.h @@ -25,6 +25,7 @@ grub_err_t grub_netbuff_pull (struct grub_net_buff *net_buff, grub_size_t len); @@ -307,3 +309,6 @@ index 9ac168c897c..1177c122051 100644 void grub_netbuff_free (struct grub_net_buff *net_buff); #endif +-- +2.13.5 + diff --git a/SOURCES/0244-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch b/SOURCES/0244-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch index e1249a9..4a9e359 100644 --- a/SOURCES/0244-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch +++ b/SOURCES/0244-net-trivial-grub_cpu_to_XX_compile_time-cleanup.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 8db8290fc9e1e30d5c3732ae3a9c6fe9399fd5a6 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Fri, 27 Mar 2015 18:58:57 +0300 -Subject: [PATCH] net: trivial grub_cpu_to_XX_compile_time cleanup +Subject: [PATCH 244/261] net: trivial grub_cpu_to_XX_compile_time cleanup --- grub-core/net/arp.c | 2 +- @@ -9,7 +9,7 @@ Subject: [PATCH] net: trivial grub_cpu_to_XX_compile_time cleanup 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 6cc580d6f85..996473e1091 100644 +index 6cc580d6f..996473e10 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -80,7 +80,7 @@ grub_net_arp_send_request (struct grub_net_network_level_interface *inf, @@ -22,7 +22,7 @@ index 6cc580d6f85..996473e1091 100644 arp_packet->op = grub_cpu_to_be16_compile_time (ARP_REQUEST); /* Sender hardware address. */ diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index 78223946031..7953e68ecfa 100644 +index 782239460..7953e68ec 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -552,8 +552,8 @@ grub_net_icmp6_send_router_solicit (struct grub_net_network_level_interface *inf @@ -36,3 +36,6 @@ index 78223946031..7953e68ecfa 100644 err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); if (err) +-- +2.13.5 + diff --git a/SOURCES/0245-bootp-ignore-gateway_ip-relay-field.patch b/SOURCES/0245-bootp-ignore-gateway_ip-relay-field.patch index 53cfb25..b15b23e 100644 --- a/SOURCES/0245-bootp-ignore-gateway_ip-relay-field.patch +++ b/SOURCES/0245-bootp-ignore-gateway_ip-relay-field.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From d2a69d49f156c0bc3f3ba9f9cb14c21d817eadb3 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 17 May 2015 22:38:30 +0300 -Subject: [PATCH] bootp: ignore gateway_ip (relay) field. +Subject: [PATCH 245/261] bootp: ignore gateway_ip (relay) field. From RFC1542: @@ -24,12 +24,29 @@ Leave code ifdef'd out for the time being in case we see regression. Suggested by: Rink Springer Closes: 43396 --- - grub-core/net/bootp.c | 7 +++++++ docs/grub.texi | 6 ++++-- + grub-core/net/bootp.c | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) +diff --git a/docs/grub.texi b/docs/grub.texi +index ef09c8324..98138e04d 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -5211,8 +5211,10 @@ by @var{shortname} which can be used to remove it (@pxref{net_del_route}). + Perform configuration of @var{card} using DHCP protocol. If no card name + is specified, try to configure all existing cards. If configuration was + successful, interface with name @var{card}@samp{:dhcp} and configured +-address is added to @var{card}. If server provided gateway information in +-DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. Additionally the following DHCP options are recognized and processed: ++address is added to @var{card}. ++@comment If server provided gateway information in ++@comment DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. ++Additionally the following DHCP options are recognized and processed: + + @table @samp + @item 1 (Subnet Mask) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index b4b8159cdad..62d602d9645 100644 +index b4b8159cd..62d602d96 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -237,6 +237,12 @@ grub_net_configure_by_dhcp_ack (const char *name, @@ -53,20 +70,6 @@ index b4b8159cdad..62d602d9645 100644 if (size > OFFSET_OF (boot_file, bp)) grub_env_set_net_property (name, "boot_file", bp->boot_file, -diff --git a/docs/grub.texi b/docs/grub.texi -index ef09c832482..98138e04d5b 100644 ---- a/docs/grub.texi -+++ b/docs/grub.texi -@@ -5211,8 +5211,10 @@ by @var{shortname} which can be used to remove it (@pxref{net_del_route}). - Perform configuration of @var{card} using DHCP protocol. If no card name - is specified, try to configure all existing cards. If configuration was - successful, interface with name @var{card}@samp{:dhcp} and configured --address is added to @var{card}. If server provided gateway information in --DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. Additionally the following DHCP options are recognized and processed: -+address is added to @var{card}. -+@comment If server provided gateway information in -+@comment DHCP ACK packet, it is added as route entry with the name @var{card}@samp{:dhcp:gw}. -+Additionally the following DHCP options are recognized and processed: - - @table @samp - @item 1 (Subnet Mask) +-- +2.13.5 + diff --git a/SOURCES/0246-bootp-check-that-interface-is-not-NULL-in-configure_.patch b/SOURCES/0246-bootp-check-that-interface-is-not-NULL-in-configure_.patch index 2132f27..d0e3818 100644 --- a/SOURCES/0246-bootp-check-that-interface-is-not-NULL-in-configure_.patch +++ b/SOURCES/0246-bootp-check-that-interface-is-not-NULL-in-configure_.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 196938fb6e3eed1cf12d5a57a7e1f3ce59e344c3 Mon Sep 17 00:00:00 2001 From: Andrei Borzenkov Date: Sun, 20 Mar 2016 10:32:33 +0300 -Subject: [PATCH] bootp: check that interface is not NULL in +Subject: [PATCH 246/261] bootp: check that interface is not NULL in configure_by_dhcp_ack grub_net_add_addr may fail with OOM and we use returned interface @@ -11,7 +11,7 @@ later without any checks. 1 file changed, 3 insertions(+) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 62d602d9645..7df7f55110e 100644 +index 62d602d96..7df7f5511 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -237,6 +237,9 @@ grub_net_configure_by_dhcp_ack (const char *name, @@ -24,3 +24,6 @@ index 62d602d9645..7df7f55110e 100644 #if 0 /* This is likely based on misunderstanding. gateway_ip refers to address of BOOTP relay and should not be used after BOOTP transaction +-- +2.13.5 + diff --git a/SOURCES/0247-Use-xid-to-match-DHCP-replies.patch b/SOURCES/0247-Use-xid-to-match-DHCP-replies.patch index 95b3ffb..6b284a0 100644 --- a/SOURCES/0247-Use-xid-to-match-DHCP-replies.patch +++ b/SOURCES/0247-Use-xid-to-match-DHCP-replies.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 0d757a7fa6596dc307bd98cda2121329f121c5ce Mon Sep 17 00:00:00 2001 From: Andrzej Kacprowski Date: Fri, 21 Apr 2017 09:20:38 +0200 -Subject: [PATCH] Use xid to match DHCP replies +Subject: [PATCH 247/261] Use xid to match DHCP replies Transaction identifier (xid) from DHCP request packet is stored in network level interface and used @@ -17,7 +17,7 @@ Signed-off-by: Andrzej Kacprowski 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 7df7f55110e..dfdf7e08d90 100644 +index 7df7f5511..dfdf7e08d 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -769,7 +769,8 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), @@ -31,7 +31,7 @@ index 7df7f55110e..dfdf7e08d90 100644 grub_memcpy (&pack->mac_addr, &ifaces[j].hwaddress.mac, 6); diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index 5a609544403..9e7930caa03 100644 +index 5a6095444..9e7930caa 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -271,6 +271,7 @@ handle_dgram (struct grub_net_buff *nb, @@ -43,7 +43,7 @@ index 5a609544403..9e7930caa03 100644 && grub_memcmp (inf->hwaddress.mac, &bootp->mac_addr, sizeof (inf->hwaddress.mac)) == 0) diff --git a/include/grub/net.h b/include/grub/net.h -index bd930f4dd8c..b1bc23048f1 100644 +index bd930f4dd..b1bc23048 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -279,6 +279,7 @@ struct grub_net_network_level_interface @@ -63,3 +63,6 @@ index bd930f4dd8c..b1bc23048f1 100644 grub_uint16_t seconds; /* seconds since did initial bootstrap. */ grub_uint16_t flags; grub_uint32_t client_ip; +-- +2.13.5 + diff --git a/SOURCES/0248-Add-support-for-non-Ethernet-network-cards.patch b/SOURCES/0248-Add-support-for-non-Ethernet-network-cards.patch index 48bf748..051de2e 100644 --- a/SOURCES/0248-Add-support-for-non-Ethernet-network-cards.patch +++ b/SOURCES/0248-Add-support-for-non-Ethernet-network-cards.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From fba1410c59351eb760ccf2de1b4b80bda407e635 Mon Sep 17 00:00:00 2001 From: Andrzej Kacprowski Date: Fri, 21 Apr 2017 10:06:20 +0200 -Subject: [PATCH] Add support for non-Ethernet network cards +Subject: [PATCH 248/261] Add support for non-Ethernet network cards This patch replaces fixed 6-byte link layer address with up to 32-byte variable sized address. @@ -24,7 +24,7 @@ Signed-off-by: Andrzej Kacprowski Conflicts: grub-core/net/ip.c --- - grub-core/net/arp.c | 157 +++++++++++++++++++++------------ + grub-core/net/arp.c | 159 +++++++++++++++++++++------------ grub-core/net/bootp.c | 14 ++- grub-core/net/drivers/efi/efinet.c | 8 +- grub-core/net/drivers/emu/emunet.c | 1 + @@ -36,10 +36,10 @@ Conflicts: grub-core/net/ip.c | 4 +- grub-core/net/net.c | 48 +++++----- include/grub/net.h | 19 ++-- - 12 files changed, 213 insertions(+), 152 deletions(-) + 12 files changed, 214 insertions(+), 153 deletions(-) diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c -index 996473e1091..badd2d3e684 100644 +index 996473e10..badd2d3e6 100644 --- a/grub-core/net/arp.c +++ b/grub-core/net/arp.c @@ -31,22 +31,12 @@ enum @@ -149,15 +149,16 @@ index 996473e1091..badd2d3e684 100644 grub_net_network_level_address_t sender_addr, target_addr; grub_net_link_level_address_t sender_mac_addr; struct grub_net_network_level_interface *inf; +- +- if (arp_packet->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) +- || arp_packet->pln != 4 || arp_packet->hln != 6 +- || nb->tail - nb->data < (int) sizeof (*arp_packet)) + grub_uint16_t hw_type; + grub_uint8_t hln; + grub_uint8_t pln; + grub_uint8_t arp_packet_len; + grub_uint8_t *tmp_ptr; - -- if (arp_packet->pro != grub_cpu_to_be16_compile_time (GRUB_NET_ETHERTYPE_IP) -- || arp_packet->pln != 4 || arp_packet->hln != 6 -- || nb->tail - nb->data < (int) sizeof (*arp_packet)) ++ + hw_type = card->default_address.type; + hln = card->default_address.len; + pln = sizeof(sender_addr.ipv4); @@ -180,29 +181,29 @@ index 996473e1091..badd2d3e684 100644 + + /* The source protocol address. */ sender_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +- target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; +- sender_addr.ipv4 = arp_packet->sender_ip; +- target_addr.ipv4 = arp_packet->recv_ip; +- if (arp_packet->sender_ip == pending_req) +- have_pending = 1; + grub_memcpy(&sender_addr.ipv4, tmp_ptr, pln); + tmp_ptr += pln; -+ -+ grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); -+ + +- sender_mac_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; +- grub_memcpy (sender_mac_addr.mac, arp_packet->sender_mac, +- sizeof (sender_mac_addr.mac)); + grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); + + /* The target hardware address. */ + tmp_ptr += hln; + + /* The target protocol address. */ - target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; -- sender_addr.ipv4 = arp_packet->sender_ip; -- target_addr.ipv4 = arp_packet->recv_ip; -- if (arp_packet->sender_ip == pending_req) ++ target_addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; + grub_memcpy(&target_addr.ipv4, tmp_ptr, pln); + + if (sender_addr.ipv4 == pending_req) - have_pending = 1; - -- sender_mac_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; -- grub_memcpy (sender_mac_addr.mac, arp_packet->sender_mac, -- sizeof (sender_mac_addr.mac)); -- grub_net_link_layer_add_address (card, &sender_addr, &sender_mac_addr, 1); -- ++ have_pending = 1; ++ FOR_NET_NETWORK_LEVEL_INTERFACES (inf) { /* Am I the protocol address target? */ @@ -271,7 +272,7 @@ index 996473e1091..badd2d3e684 100644 /* Change operation to REPLY and send packet */ send_ethernet_packet (inf, &nb_reply, target, GRUB_NET_ETHERTYPE_ARP); diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index dfdf7e08d90..0a2d11b8820 100644 +index dfdf7e08d..0a2d11b88 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -219,7 +219,6 @@ grub_net_configure_by_dhcp_ack (const char *name, @@ -317,7 +318,7 @@ index dfdf7e08d90..0a2d11b8820 100644 grub_netbuff_push (nb, sizeof (*udph)); diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 69b0fc7a8fe..b9ed13fcad1 100644 +index 69b0fc7a8..b9ed13fca 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -290,6 +290,9 @@ grub_efinet_findcards (void) @@ -345,7 +346,7 @@ index 69b0fc7a8fe..b9ed13fcad1 100644 card->efi_handle = *handle; diff --git a/grub-core/net/drivers/emu/emunet.c b/grub-core/net/drivers/emu/emunet.c -index 7c977cd52ca..962b0c86d2b 100644 +index 7c977cd52..962b0c86d 100644 --- a/grub-core/net/drivers/emu/emunet.c +++ b/grub-core/net/drivers/emu/emunet.c @@ -46,6 +46,7 @@ static struct grub_net_card emucard = @@ -357,7 +358,7 @@ index 7c977cd52ca..962b0c86d2b 100644 }, .flags = 0 diff --git a/grub-core/net/drivers/i386/pc/pxe.c b/grub-core/net/drivers/i386/pc/pxe.c -index e8c0b22e294..5660149503d 100644 +index e8c0b22e2..566014950 100644 --- a/grub-core/net/drivers/i386/pc/pxe.c +++ b/grub-core/net/drivers/i386/pc/pxe.c @@ -387,20 +387,21 @@ GRUB_MOD_INIT(pxe) @@ -389,7 +390,7 @@ index e8c0b22e294..5660149503d 100644 grub_pxe_card.default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c -index cd24ddc99c5..5a199bcaa75 100644 +index cd24ddc99..5a199bcaa 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -154,6 +154,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, @@ -409,7 +410,7 @@ index cd24ddc99c5..5a199bcaa75 100644 card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; diff --git a/grub-core/net/drivers/uboot/ubootnet.c b/grub-core/net/drivers/uboot/ubootnet.c -index 056052e40d5..22ebcbf211e 100644 +index 056052e40..22ebcbf21 100644 --- a/grub-core/net/drivers/uboot/ubootnet.c +++ b/grub-core/net/drivers/uboot/ubootnet.c @@ -131,6 +131,7 @@ GRUB_MOD_INIT (ubootnet) @@ -421,7 +422,7 @@ index 056052e40d5..22ebcbf211e 100644 card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; card->txbuf = grub_zalloc (card->txbufsize); diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c -index faaca67c50e..1b479d3cadc 100644 +index faaca67c5..1b479d3ca 100644 --- a/grub-core/net/ethernet.c +++ b/grub-core/net/ethernet.c @@ -29,13 +29,6 @@ @@ -566,7 +567,7 @@ index faaca67c50e..1b479d3cadc 100644 { /* ARP packet. */ diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c -index 7953e68ecfa..7e7a6bcbd68 100644 +index 7953e68ec..7e7a6bcbd 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -230,8 +230,9 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, @@ -606,7 +607,7 @@ index 7953e68ecfa..7e7a6bcbd68 100644 } if (ohdr->type == OPTION_PREFIX && ohdr->len == 4) diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index 9e7930caa03..311213feec1 100644 +index 9e7930caa..311213fee 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -273,8 +273,8 @@ handle_dgram (struct grub_net_buff *nb, @@ -621,7 +622,7 @@ index 9e7930caa03..311213feec1 100644 grub_net_process_dhcp (nb, inf->card); grub_netbuff_free (nb); diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index fc6f714bf7f..b3a80ba2954 100644 +index fc6f714bf..b3a80ba29 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -143,8 +143,9 @@ grub_net_link_layer_resolve (struct grub_net_network_level_interface *inf, @@ -705,7 +706,7 @@ index fc6f714bf7f..b3a80ba2954 100644 int diff --git a/include/grub/net.h b/include/grub/net.h -index b1bc23048f1..0d9213d6759 100644 +index b1bc23048..0d9213d67 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -29,7 +29,8 @@ @@ -756,3 +757,6 @@ index b1bc23048f1..0d9213d6759 100644 void grub_net_addr_to_str (const grub_net_network_level_address_t *target, +-- +2.13.5 + diff --git a/SOURCES/0249-misc-fix-invalid-character-recongition-in-strto-l.patch b/SOURCES/0249-misc-fix-invalid-character-recongition-in-strto-l.patch index 51feac7..763e869 100644 --- a/SOURCES/0249-misc-fix-invalid-character-recongition-in-strto-l.patch +++ b/SOURCES/0249-misc-fix-invalid-character-recongition-in-strto-l.patch @@ -1,7 +1,7 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From 86004f0ab4bfcbc578274fc153da1280a3ac04e6 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Fri, 29 Jul 2016 17:41:27 +0800 -Subject: [PATCH] misc: fix invalid character recongition in strto*l +Subject: [PATCH 249/261] misc: fix invalid character recongition in strto*l Would previously allow digits larger than the base and didn't check that subtracting the difference from 0-9 to lowercase letters for characters @@ -12,7 +12,7 @@ parses: ` = 9, _ = 8, ^ = 7, ] = 6, \ = 5, and [ = 4 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c -index 240396c55f3..d0ca2ee603b 100644 +index 240396c55..d0ca2ee60 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -436,9 +436,13 @@ grub_strtoull (const char *str, char **end, int base) @@ -30,3 +30,6 @@ index 240396c55f3..d0ca2ee603b 100644 found = 1; +-- +2.13.5 + diff --git a/SOURCES/0250-net-read-bracketed-ipv6-addrs-and-port-numbers.patch b/SOURCES/0250-net-read-bracketed-ipv6-addrs-and-port-numbers.patch index 5b10e5d..30fde44 100644 --- a/SOURCES/0250-net-read-bracketed-ipv6-addrs-and-port-numbers.patch +++ b/SOURCES/0250-net-read-bracketed-ipv6-addrs-and-port-numbers.patch @@ -1,23 +1,34 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From fc71f52ca2ea207a692b79819502bb1738c5d148 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Fri, 29 Jul 2016 17:41:38 +0800 -Subject: [PATCH] net: read bracketed ipv6 addrs and port numbers +Subject: [PATCH 250/261] net: read bracketed ipv6 addrs and port numbers Allow specifying port numbers for http and tftp paths, and allow ipv6 addresses to be recognized with brackets around them, which is required to specify a port number --- - grub-core/net/http.c | 23 ++++++++++++---- - grub-core/net/net.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - grub-core/net/tftp.c | 8 ++++-- + grub-core/net/http.c | 25 +++++++++++--- + grub-core/net/net.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++------ + grub-core/net/tftp.c | 25 +++++++++++--- include/grub/net.h | 1 + - 4 files changed, 102 insertions(+), 7 deletions(-) + 4 files changed, 125 insertions(+), 20 deletions(-) diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index ef9538c539c..6d99051d345 100644 +index ef9538c53..e8accbe68 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c -@@ -312,12 +312,14 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) +@@ -289,7 +289,9 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), + nb2 = grub_netbuff_alloc (data->chunk_rem); + if (!nb2) + return grub_errno; +- grub_netbuff_put (nb2, data->chunk_rem); ++ err = grub_netbuff_put (nb2, data->chunk_rem); ++ if (err) ++ return grub_errno; + grub_memcpy (nb2->data, nb->data, data->chunk_rem); + if (file->device->net->packs.count >= 20) + { +@@ -312,12 +314,14 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) int i; struct grub_net_buff *nb; grub_err_t err; @@ -33,7 +44,7 @@ index ef9538c539c..6d99051d345 100644 + sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n") - 1 + sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX" -@@ -356,7 +358,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) +@@ -356,7 +360,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) sizeof (" HTTP/1.1\r\nHost: ") - 1); ptr = nb->tail; @@ -42,7 +53,7 @@ index ef9538c539c..6d99051d345 100644 if (err) { grub_netbuff_free (nb); -@@ -365,6 +367,15 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) +@@ -365,6 +369,15 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) grub_memcpy (ptr, file->device->net->server, grub_strlen (file->device->net->server)); @@ -50,7 +61,7 @@ index ef9538c539c..6d99051d345 100644 + { + ptr = nb->tail; + grub_snprintf ((char *) ptr, -+ sizeof (":XXXXXXXXXX"), ++ sizeof (":xxxxxxxxxx"), + ":%d", + port); + } @@ -58,45 +69,43 @@ index ef9538c539c..6d99051d345 100644 ptr = nb->tail; err = grub_netbuff_put (nb, sizeof ("\r\nUser-Agent: " PACKAGE_STRING "\r\n") -@@ -391,9 +402,11 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) +@@ -391,8 +404,10 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) grub_netbuff_put (nb, 2); grub_memcpy (ptr, "\r\n", 2); - data->sock = grub_net_tcp_open (file->device->net->server, - HTTP_PORT, http_receive, -- http_err, NULL, + grub_dprintf ("http", "opening path %s on host %s TCP port %d\n", + data->filename, server, port ? port : HTTP_PORT); + data->sock = grub_net_tcp_open (server, + port ? port : HTTP_PORT, http_receive, -+ http_err, http_err, + http_err, NULL, file); if (!data->sock) - { diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index b3a80ba2954..b062f6fd0cd 100644 +index b3a80ba29..6b4b10ba4 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c -@@ -462,6 +462,12 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) +@@ -462,6 +462,13 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) grub_uint16_t newip[8]; const char *ptr = val; int word, quaddot = -1; + int bracketed = 0; + -+ if (ptr[0] == '[') { -+ bracketed = 1; -+ ptr++; -+ } ++ if (ptr[0] == '[') ++ { ++ bracketed = 1; ++ ptr++; ++ } if (ptr[0] == ':' && ptr[1] != ':') return 0; -@@ -500,6 +506,9 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) +@@ -500,6 +507,8 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); } grub_memcpy (ip, newip, 16); -+ if (bracketed && *ptr == ']') { ++ if (bracketed && *ptr == ']') + ptr++; -+ } if (rest) *rest = ptr; return 1; @@ -118,7 +127,7 @@ index b3a80ba2954..b062f6fd0cd 100644 + char* port_start; + /* ipv6 or port specified? */ + if ((port_start = grub_strchr (server, ':'))) -+ { ++ { + char* ipv6_begin; + if((ipv6_begin = grub_strchr (server, '['))) + { @@ -184,8 +193,41 @@ index b3a80ba2954..b062f6fd0cd 100644 for (try = 0; try < 2; try++) { FOR_NET_APP_LEVEL (proto) +@@ -1396,19 +1473,13 @@ grub_net_open_real (const char *name) + { + grub_net_t ret = grub_zalloc (sizeof (*ret)); + if (!ret) +- return NULL; +- ret->protocol = proto; +- if (server) + { +- ret->server = grub_strdup (server); +- if (!ret->server) +- { +- grub_free (ret); +- return NULL; +- } ++ grub_free (host); ++ return NULL; + } +- else +- ret->server = NULL; ++ ret->protocol = proto; ++ ret->port = port; ++ ret->server = host; + ret->fs = &grub_net_fs; + ret->offset = 0; + ret->eof = 0; +@@ -1439,6 +1510,7 @@ grub_net_open_real (const char *name) + grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), + name); + ++ grub_free (host); + return NULL; + } + diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 3931884c6dd..d13a6c8ed2d 100644 +index 3931884c6..ed12e610f 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -333,6 +333,7 @@ tftp_open (struct grub_file *file, const char *filename) @@ -196,16 +238,49 @@ index 3931884c6dd..d13a6c8ed2d 100644 data = grub_zalloc (sizeof (*data)); if (!data) -@@ -396,14 +397,17 @@ tftp_open (struct grub_file *file, const char *filename) +@@ -345,7 +346,10 @@ tftp_open (struct grub_file *file, const char *filename) + grub_netbuff_reserve (&nb, 1500); + err = grub_netbuff_push (&nb, sizeof (*tftph)); + if (err) +- return err; ++ { ++ grub_free (data); ++ return err; ++ } + + tftph = (struct tftphdr *) nb.data; + +@@ -383,32 +387,43 @@ tftp_open (struct grub_file *file, const char *filename) + + err = grub_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); + if (err) +- return err; ++ { ++ grub_free (data); ++ return err; ++ } + + file->not_easily_seekable = 1; + file->data = data; + + data->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); + if (!data->pq) +- return grub_errno; ++ { ++ grub_free (data); ++ 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); -+ grub_dprintf ("tftp", "Address resolution failed: %d\n", err); + grub_dprintf("tftp", "Address resolution failed: %d\n", err); + grub_dprintf ("tftp", "file_size is %llu, block_size is %llu\n", + (unsigned long long)data->file_size, + (unsigned long long)data->block_size); destroy_pq (data); ++ grub_free (data); return err; } @@ -216,8 +291,30 @@ index 3931884c6dd..d13a6c8ed2d 100644 file); if (!data->sock) { + grub_dprintf("tftp", "connection failed\n"); + destroy_pq (data); ++ grub_free (data); + return grub_errno; + } + +@@ -422,6 +437,7 @@ tftp_open (struct grub_file *file, const char *filename) + { + grub_net_udp_close (data->sock); + destroy_pq (data); ++ grub_free (data); + return err; + } + grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), +@@ -438,6 +454,7 @@ tftp_open (struct grub_file *file, const char *filename) + { + grub_net_udp_close (data->sock); + destroy_pq (data); ++ grub_free (data); + return grub_errno; + } + diff --git a/include/grub/net.h b/include/grub/net.h -index 0d9213d6759..20e699bb025 100644 +index 0d9213d67..20e699bb0 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -261,6 +261,7 @@ typedef struct grub_net @@ -228,3 +325,6 @@ index 0d9213d6759..20e699bb025 100644 grub_net_app_level_t protocol; grub_net_packets_t packs; grub_off_t offset; +-- +2.13.5 + diff --git a/SOURCES/0251-bootp-New-net_bootp6-command.patch b/SOURCES/0251-bootp-New-net_bootp6-command.patch new file mode 100644 index 0000000..17a06c7 --- /dev/null +++ b/SOURCES/0251-bootp-New-net_bootp6-command.patch @@ -0,0 +1,1291 @@ +From 64891c8f3d0521f595affec99ef74c1087dabe83 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Sun, 10 Jul 2016 23:46:06 +0800 +Subject: [PATCH 251/261] bootp: New net_bootp6 command + +Implement new net_bootp6 command for IPv6 network auto configuration via the +DHCPv6 protocol (RFC3315). + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/bootp.c | 1016 ++++++++++++++++++++++++++++++++++++++++++------- + grub-core/net/ip.c | 39 ++ + include/grub/net.h | 91 +++-- + 3 files changed, 969 insertions(+), 177 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 0a2d11b88..26b3d83d0 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -25,6 +25,98 @@ + #include + #include + #include ++#include ++#include ++ ++static int ++dissect_url (const char *url, char **proto, char **host, char **path) ++{ ++ const char *p, *ps; ++ grub_size_t l; ++ ++ *proto = *host = *path = NULL; ++ ps = p = url; ++ ++ while ((p = grub_strchr (p, ':'))) ++ { ++ if (grub_strlen (p) < sizeof ("://") - 1) ++ break; ++ if (grub_memcmp (p, "://", sizeof ("://") - 1) == 0) ++ { ++ l = p - ps; ++ *proto = grub_malloc (l + 1); ++ if (!*proto) ++ { ++ grub_print_error (); ++ return 0; ++ } ++ ++ grub_memcpy (*proto, ps, l); ++ (*proto)[l] = '\0'; ++ p += sizeof ("://") - 1; ++ break; ++ } ++ ++p; ++ } ++ ++ if (!*proto) ++ { ++ grub_dprintf ("bootp", "url: %s is not valid, protocol not found\n", url); ++ return 0; ++ } ++ ++ ps = p; ++ p = grub_strchr (p, '/'); ++ ++ if (!p) ++ { ++ grub_dprintf ("bootp", "url: %s is not valid, host/path not found\n", url); ++ grub_free (*proto); ++ *proto = NULL; ++ return 0; ++ } ++ ++ l = p - ps; ++ ++ if (l > 2 && ps[0] == '[' && ps[l - 1] == ']') ++ { ++ *host = grub_malloc (l - 1); ++ if (!*host) ++ { ++ grub_print_error (); ++ grub_free (*proto); ++ *proto = NULL; ++ return 0; ++ } ++ grub_memcpy (*host, ps + 1, l - 2); ++ (*host)[l - 2] = 0; ++ } ++ else ++ { ++ *host = grub_malloc (l + 1); ++ if (!*host) ++ { ++ grub_print_error (); ++ grub_free (*proto); ++ *proto = NULL; ++ return 0; ++ } ++ grub_memcpy (*host, ps, l); ++ (*host)[l] = 0; ++ } ++ ++ *path = grub_strdup (p); ++ if (!*path) ++ { ++ grub_print_error (); ++ grub_free (*host); ++ grub_free (*proto); ++ *host = NULL; ++ *proto = NULL; ++ return 0; ++ } ++ return 1; ++} + + static char * + grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), +@@ -341,178 +433,578 @@ 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) ++/* The default netbuff size for sending DHCPv6 packets which should be ++ large enough to hold the information */ ++#define GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE 512 ++ ++struct grub_dhcp6_options + { +- struct grub_net_network_level_interface *inter = NULL; +- struct grub_net_network_level_address addr; +- int mask = -1; ++ grub_uint8_t *client_duid; ++ grub_uint16_t client_duid_len; ++ grub_uint8_t *server_duid; ++ grub_uint16_t server_duid_len; ++ grub_uint32_t iaid; ++ grub_uint32_t t1; ++ grub_uint32_t t2; ++ grub_net_network_level_address_t *ia_addr; ++ grub_uint32_t preferred_lifetime; ++ grub_uint32_t valid_lifetime; ++ grub_net_network_level_address_t *dns_server_addrs; ++ grub_uint16_t num_dns_server; ++ char *boot_file_proto; ++ char *boot_file_server_ip; ++ char *boot_file_path; ++}; ++ ++typedef struct grub_dhcp6_options *grub_dhcp6_options_t; ++ ++struct grub_dhcp6_session ++{ ++ struct grub_dhcp6_session *next; ++ struct grub_dhcp6_session **prev; ++ grub_uint32_t iaid; ++ grub_uint32_t transaction_id:24; ++ grub_uint64_t start_time; ++ struct grub_net_dhcp6_option_duid_ll duid; ++ struct grub_net_network_level_interface *iface; + +- if (!device || !path) +- return NULL; ++ /* The associated dhcpv6 options */ ++ grub_dhcp6_options_t adv; ++ grub_dhcp6_options_t reply; ++}; + +- *device = 0; +- *path = 0; ++typedef struct grub_dhcp6_session *grub_dhcp6_session_t; + +- 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]); ++typedef void (*dhcp6_option_hook_fn) (const struct grub_net_dhcp6_option *opt, void *data); + +- if (is_def) +- grub_net_default_server = 0; ++static void ++foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size, ++ dhcp6_option_hook_fn hook, void *hook_data); ++ ++static void ++parse_dhcp6_iaaddr (const struct grub_net_dhcp6_option *opt, void *data) ++{ ++ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t )data; ++ ++ grub_uint16_t code = grub_be_to_cpu16 (opt->code); ++ grub_uint16_t len = grub_be_to_cpu16 (opt->len); + +- if (is_def && !grub_net_default_server && packet) ++ if (code == GRUB_NET_DHCP6_OPTION_IAADDR) + { +- const grub_uint8_t *options = packet->dhcp_options; +- unsigned int option_max = 1024 - OFFSET_OF (dhcp_options, packet); +- unsigned int i; ++ const struct grub_net_dhcp6_option_iaaddr *iaaddr; ++ iaaddr = (const struct grub_net_dhcp6_option_iaaddr *)opt->data; + +- for (i = 0; i < option_max - sizeof (grub_net_dhcpv6_option_t); ) ++ if (len < sizeof (*iaaddr)) + { +- grub_uint16_t num, len; +- grub_net_dhcpv6_option_t *opt = +- (grub_net_dhcpv6_option_t *)(options + i); ++ grub_dprintf ("bootp", "DHCPv6: code %u with insufficient length %u\n", code, len); ++ return; ++ } ++ if (!dhcp6->ia_addr) ++ { ++ dhcp6->ia_addr = grub_malloc (sizeof(*dhcp6->ia_addr)); ++ dhcp6->ia_addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ dhcp6->ia_addr->ipv6[0] = grub_get_unaligned64 (iaaddr->addr); ++ dhcp6->ia_addr->ipv6[1] = grub_get_unaligned64 (iaaddr->addr + 8); ++ dhcp6->preferred_lifetime = grub_be_to_cpu32 (iaaddr->preferred_lifetime); ++ dhcp6->valid_lifetime = grub_be_to_cpu32 (iaaddr->valid_lifetime); ++ } ++ } ++} + +- num = grub_be_to_cpu16(opt->option_num); +- len = grub_be_to_cpu16(opt->option_len); ++static void ++parse_dhcp6_option (const struct grub_net_dhcp6_option *opt, void *data) ++{ ++ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t)data; ++ grub_uint16_t code = grub_be_to_cpu16 (opt->code); ++ grub_uint16_t len = grub_be_to_cpu16 (opt->len); + +- grub_dprintf ("net", "got dhcpv6 option %d len %d\n", num, len); ++ switch (code) ++ { ++ case GRUB_NET_DHCP6_OPTION_CLIENTID: + +- if (len == 0) ++ if (dhcp6->client_duid || !len) ++ { ++ grub_dprintf ("bootp", "Skipped DHCPv6 CLIENTID with length %u\n", len); + break; ++ } ++ dhcp6->client_duid = grub_malloc (len); ++ grub_memcpy (dhcp6->client_duid, opt->data, len); ++ dhcp6->client_duid_len = len; ++ break; ++ ++ case GRUB_NET_DHCP6_OPTION_SERVERID: + +- if (len + i > 1024) ++ if (dhcp6->server_duid || !len) ++ { ++ grub_dprintf ("bootp", "Skipped DHCPv6 SERVERID with length %u\n", len); + break; ++ } ++ dhcp6->server_duid = grub_malloc (len); ++ grub_memcpy (dhcp6->server_duid, opt->data, len); ++ dhcp6->server_duid_len = len; ++ break; + +- if (num == GRUB_NET_DHCP6_BOOTFILE_URL) ++ case GRUB_NET_DHCP6_OPTION_IA_NA: ++ { ++ const struct grub_net_dhcp6_option_iana *ia_na; ++ grub_uint16_t data_len; ++ ++ if (dhcp6->iaid || len < sizeof (*ia_na)) + { +- 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; ++ grub_dprintf ("bootp", "Skipped DHCPv6 IA_NA with length %u\n", len); ++ break; + } +- else if (num == GRUB_NET_DHCP6_IA_NA) ++ ia_na = (const struct grub_net_dhcp6_option_iana *)opt->data; ++ dhcp6->iaid = grub_be_to_cpu32 (ia_na->iaid); ++ dhcp6->t1 = grub_be_to_cpu32 (ia_na->t1); ++ dhcp6->t2 = grub_be_to_cpu32 (ia_na->t2); ++ ++ data_len = len - sizeof (*ia_na); ++ if (data_len) ++ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)ia_na->data, data_len, parse_dhcp6_iaaddr, dhcp6); ++ } ++ break; ++ ++ case GRUB_NET_DHCP6_OPTION_DNS_SERVERS: ++ { ++ const grub_uint8_t *po; ++ grub_uint16_t ln; ++ grub_net_network_level_address_t *la; ++ ++ if (!len || len & 0xf) + { +- 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; +- } ++ grub_dprintf ("bootp", "Skip invalid length DHCPv6 DNS_SERVERS \n"); ++ break; + } ++ dhcp6->num_dns_server = ln = len >> 4; ++ dhcp6->dns_server_addrs = la = grub_zalloc (ln * sizeof (*la)); + +- i += len + 4; ++ for (po = opt->data; ln > 0; po += 0x10, la++, ln--) ++ { ++ la->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ la->ipv6[0] = grub_get_unaligned64 (po); ++ la->ipv6[1] = grub_get_unaligned64 (po + 8); ++ la->option = DNS_OPTION_PREFER_IPV6; ++ } + } ++ break; + +- grub_print_error (); ++ case GRUB_NET_DHCP6_OPTION_BOOTFILE_URL: ++ dissect_url ((const char *)opt->data, ++ &dhcp6->boot_file_proto, ++ &dhcp6->boot_file_server_ip, ++ &dhcp6->boot_file_path); ++ break; ++ ++ default: ++ break; + } ++} + +- if (is_def) ++static void ++foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size, dhcp6_option_hook_fn hook, void *hook_data) ++{ ++ while (size) + { ++ grub_uint16_t code, len; ++ ++ if (size < sizeof (*opt)) ++ { ++ grub_dprintf ("bootp", "DHCPv6: Options stopped with remaining size %" PRIxGRUB_SIZE "\n", size); ++ break; ++ } ++ size -= sizeof (*opt); ++ len = grub_be_to_cpu16 (opt->len); ++ code = grub_be_to_cpu16 (opt->code); ++ if (size < len) ++ { ++ grub_dprintf ("bootp", "DHCPv6: Options stopped at out of bound length %u for option %u\n", len, code); ++ break; ++ } ++ if (!len) ++ { ++ grub_dprintf ("bootp", "DHCPv6: Options stopped at zero length option %u\n", code); ++ break; ++ } ++ else ++ { ++ if (hook) ++ hook (opt, hook_data); ++ size -= len; ++ opt = (const struct grub_net_dhcp6_option *)((grub_uint8_t *)opt + len + sizeof (*opt)); ++ } ++ } ++} ++ ++static grub_dhcp6_options_t ++grub_dhcp6_options_get (const struct grub_net_dhcp6_packet *v6h, ++ grub_size_t size) ++{ ++ grub_dhcp6_options_t options; ++ ++ if (size < sizeof (*v6h)) ++ { ++ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("DHCPv6 packet size too small")); ++ return NULL; ++ } ++ ++ options = grub_zalloc (sizeof(*options)); ++ if (!options) ++ return NULL; ++ ++ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)v6h->dhcp_options, ++ size - sizeof (*v6h), parse_dhcp6_option, options); ++ ++ return options; ++} ++ ++static void ++grub_dhcp6_options_free (grub_dhcp6_options_t options) ++{ ++ if (options->client_duid) ++ grub_free (options->client_duid); ++ if (options->server_duid) ++ grub_free (options->server_duid); ++ if (options->ia_addr) ++ grub_free (options->ia_addr); ++ if (options->dns_server_addrs) ++ grub_free (options->dns_server_addrs); ++ if (options->boot_file_proto) ++ grub_free (options->boot_file_proto); ++ if (options->boot_file_server_ip) ++ grub_free (options->boot_file_server_ip); ++ if (options->boot_file_path) ++ grub_free (options->boot_file_path); ++ ++ grub_free (options); ++} ++ ++static grub_dhcp6_session_t grub_dhcp6_sessions; ++#define FOR_DHCP6_SESSIONS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE (var, next, grub_dhcp6_sessions) ++#define FOR_DHCP6_SESSIONS(var) FOR_LIST_ELEMENTS (var, grub_dhcp6_sessions) ++ ++static void ++grub_net_configure_by_dhcp6_info (const char *name, ++ struct grub_net_card *card, ++ grub_dhcp6_options_t dhcp6, ++ int is_def, ++ int flags, ++ struct grub_net_network_level_interface **ret_inf) ++{ ++ grub_net_network_level_netaddress_t netaddr; ++ struct grub_net_network_level_interface *inf; ++ ++ if (dhcp6->ia_addr) ++ { ++ inf = grub_net_add_addr (name, card, dhcp6->ia_addr, &card->default_address, flags); ++ ++ netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ netaddr.ipv6.base[0] = dhcp6->ia_addr->ipv6[0]; ++ netaddr.ipv6.base[1] = 0; ++ netaddr.ipv6.masksize = 64; ++ grub_net_add_route (name, netaddr, inf); ++ ++ if (ret_inf) ++ *ret_inf = inf; ++ } ++ ++ if (dhcp6->dns_server_addrs) ++ { ++ grub_uint16_t i; ++ ++ for (i = 0; i < dhcp6->num_dns_server; ++i) ++ grub_net_add_dns_server (dhcp6->dns_server_addrs + i); ++ } ++ ++ if (dhcp6->boot_file_path) ++ grub_env_set_net_property (name, "boot_file", dhcp6->boot_file_path, ++ grub_strlen (dhcp6->boot_file_path)); ++ ++ if (is_def && dhcp6->boot_file_server_ip) ++ { ++ grub_net_default_server = grub_strdup (dhcp6->boot_file_server_ip); + grub_env_set ("net_default_interface", name); + grub_env_export ("net_default_interface"); + } ++} + +- if (inter) +- grub_net_add_ipv6_local (inter, mask); +- return inter; ++static void ++grub_dhcp6_session_add (struct grub_net_network_level_interface *iface, ++ grub_uint32_t iaid) ++{ ++ grub_dhcp6_session_t se; ++ struct grub_datetime date; ++ grub_err_t err; ++ grub_int32_t t = 0; ++ ++ se = grub_malloc (sizeof (*se)); ++ ++ err = grub_get_datetime (&date); ++ if (err || !grub_datetime2unixtime (&date, &t)) ++ { ++ grub_errno = GRUB_ERR_NONE; ++ t = 0; ++ } ++ ++ se->iface = iface; ++ se->iaid = iaid; ++ se->transaction_id = t; ++ se->start_time = grub_get_time_ms (); ++ se->duid.type = grub_cpu_to_be16_compile_time (3) ; ++ se->duid.hw_type = grub_cpu_to_be16_compile_time (1); ++ grub_memcpy (&se->duid.hwaddr, &iface->hwaddress.mac, sizeof (se->duid.hwaddr)); ++ se->adv = NULL; ++ se->reply = NULL; ++ grub_list_push (GRUB_AS_LIST_P (&grub_dhcp6_sessions), GRUB_AS_LIST (se)); + } + ++static void ++grub_dhcp6_session_remove (grub_dhcp6_session_t se) ++{ ++ grub_list_remove (GRUB_AS_LIST (se)); ++ if (se->adv) ++ grub_dhcp6_options_free (se->adv); ++ if (se->reply) ++ grub_dhcp6_options_free (se->reply); ++ grub_free (se); ++} ++ ++static void ++grub_dhcp6_session_remove_all (void) ++{ ++ grub_dhcp6_session_t se, next; ++ ++ FOR_DHCP6_SESSIONS_SAFE (se, next) ++ { ++ grub_dhcp6_session_remove (se); ++ } ++ grub_dhcp6_sessions = NULL; ++} ++ ++static grub_err_t ++grub_dhcp6_session_configure_network (grub_dhcp6_session_t se) ++{ ++ char *name; ++ ++ name = grub_xasprintf ("%s:dhcp6", se->iface->card->name); ++ if (!name) ++ return grub_errno; ++ ++ grub_net_configure_by_dhcp6_info (name, se->iface->card, se->reply, 1, 0, 0); ++ grub_free (name); ++ ++ return GRUB_ERR_NONE; ++} ++ ++static grub_err_t ++grub_dhcp6_session_send_request (grub_dhcp6_session_t se) ++{ ++ struct grub_net_buff *nb; ++ struct grub_net_dhcp6_option *opt; ++ struct grub_net_dhcp6_packet *v6h; ++ struct grub_net_dhcp6_option_iana *ia_na; ++ struct grub_net_dhcp6_option_iaaddr *iaaddr; ++ struct udphdr *udph; ++ grub_net_network_level_address_t multicast; ++ grub_net_link_level_address_t ll_multicast; ++ grub_uint64_t elapsed; ++ struct grub_net_network_level_interface *inf = se->iface; ++ grub_dhcp6_options_t dhcp6 = se->adv; ++ grub_err_t err = GRUB_ERR_NONE; ++ ++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); ++ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL); ++ ++ err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); ++ if (err) ++ return err; ++ ++ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); ++ ++ if (!nb) ++ return grub_errno; ++ ++ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ err = grub_netbuff_push (nb, dhcp6->client_duid_len + sizeof (*opt)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID); ++ opt->len = grub_cpu_to_be16 (dhcp6->client_duid_len); ++ grub_memcpy (opt->data, dhcp6->client_duid , dhcp6->client_duid_len); ++ ++ err = grub_netbuff_push (nb, dhcp6->server_duid_len + sizeof (*opt)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_SERVERID); ++ opt->len = grub_cpu_to_be16 (dhcp6->server_duid_len); ++ grub_memcpy (opt->data, dhcp6->server_duid , dhcp6->server_duid_len); ++ ++ err = grub_netbuff_push (nb, sizeof (*ia_na) + sizeof (*opt)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ if (dhcp6->ia_addr) ++ { ++ err = grub_netbuff_push (nb, sizeof(*iaaddr) + sizeof (*opt)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ } ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); ++ opt->len = grub_cpu_to_be16 (sizeof (*ia_na)); ++ if (dhcp6->ia_addr) ++ opt->len += grub_cpu_to_be16 (sizeof(*iaaddr) + sizeof (*opt)); ++ ++ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data; ++ ia_na->iaid = grub_cpu_to_be32 (dhcp6->iaid); ++ ++ ia_na->t1 = grub_cpu_to_be32 (dhcp6->t1); ++ ia_na->t2 = grub_cpu_to_be32 (dhcp6->t2); ++ ++ if (dhcp6->ia_addr) ++ { ++ opt = (struct grub_net_dhcp6_option *)ia_na->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR); ++ opt->len = grub_cpu_to_be16 (sizeof (*iaaddr)); ++ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)opt->data; ++ grub_set_unaligned64 (iaaddr->addr, dhcp6->ia_addr->ipv6[0]); ++ grub_set_unaligned64 (iaaddr->addr + 8, dhcp6->ia_addr->ipv6[1]); ++ ++ iaaddr->preferred_lifetime = grub_cpu_to_be32 (dhcp6->preferred_lifetime); ++ iaaddr->valid_lifetime = grub_cpu_to_be32 (dhcp6->valid_lifetime); ++ } ++ ++ err = grub_netbuff_push (nb, sizeof (*opt) + 2 * sizeof (grub_uint16_t)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ opt = (struct grub_net_dhcp6_option*) nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ORO); ++ opt->len = grub_cpu_to_be16_compile_time (2 * sizeof (grub_uint16_t)); ++ grub_set_unaligned16 (opt->data, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL)); ++ grub_set_unaligned16 (opt->data + 2, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS)); ++ ++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ opt = (struct grub_net_dhcp6_option*) nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME); ++ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t)); ++ ++ /* the time is expressed in hundredths of a second */ ++ elapsed = grub_divmod64 (grub_get_time_ms () - se->start_time, 10, 0); ++ ++ if (elapsed > 0xffff) ++ elapsed = 0xffff; ++ ++ grub_set_unaligned16 (opt->data, grub_cpu_to_be16 ((grub_uint16_t)elapsed)); ++ ++ err = grub_netbuff_push (nb, sizeof (*v6h)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ v6h = (struct grub_net_dhcp6_packet *) nb->data; ++ v6h->message_type = GRUB_NET_DHCP6_REQUEST; ++ v6h->transaction_id = se->transaction_id; ++ ++ err = grub_netbuff_push (nb, sizeof (*udph)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ udph = (struct udphdr *) nb->data; ++ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT); ++ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT); ++ udph->chksum = 0; ++ udph->len = grub_cpu_to_be16 (nb->tail - nb->data); ++ ++ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, ++ &inf->address, ++ &multicast); ++ err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, ++ GRUB_NET_IP_UDP); ++ ++ grub_netbuff_free (nb); ++ ++ return err; ++} ++ ++struct grub_net_network_level_interface * ++grub_net_configure_by_dhcpv6_reply (const char *name, ++ struct grub_net_card *card, ++ grub_net_interface_flags_t flags, ++ const struct grub_net_dhcp6_packet *v6h, ++ grub_size_t size, ++ int is_def, ++ char **device, char **path) ++{ ++ struct grub_net_network_level_interface *inf; ++ grub_dhcp6_options_t dhcp6; ++ ++ dhcp6 = grub_dhcp6_options_get (v6h, size); ++ if (!dhcp6) ++ { ++ grub_print_error (); ++ return NULL; ++ } ++ ++ grub_net_configure_by_dhcp6_info (name, card, dhcp6, is_def, flags, &inf); ++ ++ if (device && dhcp6->boot_file_proto && dhcp6->boot_file_server_ip) ++ { ++ *device = grub_xasprintf ("%s,%s", dhcp6->boot_file_proto, dhcp6->boot_file_server_ip); ++ grub_print_error (); ++ } ++ if (path && dhcp6->boot_file_path) ++ { ++ *path = grub_strdup (dhcp6->boot_file_path); ++ grub_print_error (); ++ if (*path) ++ { ++ char *slash; ++ slash = grub_strrchr (*path, '/'); ++ if (slash) ++ *slash = 0; ++ else ++ **path = 0; ++ } ++ } ++ ++ grub_dhcp6_options_free (dhcp6); ++ return inf; ++} + + void + grub_net_process_dhcp (struct grub_net_buff *nb, +@@ -546,6 +1038,77 @@ grub_net_process_dhcp (struct grub_net_buff *nb, + } + } + ++grub_err_t ++grub_net_process_dhcp6 (struct grub_net_buff *nb, ++ struct grub_net_card *card __attribute__ ((unused))) ++{ ++ const struct grub_net_dhcp6_packet *v6h; ++ grub_dhcp6_session_t se; ++ grub_size_t size; ++ grub_dhcp6_options_t options; ++ ++ v6h = (const struct grub_net_dhcp6_packet *) nb->data; ++ size = nb->tail - nb->data; ++ ++ options = grub_dhcp6_options_get (v6h, size); ++ if (!options) ++ return grub_errno; ++ ++ if (!options->client_duid || !options->server_duid || !options->ia_addr) ++ { ++ grub_dhcp6_options_free (options); ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Bad DHCPv6 Packet"); ++ } ++ ++ FOR_DHCP6_SESSIONS (se) ++ { ++ if (se->transaction_id == v6h->transaction_id && ++ grub_memcmp (options->client_duid, &se->duid, sizeof (se->duid)) == 0 && ++ se->iaid == options->iaid) ++ break; ++ } ++ ++ if (!se) ++ { ++ grub_dprintf ("bootp", "DHCPv6 session not found\n"); ++ grub_dhcp6_options_free (options); ++ return GRUB_ERR_NONE; ++ } ++ ++ if (v6h->message_type == GRUB_NET_DHCP6_ADVERTISE) ++ { ++ if (se->adv) ++ { ++ grub_dprintf ("bootp", "Skipped DHCPv6 Advertised .. \n"); ++ grub_dhcp6_options_free (options); ++ return GRUB_ERR_NONE; ++ } ++ ++ se->adv = options; ++ return grub_dhcp6_session_send_request (se); ++ } ++ else if (v6h->message_type == GRUB_NET_DHCP6_REPLY) ++ { ++ if (!se->adv) ++ { ++ grub_dprintf ("bootp", "Skipped DHCPv6 Reply .. \n"); ++ grub_dhcp6_options_free (options); ++ return GRUB_ERR_NONE; ++ } ++ ++ se->reply = options; ++ grub_dhcp6_session_configure_network (se); ++ grub_dhcp6_session_remove (se); ++ return GRUB_ERR_NONE; ++ } ++ else ++ { ++ grub_dhcp6_options_free (options); ++ } ++ ++ return GRUB_ERR_NONE; ++} ++ + static grub_err_t + grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), + int argc, char **args) +@@ -816,7 +1379,174 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), + return err; + } + +-static grub_command_t cmd_getdhcp, cmd_bootp; ++static grub_err_t ++grub_cmd_bootp6 (struct grub_command *cmd __attribute__ ((unused)), ++ int argc, char **args) ++{ ++ struct grub_net_card *card; ++ grub_uint32_t iaid = 0; ++ int interval; ++ grub_err_t err; ++ grub_dhcp6_session_t se; ++ ++ err = GRUB_ERR_NONE; ++ ++ FOR_NET_CARDS (card) ++ { ++ struct grub_net_network_level_interface *iface; ++ ++ if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) ++ continue; ++ ++ iface = grub_net_ipv6_get_link_local (card, &card->default_address); ++ if (!iface) ++ { ++ grub_dhcp6_session_remove_all (); ++ return grub_errno; ++ } ++ ++ grub_dhcp6_session_add (iface, iaid++); ++ } ++ ++ for (interval = 200; interval < 10000; interval *= 2) ++ { ++ int done = 1; ++ ++ FOR_DHCP6_SESSIONS (se) ++ { ++ struct grub_net_buff *nb; ++ struct grub_net_dhcp6_option *opt; ++ struct grub_net_dhcp6_packet *v6h; ++ struct grub_net_dhcp6_option_duid_ll *duid; ++ struct grub_net_dhcp6_option_iana *ia_na; ++ grub_net_network_level_address_t multicast; ++ grub_net_link_level_address_t ll_multicast; ++ struct udphdr *udph; ++ ++ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; ++ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); ++ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL); ++ ++ err = grub_net_link_layer_resolve (se->iface, ++ &multicast, &ll_multicast); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ return err; ++ } ++ ++ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); ++ ++ if (!nb) ++ { ++ grub_dhcp6_session_remove_all (); ++ return grub_errno; ++ } ++ ++ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t)); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME); ++ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t)); ++ grub_set_unaligned16 (opt->data, 0); ++ ++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*duid)); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID); ++ opt->len = grub_cpu_to_be16 (sizeof (*duid)); ++ ++ duid = (struct grub_net_dhcp6_option_duid_ll *) opt->data; ++ grub_memcpy (duid, &se->duid, sizeof (*duid)); ++ ++ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*ia_na)); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ opt = (struct grub_net_dhcp6_option *)nb->data; ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); ++ opt->len = grub_cpu_to_be16 (sizeof (*ia_na)); ++ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data; ++ ia_na->iaid = grub_cpu_to_be32 (se->iaid); ++ ia_na->t1 = 0; ++ ia_na->t2 = 0; ++ ++ err = grub_netbuff_push (nb, sizeof (*v6h)); ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ v6h = (struct grub_net_dhcp6_packet *)nb->data; ++ v6h->message_type = GRUB_NET_DHCP6_SOLICIT; ++ v6h->transaction_id = se->transaction_id; ++ ++ grub_netbuff_push (nb, sizeof (*udph)); ++ ++ udph = (struct udphdr *) nb->data; ++ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT); ++ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT); ++ udph->chksum = 0; ++ udph->len = grub_cpu_to_be16 (nb->tail - nb->data); ++ ++ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, ++ &se->iface->address, &multicast); ++ ++ err = grub_net_send_ip_packet (se->iface, &multicast, ++ &ll_multicast, nb, GRUB_NET_IP_UDP); ++ done = 0; ++ grub_netbuff_free (nb); ++ ++ if (err) ++ { ++ grub_dhcp6_session_remove_all (); ++ return err; ++ } ++ } ++ if (!done) ++ grub_net_poll_cards (interval, 0); ++ } ++ ++ FOR_DHCP6_SESSIONS (se) ++ { ++ grub_error_push (); ++ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, ++ N_("couldn't autoconfigure %s"), ++ se->iface->card->name); ++ } ++ ++ grub_dhcp6_session_remove_all (); ++ ++ return err; ++} ++ ++static grub_command_t cmd_getdhcp, cmd_bootp, cmd_bootp6; + + void + grub_bootp_init (void) +@@ -827,6 +1557,9 @@ grub_bootp_init (void) + cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt, + N_("VAR INTERFACE NUMBER DESCRIPTION"), + N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value.")); ++ cmd_bootp6 = grub_register_command ("net_bootp6", grub_cmd_bootp6, ++ N_("[CARD]"), ++ N_("perform a DHCPv6 autoconfiguration")); + } + + void +@@ -834,4 +1567,5 @@ grub_bootp_fini (void) + { + grub_unregister_command (cmd_getdhcp); + grub_unregister_command (cmd_bootp); ++ grub_unregister_command (cmd_bootp6); + } +diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c +index 311213fee..daa5b0351 100644 +--- a/grub-core/net/ip.c ++++ b/grub-core/net/ip.c +@@ -235,6 +235,45 @@ handle_dgram (struct grub_net_buff *nb, + { + struct udphdr *udph; + udph = (struct udphdr *) nb->data; ++ ++ if (proto == GRUB_NET_IP_UDP && udph->dst == grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT)) ++ { ++ if (udph->chksum) ++ { ++ grub_uint16_t chk, expected; ++ chk = udph->chksum; ++ udph->chksum = 0; ++ expected = grub_net_ip_transport_checksum (nb, ++ GRUB_NET_IP_UDP, ++ source, ++ dest); ++ if (expected != chk) ++ { ++ grub_dprintf ("net", "Invalid UDP checksum. " ++ "Expected %x, got %x\n", ++ grub_be_to_cpu16 (expected), ++ grub_be_to_cpu16 (chk)); ++ grub_netbuff_free (nb); ++ return GRUB_ERR_NONE; ++ } ++ udph->chksum = chk; ++ } ++ ++ err = grub_netbuff_pull (nb, sizeof (*udph)); ++ if (err) ++ { ++ grub_netbuff_free (nb); ++ return err; ++ } ++ ++ err = grub_net_process_dhcp6 (nb, card); ++ if (err) ++ grub_print_error (); ++ ++ grub_netbuff_free (nb); ++ return GRUB_ERR_NONE; ++ } ++ + if (proto == GRUB_NET_IP_UDP && grub_be_to_cpu16 (udph->dst) == 68) + { + const struct grub_net_bootp_packet *bootp; +diff --git a/include/grub/net.h b/include/grub/net.h +index 20e699bb0..8ecfbb492 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -423,50 +423,65 @@ struct grub_net_bootp_packet + 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 ++struct grub_net_dhcp6_packet + { +- grub_uint16_t option_num; +- grub_uint16_t option_len; +- grub_uint8_t option_data[]; ++ grub_uint32_t message_type:8; ++ grub_uint32_t transaction_id:24; ++ grub_uint8_t dhcp_options[0]; + } 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; ++struct grub_net_dhcp6_option { ++ grub_uint16_t code; ++ grub_uint16_t len; ++ grub_uint8_t data[0]; ++} GRUB_PACKED; ++ ++struct grub_net_dhcp6_option_iana { + grub_uint32_t iaid; + grub_uint32_t t1; + grub_uint32_t t2; +- grub_uint8_t options[]; ++ grub_uint8_t data[0]; + } 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]; ++struct grub_net_dhcp6_option_iaaddr { ++ grub_uint8_t addr[16]; + grub_uint32_t preferred_lifetime; + grub_uint32_t valid_lifetime; +- grub_uint8_t options[]; ++ grub_uint8_t data[0]; + } GRUB_PACKED; +-typedef struct grub_net_dhcpv6_opt_ia_address grub_net_dhcpv6_opt_ia_address_t; + +-struct grub_net_dhcpv6_packet ++struct grub_net_dhcp6_option_duid_ll + { +- grub_uint32_t message_type:8; +- grub_uint32_t transaction_id:24; +- grub_uint8_t dhcp_options[1024]; ++ grub_uint16_t type; ++ grub_uint16_t hw_type; ++ grub_uint8_t hwaddr[6]; + } GRUB_PACKED; +-typedef struct grub_net_dhcpv6_packet grub_net_dhcpv6_packet_t; ++ ++enum ++ { ++ GRUB_NET_DHCP6_SOLICIT = 1, ++ GRUB_NET_DHCP6_ADVERTISE = 2, ++ GRUB_NET_DHCP6_REQUEST = 3, ++ GRUB_NET_DHCP6_REPLY = 7 ++ }; ++ ++enum ++ { ++ DHCP6_CLIENT_PORT = 546, ++ DHCP6_SERVER_PORT = 547 ++ }; ++ ++enum ++ { ++ GRUB_NET_DHCP6_OPTION_CLIENTID = 1, ++ GRUB_NET_DHCP6_OPTION_SERVERID = 2, ++ GRUB_NET_DHCP6_OPTION_IA_NA = 3, ++ GRUB_NET_DHCP6_OPTION_IAADDR = 5, ++ GRUB_NET_DHCP6_OPTION_ORO = 6, ++ GRUB_NET_DHCP6_OPTION_ELAPSED_TIME = 8, ++ GRUB_NET_DHCP6_OPTION_DNS_SERVERS = 23, ++ GRUB_NET_DHCP6_OPTION_BOOTFILE_URL = 59 ++ }; + + #define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63 + #define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82 +@@ -497,12 +512,12 @@ grub_net_configure_by_dhcp_ack (const char *name, + 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); ++grub_net_configure_by_dhcpv6_reply (const char *name, ++ struct grub_net_card *card, ++ grub_net_interface_flags_t flags, ++ const struct grub_net_dhcp6_packet *v6, ++ grub_size_t size, ++ int is_def, char **device, char **path); + + int + grub_ipv6_get_masksize(grub_uint16_t *mask); +@@ -519,6 +534,10 @@ void + grub_net_process_dhcp (struct grub_net_buff *nb, + struct grub_net_card *card); + ++grub_err_t ++grub_net_process_dhcp6 (struct grub_net_buff *nb, ++ struct grub_net_card *card); ++ + int + grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, + const grub_net_link_level_address_t *b); +-- +2.13.5 + diff --git a/SOURCES/0251-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch b/SOURCES/0251-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch deleted file mode 100644 index b8a71b6..0000000 --- a/SOURCES/0251-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch +++ /dev/null @@ -1,183 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aaron Miller -Date: Fri, 29 Jul 2016 17:41:38 +0800 -Subject: [PATCH] net: read bracketed ipv6 addrs and port numbers (pjones - fixup) - -Various bug fixes related to previous patch. - -Signed-off-by: Peter Jones ---- - grub-core/net/http.c | 6 ++++-- - grub-core/net/net.c | 31 +++++++++++++------------------ - grub-core/net/tftp.c | 19 ++++++++++++++++--- - 3 files changed, 33 insertions(+), 23 deletions(-) - -diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index 6d99051d345..2b46e4672fc 100644 ---- a/grub-core/net/http.c -+++ b/grub-core/net/http.c -@@ -289,7 +289,9 @@ http_receive (grub_net_tcp_socket_t sock __attribute__ ((unused)), - nb2 = grub_netbuff_alloc (data->chunk_rem); - if (!nb2) - return grub_errno; -- grub_netbuff_put (nb2, data->chunk_rem); -+ err = grub_netbuff_put (nb2, data->chunk_rem); -+ if (err) -+ return grub_errno; - grub_memcpy (nb2->data, nb->data, data->chunk_rem); - if (file->device->net->packs.count >= 20) - { -@@ -406,7 +408,7 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) - data->filename, server, port ? port : HTTP_PORT); - data->sock = grub_net_tcp_open (server, - port ? port : HTTP_PORT, http_receive, -- http_err, http_err, -+ http_err, NULL, - file); - if (!data->sock) - { -diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index b062f6fd0cd..6b4b10ba444 100644 ---- a/grub-core/net/net.c -+++ b/grub-core/net/net.c -@@ -464,10 +464,11 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) - int word, quaddot = -1; - int bracketed = 0; - -- if (ptr[0] == '[') { -- bracketed = 1; -- ptr++; -- } -+ if (ptr[0] == '[') -+ { -+ bracketed = 1; -+ ptr++; -+ } - - if (ptr[0] == ':' && ptr[1] != ':') - return 0; -@@ -506,9 +507,8 @@ parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) - grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); - } - grub_memcpy (ip, newip, 16); -- if (bracketed && *ptr == ']') { -+ if (bracketed && *ptr == ']') - ptr++; -- } - if (rest) - *rest = ptr; - return 1; -@@ -1401,7 +1401,7 @@ grub_net_open_real (const char *name) - char* port_start; - /* ipv6 or port specified? */ - if ((port_start = grub_strchr (server, ':'))) -- { -+ { - char* ipv6_begin; - if((ipv6_begin = grub_strchr (server, '['))) - { -@@ -1473,19 +1473,13 @@ grub_net_open_real (const char *name) - { - grub_net_t ret = grub_zalloc (sizeof (*ret)); - if (!ret) -- return NULL; -- ret->protocol = proto; -- if (server) - { -- ret->server = grub_strdup (server); -- if (!ret->server) -- { -- grub_free (ret); -- return NULL; -- } -+ grub_free (host); -+ return NULL; - } -- else -- ret->server = NULL; -+ ret->protocol = proto; -+ ret->port = port; -+ ret->server = host; - ret->fs = &grub_net_fs; - ret->offset = 0; - ret->eof = 0; -@@ -1516,6 +1510,7 @@ grub_net_open_real (const char *name) - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), - name); - -+ grub_free (host); - return NULL; - } - -diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index d13a6c8ed2d..17583cba380 100644 ---- a/grub-core/net/tftp.c -+++ b/grub-core/net/tftp.c -@@ -346,7 +346,10 @@ tftp_open (struct grub_file *file, const char *filename) - grub_netbuff_reserve (&nb, 1500); - err = grub_netbuff_push (&nb, sizeof (*tftph)); - if (err) -- return err; -+ { -+ grub_free (data); -+ return err; -+ } - - tftph = (struct tftphdr *) nb.data; - -@@ -384,14 +387,20 @@ tftp_open (struct grub_file *file, const char *filename) - - err = grub_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); - if (err) -- return err; -+ { -+ grub_free (data); -+ return err; -+ } - - file->not_easily_seekable = 1; - file->data = data; - - data->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); - if (!data->pq) -- return grub_errno; -+ { -+ grub_free (data); -+ 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); -@@ -402,6 +411,7 @@ tftp_open (struct grub_file *file, const char *filename) - (unsigned long long)data->file_size, - (unsigned long long)data->block_size); - destroy_pq (data); -+ grub_free (data); - return err; - } - -@@ -413,6 +423,7 @@ tftp_open (struct grub_file *file, const char *filename) - { - grub_dprintf("tftp", "connection failed\n"); - destroy_pq (data); -+ grub_free (data); - return grub_errno; - } - -@@ -426,6 +437,7 @@ tftp_open (struct grub_file *file, const char *filename) - { - grub_net_udp_close (data->sock); - destroy_pq (data); -+ grub_free (data); - return err; - } - grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), -@@ -442,6 +454,7 @@ tftp_open (struct grub_file *file, const char *filename) - { - grub_net_udp_close (data->sock); - destroy_pq (data); -+ grub_free (data); - return grub_errno; - } - diff --git a/SOURCES/0252-efinet-UEFI-IPv6-PXE-support.patch b/SOURCES/0252-efinet-UEFI-IPv6-PXE-support.patch new file mode 100644 index 0000000..cc7c82e --- /dev/null +++ b/SOURCES/0252-efinet-UEFI-IPv6-PXE-support.patch @@ -0,0 +1,160 @@ +From 25fdb7899c0f66ba4fddd8093df9c66a49dd2870 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Wed, 15 Apr 2015 14:48:30 +0800 +Subject: [PATCH 252/261] efinet: UEFI IPv6 PXE support + +When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is +cached in firmware buffer which can be obtained by PXE Base Code protocol. The +network interface can be setup through the parameters in that obtained packet. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 23 +++++--------- + include/grub/efi/api.h | 64 ++++++++++++++++++++++++-------------- + 2 files changed, 48 insertions(+), 39 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index b9ed13fca..c00ac2e64 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -404,26 +404,19 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + pxe_mode = pxe->mode; + 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", + 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)); +- +- 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_net_configure_by_dhcpv6_reply (card->name, card, 0, ++ (struct grub_net_dhcp6_packet *) ++ &pxe_mode->dhcp_ack, ++ sizeof (pxe_mode->dhcp_ack), ++ 1, device, path); ++ if (device && path) + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); ++ if (grub_errno) ++ grub_print_error (); + } + else + { +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index 9422ba9a9..0821e3364 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -1446,29 +1446,42 @@ typedef union + 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]; ++typedef struct { ++ grub_uint8_t addr[4]; ++} grub_efi_pxe_ipv4_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[16]; ++} grub_efi_pxe_ipv6_address_t; ++ ++typedef struct { ++ grub_uint8_t addr[32]; ++} grub_efi_pxe_mac_address_t; ++ ++typedef union { ++ grub_uint32_t addr[4]; ++ grub_efi_pxe_ipv4_address_t v4; ++ grub_efi_pxe_ipv6_address_t v6; ++} grub_efi_pxe_ip_address_t; ++ ++#define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8 ++typedef struct { ++ grub_uint8_t filters; ++ grub_uint8_t ip_cnt; ++ grub_uint16_t reserved; ++ grub_efi_pxe_ip_address_t ip_list[GRUB_EFI_PXE_BASE_CODE_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; ++typedef struct { ++ grub_efi_pxe_ip_address_t ip_addr; ++ grub_efi_pxe_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; ++typedef struct { ++ grub_efi_pxe_ip_address_t ip_addr; ++ grub_efi_pxe_ip_address_t subnet_mask; ++ grub_efi_pxe_ip_address_t gw_addr; + } grub_efi_pxe_route_entry_t; + + typedef struct grub_efi_pxe_icmp_error +@@ -1482,10 +1495,10 @@ typedef struct grub_efi_pxe_icmp_error + grub_efi_uint32_t mtu; + grub_efi_uint32_t pointer; + struct +- { +- grub_efi_uint16_t identifier; +- grub_efi_uint16_t sequence; +- } echo; ++ { ++ grub_efi_uint16_t identifier; ++ grub_efi_uint16_t sequence; ++ } echo; + } u; + grub_efi_uint8_t data[494]; + } grub_efi_pxe_icmp_error_t; +@@ -1496,6 +1509,9 @@ typedef struct grub_efi_pxe_tftp_error + grub_efi_char8_t error_string[127]; + } grub_efi_pxe_tftp_error_t; + ++#define GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8 ++#define GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8 ++ + typedef struct grub_efi_pxe_mode + { + grub_efi_boolean_t started; +@@ -1527,9 +1543,9 @@ typedef struct grub_efi_pxe_mode + 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_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_BASE_CODE_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_route_entry_t route_table[GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES]; + grub_efi_pxe_icmp_error_t icmp_error; + grub_efi_pxe_tftp_error_t tftp_error; + } grub_efi_pxe_mode_t; +-- +2.13.5 + diff --git a/SOURCES/0252-tftp-Fix-a-minor-const-error.patch b/SOURCES/0252-tftp-Fix-a-minor-const-error.patch deleted file mode 100644 index eb6abd9..0000000 --- a/SOURCES/0252-tftp-Fix-a-minor-const-error.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 21 Jun 2018 19:09:11 -0400 -Subject: [PATCH] tftp: Fix a minor const error - -Signed-off-by: Peter Jones ---- - grub-core/net/tftp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c -index 17583cba380..e267af354f4 100644 ---- a/grub-core/net/tftp.c -+++ b/grub-core/net/tftp.c -@@ -307,7 +307,7 @@ static void - grub_normalize_filename (char *normalized, const char *filename) - { - char *dest = normalized; -- char *src = filename; -+ const char *src = filename; - - while (*src != '\0') - { diff --git a/SOURCES/0253-bootp-New-net_bootp6-command.patch b/SOURCES/0253-bootp-New-net_bootp6-command.patch deleted file mode 100644 index 5cfc9cf..0000000 --- a/SOURCES/0253-bootp-New-net_bootp6-command.patch +++ /dev/null @@ -1,1304 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Sun, 10 Jul 2016 23:46:06 +0800 -Subject: [PATCH] bootp: New net_bootp6 command - -Implement new net_bootp6 command for IPv6 network auto configuration via the -DHCPv6 protocol (RFC3315). - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/bootp.c | 1048 +++++++++++++++++++++++++++++++++++++++++-------- - grub-core/net/ip.c | 39 ++ - include/grub/net.h | 91 +++-- - 3 files changed, 985 insertions(+), 193 deletions(-) - -diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 0a2d11b8820..26b3d83d0bc 100644 ---- a/grub-core/net/bootp.c -+++ b/grub-core/net/bootp.c -@@ -25,6 +25,98 @@ - #include - #include - #include -+#include -+#include -+ -+static int -+dissect_url (const char *url, char **proto, char **host, char **path) -+{ -+ const char *p, *ps; -+ grub_size_t l; -+ -+ *proto = *host = *path = NULL; -+ ps = p = url; -+ -+ while ((p = grub_strchr (p, ':'))) -+ { -+ if (grub_strlen (p) < sizeof ("://") - 1) -+ break; -+ if (grub_memcmp (p, "://", sizeof ("://") - 1) == 0) -+ { -+ l = p - ps; -+ *proto = grub_malloc (l + 1); -+ if (!*proto) -+ { -+ grub_print_error (); -+ return 0; -+ } -+ -+ grub_memcpy (*proto, ps, l); -+ (*proto)[l] = '\0'; -+ p += sizeof ("://") - 1; -+ break; -+ } -+ ++p; -+ } -+ -+ if (!*proto) -+ { -+ grub_dprintf ("bootp", "url: %s is not valid, protocol not found\n", url); -+ return 0; -+ } -+ -+ ps = p; -+ p = grub_strchr (p, '/'); -+ -+ if (!p) -+ { -+ grub_dprintf ("bootp", "url: %s is not valid, host/path not found\n", url); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ -+ l = p - ps; -+ -+ if (l > 2 && ps[0] == '[' && ps[l - 1] == ']') -+ { -+ *host = grub_malloc (l - 1); -+ if (!*host) -+ { -+ grub_print_error (); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ grub_memcpy (*host, ps + 1, l - 2); -+ (*host)[l - 2] = 0; -+ } -+ else -+ { -+ *host = grub_malloc (l + 1); -+ if (!*host) -+ { -+ grub_print_error (); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ grub_memcpy (*host, ps, l); -+ (*host)[l] = 0; -+ } -+ -+ *path = grub_strdup (p); -+ if (!*path) -+ { -+ grub_print_error (); -+ grub_free (*host); -+ grub_free (*proto); -+ *host = NULL; -+ *proto = NULL; -+ return 0; -+ } -+ return 1; -+} - - static char * - grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), -@@ -341,178 +433,578 @@ 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 || !path) -+/* The default netbuff size for sending DHCPv6 packets which should be -+ large enough to hold the information */ -+#define GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE 512 -+ -+struct grub_dhcp6_options -+{ -+ grub_uint8_t *client_duid; -+ grub_uint16_t client_duid_len; -+ grub_uint8_t *server_duid; -+ grub_uint16_t server_duid_len; -+ grub_uint32_t iaid; -+ grub_uint32_t t1; -+ grub_uint32_t t2; -+ grub_net_network_level_address_t *ia_addr; -+ grub_uint32_t preferred_lifetime; -+ grub_uint32_t valid_lifetime; -+ grub_net_network_level_address_t *dns_server_addrs; -+ grub_uint16_t num_dns_server; -+ char *boot_file_proto; -+ char *boot_file_server_ip; -+ char *boot_file_path; -+}; -+ -+typedef struct grub_dhcp6_options *grub_dhcp6_options_t; -+ -+struct grub_dhcp6_session -+{ -+ struct grub_dhcp6_session *next; -+ struct grub_dhcp6_session **prev; -+ grub_uint32_t iaid; -+ grub_uint32_t transaction_id:24; -+ grub_uint64_t start_time; -+ struct grub_net_dhcp6_option_duid_ll duid; -+ struct grub_net_network_level_interface *iface; -+ -+ /* The associated dhcpv6 options */ -+ grub_dhcp6_options_t adv; -+ grub_dhcp6_options_t reply; -+}; -+ -+typedef struct grub_dhcp6_session *grub_dhcp6_session_t; -+ -+typedef void (*dhcp6_option_hook_fn) (const struct grub_net_dhcp6_option *opt, void *data); -+ -+static void -+foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size, -+ dhcp6_option_hook_fn hook, void *hook_data); -+ -+static void -+parse_dhcp6_iaaddr (const struct grub_net_dhcp6_option *opt, void *data) -+{ -+ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t )data; -+ -+ grub_uint16_t code = grub_be_to_cpu16 (opt->code); -+ grub_uint16_t len = grub_be_to_cpu16 (opt->len); -+ -+ if (code == GRUB_NET_DHCP6_OPTION_IAADDR) -+ { -+ const struct grub_net_dhcp6_option_iaaddr *iaaddr; -+ iaaddr = (const struct grub_net_dhcp6_option_iaaddr *)opt->data; -+ -+ if (len < sizeof (*iaaddr)) -+ { -+ grub_dprintf ("bootp", "DHCPv6: code %u with insufficient length %u\n", code, len); -+ return; -+ } -+ if (!dhcp6->ia_addr) -+ { -+ dhcp6->ia_addr = grub_malloc (sizeof(*dhcp6->ia_addr)); -+ dhcp6->ia_addr->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; -+ dhcp6->ia_addr->ipv6[0] = grub_get_unaligned64 (iaaddr->addr); -+ dhcp6->ia_addr->ipv6[1] = grub_get_unaligned64 (iaaddr->addr + 8); -+ dhcp6->preferred_lifetime = grub_be_to_cpu32 (iaaddr->preferred_lifetime); -+ dhcp6->valid_lifetime = grub_be_to_cpu32 (iaaddr->valid_lifetime); -+ } -+ } -+} -+ -+static void -+parse_dhcp6_option (const struct grub_net_dhcp6_option *opt, void *data) -+{ -+ grub_dhcp6_options_t dhcp6 = (grub_dhcp6_options_t)data; -+ grub_uint16_t code = grub_be_to_cpu16 (opt->code); -+ grub_uint16_t len = grub_be_to_cpu16 (opt->len); -+ -+ switch (code) -+ { -+ case GRUB_NET_DHCP6_OPTION_CLIENTID: -+ -+ if (dhcp6->client_duid || !len) -+ { -+ grub_dprintf ("bootp", "Skipped DHCPv6 CLIENTID with length %u\n", len); -+ break; -+ } -+ dhcp6->client_duid = grub_malloc (len); -+ grub_memcpy (dhcp6->client_duid, opt->data, len); -+ dhcp6->client_duid_len = len; -+ break; -+ -+ case GRUB_NET_DHCP6_OPTION_SERVERID: -+ -+ if (dhcp6->server_duid || !len) -+ { -+ grub_dprintf ("bootp", "Skipped DHCPv6 SERVERID with length %u\n", len); -+ break; -+ } -+ dhcp6->server_duid = grub_malloc (len); -+ grub_memcpy (dhcp6->server_duid, opt->data, len); -+ dhcp6->server_duid_len = len; -+ break; -+ -+ case GRUB_NET_DHCP6_OPTION_IA_NA: -+ { -+ const struct grub_net_dhcp6_option_iana *ia_na; -+ grub_uint16_t data_len; -+ -+ if (dhcp6->iaid || len < sizeof (*ia_na)) -+ { -+ grub_dprintf ("bootp", "Skipped DHCPv6 IA_NA with length %u\n", len); -+ break; -+ } -+ ia_na = (const struct grub_net_dhcp6_option_iana *)opt->data; -+ dhcp6->iaid = grub_be_to_cpu32 (ia_na->iaid); -+ dhcp6->t1 = grub_be_to_cpu32 (ia_na->t1); -+ dhcp6->t2 = grub_be_to_cpu32 (ia_na->t2); -+ -+ data_len = len - sizeof (*ia_na); -+ if (data_len) -+ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)ia_na->data, data_len, parse_dhcp6_iaaddr, dhcp6); -+ } -+ break; -+ -+ case GRUB_NET_DHCP6_OPTION_DNS_SERVERS: -+ { -+ const grub_uint8_t *po; -+ grub_uint16_t ln; -+ grub_net_network_level_address_t *la; -+ -+ if (!len || len & 0xf) -+ { -+ grub_dprintf ("bootp", "Skip invalid length DHCPv6 DNS_SERVERS \n"); -+ break; -+ } -+ dhcp6->num_dns_server = ln = len >> 4; -+ dhcp6->dns_server_addrs = la = grub_zalloc (ln * sizeof (*la)); -+ -+ for (po = opt->data; ln > 0; po += 0x10, la++, ln--) -+ { -+ la->type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; -+ la->ipv6[0] = grub_get_unaligned64 (po); -+ la->ipv6[1] = grub_get_unaligned64 (po + 8); -+ la->option = DNS_OPTION_PREFER_IPV6; -+ } -+ } -+ break; -+ -+ case GRUB_NET_DHCP6_OPTION_BOOTFILE_URL: -+ dissect_url ((const char *)opt->data, -+ &dhcp6->boot_file_proto, -+ &dhcp6->boot_file_server_ip, -+ &dhcp6->boot_file_path); -+ break; -+ -+ default: -+ break; -+ } -+} -+ -+static void -+foreach_dhcp6_option (const struct grub_net_dhcp6_option *opt, grub_size_t size, dhcp6_option_hook_fn hook, void *hook_data) -+{ -+ while (size) -+ { -+ grub_uint16_t code, len; -+ -+ if (size < sizeof (*opt)) -+ { -+ grub_dprintf ("bootp", "DHCPv6: Options stopped with remaining size %" PRIxGRUB_SIZE "\n", size); -+ break; -+ } -+ size -= sizeof (*opt); -+ len = grub_be_to_cpu16 (opt->len); -+ code = grub_be_to_cpu16 (opt->code); -+ if (size < len) -+ { -+ grub_dprintf ("bootp", "DHCPv6: Options stopped at out of bound length %u for option %u\n", len, code); -+ break; -+ } -+ if (!len) -+ { -+ grub_dprintf ("bootp", "DHCPv6: Options stopped at zero length option %u\n", code); -+ break; -+ } -+ else -+ { -+ if (hook) -+ hook (opt, hook_data); -+ size -= len; -+ opt = (const struct grub_net_dhcp6_option *)((grub_uint8_t *)opt + len + sizeof (*opt)); -+ } -+ } -+} -+ -+static grub_dhcp6_options_t -+grub_dhcp6_options_get (const struct grub_net_dhcp6_packet *v6h, -+ grub_size_t size) -+{ -+ grub_dhcp6_options_t options; -+ -+ if (size < sizeof (*v6h)) -+ { -+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("DHCPv6 packet size too small")); -+ return NULL; -+ } -+ -+ options = grub_zalloc (sizeof(*options)); -+ if (!options) - 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], -- 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) -+ foreach_dhcp6_option ((const struct grub_net_dhcp6_option *)v6h->dhcp_options, -+ size - sizeof (*v6h), parse_dhcp6_option, options); -+ -+ return options; -+} -+ -+static void -+grub_dhcp6_options_free (grub_dhcp6_options_t options) -+{ -+ if (options->client_duid) -+ grub_free (options->client_duid); -+ if (options->server_duid) -+ grub_free (options->server_duid); -+ if (options->ia_addr) -+ grub_free (options->ia_addr); -+ if (options->dns_server_addrs) -+ grub_free (options->dns_server_addrs); -+ if (options->boot_file_proto) -+ grub_free (options->boot_file_proto); -+ if (options->boot_file_server_ip) -+ grub_free (options->boot_file_server_ip); -+ if (options->boot_file_path) -+ grub_free (options->boot_file_path); -+ -+ grub_free (options); -+} -+ -+static grub_dhcp6_session_t grub_dhcp6_sessions; -+#define FOR_DHCP6_SESSIONS_SAFE(var, next) FOR_LIST_ELEMENTS_SAFE (var, next, grub_dhcp6_sessions) -+#define FOR_DHCP6_SESSIONS(var) FOR_LIST_ELEMENTS (var, grub_dhcp6_sessions) -+ -+static void -+grub_net_configure_by_dhcp6_info (const char *name, -+ struct grub_net_card *card, -+ grub_dhcp6_options_t dhcp6, -+ int is_def, -+ int flags, -+ struct grub_net_network_level_interface **ret_inf) -+{ -+ grub_net_network_level_netaddress_t netaddr; -+ struct grub_net_network_level_interface *inf; -+ -+ if (dhcp6->ia_addr) - { -- 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; -+ inf = grub_net_add_addr (name, card, dhcp6->ia_addr, &card->default_address, flags); - -- *device = grub_xasprintf ("%s,%s", scheme, tmp); -- grub_free (scheme); -- grub_free (host); -+ netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; -+ netaddr.ipv6.base[0] = dhcp6->ia_addr->ipv6[0]; -+ netaddr.ipv6.base[1] = 0; -+ netaddr.ipv6.masksize = 64; -+ grub_net_add_route (name, netaddr, inf); - -- 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; -- } -- } -+ if (ret_inf) -+ *ret_inf = inf; -+ } - -- i += len + 4; -- } -+ if (dhcp6->dns_server_addrs) -+ { -+ grub_uint16_t i; - -- grub_print_error (); -+ for (i = 0; i < dhcp6->num_dns_server; ++i) -+ grub_net_add_dns_server (dhcp6->dns_server_addrs + i); - } - -- if (is_def) -+ if (dhcp6->boot_file_path) -+ grub_env_set_net_property (name, "boot_file", dhcp6->boot_file_path, -+ grub_strlen (dhcp6->boot_file_path)); -+ -+ if (is_def && dhcp6->boot_file_server_ip) - { -+ grub_net_default_server = grub_strdup (dhcp6->boot_file_server_ip); - grub_env_set ("net_default_interface", name); - grub_env_export ("net_default_interface"); - } -+} -+ -+static void -+grub_dhcp6_session_add (struct grub_net_network_level_interface *iface, -+ grub_uint32_t iaid) -+{ -+ grub_dhcp6_session_t se; -+ struct grub_datetime date; -+ grub_err_t err; -+ grub_int32_t t = 0; -+ -+ se = grub_malloc (sizeof (*se)); -+ -+ err = grub_get_datetime (&date); -+ if (err || !grub_datetime2unixtime (&date, &t)) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ t = 0; -+ } -+ -+ se->iface = iface; -+ se->iaid = iaid; -+ se->transaction_id = t; -+ se->start_time = grub_get_time_ms (); -+ se->duid.type = grub_cpu_to_be16_compile_time (3) ; -+ se->duid.hw_type = grub_cpu_to_be16_compile_time (1); -+ grub_memcpy (&se->duid.hwaddr, &iface->hwaddress.mac, sizeof (se->duid.hwaddr)); -+ se->adv = NULL; -+ se->reply = NULL; -+ grub_list_push (GRUB_AS_LIST_P (&grub_dhcp6_sessions), GRUB_AS_LIST (se)); -+} -+ -+static void -+grub_dhcp6_session_remove (grub_dhcp6_session_t se) -+{ -+ grub_list_remove (GRUB_AS_LIST (se)); -+ if (se->adv) -+ grub_dhcp6_options_free (se->adv); -+ if (se->reply) -+ grub_dhcp6_options_free (se->reply); -+ grub_free (se); -+} -+ -+static void -+grub_dhcp6_session_remove_all (void) -+{ -+ grub_dhcp6_session_t se, next; -+ -+ FOR_DHCP6_SESSIONS_SAFE (se, next) -+ { -+ grub_dhcp6_session_remove (se); -+ } -+ grub_dhcp6_sessions = NULL; -+} -+ -+static grub_err_t -+grub_dhcp6_session_configure_network (grub_dhcp6_session_t se) -+{ -+ char *name; - -- if (inter) -- grub_net_add_ipv6_local (inter, mask); -- return inter; -+ name = grub_xasprintf ("%s:dhcp6", se->iface->card->name); -+ if (!name) -+ return grub_errno; -+ -+ grub_net_configure_by_dhcp6_info (name, se->iface->card, se->reply, 1, 0, 0); -+ grub_free (name); -+ -+ return GRUB_ERR_NONE; - } - -+static grub_err_t -+grub_dhcp6_session_send_request (grub_dhcp6_session_t se) -+{ -+ struct grub_net_buff *nb; -+ struct grub_net_dhcp6_option *opt; -+ struct grub_net_dhcp6_packet *v6h; -+ struct grub_net_dhcp6_option_iana *ia_na; -+ struct grub_net_dhcp6_option_iaaddr *iaaddr; -+ struct udphdr *udph; -+ grub_net_network_level_address_t multicast; -+ grub_net_link_level_address_t ll_multicast; -+ grub_uint64_t elapsed; -+ struct grub_net_network_level_interface *inf = se->iface; -+ grub_dhcp6_options_t dhcp6 = se->adv; -+ grub_err_t err = GRUB_ERR_NONE; -+ -+ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; -+ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); -+ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL); -+ -+ err = grub_net_link_layer_resolve (inf, &multicast, &ll_multicast); -+ if (err) -+ return err; -+ -+ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); -+ -+ if (!nb) -+ return grub_errno; -+ -+ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ err = grub_netbuff_push (nb, dhcp6->client_duid_len + sizeof (*opt)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID); -+ opt->len = grub_cpu_to_be16 (dhcp6->client_duid_len); -+ grub_memcpy (opt->data, dhcp6->client_duid , dhcp6->client_duid_len); -+ -+ err = grub_netbuff_push (nb, dhcp6->server_duid_len + sizeof (*opt)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_SERVERID); -+ opt->len = grub_cpu_to_be16 (dhcp6->server_duid_len); -+ grub_memcpy (opt->data, dhcp6->server_duid , dhcp6->server_duid_len); -+ -+ err = grub_netbuff_push (nb, sizeof (*ia_na) + sizeof (*opt)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ if (dhcp6->ia_addr) -+ { -+ err = grub_netbuff_push (nb, sizeof(*iaaddr) + sizeof (*opt)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ } -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); -+ opt->len = grub_cpu_to_be16 (sizeof (*ia_na)); -+ if (dhcp6->ia_addr) -+ opt->len += grub_cpu_to_be16 (sizeof(*iaaddr) + sizeof (*opt)); -+ -+ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data; -+ ia_na->iaid = grub_cpu_to_be32 (dhcp6->iaid); -+ -+ ia_na->t1 = grub_cpu_to_be32 (dhcp6->t1); -+ ia_na->t2 = grub_cpu_to_be32 (dhcp6->t2); -+ -+ if (dhcp6->ia_addr) -+ { -+ opt = (struct grub_net_dhcp6_option *)ia_na->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR); -+ opt->len = grub_cpu_to_be16 (sizeof (*iaaddr)); -+ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)opt->data; -+ grub_set_unaligned64 (iaaddr->addr, dhcp6->ia_addr->ipv6[0]); -+ grub_set_unaligned64 (iaaddr->addr + 8, dhcp6->ia_addr->ipv6[1]); -+ -+ iaaddr->preferred_lifetime = grub_cpu_to_be32 (dhcp6->preferred_lifetime); -+ iaaddr->valid_lifetime = grub_cpu_to_be32 (dhcp6->valid_lifetime); -+ } -+ -+ err = grub_netbuff_push (nb, sizeof (*opt) + 2 * sizeof (grub_uint16_t)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ opt = (struct grub_net_dhcp6_option*) nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ORO); -+ opt->len = grub_cpu_to_be16_compile_time (2 * sizeof (grub_uint16_t)); -+ grub_set_unaligned16 (opt->data, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL)); -+ grub_set_unaligned16 (opt->data + 2, grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS)); -+ -+ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ opt = (struct grub_net_dhcp6_option*) nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME); -+ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t)); -+ -+ /* the time is expressed in hundredths of a second */ -+ elapsed = grub_divmod64 (grub_get_time_ms () - se->start_time, 10, 0); -+ -+ if (elapsed > 0xffff) -+ elapsed = 0xffff; -+ -+ grub_set_unaligned16 (opt->data, grub_cpu_to_be16 ((grub_uint16_t)elapsed)); -+ -+ err = grub_netbuff_push (nb, sizeof (*v6h)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ v6h = (struct grub_net_dhcp6_packet *) nb->data; -+ v6h->message_type = GRUB_NET_DHCP6_REQUEST; -+ v6h->transaction_id = se->transaction_id; -+ -+ err = grub_netbuff_push (nb, sizeof (*udph)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ udph = (struct udphdr *) nb->data; -+ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT); -+ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT); -+ udph->chksum = 0; -+ udph->len = grub_cpu_to_be16 (nb->tail - nb->data); -+ -+ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, -+ &inf->address, -+ &multicast); -+ err = grub_net_send_ip_packet (inf, &multicast, &ll_multicast, nb, -+ GRUB_NET_IP_UDP); -+ -+ grub_netbuff_free (nb); -+ -+ return err; -+} -+ -+struct grub_net_network_level_interface * -+grub_net_configure_by_dhcpv6_reply (const char *name, -+ struct grub_net_card *card, -+ grub_net_interface_flags_t flags, -+ const struct grub_net_dhcp6_packet *v6h, -+ grub_size_t size, -+ int is_def, -+ char **device, char **path) -+{ -+ struct grub_net_network_level_interface *inf; -+ grub_dhcp6_options_t dhcp6; -+ -+ dhcp6 = grub_dhcp6_options_get (v6h, size); -+ if (!dhcp6) -+ { -+ grub_print_error (); -+ return NULL; -+ } -+ -+ grub_net_configure_by_dhcp6_info (name, card, dhcp6, is_def, flags, &inf); -+ -+ if (device && dhcp6->boot_file_proto && dhcp6->boot_file_server_ip) -+ { -+ *device = grub_xasprintf ("%s,%s", dhcp6->boot_file_proto, dhcp6->boot_file_server_ip); -+ grub_print_error (); -+ } -+ if (path && dhcp6->boot_file_path) -+ { -+ *path = grub_strdup (dhcp6->boot_file_path); -+ grub_print_error (); -+ if (*path) -+ { -+ char *slash; -+ slash = grub_strrchr (*path, '/'); -+ if (slash) -+ *slash = 0; -+ else -+ **path = 0; -+ } -+ } -+ -+ grub_dhcp6_options_free (dhcp6); -+ return inf; -+} - - void - grub_net_process_dhcp (struct grub_net_buff *nb, -@@ -546,6 +1038,77 @@ grub_net_process_dhcp (struct grub_net_buff *nb, - } - } - -+grub_err_t -+grub_net_process_dhcp6 (struct grub_net_buff *nb, -+ struct grub_net_card *card __attribute__ ((unused))) -+{ -+ const struct grub_net_dhcp6_packet *v6h; -+ grub_dhcp6_session_t se; -+ grub_size_t size; -+ grub_dhcp6_options_t options; -+ -+ v6h = (const struct grub_net_dhcp6_packet *) nb->data; -+ size = nb->tail - nb->data; -+ -+ options = grub_dhcp6_options_get (v6h, size); -+ if (!options) -+ return grub_errno; -+ -+ if (!options->client_duid || !options->server_duid || !options->ia_addr) -+ { -+ grub_dhcp6_options_free (options); -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Bad DHCPv6 Packet"); -+ } -+ -+ FOR_DHCP6_SESSIONS (se) -+ { -+ if (se->transaction_id == v6h->transaction_id && -+ grub_memcmp (options->client_duid, &se->duid, sizeof (se->duid)) == 0 && -+ se->iaid == options->iaid) -+ break; -+ } -+ -+ if (!se) -+ { -+ grub_dprintf ("bootp", "DHCPv6 session not found\n"); -+ grub_dhcp6_options_free (options); -+ return GRUB_ERR_NONE; -+ } -+ -+ if (v6h->message_type == GRUB_NET_DHCP6_ADVERTISE) -+ { -+ if (se->adv) -+ { -+ grub_dprintf ("bootp", "Skipped DHCPv6 Advertised .. \n"); -+ grub_dhcp6_options_free (options); -+ return GRUB_ERR_NONE; -+ } -+ -+ se->adv = options; -+ return grub_dhcp6_session_send_request (se); -+ } -+ else if (v6h->message_type == GRUB_NET_DHCP6_REPLY) -+ { -+ if (!se->adv) -+ { -+ grub_dprintf ("bootp", "Skipped DHCPv6 Reply .. \n"); -+ grub_dhcp6_options_free (options); -+ return GRUB_ERR_NONE; -+ } -+ -+ se->reply = options; -+ grub_dhcp6_session_configure_network (se); -+ grub_dhcp6_session_remove (se); -+ return GRUB_ERR_NONE; -+ } -+ else -+ { -+ grub_dhcp6_options_free (options); -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ - static grub_err_t - grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), - int argc, char **args) -@@ -816,7 +1379,174 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)), - return err; - } - --static grub_command_t cmd_getdhcp, cmd_bootp; -+static grub_err_t -+grub_cmd_bootp6 (struct grub_command *cmd __attribute__ ((unused)), -+ int argc, char **args) -+{ -+ struct grub_net_card *card; -+ grub_uint32_t iaid = 0; -+ int interval; -+ grub_err_t err; -+ grub_dhcp6_session_t se; -+ -+ err = GRUB_ERR_NONE; -+ -+ FOR_NET_CARDS (card) -+ { -+ struct grub_net_network_level_interface *iface; -+ -+ if (argc > 0 && grub_strcmp (card->name, args[0]) != 0) -+ continue; -+ -+ iface = grub_net_ipv6_get_link_local (card, &card->default_address); -+ if (!iface) -+ { -+ grub_dhcp6_session_remove_all (); -+ return grub_errno; -+ } -+ -+ grub_dhcp6_session_add (iface, iaid++); -+ } -+ -+ for (interval = 200; interval < 10000; interval *= 2) -+ { -+ int done = 1; -+ -+ FOR_DHCP6_SESSIONS (se) -+ { -+ struct grub_net_buff *nb; -+ struct grub_net_dhcp6_option *opt; -+ struct grub_net_dhcp6_packet *v6h; -+ struct grub_net_dhcp6_option_duid_ll *duid; -+ struct grub_net_dhcp6_option_iana *ia_na; -+ grub_net_network_level_address_t multicast; -+ grub_net_link_level_address_t ll_multicast; -+ struct udphdr *udph; -+ -+ multicast.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; -+ multicast.ipv6[0] = grub_cpu_to_be64_compile_time (0xff02ULL << 48); -+ multicast.ipv6[1] = grub_cpu_to_be64_compile_time (0x10002ULL); -+ -+ err = grub_net_link_layer_resolve (se->iface, -+ &multicast, &ll_multicast); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ return err; -+ } -+ -+ nb = grub_netbuff_alloc (GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); -+ -+ if (!nb) -+ { -+ grub_dhcp6_session_remove_all (); -+ return grub_errno; -+ } -+ -+ err = grub_netbuff_reserve (nb, GRUB_DHCP6_DEFAULT_NETBUFF_ALLOC_SIZE); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (grub_uint16_t)); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_ELAPSED_TIME); -+ opt->len = grub_cpu_to_be16_compile_time (sizeof (grub_uint16_t)); -+ grub_set_unaligned16 (opt->data, 0); -+ -+ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*duid)); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_CLIENTID); -+ opt->len = grub_cpu_to_be16 (sizeof (*duid)); -+ -+ duid = (struct grub_net_dhcp6_option_duid_ll *) opt->data; -+ grub_memcpy (duid, &se->duid, sizeof (*duid)); -+ -+ err = grub_netbuff_push (nb, sizeof (*opt) + sizeof (*ia_na)); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ opt = (struct grub_net_dhcp6_option *)nb->data; -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); -+ opt->len = grub_cpu_to_be16 (sizeof (*ia_na)); -+ ia_na = (struct grub_net_dhcp6_option_iana *)opt->data; -+ ia_na->iaid = grub_cpu_to_be32 (se->iaid); -+ ia_na->t1 = 0; -+ ia_na->t2 = 0; -+ -+ err = grub_netbuff_push (nb, sizeof (*v6h)); -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ v6h = (struct grub_net_dhcp6_packet *)nb->data; -+ v6h->message_type = GRUB_NET_DHCP6_SOLICIT; -+ v6h->transaction_id = se->transaction_id; -+ -+ grub_netbuff_push (nb, sizeof (*udph)); -+ -+ udph = (struct udphdr *) nb->data; -+ udph->src = grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT); -+ udph->dst = grub_cpu_to_be16_compile_time (DHCP6_SERVER_PORT); -+ udph->chksum = 0; -+ udph->len = grub_cpu_to_be16 (nb->tail - nb->data); -+ -+ udph->chksum = grub_net_ip_transport_checksum (nb, GRUB_NET_IP_UDP, -+ &se->iface->address, &multicast); -+ -+ err = grub_net_send_ip_packet (se->iface, &multicast, -+ &ll_multicast, nb, GRUB_NET_IP_UDP); -+ done = 0; -+ grub_netbuff_free (nb); -+ -+ if (err) -+ { -+ grub_dhcp6_session_remove_all (); -+ return err; -+ } -+ } -+ if (!done) -+ grub_net_poll_cards (interval, 0); -+ } -+ -+ FOR_DHCP6_SESSIONS (se) -+ { -+ grub_error_push (); -+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, -+ N_("couldn't autoconfigure %s"), -+ se->iface->card->name); -+ } -+ -+ grub_dhcp6_session_remove_all (); -+ -+ return err; -+} -+ -+static grub_command_t cmd_getdhcp, cmd_bootp, cmd_bootp6; - - void - grub_bootp_init (void) -@@ -827,6 +1557,9 @@ grub_bootp_init (void) - cmd_getdhcp = grub_register_command ("net_get_dhcp_option", grub_cmd_dhcpopt, - N_("VAR INTERFACE NUMBER DESCRIPTION"), - N_("retrieve DHCP option and save it into VAR. If VAR is - then print the value.")); -+ cmd_bootp6 = grub_register_command ("net_bootp6", grub_cmd_bootp6, -+ N_("[CARD]"), -+ N_("perform a DHCPv6 autoconfiguration")); - } - - void -@@ -834,4 +1567,5 @@ grub_bootp_fini (void) - { - grub_unregister_command (cmd_getdhcp); - grub_unregister_command (cmd_bootp); -+ grub_unregister_command (cmd_bootp6); - } -diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c -index 311213feec1..daa5b03516b 100644 ---- a/grub-core/net/ip.c -+++ b/grub-core/net/ip.c -@@ -235,6 +235,45 @@ handle_dgram (struct grub_net_buff *nb, - { - struct udphdr *udph; - udph = (struct udphdr *) nb->data; -+ -+ if (proto == GRUB_NET_IP_UDP && udph->dst == grub_cpu_to_be16_compile_time (DHCP6_CLIENT_PORT)) -+ { -+ if (udph->chksum) -+ { -+ grub_uint16_t chk, expected; -+ chk = udph->chksum; -+ udph->chksum = 0; -+ expected = grub_net_ip_transport_checksum (nb, -+ GRUB_NET_IP_UDP, -+ source, -+ dest); -+ if (expected != chk) -+ { -+ grub_dprintf ("net", "Invalid UDP checksum. " -+ "Expected %x, got %x\n", -+ grub_be_to_cpu16 (expected), -+ grub_be_to_cpu16 (chk)); -+ grub_netbuff_free (nb); -+ return GRUB_ERR_NONE; -+ } -+ udph->chksum = chk; -+ } -+ -+ err = grub_netbuff_pull (nb, sizeof (*udph)); -+ if (err) -+ { -+ grub_netbuff_free (nb); -+ return err; -+ } -+ -+ err = grub_net_process_dhcp6 (nb, card); -+ if (err) -+ grub_print_error (); -+ -+ grub_netbuff_free (nb); -+ return GRUB_ERR_NONE; -+ } -+ - if (proto == GRUB_NET_IP_UDP && grub_be_to_cpu16 (udph->dst) == 68) - { - const struct grub_net_bootp_packet *bootp; -diff --git a/include/grub/net.h b/include/grub/net.h -index 20e699bb025..8ecfbb49221 100644 ---- a/include/grub/net.h -+++ b/include/grub/net.h -@@ -423,50 +423,65 @@ struct grub_net_bootp_packet - 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 -+struct grub_net_dhcp6_packet - { -- grub_uint16_t option_num; -- grub_uint16_t option_len; -- grub_uint8_t option_data[]; -+ grub_uint32_t message_type:8; -+ grub_uint32_t transaction_id:24; -+ grub_uint8_t dhcp_options[0]; - } 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; -+struct grub_net_dhcp6_option { -+ grub_uint16_t code; -+ grub_uint16_t len; -+ grub_uint8_t data[0]; -+} GRUB_PACKED; -+ -+struct grub_net_dhcp6_option_iana { - grub_uint32_t iaid; - grub_uint32_t t1; - grub_uint32_t t2; -- grub_uint8_t options[]; -+ grub_uint8_t data[0]; - } 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]; -+struct grub_net_dhcp6_option_iaaddr { -+ grub_uint8_t addr[16]; - grub_uint32_t preferred_lifetime; - grub_uint32_t valid_lifetime; -- grub_uint8_t options[]; -+ grub_uint8_t data[0]; - } GRUB_PACKED; --typedef struct grub_net_dhcpv6_opt_ia_address grub_net_dhcpv6_opt_ia_address_t; - --struct grub_net_dhcpv6_packet -+struct grub_net_dhcp6_option_duid_ll - { -- grub_uint32_t message_type:8; -- grub_uint32_t transaction_id:24; -- grub_uint8_t dhcp_options[1024]; -+ grub_uint16_t type; -+ grub_uint16_t hw_type; -+ grub_uint8_t hwaddr[6]; - } GRUB_PACKED; --typedef struct grub_net_dhcpv6_packet grub_net_dhcpv6_packet_t; -+ -+enum -+ { -+ GRUB_NET_DHCP6_SOLICIT = 1, -+ GRUB_NET_DHCP6_ADVERTISE = 2, -+ GRUB_NET_DHCP6_REQUEST = 3, -+ GRUB_NET_DHCP6_REPLY = 7 -+ }; -+ -+enum -+ { -+ DHCP6_CLIENT_PORT = 546, -+ DHCP6_SERVER_PORT = 547 -+ }; -+ -+enum -+ { -+ GRUB_NET_DHCP6_OPTION_CLIENTID = 1, -+ GRUB_NET_DHCP6_OPTION_SERVERID = 2, -+ GRUB_NET_DHCP6_OPTION_IA_NA = 3, -+ GRUB_NET_DHCP6_OPTION_IAADDR = 5, -+ GRUB_NET_DHCP6_OPTION_ORO = 6, -+ GRUB_NET_DHCP6_OPTION_ELAPSED_TIME = 8, -+ GRUB_NET_DHCP6_OPTION_DNS_SERVERS = 23, -+ GRUB_NET_DHCP6_OPTION_BOOTFILE_URL = 59 -+ }; - - #define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63 - #define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82 -@@ -497,12 +512,12 @@ grub_net_configure_by_dhcp_ack (const char *name, - 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); -+grub_net_configure_by_dhcpv6_reply (const char *name, -+ struct grub_net_card *card, -+ grub_net_interface_flags_t flags, -+ const struct grub_net_dhcp6_packet *v6, -+ grub_size_t size, -+ int is_def, char **device, char **path); - - int - grub_ipv6_get_masksize(grub_uint16_t *mask); -@@ -519,6 +534,10 @@ void - grub_net_process_dhcp (struct grub_net_buff *nb, - struct grub_net_card *card); - -+grub_err_t -+grub_net_process_dhcp6 (struct grub_net_buff *nb, -+ struct grub_net_card *card); -+ - int - grub_net_hwaddr_cmp (const grub_net_link_level_address_t *a, - const grub_net_link_level_address_t *b); diff --git a/SOURCES/0253-grub.texi-Add-net_bootp6-doument.patch b/SOURCES/0253-grub.texi-Add-net_bootp6-doument.patch new file mode 100644 index 0000000..632c2bc --- /dev/null +++ b/SOURCES/0253-grub.texi-Add-net_bootp6-doument.patch @@ -0,0 +1,51 @@ +From bf9c2c12aebec23c3e65fdba63aad67712df5f41 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 5 May 2015 14:19:24 +0800 +Subject: [PATCH 253/261] grub.texi: Add net_bootp6 doument + +Update grub documentation for net_bootp6 command. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + docs/grub.texi | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/docs/grub.texi b/docs/grub.texi +index 98138e04d..bd3457af9 100644 +--- a/docs/grub.texi ++++ b/docs/grub.texi +@@ -5159,6 +5159,7 @@ List available video modes. If resolution is given, show only matching modes. + * net_add_dns:: Add a DNS server + * net_add_route:: Add routing entry + * net_bootp:: Perform a bootp autoconfiguration ++* net_bootp6:: Perform a DHCPv6 autoconfiguration + * net_del_addr:: Remove IP address from interface + * net_del_dns:: Remove a DNS server + * net_del_route:: Remove a route entry +@@ -5240,6 +5241,22 @@ Sets environment variable @samp{net_}@var{}@samp{_dhcp_extensionspath} + + @end deffn + ++@node net_bootp6 ++@subsection net_bootp6 ++ ++@deffn Command net_bootp6 [@var{card}] ++Perform configuration of @var{card} using DHCPv6 protocol. If no card name is ++specified, try to configure all existing cards. If configuration was ++successful, interface with name @var{card}@samp{:dhcp6} and configured address ++is added to @var{card}. ++ ++@table @samp ++@item 1 (Domain Name Server) ++Adds all servers from option value to the list of servers used during name ++resolution. ++@end table ++ ++@end deffn + + @node net_del_addr + @subsection net_del_addr +-- +2.13.5 + diff --git a/SOURCES/0254-Put-back-our-code-to-add-a-local-route.patch b/SOURCES/0254-Put-back-our-code-to-add-a-local-route.patch deleted file mode 100644 index 3c638ba..0000000 --- a/SOURCES/0254-Put-back-our-code-to-add-a-local-route.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 21 Jun 2018 18:32:26 -0400 -Subject: [PATCH] Put back our code to add a local route. - -This was removed by the previous patch. - -Signed-off-by: Peter Jones ---- - grub-core/net/bootp.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index 26b3d83d0bc..dd4660601e2 100644 ---- a/grub-core/net/bootp.c -+++ b/grub-core/net/bootp.c -@@ -972,6 +972,7 @@ grub_net_configure_by_dhcpv6_reply (const char *name, - { - struct grub_net_network_level_interface *inf; - grub_dhcp6_options_t dhcp6; -+ int mask = -1; - - dhcp6 = grub_dhcp6_options_get (v6h, size); - if (!dhcp6) -@@ -1003,6 +1004,10 @@ grub_net_configure_by_dhcpv6_reply (const char *name, - } - - grub_dhcp6_options_free (dhcp6); -+ -+ if (inf) -+ grub_net_add_ipv6_local (inf, mask); -+ - return inf; - } - diff --git a/SOURCES/0254-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch b/SOURCES/0254-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch new file mode 100644 index 0000000..38e87ae --- /dev/null +++ b/SOURCES/0254-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch @@ -0,0 +1,138 @@ +From f7fe0f689b527ee9d44a00d81eaa941cbf9fab86 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Thu, 14 Jul 2016 18:45:14 +0800 +Subject: [PATCH 254/261] bootp: Add processing DHCPACK packet from HTTP Boot + +The vendor class identifier with the string "HTTPClient" is used to denote the +packet as responding to HTTP boot request. In DHCP4 config, the filename for +HTTP boot is the URL of the boot file while for PXE boot it is the path to the +boot file. As a consequence, the next-server becomes obseleted because the HTTP +URL already contains the server address for the boot file. For DHCP6 config, +there's no difference definition in existing config as dhcp6.bootfile-url can +be used to specify URL for both HTTP and PXE boot file. + +This patch adds processing for "HTTPClient" vendor class identifier in DHCPACK +packet by treating it as HTTP format, not as the PXE format. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/bootp.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-- + include/grub/net.h | 1 + + 2 files changed, 67 insertions(+), 2 deletions(-) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index 26b3d83d0..fa7eefe51 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -254,6 +255,11 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) + taglength); + break; + ++ case GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER: ++ grub_env_set_net_property (name, "vendor_class_identifier", (const char *) ptr, ++ taglength); ++ break; ++ + case GRUB_NET_BOOTP_EXTENSIONS_PATH: + grub_env_set_net_property (name, "extensionspath", (const char *) ptr, + taglength); +@@ -356,6 +362,66 @@ grub_net_configure_by_dhcp_ack (const char *name, + } + #endif + ++ if (size > OFFSET_OF (vendor, bp)) ++ { ++ char *cidvar; ++ const char *cid; ++ ++ parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); ++ cidvar = grub_xasprintf ("net_%s_%s", name, "vendor_class_identifier"); ++ cid = grub_env_get (cidvar); ++ grub_free (cidvar); ++ ++ if (cid && grub_strcmp (cid, "HTTPClient") == 0) ++ { ++ char *proto, *ip, *pa; ++ ++ if (!dissect_url (bp->boot_file, &proto, &ip, &pa)) ++ return inter; ++ ++ grub_env_set_net_property (name, "boot_file", pa, grub_strlen (pa)); ++ if (is_def) ++ { ++ grub_net_default_server = grub_strdup (ip); ++ grub_env_set ("net_default_interface", name); ++ grub_env_export ("net_default_interface"); ++ } ++ if (device && !*device) ++ { ++ *device = grub_xasprintf ("%s,%s", proto, ip); ++ grub_print_error (); ++ } ++ if (path) ++ { ++ *path = grub_strdup (pa); ++ grub_print_error (); ++ if (*path) ++ { ++ char *slash; ++ slash = grub_strrchr (*path, '/'); ++ if (slash) ++ *slash = 0; ++ else ++ **path = 0; ++ } ++ } ++ grub_net_add_ipv4_local (inter, mask); ++ inter->dhcp_ack = grub_malloc (size); ++ if (inter->dhcp_ack) ++ { ++ grub_memcpy (inter->dhcp_ack, bp, size); ++ inter->dhcp_acklen = size; ++ } ++ else ++ grub_errno = GRUB_ERR_NONE; ++ ++ grub_free (proto); ++ grub_free (ip); ++ grub_free (pa); ++ return inter; ++ } ++ } ++ + if (size > OFFSET_OF (boot_file, bp)) + grub_env_set_net_property (name, "boot_file", bp->boot_file, + sizeof (bp->boot_file)); +@@ -417,8 +483,6 @@ grub_net_configure_by_dhcp_ack (const char *name, + **path = 0; + } + } +- if (size > OFFSET_OF (vendor, bp)) +- parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); + grub_net_add_ipv4_local (inter, mask); + + inter->dhcp_ack = grub_malloc (size); +diff --git a/include/grub/net.h b/include/grub/net.h +index 8ecfbb492..1ec827b9b 100644 +--- a/include/grub/net.h ++++ b/include/grub/net.h +@@ -498,6 +498,7 @@ enum + GRUB_NET_BOOTP_DOMAIN = 0x0f, + GRUB_NET_BOOTP_ROOT_PATH = 0x11, + GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12, ++ GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER = 0x3c, + GRUB_NET_BOOTP_CLIENT_ID = 0x3d, + GRUB_NET_BOOTP_CLIENT_UUID = 0x61, + GRUB_NET_BOOTP_END = 0xff +-- +2.13.5 + diff --git a/SOURCES/0255-efinet-Setting-network-from-UEFI-device-path.patch b/SOURCES/0255-efinet-Setting-network-from-UEFI-device-path.patch new file mode 100644 index 0000000..4c01457 --- /dev/null +++ b/SOURCES/0255-efinet-Setting-network-from-UEFI-device-path.patch @@ -0,0 +1,416 @@ +From 083e05daa723dcb8ddca934341d523e80c63aba4 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Sun, 10 Jul 2016 23:46:31 +0800 +Subject: [PATCH 255/261] efinet: Setting network from UEFI device path + +The PXE Base Code protocol used to obtain cached PXE DHCPACK packet is no +longer provided for HTTP Boot. Instead, we have to get the HTTP boot +information from the device path nodes defined in following UEFI Specification +sections. + + 9.3.5.12 IPv4 Device Path + 9.3.5.13 IPv6 Device Path + 9.3.5.23 Uniform Resource Identifiers (URI) Device Path + +This patch basically does: + +include/grub/efi/api.h: +Add new structure of Uniform Resource Identifiers (URI) Device Path + +grub-core/net/drivers/efi/efinet.c: +Check if PXE Base Code is available, if not it will try to obtain the netboot +information from the device path where the image booted from. The DHCPACK +packet is recoverd from the information in device patch and feed into the same +DHCP packet processing functions to ensure the network interface is setting up +the same way it used to be. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 293 +++++++++++++++++++++++++++++++++++-- + include/grub/efi/api.h | 11 ++ + 2 files changed, 292 insertions(+), 12 deletions(-) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index c00ac2e64..08e9d7aa3 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + GRUB_MOD_LICENSE ("GPLv3+"); + +@@ -342,6 +343,244 @@ grub_efinet_findcards (void) + grub_free (handles); + } + ++static struct grub_net_buff * ++grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6) ++{ ++ grub_efi_uint16_t uri_len; ++ grub_efi_device_path_t *ldp, *ddp; ++ grub_efi_uri_device_path_t *uri_dp; ++ struct grub_net_buff *nb; ++ grub_err_t err; ++ ++ ddp = grub_efi_duplicate_device_path (dp); ++ if (!ddp) ++ return NULL; ++ ++ ldp = grub_efi_find_last_device_path (ddp); ++ ++ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE ++ || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ return NULL; ++ } ++ ++ uri_len = GRUB_EFI_DEVICE_PATH_LENGTH (ldp) > 4 ? GRUB_EFI_DEVICE_PATH_LENGTH (ldp) - 4 : 0; ++ ++ if (!uri_len) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ return NULL; ++ } ++ ++ uri_dp = (grub_efi_uri_device_path_t *) ldp; ++ ++ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; ++ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ++ ldp->length = sizeof (*ldp); ++ ++ ldp = grub_efi_find_last_device_path (ddp); ++ ++ 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)) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ return NULL; ++ } ++ ++ nb = grub_netbuff_alloc (512); ++ if (!nb) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ return NULL; ++ } ++ ++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE) ++ { ++ grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp; ++ struct grub_net_bootp_packet *bp; ++ grub_uint8_t *ptr; ++ ++ bp = (struct grub_net_bootp_packet *) nb->tail; ++ err = grub_netbuff_put (nb, sizeof (*bp) + 4); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ ++ if (sizeof(bp->boot_file) < uri_len) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ grub_memcpy (bp->boot_file, uri_dp->uri, uri_len); ++ grub_memcpy (&bp->your_ip, ipv4->local_ip_address, sizeof (bp->your_ip)); ++ grub_memcpy (&bp->server_ip, ipv4->remote_ip_address, sizeof (bp->server_ip)); ++ ++ bp->vendor[0] = GRUB_NET_BOOTP_RFC1048_MAGIC_0; ++ bp->vendor[1] = GRUB_NET_BOOTP_RFC1048_MAGIC_1; ++ bp->vendor[2] = GRUB_NET_BOOTP_RFC1048_MAGIC_2; ++ bp->vendor[3] = GRUB_NET_BOOTP_RFC1048_MAGIC_3; ++ ++ ptr = nb->tail; ++ err = grub_netbuff_put (nb, sizeof (ipv4->subnet_mask) + 2); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ *ptr++ = GRUB_NET_BOOTP_NETMASK; ++ *ptr++ = sizeof (ipv4->subnet_mask); ++ grub_memcpy (ptr, ipv4->subnet_mask, sizeof (ipv4->subnet_mask)); ++ ++ ptr = nb->tail; ++ err = grub_netbuff_put (nb, sizeof (ipv4->gateway_ip_address) + 2); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ *ptr++ = GRUB_NET_BOOTP_ROUTER; ++ *ptr++ = sizeof (ipv4->gateway_ip_address); ++ grub_memcpy (ptr, ipv4->gateway_ip_address, sizeof (ipv4->gateway_ip_address)); ++ ++ ptr = nb->tail; ++ err = grub_netbuff_put (nb, sizeof ("HTTPClient") + 1); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ *ptr++ = GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER; ++ *ptr++ = sizeof ("HTTPClient") - 1; ++ grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1); ++ ++ ptr = nb->tail; ++ err = grub_netbuff_put (nb, 1); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ *ptr = GRUB_NET_BOOTP_END; ++ *use_ipv6 = 0; ++ ++ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; ++ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ++ ldp->length = sizeof (*ldp); ++ ldp = grub_efi_find_last_device_path (ddp); ++ ++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) ++ { ++ grub_efi_mac_address_device_path_t *mac = (grub_efi_mac_address_device_path_t *) ldp; ++ bp->hw_type = mac->if_type; ++ bp->hw_len = sizeof (bp->mac_addr); ++ grub_memcpy (bp->mac_addr, mac->mac_address, bp->hw_len); ++ } ++ } ++ else ++ { ++ grub_efi_ipv6_device_path_t *ipv6 = (grub_efi_ipv6_device_path_t *) ldp; ++ ++ struct grub_net_dhcp6_packet *d6p; ++ struct grub_net_dhcp6_option *opt; ++ struct grub_net_dhcp6_option_iana *iana; ++ struct grub_net_dhcp6_option_iaaddr *iaaddr; ++ ++ d6p = (struct grub_net_dhcp6_packet *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*d6p)); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ d6p->message_type = GRUB_NET_DHCP6_REPLY; ++ ++ opt = (struct grub_net_dhcp6_option *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*opt)); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); ++ opt->len = grub_cpu_to_be16_compile_time (sizeof(*iana) + sizeof(*opt) + sizeof(*iaaddr)); ++ ++ err = grub_netbuff_put (nb, sizeof(*iana)); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ ++ opt = (struct grub_net_dhcp6_option *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*opt)); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR); ++ opt->len = grub_cpu_to_be16_compile_time (sizeof (*iaaddr)); ++ ++ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*iaaddr)); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ grub_memcpy (iaaddr->addr, ipv6->local_ip_address, sizeof(ipv6->local_ip_address)); ++ ++ opt = (struct grub_net_dhcp6_option *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*opt) + uri_len); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL); ++ opt->len = grub_cpu_to_be16 (uri_len); ++ grub_memcpy (opt->data, uri_dp->uri, uri_len); ++ ++ *use_ipv6 = 1; ++ } ++ ++ grub_free (ldp); ++ grub_free (ddp); ++ return nb; ++} ++ + static void + grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + char **path) +@@ -358,6 +597,10 @@ 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; ++ grub_uint8_t *packet_buf; ++ grub_size_t packet_bufsz ; ++ int ipv6; ++ struct grub_net_buff *nb = NULL; + + if (card->driver != &efidriver) + continue; +@@ -381,11 +624,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + */ + 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)) ++ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE ++ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) + continue; + dup_dp = grub_efi_duplicate_device_path (dp); + if (!dup_dp) + continue; ++ ++ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE) ++ { ++ dup_ldp = grub_efi_find_last_device_path (dup_dp); ++ dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; ++ dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ++ dup_ldp->length = sizeof (*dup_ldp); ++ } ++ + dup_ldp = grub_efi_find_last_device_path (dup_dp); + dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; + dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; +@@ -398,20 +651,32 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + + pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, + GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); +- if (! pxe) +- continue; ++ if (!pxe) ++ { ++ nb = grub_efinet_create_dhcp_ack_from_device_path (dp, &ipv6); ++ if (!nb) ++ { ++ grub_print_error (); ++ continue; ++ } ++ packet_buf = nb->head; ++ packet_bufsz = nb->tail - nb->head; ++ } ++ else ++ { ++ pxe_mode = pxe->mode; ++ packet_buf = (grub_uint8_t *) &pxe_mode->dhcp_ack; ++ packet_bufsz = sizeof (pxe_mode->dhcp_ack); ++ ipv6 = pxe_mode->using_ipv6; ++ } + +- pxe_mode = pxe->mode; +- if (pxe_mode->using_ipv6) ++ if (ipv6) + { + 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"); + grub_net_configure_by_dhcpv6_reply (card->name, card, 0, + (struct grub_net_dhcp6_packet *) +- &pxe_mode->dhcp_ack, +- sizeof (pxe_mode->dhcp_ack), ++ packet_buf, ++ packet_bufsz, + 1, device, path); + if (device && path) + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); +@@ -423,11 +688,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, + 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), ++ packet_buf, ++ packet_bufsz, + 1, device, path); + grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); + } ++ ++ if (nb) ++ grub_netbuff_free (nb); ++ + return; + } + } +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index 0821e3364..a37fb50de 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -786,6 +786,8 @@ struct grub_efi_ipv4_device_path + grub_efi_uint16_t remote_port; + grub_efi_uint16_t protocol; + grub_efi_uint8_t static_ip_address; ++ grub_efi_ipv4_address_t gateway_ip_address; ++ grub_efi_ipv4_address_t subnet_mask; + } GRUB_PACKED; + typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t; + +@@ -840,6 +842,15 @@ struct grub_efi_sata_device_path + } GRUB_PACKED; + typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t; + ++#define GRUB_EFI_URI_DEVICE_PATH_SUBTYPE 24 ++ ++struct grub_efi_uri_device_path ++{ ++ grub_efi_device_path_t header; ++ grub_efi_uint8_t uri[0]; ++} GRUB_PACKED; ++typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t; ++ + #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 + + /* Media Device Path. */ +-- +2.13.5 + diff --git a/SOURCES/0255-efinet-UEFI-IPv6-PXE-support.patch b/SOURCES/0255-efinet-UEFI-IPv6-PXE-support.patch deleted file mode 100644 index 6f0c915..0000000 --- a/SOURCES/0255-efinet-UEFI-IPv6-PXE-support.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Wed, 15 Apr 2015 14:48:30 +0800 -Subject: [PATCH] efinet: UEFI IPv6 PXE support - -When grub2 image is booted from UEFI IPv6 PXE, the DHCPv6 Reply packet is -cached in firmware buffer which can be obtained by PXE Base Code protocol. The -network interface can be setup through the parameters in that obtained packet. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/drivers/efi/efinet.c | 22 ++++++------ - include/grub/efi/api.h | 71 +++++++++++++++++++++++--------------- - 2 files changed, 54 insertions(+), 39 deletions(-) - -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index b9ed13fcad1..8bb0db014ac 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -404,9 +404,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - pxe_mode = pxe->mode; - 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", - pxe_mode->dhcp_ack_received ? "yes" : "no", -@@ -414,16 +411,17 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - 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)); -- -- 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_net_configure_by_dhcpv6_reply (card->name, card, 0, -+ (struct grub_net_dhcp6_packet *) -+ &pxe_mode->dhcp_ack, -+ sizeof (pxe_mode->dhcp_ack), -+ 1, device, path); -+ if (grub_errno) -+ grub_print_error (); -+ if (device && path) - grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); -+ if (grub_errno) -+ grub_print_error (); - } - else - { -diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 9422ba9a9db..2d0f37a8164 100644 ---- a/include/grub/efi/api.h -+++ b/include/grub/efi/api.h -@@ -1446,31 +1446,6 @@ typedef union - 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; -@@ -1496,6 +1471,48 @@ typedef struct grub_efi_pxe_tftp_error - grub_efi_char8_t error_string[127]; - } grub_efi_pxe_tftp_error_t; - -+typedef struct { -+ grub_uint8_t addr[4]; -+} grub_efi_pxe_ipv4_address_t; -+ -+typedef struct { -+ grub_uint8_t addr[16]; -+} grub_efi_pxe_ipv6_address_t; -+ -+typedef struct { -+ grub_uint8_t addr[32]; -+} grub_efi_pxe_mac_address_t; -+ -+typedef union { -+ grub_uint32_t addr[4]; -+ grub_efi_pxe_ipv4_address_t v4; -+ grub_efi_pxe_ipv6_address_t v6; -+} grub_efi_pxe_ip_address_t; -+ -+#define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8 -+typedef struct grub_efi_pxe_ip_filter -+{ -+ grub_efi_uint8_t filters; -+ grub_efi_uint8_t ip_count; -+ grub_efi_uint16_t reserved; -+ grub_efi_ip_address_t ip_list[GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT]; -+} grub_efi_pxe_ip_filter_t; -+ -+typedef struct { -+ grub_efi_pxe_ip_address_t ip_addr; -+ grub_efi_pxe_mac_address_t mac_addr; -+} grub_efi_pxe_arp_entry_t; -+ -+typedef struct { -+ grub_efi_pxe_ip_address_t ip_addr; -+ grub_efi_pxe_ip_address_t subnet_mask; -+ grub_efi_pxe_ip_address_t gw_addr; -+} grub_efi_pxe_route_entry_t; -+ -+ -+#define GRUB_EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8 -+#define GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8 -+ - typedef struct grub_efi_pxe_mode - { - grub_efi_boolean_t started; -@@ -1527,9 +1544,9 @@ typedef struct grub_efi_pxe_mode - 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_pxe_arp_entry_t arp_cache[GRUB_EFI_PXE_BASE_CODE_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_route_entry_t route_table[GRUB_EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES]; - grub_efi_pxe_icmp_error_t icmp_error; - grub_efi_pxe_tftp_error_t tftp_error; - } grub_efi_pxe_mode_t; diff --git a/SOURCES/0256-efinet-Setting-DNS-server-from-UEFI-protocol.patch b/SOURCES/0256-efinet-Setting-DNS-server-from-UEFI-protocol.patch new file mode 100644 index 0000000..c5c6e04 --- /dev/null +++ b/SOURCES/0256-efinet-Setting-DNS-server-from-UEFI-protocol.patch @@ -0,0 +1,342 @@ +From b756c43bdb1219e3eaa6ea487a0faaa022bcfe28 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Thu, 14 Jul 2016 17:48:45 +0800 +Subject: [PATCH 256/261] efinet: Setting DNS server from UEFI protocol + +In the URI device path node, any name rahter than address can be used for +looking up the resources so that DNS service become needed to get answer of the +name's address. Unfortunately the DNS is not defined in any of the device path +nodes so that we use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL +to obtain it. + +These two protcols are defined the sections of UEFI specification. + + 27.5 EFI IPv4 Configuration II Protocol + 27.7 EFI IPv6 Configuration Protocol + +include/grub/efi/api.h: +Add new structure and protocol UUID of EFI_IP4_CONFIG2_PROTOCOL and +EFI_IP6_CONFIG_PROTOCOL. + +grub-core/net/drivers/efi/efinet.c: +Use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL to obtain the list +of DNS server address for IPv4 and IPv6 respectively. The address of DNS +servers is structured into DHCPACK packet and feed into the same DHCP packet +processing functions to ensure the network interface is setting up the same way +it used to be. + +Signed-off-by: Michael Chang +Signed-off-by: Ken Lin +--- + grub-core/net/drivers/efi/efinet.c | 165 +++++++++++++++++++++++++++++++++++++ + include/grub/efi/api.h | 76 +++++++++++++++++ + 2 files changed, 241 insertions(+) + +diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c +index 08e9d7aa3..36958a5a7 100644 +--- a/grub-core/net/drivers/efi/efinet.c ++++ b/grub-core/net/drivers/efi/efinet.c +@@ -34,6 +34,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); + /* GUID. */ + static grub_efi_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID; + static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID; ++static grub_efi_guid_t ip4_config_guid = GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID; ++static grub_efi_guid_t ip6_config_guid = GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID; + + static grub_err_t + send_card_buffer (struct grub_net_card *dev, +@@ -343,6 +345,125 @@ grub_efinet_findcards (void) + grub_free (handles); + } + ++static grub_efi_handle_t ++grub_efi_locate_device_path (grub_efi_guid_t *protocol, grub_efi_device_path_t *device_path, ++ grub_efi_device_path_t **r_device_path) ++{ ++ grub_efi_handle_t handle; ++ grub_efi_status_t status; ++ ++ status = efi_call_3 (grub_efi_system_table->boot_services->locate_device_path, ++ protocol, &device_path, &handle); ++ ++ if (status != GRUB_EFI_SUCCESS) ++ return 0; ++ ++ if (r_device_path) ++ *r_device_path = device_path; ++ ++ return handle; ++} ++ ++static grub_efi_ipv4_address_t * ++grub_dns_server_ip4_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns) ++{ ++ grub_efi_handle_t hnd; ++ grub_efi_status_t status; ++ grub_efi_ip4_config2_protocol_t *conf; ++ grub_efi_ipv4_address_t *addrs; ++ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv4_address_t); ++ ++ hnd = grub_efi_locate_device_path (&ip4_config_guid, dp, NULL); ++ ++ if (!hnd) ++ return 0; ++ ++ conf = grub_efi_open_protocol (hnd, &ip4_config_guid, ++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); ++ ++ if (!conf) ++ return 0; ++ ++ addrs = grub_malloc (data_size); ++ if (!addrs) ++ return 0; ++ ++ status = efi_call_4 (conf->get_data, conf, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, ++ &data_size, addrs); ++ ++ if (status == GRUB_EFI_BUFFER_TOO_SMALL) ++ { ++ grub_free (addrs); ++ addrs = grub_malloc (data_size); ++ if (!addrs) ++ return 0; ++ ++ status = efi_call_4 (conf->get_data, conf, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, ++ &data_size, addrs); ++ } ++ ++ if (status != GRUB_EFI_SUCCESS) ++ { ++ grub_free (addrs); ++ return 0; ++ } ++ ++ *num_dns = data_size / sizeof (grub_efi_ipv4_address_t); ++ return addrs; ++} ++ ++static grub_efi_ipv6_address_t * ++grub_dns_server_ip6_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns) ++{ ++ grub_efi_handle_t hnd; ++ grub_efi_status_t status; ++ grub_efi_ip6_config_protocol_t *conf; ++ grub_efi_ipv6_address_t *addrs; ++ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv6_address_t); ++ ++ hnd = grub_efi_locate_device_path (&ip6_config_guid, dp, NULL); ++ ++ if (!hnd) ++ return 0; ++ ++ conf = grub_efi_open_protocol (hnd, &ip6_config_guid, ++ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); ++ ++ if (!conf) ++ return 0; ++ ++ addrs = grub_malloc (data_size); ++ if (!addrs) ++ return 0; ++ ++ status = efi_call_4 (conf->get_data, conf, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, ++ &data_size, addrs); ++ ++ if (status == GRUB_EFI_BUFFER_TOO_SMALL) ++ { ++ grub_free (addrs); ++ addrs = grub_malloc (data_size); ++ if (!addrs) ++ return 0; ++ ++ status = efi_call_4 (conf->get_data, conf, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, ++ &data_size, addrs); ++ } ++ ++ if (status != GRUB_EFI_SUCCESS) ++ { ++ grub_free (addrs); ++ return 0; ++ } ++ ++ *num_dns = data_size / sizeof (grub_efi_ipv6_address_t); ++ return addrs; ++} ++ + static struct grub_net_buff * + grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6) + { +@@ -405,6 +526,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u + grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp; + struct grub_net_bootp_packet *bp; + grub_uint8_t *ptr; ++ grub_efi_ipv4_address_t *dns; ++ grub_efi_uintn_t num_dns; + + bp = (struct grub_net_bootp_packet *) nb->tail; + err = grub_netbuff_put (nb, sizeof (*bp) + 4); +@@ -471,6 +594,26 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u + *ptr++ = sizeof ("HTTPClient") - 1; + grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1); + ++ dns = grub_dns_server_ip4_address (dp, &num_dns); ++ if (dns) ++ { ++ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns; ++ ++ ptr = nb->tail; ++ err = grub_netbuff_put (nb, size_dns + 2); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ *ptr++ = GRUB_NET_BOOTP_DNS; ++ *ptr++ = size_dns; ++ grub_memcpy (ptr, dns, size_dns); ++ grub_free (dns); ++ } ++ + ptr = nb->tail; + err = grub_netbuff_put (nb, 1); + if (err) +@@ -504,6 +647,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u + struct grub_net_dhcp6_option *opt; + struct grub_net_dhcp6_option_iana *iana; + struct grub_net_dhcp6_option_iaaddr *iaaddr; ++ grub_efi_ipv6_address_t *dns; ++ grub_efi_uintn_t num_dns; + + d6p = (struct grub_net_dhcp6_packet *)nb->tail; + err = grub_netbuff_put (nb, sizeof(*d6p)); +@@ -573,6 +718,26 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u + opt->len = grub_cpu_to_be16 (uri_len); + grub_memcpy (opt->data, uri_dp->uri, uri_len); + ++ dns = grub_dns_server_ip6_address (dp, &num_dns); ++ if (dns) ++ { ++ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns; ++ ++ opt = (struct grub_net_dhcp6_option *)nb->tail; ++ err = grub_netbuff_put (nb, sizeof(*opt) + size_dns); ++ if (err) ++ { ++ grub_free (ddp); ++ grub_free (ldp); ++ grub_netbuff_free (nb); ++ return NULL; ++ } ++ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS); ++ opt->len = grub_cpu_to_be16 (size_dns); ++ grub_memcpy (opt->data, dns, size_dns); ++ grub_free (dns); ++ } ++ + *use_ipv6 = 1; + } + +diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h +index a37fb50de..4edbeef9f 100644 +--- a/include/grub/efi/api.h ++++ b/include/grub/efi/api.h +@@ -289,6 +289,16 @@ + { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ + } + ++#define GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID \ ++ { 0x5b446ed1, 0xe30b, 0x4faa, \ ++ { 0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \ ++ } ++ ++#define GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID \ ++ { 0x937fe521, 0x95ae, 0x4d1a, \ ++ { 0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \ ++ } ++ + struct grub_efi_sal_system_table + { + grub_uint32_t signature; +@@ -1784,6 +1794,72 @@ struct grub_efi_block_io + }; + typedef struct grub_efi_block_io grub_efi_block_io_t; + ++enum grub_efi_ip4_config2_data_type { ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_POLICY, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_GATEWAY, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, ++ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MAXIMUM ++}; ++typedef enum grub_efi_ip4_config2_data_type grub_efi_ip4_config2_data_type_t; ++ ++struct grub_efi_ip4_config2_protocol ++{ ++ grub_efi_status_t (*set_data) (struct grub_efi_ip4_config2_protocol *this, ++ grub_efi_ip4_config2_data_type_t data_type, ++ grub_efi_uintn_t data_size, ++ void *data); ++ ++ grub_efi_status_t (*get_data) (struct grub_efi_ip4_config2_protocol *this, ++ grub_efi_ip4_config2_data_type_t data_type, ++ grub_efi_uintn_t *data_size, ++ void *data); ++ ++ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip4_config2_protocol *this, ++ grub_efi_ip4_config2_data_type_t data_type, ++ grub_efi_event_t event); ++ ++ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip4_config2_protocol *this, ++ grub_efi_ip4_config2_data_type_t data_type, ++ grub_efi_event_t event); ++}; ++typedef struct grub_efi_ip4_config2_protocol grub_efi_ip4_config2_protocol_t; ++ ++enum grub_efi_ip6_config_data_type { ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_ALT_INTERFACEID, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_POLICY, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DUP_ADDR_DETECT_TRANSMITS, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_GATEWAY, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, ++ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MAXIMUM ++}; ++typedef enum grub_efi_ip6_config_data_type grub_efi_ip6_config_data_type_t; ++ ++struct grub_efi_ip6_config_protocol ++{ ++ grub_efi_status_t (*set_data) (struct grub_efi_ip6_config_protocol *this, ++ grub_efi_ip6_config_data_type_t data_type, ++ grub_efi_uintn_t data_size, ++ void *data); ++ ++ grub_efi_status_t (*get_data) (struct grub_efi_ip6_config_protocol *this, ++ grub_efi_ip6_config_data_type_t data_type, ++ grub_efi_uintn_t *data_size, ++ void *data); ++ ++ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip6_config_protocol *this, ++ grub_efi_ip6_config_data_type_t data_type, ++ grub_efi_event_t event); ++ ++ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip6_config_protocol *this, ++ grub_efi_ip6_config_data_type_t data_type, ++ grub_efi_event_t event); ++}; ++typedef struct grub_efi_ip6_config_protocol grub_efi_ip6_config_protocol_t; ++ + #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ + || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) + +-- +2.13.5 + diff --git a/SOURCES/0256-grub.texi-Add-net_bootp6-doument.patch b/SOURCES/0256-grub.texi-Add-net_bootp6-doument.patch deleted file mode 100644 index da2c8e7..0000000 --- a/SOURCES/0256-grub.texi-Add-net_bootp6-doument.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Tue, 5 May 2015 14:19:24 +0800 -Subject: [PATCH] grub.texi: Add net_bootp6 doument - -Update grub documentation for net_bootp6 command. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - docs/grub.texi | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/docs/grub.texi b/docs/grub.texi -index 98138e04d5b..bd3457af9a9 100644 ---- a/docs/grub.texi -+++ b/docs/grub.texi -@@ -5159,6 +5159,7 @@ List available video modes. If resolution is given, show only matching modes. - * net_add_dns:: Add a DNS server - * net_add_route:: Add routing entry - * net_bootp:: Perform a bootp autoconfiguration -+* net_bootp6:: Perform a DHCPv6 autoconfiguration - * net_del_addr:: Remove IP address from interface - * net_del_dns:: Remove a DNS server - * net_del_route:: Remove a route entry -@@ -5240,6 +5241,22 @@ Sets environment variable @samp{net_}@var{}@samp{_dhcp_extensionspath} - - @end deffn - -+@node net_bootp6 -+@subsection net_bootp6 -+ -+@deffn Command net_bootp6 [@var{card}] -+Perform configuration of @var{card} using DHCPv6 protocol. If no card name is -+specified, try to configure all existing cards. If configuration was -+successful, interface with name @var{card}@samp{:dhcp6} and configured address -+is added to @var{card}. -+ -+@table @samp -+@item 1 (Domain Name Server) -+Adds all servers from option value to the list of servers used during name -+resolution. -+@end table -+ -+@end deffn - - @node net_del_addr - @subsection net_del_addr diff --git a/SOURCES/0257-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch b/SOURCES/0257-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch deleted file mode 100644 index 0e8ea37..0000000 --- a/SOURCES/0257-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Thu, 14 Jul 2016 18:45:14 +0800 -Subject: [PATCH] bootp: Add processing DHCPACK packet from HTTP Boot - -The vendor class identifier with the string "HTTPClient" is used to denote the -packet as responding to HTTP boot request. In DHCP4 config, the filename for -HTTP boot is the URL of the boot file while for PXE boot it is the path to the -boot file. As a consequence, the next-server becomes obseleted because the HTTP -URL already contains the server address for the boot file. For DHCP6 config, -there's no difference definition in existing config as dhcp6.bootfile-url can -be used to specify URL for both HTTP and PXE boot file. - -This patch adds processing for "HTTPClient" vendor class identifier in DHCPACK -packet by treating it as HTTP format, not as the PXE format. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/bootp.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-- - include/grub/net.h | 1 + - 2 files changed, 67 insertions(+), 2 deletions(-) - -diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index dd4660601e2..d47ad80a2ad 100644 ---- a/grub-core/net/bootp.c -+++ b/grub-core/net/bootp.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -254,6 +255,11 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) - taglength); - break; - -+ case GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER: -+ grub_env_set_net_property (name, "vendor_class_identifier", (const char *) ptr, -+ taglength); -+ break; -+ - case GRUB_NET_BOOTP_EXTENSIONS_PATH: - grub_env_set_net_property (name, "extensionspath", (const char *) ptr, - taglength); -@@ -356,6 +362,66 @@ grub_net_configure_by_dhcp_ack (const char *name, - } - #endif - -+ if (size > OFFSET_OF (vendor, bp)) -+ { -+ char *cidvar; -+ const char *cid; -+ -+ parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); -+ cidvar = grub_xasprintf ("net_%s_%s", name, "vendor_class_identifier"); -+ cid = grub_env_get (cidvar); -+ grub_free (cidvar); -+ -+ if (cid && grub_strcmp (cid, "HTTPClient") == 0) -+ { -+ char *proto, *ip, *pa; -+ -+ if (!dissect_url (bp->boot_file, &proto, &ip, &pa)) -+ return inter; -+ -+ grub_env_set_net_property (name, "boot_file", pa, grub_strlen (pa)); -+ if (is_def) -+ { -+ grub_net_default_server = grub_strdup (ip); -+ grub_env_set ("net_default_interface", name); -+ grub_env_export ("net_default_interface"); -+ } -+ if (device && !*device) -+ { -+ *device = grub_xasprintf ("%s,%s", proto, ip); -+ grub_print_error (); -+ } -+ if (path) -+ { -+ *path = grub_strdup (pa); -+ grub_print_error (); -+ if (*path) -+ { -+ char *slash; -+ slash = grub_strrchr (*path, '/'); -+ if (slash) -+ *slash = 0; -+ else -+ **path = 0; -+ } -+ } -+ grub_net_add_ipv4_local (inter, mask); -+ inter->dhcp_ack = grub_malloc (size); -+ if (inter->dhcp_ack) -+ { -+ grub_memcpy (inter->dhcp_ack, bp, size); -+ inter->dhcp_acklen = size; -+ } -+ else -+ grub_errno = GRUB_ERR_NONE; -+ -+ grub_free (proto); -+ grub_free (ip); -+ grub_free (pa); -+ return inter; -+ } -+ } -+ - if (size > OFFSET_OF (boot_file, bp)) - grub_env_set_net_property (name, "boot_file", bp->boot_file, - sizeof (bp->boot_file)); -@@ -417,8 +483,6 @@ grub_net_configure_by_dhcp_ack (const char *name, - **path = 0; - } - } -- if (size > OFFSET_OF (vendor, bp)) -- parse_dhcp_vendor (name, &bp->vendor, size - OFFSET_OF (vendor, bp), &mask); - grub_net_add_ipv4_local (inter, mask); - - inter->dhcp_ack = grub_malloc (size); -diff --git a/include/grub/net.h b/include/grub/net.h -index 8ecfbb49221..1ec827b9bf3 100644 ---- a/include/grub/net.h -+++ b/include/grub/net.h -@@ -498,6 +498,7 @@ enum - GRUB_NET_BOOTP_DOMAIN = 0x0f, - GRUB_NET_BOOTP_ROOT_PATH = 0x11, - GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12, -+ GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER = 0x3c, - GRUB_NET_BOOTP_CLIENT_ID = 0x3d, - GRUB_NET_BOOTP_CLIENT_UUID = 0x61, - GRUB_NET_BOOTP_END = 0xff diff --git a/SOURCES/0257-set-rootpath.patch b/SOURCES/0257-set-rootpath.patch new file mode 100644 index 0000000..13a7f94 --- /dev/null +++ b/SOURCES/0257-set-rootpath.patch @@ -0,0 +1,49 @@ +From 620997ba9e7b4d0f0eaaccc8fbff08b746f78bef Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Wed, 24 May 2017 15:02:40 -0400 +Subject: [PATCH 257/261] set rootpath + +Signed-off-by: Peter Jones +--- + grub-core/net/bootp.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c +index fa7eefe51..017531d87 100644 +--- a/grub-core/net/bootp.c ++++ b/grub-core/net/bootp.c +@@ -398,11 +398,31 @@ grub_net_configure_by_dhcp_ack (const char *name, + if (*path) + { + char *slash; ++ int root_path_len; + slash = grub_strrchr (*path, '/'); + if (slash) + *slash = 0; + else + **path = 0; ++ root_path_len = grub_strlen (*path); ++ if (root_path_len >= 9 && ++ !grub_strcasecmp (&(*path)[root_path_len - 9], "/efi/boot")) ++ { ++ char *root_path; ++ grub_print_error (); ++ if (root_path_len - 9 == 0) ++ { ++ root_path_len = 1; ++ root_path = grub_xasprintf ("/"); ++ } ++ else ++ { ++ root_path_len -= 9; ++ root_path = grub_strndup (*path, root_path_len); ++ } ++ grub_env_set_net_property (name, "rootpath", ++ root_path, root_path_len); ++ } + } + } + grub_net_add_ipv4_local (inter, mask); +-- +2.13.5 + diff --git a/SOURCES/0258-Fix-one-more-coverity-complaint.patch b/SOURCES/0258-Fix-one-more-coverity-complaint.patch new file mode 100644 index 0000000..89724ea --- /dev/null +++ b/SOURCES/0258-Fix-one-more-coverity-complaint.patch @@ -0,0 +1,30 @@ +From 5b6796eb8c43c6d16fcb92cc1c5cb4351c4e7050 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 25 May 2017 11:27:40 -0400 +Subject: [PATCH 258/261] Fix one more coverity complaint + +No idea why covscan thinks this is an "added" bug, since the file hasn't +changed in 3 years, but... yeah. + +Signed-off-by: Peter Jones +--- + grub-core/normal/completion.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c +index 2c9b9e931..93aa0d8ed 100644 +--- a/grub-core/normal/completion.c ++++ b/grub-core/normal/completion.c +@@ -284,7 +284,8 @@ complete_file (void) + + /* Cut away the filename part. */ + dirfile = grub_strrchr (dir, '/'); +- dirfile[1] = '\0'; ++ if (dirfile) ++ dirfile[1] = '\0'; + + /* Iterate the directory. */ + (fs->dir) (dev, dir, iterate_dir, NULL); +-- +2.13.5 + diff --git a/SOURCES/0258-efinet-Setting-network-from-UEFI-device-path.patch b/SOURCES/0258-efinet-Setting-network-from-UEFI-device-path.patch deleted file mode 100644 index 97af921..0000000 --- a/SOURCES/0258-efinet-Setting-network-from-UEFI-device-path.patch +++ /dev/null @@ -1,396 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Sun, 10 Jul 2016 23:46:31 +0800 -Subject: [PATCH] efinet: Setting network from UEFI device path - -The PXE Base Code protocol used to obtain cached PXE DHCPACK packet is no -longer provided for HTTP Boot. Instead, we have to get the HTTP boot -information from the device path nodes defined in following UEFI Specification -sections. - - 9.3.5.12 IPv4 Device Path - 9.3.5.13 IPv6 Device Path - 9.3.5.23 Uniform Resource Identifiers (URI) Device Path - -This patch basically does: - -include/grub/efi/api.h: -Add new structure of Uniform Resource Identifiers (URI) Device Path - -grub-core/net/drivers/efi/efinet.c: -Check if PXE Base Code is available, if not it will try to obtain the netboot -information from the device path where the image booted from. The DHCPACK -packet is recoverd from the information in device patch and feed into the same -DHCP packet processing functions to ensure the network interface is setting up -the same way it used to be. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/drivers/efi/efinet.c | 273 +++++++++++++++++++++++++++++++++++-- - include/grub/efi/api.h | 11 ++ - 2 files changed, 275 insertions(+), 9 deletions(-) - -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 8bb0db014ac..6f75ff1f9d1 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - GRUB_MOD_LICENSE ("GPLv3+"); - -@@ -342,6 +343,227 @@ grub_efinet_findcards (void) - grub_free (handles); - } - -+static struct grub_net_buff * -+grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6) -+{ -+ grub_efi_uint16_t uri_len; -+ grub_efi_device_path_t *ldp, *ddp; -+ grub_efi_uri_device_path_t *uri_dp; -+ struct grub_net_buff *nb; -+ grub_err_t err; -+ -+ ddp = grub_efi_duplicate_device_path (dp); -+ if (!ddp) -+ return NULL; -+ -+ ldp = grub_efi_find_last_device_path (ddp); -+ -+ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -+ || GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE) -+ { -+ grub_free (ddp); -+ return NULL; -+ } -+ -+ uri_len = GRUB_EFI_DEVICE_PATH_LENGTH (ldp) > 4 ? GRUB_EFI_DEVICE_PATH_LENGTH (ldp) - 4 : 0; -+ -+ if (!uri_len) -+ { -+ grub_free (ddp); -+ return NULL; -+ } -+ -+ uri_dp = (grub_efi_uri_device_path_t *) ldp; -+ -+ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ ldp->length = sizeof (*ldp); -+ -+ ldp = grub_efi_find_last_device_path (ddp); -+ -+ 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)) -+ { -+ grub_free (ddp); -+ return NULL; -+ } -+ -+ nb = grub_netbuff_alloc (512); -+ if (!nb) -+ { -+ grub_free (ddp); -+ return NULL; -+ } -+ -+ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE) -+ { -+ grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp; -+ struct grub_net_bootp_packet *bp; -+ grub_uint8_t *ptr; -+ -+ bp = (struct grub_net_bootp_packet *) nb->tail; -+ err = grub_netbuff_put (nb, sizeof (*bp) + 4); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ -+ if (sizeof(bp->boot_file) < uri_len) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ grub_memcpy (bp->boot_file, uri_dp->uri, uri_len); -+ grub_memcpy (&bp->your_ip, ipv4->local_ip_address, sizeof (bp->your_ip)); -+ grub_memcpy (&bp->server_ip, ipv4->remote_ip_address, sizeof (bp->server_ip)); -+ -+ bp->vendor[0] = GRUB_NET_BOOTP_RFC1048_MAGIC_0; -+ bp->vendor[1] = GRUB_NET_BOOTP_RFC1048_MAGIC_1; -+ bp->vendor[2] = GRUB_NET_BOOTP_RFC1048_MAGIC_2; -+ bp->vendor[3] = GRUB_NET_BOOTP_RFC1048_MAGIC_3; -+ -+ ptr = nb->tail; -+ err = grub_netbuff_put (nb, sizeof (ipv4->subnet_mask) + 2); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ *ptr++ = GRUB_NET_BOOTP_NETMASK; -+ *ptr++ = sizeof (ipv4->subnet_mask); -+ grub_memcpy (ptr, ipv4->subnet_mask, sizeof (ipv4->subnet_mask)); -+ -+ ptr = nb->tail; -+ err = grub_netbuff_put (nb, sizeof (ipv4->gateway_ip_address) + 2); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ *ptr++ = GRUB_NET_BOOTP_ROUTER; -+ *ptr++ = sizeof (ipv4->gateway_ip_address); -+ grub_memcpy (ptr, ipv4->gateway_ip_address, sizeof (ipv4->gateway_ip_address)); -+ -+ ptr = nb->tail; -+ err = grub_netbuff_put (nb, sizeof ("HTTPClient") + 1); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ *ptr++ = GRUB_NET_BOOTP_VENDOR_CLASS_IDENTIFIER; -+ *ptr++ = sizeof ("HTTPClient") - 1; -+ grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1); -+ -+ ptr = nb->tail; -+ err = grub_netbuff_put (nb, 1); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ *ptr = GRUB_NET_BOOTP_END; -+ *use_ipv6 = 0; -+ -+ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ ldp->length = sizeof (*ldp); -+ ldp = grub_efi_find_last_device_path (ddp); -+ -+ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE) -+ { -+ grub_efi_mac_address_device_path_t *mac = (grub_efi_mac_address_device_path_t *) ldp; -+ bp->hw_type = mac->if_type; -+ bp->hw_len = sizeof (bp->mac_addr); -+ grub_memcpy (bp->mac_addr, mac->mac_address, bp->hw_len); -+ } -+ } -+ else -+ { -+ grub_efi_ipv6_device_path_t *ipv6 = (grub_efi_ipv6_device_path_t *) ldp; -+ -+ struct grub_net_dhcp6_packet *d6p; -+ struct grub_net_dhcp6_option *opt; -+ struct grub_net_dhcp6_option_iana *iana; -+ struct grub_net_dhcp6_option_iaaddr *iaaddr; -+ -+ d6p = (struct grub_net_dhcp6_packet *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*d6p)); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ d6p->message_type = GRUB_NET_DHCP6_REPLY; -+ -+ opt = (struct grub_net_dhcp6_option *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*opt)); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IA_NA); -+ opt->len = grub_cpu_to_be16_compile_time (sizeof(*iana) + sizeof(*opt) + sizeof(*iaaddr)); -+ -+ err = grub_netbuff_put (nb, sizeof(*iana)); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ -+ opt = (struct grub_net_dhcp6_option *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*opt)); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_IAADDR); -+ opt->len = grub_cpu_to_be16_compile_time (sizeof (*iaaddr)); -+ -+ iaaddr = (struct grub_net_dhcp6_option_iaaddr *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*iaaddr)); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ grub_memcpy (iaaddr->addr, ipv6->local_ip_address, sizeof(ipv6->local_ip_address)); -+ -+ opt = (struct grub_net_dhcp6_option *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*opt) + uri_len); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_BOOTFILE_URL); -+ opt->len = grub_cpu_to_be16 (uri_len); -+ grub_memcpy (opt->data, uri_dp->uri, uri_len); -+ -+ *use_ipv6 = 1; -+ } -+ -+ grub_free (ddp); -+ return nb; -+} -+ - static void - grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - char **path) -@@ -358,6 +580,10 @@ 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; -+ grub_uint8_t *packet_buf; -+ grub_size_t packet_bufsz ; -+ int ipv6; -+ struct grub_net_buff *nb = NULL; - - if (card->driver != &efidriver) - continue; -@@ -381,11 +607,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - */ - 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)) -+ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE -+ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) - continue; - dup_dp = grub_efi_duplicate_device_path (dp); - if (!dup_dp) - continue; -+ -+ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE) -+ { -+ dup_ldp = grub_efi_find_last_device_path (dup_dp); -+ dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ dup_ldp->length = sizeof (*dup_ldp); -+ } -+ - dup_ldp = grub_efi_find_last_device_path (dup_dp); - dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -@@ -398,11 +634,26 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - - pxe = grub_efi_open_protocol (hnd, &pxe_io_guid, - GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -- if (! pxe) -- continue; -+ if (!pxe) -+ { -+ nb = grub_efinet_create_dhcp_ack_from_device_path (dp, &ipv6); -+ if (!nb) -+ { -+ grub_print_error (); -+ continue; -+ } -+ packet_buf = nb->head; -+ packet_bufsz = nb->tail - nb->head; -+ } -+ else -+ { -+ pxe_mode = pxe->mode; -+ packet_buf = (grub_uint8_t *) &pxe_mode->dhcp_ack; -+ packet_bufsz = sizeof (pxe_mode->dhcp_ack); -+ ipv6 = pxe_mode->using_ipv6; -+ } - -- pxe_mode = pxe->mode; -- if (pxe_mode->using_ipv6) -+ if (ipv6) - { - grub_dprintf ("efinet", "using ipv6 and dhcpv6\n"); - grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n", -@@ -413,8 +664,8 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - - grub_net_configure_by_dhcpv6_reply (card->name, card, 0, - (struct grub_net_dhcp6_packet *) -- &pxe_mode->dhcp_ack, -- sizeof (pxe_mode->dhcp_ack), -+ packet_buf, -+ packet_bufsz, - 1, device, path); - if (grub_errno) - grub_print_error (); -@@ -428,11 +679,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - 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), -+ packet_buf, -+ packet_bufsz, - 1, device, path); - grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path); - } -+ -+ if (nb) -+ grub_netbuff_free (nb); -+ - return; - } - } -diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 2d0f37a8164..76ad56aa2b0 100644 ---- a/include/grub/efi/api.h -+++ b/include/grub/efi/api.h -@@ -786,6 +786,8 @@ struct grub_efi_ipv4_device_path - grub_efi_uint16_t remote_port; - grub_efi_uint16_t protocol; - grub_efi_uint8_t static_ip_address; -+ grub_efi_ipv4_address_t gateway_ip_address; -+ grub_efi_ipv4_address_t subnet_mask; - } GRUB_PACKED; - typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t; - -@@ -840,6 +842,15 @@ struct grub_efi_sata_device_path - } GRUB_PACKED; - typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t; - -+#define GRUB_EFI_URI_DEVICE_PATH_SUBTYPE 24 -+ -+struct grub_efi_uri_device_path -+{ -+ grub_efi_device_path_t header; -+ grub_efi_uint8_t uri[0]; -+} GRUB_PACKED; -+typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t; -+ - #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 - - /* Media Device Path. */ diff --git a/SOURCES/0259-Fix-up-linux-params-usage.patch b/SOURCES/0259-Fix-up-linux-params-usage.patch new file mode 100644 index 0000000..7cc8959 --- /dev/null +++ b/SOURCES/0259-Fix-up-linux-params-usage.patch @@ -0,0 +1,45 @@ +From 91c15505ac228234b182a483910d5cab30ab8699 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Tue, 30 May 2017 14:16:07 -0400 +Subject: [PATCH 259/261] Fix up linux params usage... + +Related: rhbz#1310763 + +Signed-off-by: Peter Jones +--- + grub-core/loader/i386/linux.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c +index e3906eb65..656c75fd7 100644 +--- a/grub-core/loader/i386/linux.c ++++ b/grub-core/loader/i386/linux.c +@@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + { + grub_file_t file = 0; + struct linux_kernel_header lh; ++ grub_uint8_t *linux_params_ptr; + grub_uint8_t setup_sects; + grub_size_t real_size, prot_size, prot_file_size, kernel_offset; + grub_ssize_t len; +@@ -811,6 +812,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + preferred_address)) + goto fail; + ++ + grub_memset (&linux_params, 0, sizeof (linux_params)); + grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); + +@@ -820,7 +822,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + + len = sizeof (linux_params) - sizeof (lh); + +- grub_memcpy (&linux_params + sizeof (lh), kernel + kernel_offset, len); ++ linux_params_ptr = (void *)&linux_params; ++ grub_memcpy (linux_params_ptr + sizeof (lh), kernel + kernel_offset, len); + kernel_offset += len; + + linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; +-- +2.13.5 + diff --git a/SOURCES/0259-efinet-Setting-DNS-server-from-UEFI-protocol.patch b/SOURCES/0259-efinet-Setting-DNS-server-from-UEFI-protocol.patch deleted file mode 100644 index 3623e0c..0000000 --- a/SOURCES/0259-efinet-Setting-DNS-server-from-UEFI-protocol.patch +++ /dev/null @@ -1,337 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Thu, 14 Jul 2016 17:48:45 +0800 -Subject: [PATCH] efinet: Setting DNS server from UEFI protocol - -In the URI device path node, any name rahter than address can be used for -looking up the resources so that DNS service become needed to get answer of the -name's address. Unfortunately the DNS is not defined in any of the device path -nodes so that we use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL -to obtain it. - -These two protcols are defined the sections of UEFI specification. - - 27.5 EFI IPv4 Configuration II Protocol - 27.7 EFI IPv6 Configuration Protocol - -include/grub/efi/api.h: -Add new structure and protocol UUID of EFI_IP4_CONFIG2_PROTOCOL and -EFI_IP6_CONFIG_PROTOCOL. - -grub-core/net/drivers/efi/efinet.c: -Use the EFI_IP4_CONFIG2_PROTOCOL and EFI_IP6_CONFIG_PROTOCOL to obtain the list -of DNS server address for IPv4 and IPv6 respectively. The address of DNS -servers is structured into DHCPACK packet and feed into the same DHCP packet -processing functions to ensure the network interface is setting up the same way -it used to be. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/drivers/efi/efinet.c | 163 +++++++++++++++++++++++++++++++++++++ - include/grub/efi/api.h | 76 +++++++++++++++++ - 2 files changed, 239 insertions(+) - -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 6f75ff1f9d1..25616a9c6c8 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -34,6 +34,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); - /* GUID. */ - static grub_efi_guid_t net_io_guid = GRUB_EFI_SIMPLE_NETWORK_GUID; - static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID; -+static grub_efi_guid_t ip4_config_guid = GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID; -+static grub_efi_guid_t ip6_config_guid = GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID; - - static grub_err_t - send_card_buffer (struct grub_net_card *dev, -@@ -343,6 +345,125 @@ grub_efinet_findcards (void) - grub_free (handles); - } - -+static grub_efi_handle_t -+grub_efi_locate_device_path (grub_efi_guid_t *protocol, grub_efi_device_path_t *device_path, -+ grub_efi_device_path_t **r_device_path) -+{ -+ grub_efi_handle_t handle; -+ grub_efi_status_t status; -+ -+ status = efi_call_3 (grub_efi_system_table->boot_services->locate_device_path, -+ protocol, &device_path, &handle); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ -+ if (r_device_path) -+ *r_device_path = device_path; -+ -+ return handle; -+} -+ -+static grub_efi_ipv4_address_t * -+grub_dns_server_ip4_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns) -+{ -+ grub_efi_handle_t hnd; -+ grub_efi_status_t status; -+ grub_efi_ip4_config2_protocol_t *conf; -+ grub_efi_ipv4_address_t *addrs; -+ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv4_address_t); -+ -+ hnd = grub_efi_locate_device_path (&ip4_config_guid, dp, NULL); -+ -+ if (!hnd) -+ return 0; -+ -+ conf = grub_efi_open_protocol (hnd, &ip4_config_guid, -+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ -+ if (!conf) -+ return 0; -+ -+ addrs = grub_malloc (data_size); -+ if (!addrs) -+ return 0; -+ -+ status = efi_call_4 (conf->get_data, conf, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, -+ &data_size, addrs); -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL) -+ { -+ grub_free (addrs); -+ addrs = grub_malloc (data_size); -+ if (!addrs) -+ return 0; -+ -+ status = efi_call_4 (conf->get_data, conf, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, -+ &data_size, addrs); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (addrs); -+ return 0; -+ } -+ -+ *num_dns = data_size / sizeof (grub_efi_ipv4_address_t); -+ return addrs; -+} -+ -+static grub_efi_ipv6_address_t * -+grub_dns_server_ip6_address (grub_efi_device_path_t *dp, grub_efi_uintn_t *num_dns) -+{ -+ grub_efi_handle_t hnd; -+ grub_efi_status_t status; -+ grub_efi_ip6_config_protocol_t *conf; -+ grub_efi_ipv6_address_t *addrs; -+ grub_efi_uintn_t data_size = 1 * sizeof (grub_efi_ipv6_address_t); -+ -+ hnd = grub_efi_locate_device_path (&ip6_config_guid, dp, NULL); -+ -+ if (!hnd) -+ return 0; -+ -+ conf = grub_efi_open_protocol (hnd, &ip6_config_guid, -+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ -+ if (!conf) -+ return 0; -+ -+ addrs = grub_malloc (data_size); -+ if (!addrs) -+ return 0; -+ -+ status = efi_call_4 (conf->get_data, conf, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, -+ &data_size, addrs); -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL) -+ { -+ grub_free (addrs); -+ addrs = grub_malloc (data_size); -+ if (!addrs) -+ return 0; -+ -+ status = efi_call_4 (conf->get_data, conf, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, -+ &data_size, addrs); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (addrs); -+ return 0; -+ } -+ -+ *num_dns = data_size / sizeof (grub_efi_ipv6_address_t); -+ return addrs; -+} -+ - static struct grub_net_buff * - grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *use_ipv6) - { -@@ -401,6 +522,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) ldp; - struct grub_net_bootp_packet *bp; - grub_uint8_t *ptr; -+ grub_efi_ipv4_address_t *dns; -+ grub_efi_uintn_t num_dns; - - bp = (struct grub_net_bootp_packet *) nb->tail; - err = grub_netbuff_put (nb, sizeof (*bp) + 4); -@@ -462,6 +585,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - *ptr++ = sizeof ("HTTPClient") - 1; - grub_memcpy (ptr, "HTTPClient", sizeof ("HTTPClient") - 1); - -+ dns = grub_dns_server_ip4_address (dp, &num_dns); -+ if (dns) -+ { -+ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns; -+ -+ ptr = nb->tail; -+ err = grub_netbuff_put (nb, size_dns + 2); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ *ptr++ = GRUB_NET_BOOTP_DNS; -+ *ptr++ = size_dns; -+ grub_memcpy (ptr, dns, size_dns); -+ grub_free (dns); -+ } -+ - ptr = nb->tail; - err = grub_netbuff_put (nb, 1); - if (err) -@@ -494,6 +636,8 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - struct grub_net_dhcp6_option *opt; - struct grub_net_dhcp6_option_iana *iana; - struct grub_net_dhcp6_option_iaaddr *iaaddr; -+ grub_efi_ipv6_address_t *dns; -+ grub_efi_uintn_t num_dns; - - d6p = (struct grub_net_dhcp6_packet *)nb->tail; - err = grub_netbuff_put (nb, sizeof(*d6p)); -@@ -557,6 +701,25 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - opt->len = grub_cpu_to_be16 (uri_len); - grub_memcpy (opt->data, uri_dp->uri, uri_len); - -+ dns = grub_dns_server_ip6_address (dp, &num_dns); -+ if (dns) -+ { -+ grub_efi_uintn_t size_dns = sizeof (*dns) * num_dns; -+ -+ opt = (struct grub_net_dhcp6_option *)nb->tail; -+ err = grub_netbuff_put (nb, sizeof(*opt) + size_dns); -+ if (err) -+ { -+ grub_free (ddp); -+ grub_netbuff_free (nb); -+ return NULL; -+ } -+ opt->code = grub_cpu_to_be16_compile_time (GRUB_NET_DHCP6_OPTION_DNS_SERVERS); -+ opt->len = grub_cpu_to_be16 (size_dns); -+ grub_memcpy (opt->data, dns, size_dns); -+ grub_free (dns); -+ } -+ - *use_ipv6 = 1; - } - -diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 76ad56aa2b0..852daddfb0f 100644 ---- a/include/grub/efi/api.h -+++ b/include/grub/efi/api.h -@@ -289,6 +289,16 @@ - { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ - } - -+#define GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID \ -+ { 0x5b446ed1, 0xe30b, 0x4faa, \ -+ { 0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80 } \ -+ } -+ -+#define GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID \ -+ { 0x937fe521, 0x95ae, 0x4d1a, \ -+ { 0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a } \ -+ } -+ - struct grub_efi_sal_system_table - { - grub_uint32_t signature; -@@ -1785,6 +1795,72 @@ struct grub_efi_block_io - }; - typedef struct grub_efi_block_io grub_efi_block_io_t; - -+enum grub_efi_ip4_config2_data_type { -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_POLICY, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_GATEWAY, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MAXIMUM -+}; -+typedef enum grub_efi_ip4_config2_data_type grub_efi_ip4_config2_data_type_t; -+ -+struct grub_efi_ip4_config2_protocol -+{ -+ grub_efi_status_t (*set_data) (struct grub_efi_ip4_config2_protocol *this, -+ grub_efi_ip4_config2_data_type_t data_type, -+ grub_efi_uintn_t data_size, -+ void *data); -+ -+ grub_efi_status_t (*get_data) (struct grub_efi_ip4_config2_protocol *this, -+ grub_efi_ip4_config2_data_type_t data_type, -+ grub_efi_uintn_t *data_size, -+ void *data); -+ -+ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip4_config2_protocol *this, -+ grub_efi_ip4_config2_data_type_t data_type, -+ grub_efi_event_t event); -+ -+ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip4_config2_protocol *this, -+ grub_efi_ip4_config2_data_type_t data_type, -+ grub_efi_event_t event); -+}; -+typedef struct grub_efi_ip4_config2_protocol grub_efi_ip4_config2_protocol_t; -+ -+enum grub_efi_ip6_config_data_type { -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_ALT_INTERFACEID, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_POLICY, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DUP_ADDR_DETECT_TRANSMITS, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_GATEWAY, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MAXIMUM -+}; -+typedef enum grub_efi_ip6_config_data_type grub_efi_ip6_config_data_type_t; -+ -+struct grub_efi_ip6_config_protocol -+{ -+ grub_efi_status_t (*set_data) (struct grub_efi_ip6_config_protocol *this, -+ grub_efi_ip6_config_data_type_t data_type, -+ grub_efi_uintn_t data_size, -+ void *data); -+ -+ grub_efi_status_t (*get_data) (struct grub_efi_ip6_config_protocol *this, -+ grub_efi_ip6_config_data_type_t data_type, -+ grub_efi_uintn_t *data_size, -+ void *data); -+ -+ grub_efi_status_t (*register_data_notify) (struct grub_efi_ip6_config_protocol *this, -+ grub_efi_ip6_config_data_type_t data_type, -+ grub_efi_event_t event); -+ -+ grub_efi_status_t (*unregister_datanotify) (struct grub_efi_ip6_config_protocol *this, -+ grub_efi_ip6_config_data_type_t data_type, -+ grub_efi_event_t event); -+}; -+typedef struct grub_efi_ip6_config_protocol grub_efi_ip6_config_protocol_t; -+ - #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ - || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) - diff --git a/SOURCES/0260-Make-module-directory-specifiable-on-the-configure-c.patch b/SOURCES/0260-Make-module-directory-specifiable-on-the-configure-c.patch new file mode 100644 index 0000000..1077639 --- /dev/null +++ b/SOURCES/0260-Make-module-directory-specifiable-on-the-configure-c.patch @@ -0,0 +1,101 @@ +From 01469263892c3bf6634ffd82dbe5cf981aaa328d Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 25 May 2017 13:45:01 -0400 +Subject: [PATCH 260/261] Make module directory specifiable on the configure + command line. + +Currently ppc, ppc64, and ppc64le all wind up with modules in +/usr/lib/grub/powerpc-ieee1275, because powerpc is the target cpu in +grub's eyes. This causes file conflicts between "noarch" module +packages. + +This patch allows --with-moduledir=%{arch} to be specified on the +configure command line to override the directory name for a specific +build, to disambiguate the various ppc directories. + +Resolves: rhbz#1455243 + +Signed-off-by: Peter Jones +--- + conf/Makefile.common | 2 +- + config.h.in | 2 ++ + configure.ac | 9 +++++++++ + grub-core/osdep/aros/config.c | 2 +- + grub-core/osdep/unix/config.c | 2 +- + 5 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/conf/Makefile.common b/conf/Makefile.common +index 6f836d827..5daa6d57c 100644 +--- a/conf/Makefile.common ++++ b/conf/Makefile.common +@@ -69,7 +69,7 @@ CCASFLAGS_LIBRARY = + # Other variables + + grubconfdir = $(sysconfdir)/grub.d +-platformdir = $(pkglibdir)/$(target_cpu)-$(platform) ++platformdir = $(pkglibdir)/$(moduledirname) + starfielddir = $(pkgdatadir)/themes/starfield + + CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion +diff --git a/config.h.in b/config.h.in +index 4b6301441..c38fc74f7 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -41,6 +41,8 @@ + #define END_SYMBOL @END_SYMBOL@ + /* Name of package. */ + #define PACKAGE "@PACKAGE@" ++/* Name of the default module directory. */ ++#define MODULE_DIR_NAME "@MODULE_DIR_NAME@" + /* Version number of package. */ + #define VERSION "@VERSION@" + /* Define to the full name and version of this package. */ +diff --git a/configure.ac b/configure.ac +index 8b10a93cb..ab3007ba6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -315,6 +315,15 @@ AC_SUBST(grubdirname) + AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname", + [Default grub directory name]) + ++AC_ARG_WITH([moduledir], ++ AS_HELP_STRING([--with-moduledir=NAME], ++ [set the name of the module directory [[guessed]]]), ++ [moduledirname="$with_moduledir"], ++ [moduledirname="$target_cpu-$platform"]) ++AC_SUBST(moduledirname) ++AC_DEFINE_UNQUOTED(MODULE_DIR_NAME, "$moduledirname", ++ [Default module directory name]) ++ + # + # Checks for build programs. + # +diff --git a/grub-core/osdep/aros/config.c b/grub-core/osdep/aros/config.c +index c82d0ea8e..bf3593d97 100644 +--- a/grub-core/osdep/aros/config.c ++++ b/grub-core/osdep/aros/config.c +@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void) + const char * + grub_util_get_pkglibdir (void) + { +- return GRUB_LIBDIR "/" PACKAGE; ++ return GRUB_LIBDIR "/" MODULE_DIR_NAME; + } + + const char * +diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c +index f4b0bb466..d882bed33 100644 +--- a/grub-core/osdep/unix/config.c ++++ b/grub-core/osdep/unix/config.c +@@ -52,7 +52,7 @@ grub_util_get_pkgdatadir (void) + const char * + grub_util_get_pkglibdir (void) + { +- return GRUB_LIBDIR "/" PACKAGE; ++ return GRUB_LIBDIR "/" MODULE_DIR_NAME; + } + + const char * +-- +2.13.5 + diff --git a/SOURCES/0260-set-rootpath.patch b/SOURCES/0260-set-rootpath.patch deleted file mode 100644 index 155cc30..0000000 --- a/SOURCES/0260-set-rootpath.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Wed, 24 May 2017 15:02:40 -0400 -Subject: [PATCH] set rootpath - -Signed-off-by: Peter Jones ---- - grub-core/net/bootp.c | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c -index d47ad80a2ad..249ca0c2dc6 100644 ---- a/grub-core/net/bootp.c -+++ b/grub-core/net/bootp.c -@@ -398,11 +398,31 @@ grub_net_configure_by_dhcp_ack (const char *name, - if (*path) - { - char *slash; -+ int root_path_len; - slash = grub_strrchr (*path, '/'); - if (slash) - *slash = 0; - else - **path = 0; -+ root_path_len = grub_strlen (*path); -+ if (root_path_len >= 9 && -+ !grub_strcasecmp (&(*path)[root_path_len - 9], "/efi/boot")) -+ { -+ char *root_path; -+ grub_print_error (); -+ if (root_path_len - 9 == 0) -+ { -+ root_path_len = 1; -+ root_path = grub_xasprintf ("/"); -+ } -+ else -+ { -+ root_path_len -= 9; -+ root_path = grub_strndup (*path, root_path_len); -+ } -+ grub_env_set_net_property (name, "rootpath", -+ root_path, root_path_len); -+ } - } - } - grub_net_add_ipv4_local (inter, mask); diff --git a/SOURCES/0261-Fix-grub_net_hwaddr_to_str.patch b/SOURCES/0261-Fix-grub_net_hwaddr_to_str.patch new file mode 100644 index 0000000..fabd948 --- /dev/null +++ b/SOURCES/0261-Fix-grub_net_hwaddr_to_str.patch @@ -0,0 +1,44 @@ +From f1fa4958044effea7f3ea0506097e27ca5b520f1 Mon Sep 17 00:00:00 2001 +From: Mark Salter +Date: Tue, 22 Aug 2017 12:21:12 -0400 +Subject: [PATCH 261/261] Fix grub_net_hwaddr_to_str + +commit 5c3b78c92f8 introduced support for larger network hw addresses. +However, grub_net_hwaddr_to_str() relies on GRUB_NET_MAX_STR_ADDRESS_SIZE +to prevent a spurious ':' at the end of the string. So now, if actual +hwaddr size is less than max, an extra ':' appears at the end of the +string. So calculate max string size based on actual hwaddr length to +fix the problem. + +Signed-off-by: Mark Salter +--- + grub-core/net/net.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/net.c b/grub-core/net/net.c +index 6b4b10ba4..a6566bdb0 100644 +--- a/grub-core/net/net.c ++++ b/grub-core/net/net.c +@@ -784,6 +784,7 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) + { + char *ptr; + unsigned i; ++ int maxstr; + + if (addr->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE) + { +@@ -792,9 +793,10 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) + addr->type, addr->len); + return; + } ++ maxstr = addr->len * grub_strlen ("XX:"); + for (ptr = str, i = 0; i < addr->len; i++) + { +- ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), ++ ptr += grub_snprintf (ptr, maxstr - (ptr - str), + "%02x:", addr->mac[i] & 0xff); + } + } +-- +2.13.5 + diff --git a/SOURCES/0261-Fix-one-more-coverity-complaint.patch b/SOURCES/0261-Fix-one-more-coverity-complaint.patch deleted file mode 100644 index ba00fbd..0000000 --- a/SOURCES/0261-Fix-one-more-coverity-complaint.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 25 May 2017 11:27:40 -0400 -Subject: [PATCH] Fix one more coverity complaint - -No idea why covscan thinks this is an "added" bug, since the file hasn't -changed in 3 years, but... yeah. - -Signed-off-by: Peter Jones ---- - grub-core/normal/completion.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c -index 2c9b9e9312a..93aa0d8eda8 100644 ---- a/grub-core/normal/completion.c -+++ b/grub-core/normal/completion.c -@@ -284,7 +284,8 @@ complete_file (void) - - /* Cut away the filename part. */ - dirfile = grub_strrchr (dir, '/'); -- dirfile[1] = '\0'; -+ if (dirfile) -+ dirfile[1] = '\0'; - - /* Iterate the directory. */ - (fs->dir) (dev, dir, iterate_dir, NULL); diff --git a/SOURCES/0262-Fix-up-linux-params-usage.patch b/SOURCES/0262-Fix-up-linux-params-usage.patch deleted file mode 100644 index 0024568..0000000 --- a/SOURCES/0262-Fix-up-linux-params-usage.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Tue, 30 May 2017 14:16:07 -0400 -Subject: [PATCH] Fix up linux params usage... - -Related: rhbz#1310763 - -Signed-off-by: Peter Jones ---- - grub-core/loader/i386/linux.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c -index e3906eb658f..656c75fd7e8 100644 ---- a/grub-core/loader/i386/linux.c -+++ b/grub-core/loader/i386/linux.c -@@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - { - grub_file_t file = 0; - struct linux_kernel_header lh; -+ grub_uint8_t *linux_params_ptr; - grub_uint8_t setup_sects; - grub_size_t real_size, prot_size, prot_file_size, kernel_offset; - grub_ssize_t len; -@@ -811,6 +812,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - preferred_address)) - goto fail; - -+ - grub_memset (&linux_params, 0, sizeof (linux_params)); - grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); - -@@ -820,7 +822,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), - - len = sizeof (linux_params) - sizeof (lh); - -- grub_memcpy (&linux_params + sizeof (lh), kernel + kernel_offset, len); -+ linux_params_ptr = (void *)&linux_params; -+ grub_memcpy (linux_params_ptr + sizeof (lh), kernel + kernel_offset, len); - kernel_offset += len; - - linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; diff --git a/SOURCES/0263-Fix-grub_net_hwaddr_to_str.patch b/SOURCES/0263-Fix-grub_net_hwaddr_to_str.patch deleted file mode 100644 index c6f2d4f..0000000 --- a/SOURCES/0263-Fix-grub_net_hwaddr_to_str.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Mark Salter -Date: Tue, 22 Aug 2017 12:21:12 -0400 -Subject: [PATCH] Fix grub_net_hwaddr_to_str - -commit 5c3b78c92f8 introduced support for larger network hw addresses. -However, grub_net_hwaddr_to_str() relies on GRUB_NET_MAX_STR_ADDRESS_SIZE -to prevent a spurious ':' at the end of the string. So now, if actual -hwaddr size is less than max, an extra ':' appears at the end of the -string. So calculate max string size based on actual hwaddr length to -fix the problem. - -Signed-off-by: Mark Salter ---- - grub-core/net/net.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index 6b4b10ba444..a6566bdb00a 100644 ---- a/grub-core/net/net.c -+++ b/grub-core/net/net.c -@@ -784,6 +784,7 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) - { - char *ptr; - unsigned i; -+ int maxstr; - - if (addr->len > GRUB_NET_MAX_LINK_ADDRESS_SIZE) - { -@@ -792,9 +793,10 @@ grub_net_hwaddr_to_str (const grub_net_link_level_address_t *addr, char *str) - addr->type, addr->len); - return; - } -+ maxstr = addr->len * grub_strlen ("XX:"); - for (ptr = str, i = 0; i < addr->len; i++) - { -- ptr += grub_snprintf (ptr, GRUB_NET_MAX_STR_HWADDR_LEN - (ptr - str), -+ ptr += grub_snprintf (ptr, maxstr - (ptr - str), - "%02x:", addr->mac[i] & 0xff); - } - } diff --git a/SOURCES/0264-Fixup-for-newer-compiler.patch b/SOURCES/0264-Fixup-for-newer-compiler.patch deleted file mode 100644 index e3a56de..0000000 --- a/SOURCES/0264-Fixup-for-newer-compiler.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Thu, 10 May 2018 13:40:19 -0400 -Subject: [PATCH] Fixup for newer compiler - ---- - grub-core/fs/btrfs.c | 2 +- - include/grub/gpt_partition.h | 2 +- - conf/Makefile.common | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index f7b6c152037..4a6efffeb46 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -183,7 +183,7 @@ struct grub_btrfs_inode - grub_uint64_t size; - grub_uint8_t dummy2[0x70]; - struct grub_btrfs_time mtime; --} GRUB_PACKED; -+} GRUB_PACKED __attribute__ ((aligned(8))); - - struct grub_btrfs_extent_data - { -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f6725a4..8cddf997efc 100644 ---- a/include/grub/gpt_partition.h -+++ b/include/grub/gpt_partition.h -@@ -76,7 +76,7 @@ struct grub_gpt_partentry - grub_uint64_t end; - grub_uint64_t attrib; - char name[72]; --} GRUB_PACKED; -+} GRUB_PACKED __attribute__ ((aligned(8))); - - grub_err_t - grub_gpt_partition_map_iterate (grub_disk_t disk, -diff --git a/conf/Makefile.common b/conf/Makefile.common -index 6f836d82771..9e0e8364f38 100644 ---- a/conf/Makefile.common -+++ b/conf/Makefile.common -@@ -45,7 +45,7 @@ CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding - LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC) - CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 - CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) --STRIPFLAGS_KERNEL = -R .eh_frame -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -+STRIPFLAGS_KERNEL = -R .eh_frame -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags -R .ARM.exidx -R .note.gnu.property -R .gnu.build.attributes - - CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding - LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d diff --git a/SOURCES/0265-Support-UEFI-networking-protocols.patch b/SOURCES/0265-Support-UEFI-networking-protocols.patch deleted file mode 100644 index bda2ee2..0000000 --- a/SOURCES/0265-Support-UEFI-networking-protocols.patch +++ /dev/null @@ -1,5055 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Wed, 22 Feb 2017 14:27:50 +0800 -Subject: [PATCH] Support UEFI networking protocols - -References: fate#320130, bsc#1015589, bsc#1076132 -Patch-Mainline: no - -V1: - * Add preliminary support of UEFI networking protocols - * Support UEFI HTTPS Boot - -V2: - * Workaround http data access in firmware - * Fix DNS device path parsing for efinet device - * Relaxed UEFI Protocol requirement - * Support Intel OPA (Omni-Path Architecture) PXE Boot - -V3: - * Fix bufio in calculating address of next_buf - * Check HTTP respond code - * Use HEAD request method to test before GET - * Finish HTTP transaction in one go - * Fix bsc#1076132 ---- - grub-core/Makefile.core.def | 18 + - grub-core/io/bufio.c | 2 +- - grub-core/kern/efi/efi.c | 96 ++- - grub-core/net/drivers/efi/efinet.c | 27 + - grub-core/net/efi/dhcp.c | 397 ++++++++++ - grub-core/net/efi/efi_netfs.c | 57 ++ - grub-core/net/efi/http.c | 419 +++++++++++ - grub-core/net/efi/ip4_config.c | 398 ++++++++++ - grub-core/net/efi/ip6_config.c | 422 +++++++++++ - grub-core/net/efi/net.c | 1428 ++++++++++++++++++++++++++++++++++++ - grub-core/net/efi/pxe.c | 424 +++++++++++ - grub-core/net/net.c | 74 ++ - util/grub-mknetdir.c | 23 +- - include/grub/efi/api.h | 180 ++++- - include/grub/efi/dhcp.h | 343 +++++++++ - include/grub/efi/http.h | 215 ++++++ - include/grub/net/efi.h | 144 ++++ - 17 files changed, 4626 insertions(+), 41 deletions(-) - create mode 100644 grub-core/net/efi/dhcp.c - create mode 100644 grub-core/net/efi/efi_netfs.c - create mode 100644 grub-core/net/efi/http.c - create mode 100644 grub-core/net/efi/ip4_config.c - create mode 100644 grub-core/net/efi/ip6_config.c - create mode 100644 grub-core/net/efi/net.c - create mode 100644 grub-core/net/efi/pxe.c - create mode 100644 include/grub/efi/dhcp.h - create mode 100644 include/grub/efi/http.h - create mode 100644 include/grub/net/efi.h - -diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index b340ceeec7f..00110ae5efd 100644 ---- a/grub-core/Makefile.core.def -+++ b/grub-core/Makefile.core.def -@@ -2093,6 +2093,18 @@ module = { - common = hook/datehook.c; - }; - -+module = { -+ name = efi_netfs; -+ common = net/efi/efi_netfs.c; -+ common = net/efi/net.c; -+ common = net/efi/http.c; -+ common = net/efi/pxe.c; -+ common = net/efi/ip4_config.c; -+ common = net/efi/ip6_config.c; -+ common = net/efi/dhcp.c; -+ enable = efi; -+}; -+ - module = { - name = net; - common = net/net.c; -@@ -2107,6 +2119,12 @@ module = { - common = net/arp.c; - common = net/netbuff.c; - common = net/url.c; -+ efi = net/efi/net.c; -+ efi = net/efi/http.c; -+ efi = net/efi/pxe.c; -+ efi = net/efi/ip4_config.c; -+ efi = net/efi/ip6_config.c; -+ efi = net/efi/dhcp.c; - }; - - module = { -diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c -index 22438277d74..d0b0f71b6ed 100644 ---- a/grub-core/io/bufio.c -+++ b/grub-core/io/bufio.c -@@ -132,7 +132,7 @@ grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) - return res; - - /* Need to read some more. */ -- next_buf = (file->offset + res + len - 1) & ~((grub_off_t) bufio->block_size - 1); -+ next_buf = (grub_divmod64 (file->offset + res + len - 1, bufio->block_size, NULL)) * bufio->block_size; - /* Now read between file->offset + res and bufio->buffer_at. */ - if (file->offset + res < next_buf) - { -diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 101307fc71e..570535f78d0 100644 ---- a/grub-core/kern/efi/efi.c -+++ b/grub-core/kern/efi/efi.c -@@ -674,7 +674,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) - { - grub_efi_ipv4_device_path_t *ipv4 - = (grub_efi_ipv4_device_path_t *) dp; -- grub_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x)", -+ grub_printf ("/IPv4(%u.%u.%u.%u,%u.%u.%u.%u,%u,%u,%x,%x", - (unsigned) ipv4->local_ip_address[0], - (unsigned) ipv4->local_ip_address[1], - (unsigned) ipv4->local_ip_address[2], -@@ -687,33 +687,60 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) - (unsigned) ipv4->remote_port, - (unsigned) ipv4->protocol, - (unsigned) ipv4->static_ip_address); -+ if (len == sizeof (*ipv4)) -+ { -+ grub_printf (",%u.%u.%u.%u,%u.%u.%u.%u", -+ (unsigned) ipv4->gateway_ip_address[0], -+ (unsigned) ipv4->gateway_ip_address[1], -+ (unsigned) ipv4->gateway_ip_address[2], -+ (unsigned) ipv4->gateway_ip_address[3], -+ (unsigned) ipv4->subnet_mask[0], -+ (unsigned) ipv4->subnet_mask[1], -+ (unsigned) ipv4->subnet_mask[2], -+ (unsigned) ipv4->subnet_mask[3]); -+ } -+ grub_printf (")"); - } - break; - case GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE: - { - grub_efi_ipv6_device_path_t *ipv6 - = (grub_efi_ipv6_device_path_t *) dp; -- grub_printf ("/IPv6(%x:%x:%x:%x:%x:%x:%x:%x,%x:%x:%x:%x:%x:%x:%x:%x,%u,%u,%x,%x)", -- (unsigned) ipv6->local_ip_address[0], -- (unsigned) ipv6->local_ip_address[1], -- (unsigned) ipv6->local_ip_address[2], -- (unsigned) ipv6->local_ip_address[3], -- (unsigned) ipv6->local_ip_address[4], -- (unsigned) ipv6->local_ip_address[5], -- (unsigned) ipv6->local_ip_address[6], -- (unsigned) ipv6->local_ip_address[7], -- (unsigned) ipv6->remote_ip_address[0], -- (unsigned) ipv6->remote_ip_address[1], -- (unsigned) ipv6->remote_ip_address[2], -- (unsigned) ipv6->remote_ip_address[3], -- (unsigned) ipv6->remote_ip_address[4], -- (unsigned) ipv6->remote_ip_address[5], -- (unsigned) ipv6->remote_ip_address[6], -- (unsigned) ipv6->remote_ip_address[7], -+ grub_printf ("/IPv6(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x,%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x,%u,%u,%x,%x", -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[0]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[1]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[2]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[3]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[4]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[5]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[6]), -+ (unsigned) grub_be_to_cpu16 (ipv6->local_ip_address[7]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[0]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[1]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[2]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[3]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[4]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[5]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[6]), -+ (unsigned) grub_be_to_cpu16 (ipv6->remote_ip_address[7]), - (unsigned) ipv6->local_port, - (unsigned) ipv6->remote_port, - (unsigned) ipv6->protocol, - (unsigned) ipv6->static_ip_address); -+ if (len == sizeof (*ipv6)) -+ { -+ grub_printf (",%u,%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", -+ (unsigned) ipv6->prefix_length, -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[0]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[1]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[2]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[3]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[4]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[5]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[6]), -+ (unsigned) grub_be_to_cpu16 (ipv6->gateway_ip_address[7])); -+ } -+ grub_printf (")"); - } - break; - case GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE: -@@ -753,6 +780,39 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) - dump_vendor_path ("Messaging", - (grub_efi_vendor_device_path_t *) dp); - break; -+ case GRUB_EFI_URI_DEVICE_PATH_SUBTYPE: -+ { -+ grub_efi_uri_device_path_t *uri -+ = (grub_efi_uri_device_path_t *) dp; -+ grub_printf ("/URI(%s)", uri->uri); -+ } -+ break; -+ case GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE: -+ { -+ grub_efi_dns_device_path_t *dns -+ = (grub_efi_dns_device_path_t *) dp; -+ if (dns->is_ipv6) -+ { -+ grub_printf ("/DNS(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x)", -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[0]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[0])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[1]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[1])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[2]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[2])), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[3]) >> 16), -+ (grub_uint16_t)(grub_be_to_cpu32(dns->dns_server_ip[0].addr[3]))); -+ } -+ else -+ { -+ grub_printf ("/DNS(%d.%d.%d.%d)", -+ dns->dns_server_ip[0].v4.addr[0], -+ dns->dns_server_ip[0].v4.addr[1], -+ dns->dns_server_ip[0].v4.addr[2], -+ dns->dns_server_ip[0].v4.addr[3]); -+ } -+ } -+ break; - default: - grub_printf ("/UnknownMessaging(%x)", (unsigned) subtype); - break; -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 25616a9c6c8..3bea6221745 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - GRUB_MOD_LICENSE ("GPLv3+"); - -@@ -502,6 +503,17 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - - ldp = grub_efi_find_last_device_path (ddp); - -+ /* Skip the DNS Device */ -+ if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -+ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE) -+ { -+ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ ldp->length = sizeof (*ldp); -+ -+ ldp = grub_efi_find_last_device_path (ddp); -+ } -+ - 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)) -@@ -771,6 +783,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - 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 -+ && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE - && GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) - continue; - dup_dp = grub_efi_duplicate_device_path (dp); -@@ -785,6 +798,15 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - dup_ldp->length = sizeof (*dup_ldp); - } - -+ dup_ldp = grub_efi_find_last_device_path (dup_dp); -+ if (GRUB_EFI_DEVICE_PATH_SUBTYPE (dup_ldp) == GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE) -+ { -+ dup_ldp = grub_efi_find_last_device_path (dup_dp); -+ dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ dup_ldp->length = sizeof (*dup_ldp); -+ } -+ - dup_ldp = grub_efi_find_last_device_path (dup_dp); - dup_ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; - dup_ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -@@ -857,6 +879,9 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - - GRUB_MOD_INIT(efinet) - { -+ if (grub_efi_net_config) -+ return; -+ - grub_efinet_findcards (); - grub_efi_net_config = grub_efi_net_config_real; - } -@@ -868,5 +893,7 @@ GRUB_MOD_FINI(efinet) - FOR_NET_CARDS_SAFE (card, next) - if (card->driver == &efidriver) - grub_net_card_unregister (card); -+ -+ grub_efi_net_config = NULL; - } - -diff --git a/grub-core/net/efi/dhcp.c b/grub-core/net/efi/dhcp.c -new file mode 100644 -index 00000000000..dbef63d8c08 ---- /dev/null -+++ b/grub-core/net/efi/dhcp.c -@@ -0,0 +1,397 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifdef GRUB_EFI_NET_DEBUG -+static void -+dhcp4_mode_print (grub_efi_dhcp4_mode_data_t *mode) -+{ -+ switch (mode->state) -+ { -+ case GRUB_EFI_DHCP4_STOPPED: -+ grub_printf ("STATE: STOPPED\n"); -+ break; -+ case GRUB_EFI_DHCP4_INIT: -+ grub_printf ("STATE: INIT\n"); -+ break; -+ case GRUB_EFI_DHCP4_SELECTING: -+ grub_printf ("STATE: SELECTING\n"); -+ break; -+ case GRUB_EFI_DHCP4_REQUESTING: -+ grub_printf ("STATE: REQUESTING\n"); -+ break; -+ case GRUB_EFI_DHCP4_BOUND: -+ grub_printf ("STATE: BOUND\n"); -+ break; -+ case GRUB_EFI_DHCP4_RENEWING: -+ grub_printf ("STATE: RENEWING\n"); -+ break; -+ case GRUB_EFI_DHCP4_REBINDING: -+ grub_printf ("STATE: REBINDING\n"); -+ break; -+ case GRUB_EFI_DHCP4_INIT_REBOOT: -+ grub_printf ("STATE: INIT_REBOOT\n"); -+ break; -+ case GRUB_EFI_DHCP4_REBOOTING: -+ grub_printf ("STATE: REBOOTING\n"); -+ break; -+ default: -+ grub_printf ("STATE: UNKNOWN\n"); -+ break; -+ } -+ -+ grub_printf ("CLIENT_ADDRESS: %u.%u.%u.%u\n", -+ mode->client_address[0], -+ mode->client_address[1], -+ mode->client_address[2], -+ mode->client_address[3]); -+ grub_printf ("SERVER_ADDRESS: %u.%u.%u.%u\n", -+ mode->server_address[0], -+ mode->server_address[1], -+ mode->server_address[2], -+ mode->server_address[3]); -+ grub_printf ("SUBNET_MASK: %u.%u.%u.%u\n", -+ mode->subnet_mask[0], -+ mode->subnet_mask[1], -+ mode->subnet_mask[2], -+ mode->subnet_mask[3]); -+ grub_printf ("ROUTER_ADDRESS: %u.%u.%u.%u\n", -+ mode->router_address[0], -+ mode->router_address[1], -+ mode->router_address[2], -+ mode->router_address[3]); -+} -+#endif -+ -+static grub_efi_ipv4_address_t * -+grub_efi_dhcp4_parse_dns (grub_efi_dhcp4_protocol_t *dhcp4, grub_efi_dhcp4_packet_t *reply_packet) -+{ -+ grub_efi_dhcp4_packet_option_t **option_list; -+ grub_efi_status_t status; -+ grub_efi_uint32_t option_count = 0; -+ grub_efi_uint32_t i; -+ -+ status = efi_call_4 (dhcp4->parse, dhcp4, reply_packet, &option_count, NULL); -+ -+ if (status != GRUB_EFI_BUFFER_TOO_SMALL) -+ return NULL; -+ -+ option_list = grub_malloc (option_count * sizeof(*option_list)); -+ if (!option_list) -+ return NULL; -+ -+ status = efi_call_4 (dhcp4->parse, dhcp4, reply_packet, &option_count, option_list); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (option_list); -+ return NULL; -+ } -+ -+ for (i = 0; i < option_count; ++i) -+ { -+ if (option_list[i]->op_code == 6) -+ { -+ grub_efi_ipv4_address_t *dns_address; -+ -+ if (((option_list[i]->length & 0x3) != 0) || (option_list[i]->length == 0)) -+ continue; -+ -+ /* We only contact primary dns */ -+ dns_address = grub_malloc (sizeof (*dns_address)); -+ if (!dns_address) -+ { -+ grub_free (option_list); -+ return NULL; -+ } -+ grub_memcpy (dns_address, option_list[i]->data, sizeof (dns_address)); -+ grub_free (option_list); -+ return dns_address; -+ } -+ } -+ -+ grub_free (option_list); -+ return NULL; -+} -+ -+#if 0 -+/* Somehow this doesn't work ... */ -+static grub_err_t -+grub_cmd_efi_bootp (struct grub_command *cmd __attribute__ ((unused)), -+ int argc __attribute__ ((unused)), -+ char **args __attribute__ ((unused))) -+{ -+ struct grub_efi_net_device *dev; -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ grub_efi_pxe_t *pxe = dev->ip4_pxe; -+ grub_efi_pxe_mode_t *mode = pxe->mode; -+ grub_efi_status_t status; -+ -+ if (!mode->started) -+ { -+ status = efi_call_2 (pxe->start, pxe, 0); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ grub_printf ("Couldn't start PXE\n"); -+ } -+ -+ status = efi_call_2 (pxe->dhcp, pxe, 0); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp4 configure failed, %d\n", (int)status); -+ continue; -+ } -+ -+ dev->prefer_ip6 = 0; -+ } -+ -+ return GRUB_ERR_NONE; -+} -+#endif -+ -+static grub_err_t -+grub_cmd_efi_bootp (struct grub_command *cmd __attribute__ ((unused)), -+ int argc, -+ char **args) -+{ -+ struct grub_efi_net_device *netdev; -+ -+ for (netdev = net_devices; netdev; netdev = netdev->next) -+ { -+ grub_efi_status_t status; -+ grub_efi_dhcp4_mode_data_t mode; -+ grub_efi_dhcp4_config_data_t config; -+ grub_efi_dhcp4_packet_option_t *options; -+ grub_efi_ipv4_address_t *dns_address; -+ grub_efi_net_ip_manual_address_t net_ip; -+ grub_efi_net_ip_address_t ip_addr; -+ grub_efi_net_interface_t *inf = NULL; -+ -+ if (argc > 0 && grub_strcmp (netdev->card_name, args[0]) != 0) -+ continue; -+ -+ grub_memset (&config, 0, sizeof(config)); -+ -+ config.option_count = 1; -+ options = grub_malloc (sizeof(*options) + 2); -+ /* Parameter request list */ -+ options->op_code = 55; -+ options->length = 3; -+ /* subnet mask */ -+ options->data[0] = 1; -+ /* router */ -+ options->data[1] = 3; -+ /* DNS */ -+ options->data[2] = 6; -+ config.option_list = &options; -+ -+ /* FIXME: What if the dhcp has bounded */ -+ status = efi_call_2 (netdev->dhcp4->configure, netdev->dhcp4, &config); -+ grub_free (options); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp4 configure failed, %d\n", (int)status); -+ continue; -+ } -+ -+ status = efi_call_2 (netdev->dhcp4->start, netdev->dhcp4, NULL); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp4 start failed, %d\n", (int)status); -+ continue; -+ } -+ -+ status = efi_call_2 (netdev->dhcp4->get_mode_data, netdev->dhcp4, &mode); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp4 get mode failed, %d\n", (int)status); -+ continue; -+ } -+ -+#ifdef GRUB_EFI_NET_DEBUG -+ dhcp4_mode_print (&mode); -+#endif -+ -+ for (inf = netdev->net_interfaces; inf; inf = inf->next) -+ if (inf->prefer_ip6 == 0) -+ break; -+ -+ grub_memcpy (net_ip.ip4.address, mode.client_address, sizeof (net_ip.ip4.address)); -+ grub_memcpy (net_ip.ip4.subnet_mask, mode.subnet_mask, sizeof (net_ip.ip4.subnet_mask)); -+ -+ if (!inf) -+ { -+ char *name = grub_xasprintf ("%s:dhcp", netdev->card_name); -+ -+ net_ip.is_ip6 = 0; -+ inf = grub_efi_net_create_interface (netdev, -+ name, -+ &net_ip, -+ 1); -+ grub_free (name); -+ } -+ else -+ { -+ efi_net_interface_set_address (inf, &net_ip, 1); -+ } -+ -+ grub_memcpy (ip_addr.ip4, mode.router_address, sizeof (ip_addr.ip4)); -+ efi_net_interface_set_gateway (inf, &ip_addr); -+ -+ dns_address = grub_efi_dhcp4_parse_dns (netdev->dhcp4, mode.reply_packet); -+ if (dns_address) -+ efi_net_interface_set_dns (inf, (grub_efi_net_ip_address_t *)&dns_address); -+ -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ -+ -+static grub_err_t -+grub_cmd_efi_bootp6 (struct grub_command *cmd __attribute__ ((unused)), -+ int argc, -+ char **args) -+{ -+ struct grub_efi_net_device *dev; -+ grub_efi_uint32_t ia_id; -+ -+ for (dev = net_devices, ia_id = 0; dev; dev = dev->next, ia_id++) -+ { -+ grub_efi_dhcp6_config_data_t config; -+ grub_efi_dhcp6_packet_option_t *option_list[1]; -+ grub_efi_dhcp6_packet_option_t *opt; -+ grub_efi_status_t status; -+ grub_efi_dhcp6_mode_data_t mode; -+ grub_efi_dhcp6_retransmission_t retrans; -+ grub_efi_net_ip_manual_address_t net_ip; -+ grub_efi_boot_services_t *b = grub_efi_system_table->boot_services; -+ grub_efi_net_interface_t *inf = NULL; -+ -+ if (argc > 0 && grub_strcmp (dev->card_name, args[0]) != 0) -+ continue; -+ -+ opt = grub_malloc (sizeof(*opt) + 2 * sizeof (grub_efi_uint16_t)); -+ -+#define GRUB_EFI_DHCP6_OPT_ORO 6 -+ -+ opt->op_code = grub_cpu_to_be16_compile_time (GRUB_EFI_DHCP6_OPT_ORO); -+ opt->op_len = grub_cpu_to_be16_compile_time (2 * sizeof (grub_efi_uint16_t)); -+ -+#define GRUB_EFI_DHCP6_OPT_BOOT_FILE_URL 59 -+#define GRUB_EFI_DHCP6_OPT_DNS_SERVERS 23 -+ -+ grub_set_unaligned16 (opt->data, grub_cpu_to_be16_compile_time(GRUB_EFI_DHCP6_OPT_BOOT_FILE_URL)); -+ grub_set_unaligned16 (opt->data + 1 * sizeof (grub_efi_uint16_t), -+ grub_cpu_to_be16_compile_time(GRUB_EFI_DHCP6_OPT_DNS_SERVERS)); -+ -+ option_list[0] = opt; -+ retrans.irt = 4; -+ retrans.mrc = 4; -+ retrans.mrt = 32; -+ retrans.mrd = 60; -+ -+ config.dhcp6_callback = NULL; -+ config.callback_context = NULL; -+ config.option_count = 1; -+ config.option_list = option_list; -+ config.ia_descriptor.ia_id = ia_id; -+ config.ia_descriptor.type = GRUB_EFI_DHCP6_IA_TYPE_NA; -+ config.ia_info_event = NULL; -+ config.reconfigure_accept = 0; -+ config.rapid_commit = 0; -+ config.solicit_retransmission = &retrans; -+ -+ status = efi_call_2 (dev->dhcp6->configure, dev->dhcp6, &config); -+ grub_free (opt); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp6 configure failed, %d\n", (int)status); -+ continue; -+ } -+ status = efi_call_1 (dev->dhcp6->start, dev->dhcp6); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp6 start failed, %d\n", (int)status); -+ continue; -+ } -+ -+ status = efi_call_3 (dev->dhcp6->get_mode_data, dev->dhcp6, &mode, NULL); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("dhcp4 get mode failed, %d\n", (int)status); -+ continue; -+ } -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (inf->prefer_ip6 == 1) -+ break; -+ -+ grub_memcpy (net_ip.ip6.address, mode.ia->ia_address[0].ip_address, sizeof (net_ip.ip6.address)); -+ net_ip.ip6.prefix_length = 64; -+ net_ip.ip6.is_anycast = 0; -+ net_ip.is_ip6 = 1; -+ -+ if (!inf) -+ { -+ char *name = grub_xasprintf ("%s:dhcp", dev->card_name); -+ -+ inf = grub_efi_net_create_interface (dev, -+ name, -+ &net_ip, -+ 1); -+ grub_free (name); -+ } -+ else -+ { -+ efi_net_interface_set_address (inf, &net_ip, 1); -+ } -+ -+ { -+ grub_efi_uint32_t count = 0; -+ grub_efi_dhcp6_packet_option_t **options = NULL; -+ grub_efi_uint32_t i; -+ -+ status = efi_call_4 (dev->dhcp6->parse, dev->dhcp6, mode.ia->reply_packet, &count, NULL); -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL && count) -+ { -+ options = grub_malloc (count * sizeof(*options)); -+ status = efi_call_4 (dev->dhcp6->parse, dev->dhcp6, mode.ia->reply_packet, &count, options); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ if (options) -+ grub_free (options); -+ continue; -+ } -+ -+ for (i = 0; i < count; ++i) -+ { -+ if (options[i]->op_code == grub_cpu_to_be16_compile_time(GRUB_EFI_DHCP6_OPT_DNS_SERVERS)) -+ { -+ grub_efi_net_ip_address_t dns; -+ grub_memcpy (dns.ip6, options[i]->data, sizeof(net_ip.ip6)); -+ efi_net_interface_set_dns (inf, &dns); -+ break; -+ } -+ } -+ -+ if (options) -+ grub_free (options); -+ } -+ -+ efi_call_1 (b->free_pool, mode.client_id); -+ efi_call_1 (b->free_pool, mode.ia); -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ -+grub_command_func_t grub_efi_net_bootp = grub_cmd_efi_bootp; -+grub_command_func_t grub_efi_net_bootp6 = grub_cmd_efi_bootp6; -diff --git a/grub-core/net/efi/efi_netfs.c b/grub-core/net/efi/efi_netfs.c -new file mode 100644 -index 00000000000..ef371d885ea ---- /dev/null -+++ b/grub-core/net/efi/efi_netfs.c -@@ -0,0 +1,57 @@ -+#include -+#include -+#define EFI_NET_CMD_PREFIX "net_efi" -+#include -+ -+GRUB_MOD_LICENSE ("GPLv3+"); -+ -+static grub_command_t cmd_efi_lsroutes; -+static grub_command_t cmd_efi_lscards; -+static grub_command_t cmd_efi_lsaddrs; -+static grub_command_t cmd_efi_addaddr; -+static grub_command_t cmd_efi_bootp; -+static grub_command_t cmd_efi_bootp6; -+ -+static int initialized; -+ -+GRUB_MOD_INIT(efi_netfs) -+{ -+ if (grub_net_open) -+ return; -+ -+ if (grub_efi_net_fs_init ()) -+ { -+ cmd_efi_lsroutes = grub_register_command ("net_efi_ls_routes", grub_efi_net_list_routes, -+ "", N_("list network routes")); -+ cmd_efi_lscards = grub_register_command ("net_efi_ls_cards", grub_efi_net_list_cards, -+ "", N_("list network cards")); -+ cmd_efi_lsaddrs = grub_register_command ("net_efi_ls_addr", grub_efi_net_list_addrs, -+ "", N_("list network addresses")); -+ cmd_efi_addaddr = grub_register_command ("net_efi_add_addr", grub_efi_net_add_addr, -+ N_("SHORTNAME CARD ADDRESS [HWADDRESS]"), -+ N_("Add a network address.")); -+ cmd_efi_bootp = grub_register_command ("net_efi_bootp", grub_efi_net_bootp, -+ N_("[CARD]"), -+ N_("perform a bootp autoconfiguration")); -+ cmd_efi_bootp6 = grub_register_command ("net_efi_bootp6", grub_efi_net_bootp6, -+ N_("[CARD]"), -+ N_("perform a bootp autoconfiguration")); -+ initialized = 1; -+ } -+} -+ -+GRUB_MOD_FINI(efi_netfs) -+{ -+ if (initialized) -+ { -+ grub_unregister_command (cmd_efi_lsroutes); -+ grub_unregister_command (cmd_efi_lscards); -+ grub_unregister_command (cmd_efi_lsaddrs); -+ grub_unregister_command (cmd_efi_addaddr); -+ grub_unregister_command (cmd_efi_bootp); -+ grub_unregister_command (cmd_efi_bootp6); -+ grub_efi_net_fs_fini (); -+ initialized = 0; -+ return; -+ } -+} -diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -new file mode 100644 -index 00000000000..3f61fd2fa5b ---- /dev/null -+++ b/grub-core/net/efi/http.c -@@ -0,0 +1,419 @@ -+ -+#include -+#include -+#include -+#include -+#include -+ -+static void -+http_configure (struct grub_efi_net_device *dev, int prefer_ip6) -+{ -+ grub_efi_http_config_data_t http_config; -+ grub_efi_httpv4_access_point_t httpv4_node; -+ grub_efi_httpv6_access_point_t httpv6_node; -+ grub_efi_status_t status; -+ -+ grub_efi_http_t *http = dev->http; -+ -+ grub_memset (&http_config, 0, sizeof(http_config)); -+ http_config.http_version = GRUB_EFI_HTTPVERSION11; -+ http_config.timeout_millisec = 5000; -+ -+ if (prefer_ip6) -+ { -+ grub_efi_uintn_t sz; -+ grub_efi_ip6_config_manual_address_t manual_address; -+ -+ http_config.local_address_is_ipv6 = 1; -+ sz = sizeof (manual_address); -+ status = efi_call_4 (dev->ip6_config->get_data, dev->ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, -+ &sz, &manual_address); -+ -+ if (status == GRUB_EFI_NOT_FOUND) -+ { -+ grub_printf ("The MANUAL ADDRESS is not found\n"); -+ } -+ -+ /* FIXME: The manual interface would return BUFFER TOO SMALL !!! */ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_printf ("??? %d\n",(int) status); -+ return; -+ } -+ -+ grub_memcpy (httpv6_node.local_address, manual_address.address, sizeof (httpv6_node.local_address)); -+ httpv6_node.local_port = 0; -+ http_config.access_point.ipv6_node = &httpv6_node; -+ } -+ else -+ { -+ http_config.local_address_is_ipv6 = 0; -+ grub_memset (&httpv4_node, 0, sizeof(httpv4_node)); -+ httpv4_node.use_default_address = 1; -+ -+ /* Use random port here */ -+ /* See TcpBind() in edk2/NetworkPkg/TcpDxe/TcpDispatcher.c */ -+ httpv4_node.local_port = 0; -+ http_config.access_point.ipv4_node = &httpv4_node; -+ } -+ -+ status = efi_call_2 (http->configure, http, &http_config); -+ -+ if (status == GRUB_EFI_ALREADY_STARTED) -+ { -+ /* XXX: This hangs HTTPS boot */ -+#if 0 -+ if (efi_call_2 (http->configure, http, NULL) != GRUB_EFI_SUCCESS) -+ { -+ grub_error (GRUB_ERR_IO, N_("couldn't reset http instance")); -+ grub_print_error (); -+ return; -+ } -+ status = efi_call_2 (http->configure, http, &http_config); -+#endif -+ return; -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_error (GRUB_ERR_IO, N_("couldn't configure http protocol, reason: %d"), (int)status); -+ grub_print_error (); -+ return ; -+ } -+} -+ -+static grub_efi_boolean_t request_callback_done; -+static grub_efi_boolean_t response_callback_done; -+ -+static void -+grub_efi_http_request_callback (grub_efi_event_t event __attribute__ ((unused)), -+ void *context __attribute__ ((unused))) -+{ -+ request_callback_done = 1; -+} -+ -+static void -+grub_efi_http_response_callback (grub_efi_event_t event __attribute__ ((unused)), -+ void *context __attribute__ ((unused))) -+{ -+ response_callback_done = 1; -+} -+ -+static grub_err_t -+efihttp_request (grub_efi_http_t *http, char *server, char *name, int use_https, int headeronly, grub_off_t *file_size) -+{ -+ grub_efi_http_request_data_t request_data; -+ grub_efi_http_message_t request_message; -+ grub_efi_http_token_t request_token; -+ grub_efi_http_response_data_t response_data; -+ grub_efi_http_message_t response_message; -+ grub_efi_http_token_t response_token; -+ grub_efi_http_header_t request_headers[3]; -+ -+ grub_efi_status_t status; -+ grub_efi_boot_services_t *b = grub_efi_system_table->boot_services; -+ char *url = NULL; -+ -+ request_headers[0].field_name = (grub_efi_char8_t *)"Host"; -+ request_headers[0].field_value = (grub_efi_char8_t *)server; -+ request_headers[1].field_name = (grub_efi_char8_t *)"Accept"; -+ request_headers[1].field_value = (grub_efi_char8_t *)"*/*"; -+ request_headers[2].field_name = (grub_efi_char8_t *)"User-Agent"; -+ request_headers[2].field_value = (grub_efi_char8_t *)"UefiHttpBoot/1.0"; -+ -+ { -+ grub_efi_ipv6_address_t address; -+ const char *rest; -+ grub_efi_char16_t *ucs2_url; -+ grub_size_t url_len, ucs2_url_len; -+ const char *protocol = (use_https == 1) ? "https" : "http"; -+ -+ if (grub_efi_string_to_ip6_address (server, &address, &rest) && *rest == 0) -+ url = grub_xasprintf ("%s://[%s]%s", protocol, server, name); -+ else -+ url = grub_xasprintf ("%s://%s%s", protocol, server, name); -+ -+ if (!url) -+ { -+ return grub_errno; -+ } -+ -+ url_len = grub_strlen (url); -+ ucs2_url_len = url_len * GRUB_MAX_UTF16_PER_UTF8; -+ ucs2_url = grub_malloc ((ucs2_url_len + 1) * sizeof (ucs2_url[0])); -+ -+ if (!ucs2_url) -+ { -+ grub_free (url); -+ return grub_errno; -+ } -+ -+ ucs2_url_len = grub_utf8_to_utf16 (ucs2_url, ucs2_url_len, (grub_uint8_t *)url, url_len, NULL); /* convert string format from ascii to usc2 */ -+ ucs2_url[ucs2_url_len] = 0; -+ grub_free (url); -+ request_data.url = ucs2_url; -+ } -+ -+ request_data.method = (headeronly > 0) ? GRUB_EFI_HTTPMETHODHEAD : GRUB_EFI_HTTPMETHODGET; -+ -+ request_message.data.request = &request_data; -+ request_message.header_count = 3; -+ request_message.headers = request_headers; -+ request_message.body_length = 0; -+ request_message.body = NULL; -+ -+ /* request token */ -+ request_token.event = NULL; -+ request_token.status = GRUB_EFI_NOT_READY; -+ request_token.message = &request_message; -+ -+ request_callback_done = 0; -+ status = efi_call_5 (b->create_event, -+ GRUB_EFI_EVT_NOTIFY_SIGNAL, -+ GRUB_EFI_TPL_CALLBACK, -+ grub_efi_http_request_callback, -+ NULL, -+ &request_token.event); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (request_data.url); -+ return grub_error (GRUB_ERR_IO, "Fail to create an event! status=0x%x\n", status); -+ } -+ -+ status = efi_call_2 (http->request, http, &request_token); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ efi_call_1 (b->close_event, request_token.event); -+ grub_free (request_data.url); -+ return grub_error (GRUB_ERR_IO, "Fail to send a request! status=0x%x\n", status); -+ } -+ /* TODO: Add Timeout */ -+ while (!request_callback_done) -+ efi_call_1(http->poll, http); -+ -+ response_data.status_code = GRUB_EFI_HTTP_STATUS_UNSUPPORTED_STATUS; -+ response_message.data.response = &response_data; -+ /* herader_count will be updated by the HTTP driver on response */ -+ response_message.header_count = 0; -+ /* headers will be populated by the driver on response */ -+ response_message.headers = NULL; -+ /* use zero BodyLength to only receive the response headers */ -+ response_message.body_length = 0; -+ response_message.body = NULL; -+ response_token.event = NULL; -+ -+ status = efi_call_5 (b->create_event, -+ GRUB_EFI_EVT_NOTIFY_SIGNAL, -+ GRUB_EFI_TPL_CALLBACK, -+ grub_efi_http_response_callback, -+ NULL, -+ &response_token.event); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ efi_call_1 (b->close_event, request_token.event); -+ grub_free (request_data.url); -+ return grub_error (GRUB_ERR_IO, "Fail to create an event! status=0x%x\n", status); -+ } -+ -+ response_token.status = GRUB_EFI_SUCCESS; -+ response_token.message = &response_message; -+ -+ /* wait for HTTP response */ -+ response_callback_done = 0; -+ status = efi_call_2 (http->response, http, &response_token); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ efi_call_1 (b->close_event, response_token.event); -+ efi_call_1 (b->close_event, request_token.event); -+ grub_free (request_data.url); -+ return grub_error (GRUB_ERR_IO, "Fail to receive a response! status=%d\n", (int)status); -+ } -+ -+ /* TODO: Add Timeout */ -+ while (!response_callback_done) -+ efi_call_1 (http->poll, http); -+ -+ if (response_message.data.response->status_code != GRUB_EFI_HTTP_STATUS_200_OK) -+ { -+ grub_efi_http_status_code_t status_code = response_message.data.response->status_code; -+ -+ if (response_message.headers) -+ efi_call_1 (b->free_pool, response_message.headers); -+ efi_call_1 (b->close_event, response_token.event); -+ efi_call_1 (b->close_event, request_token.event); -+ grub_free (request_data.url); -+ if (status_code == GRUB_EFI_HTTP_STATUS_404_NOT_FOUND) -+ { -+ return grub_error (GRUB_ERR_FILE_NOT_FOUND, _("file `%s' not found"), name); -+ } -+ else -+ { -+ return grub_error (GRUB_ERR_NET_UNKNOWN_ERROR, -+ _("unsupported uefi http status code 0x%x"), status_code); -+ } -+ } -+ -+ if (file_size) -+ { -+ int i; -+ /* parse the length of the file from the ContentLength header */ -+ for (*file_size = 0, i = 0; i < (int)response_message.header_count; ++i) -+ { -+ if (!grub_strcmp((const char*)response_message.headers[i].field_name, "Content-Length")) -+ { -+ *file_size = grub_strtoul((const char*)response_message.headers[i].field_value, 0, 10); -+ break; -+ } -+ } -+ } -+ -+ if (response_message.headers) -+ efi_call_1 (b->free_pool, response_message.headers); -+ efi_call_1 (b->close_event, response_token.event); -+ efi_call_1 (b->close_event, request_token.event); -+ grub_free (request_data.url); -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_ssize_t -+efihttp_read (struct grub_efi_net_device *dev, -+ char *buf, -+ grub_size_t len) -+{ -+ grub_efi_http_message_t response_message; -+ grub_efi_http_token_t response_token; -+ -+ grub_efi_status_t status; -+ grub_size_t sum = 0; -+ grub_efi_boot_services_t *b = grub_efi_system_table->boot_services; -+ grub_efi_http_t *http = dev->http; -+ -+ if (!len) -+ { -+ grub_error (GRUB_ERR_BUG, "Invalid arguments to EFI HTTP Read"); -+ return -1; -+ } -+ -+ efi_call_5 (b->create_event, -+ GRUB_EFI_EVT_NOTIFY_SIGNAL, -+ GRUB_EFI_TPL_CALLBACK, -+ grub_efi_http_response_callback, -+ NULL, -+ &response_token.event); -+ -+ while (len) -+ { -+ response_message.data.response = NULL; -+ response_message.header_count = 0; -+ response_message.headers = NULL; -+ response_message.body_length = len; -+ response_message.body = buf; -+ -+ response_token.message = &response_message; -+ response_token.status = GRUB_EFI_NOT_READY; -+ -+ response_callback_done = 0; -+ -+ status = efi_call_2 (http->response, http, &response_token); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ efi_call_1 (b->close_event, response_token.event); -+ grub_error (GRUB_ERR_IO, "Error! status=%d\n", (int)status); -+ return -1; -+ } -+ -+ while (!response_callback_done) -+ efi_call_1(http->poll, http); -+ -+ sum += response_message.body_length; -+ buf += response_message.body_length; -+ len -= response_message.body_length; -+ } -+ -+ efi_call_1 (b->close_event, response_token.event); -+ -+ return sum; -+} -+ -+static grub_err_t -+grub_efihttp_open (struct grub_efi_net_device *dev, -+ int prefer_ip6 __attribute__ ((unused)), -+ grub_file_t file, -+ const char *filename __attribute__ ((unused)), -+ int type) -+{ -+ grub_err_t err; -+ grub_off_t size; -+ char *buf; -+ -+ err = efihttp_request (dev->http, file->device->net->server, file->device->net->name, type, 1, 0); -+ if (err != GRUB_ERR_NONE) -+ return err; -+ -+ err = efihttp_request (dev->http, file->device->net->server, file->device->net->name, type, 0, &size); -+ if (err != GRUB_ERR_NONE) -+ return err; -+ -+ buf = grub_malloc (size); -+ efihttp_read (dev, buf, size); -+ -+ file->size = size; -+ file->data = buf; -+ file->not_easily_seekable = 0; -+ file->device->net->offset = 0; -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+grub_efihttp_close (struct grub_efi_net_device *dev __attribute__ ((unused)), -+ int prefer_ip6 __attribute__ ((unused)), -+ grub_file_t file) -+{ -+ if (file->data) -+ grub_free (file->data); -+ -+ file->data = 0; -+ file->offset = 0; -+ file->size = 0; -+ file->device->net->offset = 0; -+ return GRUB_ERR_NONE; -+} -+ -+static grub_ssize_t -+grub_efihttp_read (struct grub_efi_net_device *dev __attribute__((unused)), -+ int prefer_ip6 __attribute__((unused)), -+ grub_file_t file, -+ char *buf, -+ grub_size_t len) -+{ -+ grub_size_t r = len; -+ -+ if (!file->data || !buf || !len) -+ return 0; -+ -+ if ((file->device->net->offset + len) > file->size) -+ r = file->size - file->device->net->offset; -+ -+ if (r) -+ { -+ grub_memcpy (buf, (char *)file->data + file->device->net->offset, r); -+ file->device->net->offset += r; -+ } -+ -+ return r; -+} -+ -+struct grub_efi_net_io io_http = -+ { -+ .configure = http_configure, -+ .open = grub_efihttp_open, -+ .read = grub_efihttp_read, -+ .close = grub_efihttp_close -+ }; -diff --git a/grub-core/net/efi/ip4_config.c b/grub-core/net/efi/ip4_config.c -new file mode 100644 -index 00000000000..b711a5d9457 ---- /dev/null -+++ b/grub-core/net/efi/ip4_config.c -@@ -0,0 +1,398 @@ -+ -+#include -+#include -+#include -+#include -+#include -+ -+char * -+grub_efi_hw_address_to_string (grub_efi_uint32_t hw_address_size, grub_efi_mac_address_t hw_address) -+{ -+ char *hw_addr, *p; -+ int sz, s; -+ int i; -+ -+ sz = (int)hw_address_size * (sizeof ("XX:") - 1) + 1; -+ -+ hw_addr = grub_malloc (sz); -+ if (!hw_addr) -+ return NULL; -+ -+ p = hw_addr; -+ s = sz; -+ for (i = 0; i < (int)hw_address_size; i++) -+ { -+ grub_snprintf (p, sz, "%02x:", hw_address[i]); -+ p += sizeof ("XX:") - 1; -+ s -= sizeof ("XX:") - 1; -+ } -+ -+ hw_addr[sz - 2] = '\0'; -+ return hw_addr; -+} -+ -+char * -+grub_efi_ip4_address_to_string (grub_efi_ipv4_address_t *address) -+{ -+ char *addr; -+ -+ addr = grub_malloc (sizeof ("XXX.XXX.XXX.XXX")); -+ if (!addr) -+ return NULL; -+ -+ /* FIXME: Use grub_xasprintf ? */ -+ grub_snprintf (addr, -+ sizeof ("XXX.XXX.XXX.XXX"), -+ "%u.%u.%u.%u", -+ (*address)[0], -+ (*address)[1], -+ (*address)[2], -+ (*address)[3]); -+ -+ return addr; -+} -+ -+int -+grub_efi_string_to_ip4_address (const char *val, grub_efi_ipv4_address_t *address, const char **rest) -+{ -+ grub_uint32_t newip = 0; -+ int i; -+ const char *ptr = val; -+ -+ for (i = 0; i < 4; i++) -+ { -+ unsigned long t; -+ t = grub_strtoul (ptr, (char **) &ptr, 0); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (*ptr != '.' && i == 0) -+ { -+ /* XXX: t is in host byte order */ -+ newip = t; -+ break; -+ } -+ if (t & ~0xff) -+ return 0; -+ newip <<= 8; -+ newip |= t; -+ if (i != 3 && *ptr != '.') -+ return 0; -+ ptr++; -+ } -+ -+ newip = grub_cpu_to_be32 (newip); -+ -+ grub_memcpy (address, &newip, sizeof(*address)); -+ -+ if (rest) -+ *rest = (ptr - 1); -+ return 1; -+} -+ -+static grub_efi_ip4_config2_interface_info_t * -+efi_ip4_config_interface_info (grub_efi_ip4_config2_protocol_t *ip4_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip4_config2_interface_info_t *interface_info; -+ -+ sz = sizeof (*interface_info) + sizeof (*interface_info->route_table); -+ interface_info = grub_malloc (sz); -+ if (!interface_info) -+ return NULL; -+ -+ status = efi_call_4 (ip4_config->get_data, ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO, -+ &sz, interface_info); -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL) -+ { -+ grub_free (interface_info); -+ interface_info = grub_malloc (sz); -+ status = efi_call_4 (ip4_config->get_data, ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO, -+ &sz, interface_info); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (interface_info); -+ return NULL; -+ } -+ -+ return interface_info; -+} -+ -+static grub_efi_ip4_config2_manual_address_t * -+efi_ip4_config_manual_address (grub_efi_ip4_config2_protocol_t *ip4_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip4_config2_manual_address_t *manual_address; -+ -+ sz = sizeof (*manual_address); -+ manual_address = grub_malloc (sz); -+ if (!manual_address) -+ return NULL; -+ -+ status = efi_call_4 (ip4_config->get_data, ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS, -+ &sz, manual_address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (manual_address); -+ return NULL; -+ } -+ -+ return manual_address; -+} -+ -+char * -+grub_efi_ip4_interface_name (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip4_config2_interface_info_t *interface_info; -+ char *name; -+ -+ interface_info = efi_ip4_config_interface_info (dev->ip4_config); -+ -+ if (!interface_info) -+ return NULL; -+ -+ name = grub_malloc (GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE -+ * GRUB_MAX_UTF8_PER_UTF16 + 1); -+ *grub_utf16_to_utf8 ((grub_uint8_t *)name, interface_info->name, -+ GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE) = 0; -+ grub_free (interface_info); -+ return name; -+} -+ -+static char * -+grub_efi_ip4_interface_hw_address (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip4_config2_interface_info_t *interface_info; -+ char *hw_addr; -+ -+ interface_info = efi_ip4_config_interface_info (dev->ip4_config); -+ -+ if (!interface_info) -+ return NULL; -+ -+ hw_addr = grub_efi_hw_address_to_string (interface_info->hw_address_size, interface_info->hw_address); -+ grub_free (interface_info); -+ -+ return hw_addr; -+} -+ -+static char * -+grub_efi_ip4_interface_address (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip4_config2_manual_address_t *manual_address; -+ char *addr; -+ -+ manual_address = efi_ip4_config_manual_address (dev->ip4_config); -+ -+ if (!manual_address) -+ return NULL; -+ -+ addr = grub_efi_ip4_address_to_string (&manual_address->address); -+ grub_free (manual_address); -+ return addr; -+} -+ -+ -+static int -+address_mask_size (grub_efi_ipv4_address_t *address) -+{ -+ grub_uint8_t i; -+ grub_uint32_t u32_addr = grub_be_to_cpu32 (grub_get_unaligned32 (address)); -+ -+ if (u32_addr == 0) -+ return 0; -+ -+ for (i = 0; i < 32 ; ++i) -+ { -+ if (u32_addr == ((0xffffffff >> i) << i)) -+ return (32 - i); -+ } -+ -+ return -1; -+} -+ -+static char ** -+grub_efi_ip4_interface_route_table (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip4_config2_interface_info_t *interface_info; -+ char **ret; -+ int i, id; -+ -+ interface_info = efi_ip4_config_interface_info (dev->ip4_config); -+ if (!interface_info) -+ return NULL; -+ -+ ret = grub_malloc (sizeof (*ret) * (interface_info->route_table_size + 1)); -+ -+ if (!ret) -+ { -+ grub_free (interface_info); -+ return NULL; -+ } -+ -+ id = 0; -+ for (i = 0; i < (int)interface_info->route_table_size; i++) -+ { -+ char *subnet, *gateway, *mask; -+ grub_uint32_t u32_subnet, u32_gateway; -+ int mask_size; -+ grub_efi_ip4_route_table_t *route_table = interface_info->route_table + i; -+ grub_efi_net_interface_t *inf; -+ char *interface_name = NULL; -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (!inf->prefer_ip6) -+ interface_name = inf->name; -+ -+ u32_gateway = grub_get_unaligned32 (&route_table->gateway_address); -+ gateway = grub_efi_ip4_address_to_string (&route_table->gateway_address); -+ u32_subnet = grub_get_unaligned32 (&route_table->subnet_address); -+ subnet = grub_efi_ip4_address_to_string (&route_table->subnet_address); -+ mask_size = address_mask_size (&route_table->subnet_mask); -+ mask = grub_efi_ip4_address_to_string (&route_table->subnet_mask); -+ if (u32_subnet && !u32_gateway && interface_name) -+ ret[id++] = grub_xasprintf ("%s:local %s/%d %s", dev->card_name, subnet, mask_size, interface_name); -+ else if (u32_subnet && u32_gateway) -+ ret[id++] = grub_xasprintf ("%s:gw %s/%d gw %s", dev->card_name, subnet, mask_size, gateway); -+ else if (!u32_subnet && u32_gateway) -+ ret[id++] = grub_xasprintf ("%s:default %s/%d gw %s", dev->card_name, subnet, mask_size, gateway); -+ grub_free (subnet); -+ grub_free (gateway); -+ grub_free (mask); -+ } -+ -+ ret[id] = NULL; -+ grub_free (interface_info); -+ return ret; -+} -+ -+static grub_efi_net_interface_t * -+grub_efi_ip4_interface_match (struct grub_efi_net_device *dev, grub_efi_net_ip_address_t *ip_address) -+{ -+ grub_efi_ip4_config2_interface_info_t *interface_info; -+ grub_efi_net_interface_t *inf; -+ int i; -+ grub_efi_ipv4_address_t *address = &ip_address->ip4; -+ -+ interface_info = efi_ip4_config_interface_info (dev->ip4_config); -+ if (!interface_info) -+ return NULL; -+ -+ for (i = 0; i < (int)interface_info->route_table_size; i++) -+ { -+ grub_efi_ip4_route_table_t *route_table = interface_info->route_table + i; -+ grub_uint32_t u32_address, u32_mask, u32_subnet; -+ -+ u32_address = grub_get_unaligned32 (address); -+ u32_subnet = grub_get_unaligned32 (route_table->subnet_address); -+ u32_mask = grub_get_unaligned32 (route_table->subnet_mask); -+ -+ /* SKIP Default GATEWAY */ -+ if (!u32_subnet && !u32_mask) -+ continue; -+ -+ if ((u32_address & u32_mask) == u32_subnet) -+ { -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (!inf->prefer_ip6) -+ { -+ grub_free (interface_info); -+ return inf; -+ } -+ } -+ } -+ -+ grub_free (interface_info); -+ return NULL; -+} -+ -+static int -+grub_efi_ip4_interface_set_manual_address (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_manual_address_t *net_ip, -+ int with_subnet) -+{ -+ grub_efi_status_t status; -+ grub_efi_ip4_config2_manual_address_t *address = &net_ip->ip4; -+ -+ if (!with_subnet) -+ { -+ grub_efi_ip4_config2_manual_address_t *manual_address = -+ efi_ip4_config_manual_address (dev->ip4_config); -+ -+ if (manual_address) -+ { -+ grub_memcpy (address->subnet_mask, manual_address->subnet_mask, sizeof(address->subnet_mask)); -+ grub_free (manual_address); -+ } -+ else -+ { -+ /* XXX: */ -+ address->subnet_mask[0] = 0xff; -+ address->subnet_mask[1] = 0xff; -+ address->subnet_mask[2] = 0xff; -+ address->subnet_mask[3] = 0; -+ } -+ } -+ -+ status = efi_call_4 (dev->ip4_config->set_data, dev->ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS, -+ sizeof(*address), address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ -+ return 1; -+} -+ -+static int -+grub_efi_ip4_interface_set_gateway (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_address_t *address) -+{ -+ grub_efi_status_t status; -+ -+ status = efi_call_4 (dev->ip4_config->set_data, dev->ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_GATEWAY, -+ sizeof (address->ip4), &address->ip4); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ return 1; -+} -+ -+/* FIXME: Multiple DNS */ -+static int -+grub_efi_ip4_interface_set_dns (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_address_t *address) -+{ -+ grub_efi_status_t status; -+ -+ status = efi_call_4 (dev->ip4_config->set_data, dev->ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER, -+ sizeof (address->ip4), &address->ip4); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ return 1; -+} -+ -+grub_efi_net_ip_config_t *efi_net_ip4_config = &(grub_efi_net_ip_config_t) -+ { -+ .get_hw_address = grub_efi_ip4_interface_hw_address, -+ .get_address = grub_efi_ip4_interface_address, -+ .get_route_table = grub_efi_ip4_interface_route_table, -+ .best_interface = grub_efi_ip4_interface_match, -+ .set_address = grub_efi_ip4_interface_set_manual_address, -+ .set_gateway = grub_efi_ip4_interface_set_gateway, -+ .set_dns = grub_efi_ip4_interface_set_dns -+ }; -diff --git a/grub-core/net/efi/ip6_config.c b/grub-core/net/efi/ip6_config.c -new file mode 100644 -index 00000000000..017c4d05bc7 ---- /dev/null -+++ b/grub-core/net/efi/ip6_config.c -@@ -0,0 +1,422 @@ -+#include -+#include -+#include -+#include -+#include -+ -+char * -+grub_efi_ip6_address_to_string (grub_efi_pxe_ipv6_address_t *address) -+{ -+ char *str = grub_malloc (sizeof ("XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX")); -+ char *p; -+ int i; -+ int squash; -+ -+ if (!str) -+ return NULL; -+ -+ p = str; -+ squash = 0; -+ for (i = 0; i < 8; ++i) -+ { -+ grub_uint16_t addr; -+ -+ if (i == 7) -+ squash = 2; -+ -+ addr = grub_get_unaligned16 (address->addr + i * 2); -+ -+ if (grub_be_to_cpu16 (addr)) -+ { -+ char buf[sizeof ("XXXX")]; -+ if (i > 0) -+ *p++ = ':'; -+ grub_snprintf (buf, sizeof (buf), "%x", grub_be_to_cpu16 (addr)); -+ grub_strcpy (p, buf); -+ p += grub_strlen (buf); -+ -+ if (squash == 1) -+ squash = 2; -+ } -+ else -+ { -+ if (squash == 0) -+ { -+ *p++ = ':'; -+ squash = 1; -+ } -+ else if (squash == 2) -+ { -+ *p++ = ':'; -+ *p++ = '0'; -+ } -+ } -+ } -+ *p = '\0'; -+ return str; -+} -+ -+int -+grub_efi_string_to_ip6_address (const char *val, grub_efi_ipv6_address_t *address, const char **rest) -+{ -+ grub_uint16_t newip[8]; -+ const char *ptr = val; -+ int word, quaddot = -1; -+ int bracketed = 0; -+ -+ if (ptr[0] == '[') { -+ bracketed = 1; -+ ptr++; -+ } -+ -+ if (ptr[0] == ':' && ptr[1] != ':') -+ return 0; -+ if (ptr[0] == ':') -+ ptr++; -+ -+ for (word = 0; word < 8; word++) -+ { -+ unsigned long t; -+ if (*ptr == ':') -+ { -+ quaddot = word; -+ word--; -+ ptr++; -+ continue; -+ } -+ t = grub_strtoul (ptr, (char **) &ptr, 16); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ break; -+ } -+ if (t & ~0xffff) -+ return 0; -+ newip[word] = grub_cpu_to_be16 (t); -+ if (*ptr != ':') -+ break; -+ ptr++; -+ } -+ if (quaddot == -1 && word < 7) -+ return 0; -+ if (quaddot != -1) -+ { -+ grub_memmove (&newip[quaddot + 7 - word], &newip[quaddot], -+ (word - quaddot + 1) * sizeof (newip[0])); -+ grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); -+ } -+ grub_memcpy (address, newip, 16); -+ if (bracketed && *ptr == ']') { -+ ptr++; -+ } -+ if (rest) -+ *rest = ptr; -+ return 1; -+} -+ -+static grub_efi_ip6_config_interface_info_t * -+efi_ip6_config_interface_info (grub_efi_ip6_config_protocol_t *ip6_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip6_config_interface_info_t *interface_info; -+ -+ sz = sizeof (*interface_info) + sizeof (*interface_info->route_table); -+ interface_info = grub_malloc (sz); -+ -+ status = efi_call_4 (ip6_config->get_data, ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, -+ &sz, interface_info); -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL) -+ { -+ grub_free (interface_info); -+ interface_info = grub_malloc (sz); -+ status = efi_call_4 (ip6_config->get_data, ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, -+ &sz, interface_info); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (interface_info); -+ return NULL; -+ } -+ -+ return interface_info; -+} -+ -+static grub_efi_ip6_config_manual_address_t * -+efi_ip6_config_manual_address (grub_efi_ip6_config_protocol_t *ip6_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip6_config_manual_address_t *manual_address; -+ -+ sz = sizeof (*manual_address); -+ manual_address = grub_malloc (sz); -+ if (!manual_address) -+ return NULL; -+ -+ status = efi_call_4 (ip6_config->get_data, ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, -+ &sz, manual_address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (manual_address); -+ return NULL; -+ } -+ -+ return manual_address; -+} -+ -+char * -+grub_efi_ip6_interface_name (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip6_config_interface_info_t *interface_info; -+ char *name; -+ -+ interface_info = efi_ip6_config_interface_info (dev->ip6_config); -+ -+ if (!interface_info) -+ return NULL; -+ -+ name = grub_malloc (GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE -+ * GRUB_MAX_UTF8_PER_UTF16 + 1); -+ *grub_utf16_to_utf8 ((grub_uint8_t *)name, interface_info->name, -+ GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE) = 0; -+ grub_free (interface_info); -+ return name; -+} -+ -+static char * -+grub_efi_ip6_interface_hw_address (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip6_config_interface_info_t *interface_info; -+ char *hw_addr; -+ -+ interface_info = efi_ip6_config_interface_info (dev->ip6_config); -+ -+ if (!interface_info) -+ return NULL; -+ -+ hw_addr = grub_efi_hw_address_to_string (interface_info->hw_address_size, interface_info->hw_address); -+ grub_free (interface_info); -+ -+ return hw_addr; -+} -+ -+static char * -+grub_efi_ip6_interface_address (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip6_config_manual_address_t *manual_address; -+ char *addr; -+ -+ manual_address = efi_ip6_config_manual_address (dev->ip6_config); -+ -+ if (!manual_address) -+ return NULL; -+ -+ addr = grub_efi_ip6_address_to_string ((grub_efi_pxe_ipv6_address_t *)&manual_address->address); -+ grub_free (manual_address); -+ return addr; -+} -+ -+static char ** -+grub_efi_ip6_interface_route_table (struct grub_efi_net_device *dev) -+{ -+ grub_efi_ip6_config_interface_info_t *interface_info; -+ char **ret; -+ int i, id; -+ -+ interface_info = efi_ip6_config_interface_info (dev->ip6_config); -+ if (!interface_info) -+ return NULL; -+ -+ ret = grub_malloc (sizeof (*ret) * (interface_info->route_count + 1)); -+ -+ if (!ret) -+ { -+ grub_free (interface_info); -+ return NULL; -+ } -+ -+ id = 0; -+ for (i = 0; i < (int)interface_info->route_count ; i++) -+ { -+ char *gateway, *destination; -+ grub_uint64_t u64_gateway[2]; -+ grub_uint64_t u64_destination[2]; -+ grub_efi_ip6_route_table_t *route_table = interface_info->route_table + i; -+ grub_efi_net_interface_t *inf; -+ char *interface_name = NULL; -+ -+ gateway = grub_efi_ip6_address_to_string (&route_table->gateway); -+ destination = grub_efi_ip6_address_to_string (&route_table->destination); -+ -+ u64_gateway[0] = grub_get_unaligned64 (route_table->gateway.addr); -+ u64_gateway[1] = grub_get_unaligned64 (route_table->gateway.addr + 8); -+ u64_destination[0] = grub_get_unaligned64 (route_table->destination.addr); -+ u64_destination[1] = grub_get_unaligned64 (route_table->destination.addr + 8); -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (inf->prefer_ip6) -+ interface_name = inf->name; -+ -+ if ((!u64_gateway[0] && !u64_gateway[1]) -+ && (u64_destination[0] || u64_destination[1])) -+ { -+ if (interface_name) -+ { -+ if ((grub_be_to_cpu64 (u64_destination[0]) == 0xfe80000000000000ULL) -+ && (!u64_destination[1]) -+ && (route_table->prefix_length == 64)) -+ ret[id++] = grub_xasprintf ("%s:link %s/%d %s", dev->card_name, destination, route_table->prefix_length, interface_name); -+ else -+ ret[id++] = grub_xasprintf ("%s:local %s/%d %s", dev->card_name, destination, route_table->prefix_length, interface_name); -+ } -+ } -+ else if ((u64_gateway[0] || u64_gateway[1]) -+ && (u64_destination[0] || u64_destination[1])) -+ ret[id++] = grub_xasprintf ("%s:gw %s/%d gw %s", dev->card_name, destination, route_table->prefix_length, gateway); -+ else if ((u64_gateway[0] || u64_gateway[1]) -+ && (!u64_destination[0] && !u64_destination[1])) -+ ret[id++] = grub_xasprintf ("%s:default %s/%d gw %s", dev->card_name, destination, route_table->prefix_length, gateway); -+ -+ grub_free (gateway); -+ grub_free (destination); -+ } -+ -+ ret[id] = NULL; -+ grub_free (interface_info); -+ return ret; -+} -+ -+static grub_efi_net_interface_t * -+grub_efi_ip6_interface_match (struct grub_efi_net_device *dev, grub_efi_net_ip_address_t *ip_address) -+{ -+ grub_efi_ip6_config_interface_info_t *interface_info; -+ grub_efi_net_interface_t *inf; -+ int i; -+ grub_efi_ipv6_address_t *address = &ip_address->ip6; -+ -+ interface_info = efi_ip6_config_interface_info (dev->ip6_config); -+ if (!interface_info) -+ return NULL; -+ -+ for (i = 0; i < (int)interface_info->route_count ; i++) -+ { -+ grub_uint64_t u64_addr[2]; -+ grub_uint64_t u64_subnet[2]; -+ grub_uint64_t u64_mask[2]; -+ -+ grub_efi_ip6_route_table_t *route_table = interface_info->route_table + i; -+ -+ /* SKIP Default GATEWAY */ -+ if (route_table->prefix_length == 0) -+ continue; -+ -+ u64_addr[0] = grub_get_unaligned64 (address); -+ u64_addr[1] = grub_get_unaligned64 (address + 4); -+ u64_subnet[0] = grub_get_unaligned64 (route_table->destination.addr); -+ u64_subnet[1] = grub_get_unaligned64 (route_table->destination.addr + 8); -+ u64_mask[0] = (route_table->prefix_length <= 64) ? -+ 0xffffffffffffffffULL << (64 - route_table->prefix_length) : -+ 0xffffffffffffffffULL; -+ u64_mask[1] = (route_table->prefix_length <= 64) ? -+ 0 : -+ 0xffffffffffffffffULL << (128 - route_table->prefix_length); -+ -+ if (((u64_addr[0] & u64_mask[0]) == u64_subnet[0]) -+ && ((u64_addr[1] & u64_mask[1]) == u64_subnet[1])) -+ { -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (inf->prefer_ip6) -+ { -+ grub_free (interface_info); -+ return inf; -+ } -+ } -+ } -+ -+ grub_free (interface_info); -+ return NULL; -+} -+ -+static int -+grub_efi_ip6_interface_set_manual_address (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_manual_address_t *net_ip, -+ int with_subnet) -+{ -+ grub_efi_status_t status; -+ grub_efi_ip6_config_manual_address_t *address = &net_ip->ip6; -+ -+ if (!with_subnet) -+ { -+ grub_efi_ip6_config_manual_address_t *manual_address = -+ efi_ip6_config_manual_address (dev->ip6_config); -+ -+ if (manual_address) -+ { -+ address->prefix_length = manual_address->prefix_length; -+ grub_free (manual_address); -+ } -+ else -+ { -+ /* XXX: */ -+ address->prefix_length = 64; -+ } -+ } -+ -+ status = efi_call_4 (dev->ip6_config->set_data, dev->ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, -+ sizeof(*address), address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ -+ return 1; -+} -+ -+static int -+grub_efi_ip6_interface_set_gateway (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_address_t *address) -+{ -+ grub_efi_status_t status; -+ -+ status = efi_call_4 (dev->ip6_config->set_data, dev->ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_GATEWAY, -+ sizeof (address->ip6), &address->ip6); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ return 1; -+} -+ -+static int -+grub_efi_ip6_interface_set_dns (struct grub_efi_net_device *dev, -+ grub_efi_net_ip_address_t *address) -+{ -+ -+ grub_efi_status_t status; -+ -+ status = efi_call_4 (dev->ip6_config->set_data, dev->ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_DNSSERVER, -+ sizeof (address->ip6), &address->ip6); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ return 1; -+} -+ -+grub_efi_net_ip_config_t *efi_net_ip6_config = &(grub_efi_net_ip_config_t) -+ { -+ .get_hw_address = grub_efi_ip6_interface_hw_address, -+ .get_address = grub_efi_ip6_interface_address, -+ .get_route_table = grub_efi_ip6_interface_route_table, -+ .best_interface = grub_efi_ip6_interface_match, -+ .set_address = grub_efi_ip6_interface_set_manual_address, -+ .set_gateway = grub_efi_ip6_interface_set_gateway, -+ .set_dns = grub_efi_ip6_interface_set_dns -+ }; -diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -new file mode 100644 -index 00000000000..9e0078ac1c6 ---- /dev/null -+++ b/grub-core/net/efi/net.c -@@ -0,0 +1,1428 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+GRUB_MOD_LICENSE ("GPLv3+"); -+ -+#define GRUB_EFI_IP6_PREFIX_LENGTH 64 -+ -+static grub_efi_guid_t ip4_config_guid = GRUB_EFI_IP4_CONFIG2_PROTOCOL_GUID; -+static grub_efi_guid_t ip6_config_guid = GRUB_EFI_IP6_CONFIG_PROTOCOL_GUID; -+static grub_efi_guid_t http_service_binding_guid = GRUB_EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID; -+static grub_efi_guid_t http_guid = GRUB_EFI_HTTP_PROTOCOL_GUID; -+static grub_efi_guid_t pxe_io_guid = GRUB_EFI_PXE_GUID; -+static grub_efi_guid_t dhcp4_service_binding_guid = GRUB_EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID; -+static grub_efi_guid_t dhcp4_guid = GRUB_EFI_DHCP4_PROTOCOL_GUID; -+static grub_efi_guid_t dhcp6_service_binding_guid = GRUB_EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID; -+static grub_efi_guid_t dhcp6_guid = GRUB_EFI_DHCP6_PROTOCOL_GUID; -+ -+struct grub_efi_net_device *net_devices; -+ -+static char *default_server; -+static grub_efi_net_interface_t *net_interface; -+static grub_efi_net_interface_t *net_default_interface; -+ -+#define efi_net_interface_configure(inf) inf->io->configure (inf->dev, inf->prefer_ip6) -+#define efi_net_interface_open(inf, file, name) inf->io->open (inf->dev, inf->prefer_ip6, file, name, inf->io_type) -+#define efi_net_interface_read(inf, file, buf, sz) inf->io->read (inf->dev, inf->prefer_ip6, file, buf, sz) -+#define efi_net_interface_close(inf, file) inf->io->close (inf->dev, inf->prefer_ip6, file) -+#define efi_net_interface(m,...) efi_net_interface_ ## m (net_interface, ## __VA_ARGS__) -+ -+static grub_efi_handle_t -+grub_efi_locate_device_path (grub_efi_guid_t *protocol, grub_efi_device_path_t *device_path, -+ grub_efi_device_path_t **r_device_path) -+{ -+ grub_efi_handle_t handle; -+ grub_efi_status_t status; -+ -+ status = efi_call_3 (grub_efi_system_table->boot_services->locate_device_path, -+ protocol, &device_path, &handle); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return 0; -+ -+ if (r_device_path) -+ *r_device_path = device_path; -+ -+ return handle; -+} -+ -+static int -+url_parse_fields (const char *url, char **proto, char **host, char **path) -+{ -+ const char *p, *ps; -+ grub_size_t l; -+ -+ *proto = *host = *path = NULL; -+ ps = p = url; -+ -+ while ((p = grub_strchr (p, ':'))) -+ { -+ if (grub_strlen (p) < sizeof ("://") - 1) -+ break; -+ if (grub_memcmp (p, "://", sizeof ("://") - 1) == 0) -+ { -+ l = p - ps; -+ *proto = grub_malloc (l + 1); -+ if (!*proto) -+ { -+ grub_print_error (); -+ return 0; -+ } -+ -+ grub_memcpy (*proto, ps, l); -+ (*proto)[l] = '\0'; -+ p += sizeof ("://") - 1; -+ break; -+ } -+ ++p; -+ } -+ -+ if (!*proto) -+ { -+ grub_dprintf ("bootp", "url: %s is not valid, protocol not found\n", url); -+ return 0; -+ } -+ -+ ps = p; -+ p = grub_strchr (p, '/'); -+ -+ if (!p) -+ { -+ grub_dprintf ("bootp", "url: %s is not valid, host/path not found\n", url); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ -+ l = p - ps; -+ -+ if (l > 2 && ps[0] == '[' && ps[l - 1] == ']') -+ { -+ *host = grub_malloc (l - 1); -+ if (!*host) -+ { -+ grub_print_error (); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ grub_memcpy (*host, ps + 1, l - 2); -+ (*host)[l - 2] = 0; -+ } -+ else -+ { -+ *host = grub_malloc (l + 1); -+ if (!*host) -+ { -+ grub_print_error (); -+ grub_free (*proto); -+ *proto = NULL; -+ return 0; -+ } -+ grub_memcpy (*host, ps, l); -+ (*host)[l] = 0; -+ } -+ -+ *path = grub_strdup (p); -+ if (!*path) -+ { -+ grub_print_error (); -+ grub_free (*host); -+ grub_free (*proto); -+ *host = NULL; -+ *proto = NULL; -+ return 0; -+ } -+ return 1; -+} -+ -+static void -+url_get_boot_location (const char *url, char **device, char **path, int is_default) -+{ -+ char *protocol, *server, *file; -+ char *slash; -+ -+ if (!url_parse_fields (url, &protocol, &server, &file)) -+ return; -+ -+ if ((slash = grub_strrchr (file, '/'))) -+ *slash = 0; -+ else -+ *file = 0; -+ -+ *device = grub_xasprintf ("%s,%s", protocol, server); -+ *path = grub_strdup(file); -+ -+ if (is_default) -+ default_server = server; -+ else -+ grub_free (server); -+ -+ grub_free (protocol); -+ grub_free (file); -+} -+ -+static void -+pxe_get_boot_location (const struct grub_net_bootp_packet *bp, -+ char **device, -+ char **path, -+ int is_default) -+{ -+ char *server = grub_xasprintf ("%d.%d.%d.%d", -+ ((grub_uint8_t *) &bp->server_ip)[0], -+ ((grub_uint8_t *) &bp->server_ip)[1], -+ ((grub_uint8_t *) &bp->server_ip)[2], -+ ((grub_uint8_t *) &bp->server_ip)[3]); -+ -+ *device = grub_xasprintf ("tftp,%s", server); -+ -+ *path = grub_strndup (bp->boot_file, sizeof (bp->boot_file)); -+ -+ if (*path) -+ { -+ char *slash; -+ slash = grub_strrchr (*path, '/'); -+ if (slash) -+ *slash = 0; -+ else -+ **path = 0; -+ } -+ -+ if (is_default) -+ default_server = server; -+ else -+ grub_free (server); -+} -+ -+static void -+pxe_get_boot_location_v6 (const struct grub_net_dhcp6_packet *dp, -+ grub_size_t dhcp_size, -+ char **device, -+ char **path) -+{ -+ -+ struct grub_net_dhcp6_option *dhcp_opt; -+ grub_size_t dhcp_remain_size; -+ *device = *path = 0; -+ -+ if (dhcp_size < sizeof (*dp)) -+ { -+ grub_error (GRUB_ERR_OUT_OF_RANGE, N_("DHCPv6 packet size too small")); -+ return; -+ } -+ -+ dhcp_remain_size = dhcp_size - sizeof (*dp); -+ dhcp_opt = (struct grub_net_dhcp6_option *)dp->dhcp_options; -+ -+ while (dhcp_remain_size) -+ { -+ grub_uint16_t code = grub_be_to_cpu16 (dhcp_opt->code); -+ grub_uint16_t len = grub_be_to_cpu16 (dhcp_opt->len); -+ grub_uint16_t option_size = sizeof (*dhcp_opt) + len; -+ -+ if (dhcp_remain_size < option_size || code == 0) -+ break; -+ -+ if (code == GRUB_NET_DHCP6_OPTION_BOOTFILE_URL) -+ { -+ char *url = grub_malloc (len + 1); -+ -+ grub_memcpy (url, dhcp_opt->data, len); -+ url[len] = 0; -+ -+ url_get_boot_location ((const char *)url, device, path, 1); -+ grub_free (url); -+ break; -+ } -+ -+ dhcp_remain_size -= option_size; -+ dhcp_opt = (struct grub_net_dhcp6_option *)((grub_uint8_t *)dhcp_opt + option_size); -+ } -+} -+ -+static grub_efi_net_interface_t * -+grub_efi_net_config_from_device_path (grub_efi_device_path_t *dp, -+ struct grub_efi_net_device *netdev, -+ char **device, -+ char **path) -+{ -+ grub_efi_net_interface_t *inf = NULL; -+ -+ while (1) -+ { -+ grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); -+ grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); -+ grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp); -+ -+ if (type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE) -+ { -+ if (subtype == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE) -+ { -+ grub_efi_uri_device_path_t *uri_dp; -+ uri_dp = (grub_efi_uri_device_path_t *) dp; -+ /* Beware that uri_dp->uri may not be null terminated */ -+ url_get_boot_location ((const char *)uri_dp->uri, device, path, 1); -+ } -+ else if (subtype == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE) -+ { -+ grub_efi_net_ip_manual_address_t net_ip; -+ grub_efi_ipv4_device_path_t *ipv4 = (grub_efi_ipv4_device_path_t *) dp; -+ -+ if (inf) -+ continue; -+ grub_memcpy (net_ip.ip4.address, ipv4->local_ip_address, sizeof (net_ip.ip4.address)); -+ grub_memcpy (net_ip.ip4.subnet_mask, ipv4->subnet_mask, sizeof (net_ip.ip4.subnet_mask)); -+ net_ip.is_ip6 = 0; -+ inf = grub_efi_net_create_interface (netdev, -+ netdev->card_name, -+ &net_ip, -+ 1); -+ } -+ else if (subtype == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) -+ { -+ grub_efi_net_ip_manual_address_t net_ip; -+ grub_efi_ipv6_device_path_t *ipv6 = (grub_efi_ipv6_device_path_t *) dp; -+ -+ if (inf) -+ continue; -+ grub_memcpy (net_ip.ip6.address, ipv6->local_ip_address, sizeof (net_ip.ip6.address)); -+ net_ip.ip6.prefix_length = GRUB_EFI_IP6_PREFIX_LENGTH; -+ net_ip.ip6.is_anycast = 0; -+ net_ip.is_ip6 = 1; -+ inf = grub_efi_net_create_interface (netdev, -+ netdev->card_name, -+ &net_ip, -+ 1); -+ } -+ } -+ -+ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) -+ break; -+ dp = (grub_efi_device_path_t *) ((char *) dp + len); -+ } -+ -+ return inf; -+} -+ -+static grub_efi_net_interface_t * -+grub_efi_net_config_from_handle (grub_efi_handle_t *hnd, -+ struct grub_efi_net_device *netdev, -+ char **device, -+ char **path) -+{ -+ grub_efi_pxe_t *pxe = NULL; -+ -+ if (hnd == netdev->ip4_pxe_handle) -+ pxe = netdev->ip4_pxe; -+ else if (hnd == netdev->ip6_pxe_handle) -+ pxe = netdev->ip6_pxe; -+ -+ if (!pxe) -+ return (grub_efi_net_config_from_device_path ( -+ grub_efi_get_device_path (hnd), -+ netdev, -+ device, -+ path)); -+ -+ if (pxe->mode->using_ipv6) -+ { -+ grub_efi_net_ip_manual_address_t net_ip; -+ -+ pxe_get_boot_location_v6 ( -+ (const struct grub_net_dhcp6_packet *) &pxe->mode->dhcp_ack, -+ sizeof (pxe->mode->dhcp_ack), -+ device, -+ path); -+ -+ grub_memcpy (net_ip.ip6.address, pxe->mode->station_ip.v6, sizeof(net_ip.ip6.address)); -+ net_ip.ip6.prefix_length = GRUB_EFI_IP6_PREFIX_LENGTH; -+ net_ip.ip6.is_anycast = 0; -+ net_ip.is_ip6 = 1; -+ return (grub_efi_net_create_interface (netdev, -+ netdev->card_name, -+ &net_ip, -+ 1)); -+ } -+ else -+ { -+ grub_efi_net_ip_manual_address_t net_ip; -+ -+ pxe_get_boot_location ( -+ (const struct grub_net_bootp_packet *) &pxe->mode->dhcp_ack, -+ device, -+ path, -+ 1); -+ -+ grub_memcpy (net_ip.ip4.address, pxe->mode->station_ip.v4, sizeof (net_ip.ip4.address)); -+ grub_memcpy (net_ip.ip4.subnet_mask, pxe->mode->subnet_mask.v4, sizeof (net_ip.ip4.subnet_mask)); -+ net_ip.is_ip6 = 0; -+ return (grub_efi_net_create_interface (netdev, -+ netdev->card_name, -+ &net_ip, -+ 1)); -+ } -+} -+ -+static const char * -+grub_efi_net_var_get_address (struct grub_env_var *var, -+ const char *val __attribute__ ((unused))) -+{ -+ struct grub_efi_net_device *dev; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ grub_efi_net_interface_t *inf; -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ { -+ char *var_name; -+ -+ var_name = grub_xasprintf ("net_%s_ip", inf->name); -+ if (grub_strcmp (var_name, var->name) == 0) -+ return efi_net_interface_get_address (inf); -+ grub_free (var_name); -+ var_name = grub_xasprintf ("net_%s_mac", inf->name); -+ if (grub_strcmp (var_name, var->name) == 0) -+ return efi_net_interface_get_hw_address (inf); -+ grub_free (var_name); -+ } -+ } -+ -+ return NULL; -+} -+ -+static char * -+grub_efi_net_var_set_interface (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val) -+{ -+ struct grub_efi_net_device *dev; -+ grub_efi_net_interface_t *inf; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ if (grub_strcmp (inf->name, val) == 0) -+ { -+ net_default_interface = inf; -+ return grub_strdup (val); -+ } -+ -+ return NULL; -+} -+ -+static char * -+grub_efi_net_var_set_server (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val) -+{ -+ grub_free (default_server); -+ default_server = grub_strdup (val); -+ return grub_strdup (val); -+} -+ -+static const char * -+grub_efi_net_var_get_server (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val __attribute__ ((unused))) -+{ -+ return default_server ? : ""; -+} -+ -+static const char * -+grub_efi_net_var_get_ip (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val __attribute__ ((unused))) -+{ -+ const char *intf = grub_env_get ("net_default_interface"); -+ const char *ret = NULL; -+ if (intf) -+ { -+ char *buf = grub_xasprintf ("net_%s_ip", intf); -+ if (buf) -+ ret = grub_env_get (buf); -+ grub_free (buf); -+ } -+ return ret; -+} -+ -+static const char * -+grub_efi_net_var_get_mac (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val __attribute__ ((unused))) -+{ -+ const char *intf = grub_env_get ("net_default_interface"); -+ const char *ret = NULL; -+ if (intf) -+ { -+ char *buf = grub_xasprintf ("net_%s_mac", intf); -+ if (buf) -+ ret = grub_env_get (buf); -+ grub_free (buf); -+ } -+ return ret; -+} -+ -+static void -+grub_efi_net_export_interface_vars (void) -+{ -+ struct grub_efi_net_device *dev; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ grub_efi_net_interface_t *inf; -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ { -+ char *var; -+ -+ var = grub_xasprintf ("net_%s_ip", inf->name); -+ grub_register_variable_hook (var, grub_efi_net_var_get_address, 0); -+ grub_env_export (var); -+ grub_free (var); -+ var = grub_xasprintf ("net_%s_mac", inf->name); -+ grub_register_variable_hook (var, grub_efi_net_var_get_address, 0); -+ grub_env_export (var); -+ grub_free (var); -+ } -+ } -+} -+ -+static void -+grub_efi_net_unset_interface_vars (void) -+{ -+ struct grub_efi_net_device *dev; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ grub_efi_net_interface_t *inf; -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ { -+ char *var; -+ -+ var = grub_xasprintf ("net_%s_ip", inf->name); -+ grub_register_variable_hook (var, 0, 0); -+ grub_env_unset (var); -+ grub_free (var); -+ var = grub_xasprintf ("net_%s_mac", inf->name); -+ grub_register_variable_hook (var, 0, 0); -+ grub_env_unset (var); -+ grub_free (var); -+ } -+ } -+} -+ -+grub_efi_net_interface_t * -+grub_efi_net_create_interface (struct grub_efi_net_device *dev, -+ const char *interface_name, -+ grub_efi_net_ip_manual_address_t *net_ip, -+ int has_subnet) -+{ -+ grub_efi_net_interface_t *inf; -+ -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ { -+ if (inf->prefer_ip6 == net_ip->is_ip6) -+ break; -+ } -+ -+ if (!inf) -+ { -+ inf = grub_malloc (sizeof(*inf)); -+ inf->name = grub_strdup (interface_name); -+ inf->prefer_ip6 = net_ip->is_ip6; -+ inf->dev = dev; -+ inf->next = dev->net_interfaces; -+ inf->ip_config = (net_ip->is_ip6) ? efi_net_ip6_config : efi_net_ip4_config ; -+ dev->net_interfaces = inf; -+ } -+ else -+ { -+ grub_free (inf->name); -+ inf->name = grub_strdup (interface_name); -+ } -+ -+ if (!efi_net_interface_set_address (inf, net_ip, has_subnet)) -+ { -+ grub_error (GRUB_ERR_BUG, N_("Set Address Failed")); -+ return NULL; -+ } -+ -+ return inf; -+} -+ -+static void -+grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, -+ char **path) -+{ -+ grub_efi_handle_t config_hnd; -+ -+ struct grub_efi_net_device *netdev; -+ grub_efi_net_interface_t *inf; -+ -+ config_hnd = grub_efi_locate_device_path (&ip4_config_guid, grub_efi_get_device_path (hnd), NULL); -+ -+ if (!config_hnd) -+ return; -+ -+ for (netdev = net_devices; netdev; netdev = netdev->next) -+ if (netdev->handle == config_hnd) -+ break; -+ -+ if (!netdev) -+ return; -+ -+ if (!(inf = grub_efi_net_config_from_handle (hnd, netdev, device, path))) -+ return; -+ -+ grub_env_set ("net_default_interface", inf->name); -+ grub_efi_net_export_interface_vars (); -+} -+ -+static grub_err_t -+grub_efi_netfs_dir (grub_device_t device, const char *path __attribute__ ((unused)), -+ grub_fs_dir_hook_t hook __attribute__ ((unused)), -+ void *hook_data __attribute__ ((unused))) -+{ -+ if (!device->net) -+ return grub_error (GRUB_ERR_BUG, "invalid net device"); -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+grub_efi_netfs_open (struct grub_file *file_out __attribute__ ((unused)), -+ const char *name __attribute__ ((unused))) -+{ -+ struct grub_file *file, *bufio; -+ -+ file = grub_malloc (sizeof (*file)); -+ if (!file) -+ return grub_errno; -+ -+ grub_memcpy (file, file_out, sizeof (struct grub_file)); -+ file->device->net->name = grub_strdup (name); -+ -+ if (!file->device->net->name) -+ { -+ grub_free (file); -+ return grub_errno; -+ } -+ -+ efi_net_interface(open, file, name); -+ grub_print_error (); -+ -+ bufio = grub_bufio_open (file, 32768); -+ if (!bufio) -+ { -+ grub_free (file->device->net->name); -+ grub_free (file); -+ return grub_errno; -+ } -+ grub_memcpy (file_out, bufio, sizeof (struct grub_file)); -+ grub_free (bufio); -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_ssize_t -+grub_efihttp_chunk_read (grub_file_t file, char *buf, -+ grub_size_t len, grub_size_t chunk_size) -+{ -+ char *chunk = grub_malloc (chunk_size); -+ grub_size_t sum = 0; -+ -+ while (len) -+ { -+ grub_ssize_t rd; -+ grub_size_t sz = (len > chunk_size) ? chunk_size : len; -+ -+ rd = efi_net_interface (read, file, chunk, sz); -+ -+ if (rd <= 0) -+ return rd; -+ -+ if (buf) -+ { -+ grub_memcpy (buf, chunk, rd); -+ buf += rd; -+ } -+ sum += rd; -+ len -= rd; -+ } -+ -+ grub_free (chunk); -+ return sum; -+} -+ -+static grub_ssize_t -+grub_efi_netfs_read (grub_file_t file __attribute__ ((unused)), -+ char *buf __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) -+{ -+ if (file->offset > file->device->net->offset) -+ { -+ grub_efihttp_chunk_read (file, NULL, file->offset - file->device->net->offset, 10240); -+ } -+ else if (file->offset < file->device->net->offset) -+ { -+ efi_net_interface (close, file); -+ efi_net_interface (open, file, file->device->net->name); -+ if (file->offset) -+ grub_efihttp_chunk_read (file, NULL, file->offset, 10240); -+ } -+ -+ return efi_net_interface (read, file, buf, len); -+} -+ -+static grub_err_t -+grub_efi_netfs_close (grub_file_t file) -+{ -+ efi_net_interface (close, file); -+ return GRUB_ERR_NONE; -+} -+ -+static grub_efi_handle_t -+grub_efi_service_binding (grub_efi_handle_t dev, grub_efi_guid_t *service_binding_guid) -+{ -+ grub_efi_service_binding_t *service; -+ grub_efi_status_t status; -+ grub_efi_handle_t child_dev = NULL; -+ -+ service = grub_efi_open_protocol (dev, service_binding_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ if (!service) -+ { -+ grub_error (GRUB_ERR_IO, N_("couldn't open efi service binding protocol")); -+ return NULL; -+ } -+ -+ status = efi_call_2 (service->create_child, service, &child_dev); -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_error (GRUB_ERR_IO, N_("Failed to create child device of http service %x"), status); -+ return NULL; -+ } -+ -+ return child_dev; -+} -+ -+static grub_err_t -+grub_efi_net_parse_address (const char *address, -+ grub_efi_ip4_config2_manual_address_t *ip4, -+ grub_efi_ip6_config_manual_address_t *ip6, -+ int *is_ip6, -+ int *has_cidr) -+{ -+ const char *rest; -+ -+ if (grub_efi_string_to_ip4_address (address, &ip4->address, &rest)) -+ { -+ *is_ip6 = 0; -+ if (*rest == '/') -+ { -+ grub_uint32_t subnet_mask_size; -+ -+ subnet_mask_size = grub_strtoul (rest + 1, (char **) &rest, 0); -+ -+ if (!grub_errno && subnet_mask_size <= 32 && *rest == 0) -+ { -+ grub_uint32_t subnet_mask; -+ -+ subnet_mask = grub_cpu_to_be32 ((0xffffffffU << (32 - subnet_mask_size))); -+ grub_memcpy (ip4->subnet_mask, &subnet_mask, sizeof (ip4->subnet_mask)); -+ if (has_cidr) -+ *has_cidr = 1; -+ return GRUB_ERR_NONE; -+ } -+ } -+ else if (*rest == 0) -+ { -+ grub_uint32_t subnet_mask = 0xffffffffU; -+ grub_memcpy (ip4->subnet_mask, &subnet_mask, sizeof (ip4->subnet_mask)); -+ if (has_cidr) -+ *has_cidr = 0; -+ return GRUB_ERR_NONE; -+ } -+ } -+ else if (grub_efi_string_to_ip6_address (address, &ip6->address, &rest)) -+ { -+ *is_ip6 = 1; -+ if (*rest == '/') -+ { -+ grub_efi_uint8_t prefix_length; -+ -+ prefix_length = grub_strtoul (rest + 1, (char **) &rest, 0); -+ if (!grub_errno && prefix_length <= 128 && *rest == 0) -+ { -+ ip6->prefix_length = prefix_length; -+ ip6->is_anycast = 0; -+ if (has_cidr) -+ *has_cidr = 1; -+ return GRUB_ERR_NONE; -+ } -+ } -+ else if (*rest == 0) -+ { -+ ip6->prefix_length = 128; -+ ip6->is_anycast = 0; -+ if (has_cidr) -+ *has_cidr = 0; -+ return GRUB_ERR_NONE; -+ } -+ } -+ -+ return grub_error (GRUB_ERR_NET_BAD_ADDRESS, -+ N_("unrecognised network address `%s'"), -+ address); -+} -+ -+static grub_efi_net_interface_t * -+match_route (const char *server) -+{ -+ grub_err_t err; -+ grub_efi_ip4_config2_manual_address_t ip4; -+ grub_efi_ip6_config_manual_address_t ip6; -+ grub_efi_net_interface_t *inf; -+ int is_ip6 = 0; -+ -+ err = grub_efi_net_parse_address (server, &ip4, &ip6, &is_ip6, 0); -+ -+ if (err) -+ { -+ grub_print_error (); -+ return NULL; -+ } -+ -+ if (is_ip6) -+ { -+ struct grub_efi_net_device *dev; -+ grub_efi_net_ip_address_t addr; -+ -+ grub_memcpy (addr.ip6, ip6.address, sizeof(ip6.address)); -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ if ((inf = efi_net_ip6_config->best_interface (dev, &addr))) -+ return inf; -+ } -+ else -+ { -+ struct grub_efi_net_device *dev; -+ grub_efi_net_ip_address_t addr; -+ -+ grub_memcpy (addr.ip4, ip4.address, sizeof(ip4.address)); -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ if ((inf = efi_net_ip4_config->best_interface (dev, &addr))) -+ return inf; -+ } -+ -+ return 0; -+} -+ -+static void -+grub_efi_net_add_pxebc_to_cards (void) -+{ -+ grub_efi_uintn_t num_handles; -+ grub_efi_handle_t *handles; -+ grub_efi_handle_t *handle; -+ -+ handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &pxe_io_guid, -+ 0, &num_handles); -+ if (!handles) -+ return; -+ -+ for (handle = handles; num_handles--; handle++) -+ { -+ grub_efi_device_path_t *dp, *ddp, *ldp; -+ grub_efi_pxe_t *pxe; -+ struct grub_efi_net_device *d; -+ int is_ip6 = 0; -+ -+ dp = grub_efi_get_device_path (*handle); -+ if (!dp) -+ continue; -+ -+ ddp = grub_efi_duplicate_device_path (dp); -+ ldp = grub_efi_find_last_device_path (ddp); -+ -+ if (ldp->type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -+ && ldp->subtype == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE) -+ { -+ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ ldp->length = sizeof (*ldp); -+ } -+ else if (ldp->type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -+ && ldp->subtype == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) -+ { -+ is_ip6 = 1; -+ ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; -+ ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; -+ ldp->length = sizeof (*ldp); -+ } -+ -+ for (d = net_devices; d; d = d->next) -+ if (grub_efi_compare_device_paths (ddp, grub_efi_get_device_path (d->handle)) == 0) -+ break; -+ -+ if (!d) -+ { -+ grub_free (ddp); -+ continue; -+ } -+ -+ pxe = grub_efi_open_protocol (*handle, &pxe_io_guid, -+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ -+ if (!pxe) -+ { -+ grub_free (ddp); -+ continue; -+ } -+ -+ if (is_ip6) -+ { -+ d->ip6_pxe_handle = *handle; -+ d->ip6_pxe = pxe; -+ } -+ else -+ { -+ d->ip4_pxe_handle = *handle; -+ d->ip4_pxe = pxe; -+ } -+ -+ grub_free (ddp); -+ } -+ -+ grub_free (handles); -+} -+ -+static void -+set_ip_policy_to_static (void) -+{ -+ struct grub_efi_net_device *dev; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ grub_efi_ip4_config2_policy_t ip4_policy = GRUB_EFI_IP4_CONFIG2_POLICY_STATIC; -+ -+ if (efi_call_4 (dev->ip4_config->set_data, dev->ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_POLICY, -+ sizeof (ip4_policy), &ip4_policy) != GRUB_EFI_SUCCESS) -+ grub_dprintf ("efinetfs", "could not set GRUB_EFI_IP4_CONFIG2_POLICY_STATIC on dev `%s'", dev->card_name); -+ -+ if (dev->ip6_config) -+ { -+ grub_efi_ip6_config_policy_t ip6_policy = GRUB_EFI_IP6_CONFIG_POLICY_MANUAL; -+ -+ if (efi_call_4 (dev->ip6_config->set_data, dev->ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_POLICY, -+ sizeof (ip6_policy), &ip6_policy) != GRUB_EFI_SUCCESS) -+ grub_dprintf ("efinetfs", "could not set GRUB_EFI_IP6_CONFIG_POLICY_MANUAL on dev `%s'", dev->card_name); -+ } -+ } -+} -+ -+/* FIXME: Do not fail if the card did not support any of the protocol (Eg http) */ -+static void -+grub_efi_net_find_cards (void) -+{ -+ grub_efi_uintn_t num_handles; -+ grub_efi_handle_t *handles; -+ grub_efi_handle_t *handle; -+ int id; -+ -+ handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &ip4_config_guid, -+ 0, &num_handles); -+ if (!handles) -+ return; -+ -+ for (id = 0, handle = handles; num_handles--; handle++, id++) -+ { -+ grub_efi_device_path_t *dp; -+ grub_efi_ip4_config2_protocol_t *ip4_config; -+ grub_efi_ip6_config_protocol_t *ip6_config; -+ grub_efi_handle_t http_handle; -+ grub_efi_http_t *http; -+ grub_efi_handle_t dhcp4_handle; -+ grub_efi_dhcp4_protocol_t *dhcp4; -+ grub_efi_handle_t dhcp6_handle; -+ grub_efi_dhcp6_protocol_t *dhcp6; -+ -+ struct grub_efi_net_device *d; -+ -+ dp = grub_efi_get_device_path (*handle); -+ if (!dp) -+ continue; -+ -+ ip4_config = grub_efi_open_protocol (*handle, &ip4_config_guid, -+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ if (!ip4_config) -+ continue; -+ -+ ip6_config = grub_efi_open_protocol (*handle, &ip6_config_guid, -+ GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); -+ -+ http_handle = grub_efi_service_binding (*handle, &http_service_binding_guid); -+ grub_errno = GRUB_ERR_NONE; -+ http = (http_handle) -+ ? grub_efi_open_protocol (http_handle, &http_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL) -+ : NULL; -+ -+ dhcp4_handle = grub_efi_service_binding (*handle, &dhcp4_service_binding_guid); -+ grub_errno = GRUB_ERR_NONE; -+ dhcp4 = (dhcp4_handle) -+ ? grub_efi_open_protocol (dhcp4_handle, &dhcp4_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL) -+ : NULL; -+ -+ -+ dhcp6_handle = grub_efi_service_binding (*handle, &dhcp6_service_binding_guid); -+ grub_errno = GRUB_ERR_NONE; -+ dhcp6 = (dhcp6_handle) -+ ? grub_efi_open_protocol (dhcp6_handle, &dhcp6_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL) -+ : NULL; -+ -+ d = grub_malloc (sizeof (*d)); -+ if (!d) -+ { -+ grub_free (handles); -+ while (net_devices) -+ { -+ d = net_devices->next; -+ grub_free (net_devices); -+ net_devices = d; -+ } -+ return; -+ } -+ d->handle = *handle; -+ d->ip4_config = ip4_config; -+ d->ip6_config = ip6_config; -+ d->http_handle = http_handle; -+ d->http = http; -+ d->dhcp4_handle = dhcp4_handle; -+ d->dhcp4 = dhcp4; -+ d->dhcp6_handle = dhcp6_handle; -+ d->dhcp6 = dhcp6; -+ d->next = net_devices; -+ d->card_name = grub_xasprintf ("efinet%d", id); -+ d->net_interfaces = NULL; -+ net_devices = d; -+ } -+ -+ grub_efi_net_add_pxebc_to_cards (); -+ grub_free (handles); -+ set_ip_policy_to_static (); -+} -+ -+static void -+listroutes_ip4 (struct grub_efi_net_device *netdev) -+{ -+ char **routes; -+ -+ routes = NULL; -+ -+ if ((routes = efi_net_ip4_config->get_route_table (netdev))) -+ { -+ char **r; -+ -+ for (r = routes; *r; ++r) -+ grub_printf ("%s\n", *r); -+ } -+ -+ if (routes) -+ { -+ char **r; -+ -+ for (r = routes; *r; ++r) -+ grub_free (*r); -+ grub_free (routes); -+ } -+} -+ -+static void -+listroutes_ip6 (struct grub_efi_net_device *netdev) -+{ -+ char **routes; -+ -+ routes = NULL; -+ -+ if ((routes = efi_net_ip6_config->get_route_table (netdev))) -+ { -+ char **r; -+ -+ for (r = routes; *r; ++r) -+ grub_printf ("%s\n", *r); -+ } -+ -+ if (routes) -+ { -+ char **r; -+ -+ for (r = routes; *r; ++r) -+ grub_free (*r); -+ grub_free (routes); -+ } -+} -+ -+static grub_err_t -+grub_cmd_efi_listroutes (struct grub_command *cmd __attribute__ ((unused)), -+ int argc __attribute__ ((unused)), -+ char **args __attribute__ ((unused))) -+{ -+ struct grub_efi_net_device *netdev; -+ -+ for (netdev = net_devices; netdev; netdev = netdev->next) -+ { -+ listroutes_ip4 (netdev); -+ listroutes_ip6 (netdev); -+ } -+ -+ return GRUB_ERR_NONE; -+} -+static grub_err_t -+grub_cmd_efi_listcards (struct grub_command *cmd __attribute__ ((unused)), -+ int argc __attribute__ ((unused)), -+ char **args __attribute__ ((unused))) -+{ -+ struct grub_efi_net_device *dev; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ char *hw_addr; -+ -+ hw_addr = efi_net_ip4_config->get_hw_address (dev); -+ -+ if (hw_addr) -+ { -+ grub_printf ("%s %s\n", dev->card_name, hw_addr); -+ grub_free (hw_addr); -+ } -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+grub_cmd_efi_listaddrs (struct grub_command *cmd __attribute__ ((unused)), -+ int argc __attribute__ ((unused)), -+ char **args __attribute__ ((unused))) -+{ -+ struct grub_efi_net_device *dev; -+ grub_efi_net_interface_t *inf; -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ for (inf = dev->net_interfaces; inf; inf = inf->next) -+ { -+ char *hw_addr = NULL; -+ char *addr = NULL; -+ -+ if ((hw_addr = efi_net_interface_get_hw_address (inf)) -+ && (addr = efi_net_interface_get_address (inf))) -+ grub_printf ("%s %s %s\n", inf->name, hw_addr, addr); -+ -+ if (hw_addr) -+ grub_free (hw_addr); -+ if (addr) -+ grub_free (addr); -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ -+/* FIXME: support MAC specifying. */ -+static grub_err_t -+grub_cmd_efi_addaddr (struct grub_command *cmd __attribute__ ((unused)), -+ int argc, char **args) -+{ -+ struct grub_efi_net_device *dev; -+ grub_err_t err; -+ grub_efi_ip4_config2_manual_address_t ip4; -+ grub_efi_ip6_config_manual_address_t ip6; -+ grub_efi_net_ip_manual_address_t net_ip; -+ int is_ip6 = 0; -+ int cidr = 0; -+ -+ if (argc != 3) -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("three arguments expected")); -+ -+ for (dev = net_devices; dev; dev = dev->next) -+ { -+ if (grub_strcmp (dev->card_name, args[1]) == 0) -+ break; -+ } -+ -+ if (!dev) -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("card not found")); -+ -+ err = grub_efi_net_parse_address (args[2], &ip4, &ip6, &is_ip6, &cidr); -+ -+ if (err) -+ return err; -+ -+ net_ip.is_ip6 = is_ip6; -+ if (is_ip6) -+ grub_memcpy (&net_ip.ip6, &ip6, sizeof(net_ip.ip6)); -+ else -+ grub_memcpy (&net_ip.ip4, &ip4, sizeof(net_ip.ip4)); -+ -+ if (!grub_efi_net_create_interface (dev, -+ args[0], -+ &net_ip, -+ cidr)) -+ return grub_errno; -+ -+ return GRUB_ERR_NONE; -+} -+ -+static struct grub_fs grub_efi_netfs; -+ -+static grub_net_t -+grub_net_open_real (const char *name __attribute__ ((unused))) -+{ -+ grub_size_t protnamelen; -+ const char *protname, *server; -+ grub_net_t ret; -+ -+ net_interface = NULL; -+ -+ if (grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0) -+ { -+ protname = "tftp"; -+ protnamelen = sizeof ("tftp") - 1; -+ server = name + sizeof ("pxe:") - 1; -+ } -+ else if (grub_strcmp (name, "pxe") == 0) -+ { -+ protname = "tftp"; -+ protnamelen = sizeof ("tftp") - 1; -+ server = default_server; -+ } -+ else -+ { -+ const char *comma; -+ -+ comma = grub_strchr (name, ','); -+ if (comma) -+ { -+ protnamelen = comma - name; -+ server = comma + 1; -+ protname = name; -+ } -+ else -+ { -+ protnamelen = grub_strlen (name); -+ server = default_server; -+ protname = name; -+ } -+ } -+ -+ if (!server) -+ { -+ grub_error (GRUB_ERR_NET_BAD_ADDRESS, -+ N_("no server is specified")); -+ return NULL; -+ } -+ -+ /*FIXME: Use DNS translate name to address */ -+ net_interface = match_route (server); -+ -+ /*XXX: should we check device with default gateway ? */ -+ if (!net_interface && !(net_interface = net_default_interface)) -+ { -+ grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' no route found"), -+ name); -+ return NULL; -+ } -+ -+ if ((protnamelen == (sizeof ("https") - 1) -+ && grub_memcmp ("https", protname, protnamelen) == 0)) -+ { -+ net_interface->io = &io_http; -+ net_interface->io_type = 1; -+ } -+ else if ((protnamelen == (sizeof ("http") - 1) -+ && grub_memcmp ("http", protname, protnamelen) == 0)) -+ { -+ net_interface->io = &io_http; -+ net_interface->io_type = 0; -+ } -+ else if (protnamelen == (sizeof ("tftp") - 1) -+ && grub_memcmp ("tftp", protname, protnamelen) == 0) -+ { -+ net_interface->io = &io_pxe; -+ net_interface->io_type = 0; -+ } -+ else -+ { -+ grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), -+ name); -+ return NULL; -+ } -+ -+ /*XXX: Should we try to avoid doing excess "reconfigure" here ??? */ -+ efi_net_interface (configure); -+ -+ ret = grub_zalloc (sizeof (*ret)); -+ if (!ret) -+ return NULL; -+ -+ ret->server = grub_strdup (server); -+ if (!ret->server) -+ { -+ grub_free (ret); -+ return NULL; -+ } -+ -+ ret->fs = &grub_efi_netfs; -+ return ret; -+} -+#if 0 -+static grub_command_t cmd_efi_lsaddr; -+static grub_command_t cmd_efi_lscards; -+static grub_command_t cmd_efi_lsroutes; -+static grub_command_t cmd_efi_addaddr; -+#endif -+ -+static struct grub_fs grub_efi_netfs = -+ { -+ .name = "efi netfs", -+ .dir = grub_efi_netfs_dir, -+ .open = grub_efi_netfs_open, -+ .read = grub_efi_netfs_read, -+ .close = grub_efi_netfs_close, -+ .label = NULL, -+ .uuid = NULL, -+ .mtime = NULL, -+ }; -+ -+int -+grub_efi_net_boot_from_https (void) -+{ -+ grub_efi_loaded_image_t *image = NULL; -+ grub_efi_device_path_t *dp; -+ -+ image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ if (!image) -+ return 0; -+ -+ dp = grub_efi_get_device_path (image->device_handle); -+ -+ while (1) -+ { -+ grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); -+ grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); -+ grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp); -+ -+ if ((type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE) -+ && (subtype == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) -+ { -+ grub_efi_uri_device_path_t *uri_dp = (grub_efi_uri_device_path_t *) dp; -+ return (grub_strncmp ((const char*)uri_dp->uri, "https://", sizeof ("https://") - 1) == 0) ? 1 : 0; -+ } -+ -+ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) -+ break; -+ dp = (grub_efi_device_path_t *) ((char *) dp + len); -+ } -+ -+ return 0; -+} -+ -+int -+grub_efi_net_boot_from_opa (void) -+{ -+ grub_efi_loaded_image_t *image = NULL; -+ grub_efi_device_path_t *dp; -+ -+ image = grub_efi_get_loaded_image (grub_efi_image_handle); -+ if (!image) -+ return 0; -+ -+ dp = grub_efi_get_device_path (image->device_handle); -+ -+ while (1) -+ { -+ grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); -+ grub_efi_uint8_t subtype = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp); -+ grub_efi_uint16_t len = GRUB_EFI_DEVICE_PATH_LENGTH (dp); -+ -+ if ((type == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE) -+ && (subtype == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE)) -+ { -+ grub_efi_mac_address_device_path_t *mac_dp = (grub_efi_mac_address_device_path_t *)dp; -+ return (mac_dp->if_type == 0xC7) ? 1 : 0; -+ } -+ -+ if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) -+ break; -+ dp = (grub_efi_device_path_t *) ((char *) dp + len); -+ } -+ -+ return 0; -+} -+ -+static char * -+grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)), -+ const char *val __attribute__ ((unused))) -+{ -+ return NULL; -+} -+ -+grub_command_func_t grub_efi_net_list_routes = grub_cmd_efi_listroutes; -+grub_command_func_t grub_efi_net_list_cards = grub_cmd_efi_listcards; -+grub_command_func_t grub_efi_net_list_addrs = grub_cmd_efi_listaddrs; -+grub_command_func_t grub_efi_net_add_addr = grub_cmd_efi_addaddr; -+ -+int -+grub_efi_net_fs_init () -+{ -+ grub_efi_net_find_cards (); -+ grub_efi_net_config = grub_efi_net_config_real; -+ grub_net_open = grub_net_open_real; -+ grub_register_variable_hook ("net_default_server", grub_efi_net_var_get_server, -+ grub_efi_net_var_set_server); -+ grub_env_export ("net_default_server"); -+ grub_register_variable_hook ("pxe_default_server", grub_efi_net_var_get_server, -+ grub_efi_net_var_set_server); -+ grub_env_export ("pxe_default_server"); -+ grub_register_variable_hook ("net_default_interface", 0, -+ grub_efi_net_var_set_interface); -+ grub_env_export ("net_default_interface"); -+ grub_register_variable_hook ("net_default_ip", grub_efi_net_var_get_ip, -+ 0); -+ grub_env_export ("net_default_ip"); -+ grub_register_variable_hook ("net_default_mac", grub_efi_net_var_get_mac, -+ 0); -+ grub_env_export ("net_default_mac"); -+ -+ grub_env_set ("grub_netfs_type", "efi"); -+ grub_register_variable_hook ("grub_netfs_type", 0, grub_env_write_readonly); -+ grub_env_export ("grub_netfs_type"); -+ -+ return 1; -+} -+ -+void -+grub_efi_net_fs_fini (void) -+{ -+ grub_env_unset ("grub_netfs_type"); -+ grub_efi_net_unset_interface_vars (); -+ grub_register_variable_hook ("net_default_server", 0, 0); -+ grub_env_unset ("net_default_server"); -+ grub_register_variable_hook ("net_default_interface", 0, 0); -+ grub_env_unset ("net_default_interface"); -+ grub_register_variable_hook ("pxe_default_server", 0, 0); -+ grub_env_unset ("pxe_default_server"); -+ grub_register_variable_hook ("net_default_ip", 0, 0); -+ grub_env_unset ("net_default_ip"); -+ grub_register_variable_hook ("net_default_mac", 0, 0); -+ grub_env_unset ("net_default_mac"); -+ grub_efi_net_config = NULL; -+ grub_net_open = NULL; -+ grub_fs_unregister (&grub_efi_netfs); -+} -diff --git a/grub-core/net/efi/pxe.c b/grub-core/net/efi/pxe.c -new file mode 100644 -index 00000000000..531949cba5c ---- /dev/null -+++ b/grub-core/net/efi/pxe.c -@@ -0,0 +1,424 @@ -+ -+#include -+#include -+#include -+#include -+#include -+ -+static grub_efi_ip6_config_manual_address_t * -+efi_ip6_config_manual_address (grub_efi_ip6_config_protocol_t *ip6_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip6_config_manual_address_t *manual_address; -+ -+ sz = sizeof (*manual_address); -+ manual_address = grub_malloc (sz); -+ if (!manual_address) -+ return NULL; -+ -+ status = efi_call_4 (ip6_config->get_data, ip6_config, -+ GRUB_EFI_IP6_CONFIG_DATA_TYPE_MANUAL_ADDRESS, -+ &sz, manual_address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (manual_address); -+ return NULL; -+ } -+ -+ return manual_address; -+} -+ -+static grub_efi_ip4_config2_manual_address_t * -+efi_ip4_config_manual_address (grub_efi_ip4_config2_protocol_t *ip4_config) -+{ -+ grub_efi_uintn_t sz; -+ grub_efi_status_t status; -+ grub_efi_ip4_config2_manual_address_t *manual_address; -+ -+ sz = sizeof (*manual_address); -+ manual_address = grub_malloc (sz); -+ if (!manual_address) -+ return NULL; -+ -+ status = efi_call_4 (ip4_config->get_data, ip4_config, -+ GRUB_EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS, -+ &sz, manual_address); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ grub_free (manual_address); -+ return NULL; -+ } -+ -+ return manual_address; -+} -+ -+static void -+pxe_configure (struct grub_efi_net_device *dev, int prefer_ip6) -+{ -+ grub_efi_pxe_t *pxe = (prefer_ip6) ? dev->ip6_pxe : dev->ip4_pxe; -+ -+ grub_efi_pxe_mode_t *mode = pxe->mode; -+ -+ if (!mode->started) -+ { -+ grub_efi_status_t status; -+ status = efi_call_2 (pxe->start, pxe, prefer_ip6); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ grub_printf ("Couldn't start PXE\n"); -+ } -+ -+#if 0 -+ grub_printf ("PXE STARTED: %u\n", mode->started); -+ grub_printf ("PXE USING IPV6: %u\n", mode->using_ipv6); -+#endif -+ -+ if (mode->using_ipv6) -+ { -+ grub_efi_ip6_config_manual_address_t *manual_address; -+ manual_address = efi_ip6_config_manual_address (dev->ip6_config); -+ -+ if (manual_address && -+ grub_memcmp (manual_address->address, mode->station_ip.v6, sizeof (manual_address->address)) != 0) -+ { -+ grub_efi_status_t status; -+ grub_efi_pxe_ip_address_t station_ip; -+ -+ grub_memcpy (station_ip.v6.addr, manual_address->address, sizeof (station_ip.v6.addr)); -+ status = efi_call_3 (pxe->set_station_ip, pxe, &station_ip, NULL); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ grub_printf ("Couldn't set station ip\n"); -+ -+ grub_free (manual_address); -+ } -+ } -+ else -+ { -+ grub_efi_ip4_config2_manual_address_t *manual_address; -+ manual_address = efi_ip4_config_manual_address (dev->ip4_config); -+ -+ if (manual_address && -+ grub_memcmp (manual_address->address, mode->station_ip.v4, sizeof (manual_address->address)) != 0) -+ { -+ grub_efi_status_t status; -+ grub_efi_pxe_ip_address_t station_ip; -+ grub_efi_pxe_ip_address_t subnet_mask; -+ -+ grub_memcpy (station_ip.v4.addr, manual_address->address, sizeof (station_ip.v4.addr)); -+ grub_memcpy (subnet_mask.v4.addr, manual_address->subnet_mask, sizeof (subnet_mask.v4.addr)); -+ -+ status = efi_call_3 (pxe->set_station_ip, pxe, &station_ip, &subnet_mask); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ grub_printf ("Couldn't set station ip\n"); -+ -+ grub_free (manual_address); -+ } -+ } -+ -+#if 0 -+ if (mode->using_ipv6) -+ { -+ grub_printf ("PXE STATION IP: %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", -+ mode->station_ip.v6.addr[0], -+ mode->station_ip.v6.addr[1], -+ mode->station_ip.v6.addr[2], -+ mode->station_ip.v6.addr[3], -+ mode->station_ip.v6.addr[4], -+ mode->station_ip.v6.addr[5], -+ mode->station_ip.v6.addr[6], -+ mode->station_ip.v6.addr[7], -+ mode->station_ip.v6.addr[8], -+ mode->station_ip.v6.addr[9], -+ mode->station_ip.v6.addr[10], -+ mode->station_ip.v6.addr[11], -+ mode->station_ip.v6.addr[12], -+ mode->station_ip.v6.addr[13], -+ mode->station_ip.v6.addr[14], -+ mode->station_ip.v6.addr[15]); -+ } -+ else -+ { -+ grub_printf ("PXE STATION IP: %d.%d.%d.%d\n", -+ mode->station_ip.v4.addr[0], -+ mode->station_ip.v4.addr[1], -+ mode->station_ip.v4.addr[2], -+ mode->station_ip.v4.addr[3]); -+ grub_printf ("PXE SUBNET MASK: %d.%d.%d.%d\n", -+ mode->subnet_mask.v4.addr[0], -+ mode->subnet_mask.v4.addr[1], -+ mode->subnet_mask.v4.addr[2], -+ mode->subnet_mask.v4.addr[3]); -+ } -+#endif -+ -+ /* TODO: Set The Station IP to the IP2 Config */ -+} -+ -+static int -+parse_ip6 (const char *val, grub_uint64_t *ip, const char **rest) -+{ -+ grub_uint16_t newip[8]; -+ const char *ptr = val; -+ int word, quaddot = -1; -+ int bracketed = 0; -+ -+ if (ptr[0] == '[') { -+ bracketed = 1; -+ ptr++; -+ } -+ -+ if (ptr[0] == ':' && ptr[1] != ':') -+ return 0; -+ if (ptr[0] == ':') -+ ptr++; -+ -+ for (word = 0; word < 8; word++) -+ { -+ unsigned long t; -+ if (*ptr == ':') -+ { -+ quaddot = word; -+ word--; -+ ptr++; -+ continue; -+ } -+ t = grub_strtoul (ptr, (char **) &ptr, 16); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ break; -+ } -+ if (t & ~0xffff) -+ return 0; -+ newip[word] = grub_cpu_to_be16 (t); -+ if (*ptr != ':') -+ break; -+ ptr++; -+ } -+ if (quaddot == -1 && word < 7) -+ return 0; -+ if (quaddot != -1) -+ { -+ grub_memmove (&newip[quaddot + 7 - word], &newip[quaddot], -+ (word - quaddot + 1) * sizeof (newip[0])); -+ grub_memset (&newip[quaddot], 0, (7 - word) * sizeof (newip[0])); -+ } -+ grub_memcpy (ip, newip, 16); -+ if (bracketed && *ptr == ']') { -+ ptr++; -+ } -+ if (rest) -+ *rest = ptr; -+ return 1; -+} -+ -+static grub_err_t -+pxe_open (struct grub_efi_net_device *dev, -+ int prefer_ip6, -+ grub_file_t file, -+ const char *filename, -+ int type __attribute__((unused))) -+{ -+ int i; -+ char *p; -+ grub_efi_status_t status; -+ grub_efi_pxe_ip_address_t server_ip; -+ grub_efi_uint64_t file_size = 0; -+ grub_efi_pxe_t *pxe = (prefer_ip6) ? dev->ip6_pxe : dev->ip4_pxe; -+ -+ if (pxe->mode->using_ipv6) -+ { -+ const char *rest; -+ grub_uint64_t ip6[2]; -+ if (parse_ip6 (file->device->net->server, ip6, &rest) && *rest == 0) -+ grub_memcpy (server_ip.v6.addr, ip6, sizeof (server_ip.v6.addr)); -+ /* TODO: ERROR Handling Here */ -+#if 0 -+ grub_printf ("PXE SERVER IP: %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n", -+ server_ip.v6.addr[0], -+ server_ip.v6.addr[1], -+ server_ip.v6.addr[2], -+ server_ip.v6.addr[3], -+ server_ip.v6.addr[4], -+ server_ip.v6.addr[5], -+ server_ip.v6.addr[6], -+ server_ip.v6.addr[7], -+ server_ip.v6.addr[8], -+ server_ip.v6.addr[9], -+ server_ip.v6.addr[10], -+ server_ip.v6.addr[11], -+ server_ip.v6.addr[12], -+ server_ip.v6.addr[13], -+ server_ip.v6.addr[14], -+ server_ip.v6.addr[15]); -+#endif -+ } -+ else -+ { -+ for (i = 0, p = file->device->net->server; i < 4; ++i, ++p) -+ server_ip.v4.addr[i] = grub_strtoul (p, &p, 10); -+ } -+ -+ status = efi_call_10 (pxe->mtftp, -+ pxe, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE, -+ NULL, -+ 0, -+ &file_size, -+ NULL, -+ &server_ip, -+ (grub_efi_char8_t *)filename, -+ NULL, -+ 0); -+ -+ if (status != GRUB_EFI_SUCCESS) -+ return grub_error (GRUB_ERR_IO, "Couldn't get file size"); -+ -+ file->size = (grub_off_t)file_size; -+ file->not_easily_seekable = 0; -+ file->data = 0; -+ file->device->net->offset = 0; -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_err_t -+pxe_close (struct grub_efi_net_device *dev __attribute__((unused)), -+ int prefer_ip6 __attribute__((unused)), -+ grub_file_t file __attribute__((unused))) -+{ -+ file->offset = 0; -+ file->size = 0; -+ file->device->net->offset = 0; -+ -+ if (file->data) -+ { -+ grub_free (file->data); -+ file->data = NULL; -+ } -+ -+ return GRUB_ERR_NONE; -+} -+ -+static grub_ssize_t -+pxe_read (struct grub_efi_net_device *dev, -+ int prefer_ip6, -+ grub_file_t file, -+ char *buf, -+ grub_size_t len) -+{ -+ int i; -+ char *p; -+ grub_efi_status_t status; -+ grub_efi_pxe_t *pxe = (prefer_ip6) ? dev->ip6_pxe : dev->ip4_pxe; -+ grub_efi_uint64_t bufsz = len; -+ grub_efi_pxe_ip_address_t server_ip; -+ char *buf2 = NULL; -+ -+ if (file->data) -+ { -+ /* TODO: RANGE Check for offset and file size */ -+ grub_memcpy (buf, (char*)file->data + file->device->net->offset, len); -+ file->device->net->offset += len; -+ return len; -+ } -+ -+ if (file->device->net->offset) -+ { -+ grub_error (GRUB_ERR_BUG, "No Offet Read Possible"); -+ grub_print_error (); -+ return 0; -+ } -+ -+ if (pxe->mode->using_ipv6) -+ { -+ const char *rest; -+ grub_uint64_t ip6[2]; -+ if (parse_ip6 (file->device->net->server, ip6, &rest) && *rest == 0) -+ grub_memcpy (server_ip.v6.addr, ip6, sizeof (server_ip.v6.addr)); -+ /* TODO: ERROR Handling Here */ -+ } -+ else -+ { -+ for (i = 0, p = file->device->net->server; i < 4; ++i, ++p) -+ server_ip.v4.addr[i] = grub_strtoul (p, &p, 10); -+ } -+ -+ status = efi_call_10 (pxe->mtftp, -+ pxe, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_READ_FILE, -+ buf, -+ 0, -+ &bufsz, -+ NULL, -+ &server_ip, -+ (grub_efi_char8_t *)file->device->net->name, -+ NULL, -+ 0); -+ -+ if (bufsz != file->size) -+ { -+ grub_error (GRUB_ERR_BUG, "Short read should not happen here"); -+ grub_print_error (); -+ return 0; -+ } -+ -+ if (status == GRUB_EFI_BUFFER_TOO_SMALL) -+ { -+ -+ buf2 = grub_malloc (bufsz); -+ -+ if (!buf2) -+ { -+ grub_error (GRUB_ERR_OUT_OF_MEMORY, "ERROR OUT OF MEMORY"); -+ grub_print_error (); -+ return 0; -+ } -+ -+ status = efi_call_10 (pxe->mtftp, -+ pxe, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_READ_FILE, -+ buf2, -+ 0, -+ &bufsz, -+ NULL, -+ &server_ip, -+ (grub_efi_char8_t *)file->device->net->name, -+ NULL, -+ 0); -+ } -+ -+ if (status != GRUB_EFI_SUCCESS) -+ { -+ if (buf2) -+ grub_free (buf2); -+ -+ grub_error (GRUB_ERR_IO, "Failed to Read File"); -+ grub_print_error (); -+ return 0; -+ } -+ -+ if (buf2) -+ grub_memcpy (buf, buf2, len); -+ -+ file->device->net->offset = len; -+ -+ if (buf2) -+ file->data = buf2; -+ -+ return len; -+} -+ -+struct grub_efi_net_io io_pxe = -+ { -+ .configure = pxe_configure, -+ .open = pxe_open, -+ .read = pxe_read, -+ .close = pxe_close -+ }; -+ -diff --git a/grub-core/net/net.c b/grub-core/net/net.c -index a6566bdb00a..cfe4cb62760 100644 ---- a/grub-core/net/net.c -+++ b/grub-core/net/net.c -@@ -32,6 +32,9 @@ - #include - #include - #include -+#ifdef GRUB_MACHINE_EFI -+#include -+#endif - - GRUB_MOD_LICENSE ("GPLv3+"); - -@@ -1978,8 +1981,49 @@ static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute; - static grub_command_t cmd_lsroutes, cmd_lscards; - static grub_command_t cmd_lsaddr, cmd_slaac; - -+#ifdef GRUB_MACHINE_EFI -+ -+static enum { -+ INIT_MODE_NONE, -+ INIT_MODE_GRUB, -+ INIT_MODE_EFI -+} init_mode; -+ -+static grub_command_t cmd_bootp, cmd_bootp6; -+ -+#endif -+ - GRUB_MOD_INIT(net) - { -+#ifdef GRUB_MACHINE_EFI -+ if (grub_net_open) -+ return; -+ -+ if ((grub_efi_net_boot_from_https () || grub_efi_net_boot_from_opa ()) -+ && grub_efi_net_fs_init ()) -+ { -+ cmd_lsroutes = grub_register_command ("net_ls_routes", grub_efi_net_list_routes, -+ "", N_("list network routes")); -+ cmd_lscards = grub_register_command ("net_ls_cards", grub_efi_net_list_cards, -+ "", N_("list network cards")); -+ cmd_lsaddr = grub_register_command ("net_ls_addr", grub_efi_net_list_addrs, -+ "", N_("list network addresses")); -+ cmd_addaddr = grub_register_command ("net_add_addr", grub_efi_net_add_addr, -+ /* TRANSLATORS: HWADDRESS stands for -+ "hardware address". */ -+ N_("SHORTNAME CARD ADDRESS [HWADDRESS]"), -+ N_("Add a network address.")); -+ cmd_bootp = grub_register_command ("net_bootp", grub_efi_net_bootp, -+ N_("[CARD]"), -+ N_("perform a bootp autoconfiguration")); -+ cmd_bootp6 = grub_register_command ("net_bootp6", grub_efi_net_bootp6, -+ N_("[CARD]"), -+ N_("perform a bootp autoconfiguration")); -+ init_mode = INIT_MODE_EFI; -+ return; -+ } -+#endif -+ - grub_register_variable_hook ("net_default_server", defserver_get_env, - defserver_set_env); - grub_env_export ("net_default_server"); -@@ -2027,10 +2071,37 @@ GRUB_MOD_INIT(net) - grub_net_restore_hw, - GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK); - grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; -+ -+#ifdef GRUB_MACHINE_EFI -+ grub_env_set ("grub_netfs_type", "grub"); -+ grub_register_variable_hook ("grub_netfs_type", 0, grub_env_write_readonly); -+ grub_env_export ("grub_netfs_type"); -+ init_mode = INIT_MODE_GRUB; -+#endif -+ - } - - GRUB_MOD_FINI(net) - { -+ -+#ifdef GRUB_MACHINE_EFI -+ if (init_mode == INIT_MODE_NONE) -+ return; -+ -+ if (init_mode == INIT_MODE_EFI) -+ { -+ grub_unregister_command (cmd_lsroutes); -+ grub_unregister_command (cmd_lscards); -+ grub_unregister_command (cmd_lsaddr); -+ grub_unregister_command (cmd_addaddr); -+ grub_unregister_command (cmd_bootp); -+ grub_unregister_command (cmd_bootp6); -+ grub_efi_net_fs_fini (); -+ init_mode = INIT_MODE_NONE; -+ return; -+ } -+#endif -+ - grub_register_variable_hook ("net_default_server", 0, 0); - grub_register_variable_hook ("pxe_default_server", 0, 0); - -@@ -2049,4 +2120,7 @@ GRUB_MOD_FINI(net) - grub_net_fini_hw (0); - grub_loader_unregister_preboot_hook (fini_hnd); - grub_net_poll_cards_idle = grub_net_poll_cards_idle_real; -+#ifdef GRUB_MACHINE_EFI -+ init_mode = INIT_MODE_NONE; -+#endif - } -diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c -index 8366a1121a1..8997336e901 100644 ---- a/util/grub-mknetdir.c -+++ b/util/grub-mknetdir.c -@@ -32,13 +32,15 @@ - - static char *rootdir = NULL, *subdir = NULL; - static char *debug_image = NULL; -+static char efi_netfs = 0; - - enum - { - OPTION_NET_DIRECTORY = 0x301, - OPTION_SUBDIR, - OPTION_DEBUG, -- OPTION_DEBUG_IMAGE -+ OPTION_DEBUG_IMAGE, -+ OPTION_DEBUG_EFI_NETFS - }; - - static struct argp_option options[] = { -@@ -49,6 +51,7 @@ static struct argp_option options[] = { - 0, N_("relative subdirectory on network server"), 2}, - {"debug", OPTION_DEBUG, 0, OPTION_HIDDEN, 0, 2}, - {"debug-image", OPTION_DEBUG_IMAGE, N_("STRING"), OPTION_HIDDEN, 0, 2}, -+ {"debug-efi-netfs", OPTION_DEBUG_EFI_NETFS, 0, OPTION_HIDDEN, 0, 2}, - {0, 0, 0, 0, 0, 0} - }; - -@@ -67,6 +70,9 @@ argp_parser (int key, char *arg, struct argp_state *state) - free (subdir); - subdir = xstrdup (arg); - return 0; -+ case OPTION_DEBUG_EFI_NETFS: -+ efi_netfs = 1; -+ return 0; - /* This is an undocumented feature... */ - case OPTION_DEBUG: - verbosity++; -@@ -82,7 +88,6 @@ argp_parser (int key, char *arg, struct argp_state *state) - } - } - -- - struct argp argp = { - options, argp_parser, NULL, - "\v"N_("Prepares GRUB network boot images at net_directory/subdir " -@@ -92,7 +97,7 @@ struct argp argp = { - - static char *base; - --static const struct -+static struct - { - const char *mkimage_target; - const char *netmodule; -@@ -153,6 +158,7 @@ process_input_dir (const char *input_dir, enum grub_install_plat platform) - grub_install_push_module (targets[platform].netmodule); - - output = grub_util_path_concat_ext (2, grubdir, "core", targets[platform].ext); -+ - grub_install_make_image_wrap (input_dir, prefix, output, - 0, load_cfg, - targets[platform].mkimage_target, 0); -@@ -189,7 +195,16 @@ main (int argc, char *argv[]) - - grub_install_mkdir_p (base); - -- grub_install_push_module ("tftp"); -+ if (!efi_netfs) -+ { -+ grub_install_push_module ("tftp"); -+ grub_install_push_module ("http"); -+ } -+ else -+ { -+ targets[GRUB_INSTALL_PLATFORM_I386_EFI].netmodule = "efi_netfs"; -+ targets[GRUB_INSTALL_PLATFORM_X86_64_EFI].netmodule = "efi_netfs"; -+ } - - if (!grub_install_source_directory) - { -diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h -index 852daddfb0f..fbd1c4b529d 100644 ---- a/include/grub/efi/api.h -+++ b/include/grub/efi/api.h -@@ -549,6 +549,23 @@ typedef union - - typedef grub_efi_uint64_t grub_efi_physical_address_t; - typedef grub_efi_uint64_t grub_efi_virtual_address_t; -+typedef struct { -+ grub_uint8_t addr[4]; -+} grub_efi_pxe_ipv4_address_t; -+ -+typedef struct { -+ grub_uint8_t addr[16]; -+} grub_efi_pxe_ipv6_address_t; -+ -+typedef struct { -+ grub_uint8_t addr[32]; -+} grub_efi_pxe_mac_address_t; -+ -+typedef union { -+ grub_uint32_t addr[4]; -+ grub_efi_pxe_ipv4_address_t v4; -+ grub_efi_pxe_ipv6_address_t v6; -+} grub_efi_pxe_ip_address_t; - - struct grub_efi_guid - { -@@ -812,6 +829,8 @@ struct grub_efi_ipv6_device_path - grub_efi_uint16_t remote_port; - grub_efi_uint16_t protocol; - grub_efi_uint8_t static_ip_address; -+ grub_efi_uint8_t prefix_length; -+ grub_efi_ipv6_address_t gateway_ip_address; - } GRUB_PACKED; - typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t; - -@@ -861,6 +880,15 @@ struct grub_efi_uri_device_path - } GRUB_PACKED; - typedef struct grub_efi_uri_device_path grub_efi_uri_device_path_t; - -+#define GRUB_EFI_DNS_DEVICE_PATH_SUBTYPE 31 -+struct grub_efi_dns_device_path -+{ -+ grub_efi_device_path_t header; -+ grub_efi_uint8_t is_ipv6; -+ grub_efi_pxe_ip_address_t dns_server_ip[0]; -+} GRUB_PACKED; -+typedef struct grub_efi_dns_device_path grub_efi_dns_device_path_t; -+ - #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10 - - /* Media Device Path. */ -@@ -943,6 +971,23 @@ struct grub_efi_bios_device_path - } GRUB_PACKED; - typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t; - -+/* Service Binding definitions */ -+struct grub_efi_service_binding; -+ -+typedef grub_efi_status_t -+(*grub_efi_service_binding_create_child) (struct grub_efi_service_binding *this, -+ grub_efi_handle_t *child_handle); -+ -+typedef grub_efi_status_t -+(*grub_efi_service_binding_destroy_child) (struct grub_efi_service_binding *this, -+ grub_efi_handle_t *child_handle); -+ -+typedef struct grub_efi_service_binding -+{ -+ grub_efi_service_binding_create_child create_child; -+ grub_efi_service_binding_destroy_child destroy_child; -+} grub_efi_service_binding_t; -+ - struct grub_efi_open_protocol_information_entry - { - grub_efi_handle_t agent_handle; -@@ -1492,23 +1537,27 @@ typedef struct grub_efi_pxe_tftp_error - grub_efi_char8_t error_string[127]; - } grub_efi_pxe_tftp_error_t; - --typedef struct { -- grub_uint8_t addr[4]; --} grub_efi_pxe_ipv4_address_t; -+typedef grub_efi_uint16_t grub_efi_pxe_base_code_udp_port_t; - --typedef struct { -- grub_uint8_t addr[16]; --} grub_efi_pxe_ipv6_address_t; -+typedef enum { -+ GRUB_EFI_PXE_BASE_CODE_TFTP_FIRST, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_READ_FILE, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_WRITE_FILE, -+ GRUB_EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY, -+ GRUB_EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE, -+ GRUB_EFI_PXE_BASE_CODE_MTFTP_READ_FILE, -+ GRUB_EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY, -+ GRUB_EFI_PXE_BASE_CODE_MTFTP_LAST -+} grub_efi_pxe_base_code_tftp_opcode_t; - - typedef struct { -- grub_uint8_t addr[32]; --} grub_efi_pxe_mac_address_t; -- --typedef union { -- grub_uint32_t addr[4]; -- grub_efi_pxe_ipv4_address_t v4; -- grub_efi_pxe_ipv6_address_t v6; --} grub_efi_pxe_ip_address_t; -+ grub_efi_ip_address_t mcast_ip; -+ grub_efi_pxe_base_code_udp_port_t c_port; -+ grub_efi_pxe_base_code_udp_port_t s_port; -+ grub_efi_uint16_t listen_timeout; -+ grub_efi_uint16_t transmit_timeout; -+} grub_efi_pxe_base_code_mtftp_info_t; - - #define GRUB_EFI_PXE_BASE_CODE_MAX_IPCNT 8 - typedef struct grub_efi_pxe_ip_filter -@@ -1575,17 +1624,31 @@ typedef struct grub_efi_pxe_mode - typedef struct grub_efi_pxe - { - grub_uint64_t rev; -- void (*start) (void); -+ grub_efi_status_t (*start) (struct grub_efi_pxe *this, grub_efi_boolean_t use_ipv6); - void (*stop) (void); -- void (*dhcp) (void); -+ grub_efi_status_t (*dhcp) (struct grub_efi_pxe *this, -+ grub_efi_boolean_t sort_offers); - void (*discover) (void); -- void (*mftp) (void); -+ grub_efi_status_t (*mtftp) (struct grub_efi_pxe *this, -+ grub_efi_pxe_base_code_tftp_opcode_t operation, -+ void *buffer_ptr, -+ grub_efi_boolean_t overwrite, -+ grub_efi_uint64_t *buffer_size, -+ grub_efi_uintn_t *block_size, -+ grub_efi_pxe_ip_address_t *server_ip, -+ //grub_efi_ip_address_t *server_ip, -+ grub_efi_char8_t *filename, -+ grub_efi_pxe_base_code_mtftp_info_t *info, -+ grub_efi_boolean_t dont_use_buffer); - void (*udpwrite) (void); - void (*udpread) (void); - void (*setipfilter) (void); - void (*arp) (void); - void (*setparams) (void); -- void (*setstationip) (void); -+ grub_efi_status_t (*set_station_ip) (struct grub_efi_pxe *this, -+ grub_efi_pxe_ip_address_t *new_station_ip, -+ grub_efi_pxe_ip_address_t *new_subnet_mask); -+ //void (*setstationip) (void); - void (*setpackets) (void); - struct grub_efi_pxe_mode *mode; - } grub_efi_pxe_t; -@@ -1827,6 +1890,44 @@ struct grub_efi_ip4_config2_protocol - }; - typedef struct grub_efi_ip4_config2_protocol grub_efi_ip4_config2_protocol_t; - -+struct grub_efi_ip4_route_table { -+ grub_efi_ipv4_address_t subnet_address; -+ grub_efi_ipv4_address_t subnet_mask; -+ grub_efi_ipv4_address_t gateway_address; -+}; -+ -+typedef struct grub_efi_ip4_route_table grub_efi_ip4_route_table_t; -+ -+#define GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32 -+ -+struct grub_efi_ip4_config2_interface_info { -+ grub_efi_char16_t name[GRUB_EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE]; -+ grub_efi_uint8_t if_type; -+ grub_efi_uint32_t hw_address_size; -+ grub_efi_mac_address_t hw_address; -+ grub_efi_ipv4_address_t station_address; -+ grub_efi_ipv4_address_t subnet_mask; -+ grub_efi_uint32_t route_table_size; -+ grub_efi_ip4_route_table_t *route_table; -+}; -+ -+typedef struct grub_efi_ip4_config2_interface_info grub_efi_ip4_config2_interface_info_t; -+ -+enum grub_efi_ip4_config2_policy { -+ GRUB_EFI_IP4_CONFIG2_POLICY_STATIC, -+ GRUB_EFI_IP4_CONFIG2_POLICY_DHCP, -+ GRUB_EFI_IP4_CONFIG2_POLICY_MAX -+}; -+ -+typedef enum grub_efi_ip4_config2_policy grub_efi_ip4_config2_policy_t; -+ -+struct grub_efi_ip4_config2_manual_address { -+ grub_efi_ipv4_address_t address; -+ grub_efi_ipv4_address_t subnet_mask; -+}; -+ -+typedef struct grub_efi_ip4_config2_manual_address grub_efi_ip4_config2_manual_address_t; -+ - enum grub_efi_ip6_config_data_type { - GRUB_EFI_IP6_CONFIG_DATA_TYPE_INTERFACEINFO, - GRUB_EFI_IP6_CONFIG_DATA_TYPE_ALT_INTERFACEID, -@@ -1861,6 +1962,49 @@ struct grub_efi_ip6_config_protocol - }; - typedef struct grub_efi_ip6_config_protocol grub_efi_ip6_config_protocol_t; - -+enum grub_efi_ip6_config_policy { -+ GRUB_EFI_IP6_CONFIG_POLICY_MANUAL, -+ GRUB_EFI_IP6_CONFIG_POLICY_AUTOMATIC -+}; -+typedef enum grub_efi_ip6_config_policy grub_efi_ip6_config_policy_t; -+ -+struct grub_efi_ip6_address_info { -+ grub_efi_ipv6_address_t address; -+ grub_efi_uint8_t prefix_length; -+}; -+typedef struct grub_efi_ip6_address_info grub_efi_ip6_address_info_t; -+ -+struct grub_efi_ip6_route_table { -+ grub_efi_pxe_ipv6_address_t gateway; -+ grub_efi_pxe_ipv6_address_t destination; -+ grub_efi_uint8_t prefix_length; -+}; -+typedef struct grub_efi_ip6_route_table grub_efi_ip6_route_table_t; -+ -+struct grub_efi_ip6_config_interface_info { -+ grub_efi_char16_t name[32]; -+ grub_efi_uint8_t if_type; -+ grub_efi_uint32_t hw_address_size; -+ grub_efi_mac_address_t hw_address; -+ grub_efi_uint32_t address_info_count; -+ grub_efi_ip6_address_info_t *address_info; -+ grub_efi_uint32_t route_count; -+ grub_efi_ip6_route_table_t *route_table; -+}; -+typedef struct grub_efi_ip6_config_interface_info grub_efi_ip6_config_interface_info_t; -+ -+struct grub_efi_ip6_config_dup_addr_detect_transmits { -+ grub_efi_uint32_t dup_addr_detect_transmits; -+}; -+typedef struct grub_efi_ip6_config_dup_addr_detect_transmits grub_efi_ip6_config_dup_addr_detect_transmits_t; -+ -+struct grub_efi_ip6_config_manual_address { -+ grub_efi_ipv6_address_t address; -+ grub_efi_boolean_t is_anycast; -+ grub_efi_uint8_t prefix_length; -+}; -+typedef struct grub_efi_ip6_config_manual_address grub_efi_ip6_config_manual_address_t; -+ - #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \ - || defined (__aarch64__) || defined (__MINGW64__) || defined (__CYGWIN__) - -diff --git a/include/grub/efi/dhcp.h b/include/grub/efi/dhcp.h -new file mode 100644 -index 00000000000..fdb88eb810e ---- /dev/null -+++ b/include/grub/efi/dhcp.h -@@ -0,0 +1,343 @@ -+#ifndef GRUB_EFI_DHCP_HEADER -+#define GRUB_EFI_DHCP_HEADER 1 -+ -+#define GRUB_EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \ -+ { 0x9d9a39d8, 0xbd42, 0x4a73, \ -+ { 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \ -+ } -+ -+#define GRUB_EFI_DHCP4_PROTOCOL_GUID \ -+ { 0x8a219718, 0x4ef5, 0x4761, \ -+ { 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \ -+ } -+ -+#define GRUB_EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \ -+ { 0x9fb9a8a1, 0x2f4a, 0x43a6, \ -+ { 0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4 ,0x7a, 0xd5 } \ -+ } -+ -+#define GRUB_EFI_DHCP6_PROTOCOL_GUID \ -+ { 0x87c8bad7, 0x595, 0x4053, \ -+ { 0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b } \ -+ } -+ -+typedef struct grub_efi_dhcp4_protocol grub_efi_dhcp4_protocol_t; -+ -+enum grub_efi_dhcp4_state { -+ GRUB_EFI_DHCP4_STOPPED, -+ GRUB_EFI_DHCP4_INIT, -+ GRUB_EFI_DHCP4_SELECTING, -+ GRUB_EFI_DHCP4_REQUESTING, -+ GRUB_EFI_DHCP4_BOUND, -+ GRUB_EFI_DHCP4_RENEWING, -+ GRUB_EFI_DHCP4_REBINDING, -+ GRUB_EFI_DHCP4_INIT_REBOOT, -+ GRUB_EFI_DHCP4_REBOOTING -+}; -+ -+typedef enum grub_efi_dhcp4_state grub_efi_dhcp4_state_t; -+ -+struct grub_efi_dhcp4_header { -+ grub_efi_uint8_t op_code; -+ grub_efi_uint8_t hw_type; -+ grub_efi_uint8_t hw_addr_len; -+ grub_efi_uint8_t hops; -+ grub_efi_uint32_t xid; -+ grub_efi_uint16_t seconds; -+ grub_efi_uint16_t reserved; -+ grub_efi_ipv4_address_t client_addr; -+ grub_efi_ipv4_address_t your_addr; -+ grub_efi_ipv4_address_t server_addr; -+ grub_efi_ipv4_address_t gateway_addr; -+ grub_efi_uint8_t client_hw_addr[16]; -+ grub_efi_char8_t server_name[64]; -+ grub_efi_char8_t boot_file_name[128]; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp4_header grub_efi_dhcp4_header_t; -+ -+struct grub_efi_dhcp4_packet { -+ grub_efi_uint32_t size; -+ grub_efi_uint32_t length; -+ struct { -+ grub_efi_dhcp4_header_t header; -+ grub_efi_uint32_t magik; -+ grub_efi_uint8_t option[1]; -+ } dhcp4; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp4_packet grub_efi_dhcp4_packet_t; -+ -+struct grub_efi_dhcp4_listen_point { -+ grub_efi_ipv4_address_t listen_address; -+ grub_efi_ipv4_address_t subnet_mask; -+ grub_efi_uint16_t listen_port; -+}; -+ -+typedef struct grub_efi_dhcp4_listen_point grub_efi_dhcp4_listen_point_t; -+ -+struct grub_efi_dhcp4_transmit_receive_token { -+ grub_efi_status_t status; -+ grub_efi_event_t completion_event; -+ grub_efi_ipv4_address_t remote_address; -+ grub_efi_uint16_t remote_port; -+ grub_efi_ipv4_address_t gateway_address; -+ grub_efi_uint32_t listen_point_count; -+ grub_efi_dhcp4_listen_point_t *listen_points; -+ grub_efi_uint32_t timeout_value; -+ grub_efi_dhcp4_packet_t *packet; -+ grub_efi_uint32_t response_count; -+ grub_efi_dhcp4_packet_t *response_list; -+}; -+ -+typedef struct grub_efi_dhcp4_transmit_receive_token grub_efi_dhcp4_transmit_receive_token_t; -+ -+enum grub_efi_dhcp4_event { -+ GRUB_EFI_DHCP4_SEND_DISCOVER = 0X01, -+ GRUB_EFI_DHCP4_RCVD_OFFER, -+ GRUB_EFI_DHCP4_SELECT_OFFER, -+ GRUB_EFI_DHCP4_SEND_REQUEST, -+ GRUB_EFI_DHCP4_RCVD_ACK, -+ GRUB_EFI_DHCP4_RCVD_NAK, -+ GRUB_EFI_DHCP4_SEND_DECLINE, -+ GRUB_EFI_DHCP4_BOUND_COMPLETED, -+ GRUB_EFI_DHCP4_ENTER_RENEWING, -+ GRUB_EFI_DHCP4_ENTER_REBINDING, -+ GRUB_EFI_DHCP4_ADDRESS_LOST, -+ GRUB_EFI_DHCP4_FAIL -+}; -+ -+typedef enum grub_efi_dhcp4_event grub_efi_dhcp4_event_t; -+ -+struct grub_efi_dhcp4_packet_option { -+ grub_efi_uint8_t op_code; -+ grub_efi_uint8_t length; -+ grub_efi_uint8_t data[1]; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp4_packet_option grub_efi_dhcp4_packet_option_t; -+ -+struct grub_efi_dhcp4_config_data { -+ grub_efi_uint32_t discover_try_count; -+ grub_efi_uint32_t *discover_timeout; -+ grub_efi_uint32_t request_try_count; -+ grub_efi_uint32_t *request_timeout; -+ grub_efi_ipv4_address_t client_address; -+ grub_efi_status_t (*dhcp4_callback) ( -+ grub_efi_dhcp4_protocol_t *this, -+ void *context, -+ grub_efi_dhcp4_state_t current_state, -+ grub_efi_dhcp4_event_t dhcp4_event, -+ grub_efi_dhcp4_packet_t *packet, -+ grub_efi_dhcp4_packet_t **new_packet -+ ); -+ void *callback_context; -+ grub_efi_uint32_t option_count; -+ grub_efi_dhcp4_packet_option_t **option_list; -+}; -+ -+typedef struct grub_efi_dhcp4_config_data grub_efi_dhcp4_config_data_t; -+ -+struct grub_efi_dhcp4_mode_data { -+ grub_efi_dhcp4_state_t state; -+ grub_efi_dhcp4_config_data_t config_data; -+ grub_efi_ipv4_address_t client_address; -+ grub_efi_mac_address_t client_mac_address; -+ grub_efi_ipv4_address_t server_address; -+ grub_efi_ipv4_address_t router_address; -+ grub_efi_ipv4_address_t subnet_mask; -+ grub_efi_uint32_t lease_time; -+ grub_efi_dhcp4_packet_t *reply_packet; -+}; -+ -+typedef struct grub_efi_dhcp4_mode_data grub_efi_dhcp4_mode_data_t; -+ -+struct grub_efi_dhcp4_protocol { -+ grub_efi_status_t (*get_mode_data) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_dhcp4_mode_data_t *dhcp4_mode_data); -+ grub_efi_status_t (*configure) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_dhcp4_config_data_t *dhcp4_cfg_data); -+ grub_efi_status_t (*start) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_event_t completion_event); -+ grub_efi_status_t (*renew_rebind) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_boolean_t rebind_request, -+ grub_efi_event_t completion_event); -+ grub_efi_status_t (*release) (grub_efi_dhcp4_protocol_t *this); -+ grub_efi_status_t (*stop) (grub_efi_dhcp4_protocol_t *this); -+ grub_efi_status_t (*build) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_dhcp4_packet_t *seed_packet, -+ grub_efi_uint32_t delete_count, -+ grub_efi_uint8_t *delete_list, -+ grub_efi_uint32_t append_count, -+ grub_efi_dhcp4_packet_option_t *append_list[], -+ grub_efi_dhcp4_packet_t **new_packet); -+ grub_efi_status_t (*transmit_receive) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_dhcp4_transmit_receive_token_t *token); -+ grub_efi_status_t (*parse) (grub_efi_dhcp4_protocol_t *this, -+ grub_efi_dhcp4_packet_t *packet, -+ grub_efi_uint32_t *option_count, -+ grub_efi_dhcp4_packet_option_t *packet_option_list[]); -+}; -+ -+typedef struct grub_efi_dhcp6_protocol grub_efi_dhcp6_protocol_t; -+ -+struct grub_efi_dhcp6_retransmission { -+ grub_efi_uint32_t irt; -+ grub_efi_uint32_t mrc; -+ grub_efi_uint32_t mrt; -+ grub_efi_uint32_t mrd; -+}; -+ -+typedef struct grub_efi_dhcp6_retransmission grub_efi_dhcp6_retransmission_t; -+ -+enum grub_efi_dhcp6_event { -+ GRUB_EFI_DHCP6_SEND_SOLICIT, -+ GRUB_EFI_DHCP6_RCVD_ADVERTISE, -+ GRUB_EFI_DHCP6_SELECT_ADVERTISE, -+ GRUB_EFI_DHCP6_SEND_REQUEST, -+ GRUB_EFI_DHCP6_RCVD_REPLY, -+ GRUB_EFI_DHCP6_RCVD_RECONFIGURE, -+ GRUB_EFI_DHCP6_SEND_DECLINE, -+ GRUB_EFI_DHCP6_SEND_CONFIRM, -+ GRUB_EFI_DHCP6_SEND_RELEASE, -+ GRUB_EFI_DHCP6_SEND_RENEW, -+ GRUB_EFI_DHCP6_SEND_REBIND -+}; -+ -+typedef enum grub_efi_dhcp6_event grub_efi_dhcp6_event_t; -+ -+struct grub_efi_dhcp6_packet_option { -+ grub_efi_uint16_t op_code; -+ grub_efi_uint16_t op_len; -+ grub_efi_uint8_t data[1]; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp6_packet_option grub_efi_dhcp6_packet_option_t; -+ -+struct grub_efi_dhcp6_header { -+ grub_efi_uint32_t transaction_id:24; -+ grub_efi_uint32_t message_type:8; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp6_header grub_efi_dhcp6_header_t; -+ -+struct grub_efi_dhcp6_packet { -+ grub_efi_uint32_t size; -+ grub_efi_uint32_t length; -+ struct { -+ grub_efi_dhcp6_header_t header; -+ grub_efi_uint8_t option[1]; -+ } dhcp6; -+} GRUB_PACKED; -+ -+typedef struct grub_efi_dhcp6_packet grub_efi_dhcp6_packet_t; -+ -+struct grub_efi_dhcp6_ia_address { -+ grub_efi_ipv6_address_t ip_address; -+ grub_efi_uint32_t preferred_lifetime; -+ grub_efi_uint32_t valid_lifetime; -+}; -+ -+typedef struct grub_efi_dhcp6_ia_address grub_efi_dhcp6_ia_address_t; -+ -+enum grub_efi_dhcp6_state { -+ GRUB_EFI_DHCP6_INIT, -+ GRUB_EFI_DHCP6_SELECTING, -+ GRUB_EFI_DHCP6_REQUESTING, -+ GRUB_EFI_DHCP6_DECLINING, -+ GRUB_EFI_DHCP6_CONFIRMING, -+ GRUB_EFI_DHCP6_RELEASING, -+ GRUB_EFI_DHCP6_BOUND, -+ GRUB_EFI_DHCP6_RENEWING, -+ GRUB_EFI_DHCP6_REBINDING -+}; -+ -+typedef enum grub_efi_dhcp6_state grub_efi_dhcp6_state_t; -+ -+#define GRUB_EFI_DHCP6_IA_TYPE_NA 3 -+#define GRUB_EFI_DHCP6_IA_TYPE_TA 4 -+ -+struct grub_efi_dhcp6_ia_descriptor { -+ grub_efi_uint16_t type; -+ grub_efi_uint32_t ia_id; -+}; -+ -+typedef struct grub_efi_dhcp6_ia_descriptor grub_efi_dhcp6_ia_descriptor_t; -+ -+struct grub_efi_dhcp6_ia { -+ grub_efi_dhcp6_ia_descriptor_t descriptor; -+ grub_efi_dhcp6_state_t state; -+ grub_efi_dhcp6_packet_t *reply_packet; -+ grub_efi_uint32_t ia_address_count; -+ grub_efi_dhcp6_ia_address_t ia_address[1]; -+}; -+ -+typedef struct grub_efi_dhcp6_ia grub_efi_dhcp6_ia_t; -+ -+struct grub_efi_dhcp6_duid { -+ grub_efi_uint16_t length; -+ grub_efi_uint8_t duid[1]; -+}; -+ -+typedef struct grub_efi_dhcp6_duid grub_efi_dhcp6_duid_t; -+ -+struct grub_efi_dhcp6_mode_data { -+ grub_efi_dhcp6_duid_t *client_id; -+ grub_efi_dhcp6_ia_t *ia; -+}; -+ -+typedef struct grub_efi_dhcp6_mode_data grub_efi_dhcp6_mode_data_t; -+ -+struct grub_efi_dhcp6_config_data { -+ grub_efi_status_t (*dhcp6_callback) (grub_efi_dhcp6_protocol_t this, -+ void *context, -+ grub_efi_dhcp6_state_t current_state, -+ grub_efi_dhcp6_event_t dhcp6_event, -+ grub_efi_dhcp6_packet_t *packet, -+ grub_efi_dhcp6_packet_t **new_packet); -+ void *callback_context; -+ grub_efi_uint32_t option_count; -+ grub_efi_dhcp6_packet_option_t **option_list; -+ grub_efi_dhcp6_ia_descriptor_t ia_descriptor; -+ grub_efi_event_t ia_info_event; -+ grub_efi_boolean_t reconfigure_accept; -+ grub_efi_boolean_t rapid_commit; -+ grub_efi_dhcp6_retransmission_t *solicit_retransmission; -+}; -+ -+typedef struct grub_efi_dhcp6_config_data grub_efi_dhcp6_config_data_t; -+ -+struct grub_efi_dhcp6_protocol { -+ grub_efi_status_t (*get_mode_data) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_dhcp6_mode_data_t *dhcp6_mode_data, -+ grub_efi_dhcp6_config_data_t *dhcp6_config_data); -+ grub_efi_status_t (*configure) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_dhcp6_config_data_t *dhcp6_cfg_data); -+ grub_efi_status_t (*start) (grub_efi_dhcp6_protocol_t *this); -+ grub_efi_status_t (*info_request) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_boolean_t send_client_id, -+ grub_efi_dhcp6_packet_option_t *option_request, -+ grub_efi_uint32_t option_count, -+ grub_efi_dhcp6_packet_option_t *option_list[], -+ grub_efi_dhcp6_retransmission_t *retransmission, -+ grub_efi_event_t timeout_event, -+ grub_efi_status_t (*reply_callback) (grub_efi_dhcp6_protocol_t *this, -+ void *context, -+ grub_efi_dhcp6_packet_t *packet), -+ void *callback_context); -+ grub_efi_status_t (*renew_rebind) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_boolean_t rebind_request); -+ grub_efi_status_t (*decline) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_uint32_t address_count, -+ grub_efi_ipv6_address_t *addresses); -+ grub_efi_status_t (*release) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_uint32_t address_count, -+ grub_efi_ipv6_address_t *addresses); -+ grub_efi_status_t (*stop) (grub_efi_dhcp6_protocol_t *this); -+ grub_efi_status_t (*parse) (grub_efi_dhcp6_protocol_t *this, -+ grub_efi_dhcp6_packet_t *packet, -+ grub_efi_uint32_t *option_count, -+ grub_efi_dhcp6_packet_option_t *packet_option_list[]); -+}; -+ -+#endif /* ! GRUB_EFI_DHCP_HEADER */ -diff --git a/include/grub/efi/http.h b/include/grub/efi/http.h -new file mode 100644 -index 00000000000..c5e9a89f505 ---- /dev/null -+++ b/include/grub/efi/http.h -@@ -0,0 +1,215 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2006,2007,2008 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_HTTP_HEADER -+#define GRUB_EFI_HTTP_HEADER 1 -+ -+#include -+#include -+#include -+ -+#define GRUB_EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \ -+ { 0xbdc8e6af, 0xd9bc, 0x4379, \ -+ { 0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c } \ -+ } -+ -+#define GRUB_EFI_HTTP_PROTOCOL_GUID \ -+ { 0x7A59B29B, 0x910B, 0x4171, \ -+ { 0x82, 0x42, 0xA8, 0x5A, 0x0D, 0xF2, 0x5B, 0x5B } \ -+ } -+ -+#define EFIHTTP_WAIT_TIME 10000 // 10000ms = 10s -+#define EFIHTTP_RX_BUF_LEN 10240 -+ -+//****************************************** -+// Protocol Interface Structure -+//****************************************** -+struct grub_efi_http; -+ -+//****************************************** -+// EFI_HTTP_VERSION -+//****************************************** -+typedef enum { -+ GRUB_EFI_HTTPVERSION10, -+ GRUB_EFI_HTTPVERSION11, -+ GRUB_EFI_HTTPVERSIONUNSUPPORTED -+} grub_efi_http_version_t; -+ -+//****************************************** -+// EFI_HTTPv4_ACCESS_POINT -+//****************************************** -+typedef struct { -+ grub_efi_boolean_t use_default_address; -+ grub_efi_ipv4_address_t local_address; -+ grub_efi_ipv4_address_t local_subnet; -+ grub_efi_uint16_t local_port; -+} grub_efi_httpv4_access_point_t; -+ -+//****************************************** -+// EFI_HTTPv6_ACCESS_POINT -+//****************************************** -+typedef struct { -+ grub_efi_ipv6_address_t local_address; -+ grub_efi_uint16_t local_port; -+} grub_efi_httpv6_access_point_t; -+ -+//****************************************** -+// EFI_HTTP_CONFIG_DATA -+//****************************************** -+typedef struct { -+ grub_efi_http_version_t http_version; -+ grub_efi_uint32_t timeout_millisec; -+ grub_efi_boolean_t local_address_is_ipv6; -+ union { -+ grub_efi_httpv4_access_point_t *ipv4_node; -+ grub_efi_httpv6_access_point_t *ipv6_node; -+ } access_point; -+} grub_efi_http_config_data_t; -+ -+//****************************************** -+// EFI_HTTP_METHOD -+//****************************************** -+typedef enum { -+ GRUB_EFI_HTTPMETHODGET, -+ GRUB_EFI_HTTPMETHODPOST, -+ GRUB_EFI_HTTPMETHODPATCH, -+ GRUB_EFI_HTTPMETHODOPTIONS, -+ GRUB_EFI_HTTPMETHODCONNECT, -+ GRUB_EFI_HTTPMETHODHEAD, -+ GRUB_EFI_HTTPMETHODPUT, -+ GRUB_EFI_HTTPMETHODDELETE, -+ GRUB_EFI_HTTPMETHODTRACE, -+} grub_efi_http_method_t; -+ -+//****************************************** -+// EFI_HTTP_REQUEST_DATA -+//****************************************** -+typedef struct { -+ grub_efi_http_method_t method; -+ grub_efi_char16_t *url; -+} grub_efi_http_request_data_t; -+ -+typedef enum { -+ GRUB_EFI_HTTP_STATUS_UNSUPPORTED_STATUS = 0, -+ GRUB_EFI_HTTP_STATUS_100_CONTINUE, -+ GRUB_EFI_HTTP_STATUS_101_SWITCHING_PROTOCOLS, -+ GRUB_EFI_HTTP_STATUS_200_OK, -+ GRUB_EFI_HTTP_STATUS_201_CREATED, -+ GRUB_EFI_HTTP_STATUS_202_ACCEPTED, -+ GRUB_EFI_HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION, -+ GRUB_EFI_HTTP_STATUS_204_NO_CONTENT, -+ GRUB_EFI_HTTP_STATUS_205_RESET_CONTENT, -+ GRUB_EFI_HTTP_STATUS_206_PARTIAL_CONTENT, -+ GRUB_EFI_HTTP_STATUS_300_MULTIPLE_CHIOCES, -+ GRUB_EFI_HTTP_STATUS_301_MOVED_PERMANENTLY, -+ GRUB_EFI_HTTP_STATUS_302_FOUND, -+ GRUB_EFI_HTTP_STATUS_303_SEE_OTHER, -+ GRUB_EFI_HTTP_STATUS_304_NOT_MODIFIED, -+ GRUB_EFI_HTTP_STATUS_305_USE_PROXY, -+ GRUB_EFI_HTTP_STATUS_307_TEMPORARY_REDIRECT, -+ GRUB_EFI_HTTP_STATUS_400_BAD_REQUEST, -+ GRUB_EFI_HTTP_STATUS_401_UNAUTHORIZED, -+ GRUB_EFI_HTTP_STATUS_402_PAYMENT_REQUIRED, -+ GRUB_EFI_HTTP_STATUS_403_FORBIDDEN, -+ GRUB_EFI_HTTP_STATUS_404_NOT_FOUND, -+ GRUB_EFI_HTTP_STATUS_405_METHOD_NOT_ALLOWED, -+ GRUB_EFI_HTTP_STATUS_406_NOT_ACCEPTABLE, -+ GRUB_EFI_HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED, -+ GRUB_EFI_HTTP_STATUS_408_REQUEST_TIME_OUT, -+ GRUB_EFI_HTTP_STATUS_409_CONFLICT, -+ GRUB_EFI_HTTP_STATUS_410_GONE, -+ GRUB_EFI_HTTP_STATUS_411_LENGTH_REQUIRED, -+ GRUB_EFI_HTTP_STATUS_412_PRECONDITION_FAILED, -+ GRUB_EFI_HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE, -+ GRUB_EFI_HTTP_STATUS_414_REQUEST_URI_TOO_LARGE, -+ GRUB_EFI_HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE, -+ GRUB_EFI_HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED, -+ GRUB_EFI_HTTP_STATUS_417_EXPECTATION_FAILED, -+ GRUB_EFI_HTTP_STATUS_500_INTERNAL_SERVER_ERROR, -+ GRUB_EFI_HTTP_STATUS_501_NOT_IMPLEMENTED, -+ GRUB_EFI_HTTP_STATUS_502_BAD_GATEWAY, -+ GRUB_EFI_HTTP_STATUS_503_SERVICE_UNAVAILABLE, -+ GRUB_EFI_HTTP_STATUS_504_GATEWAY_TIME_OUT, -+ GRUB_EFI_HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED -+} grub_efi_http_status_code_t; -+ -+//****************************************** -+// EFI_HTTP_RESPONSE_DATA -+//****************************************** -+typedef struct { -+ grub_efi_http_status_code_t status_code; -+} grub_efi_http_response_data_t; -+ -+//****************************************** -+// EFI_HTTP_HEADER -+//****************************************** -+typedef struct { -+ grub_efi_char8_t *field_name; -+ grub_efi_char8_t *field_value; -+} grub_efi_http_header_t; -+ -+//****************************************** -+// EFI_HTTP_MESSAGE -+//****************************************** -+typedef struct { -+ union { -+ grub_efi_http_request_data_t *request; -+ grub_efi_http_response_data_t *response; -+ } data; -+ grub_efi_uint32_t header_count; -+ grub_efi_http_header_t *headers; -+ grub_efi_uint32_t body_length; -+ void *body; -+} grub_efi_http_message_t; -+ -+//****************************************** -+// EFI_HTTP_TOKEN -+//****************************************** -+typedef struct { -+ grub_efi_event_t event; -+ grub_efi_status_t status; -+ grub_efi_http_message_t *message; -+} grub_efi_http_token_t; -+ -+struct grub_efi_http { -+ grub_efi_status_t -+ (*get_mode_data) (struct grub_efi_http *this, -+ grub_efi_http_config_data_t *http_config_data); -+ -+ grub_efi_status_t -+ (*configure) (struct grub_efi_http *this, -+ grub_efi_http_config_data_t *http_config_data); -+ -+ grub_efi_status_t -+ (*request) (struct grub_efi_http *this, -+ grub_efi_http_token_t *token); -+ -+ grub_efi_status_t -+ (*cancel) (struct grub_efi_http *this, -+ grub_efi_http_token_t *token); -+ -+ grub_efi_status_t -+ (*response) (struct grub_efi_http *this, -+ grub_efi_http_token_t *token); -+ -+ grub_efi_status_t -+ (*poll) (struct grub_efi_http *this); -+}; -+typedef struct grub_efi_http grub_efi_http_t; -+ -+#endif /* !GRUB_EFI_HTTP_HEADER */ -diff --git a/include/grub/net/efi.h b/include/grub/net/efi.h -new file mode 100644 -index 00000000000..de90d223e8e ---- /dev/null -+++ b/include/grub/net/efi.h -@@ -0,0 +1,144 @@ -+#ifndef GRUB_NET_EFI_HEADER -+#define GRUB_NET_EFI_HEADER 1 -+ -+#include -+#include -+#include -+#include -+ -+typedef struct grub_efi_net_interface grub_efi_net_interface_t; -+typedef struct grub_efi_net_ip_config grub_efi_net_ip_config_t; -+typedef union grub_efi_net_ip_address grub_efi_net_ip_address_t; -+typedef struct grub_efi_net_ip_manual_address grub_efi_net_ip_manual_address_t; -+ -+struct grub_efi_net_interface -+{ -+ char *name; -+ int prefer_ip6; -+ struct grub_efi_net_device *dev; -+ struct grub_efi_net_io *io; -+ grub_efi_net_ip_config_t *ip_config; -+ int io_type; -+ struct grub_efi_net_interface *next; -+}; -+ -+#define efi_net_interface_get_hw_address(inf) inf->ip_config->get_hw_address (inf->dev) -+#define efi_net_interface_get_address(inf) inf->ip_config->get_address (inf->dev) -+#define efi_net_interface_get_route_table(inf) inf->ip_config->get_route_table (inf->dev) -+#define efi_net_interface_set_address(inf, addr, with_subnet) inf->ip_config->set_address (inf->dev, addr, with_subnet) -+#define efi_net_interface_set_gateway(inf, addr) inf->ip_config->set_gateway (inf->dev, addr) -+#define efi_net_interface_set_dns(inf, addr) inf->ip_config->set_dns (inf->dev, addr) -+ -+struct grub_efi_net_ip_config -+{ -+ char * (*get_hw_address) (struct grub_efi_net_device *dev); -+ char * (*get_address) (struct grub_efi_net_device *dev); -+ char ** (*get_route_table) (struct grub_efi_net_device *dev); -+ grub_efi_net_interface_t * (*best_interface) (struct grub_efi_net_device *dev, grub_efi_net_ip_address_t *address); -+ int (*set_address) (struct grub_efi_net_device *dev, grub_efi_net_ip_manual_address_t *net_ip, int with_subnet); -+ int (*set_gateway) (struct grub_efi_net_device *dev, grub_efi_net_ip_address_t *address); -+ int (*set_dns) (struct grub_efi_net_device *dev, grub_efi_net_ip_address_t *dns); -+}; -+ -+union grub_efi_net_ip_address -+{ -+ grub_efi_ipv4_address_t ip4; -+ grub_efi_ipv6_address_t ip6; -+}; -+ -+struct grub_efi_net_ip_manual_address -+{ -+ int is_ip6; -+ union -+ { -+ grub_efi_ip4_config2_manual_address_t ip4; -+ grub_efi_ip6_config_manual_address_t ip6; -+ }; -+}; -+ -+struct grub_efi_net_device -+{ -+ grub_efi_handle_t handle; -+ grub_efi_ip4_config2_protocol_t *ip4_config; -+ grub_efi_ip6_config_protocol_t *ip6_config; -+ grub_efi_handle_t http_handle; -+ grub_efi_http_t *http; -+ grub_efi_handle_t ip4_pxe_handle; -+ grub_efi_pxe_t *ip4_pxe; -+ grub_efi_handle_t ip6_pxe_handle; -+ grub_efi_pxe_t *ip6_pxe; -+ grub_efi_handle_t dhcp4_handle; -+ grub_efi_dhcp4_protocol_t *dhcp4; -+ grub_efi_handle_t dhcp6_handle; -+ grub_efi_dhcp6_protocol_t *dhcp6; -+ char *card_name; -+ grub_efi_net_interface_t *net_interfaces; -+ struct grub_efi_net_device *next; -+}; -+ -+struct grub_efi_net_io -+{ -+ void (*configure) (struct grub_efi_net_device *dev, int prefer_ip6); -+ grub_err_t (*open) (struct grub_efi_net_device *dev, -+ int prefer_ip6, -+ grub_file_t file, -+ const char *filename, -+ int type); -+ grub_ssize_t (*read) (struct grub_efi_net_device *dev, -+ int prefer_ip6, -+ grub_file_t file, -+ char *buf, -+ grub_size_t len); -+ grub_err_t (*close) (struct grub_efi_net_device *dev, -+ int prefer_ip6, -+ grub_file_t file); -+}; -+ -+extern struct grub_efi_net_device *net_devices; -+ -+extern struct grub_efi_net_io io_http; -+extern struct grub_efi_net_io io_pxe; -+ -+extern grub_efi_net_ip_config_t *efi_net_ip4_config; -+extern grub_efi_net_ip_config_t *efi_net_ip6_config; -+ -+char * -+grub_efi_ip4_address_to_string (grub_efi_ipv4_address_t *address); -+ -+char * -+grub_efi_ip6_address_to_string (grub_efi_pxe_ipv6_address_t *address); -+ -+char * -+grub_efi_hw_address_to_string (grub_efi_uint32_t hw_address_size, grub_efi_mac_address_t hw_address); -+ -+int -+grub_efi_string_to_ip4_address (const char *val, grub_efi_ipv4_address_t *address, const char **rest); -+ -+int -+grub_efi_string_to_ip6_address (const char *val, grub_efi_ipv6_address_t *address, const char **rest); -+ -+char * -+grub_efi_ip6_interface_name (struct grub_efi_net_device *dev); -+ -+char * -+grub_efi_ip4_interface_name (struct grub_efi_net_device *dev); -+ -+grub_efi_net_interface_t * -+grub_efi_net_create_interface (struct grub_efi_net_device *dev, -+ const char *interface_name, -+ grub_efi_net_ip_manual_address_t *net_ip, -+ int has_subnet); -+ -+int grub_efi_net_fs_init (void); -+void grub_efi_net_fs_fini (void); -+int grub_efi_net_boot_from_https (void); -+int grub_efi_net_boot_from_opa (void); -+ -+extern grub_command_func_t grub_efi_net_list_routes; -+extern grub_command_func_t grub_efi_net_list_cards; -+extern grub_command_func_t grub_efi_net_list_addrs; -+extern grub_command_func_t grub_efi_net_add_addr; -+extern grub_command_func_t grub_efi_net_bootp; -+extern grub_command_func_t grub_efi_net_bootp6; -+ -+#endif /* ! GRUB_NET_EFI_HEADER */ diff --git a/SOURCES/0266-efinet-Setting-network-from-UEFI-device-path.patch b/SOURCES/0266-efinet-Setting-network-from-UEFI-device-path.patch deleted file mode 100644 index 1084075..0000000 --- a/SOURCES/0266-efinet-Setting-network-from-UEFI-device-path.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Sun, 10 Jul 2016 23:46:31 +0800 -Subject: [PATCH] efinet: Setting network from UEFI device path - -The PXE Base Code protocol used to obtain cached PXE DHCPACK packet is no -longer provided for HTTP Boot. Instead, we have to get the HTTP boot -information from the device path nodes defined in following UEFI Specification -sections. - - 9.3.5.12 IPv4 Device Path - 9.3.5.13 IPv6 Device Path - 9.3.5.23 Uniform Resource Identifiers (URI) Device Path - -This patch basically does: - -include/grub/efi/api.h: -Add new structure of Uniform Resource Identifiers (URI) Device Path - -grub-core/net/drivers/efi/efinet.c: -Check if PXE Base Code is available, if not it will try to obtain the netboot -information from the device path where the image booted from. The DHCPACK -packet is recoverd from the information in device patch and feed into the same -DHCP packet processing functions to ensure the network interface is setting up -the same way it used to be. - -Signed-off-by: Michael Chang -Signed-off-by: Ken Lin ---- - grub-core/net/drivers/efi/efinet.c | 14 +++++--------- - 1 file changed, 5 insertions(+), 9 deletions(-) - -diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index 3bea6221745..a161e7a5f26 100644 ---- a/grub-core/net/drivers/efi/efinet.c -+++ b/grub-core/net/drivers/efi/efinet.c -@@ -475,9 +475,6 @@ grub_efinet_create_dhcp_ack_from_device_path (grub_efi_device_path_t *dp, int *u - grub_err_t err; - - ddp = grub_efi_duplicate_device_path (dp); -- if (!ddp) -- return NULL; -- - ldp = grub_efi_find_last_device_path (ddp); - - if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE -@@ -754,7 +751,7 @@ 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; -+ struct grub_efi_pxe_mode *pxe_mode = NULL; - grub_uint8_t *packet_buf; - grub_size_t packet_bufsz ; - int ipv6; -@@ -841,11 +838,10 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, - if (ipv6) - { - 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; -+ if (pxe_mode) -+ grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n", -+ pxe_mode->dhcp_ack_received ? "yes" : "no", -+ pxe_mode->dhcp_ack_received ? "" : " cannot continue"); - - grub_net_configure_by_dhcpv6_reply (card->name, card, 0, - (struct grub_net_dhcp6_packet *) diff --git a/SOURCES/0267-AUDIT-0-http-boot-tracker-bug.patch b/SOURCES/0267-AUDIT-0-http-boot-tracker-bug.patch deleted file mode 100644 index d6b2107..0000000 --- a/SOURCES/0267-AUDIT-0-http-boot-tracker-bug.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sebastian Krahmer -Date: Tue, 28 Nov 2017 17:24:38 +0800 -Subject: [PATCH] AUDIT-0: http boot tracker bug - -Fixing a memory leak in case of error, and a integer overflow, leading to a -heap overflow due to overly large chunk sizes. - -We need to check against some maximum value, otherwise values like 0xffffffff -will eventually lead in the allocation functions to small sized buffers, since -the len is rounded up to the next reasonable alignment. The following memcpy -will then smash the heap, leading to RCE. - -This is no big issue for pure http boot, since its going to execute an -untrusted kernel anyway, but it will break trusted boot scenarios, where only -signed code is allowed to be executed. - -Signed-off-by: Michael Chang ---- - grub-core/net/efi/net.c | 4 +++- - grub-core/net/http.c | 5 ++++- - 2 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 9e0078ac1c6..2bf15447fd5 100644 ---- a/grub-core/net/efi/net.c -+++ b/grub-core/net/efi/net.c -@@ -645,8 +645,10 @@ grub_efihttp_chunk_read (grub_file_t file, char *buf, - - rd = efi_net_interface (read, file, chunk, sz); - -- if (rd <= 0) -+ if (rd <= 0) { -+ grub_free (chunk); - return rd; -+ } - - if (buf) - { -diff --git a/grub-core/net/http.c b/grub-core/net/http.c -index 2b46e4672fc..82515f352dd 100644 ---- a/grub-core/net/http.c -+++ b/grub-core/net/http.c -@@ -31,7 +31,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); - - enum - { -- HTTP_PORT = 80 -+ HTTP_PORT = 80, -+ HTTP_MAX_CHUNK_SIZE = 0x80000000 - }; - - -@@ -78,6 +79,8 @@ parse_line (grub_file_t file, http_data_t data, char *ptr, grub_size_t len) - if (data->in_chunk_len == 2) - { - data->chunk_rem = grub_strtoul (ptr, 0, 16); -+ if (data->chunk_rem > HTTP_MAX_CHUNK_SIZE) -+ return GRUB_ERR_NET_PACKET_TOO_BIG; - grub_errno = GRUB_ERR_NONE; - if (data->chunk_rem == 0) - { diff --git a/SOURCES/0268-xfs-accept-filesystem-with-sparse-inodes.patch b/SOURCES/0268-xfs-accept-filesystem-with-sparse-inodes.patch deleted file mode 100644 index 84502ae..0000000 --- a/SOURCES/0268-xfs-accept-filesystem-with-sparse-inodes.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Eric Sandeen -Date: Tue, 15 May 2018 14:55:55 -0500 -Subject: [PATCH] xfs: accept filesystem with sparse inodes - -The sparse inode metadata format became a mkfs.xfs default in -xfsprogs-4.16.0, and such filesystems are now rejected by grub as -containing an incompatible feature. - -In essence, this feature allows xfs to allocate inodes into fragmented -freespace. (Without this feature, if xfs could not allocate contiguous -space for 64 new inodes, inode creation would fail.) - -In practice, the disk format change is restricted to the inode btree, -which as far as I can tell is not used by grub. If all you're doing -today is parsing a directory, reading an inode number, and converting -that inode number to a disk location, then ignoring this feature -should be fine, so I've added it to XFS_SB_FEAT_INCOMPAT_SUPPORTED - -I did some brief testing of this patch by hacking up the regression -tests to completely fragment freespace on the test xfs filesystem, and -then write a large-ish number of inodes to consume any existing -contiguous 64-inode chunk. This way any files the grub tests add and -traverse would be in such a fragmented inode allocation. Tests passed, -but I'm not sure how to cleanly integrate that into the test harness. - -Signed-off-by: Eric Sandeen ---- - grub-core/fs/xfs.c | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 72492915533..852155b1bf3 100644 ---- a/grub-core/fs/xfs.c -+++ b/grub-core/fs/xfs.c -@@ -76,8 +76,22 @@ GRUB_MOD_LICENSE ("GPLv3+"); - - /* incompat feature flags */ - #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ -+#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ -+#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ -+ -+/* -+ * Directory entries with ftype are explicitly handled by grub code. -+ * -+ * We do not currently verify metadata UUID, so it is safe to read filesystems -+ * with the XFS_SB_FEAT_INCOMPAT_META_UUID feature. -+ * -+ * We do not currently read the inode btrees, so it is safe to read filesystems -+ * with the XFS_SB_FEAT_INCOMPAT_SPINODES feature. -+ */ - #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ -- (XFS_SB_FEAT_INCOMPAT_FTYPE) -+ (XFS_SB_FEAT_INCOMPAT_FTYPE | \ -+ XFS_SB_FEAT_INCOMPAT_SPINODES | \ -+ XFS_SB_FEAT_INCOMPAT_META_UUID) - - struct grub_xfs_sblock - { diff --git a/SOURCES/0269-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch b/SOURCES/0269-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch deleted file mode 100644 index 33cde3b..0000000 --- a/SOURCES/0269-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alexander Graf -Date: Wed, 1 Feb 2017 23:10:45 +0100 -Subject: [PATCH] grub-core/video/efi_gop.c: Add support for BLT_ONLY adapters - -EFI GOP has support for multiple different bitness types of frame buffers -and for a special "BLT only" type which is always defined to be RGBx. - -Because grub2 doesn't ever directly access the frame buffer but instead -only renders graphics via the BLT interface anyway, we can easily support -these adapters. - -The reason this has come up now is the emerging support for virtio-gpu -in OVMF. That adapter does not have the notion of a memory mapped frame -buffer and thus is BLT only. - -Signed-off-by: Alexander Graf ---- - grub-core/video/efi_gop.c | 2 ++ - include/grub/efi/graphics_output.h | 3 ++- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c -index 7f9d1c2dfa1..c9e40e8d4e9 100644 ---- a/grub-core/video/efi_gop.c -+++ b/grub-core/video/efi_gop.c -@@ -121,6 +121,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in) - { - case GRUB_EFI_GOT_BGRA8: - case GRUB_EFI_GOT_RGBA8: -+ case GRUB_EFI_GOT_BLT_ONLY: - return 32; - - case GRUB_EFI_GOT_BITMASK: -@@ -187,6 +188,7 @@ grub_video_gop_fill_real_mode_info (unsigned mode, - switch (in->pixel_format) - { - case GRUB_EFI_GOT_RGBA8: -+ case GRUB_EFI_GOT_BLT_ONLY: - out->red_mask_size = 8; - out->red_field_pos = 0; - out->green_mask_size = 8; -diff --git a/include/grub/efi/graphics_output.h b/include/grub/efi/graphics_output.h -index 12977741192..e4388127c66 100644 ---- a/include/grub/efi/graphics_output.h -+++ b/include/grub/efi/graphics_output.h -@@ -28,7 +28,8 @@ typedef enum - { - GRUB_EFI_GOT_RGBA8, - GRUB_EFI_GOT_BGRA8, -- GRUB_EFI_GOT_BITMASK -+ GRUB_EFI_GOT_BITMASK, -+ GRUB_EFI_GOT_BLT_ONLY, - } - grub_efi_gop_pixel_format_t; - diff --git a/SOURCES/0270-efi-uga-use-64-bit-for-fb_base.patch b/SOURCES/0270-efi-uga-use-64-bit-for-fb_base.patch deleted file mode 100644 index 391bdb2..0000000 --- a/SOURCES/0270-efi-uga-use-64-bit-for-fb_base.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Wed, 16 May 2018 13:06:04 -0400 -Subject: [PATCH] efi/uga: use 64 bit for fb_base - -We get 64 bit from PCI BAR but then truncate by assigning to 32 bit. -Make sure to check that pointer does not overflow on 32 bit platform. - -Closes: 50931 ---- - grub-core/video/efi_uga.c | 31 ++++++++++++++++--------------- - 1 file changed, 16 insertions(+), 15 deletions(-) - -diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c -index 464ede874da..1d4091c5631 100644 ---- a/grub-core/video/efi_uga.c -+++ b/grub-core/video/efi_uga.c -@@ -34,7 +34,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); - - static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; - static struct grub_efi_uga_draw_protocol *uga; --static grub_uint32_t uga_fb; -+static grub_uint64_t uga_fb; - static grub_uint32_t uga_pitch; - - static struct -@@ -52,7 +52,7 @@ static struct - #define FBTEST_COUNT 8 - - static int --find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) -+find_line_len (grub_uint64_t *fb_base, grub_uint32_t *line_len) - { - grub_uint32_t *base = (grub_uint32_t *) (grub_addr_t) *fb_base; - int i; -@@ -67,7 +67,7 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) - { - if ((base[j] & RGB_MASK) == RGB_MAGIC) - { -- *fb_base = (grub_uint32_t) (grub_addr_t) base; -+ *fb_base = (grub_uint64_t) (grub_addr_t) base; - *line_len = j << 2; - - return 1; -@@ -84,7 +84,7 @@ find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) - /* Context for find_framebuf. */ - struct find_framebuf_ctx - { -- grub_uint32_t *fb_base; -+ grub_uint64_t *fb_base; - grub_uint32_t *line_len; - int found; - }; -@@ -120,7 +120,9 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) - if (i == 5) - break; - -- old_bar2 = grub_pci_read (addr + 4); -+ i++; -+ addr += 4; -+ old_bar2 = grub_pci_read (addr); - } - else - old_bar2 = 0; -@@ -129,10 +131,15 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) - base64 <<= 32; - base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); - -- grub_dprintf ("fb", "%s(%d): 0x%llx\n", -+ grub_dprintf ("fb", "%s(%d): 0x%" PRIxGRUB_UINT64_T "\n", - ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? -- "VMEM" : "MMIO"), i, -- (unsigned long long) base64); -+ "VMEM" : "MMIO"), type == GRUB_PCI_ADDR_MEM_TYPE_64 ? i - 1 : i, -+ base64); -+ -+#if GRUB_CPU_SIZEOF_VOID_P == 4 -+ if (old_bar2) -+ continue; -+#endif - - if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! ctx->found)) - { -@@ -140,12 +147,6 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) - if (find_line_len (ctx->fb_base, ctx->line_len)) - ctx->found++; - } -- -- if (type == GRUB_PCI_ADDR_MEM_TYPE_64) -- { -- i++; -- addr += 4; -- } - } - } - -@@ -153,7 +154,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) - } - - static int --find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) -+find_framebuf (grub_uint64_t *fb_base, grub_uint32_t *line_len) - { - struct find_framebuf_ctx ctx = { - .fb_base = fb_base, diff --git a/SOURCES/0271-Fix-grub-setpassword-o-s-output-path.patch b/SOURCES/0271-Fix-grub-setpassword-o-s-output-path.patch deleted file mode 100644 index 6bf5751..0000000 --- a/SOURCES/0271-Fix-grub-setpassword-o-s-output-path.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andy Lutomirski -Date: Sun, 11 Jun 2017 19:17:40 -0400 -Subject: [PATCH] Fix grub-setpassword -o's output path - -The output path is set up in the command line parsing, but completely ignored -in the code that actually writes the files. This patch fixes that. - -Signed-off-by: Peter Jones ---- - util/grub-setpassword.in | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in -index d7924af5192..9ca7114f904 100755 ---- a/util/grub-setpassword.in -+++ b/util/grub-setpassword.in -@@ -117,11 +117,11 @@ fi - - # on the ESP, these will fail to set the permissions, but it's okay because - # the directory is protected. --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" -+install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : -+chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || : -+echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg" - --if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then -+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${OUTPUT_PATH}/grub.cfg"; then - echo "WARNING: The current configuration lacks password support!" - echo "Update your configuration with @grub_mkconfig@ to support this feature." - fi diff --git a/SOURCES/0272-Verify-modules-on-build-time-rather-than-failing-in-.patch b/SOURCES/0272-Verify-modules-on-build-time-rather-than-failing-in-.patch deleted file mode 100644 index 53423db..0000000 --- a/SOURCES/0272-Verify-modules-on-build-time-rather-than-failing-in-.patch +++ /dev/null @@ -1,559 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Thu, 31 Dec 2015 13:09:15 +0100 -Subject: [PATCH] Verify modules on build-time rather than failing in runtime. - ---- - util/grub-module-verifier.c | 122 ++++++++++++++++ - util/grub-module-verifier32.c | 2 + - util/grub-module-verifier64.c | 2 + - util/grub-module-verifierXX.c | 315 +++++++++++++++++++++++++++++++++++++++++ - include/grub/module_verifier.h | 19 +++ - grub-core/Makefile.am | 6 +- - grub-core/genmod.sh.in | 5 +- - 7 files changed, 468 insertions(+), 3 deletions(-) - create mode 100644 util/grub-module-verifier.c - create mode 100644 util/grub-module-verifier32.c - create mode 100644 util/grub-module-verifier64.c - create mode 100644 util/grub-module-verifierXX.c - create mode 100644 include/grub/module_verifier.h - -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -new file mode 100644 -index 00000000000..d2d6984033c ---- /dev/null -+++ b/util/grub-module-verifier.c -@@ -0,0 +1,122 @@ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+struct grub_module_verifier_arch archs[] = { -+ { "i386", 4, 0, EM_386, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ -+ R_386_32, -+ R_386_PC32, -+ -1 -+ } }, -+ { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_X86_64_64, -+ R_X86_64_PC64, -+ /* R_X86_64_32, R_X86_64_32S, R_X86_64_PC32 are supported but shouldn't be used because of their limited range. */ -+ -1 -+ } }, -+ { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ GRUB_ELF_R_PPC_ADDR16_LO, -+ GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ -+ GRUB_ELF_R_PPC_ADDR16_HA, -+ GRUB_ELF_R_PPC_ADDR32, -+ GRUB_ELF_R_PPC_REL32, -+ -1 -+ } }, -+ { "sparc64", 8, 1, EM_SPARCV9, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_SPARC_WDISP30, /* It has limited range but GRUB adds trampolines when necessarry. */ -+ R_SPARC_HH22, -+ R_SPARC_HM10, -+ R_SPARC_LM22, -+ R_SPARC_LO10, -+ R_SPARC_64, -+ R_SPARC_OLO10, -+ /* R_SPARC_32, R_SPARC_HI22 are supported but shouldn't be used because of their limited range. */ -+ -1 -+ } }, -+ { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_IA64_PCREL21B, /* We should verify that it's pointing either -+ to a function or to a section in the same module. */ -+ R_IA64_SEGREL64LSB, -+ R_IA64_FPTR64LSB, -+ R_IA64_DIR64LSB, -+ R_IA64_PCREL64LSB, -+ R_IA64_GPREL22, /* We should verify that it's pointing to a section in the same module. */ -+ R_IA64_LTOFF22X, -+ R_IA64_LTOFF22, -+ R_IA64_LTOFF_FPTR22, -+ R_IA64_LDXMOV, -+ -1 -+ } }, -+ { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_MIPS_HI16, -+ R_MIPS_LO16, -+ R_MIPS_32, -+ R_MIPS_GPREL32, -+ R_MIPS_26, -+ R_MIPS_GOT16, -+ R_MIPS_CALL16, -+ R_MIPS_JALR, -+ -1 -+ } }, -+ { "mips", 4, 1, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_MIPS_HI16, -+ R_MIPS_LO16, -+ R_MIPS_32, -+ R_MIPS_GPREL32, -+ R_MIPS_26, -+ R_MIPS_GOT16, -+ R_MIPS_CALL16, -+ R_MIPS_JALR, -+ -1 -+ } }, -+ { "arm", 4, 0, EM_ARM, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ -+ /* Some relocations are range-limited but trampolines are added when necessarry. */ -+ R_ARM_ABS32, -+ R_ARM_CALL, -+ R_ARM_JUMP24, -+ R_ARM_THM_CALL, -+ R_ARM_THM_JUMP24, -+ R_ARM_V4BX, -+ R_ARM_THM_MOVW_ABS_NC, -+ R_ARM_THM_MOVT_ABS, -+ R_ARM_THM_JUMP19, -+ -1 -+ } }, -+ { "arm64", 8, 0, EM_AARCH64, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ -+ R_AARCH64_ABS64, -+ R_AARCH64_CALL26, -+ R_AARCH64_JUMP26, -+ -1 -+ } }, -+}; -+ -+ -+int -+main (int argc, char **argv) -+{ -+ size_t module_size; -+ unsigned arch; -+ char *module_img; -+ if (argc != 3) { -+ fprintf (stderr, "usage: %s FILE ARCH\n", argv[0]); -+ return 1; -+ } -+ -+ for (arch = 0; arch < ARRAY_SIZE(archs); arch++) -+ if (strcmp(archs[arch].name, argv[2]) == 0) -+ break; -+ if (arch == ARRAY_SIZE(archs)) -+ grub_util_error("unknown arch: %s", argv[2]); -+ -+ module_size = grub_util_get_image_size (argv[1]); -+ module_img = grub_util_read_image (argv[1]); -+ if (archs[arch].voidp_sizeof == 8) -+ grub_module_verify64(module_img, module_size, &archs[arch]); -+ else -+ grub_module_verify32(module_img, module_size, &archs[arch]); -+ return 0; -+} -diff --git a/util/grub-module-verifier32.c b/util/grub-module-verifier32.c -new file mode 100644 -index 00000000000..257229f8f08 ---- /dev/null -+++ b/util/grub-module-verifier32.c -@@ -0,0 +1,2 @@ -+#define MODULEVERIFIER_ELF32 1 -+#include "grub-module-verifierXX.c" -diff --git a/util/grub-module-verifier64.c b/util/grub-module-verifier64.c -new file mode 100644 -index 00000000000..4db6b4bedd1 ---- /dev/null -+++ b/util/grub-module-verifier64.c -@@ -0,0 +1,2 @@ -+#define MODULEVERIFIER_ELF64 1 -+#include "grub-module-verifierXX.c" -diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c -new file mode 100644 -index 00000000000..904be27d39b ---- /dev/null -+++ b/util/grub-module-verifierXX.c -@@ -0,0 +1,315 @@ -+#include -+ -+#include -+#include -+#include -+ -+#if defined(MODULEVERIFIER_ELF32) -+# define SUFFIX(x) x ## 32 -+# define ELFCLASSXX ELFCLASS32 -+# define Elf_Ehdr Elf32_Ehdr -+# define Elf_Phdr Elf32_Phdr -+# define Elf_Nhdr Elf32_Nhdr -+# define Elf_Addr Elf32_Addr -+# define Elf_Sym Elf32_Sym -+# define Elf_Off Elf32_Off -+# define Elf_Shdr Elf32_Shdr -+# define Elf_Rela Elf32_Rela -+# define Elf_Rel Elf32_Rel -+# define Elf_Word Elf32_Word -+# define Elf_Half Elf32_Half -+# define Elf_Section Elf32_Section -+# define ELF_R_SYM(val) ELF32_R_SYM(val) -+# define ELF_R_TYPE(val) ELF32_R_TYPE(val) -+# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) -+#elif defined(MODULEVERIFIER_ELF64) -+# define SUFFIX(x) x ## 64 -+# define ELFCLASSXX ELFCLASS64 -+# define Elf_Ehdr Elf64_Ehdr -+# define Elf_Phdr Elf64_Phdr -+# define Elf_Nhdr Elf64_Nhdr -+# define Elf_Addr Elf64_Addr -+# define Elf_Sym Elf64_Sym -+# define Elf_Off Elf64_Off -+# define Elf_Shdr Elf64_Shdr -+# define Elf_Rela Elf64_Rela -+# define Elf_Rel Elf64_Rel -+# define Elf_Word Elf64_Word -+# define Elf_Half Elf64_Half -+# define Elf_Section Elf64_Section -+# define ELF_R_SYM(val) ELF64_R_SYM(val) -+# define ELF_R_TYPE(val) ELF64_R_TYPE(val) -+# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) -+#else -+#error "I'm confused" -+#endif -+ -+#define grub_target_to_host32(x) (grub_target_to_host32_real (arch, (x))) -+#define grub_host_to_target32(x) (grub_host_to_target32_real (arch, (x))) -+#define grub_target_to_host64(x) (grub_target_to_host64_real (arch, (x))) -+#define grub_host_to_target64(x) (grub_host_to_target64_real (arch, (x))) -+#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (arch, (x))) -+#define grub_target_to_host16(x) (grub_target_to_host16_real (arch, (x))) -+#define grub_host_to_target16(x) (grub_host_to_target16_real (arch, (x))) -+#define grub_target_to_host(val) grub_target_to_host_real(arch, (val)) -+ -+static inline grub_uint32_t -+grub_target_to_host32_real (const struct grub_module_verifier_arch *arch, -+ grub_uint32_t in) -+{ -+ if (arch->bigendian) -+ return grub_be_to_cpu32 (in); -+ else -+ return grub_le_to_cpu32 (in); -+} -+ -+static inline grub_uint64_t -+grub_target_to_host64_real (const struct grub_module_verifier_arch *arch, -+ grub_uint64_t in) -+{ -+ if (arch->bigendian) -+ return grub_be_to_cpu64 (in); -+ else -+ return grub_le_to_cpu64 (in); -+} -+ -+static inline grub_uint64_t -+grub_host_to_target64_real (const struct grub_module_verifier_arch *arch, -+ grub_uint64_t in) -+{ -+ if (arch->bigendian) -+ return grub_cpu_to_be64 (in); -+ else -+ return grub_cpu_to_le64 (in); -+} -+ -+static inline grub_uint32_t -+grub_host_to_target32_real (const struct grub_module_verifier_arch *arch, -+ grub_uint32_t in) -+{ -+ if (arch->bigendian) -+ return grub_cpu_to_be32 (in); -+ else -+ return grub_cpu_to_le32 (in); -+} -+ -+static inline grub_uint16_t -+grub_target_to_host16_real (const struct grub_module_verifier_arch *arch, -+ grub_uint16_t in) -+{ -+ if (arch->bigendian) -+ return grub_be_to_cpu16 (in); -+ else -+ return grub_le_to_cpu16 (in); -+} -+ -+static inline grub_uint16_t -+grub_host_to_target16_real (const struct grub_module_verifier_arch *arch, -+ grub_uint16_t in) -+{ -+ if (arch->bigendian) -+ return grub_cpu_to_be16 (in); -+ else -+ return grub_cpu_to_le16 (in); -+} -+ -+static inline grub_uint64_t -+grub_host_to_target_addr_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) -+{ -+ if (arch->voidp_sizeof == 8) -+ return grub_host_to_target64_real (arch, in); -+ else -+ return grub_host_to_target32_real (arch, in); -+} -+ -+static inline grub_uint64_t -+grub_target_to_host_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) -+{ -+ if (arch->voidp_sizeof == 8) -+ return grub_target_to_host64_real (arch, in); -+ else -+ return grub_target_to_host32_real (arch, in); -+} -+ -+ -+static Elf_Shdr * -+find_section (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, const char *name) -+{ -+ Elf_Shdr *s; -+ const char *str; -+ unsigned i; -+ -+ s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host16 (e->e_shstrndx) * grub_target_to_host16 (e->e_shentsize)); -+ str = (char *) e + grub_target_to_host (s->sh_offset); -+ -+ for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); -+ i < grub_target_to_host16 (e->e_shnum); -+ i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) -+ if (strcmp (str + grub_target_to_host32 (s->sh_name), name) == 0) -+ return s; -+ return NULL; -+} -+ -+static void -+check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) -+{ -+ Elf_Shdr *s = find_section (arch, e, ".module_license"); -+ if (s && (strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3") == 0 -+ || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3+") == 0 -+ || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv2+") == 0)) -+ return; -+ grub_util_error ("incompatible license"); -+} -+ -+static void -+check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) -+{ -+ unsigned i; -+ Elf_Shdr *s, *sections; -+ Elf_Sym *sym; -+ const char *str; -+ Elf_Word size, entsize; -+ -+ sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); -+ for (i = 0, s = sections; -+ i < grub_target_to_host16 (e->e_shnum); -+ i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) -+ if (grub_target_to_host32 (s->sh_type) == SHT_SYMTAB) -+ break; -+ -+ if (i == grub_target_to_host16 (e->e_shnum)) -+ grub_util_error ("no symbol table"); -+ -+ sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); -+ size = grub_target_to_host (s->sh_size); -+ entsize = grub_target_to_host (s->sh_entsize); -+ -+ s = (Elf_Shdr *) ((char *) sections + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host32 (s->sh_link)); -+ str = (char *) e + grub_target_to_host (s->sh_offset); -+ -+ for (i = 0; -+ i < size / entsize; -+ i++, sym = (Elf_Sym *) ((char *) sym + entsize)) -+ { -+ unsigned char type = ELF_ST_TYPE (sym->st_info); -+ -+ switch (type) -+ { -+ case STT_NOTYPE: -+ case STT_OBJECT: -+ case STT_FUNC: -+ case STT_SECTION: -+ case STT_FILE: -+ break; -+ -+ default: -+ return grub_util_error ("unknown symbol type `%d'", (int) type); -+ } -+ } -+} -+ -+/* Relocate symbols. */ -+static void -+section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, -+ Elf_Shdr *s, size_t target_seg_size) -+{ -+ Elf_Rel *rel, *max; -+ -+ for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), -+ max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); -+ rel < max; -+ rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) -+ { -+ Elf_Word *addr; -+ Elf_Sym *sym; -+ unsigned i; -+ -+ if (target_seg_size < grub_target_to_host (rel->r_offset)) -+ grub_util_error ("reloc offset is out of the segment"); -+ -+ grub_uint32_t type = ELF_R_TYPE (grub_target_to_host (rel->r_info)); -+ -+ if (arch->machine == EM_SPARCV9) -+ type &= 0xff; -+ -+ for (i = 0; arch->supported_relocations[i] != -1; i++) -+ if (type == arch->supported_relocations[i]) -+ break; -+ if (arch->supported_relocations[i] == -1) -+ grub_util_error ("unsupported relocation 0x%x", type); -+ } -+} -+ -+static void -+check_relocations (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) -+{ -+ Elf_Shdr *s; -+ unsigned i; -+ -+ for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); -+ i < grub_target_to_host16 (e->e_shnum); -+ i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) -+ if (grub_target_to_host32 (s->sh_type) == SHT_REL || grub_target_to_host32 (s->sh_type) == SHT_RELA) -+ { -+ Elf_Shdr *ts; -+ -+ if (grub_target_to_host32 (s->sh_type) == SHT_REL && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_REL)) -+ grub_util_error ("unsupported SHT_REL"); -+ if (grub_target_to_host32 (s->sh_type) == SHT_RELA && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_RELA)) -+ grub_util_error ("unsupported SHT_RELA"); -+ -+ /* Find the target segment. */ -+ if (grub_target_to_host32 (s->sh_info) >= grub_target_to_host16 (e->e_shnum)) -+ grub_util_error ("orphaned reloc section"); -+ ts = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host32 (s->sh_info) * grub_target_to_host16 (e->e_shentsize)); -+ -+ section_check_relocations (arch, e, s, grub_target_to_host (ts->sh_size)); -+ } -+} -+ -+void -+SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_module_verifier_arch *arch) -+{ -+ Elf_Ehdr *e = module_img; -+ -+ /* Check the header size. */ -+ if (size < sizeof (Elf_Ehdr)) -+ grub_util_error ("ELF header smaller than expected"); -+ -+ /* Check the magic numbers. */ -+ if (e->e_ident[EI_MAG0] != ELFMAG0 -+ || e->e_ident[EI_MAG1] != ELFMAG1 -+ || e->e_ident[EI_MAG2] != ELFMAG2 -+ || e->e_ident[EI_MAG3] != ELFMAG3 -+ || e->e_ident[EI_VERSION] != EV_CURRENT -+ || grub_target_to_host32 (e->e_version) != EV_CURRENT) -+ grub_util_error ("invalid arch-independent ELF magic"); -+ -+ if (e->e_ident[EI_CLASS] != ELFCLASSXX -+ || e->e_ident[EI_DATA] != (arch->bigendian ? ELFDATA2MSB : ELFDATA2LSB) -+ || grub_target_to_host16 (e->e_machine) != arch->machine) -+ grub_util_error ("invalid arch-dependent ELF magic"); -+ -+ if (grub_target_to_host16 (e->e_type) != ET_REL) -+ { -+ grub_util_error ("this ELF file is not of the right type"); -+ } -+ -+ /* Make sure that every section is within the core. */ -+ if (size < grub_target_to_host (e->e_shoff) -+ + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) -+ { -+ grub_util_error ("ELF sections outside core"); -+ } -+ -+ check_license (arch, e); -+ -+ Elf_Shdr *s; -+ -+ s = find_section (arch, e, ".modname"); -+ if (!s) -+ grub_util_error ("no module name found"); -+ -+ check_symbols(arch, e); -+ check_relocations(arch, e); -+} -diff --git a/include/grub/module_verifier.h b/include/grub/module_verifier.h -new file mode 100644 -index 00000000000..9e3a2ba720f ---- /dev/null -+++ b/include/grub/module_verifier.h -@@ -0,0 +1,19 @@ -+#include -+#include -+ -+#include -+ -+#define GRUB_MODULE_VERIFY_SUPPORTS_REL 1 -+#define GRUB_MODULE_VERIFY_SUPPORTS_RELA 2 -+ -+struct grub_module_verifier_arch { -+ const char *name; -+ int voidp_sizeof; -+ int bigendian; -+ int machine; -+ int flags; -+ const int *supported_relocations; -+}; -+ -+void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); -+void grub_module_verify32(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index be29e327f77..77205f16358 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -39,6 +39,10 @@ gentrigtables$(BUILD_EXEEXT): gentrigtables.c - $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM) - CLEANFILES += gentrigtables$(BUILD_EXEEXT) - -+build-grub-module-verifier$(BUILD_EXEEXT): $(top_srcdir)/util/grub-module-verifier.c $(top_srcdir)/util/grub-module-verifier32.c $(top_srcdir)/util/grub-module-verifier64.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c -+ $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-module-verifier\" $^ -+CLEANFILES += build-grub-module-verifier$(BUILD_EXEEXT) -+ - # trigtables.c - trigtables.c: gentrigtables$(BUILD_EXEEXT) gentrigtables.c $(top_srcdir)/configure.ac - ./gentrigtables$(BUILD_EXEEXT) > $@ -@@ -387,7 +391,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst - platform_DATA += moddep.lst - CLEANFILES += config.log syminfo.lst moddep.lst - --$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) -+$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier - TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ - platform_DATA += $(MOD_FILES) - platform_DATA += modinfo.sh -diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 789732b108b..7dcafd9d370 100644 ---- a/grub-core/genmod.sh.in -+++ b/grub-core/genmod.sh.in -@@ -15,12 +15,12 @@ set -e - # - # Example: - # --# genmod.sh moddep.lst normal.module normal.mod -+# genmod.sh moddep.lst normal.module build-grub-module-verifier normal.mod - # - - moddep=$1 - infile=$2 --outfile=$3 -+outfile=$4 - - tmpfile=${outfile}.tmp - modname=`echo $infile | sed -e 's@\.module.*$@@'` -@@ -93,4 +93,5 @@ else - -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 - rm -f $name.bin - fi -+./build-grub-module-verifier $tmpfile @target_cpu@ - mv $tmpfile $outfile diff --git a/SOURCES/0273-module-verifier-Check-range-limited-relative-relocat.patch b/SOURCES/0273-module-verifier-Check-range-limited-relative-relocat.patch deleted file mode 100644 index 9d23811..0000000 --- a/SOURCES/0273-module-verifier-Check-range-limited-relative-relocat.patch +++ /dev/null @@ -1,183 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Thu, 31 Dec 2015 15:29:28 +0100 -Subject: [PATCH] module-verifier: Check range-limited relative relocations. - -Check that they point to the same module, so will end up in the same -chunk of memory. ---- - util/grub-module-verifier.c | 19 ++++++++++--- - util/grub-module-verifierXX.c | 62 ++++++++++++++++++++++++++++++++++-------- - include/grub/module_verifier.h | 1 + - 3 files changed, 67 insertions(+), 15 deletions(-) - -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index d2d6984033c..c027f0a0fb1 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -15,9 +15,13 @@ struct grub_module_verifier_arch archs[] = { - { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - R_X86_64_64, - R_X86_64_PC64, -- /* R_X86_64_32, R_X86_64_32S, R_X86_64_PC32 are supported but shouldn't be used because of their limited range. */ -+ /* R_X86_64_32, R_X86_64_32S are supported but shouldn't be used because of their limited range. */ - -1 -- } }, -+ }, (int[]){ -+ R_X86_64_PC32, -+ -1 -+ } -+ }, - { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - GRUB_ELF_R_PPC_ADDR16_LO, - GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ -@@ -39,17 +43,24 @@ struct grub_module_verifier_arch archs[] = { - } }, - { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - R_IA64_PCREL21B, /* We should verify that it's pointing either -- to a function or to a section in the same module. */ -+ to a function or to a section in the same module. -+ Checking that external symbol is a function is -+ non-trivial and I have never seen this relocation used -+ for anything else, so assume that it always points to a -+ function. -+ */ - R_IA64_SEGREL64LSB, - R_IA64_FPTR64LSB, - R_IA64_DIR64LSB, - R_IA64_PCREL64LSB, -- R_IA64_GPREL22, /* We should verify that it's pointing to a section in the same module. */ - R_IA64_LTOFF22X, - R_IA64_LTOFF22, - R_IA64_LTOFF_FPTR22, - R_IA64_LDXMOV, - -1 -+ }, (int[]){ -+ R_IA64_GPREL22, -+ -1 - } }, - { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ - R_MIPS_HI16, -diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c -index 904be27d39b..25988ebc21d 100644 ---- a/util/grub-module-verifierXX.c -+++ b/util/grub-module-verifierXX.c -@@ -161,14 +161,12 @@ check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) - grub_util_error ("incompatible license"); - } - --static void --check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) -+static Elf_Sym * -+get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word *size, Elf_Word *entsize) - { - unsigned i; - Elf_Shdr *s, *sections; - Elf_Sym *sym; -- const char *str; -- Elf_Word size, entsize; - - sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); - for (i = 0, s = sections; -@@ -181,11 +179,19 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) - grub_util_error ("no symbol table"); - - sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); -- size = grub_target_to_host (s->sh_size); -- entsize = grub_target_to_host (s->sh_entsize); -+ *size = grub_target_to_host (s->sh_size); -+ *entsize = grub_target_to_host (s->sh_entsize); -+ return sym; -+} - -- s = (Elf_Shdr *) ((char *) sections + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host32 (s->sh_link)); -- str = (char *) e + grub_target_to_host (s->sh_offset); -+static void -+check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) -+{ -+ Elf_Sym *sym; -+ Elf_Word size, entsize; -+ unsigned i; -+ -+ sym = get_symtab (arch, e, &size, &entsize); - - for (i = 0; - i < size / entsize; -@@ -208,19 +214,41 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) - } - } - --/* Relocate symbols. */ -+static int -+is_symbol_local(Elf_Sym *sym) -+{ -+ switch (ELF_ST_TYPE (sym->st_info)) -+ { -+ case STT_NOTYPE: -+ case STT_OBJECT: -+ if (sym->st_name != 0 && sym->st_shndx == 0) -+ return 0; -+ return 1; -+ -+ case STT_FUNC: -+ case STT_SECTION: -+ return 1; -+ -+ default: -+ return 0; -+ } -+} -+ - static void - section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, - Elf_Shdr *s, size_t target_seg_size) - { - Elf_Rel *rel, *max; -+ Elf_Sym *symtab; -+ Elf_Word symtabsize, symtabentsize; -+ -+ symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); - - for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), - max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); - rel < max; - rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) - { -- Elf_Word *addr; - Elf_Sym *sym; - unsigned i; - -@@ -235,8 +263,20 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e - for (i = 0; arch->supported_relocations[i] != -1; i++) - if (type == arch->supported_relocations[i]) - break; -- if (arch->supported_relocations[i] == -1) -+ if (arch->supported_relocations[i] != -1) -+ continue; -+ if (!arch->short_relocations) - grub_util_error ("unsupported relocation 0x%x", type); -+ for (i = 0; arch->short_relocations[i] != -1; i++) -+ if (type == arch->short_relocations[i]) -+ break; -+ if (arch->short_relocations[i] == -1) -+ grub_util_error ("unsupported relocation 0x%x", type); -+ sym = (Elf_Sym *) ((char *) symtab + symtabentsize * ELF_R_SYM (grub_target_to_host (rel->r_info))); -+ -+ if (is_symbol_local (sym)) -+ continue; -+ grub_util_error ("relocation 0x%x is not module-local", type); - } - } - -diff --git a/include/grub/module_verifier.h b/include/grub/module_verifier.h -index 9e3a2ba720f..6cddff30f2e 100644 ---- a/include/grub/module_verifier.h -+++ b/include/grub/module_verifier.h -@@ -13,6 +13,7 @@ struct grub_module_verifier_arch { - int machine; - int flags; - const int *supported_relocations; -+ const int *short_relocations; - }; - - void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); diff --git a/SOURCES/0274-Strip-.ARM.exidx.patch b/SOURCES/0274-Strip-.ARM.exidx.patch deleted file mode 100644 index aed2f16..0000000 --- a/SOURCES/0274-Strip-.ARM.exidx.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Thu, 31 Dec 2015 18:13:59 +0100 -Subject: [PATCH] Strip .ARM.exidx - -This section is generated by clang and is useful only for debugging. -It contains exotic relocations, so strip them to avoid them interferring -with module loading. ---- - gentpl.py | 2 +- - grub-core/genmod.sh.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gentpl.py b/gentpl.py -index 889cc91d39c..58430fcd236 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -753,7 +753,7 @@ def image(defn, platform): - if test x$(TARGET_APPLE_LINKER) = x1; then \ - $(MACHO2IMG) $< $@; \ - else \ -- $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ -+ $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .ARM.exidx $< $@; \ - fi - """) - -diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 7dcafd9d370..005cb198504 100644 ---- a/grub-core/genmod.sh.in -+++ b/grub-core/genmod.sh.in -@@ -58,7 +58,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then - -K grub_mod_init -K grub_mod_fini \ - -K _grub_mod_init -K _grub_mod_fini \ - -R .note.gnu.gold-version -R .note.GNU-stack \ -- -R .note -R .comment $tmpfile || exit 1 -+ -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 - fi - if ! test -z "${TARGET_OBJ2ELF}"; then - "${TARGET_OBJ2ELF}" $tmpfile || exit 1 diff --git a/SOURCES/0275-Disable-build-time-module-check-on-emu.patch b/SOURCES/0275-Disable-build-time-module-check-on-emu.patch deleted file mode 100644 index 51c4d4e..0000000 --- a/SOURCES/0275-Disable-build-time-module-check-on-emu.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Thu, 31 Dec 2015 18:20:11 +0100 -Subject: [PATCH] Disable build-time module check on emu. - -On emu some checks can be laxer like check for relocation range. Additionally -module loading in emu is rarely used. So skip this check rather than making -it laxer for all platforms. In ideal we may want to have slightly different -check for emu but for now this is good enough. ---- - grub-core/genmod.sh.in | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index 005cb198504..f74edd55181 100644 ---- a/grub-core/genmod.sh.in -+++ b/grub-core/genmod.sh.in -@@ -93,5 +93,7 @@ else - -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 - rm -f $name.bin - fi --./build-grub-module-verifier $tmpfile @target_cpu@ -+if test x@platform@ != xemu; then -+ ./build-grub-module-verifier $tmpfile @target_cpu@ -+fi - mv $tmpfile $outfile diff --git a/SOURCES/0276-module-verifier-allow-limited-range-relocations-on-s.patch b/SOURCES/0276-module-verifier-allow-limited-range-relocations-on-s.patch deleted file mode 100644 index c1791b3..0000000 --- a/SOURCES/0276-module-verifier-allow-limited-range-relocations-on-s.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Thu, 31 Dec 2015 18:30:39 +0100 -Subject: [PATCH] module-verifier: allow limited-range relocations on sparc64. - -clang as incomplete mcmodel=large support. As we don't currently need full -mcmodel=large support for sparc64, relax those checks. ---- - util/grub-module-verifier.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index c027f0a0fb1..e217dcddc07 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -38,7 +38,12 @@ struct grub_module_verifier_arch archs[] = { - R_SPARC_LO10, - R_SPARC_64, - R_SPARC_OLO10, -- /* R_SPARC_32, R_SPARC_HI22 are supported but shouldn't be used because of their limited range. */ -+ /* Following 2 relocations have limited range but unfortunately -+ clang generates them, as it doesn't implement mcmodel=large properly. -+ At least our heap and core are under 4G, so it's not a problem -+ usually. */ -+ R_SPARC_HI22, -+ R_SPARC_32, - -1 - } }, - { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ diff --git a/SOURCES/0277-remove-temporary-.bin-files-kernel-and-modules.patch b/SOURCES/0277-remove-temporary-.bin-files-kernel-and-modules.patch deleted file mode 100644 index 632f137..0000000 --- a/SOURCES/0277-remove-temporary-.bin-files-kernel-and-modules.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrey Borzenkov -Date: Thu, 31 Dec 2015 23:00:25 +0300 -Subject: [PATCH] remove temporary .bin files (kernel and modules) - ---- - gentpl.py | 2 ++ - grub-core/genmod.sh.in | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/gentpl.py b/gentpl.py -index 58430fcd236..c17a18b0ea0 100644 ---- a/gentpl.py -+++ b/gentpl.py -@@ -723,9 +723,11 @@ def kernel(defn, platform): - """if test x$(TARGET_APPLE_LINKER) = x1; then \ - $(TARGET_STRIP) -S -x $(""" + cname(defn) + """) -o $@.bin $<; \ - $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \ -+ rm -f $@.bin; \ - elif test ! -z '$(TARGET_OBJ2ELF)'; then \ - """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@.bin $< && \ - $(TARGET_OBJ2ELF) $@.bin $@ || (rm -f $@; rm -f $@.bin; exit 1); \ -+ rm -f $@.bin; \ - else """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@ $<; \ - fi""")) - -diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index f74edd55181..ca2e59d5c42 100644 ---- a/grub-core/genmod.sh.in -+++ b/grub-core/genmod.sh.in -@@ -91,7 +91,7 @@ else - -nr:_grub_mod_init:grub_mod_init \ - -nr:_grub_mod_fini:grub_mod_fini \ - -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 -- rm -f $name.bin -+ rm -f $tmpfile.bin - fi - if test x@platform@ != xemu; then - ./build-grub-module-verifier $tmpfile @target_cpu@ diff --git a/SOURCES/0278-Add-missing-BUILD_EXEEXT.patch b/SOURCES/0278-Add-missing-BUILD_EXEEXT.patch deleted file mode 100644 index afcd89c..0000000 --- a/SOURCES/0278-Add-missing-BUILD_EXEEXT.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Fri, 1 Jan 2016 11:13:54 +0300 -Subject: [PATCH] Add missing BUILD_EXEEXT - ---- - Makefile.am | 45 +++++++++++++++++++++++++-------------------- - grub-core/Makefile.am | 2 +- - grub-core/genmod.sh.in | 2 +- - 3 files changed, 27 insertions(+), 22 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index f02ae0a393c..335a268ea9f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -85,16 +85,21 @@ CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) - - if COND_STARFIELD - starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) --dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE) --dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE) --dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE) --dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE) --dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE) -+dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -s 10 -o $@ $(DJVU_FONT_SOURCE) -+CLEANFILES += dejavu_10.pf2 -+dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -s 12 -o $@ $(DJVU_FONT_SOURCE) -+CLEANFILES += dejavu_12.pf2 -+dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -s 14 -o $@ $(DJVU_FONT_SOURCE) -+CLEANFILES += dejavu_14.pf2 -+dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -b -s 14 -o $@ $(DJVU_FONT_SOURCE) -+CLEANFILES += dejavu_bold_14.pf2 -+dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -s 16 -o $@ $(DJVU_FONT_SOURCE) -+CLEANFILES += dejavu_16.pf2 - else - starfield_DATA = - endif -@@ -102,28 +107,28 @@ endif - EXTRA_DIST += $(starfield_theme_files) - EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf - --unicode.pf2: $(FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) -+unicode.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) - CLEANFILES += unicode.pf2 - - # Arrows and lines are needed to draw the menu, so always include them - UNICODE_ARROWS=0x2190-0x2193 - UNICODE_LINES=0x2501-0x251B - --ascii.pf2: $(FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) -+ascii.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) - CLEANFILES += ascii.pf2 - --euro.pf2: $(FONT_SOURCE) build-grub-mkfont -- ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) -+euro.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) -+ ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) - CLEANFILES += euro.pf2 - --ascii.h: $(FONT_SOURCE) build-grub-gen-asciih -- ./build-grub-gen-asciih $(FONT_SOURCE) $@ || (rm -f $@; exit 1) -+ascii.h: $(FONT_SOURCE) build-grub-gen-asciih$(BUILD_EXEEXT) -+ ./build-grub-gen-asciih$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) - CLEANFILES += ascii.h - --widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec -- ./build-grub-gen-widthspec $(FONT_SOURCE) $@ || (rm -f $@; exit 1) -+widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec$(BUILD_EXEEXT) -+ ./build-grub-gen-widthspec$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) - CLEANFILES += widthspec.h - - # Install config.h into platformdir -diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am -index 77205f16358..59a00f11fab 100644 ---- a/grub-core/Makefile.am -+++ b/grub-core/Makefile.am -@@ -391,7 +391,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst - platform_DATA += moddep.lst - CLEANFILES += config.log syminfo.lst moddep.lst - --$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier -+$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier$(BUILD_EXEEXT) - TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ - platform_DATA += $(MOD_FILES) - platform_DATA += modinfo.sh -diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in -index ca2e59d5c42..045817b1534 100644 ---- a/grub-core/genmod.sh.in -+++ b/grub-core/genmod.sh.in -@@ -94,6 +94,6 @@ else - rm -f $tmpfile.bin - fi - if test x@platform@ != xemu; then -- ./build-grub-module-verifier $tmpfile @target_cpu@ -+ ./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ - fi - mv $tmpfile $outfile diff --git a/SOURCES/0279-grub-module-verifier-fix-unintended-sign-extension.patch b/SOURCES/0279-grub-module-verifier-fix-unintended-sign-extension.patch deleted file mode 100644 index 3284408..0000000 --- a/SOURCES/0279-grub-module-verifier-fix-unintended-sign-extension.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Fri, 8 Jan 2016 11:05:16 +0300 -Subject: [PATCH] grub-module-verifier: fix unintended sign extension - -Found by: Coverity scan. -CID: 156533, 156532 ---- - util/grub-module-verifierXX.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c -index 25988ebc21d..f612d51f389 100644 ---- a/util/grub-module-verifierXX.c -+++ b/util/grub-module-verifierXX.c -@@ -337,7 +337,7 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_mod - - /* Make sure that every section is within the core. */ - if (size < grub_target_to_host (e->e_shoff) -- + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) -+ + (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) - { - grub_util_error ("ELF sections outside core"); - } diff --git a/SOURCES/0280-mkimage-fix-unintended-sign-extension.patch b/SOURCES/0280-mkimage-fix-unintended-sign-extension.patch deleted file mode 100644 index f151b7f..0000000 --- a/SOURCES/0280-mkimage-fix-unintended-sign-extension.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Sat, 9 Jan 2016 21:05:44 +0300 -Subject: [PATCH] mkimage: fix unintended sign extension - -Found by: Coverity scan. -CID: 73691, 73717 ---- - util/grub-mkimagexx.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index 0a1ac9e517c..66e8576411e 100644 ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -1465,7 +1465,7 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, - section_entsize = grub_target_to_host16 (e->e_shentsize); - num_sections = grub_target_to_host16 (e->e_shnum); - -- if (kernel_size < section_offset + section_entsize * num_sections) -+ if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections) - grub_util_error (_("premature end of file %s"), kernel_path); - - sections = (Elf_Shdr *) (kernel_img + section_offset); diff --git a/SOURCES/0281-arm64-Add-support-for-relocations-needed-for-linaro-.patch b/SOURCES/0281-arm64-Add-support-for-relocations-needed-for-linaro-.patch deleted file mode 100644 index 030ecc7..0000000 --- a/SOURCES/0281-arm64-Add-support-for-relocations-needed-for-linaro-.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Fri, 22 Jan 2016 19:09:37 +0100 -Subject: [PATCH] arm64: Add support for relocations needed for linaro gcc - ---- - grub-core/kern/arm64/dl.c | 18 ++++++++++++++++++ - grub-core/kern/arm64/dl_helper.c | 40 ++++++++++++++++++++++++++++++++++++++++ - util/grub-mkimagexx.c | 31 +++++++++++++++++++++++++++++++ - util/grub-module-verifier.c | 8 +++++++- - include/grub/arm64/reloc.h | 8 ++++++++ - include/grub/elf.h | 3 +++ - 6 files changed, 107 insertions(+), 1 deletion(-) - -diff --git a/grub-core/kern/arm64/dl.c b/grub-core/kern/arm64/dl.c -index e19ba6a0d58..cf50d7250d9 100644 ---- a/grub-core/kern/arm64/dl.c -+++ b/grub-core/kern/arm64/dl.c -@@ -132,6 +132,12 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - *abs_place = (grub_uint64_t) sym_addr; - } - break; -+ case R_AARCH64_ADD_ABS_LO12_NC: -+ grub_arm64_set_abs_lo12 (place, sym_addr); -+ break; -+ case R_AARCH64_LDST64_ABS_LO12_NC: -+ grub_arm64_set_abs_lo12_ldst64 (place, sym_addr); -+ break; - case R_AARCH64_CALL26: - case R_AARCH64_JUMP26: - { -@@ -154,6 +160,18 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - grub_arm64_set_xxxx26_offset (place, offset); - } - break; -+ case R_AARCH64_ADR_PREL_PG_HI21: -+ { -+ grub_int64_t offset = (sym_addr & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL); -+ -+ if (!grub_arm64_check_hi21_signed (offset)) -+ return grub_error (GRUB_ERR_BAD_MODULE, -+ "HI21 out of range"); -+ -+ grub_arm64_set_hi21 (place, offset); -+ } -+ break; -+ - default: - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), -diff --git a/grub-core/kern/arm64/dl_helper.c b/grub-core/kern/arm64/dl_helper.c -index d213ab93e88..f031b1ae921 100644 ---- a/grub-core/kern/arm64/dl_helper.c -+++ b/grub-core/kern/arm64/dl_helper.c -@@ -53,3 +53,43 @@ grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset) - *place &= insmask; - *place |= grub_cpu_to_le32 (offset >> 2) & ~insmask; - } -+ -+int -+grub_arm64_check_hi21_signed (grub_int64_t offset) -+{ -+ if (offset != (grub_int64_t)(grub_int32_t)offset) -+ return 0; -+ return 1; -+} -+ -+void -+grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset) -+{ -+ const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0x9f00001f); -+ grub_uint32_t val; -+ -+ offset >>= 12; -+ -+ val = ((offset & 3) << 29) | (((offset >> 2) & 0x7ffff) << 5); -+ -+ *place &= insmask; -+ *place |= grub_cpu_to_le32 (val) & ~insmask; -+} -+ -+void -+grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target) -+{ -+ const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xffc003ff); -+ -+ *place &= insmask; -+ *place |= grub_cpu_to_le32 (target << 10) & ~insmask; -+} -+ -+void -+grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target) -+{ -+ const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfff803ff); -+ -+ *place &= insmask; -+ *place |= grub_cpu_to_le32 (target << 7) & ~insmask; -+} -diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index 66e8576411e..d1bc95e350d 100644 ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -836,6 +836,14 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - *target = grub_host_to_target64 (grub_target_to_host64 (*target) + sym_addr); - } - break; -+ case R_AARCH64_ADD_ABS_LO12_NC: -+ grub_arm64_set_abs_lo12 ((grub_uint32_t *) target, -+ sym_addr); -+ break; -+ case R_AARCH64_LDST64_ABS_LO12_NC: -+ grub_arm64_set_abs_lo12_ldst64 ((grub_uint32_t *) target, -+ sym_addr); -+ break; - case R_AARCH64_JUMP26: - case R_AARCH64_CALL26: - { -@@ -848,6 +856,17 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - sym_addr); - } - break; -+ case R_AARCH64_ADR_PREL_PG_HI21: -+ { -+ sym_addr &= ~0xfffULL; -+ sym_addr -= (offset + SUFFIX (entry_point)) & ~0xfffULL; -+ if (!grub_arm64_check_hi21_signed (sym_addr)) -+ grub_util_error ("%s", "CALL26 Relocation out of range"); -+ -+ grub_arm64_set_hi21((grub_uint32_t *)target, -+ sym_addr); -+ } -+ break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); -@@ -1200,6 +1219,15 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, - case R_AARCH64_CALL26: - case R_AARCH64_JUMP26: - break; -+ /* Page-relative relocations do not require fixup entries. */ -+ case R_AARCH64_ADR_PREL_PG_HI21: -+ /* We page-align the whole kernel, so no need -+ for fixup entries. -+ */ -+ case R_AARCH64_ADD_ABS_LO12_NC: -+ case R_AARCH64_LDST64_ABS_LO12_NC: -+ break; -+ - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); -@@ -1343,6 +1371,9 @@ SUFFIX (locate_sections) (const char *kernel_path, - Elf_Shdr *s; - - *all_align = 1; -+ /* Page-aligning simplifies relocation handling. */ -+ if (image_target->elf_target == EM_AARCH64) -+ *all_align = 4096; - - section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); - memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index e217dcddc07..405c9117051 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -107,7 +107,13 @@ struct grub_module_verifier_arch archs[] = { - R_AARCH64_CALL26, - R_AARCH64_JUMP26, - -1 -- } }, -+ }, (int[]){ -+ R_AARCH64_ADR_PREL_PG_HI21, -+ R_AARCH64_ADD_ABS_LO12_NC, -+ R_AARCH64_LDST64_ABS_LO12_NC, -+ -1 -+ } -+ }, - }; - - -diff --git a/include/grub/arm64/reloc.h b/include/grub/arm64/reloc.h -index 4aed3d715e0..452c148226d 100644 ---- a/include/grub/arm64/reloc.h -+++ b/include/grub/arm64/reloc.h -@@ -22,5 +22,13 @@ - int grub_arm_64_check_xxxx26_offset (grub_int64_t offset); - void - grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset); -+int -+grub_arm64_check_hi21_signed (grub_int64_t offset); -+void -+grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset); -+void -+grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target); -+void -+grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target); - - #endif -diff --git a/include/grub/elf.h b/include/grub/elf.h -index caa79639082..db15acecf9f 100644 ---- a/include/grub/elf.h -+++ b/include/grub/elf.h -@@ -2068,6 +2068,9 @@ typedef Elf32_Addr Elf32_Conflict; - #define R_AARCH64_NONE 0 /* No relocation. */ - #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ - #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ -+#define R_AARCH64_ADR_PREL_PG_HI21 275 -+#define R_AARCH64_ADD_ABS_LO12_NC 277 -+#define R_AARCH64_LDST64_ABS_LO12_NC 286 - #define R_AARCH64_JUMP26 282 /* 26-bit relative. */ - #define R_AARCH64_CALL26 283 /* 26-bit relative. */ - #define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */ diff --git a/SOURCES/0282-support-modules-without-symbol-table.patch b/SOURCES/0282-support-modules-without-symbol-table.patch deleted file mode 100644 index 326deb6..0000000 --- a/SOURCES/0282-support-modules-without-symbol-table.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Wed, 3 Feb 2016 20:34:55 +0300 -Subject: [PATCH] support modules without symbol table - -all_video module does not have any code or data and exists solely for -.moddeps section to pull in dependencies. This makes all symbols unneeded. - -While in current binutils (last released version as of this commit is 2.26) -``strip --strip-unneeded'' unintentionally adds section symbols for each -existing section, this behavior was considered a bug and changed in commit -14f2c699ddca1e2f706342dffc59a6c7e23e844c to completely strip symbol table -in this case. - -Older binutils (verified with 2.17) and some other toolchains (at least -elftoolchain r3223M), both used in FreeBSD, remove symbol table in all_video -as well. - -Relax run-time check and do not return error for modules without symbol table. -Add additional checks to module verifier to make sure such modules - -a) have non-empty .moddeps section. Without either externally visible symbols -or .moddeps modules are completely useless and should not be built. - -b) do not have any relocations. - -Closes: 46986 - -v2: add run-time check for empty symbol table if relocations are present as - suggested by Vladimir. ---- - grub-core/kern/dl.c | 8 +++++++- - util/grub-module-verifierXX.c | 18 +++++++++++++++++- - 2 files changed, 24 insertions(+), 2 deletions(-) - -diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index b0b0405fcbe..c45afc64950 100644 ---- a/grub-core/kern/dl.c -+++ b/grub-core/kern/dl.c -@@ -341,8 +341,11 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) - if (s->sh_type == SHT_SYMTAB) - break; - -+ /* Module without symbol table may still be used to pull in dependencies. -+ We verify at build time that such modules do not contain any relocations -+ that may reference symbol table. */ - if (i == e->e_shnum) -- return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table")); -+ return GRUB_ERR_NONE; - - #ifdef GRUB_MODULES_MACHINE_READONLY - mod->symtab = grub_malloc (s->sh_size); -@@ -584,6 +587,9 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) - - if (seg) - { -+ if (!mod->symtab) -+ return grub_error (GRUB_ERR_BAD_MODULE, "relocation without symbol table"); -+ - err = grub_arch_dl_relocate_symbols (mod, ehdr, s, seg); - if (err) - return err; -diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c -index f612d51f389..9c04caa63b4 100644 ---- a/util/grub-module-verifierXX.c -+++ b/util/grub-module-verifierXX.c -@@ -176,7 +176,7 @@ get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word - break; - - if (i == grub_target_to_host16 (e->e_shnum)) -- grub_util_error ("no symbol table"); -+ return NULL; - - sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); - *size = grub_target_to_host (s->sh_size); -@@ -191,7 +191,21 @@ check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) - Elf_Word size, entsize; - unsigned i; - -+ /* Module without symbol table and without .moddeps section is useless -+ at boot time, so catch it early to prevent build errors */ - sym = get_symtab (arch, e, &size, &entsize); -+ if (!sym) -+ { -+ Elf_Shdr *s = find_section (arch, e, ".moddeps"); -+ -+ if (!s) -+ grub_util_error ("no symbol table and no .moddeps section"); -+ -+ if (!s->sh_size) -+ grub_util_error ("no symbol table and empty .moddeps section"); -+ -+ return; -+ } - - for (i = 0; - i < size / entsize; -@@ -243,6 +257,8 @@ section_check_relocations (const struct grub_module_verifier_arch *arch, void *e - Elf_Word symtabsize, symtabentsize; - - symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); -+ if (!symtab) -+ grub_util_error ("relocation without symbol table"); - - for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), - max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); diff --git a/SOURCES/0283-cacheinfo-Add-missing-license-information.patch b/SOURCES/0283-cacheinfo-Add-missing-license-information.patch deleted file mode 100644 index fd6c6d6..0000000 --- a/SOURCES/0283-cacheinfo-Add-missing-license-information.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Vladimir Serbinenko -Date: Fri, 20 Mar 2015 11:13:58 +0100 -Subject: [PATCH] cacheinfo: Add missing license information. - ---- - grub-core/commands/cacheinfo.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/grub-core/commands/cacheinfo.c b/grub-core/commands/cacheinfo.c -index ead6ff82cfc..d34a346964c 100644 ---- a/grub-core/commands/cacheinfo.c -+++ b/grub-core/commands/cacheinfo.c -@@ -23,6 +23,8 @@ - #include - #include - -+GRUB_MOD_LICENSE ("GPLv3+"); -+ - static grub_err_t - grub_rescue_cmd_info (struct grub_command *cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), diff --git a/SOURCES/0284-arm64-setjmp-Add-missing-license-macro.patch b/SOURCES/0284-arm64-setjmp-Add-missing-license-macro.patch deleted file mode 100644 index 0424f79..0000000 --- a/SOURCES/0284-arm64-setjmp-Add-missing-license-macro.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: dann frazier -Date: Thu, 21 May 2015 10:28:48 -0600 -Subject: [PATCH] arm64/setjmp: Add missing license macro - -Including the setjmp module in an arm64-efi image will cause it to -immediately exit with an "incompatible license" error. - -The source file includes a GPLv3+ boilerplate, so fix this by declaring a -GPLv3+ license using the GRUB_MOD_LICENSE macro. - -Signed-off-by: dann frazier ---- - grub-core/lib/arm64/setjmp.S | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/grub-core/lib/arm64/setjmp.S b/grub-core/lib/arm64/setjmp.S -index adaafe40f71..eabfd99b296 100644 ---- a/grub-core/lib/arm64/setjmp.S -+++ b/grub-core/lib/arm64/setjmp.S -@@ -17,8 +17,10 @@ - */ - - #include -+#include - - .file "setjmp.S" -+GRUB_MOD_LICENSE "GPLv3+" - .text - - /* diff --git a/SOURCES/0285-editenv-handle-relative-symlinks.patch b/SOURCES/0285-editenv-handle-relative-symlinks.patch deleted file mode 100644 index 20e1686..0000000 --- a/SOURCES/0285-editenv-handle-relative-symlinks.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jonathan Lebon -Date: Mon, 14 Aug 2017 14:37:20 -0400 -Subject: [PATCH] editenv: handle relative symlinks - -Handle symlinks with targets relative to the containing dir. This -ensures that the rename operation does not depend on the cwd. - -Resolves: rhbz#1479960 - -Signed-off-by: Jonathan Lebon ---- - util/editenv.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/util/editenv.c b/util/editenv.c -index d8d1dad6ab9..41bc7cb1c9a 100644 ---- a/util/editenv.c -+++ b/util/editenv.c -@@ -28,6 +28,7 @@ - - #include - #include -+#include - - #define DEFAULT_ENVBLK_SIZE 1024 - -@@ -87,9 +88,20 @@ grub_util_create_envblk_file (const char *name) - continue; - } - -- free (rename_target); - linkbuf[retsize] = '\0'; -- rename_target = linkbuf; -+ if (linkbuf[0] == '/') -+ { -+ free (rename_target); -+ rename_target = linkbuf; -+ } -+ else -+ { -+ char *dbuf = xstrdup (rename_target); -+ const char *dir = dirname (dbuf); -+ free (rename_target); -+ rename_target = xasprintf("%s/%s", dir, linkbuf); -+ free (dbuf); -+ } - } - - int rc = grub_util_rename (namenew, rename_target); diff --git a/SOURCES/0286-efinet-also-use-the-firmware-acceleration-for-http.patch b/SOURCES/0286-efinet-also-use-the-firmware-acceleration-for-http.patch deleted file mode 100644 index 5771c8a..0000000 --- a/SOURCES/0286-efinet-also-use-the-firmware-acceleration-for-http.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 30 Jul 2018 14:06:42 -0400 -Subject: [PATCH] efinet: also use the firmware acceleration for http - -Signed-off-by: Peter Jones ---- - grub-core/net/efi/net.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/grub-core/net/efi/net.c b/grub-core/net/efi/net.c -index 2bf15447fd5..f208d1b180c 100644 ---- a/grub-core/net/efi/net.c -+++ b/grub-core/net/efi/net.c -@@ -1324,7 +1324,9 @@ grub_efi_net_boot_from_https (void) - && (subtype == GRUB_EFI_URI_DEVICE_PATH_SUBTYPE)) - { - grub_efi_uri_device_path_t *uri_dp = (grub_efi_uri_device_path_t *) dp; -- return (grub_strncmp ((const char*)uri_dp->uri, "https://", sizeof ("https://") - 1) == 0) ? 1 : 0; -+ grub_dprintf ("efinet", "url:%s\n", (const char *)uri_dp->uri); -+ return (grub_strncmp ((const char *)uri_dp->uri, "https://", sizeof ("https://") - 1) == 0 || -+ grub_strncmp ((const char *)uri_dp->uri, "http://", sizeof ("http://") - 1) == 0); - } - - if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) diff --git a/SOURCES/0287-Make-root_url-reflect-the-protocol-hostname-of-our-b.patch b/SOURCES/0287-Make-root_url-reflect-the-protocol-hostname-of-our-b.patch deleted file mode 100644 index 2a5ffcd..0000000 --- a/SOURCES/0287-Make-root_url-reflect-the-protocol-hostname-of-our-b.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Peter Jones -Date: Mon, 30 Jul 2018 16:39:57 -0400 -Subject: [PATCH] Make root_url reflect the protocol+hostname of our boot url. - -Signed-off-by: Peter Jones ---- - grub-core/net/efi/http.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/grub-core/net/efi/http.c b/grub-core/net/efi/http.c -index 3f61fd2fa5b..243acbaa35b 100644 ---- a/grub-core/net/efi/http.c -+++ b/grub-core/net/efi/http.c -@@ -4,6 +4,7 @@ - #include - #include - #include -+#include - - static void - http_configure (struct grub_efi_net_device *dev, int prefer_ip6) -@@ -351,6 +352,24 @@ grub_efihttp_open (struct grub_efi_net_device *dev, - grub_err_t err; - grub_off_t size; - char *buf; -+ char *root_url; -+ grub_efi_ipv6_address_t address; -+ const char *rest; -+ -+ if (grub_efi_string_to_ip6_address (file->device->net->server, &address, &rest) && *rest == 0) -+ root_url = grub_xasprintf ("%s://[%s]", type ? "https" : "http", file->device->net->server); -+ else -+ root_url = grub_xasprintf ("%s://%s", type ? "https" : "http", file->device->net->server); -+ if (root_url) -+ { -+ grub_env_unset ("root_url"); -+ grub_env_set ("root_url", root_url); -+ grub_free (root_url); -+ } -+ else -+ { -+ return grub_errno; -+ } - - err = efihttp_request (dev->http, file->device->net->server, file->device->net->name, type, 1, 0); - if (err != GRUB_ERR_NONE) diff --git a/SOURCES/0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch b/SOURCES/0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch deleted file mode 100644 index 7101637..0000000 --- a/SOURCES/0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch +++ /dev/null @@ -1,50 +0,0 @@ -From a897321d9c318c18c92c6431115fd9be71fedba1 Mon Sep 17 00:00:00 2001 -From: "mike.travis@hpe.com" -Date: Wed, 28 Mar 2018 11:42:18 -0500 -Subject: [PATCH 288/288] efi/uga: Fix PCIe LER when GRUB2 accesses non-enabled - MMIO data from VGA - -A GPU inserted into a PCIe I/O slot disappears during system startup. -The problem centers around GRUB and a specific VGA init function in -efi_uga.c. This causes an LER (Link Error Recorvery) because the MMIO -memory has not been enabled before attempting access. - -The fix is to add the same coding used in other VGA drivers, specifically -to add a check to insure that it is indeed a VGA controller. And then -enable the MMIO address space with the specific bits. - -Signed-off-by: Mike Travis -Reviewed-by: Daniel Kiper ---- - grub-core/video/efi_uga.c | 13 +++++++++++-- - 1 file changed, 11 insertions(+), 2 deletions(-) - -diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c -index 1d4091c5631..97a607c01a5 100644 ---- a/grub-core/video/efi_uga.c -+++ b/grub-core/video/efi_uga.c -@@ -94,10 +94,19 @@ static int - find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data) - { - struct find_framebuf_ctx *ctx = data; -- grub_pci_address_t addr; -+ grub_pci_address_t addr, rcaddr; -+ grub_uint32_t subclass; - - addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); -- if (grub_pci_read (addr) >> 24 == 0x3) -+ subclass = (grub_pci_read (addr) >> 16) & 0xffff; -+ -+ if (subclass != GRUB_PCI_CLASS_SUBCLASS_VGA) -+ return 0; -+ -+ /* Enable MEM address spaces */ -+ rcaddr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); -+ grub_pci_write_word (rcaddr, grub_pci_read_word (rcaddr) | GRUB_PCI_COMMAND_MEM_ENABLED); -+ - { - int i; - --- -2.17.1 - diff --git a/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch b/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch deleted file mode 100644 index 70abdb9..0000000 --- a/SOURCES/0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 8f4dc1510c0f42a549b91c28eda74fe8a1e2a5d4 Mon Sep 17 00:00:00 2001 -From: Andrei Borzenkov -Date: Fri, 26 Feb 2016 21:44:37 +0300 -Subject: [PATCH] efidisk: prevent errors from diskfilter scan of removable - drives - -Map EFI_NO_MEDIA to GRUB_ERR_OUT_OF_RANGE that is ignored by diskfilter. This -actually matches pretty close (we obviously attempt to read outside of media) -and avoids adding more error codes. - -This affects only internally initiated scans. If read/write from removable is -explicitly requested, we still return an error and text explanation is more -clear for user than generic error. - -Reported and tested by Andreas Loew ---- - grub-core/disk/efi/efidisk.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index f04f20b84ff..41adc1b0421 100644 ---- a/grub-core/disk/efi/efidisk.c -+++ b/grub-core/disk/efi/efidisk.c -@@ -575,9 +575,11 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, - - status = grub_efidisk_readwrite (disk, sector, size, buf, 0); - -- if (status != GRUB_EFI_SUCCESS) -+ if (status == GRUB_EFI_NO_MEDIA) -+ return grub_error (GRUB_ERR_OUT_OF_RANGE, "no media in `%s'", disk->name); -+ else if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_READ_ERROR, -- N_("failure reading sector 0x%llx from `%s'"), -+ "failure reading sector 0x%llx from `%s'", - (unsigned long long) sector, - disk->name); - -@@ -596,9 +598,11 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, - - status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); - -- if (status != GRUB_EFI_SUCCESS) -+ if (status == GRUB_EFI_NO_MEDIA) -+ return grub_error (GRUB_ERR_OUT_OF_RANGE, "no media in `%s'", disk->name); -+ else if (status != GRUB_EFI_SUCCESS) - return grub_error (GRUB_ERR_WRITE_ERROR, -- N_("failure writing sector 0x%llx to `%s'"), -+ "failure writing sector 0x%llx to `%s'", - (unsigned long long) sector, disk->name); - - return GRUB_ERR_NONE; --- -2.20.1 - diff --git a/SOURCES/grub.macros b/SOURCES/grub.macros index 20a2f97..ffb2a41 100644 --- a/SOURCES/grub.macros +++ b/SOURCES/grub.macros @@ -1,7 +1,4 @@ # vim:filetype=spec - -%global flagday 1:2.02-0.65.el7_4 - # Modules always contain just 32-bit code %global _libdir %{_exec_prefix}/lib %global _binaries_in_noarch_packages_terminate_build 0 @@ -35,7 +32,6 @@ %global with_efi_arch 0 %global with_alt_efi_arch 0 %global with_legacy_arch 0 -%global with_legacy_utils 0 %global grubefiarch %{nil} %global grublegacyarch %{nil} @@ -101,16 +97,6 @@ -e 's/-m64//g' \\\ ) %{nil} %endif -%ifarch %{ix86} -%global target_cpu_name %{_arch} -%global grub_target_name %{_arch}-pc - -%global legacy_target_cpu_name i386 -%global legacy_package_arch pc -%global platform pc - -%global with_legacy_arch 0 -%endif %ifarch aarch64 %global efiarch aa64 @@ -148,7 +134,6 @@ %ifnarch %{efi_only} %global with_legacy_arch 1 -%global with_legacy_utils 1 %global grublegacyarch %{legacy_target_cpu_name}-%{platform} %global moduledir %{legacy_target_cpu_name}-%{platform} %endif @@ -162,14 +147,6 @@ %global with_efi_common 1 %global with_legacy_common 0 %endif -%ifarch %{ix86} -%global with_efi_arch 0 -%global with_alt_efi_arch 0 -%global with_efi_common 0 -%global with_legacy_common 1 -%global with_legacy_utils 1 -%global with_legacy_arch 0 -%endif %if 0%{with_efi_common} %global common_srcdir grub-%{grubefiarch}-%{tarversion} @@ -228,7 +205,7 @@ Requires: %{name}-tools-minimal >= %{evr} \ Requires: %{name}-tools-extra = %{evr} \ Requires: %{name}-tools = %{evr} \ %{-p:Provides: %{name}-efi = %{evr}} \ -%{-p:Obsoletes: %{name}-efi <= %{flagday}} \ +%{-p:Obsoletes: %{name}-efi < %{evr}} \ \ %{expand:%%description %{1}} \ %{desc} \ @@ -241,7 +218,7 @@ Group: System Environment/Base \ BuildArch: noarch \ Requires: %{name}-common = %{evr} \ %{-p:Provides: %{name}-efi-modules = %{evr}} \ -%{-p:Obsoletes: %{name}-efi-modules <= %{flagday}} \ +%{-p:Obsoletes: %{name}-efi-modules < %{evr}} \ %{expand:%%description %{1}-modules} \ %{desc} \ This subpackage provides support for rebuilding your own grub.efi. \ @@ -400,15 +377,15 @@ find . '(' -iname gdb_grub \\\ ')' \\\ -exec cp {} $RPM_BUILD_ROOT/usr/lib/grub/%{grubaltefiarch}/ \\\; \ find $RPM_BUILD_ROOT -iname "*.mod*" -exec chmod a-x {} '\;' \ -install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \ -install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \ +install -m 755 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \ +install -m 755 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \ cd .. \ %{nil} %define do_efi_install() \ cd grub-%{1}-%{tarversion} \ -install -m 700 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/ \ -install -m 700 -d $RPM_BUILD_ROOT/boot/grub2/ \ +install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/ \ +install -m 755 -d $RPM_BUILD_ROOT/boot/grub2/ \ make DESTDIR=$RPM_BUILD_ROOT install \ if [ -f $RPM_BUILD_ROOT%{_infodir}/grub.info ]; then \ rm -f $RPM_BUILD_ROOT%{_infodir}/grub.info \ @@ -420,10 +397,12 @@ find $RPM_BUILD_ROOT -iname "*.module" -exec chmod a-x {} '\;' \ touch $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/grub.cfg \ ln -sf ../boot/efi/EFI/%{efidir}/grub.cfg \\\ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg \ -install -m 700 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \ -install -m 700 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \ -install -D -m 700 unicode.pf2 \\\ +install -m 755 %{2} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{2} \ +install -m 755 %{3} $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/%{3} \ +install -D -m 644 unicode.pf2 \\\ $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/fonts/unicode.pf2\ +ln -sf /boot/efi/EFI/%{efidir}/grubenv \\\ + $RPM_BUILD_ROOT/boot/grub2/grubenv \ cd .. \ %{nil} @@ -436,7 +415,6 @@ fi \ if [ -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info ]; then \ rm -f $RPM_BUILD_ROOT%{_infodir}/grub-dev.info \ fi \ -touch ${RPM_BUILD_ROOT}/boot/%{name}/grub.cfg \ ln -s ../boot/%{name}/grub.cfg \\\ ${RPM_BUILD_ROOT}%{_sysconfdir}/grub2.cfg \ cd .. \ @@ -458,16 +436,18 @@ cp docs/grub.info $RPM_BUILD_ROOT%{_infodir}/%{name}.info \ cp docs/grub-dev.info \\\ $RPM_BUILD_ROOT%{_infodir}/%{name}-dev.info \ # Ghost config file \ -install -d -m 0700 ${RPM_BUILD_ROOT}/boot/efi/EFI/%{efidir}/ \ -install -d -m 0700 ${RPM_BUILD_ROOT}/boot/grub2/ \ +install -d -m 0755 ${RPM_BUILD_ROOT}/boot/efi/EFI/%{efidir}/ \ +install -d -m 0755 ${RPM_BUILD_ROOT}/boot/grub2/ \ install -d -m 0755 ${RPM_BUILD_ROOT}/boot/%{name}/themes/system \ install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/default \ install -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig \ touch ${RPM_BUILD_ROOT}%{_sysconfdir}/default/grub \ -ln -sf ../default/grub \\\ +ln -sf %{_sysconfdir}/default/grub \\\ ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/grub \ -ln -sf ../efi/EFI/%{efidir}/grubenv \\\ - $RPM_BUILD_ROOT/boot/grub2/grubenv \ +touch ${RPM_BUILD_ROOT}/boot/%{name}/grub.cfg \ +./grub-editenv ${RPM_BUILD_ROOT}/boot/grub2/grubenv create \ +ln -sf /boot/efi/EFI/%{efidir}/grubenv \\\ + ${RPM_BUILD_ROOT}/boot/grub2/grubenv \ cd .. \ %{nil} @@ -490,11 +470,11 @@ cd .. \ %{expand:%%files %{1}} \ %defattr(-,root,root,-) \ %config(noreplace) %{_sysconfdir}/%{name}-efi.cfg \ -%verify(not mtime) %dir %attr(0700,root,root)/boot/efi/EFI/%{efidir} \ -%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{2} \ -%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ -%ghost %config(noreplace) %verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grub.cfg \ -%config(noreplace) /boot/grub2/grubenv \ +%dir %attr(0755,root,root)/boot/efi/EFI/%{efidir} \ +/boot/efi/EFI/%{efidir}/%{2} \ +%attr(0755,root,root)/boot/efi/EFI/%{efidir}/fonts \ +%ghost %config(noreplace) /boot/efi/EFI/%{efidir}/grub.cfg \ +/boot/grub2/grubenv \ %ghost %config(noreplace) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/grubenv \ \ %{expand:%%files %{1}-modules} \ @@ -505,6 +485,6 @@ cd .. \ \ %{expand:%%files %{1}-cdboot} \ %defattr(-,root,root,-) \ -%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/%{3} \ -%verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir}/fonts \ +%attr(0755,root,root)/boot/efi/EFI/%{efidir}/%{3} \ +%attr(0755,root,root)/boot/efi/EFI/%{efidir}/fonts \ %{nil} diff --git a/SOURCES/grub.patches b/SOURCES/grub.patches index 5fda75b..ba404d8 100644 --- a/SOURCES/grub.patches +++ b/SOURCES/grub.patches @@ -248,42 +248,14 @@ Patch0247: 0247-Use-xid-to-match-DHCP-replies.patch Patch0248: 0248-Add-support-for-non-Ethernet-network-cards.patch Patch0249: 0249-misc-fix-invalid-character-recongition-in-strto-l.patch Patch0250: 0250-net-read-bracketed-ipv6-addrs-and-port-numbers.patch -Patch0251: 0251-net-read-bracketed-ipv6-addrs-and-port-numbers-pjone.patch -Patch0252: 0252-tftp-Fix-a-minor-const-error.patch -Patch0253: 0253-bootp-New-net_bootp6-command.patch -Patch0254: 0254-Put-back-our-code-to-add-a-local-route.patch -Patch0255: 0255-efinet-UEFI-IPv6-PXE-support.patch -Patch0256: 0256-grub.texi-Add-net_bootp6-doument.patch -Patch0257: 0257-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch -Patch0258: 0258-efinet-Setting-network-from-UEFI-device-path.patch -Patch0259: 0259-efinet-Setting-DNS-server-from-UEFI-protocol.patch -Patch0260: 0260-set-rootpath.patch -Patch0261: 0261-Fix-one-more-coverity-complaint.patch -Patch0262: 0262-Fix-up-linux-params-usage.patch -Patch0263: 0263-Fix-grub_net_hwaddr_to_str.patch -Patch0264: 0264-Fixup-for-newer-compiler.patch -Patch0265: 0265-Support-UEFI-networking-protocols.patch -Patch0266: 0266-efinet-Setting-network-from-UEFI-device-path.patch -Patch0267: 0267-AUDIT-0-http-boot-tracker-bug.patch -Patch0268: 0268-xfs-accept-filesystem-with-sparse-inodes.patch -Patch0269: 0269-grub-core-video-efi_gop.c-Add-support-for-BLT_ONLY-a.patch -Patch0270: 0270-efi-uga-use-64-bit-for-fb_base.patch -Patch0271: 0271-Fix-grub-setpassword-o-s-output-path.patch -Patch0272: 0272-Verify-modules-on-build-time-rather-than-failing-in-.patch -Patch0273: 0273-module-verifier-Check-range-limited-relative-relocat.patch -Patch0274: 0274-Strip-.ARM.exidx.patch -Patch0275: 0275-Disable-build-time-module-check-on-emu.patch -Patch0276: 0276-module-verifier-allow-limited-range-relocations-on-s.patch -Patch0277: 0277-remove-temporary-.bin-files-kernel-and-modules.patch -Patch0278: 0278-Add-missing-BUILD_EXEEXT.patch -Patch0279: 0279-grub-module-verifier-fix-unintended-sign-extension.patch -Patch0280: 0280-mkimage-fix-unintended-sign-extension.patch -Patch0281: 0281-arm64-Add-support-for-relocations-needed-for-linaro-.patch -Patch0282: 0282-support-modules-without-symbol-table.patch -Patch0283: 0283-cacheinfo-Add-missing-license-information.patch -Patch0284: 0284-arm64-setjmp-Add-missing-license-macro.patch -Patch0285: 0285-editenv-handle-relative-symlinks.patch -Patch0286: 0286-efinet-also-use-the-firmware-acceleration-for-http.patch -Patch0287: 0287-Make-root_url-reflect-the-protocol-hostname-of-our-b.patch -Patch0288: 0288-efi-uga-Fix-PCIe-LER-when-GRUB2-accesses-non-enabled.patch -Patch0289: 0289-efidisk-prevent-errors-from-diskfilter-scan-of-remov.patch +Patch0251: 0251-bootp-New-net_bootp6-command.patch +Patch0252: 0252-efinet-UEFI-IPv6-PXE-support.patch +Patch0253: 0253-grub.texi-Add-net_bootp6-doument.patch +Patch0254: 0254-bootp-Add-processing-DHCPACK-packet-from-HTTP-Boot.patch +Patch0255: 0255-efinet-Setting-network-from-UEFI-device-path.patch +Patch0256: 0256-efinet-Setting-DNS-server-from-UEFI-protocol.patch +Patch0257: 0257-set-rootpath.patch +Patch0258: 0258-Fix-one-more-coverity-complaint.patch +Patch0259: 0259-Fix-up-linux-params-usage.patch +Patch0260: 0260-Make-module-directory-specifiable-on-the-configure-c.patch +Patch0261: 0261-Fix-grub_net_hwaddr_to_str.patch diff --git a/SPECS/grub2.spec b/SPECS/grub2.spec index 60122d1..9805aeb 100644 --- a/SPECS/grub2.spec +++ b/SPECS/grub2.spec @@ -6,7 +6,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 0.80%{?dist}%{?buildid} +Release: 0.65%{?dist}%{?buildid}.1 Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -35,6 +35,13 @@ BuildRequires: /usr/lib64/crt1.o glibc-static glibc-devel %else %ifarch x86_64 BuildRequires: /usr/lib64/crt1.o glibc-static(x86-64) glibc-devel(x86-64) +# glibc32 is what will be in the buildroots, but glibc-static(x86-32) is what +# will be in an epel-7 (i.e. centos) mock root. I think. +%if 0%{?centos}%{?mock} +BuildRequires: /usr/lib/crt1.o glibc-static(x86-32) glibc-devel(x86-32) +%else +BuildRequires: /usr/lib/crt1.o glibc32 +%endif %else # ppc64 builds need the ppc crt1.o BuildRequires: /usr/lib/crt1.o glibc-static glibc-devel @@ -53,7 +60,7 @@ BuildRequires: ccache %endif ExcludeArch: s390 s390x %{arm} %{?ix86} -Obsoletes: %{name} <= %{flagday} +Obsoletes: %{name} <= %{evr} %if 0%{with_legacy_arch} Requires: %{name}-%{legacy_package_arch} = %{evr} @@ -71,7 +78,6 @@ hardware devices.\ %description %{desc} -%ifarch x86_64 %package common Summary: grub2 common layout Group: System Environment/Base @@ -80,16 +86,12 @@ BuildArch: noarch %description common This package provides some directories which are required by various grub2 subpackages. -%endif %package tools Summary: Support tools for GRUB. Group: System Environment/Base -Obsoletes: %{name}-tools <= %{flagday} -Obsoletes: %{name}-tools-efi <= %{flagday} -Provides: %{name}-tools-efi = %{evr} -Requires: %{name}-tools-minimal = %{evr} -Requires: %{name}-common = %{evr} +Obsoletes: %{name}-tools < %{evr} +Requires: %{name}-common = %{epoch}:%{version}-%{release} Requires: gettext os-prober which file Requires(pre): dracut Requires(post): dracut @@ -98,12 +100,25 @@ Requires(post): dracut %{desc} This subpackage provides tools for support of all platforms. +%ifarch x86_64 +%package tools-efi +Summary: Support tools for GRUB. +Group: System Environment/Base +Requires: gettext os-prober which file +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-tools < %{evr} + +%description tools-efi +%{desc} +This subpackage provides tools for support of EFI platforms. +%endif + %package tools-minimal Summary: Support tools for GRUB. Group: System Environment/Base Requires: gettext -Requires: %{name}-common = %{evr} -Obsoletes: %{name}-tools <= %{flagday} +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-tools < %{evr} %description tools-minimal %{desc} @@ -115,8 +130,7 @@ Group: System Environment/Base Requires: gettext os-prober which file Requires: %{name}-tools-minimal = %{epoch}:%{version}-%{release} Requires: %{name}-common = %{epoch}:%{version}-%{release} -Requires: %{name}-tools = %{evr} -Obsoletes: %{name}-tools <= %{flagday} +Obsoletes: %{name}-tools < %{evr} %description tools-extra %{desc} @@ -141,7 +155,7 @@ This subpackage provides tools for support of all platforms. %if 0%{with_alt_efi_arch} %do_setup %{grubaltefiarch} %endif -%if 0%{with_legacy_arch}%{with_legacy_utils} +%if 0%{with_legacy_arch} %do_setup %{grublegacyarch} %endif @@ -152,7 +166,7 @@ This subpackage provides tools for support of all platforms. %if 0%{with_alt_efi_arch} %do_alt_efi_build %{grubaltefiarch} %{grubaltefiname} %{grubalteficdname} %{_alt_target_platform} "'%{alt_efi_cflags}'" %{SOURCE3} %{SOURCE4} redhatsecureboot301 %endif -%if 0%{with_legacy_arch}%{with_legacy_utils} +%if 0%{with_legacy_arch} %do_legacy_build %{grublegacyarch} %endif %do_common_build @@ -168,10 +182,9 @@ rm -fr $RPM_BUILD_ROOT %if 0%{with_alt_efi_arch} %do_alt_efi_install %{grubaltefiarch} %{grubaltefiname} %{grubalteficdname} %endif -%if 0%{with_legacy_arch}%{with_legacy_utils} +%if 0%{with_legacy_arch} %do_legacy_install %{grublegacyarch} %{alt_grub_target_name} %endif -${RPM_BUILD_ROOT}/%{_bindir}/%{name}-editenv ${RPM_BUILD_ROOT}/boot/efi/EFI/%{efidir}/grubenv create rm -f $RPM_BUILD_ROOT%{_infodir}/dir %find_lang grub @@ -237,13 +250,6 @@ elif [ -f /etc/grub.d/01_users ] && \ > /boot/grub2/user.cfg fi fi -if [ -f /boot/grub2/grubenv ] && ! [ -f /boot/efi/EFI/%{efidir}/grubenv ] ; then - if [ -e /boot/efi/EFI/%{efidir}/grubenv ] ; then - rm /boot/efi/EFI/%{efidir}/grubenv - mv /boot/grub2/grubenv /boot/efi/EFI/%{efidir}/grubenv - ln -sf ../efi/EFI/%{efidir}/grubenv /boot/grub2/grubenv - fi -fi %post tools if [ "$1" = 1 ]; then @@ -283,18 +289,7 @@ if [ "$1" = 0 ]; then fi %files -%ifnarch x86_64 %{ix86} -%exclude %{_bindir}/%{name}-render-label -%exclude %{_sbindir}/%{name}-bios-setup -%exclude %{_sbindir}/%{name}-macbless -%endif -%ifnarch x86_64 -%exclude /boot/grub2/grubenv -%exclude /boot/efi/EFI/*/grubenv -%exclude %{_datadir}/locale -%endif -%ifarch x86_64 %files common -f grub.lang %dir %{_libdir}/grub/ %dir %{_datarootdir}/grub/ @@ -309,7 +304,7 @@ fi %exclude /boot/%{name}/themes/system/* %attr(0700,root,root) %dir /boot/grub2 %exclude /boot/grub2/* -%dir %verify(not mtime) %attr(0700,root,root)/boot/efi/EFI/%{efidir} +%dir %attr(0755,root,root)/boot/efi/EFI/%{efidir} %exclude /boot/efi/EFI/%{efidir}/* %license %{common_srcdir}/COPYING %ghost %config(noreplace) /boot/grub2/grubenv @@ -321,6 +316,10 @@ fi %doc %{common_srcdir}/docs/grub.html %doc %{common_srcdir}/docs/grub-dev.html %doc %{common_srcdir}/docs/font_char_metrics.png +%ifnarch x86_64 %{ix86} +%exclude %{_bindir}/%{name}-render-label +%exclude %{_sbindir}/%{name}-bios-setup +%exclude %{_sbindir}/%{name}-macbless %endif %files tools-minimal @@ -338,6 +337,15 @@ fi %{_datadir}/man/man1/%{name}-editenv* %{_datadir}/man/man1/%{name}-mkpasswd-* +%ifarch x86_64 %{ix86} +%files tools-efi +%defattr(-,root,root,-) +%{_sbindir}/%{name}-macbless +%{_bindir}/%{name}-render-label +%{_datadir}/man/man8/%{name}-macbless* +%{_datadir}/man/man1/%{name}-render-label* +%endif + %files tools %defattr(-,root,root,-) %attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/default/grub @@ -379,20 +387,10 @@ fi %exclude %{_datadir}/man/man8/%{name}-setpassword* %exclude %{_datadir}/man/man1/%{name}-editenv* %exclude %{_datadir}/man/man1/%{name}-mkpasswd-* - -%ifarch x86_64 %{?ix86} -%{_sbindir}/%{name}-macbless -%{_bindir}/%{name}-render-label -%{_datadir}/man/man8/%{name}-macbless* -%{_datadir}/man/man1/%{name}-render-label* -%else -%exclude %{_sbindir}/%{name}-macbless -%exclude %{_bindir}/%{name}-render-label %exclude %{_datadir}/man/man8/%{name}-macbless* %exclude %{_datadir}/man/man1/%{name}-render-label* -%endif -%if %{with_legacy_utils} +%if %{with_legacy_arch} %{_sbindir}/%{name}-install %ifarch %{ix86} x86_64 %{_sbindir}/%{name}-bios-setup @@ -453,95 +451,12 @@ fi %endif %if 0%{with_legacy_arch} %define_legacy_variant_files %{legacy_package_arch} %{grublegacyarch} -%else -%if 0%{with_legacy_utils} -%exclude %{_sysconfdir}/%{name}.cfg -%exclude %{_libdir}/grub/%{grublegacyarch}/* -%exclude %{_libdir}/grub/%{grublegacyarch}/ -%endif %endif %changelog -* Wed Mar 27 2019 Javier Martinez Canillas - 2.02-0.80 -- Rebuild with correct build target for signing - Resolves: rhbz#1693213 - -* Tue Mar 26 2019 Javier Martinez Canillas - 2.02-0.79 -- Ignore the modification time when doing RPM verification of /boot/efi files - Resolves: rhbz#1496952 - -* Wed Mar 20 2019 Javier Martinez Canillas - 2.02-0.78 -- Prevent errors from diskfilter scan of removable drives - Resolves: rhbz#1446418 -- Avoid grub2-efi package to overwrite existing /boot/grub2/grubenv file - Resolves: rhbz#1497918 -- Remove glibc32 and glibc-static(x86-32) BuildRequires - Resolves: rhbz#1614259 - -* Thu Oct 25 2018 Javier Martinez Canillas - 2.02-0.77 +* Mon Nov 12 2018 Javier Martinez Canillas - 2.02-0.65.el7_5.1 - Re-enable regexp module - Resolves: rhbz#1630678 - -* Mon Jul 30 2018 pjones - 2.02.0.76 -- Fix PCIe probing in EFI UGA driver. - Resolves: rhbz#1583708 - -* Wed Jul 18 2018 Peter Jones - 2.02-0.74 -- Fix symlink issues with grubenv - Resolves: rhbz#1602773 - Related: rhbz#1497918 -- Make the common subpackage only build on x86_64 to avoid timestamp - mismatches. - Related: rhbz#1602773 - Related: rhbz#1497918 - -* Fri Jun 29 2018 Peter Jones - 2.02-0.73 -- Fix loading grub modules with no symbols defined. - Related: rhbz#1490981 - -* Thu Jun 28 2018 Peter Jones - 2.02-0.72 -- Revert module dir fix; it still doesn't work. - Resolves: rhbz#1594703 - -* Mon Jun 25 2018 Peter Jones - 2.02-0.71 -- The change from 2.02-0.65.el7_4.2 never made it onto the main branch, - so one more build to avoid the regression. - Related: rhbz#1340893 - -* Mon Jun 25 2018 Peter Jones 2.02-0.70 -- ... and once more, because I built for the wrong target. - Related: rhbz#1340893 - -* Mon Jun 25 2018 Peter Jones - 2.02-0.69 -- Build utilities on i686 as well, so grubby can build-dep it there. - Related: rhbz#1340893 - -* Fri Jun 22 2018 Peter Jones - 2.02-0.68 -- More work on /boot/efi/... permissions - Resolves: rhbz#1496952 -- Rework grubenv symlinks and handle them on upgrades - Resolves: rhbz#1497918 -- Make grub2-setpassword -o work - Resolves: rhbz#1512749 - -* Thu Jun 21 2018 Peter Jones - 2.02-0.67 -- Make the permissions on /boot/efi/... match the filesystem's requirements. - Resolves: rhbz#1496952 - -* Thu Jun 21 2018 Peter Jones - 2.02-0.66 -- Fix EFI UGA driver when the framebuffer is above 4G - Resolves: rhbz#1457988 -- Handle XFS filesystems with sparse inodes - Resolves: rhbz#1402716 -- Support HTTP booting - Resolves: rhbz#1490981 - -* Mon Oct 09 2017 Peter Jones - 2.02-0.65.el7_4.2 -- Fix an incorrect man page exclusion on x86_64. - -* Fri Oct 06 2017 Peter Jones - 2.02-0.65.1 -- More precise requires and obsoletes on the -tools* subpackages to avoid - issues with mixing and matching repos the subpackages are split between. + Resolves: rhbz#1647526 * Fri Sep 22 2017 Peter Jones - 2.02-0.65 - Fix spurious : at the end of the mac address netboot paths.