Commit Graph

14719 Commits

Author SHA1 Message Date
Leif Lindholm
bcb6d29ca6 arm64/linux/loader: Rename functions and macros and move to common headers
In preparation for using the linux loader for 32-bit and 64-bit platforms,
rename grub_arm64*/GRUB_ARM64* to grub_armxx*/GRUB_ARMXX*.

Move prototypes for now-common functions to efi/efi.h.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=d24dd120864ed72a80d7bb9c0288c4f29934f79d
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm64-linux-loader-renames.patch

Gbp-Pq: Name arm64-linux-loader-renames.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
ec675e0983 efi: Add grub_efi_get_ram_base() function for arm64
Since ARM platforms do not have a common memory map, add a helper
function that finds the lowest address region with the EFI_MEMORY_WB
attribute set in the UEFI memory map.

Required for the arm64 efi linux loader to restrict the initrd
location to where it will be accessible by the kernel at runtime.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=bad144c60f664a83f5a7d3a014927bffaa2abbf1
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-add-grub_efi_get_ram_base-for-arm64.patch

Gbp-Pq: Name efi-add-grub_efi_get_ram_base-for-arm64.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
29f3ed942e efi: Add central copy of grub_efi_find_mmap_size
There are several implementations of this function in the tree.
Add a central version in grub-core/efi/mm.c.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=8ec18d1a4c26129c0a018ee7a61739a929ee1a25
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-add-central-copy-of-grub_efi_find_mmap_size.patch

Gbp-Pq: Name efi-add-central-copy-of-grub_efi_find_mmap_size.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
ab36139800 commands/file: Use definitions from arm64/linux.h
Clean up code for matching IS_ARM64 slightly by making use of struct
linux_arm64_kernel_header and GRUB_LINUX_ARM64_MAGIC_SIGNATURE.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9b37229f013db1b150082ac130be7c20b3db8cea
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: file-definitions-from-arm64-linux-h.patch

Gbp-Pq: Name file-definitions-from-arm64-linux-h.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
5fc0815984 commands/file: Use definitions from arm/linux.h
Clean up code for matching IS_ARM slightly by making use of struct
linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=40dc61ed75e08e7dc2951bdae5c59fecb15bbb72
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: file-definitions-from-arm-linux-h.patch

Gbp-Pq: Name file-definitions-from-arm-linux-h.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
6c06cba4b9 arm: make linux.h safe to include for non-native builds
<grub/machine/loader.h> (for machine arm/efi) and
<grub/machine/kernel.h> (for machine arm/coreboot) will not always
resolve (and will likely not be valid to) if pulled in when building
non-native commands, such as host tools or the "file" command.
So explicitly include them with their expanded pathnames.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=a244d9ebc7547f7ed373d9796a3bf186e7c035a1
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm-linux-h-safe-for-non-native.patch

Gbp-Pq: Name arm-linux-h-safe-for-non-native.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
44230f41b5 arm: switch linux loader to linux_arm_kernel_header struct
Use kernel header struct and magic definition to align (and coexist) with
i386/arm64 ports.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=cda033298680b6984044563b2ef6374a725b8aac
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm-switch-linux-loader-to-linux_arm_kernel_header.patch

Gbp-Pq: Name arm-switch-linux-loader-to-linux_arm_kernel_header.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
b9099a3d72 arm64: align linux kernel magic macro naming with i386
Change GRUB_ARM64_LINUX_MAGIC to GRUB_LINUX_ARM64_MAGIC_SIGNATURE.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7fd9722d0c5e9c5a85b782ef435c80085da308b2
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm64-align-linux-magic-macro-with-i386.patch

Gbp-Pq: Name arm64-align-linux-magic-macro-with-i386.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
56cbe1b5b4 arm64: align linux kernel header struct naming with i386
Rename struct grub_arm64_linux_kernel_header -> linux_arm64_kernel_header.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=ff1cf2548a3f33da19278829687d074ad746dd0a
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm64-align-linux_kernel_header-with-i386.patch

Gbp-Pq: Name arm64-align-linux_kernel_header-with-i386.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
b9c40696d2 i386: make struct linux_kernel_header architecture specific
struct linux_kernel_header -> struct linux_i386_kernel_header

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7d36709d5e769eb49b41cca709bd64336b47ab4f
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: i386-linux_kernel_header-arch-specific.patch

Gbp-Pq: Name i386-linux_kernel_header-arch-specific.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
679a7dcda6 make GRUB_LINUX_MAGIC_SIGNATURE architecture-specific
Rename GRUB_LINUX_MAGIC_SIGNATURE GRUB_LINUX_I386_MAGIC_SIGNATURE,
to be usable in code that supports more than one image type.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3245f02d9d7274e942426541cf73dc73e7298f02
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: GRUB_LINUX_MAGIC_SIGNATURE-arch-specific.patch

Gbp-Pq: Name GRUB_LINUX_MAGIC_SIGNATURE-arch-specific.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
7aed34b887 Make arch-specific linux.h include guards architecture unique
Replace uses of GRUB_LINUX_MACHINE_HEADER and GRUB_LINUX_CPU_HEADER
with GRUB_<arch>_LINUX_HEADER include guards to prevent issues when
including more than one of them.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=8776e5a942582adaadc67865ed74cdd199e56a16
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: linux-h-guards.patch

Gbp-Pq: Name linux-h-guards.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
3467fb05be arm64/efi: move EFI_PAGE definitions to efi/memory.h
The EFI page definitions and macros are generic and should not be confined
to arm64 headers - so move to efi/memory.h.
Also add EFI_PAGE_SIZE macro.

Update loader sources to reflect new header location.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=083c6e2455dcd4aafb6062d89fd6029dd3adddb6
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm64-efi-move-EFI_PAGE-definitions.patch

Gbp-Pq: Name arm64-efi-move-EFI_PAGE-definitions.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
03b5b8912b efi: change heap allocation type to GRUB_EFI_LOADER_CODE
With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may
not return regions with execute ability. Since modules are loaded onto
the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in
order to permit execution on systems with this feature enabled.

Closes: 50420

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=f826330683675f0deb55b58fd229afd7d65fb053
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-change-heap-allocation-type.patch

Gbp-Pq: Name efi-change-heap-allocation-type.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
2e1dd6b1f2 arm64 linux loader: improve type portability
In preparation for turning this into a common loader for 32-bit and 64-bit
platforms, ensure the code will compile cleanly for either.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=91212e0aa07e704a61e4540c18a27f149f5e51c3
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm64-linux-loader-improve-type-portability.patch

Gbp-Pq: Name arm64-linux-loader-improve-type-portability.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
bb691e0e3a efi: Add GRUB_PE32_MAGIC definition
Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete
the existing one in arm64/linux.h.

Update arm64 Linux loader to use this new definition.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=c5841ba7f0d14c193f20854e7e55b4f7ce9207d5
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-add-GRUB_PE32_MAGIC-definition.patch

Gbp-Pq: Name efi-add-GRUB_PE32_MAGIC-definition.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
443a9d5197 efi: move fdt helper library
There is nothing ARM64 (or even ARM) specific about the efi fdt helper
library, which is used for locating or overriding a firmware-provided
devicetree in a UEFI system - so move it to loader/efi for reuse.

Move the fdtload.h include file to grub/efi and update path to
efi/fdtload.h in source code referring to it.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=8c9465fac901caac6802d6872a1374518b001517
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-move-fdt-helper-library.patch

Gbp-Pq: Name efi-move-fdt-helper-library.patch
2019-06-25 10:11:12 +01:00
Vladimir Serbinenko
b8a659bc2c Remove grub_efi_allocate_pages.
grub_efi_allocate_pages Essentially does 2 unrelated things:
* Allocate at fixed address.
* Allocate at any address.

To switch between 2 different functions it uses address == 0 as magic
value which is wrong as 0 is a perfectly valid fixed adress to allocate at.

Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=4bc909bf89f5b4ff86c9e4e609d4fe0c11a66b0c
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-remove-grub_efi_allocate_pages.patch

Gbp-Pq: Name efi-remove-grub_efi_allocate_pages.patch
2019-06-25 10:11:12 +01:00
Leif Lindholm
07d15e00c5 efi: refactor grub_efi_allocate_pages
Expose a new function, grub_efi_allocate_pages_real(), making it possible
to specify allocation type and memory type as supported by the UEFI
AllocatePages boot service.

Make grub_efi_allocate_pages() a consumer of the new function,
maintaining its old functionality.

Also delete some left-around #if 1/#else blocks in the affected
functions.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=dd5fde2df83c5c03b7ba04d2cc5b7be96de8da7b
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: efi-refactor-grub_efi_allocate_pages.patch

Gbp-Pq: Name efi-refactor-grub_efi_allocate_pages.patch
2019-06-25 10:11:12 +01:00
Colin Watson
3392570f7f bash-completion: Drop "have" checks
These don't work with and aren't needed by dynamically-loaded
completions.

Bug-Debian: https://bugs.debian.org/912852
Forwarded: no
Last-Update: 2018-11-16

Patch-Name: bash-completion-drop-have-checks.patch

Gbp-Pq: Name bash-completion-drop-have-checks.patch
2019-06-25 10:11:12 +01:00
Colin Watson
8cd844d0d5 Cope with / being on a ZFS root dataset
If / is on the root dataset in a ZFS pool, then ${bootfs} will be set to
"/" (whereas if it is on a non-root dataset, there will be no trailing
slash).  Passing "root=ZFS=${rpool}/" will fail to boot, but
"root=ZFS=${rpool}" works fine, so strip the trailing slash.

Fixes: https://savannah.gnu.org/bugs/?52746
Tested-by: Fejes József <jozsef.fejes@gmail.com>
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>

Bug: https://savannah.gnu.org/bugs/?52746
Bug-Debian: https://bugs.debian.org/886178
Last-Update: 2018-10-29

Patch-Name: zfs-root-dataset.patch

Gbp-Pq: Name zfs-root-dataset.patch
2019-06-25 10:11:12 +01:00
Arindam Nath
5a1fd4cbda i386/linux: Add support for ext_lfb_base
The EFI Graphics Output Protocol can return a 64-bit
linear frame buffer address in some firmware/BIOS
implementations. We currently only store the lower
32-bits in the lfb_base. This will eventually be
passed to Linux kernel and the efifb driver will
incorrectly interpret the framebuffer address as
32-bit address.

The Linux kernel has already added support to handle
64-bit linear framebuffer address in the efifb driver
since quite some time now.

This patch adds the support for 64-bit linear frame
buffer address in GRUB to address the above mentioned
scenario.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=886edba8770ccbc3def0af2a7d6b346d00d0af2f
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1785033
Last-Update: 2018-10-29

Patch-Name: add_ext_lfb_base_support.patch

Gbp-Pq: Name add_ext_lfb_base_support.patch
2019-06-25 10:11:12 +01:00
Colin Watson
f3bfc050af Skip flaky grub_cmd_set_date test
Bug-Debian: https://bugs.debian.org/906470
Last-Update: 2018-10-28

Patch-Name: skip-grub_cmd_set_date.patch

Gbp-Pq: Name skip-grub_cmd_set_date.patch
2019-06-25 10:11:12 +01:00
H.J. Lu
1328b130c1 x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32
Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a

x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for
32-bit PC-relative branches.  Grub2 should treat R_X86_64_PLT32 as
R_X86_64_PC32.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=842c390469e2c2e10b5aa36700324cd3bde25875
Last-Update: 2018-07-30

Patch-Name: R_X86_64_PLT32.patch

Gbp-Pq: Name R_X86_64_PLT32.patch
2019-06-25 10:11:12 +01:00
Colin Watson
dcaa4a9fe5 tests: Fix qemu options for UHCI test
qemu 2.12 removed the -usbdevice option.  Use a more modern spelling
instead, in line with other USB-related tests.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>

Forwarded: https://lists.gnu.org/archive/html/grub-devel/2018-07/msg00114.html
Last-Update: 2018-07-30

Patch-Name: tests-fix-uhci-qemu-options.patch

Gbp-Pq: Name tests-fix-uhci-qemu-options.patch
2019-06-25 10:11:12 +01:00
Colin Watson
370c3d4323 tests: Disable sercon in SeaBIOS
SeaBIOS 1.11.0 added support for VGA emulation over a serial port, which
interferes with grub-shell.  Turn it off.

Signed-off-by: Colin Watson <cjwatson@ubuntu.com>

Forwarded: https://lists.gnu.org/archive/html/grub-devel/2018-07/msg00113.html
Last-Update: 2018-07-30

Patch-Name: tests-disable-sercon-in-seabios.patch

Gbp-Pq: Name tests-disable-sercon-in-seabios.patch
2019-06-25 10:11:12 +01:00
Luca Boccassi
350623c943 Add patch to fix lockdown mode
Description: do not overwrite sentinel byte in boot_params, breaks lockdown
 grub currently copies the entire boot_params, which includes setting sentinel
 byte to 0xff, which triggers sanitize_boot_params in the kernel which in
 turn clears various boot_params variables, including the indication that
 the booloader chain is verified and thus the kernel disables lockdown mode.
 According to the information on the Fedora bug tracker, only the information
 from byte 0x1f1 is necessary, so start copying from there instead.
Author: Luca Boccassi <bluca@debian.org>
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1418360
Forwarded: no
Patch-Name: fix_lockdown.patch

Gbp-Pq: Name fix_lockdown.patch
2019-06-25 10:11:12 +01:00
Linn Crosetto
9e7689d787 Disallow unsigned kernels if UEFI Secure Boot is enabled
If UEFI Secure Boot is enabled and kernel signature verification fails, do not
boot the kernel. Before this change, if kernel signature verification failed
then GRUB would fall back to calling ExitBootServices() and continuing the
boot.

Patch-Name: linuxefi_disable_sb_fallback.patch

Signed-off-by: Linn Crosetto <linn@hpe.com>

Gbp-Pq: Name linuxefi_disable_sb_fallback.patch
2019-06-25 10:11:12 +01:00
Konrad Rzeszutek Wilk
a1322abfb4 Use grub-file to figure out whether multiboot2 should be used for Xen.gz
The multiboot2 is much more preferable than multiboot. Especiall
if booting under EFI where multiboot does not have the functionality
to pass ImageHandler.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=b4d709b6ee789cdaf3fa7a80fd90c721a16f48c2
Bug-Debian: https://bugs.debian.org/898947
Last-Update: 2018-06-16

Patch-Name: xen-multiboot2.patch

Gbp-Pq: Name xen-multiboot2.patch
2019-06-25 10:11:12 +01:00
Vladimir Serbinenko
d1a075ae81 printf_unit_test: Disable Wformat-truncation on GCC >= 7
We intentionally pass NULL as argument to format, hence disable the warning.

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=32099228e6ccf209f64d509cd7e13413ea10778e
Last-Update: 2018-03-16

Patch-Name: printf-unit-test-gcc7.patch

Gbp-Pq: Name printf-unit-test-gcc7.patch
2019-06-25 10:11:12 +01:00
Eric Snowberg
e1c95655b7 Add support for modern sparc64 hardware
Origin: other, https://github.com/esnowberg/grub2-sparc/tree/sparc-next-v4
Bug-Debian: https://bugs.debian.org/854568
Last-Update: 2018-03-02

Patch-Name: sparc64-support.patch

Gbp-Pq: Name sparc64-support.patch
2019-06-25 10:11:12 +01:00
Vladimir Serbinenko
d6954faf58 yylex: Explicilty cast fprintf to void.
It's needed to avoid warning on recent GCC.

Bug-Debian: https://bugs.debian.org/890431
Last-Update: 2018-02-16

Patch-Name: fix-yylex-build.patch

Gbp-Pq: Name fix-yylex-build.patch
2019-06-25 10:11:12 +01:00
Colin Watson
14c76a0b1f build: Use pkg-config to find FreeType
pkg-config is apparently preferred over freetype-config these days (see
the BUGS section of freetype-config(1)).  pkg-config support was added
to FreeType in version 2.1.5, which was released in 2003, so it should
comfortably be available everywhere by now.

We no longer need to explicitly substitute FREETYPE_CFLAGS and
FREETYPE_LIBS, since PKG_CHECK_MODULES does that automatically.

Fixes Debian bug #887721.

Reported-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>

Bug-Debian: https://bugs.debian.org/887721
Last-Update: 2018-02-11

Patch-Name: freetype-pkg-config.patch

Gbp-Pq: Name freetype-pkg-config.patch
2019-06-25 10:11:12 +01:00
Colin Watson
25a43c128e build: Capitalise *freetype_* variables
Using FREETYPE_CFLAGS and FREETYPE_LIBS is more in line with the naming
scheme used by pkg-config macros.

Bug-Debian: https://bugs.debian.org/887721
Last-Update: 2018-02-11

Patch-Name: freetype-capitalise-variables.patch

Gbp-Pq: Name freetype-capitalise-variables.patch
2019-06-25 10:11:12 +01:00
David E. Box
e61c2c0fe4 tsc: Change default tsc calibration method to pmtimer on EFI systems
On efi systems, make pmtimer based tsc calibration the default over the
pit. This prevents Grub from hanging on Intel SoC systems that power gate
the pit.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=446794de8da4329ea532cbee4ca877bcafd0e534
Bug-Debian: https://bugs.debian.org/883193
Last-Update: 2017-12-01

Patch-Name: tsc_efi_default_to_pmtimer.patch

Gbp-Pq: Name tsc_efi_default_to_pmtimer.patch
2019-06-25 10:11:12 +01:00
Eric Biggers
1671822106 Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature.
On such a filesystem, inodes may have EXT4_ENCRYPT_FLAG set.
For a regular file, this means its contents are encrypted; for a
directory, this means the filenames in its directory entries are
encrypted; and for a symlink, this means its target is encrypted.  Since
GRUB cannot decrypt encrypted contents or filenames, just issue an error
if it would need to do so.  This is sufficient to allow unencrypted boot
files to co-exist with encrypted files elsewhere on the filesystem.

(Note that encrypted regular files and symlinks will not normally be
encountered outside an encrypted directory; however, it's possible via
hard links, so they still need to be handled.)

Tested by booting from an ext4 /boot partition on which I had run
'tune2fs -O encrypt'.  I also verified that the expected error messages
are printed when trying to access encrypted directories, files, and
symlinks from the GRUB command line.  Also ran 'sudo ./grub-fs-tester
ext4_encrypt'; note that this requires e2fsprogs v1.43+ and Linux v4.1+.

Signed-off-by: Eric Biggers <ebiggers@google.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=734668238fcc0ef691a080839e04f33854fa133a
Bug-Debian: https://bugs.debian.org/840204
Last-Update: 2017-07-06

Patch-Name: ext4_feature_encrypt.patch

Gbp-Pq: Name ext4_feature_encrypt.patch
2019-06-25 10:11:12 +01:00
Steve McIntyre
998ed4e938 Make grub-install check for errors from efibootmgr
Code is currently ignoring errors from efibootmgr, giving users
clearly bogus output like:

        Setting up grub-efi-amd64 (2.02~beta3-4) ...
        Installing for x86_64-efi platform.
        Could not delete variable: No space left on device
        Could not prepare Boot variable: No space left on device
        Installation finished. No error reported.

and then potentially unbootable systems. If efibootmgr fails,
grub-install should know that and report it!

Signed-off-by: Steve McIntyre <93sam@debian.org>

Bug-Debian: https://bugs.debian.org/853234
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2017-01/msg00107.html

Patch-Name: grub-install-efibootmgr-check.patch

Gbp-Pq: Name grub-install-efibootmgr-check.patch
2019-06-25 10:11:12 +01:00
Michael Chang
07ea090b3f 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 <mchang@suse.com>
Signed-off-by: Ken Lin <ken.lin@hpe.com>

Patch-Name: efinet_set_dns_from_uefi_proto.patch

Gbp-Pq: Name efinet_set_dns_from_uefi_proto.patch
2019-06-25 10:11:12 +01:00
Michael Chang
895d7c93db 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 <mchang@suse.com>
Signed-off-by: Ken Lin <ken.lin@hpe.com>

Patch-Name: efinet_set_network_from_uefi_devpath.patch

Gbp-Pq: Name efinet_set_network_from_uefi_devpath.patch
2019-06-25 10:11:12 +01:00
Michael Chang
24f11be30a 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 <mchang@suse.com>
Signed-off-by: Ken Lin <ken.lin@hpe.com>

Patch-Name: bootp_process_dhcpack_http_boot.patch

Gbp-Pq: Name bootp_process_dhcpack_http_boot.patch
2019-06-25 10:11:12 +01:00
Michael Chang
ab2deca8ae 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 <mchang@suse.com>
Signed-off-by: Ken Lin <ken.lin@hpe.com>

Patch-Name: efinet_uefi_ipv6_pxe_support.patch

Gbp-Pq: Name efinet_uefi_ipv6_pxe_support.patch
2019-06-25 10:11:12 +01:00
Michael Chang
d6cfe9ef50 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 <mchang@suse.com>
Signed-off-by: Ken Lin <ken.lin@hpe.com>

Patch-Name: bootp_new_net_bootp6_command.patch

Gbp-Pq: Name bootp_new_net_bootp6_command.patch
2019-06-25 10:11:12 +01:00
Aaron Miller
b04a2bbece 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

Patch-Name: net_read_bracketed_ipv6_addr.patch

Gbp-Pq: Name net_read_bracketed_ipv6_addr.patch
2019-06-25 10:11:12 +01:00
Aaron Miller
b66c7a1fbf 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
larger than 9 didn't result in a value lower than 9, which allowed the
parses: ` = 9, _ = 8, ^ = 7, ] = 6, \ = 5, and [ = 4

Patch-Name: misc-fix-invalid-char-strtol.patch

Gbp-Pq: Name misc-fix-invalid-char-strtol.patch
2019-06-25 10:11:12 +01:00
Chad MILLER
6cdf77db18 Tell zpool to emit full device names
zfs-initramfs currently provides extraneous, undesired symlinks to
devices directly underneath /dev/ to satisfy zpool's historical output
of unqualified device names. By including this environment variable to
signal our intent to zpool, zfs-linux packages can drop the symlink
behavior when updating to its upstream or backported output behavior.

Bug: https://savannah.gnu.org/bugs/?43653
Bug-Debian: https://bugs.debian.org/824974
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1527727
Last-Update: 2016-11-01

Patch-Name: zpool_full_device_name.patch

Gbp-Pq: Name zpool_full_device_name.patch
2019-06-25 10:11:12 +01:00
Colin Watson
fd1959bc0d syslinux_test: Fix out-of-tree build handling
When doing out-of-tree builds, abs_top_srcdir may well contain ".."
segments, and grub-syslinux2cfg canonicalises its --root argument.  As a
result, the expansion of @abs_top_srcdir@ may not match what
grub-syslinux2cfg produces.

It's somewhat difficult to portably canonicalize a path in shell, and
autoconf/automake don't offer any support for this.  But there's a much
simpler option: copy the test data to a temporary directory and make
substitutions in the expected output file based on that.

Forwarded: http://lists.gnu.org/archive/html/grub-devel/2016-09/msg00013.html
Last-Update: 2016-09-19

Patch-Name: syslinux-test-out-of-tree.patch

Gbp-Pq: Name syslinux-test-out-of-tree.patch
2019-06-25 10:11:12 +01:00
Colin Watson
9f93d37f8e Generate alternative init entries in advanced menu
Add fallback boot entries for alternative installed init systems.  Based
on patches from Michael Biebl and Didier Roche.

Bug-Debian: https://bugs.debian.org/757298
Bug-Debian: https://bugs.debian.org/773173
Forwarded: no
Last-Update: 2017-06-23

Patch-Name: mkconfig_other_inits.patch

Gbp-Pq: Name mkconfig_other_inits.patch
2019-06-25 10:11:12 +01:00
Steve McIntyre
3e6d051ac7 Add support for forcing EFI installation to the removable media path
Add an extra option to grub-install "--force-extra-removable". On EFI
platforms, this will cause an extra copy of the grub-efi image to be
written to the appropriate removable media patch
/boot/efi/EFI/BOOT/BOOT$ARCH.EFI as well. This will help with broken
UEFI implementations where the firmware does not work when configured
with new boot paths.

Signed-off-by: Steve McIntyre <93sam@debian.org>

Bug-Debian: https://bugs.debian.org/767037 https://bugs.debian.org/773092
Forwarded: Not yet
Last-Update: 2014-12-20

Patch-Name: grub-install-extra-removable.patch

Gbp-Pq: Name grub-install-extra-removable.patch
2019-06-25 10:11:12 +01:00
Ian Campbell
350e298a8a Arrange to insmod xzio and lzopio when booting a kernel as a Xen guest
This is needed in case the Linux kernel is compiled with CONFIG_KERNEL_XZ or
CONFIG_KERNEL_LZO rather than CONFIG_KERNEL_GZ (gzio is already loaded by
grub.cfg today).

Signed-off-by: Ian Campbell <ijc@debian.org>

Bug-Debian: https://bugs.debian.org/755256
Forwarded: http://lists.gnu.org/archive/html/grub-devel/2014-11/msg00091.html
Last-Update: 2014-11-30

Patch-Name: insmod-xzio-and-lzopio-on-xen.patch

Gbp-Pq: Name insmod-xzio-and-lzopio-on-xen.patch
2019-06-25 10:11:12 +01:00
Ian Campbell
a4683565a8 grub-install: Install PV Xen binaries into the upstream specified path
Upstream have defined a specification for where guests ought to place their
xenpv grub binaries in order to facilitate chainloading from a stage 1 grub
loaded from dom0.

http://xenbits.xen.org/docs/unstable-staging/misc/x86-xenpv-bootloader.html

The spec calls for installation into /boot/xen/pvboot-i386.elf or
/boot/xen/pvboot-x86_64.elf.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>

Bug-Debian: https://bugs.debian.org/762307
Forwarded: http://lists.gnu.org/archive/html/grub-devel/2014-10/msg00041.html
Last-Update: 2014-10-24

Patch-Name: grub-install-pvxen-paths.patch


Gbp-Pq: Name grub-install-pvxen-paths.patch
2019-06-25 10:11:12 +01:00