grub2-probe confused by double bind mount?

2017-08-03 Thread Chris Murphy
Running grub2-mkconfig complains with grub2-probe: error: cannot find a device for / (is /dev mounted?). /dev is mounted and looks valid. If I point grub2-probe to / I get the same error, whereas if I point it to the /dev device mounted to it, it exits normally. I suspect grub2-probe is confused

[PATCH v2 01/14] arm64/efi: move EFI_PAGE definitions to efi/memory.h

2017-08-03 Thread Leif Lindholm
The EFI page definitions and macros are generic and should not be confined to atm64 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 --- grub-core/loader/arm64/fdt.c | 1 + grub-core/loader/a

[PATCH v2 02/14] efi: add central copy of grub_efi_find_mmap_size

2017-08-03 Thread Leif Lindholm
There are several implementations of this function in the tree. Add a central version in grub-core/efi/mm.c. Taken from grub-core/loader/i386/linux.c, changing some hard-coded constants to use macros from efi/memory.h. Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 44 ++

[PATCH v2 03/14] loader: drop local implementations of find_efi_mmap_size

2017-08-03 Thread Leif Lindholm
Now we have a grub_efi_find_mmap_size, replace near-identical implementations in i386/linux and mbi2 loaders with calls to that one. Signed-off-by: Leif Lindholm --- grub-core/loader/i386/linux.c | 51 +-- grub-core/loader/multiboot_mbi2.c | 38 +--

[PATCH v2 00/14] efi: improved correctness, arm unification, and cleanup

2017-08-03 Thread Leif Lindholm
This patch series is really three different ones, but they unite around the need for (and the implementation) of more flexible control of memory

[PATCH v2 07/14] efi: Add GRUB_PE32_MAGIC definition

2017-08-03 Thread Leif Lindholm
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 --- grub-core/loader/arm64/linux.c | 2 +- include/grub/arm64/linux.h | 2 -- include/grub/efi/pe32.h

[PATCH v2 14/14] efi: change heap allocation type to GRUB_EFI_LOADER_CODE

2017-08-03 Thread Leif Lindholm
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-o

[PATCH v2 05/14] efi: refactor grub_efi_allocate_pages

2017-08-03 Thread Leif Lindholm
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

[PATCH v2 04/14] efi: add grub_efi_get_ram_base() function for arm*

2017-08-03 Thread Leif Lindholm
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 arm/arm64 linux loader to restrict the initrd location to where it will be accessible by the kernel at runti

[PATCH v2 08/14] arm64 linux loader: improve type portability

2017-08-03 Thread Leif Lindholm
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 --- grub-core/loader/arm64/linux.c | 15 ++- grub-core/loader/efi/fdt.c | 8 2 files changed, 10 insertion

[PATCH v2 06/14] efi: move fdt helper library

2017-08-03 Thread Leif Lindholm
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

[PATCH v2 11/14] arm/efi: switch to arm64 linux loader

2017-08-03 Thread Leif Lindholm
Switch over to the EFI-stub aware arm64 loader for 32-bit ARM platforms. Signed-off-by: Leif Lindholm --- grub-core/Makefile.core.def | 6 +++--- grub-core/kern/efi/mm.c | 2 +- include/grub/efi/efi.h | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/grub-core/Makef

[PATCH v2 12/14] arm: delete unused efi support from loader/arm

2017-08-03 Thread Leif Lindholm
The 32-bit arm efi port now shares the 64-bit linux loader, so delete the now unused bits from the 32-bit linux loader. This in turn leaves the grub-core/kern/arm/efi/misc.c unused, so delete that too. Signed-off-by: Leif Lindholm --- grub-core/Makefile.am | 1 - grub-core/kern/arm/ef

[PATCH v2 09/14] arm64 linux loader: rename functions and macros and move to common headers

2017-08-03 Thread Leif Lindholm
In preparation for using the linux loader for 32-bit and 64-bit platforms, rename grub_arm64*/GRUB_ARM64* to grub_efi*/GRUB_EFI*. Move prototypes for now-common functions to efi/efi.h. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c| 14 +++--- grub-core/loader/arm6

[PATCH v2 10/14] loader: switch arm/linux to grub_linux_kernel_header struct

2017-08-03 Thread Leif Lindholm
Use kernel header struct and generic magic definition to align with arm64/linux loader. Signed-off-by: Leif Lindholm --- grub-core/loader/arm/linux.c | 11 +-- include/grub/arm/linux.h | 15 --- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/grub-core/loa

[PATCH v2 13/14] efi: restrict arm/arm64 linux loader initrd placement

2017-08-03 Thread Leif Lindholm
The 32-bit arm Linux kernel is built as a zImage, which self-decompresses down to near start of RAM. In order for an initrd/initramfs to be accessible, it needs to be placed within the first ~768MB of RAM. The initrd loader built into the kernel EFI stub restricts this down to 512MB for simplicity

Re: grub installer question

2017-08-03 Thread Colin Watson
On Tue, Aug 01, 2017 at 04:45:12PM +0430, faezeh dehghan wrote: > I am a newie in grub and kernel development. I want to change the grub > package (grub-installer(1.117+deb8u1)) grub-installer is part of the Debian installer, and is not part of GRUB. Note that it is not the same as the grub-instal

Re: [PATCH v2 01/14] arm64/efi: move EFI_PAGE definitions to efi/memory.h

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
This assumes that all CPUs supporting EFI have 4K pages. What if some of CPUs have other page sizes? Le Thu, Aug 3, 2017 à 12:07 PM, Leif Lindholm a écrit : > The EFI page definitions and macros are generic and should not be confined > to atm64 headers - so move to efi/memory.h. > Also add EFI_P

Re: [PATCH v2 03/14] loader: drop local implementations of find_efi_mmap_size

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
LGTM Le Thu, Aug 3, 2017 à 12:07 PM, Leif Lindholm a écrit : > Now we have a grub_efi_find_mmap_size, replace near-identical > implementations > in i386/linux and mbi2 loaders with calls to that one. > > Signed-off-by: Leif Lindholm > --- > grub-core/loader/i386/linux.c | 51 > +---

Re: [PATCH v2 02/14] efi: add central copy of grub_efi_find_mmap_size

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
Looks good. But out of context the name is not descriptive enough. Can we add a comment near declaration to clarify what this functions is for? Le Thu, Aug 3, 2017 à 12:07 PM, Leif Lindholm a écrit : > There are several implementations of this function in the tree. > Add a central version in gru

Re: [PATCH v2 04/14] efi: add grub_efi_get_ram_base() function for arm*

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
Any reason to use plain error numbers without grub_error? Le Thu, Aug 3, 2017 à 12:09 PM, Leif Lindholm a écrit : > 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. > >

Re: [PATCH v2 05/14] efi: refactor grub_efi_allocate_pages

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
Le Thu, Aug 3, 2017 à 12:09 PM, Leif Lindholm a écrit : > 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

Re: [PATCH v2 06/14] efi: move fdt helper library

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
LGTM Le Thu, Aug 3, 2017 à 12:10 PM, Leif Lindholm a écrit : > 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

[PATCH 1/3] zfs: remove size_t typedef and use grub_size_t instead

2017-08-03 Thread Pete Batard
Regards, /Pete From 9b3a9fd2b24dc80cee38646dbdc3bbb686cc91ff Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 3 Aug 2017 15:46:15 +0100 Subject: [PATCH 1/3] zfs: remove size_t typedef and use grub_size_t instead * Prevents some toolchains from issuing a warning on size_t redef. --- grub-c

[PATCH 0/3] misc changes to improve toolchain compatibility

2017-08-03 Thread Pete Batard
Hi, The following is a series of 3 small changes that aim at making the GRUB codebase more palatable to toolchains such as the EDK2. The main aim is to enable the use the EDK2 and the GRUB fs code to compile read-only EFI file system drivers (such as the ones from my efifs project [1]). It n

[PATCH 3/3] io: add a GZ prefix to gzio specific defines

2017-08-03 Thread Pete Batard
Regards, /Pete From 331ec3f7567f3f86e4d4d78fd173079d39d4eb8d Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 3 Aug 2017 16:20:31 +0100 Subject: [PATCH 3/3] io: add a GZ prefix to gzio specific defines * This is done to avoid a conflict with a PACKED define in the EDK2 --- grub-core/io/gz

[PATCH 2/3] crypto: switch nonstandard escape sequence to its hex value

2017-08-03 Thread Pete Batard
Regards, /Pete From 3660346530b5cb39c81e71dbfb488c8315aa8b78 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 3 Aug 2017 16:16:43 +0100 Subject: [PATCH 2/3] crypto: switch nonstandard escape sequence to its hex value * '\e' is not in the C standard and produces an error with some compiler

Re: [PATCH v2 07/14] efi: Add GRUB_PE32_MAGIC definition

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
LGTM On Thu, Aug 3, 2017, 12:09 Leif Lindholm wrote: > 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 > --- > grub-core/loader/arm64/linux.c

Re: [PATCH v2 08/14] arm64 linux loader: improve type portability

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
LGTM On Thu, Aug 3, 2017, 12:10 Leif Lindholm wrote: > 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 > --- > grub-core/loader/arm64/linux.c | 15 ++- > grub-c

Re: [PATCH v2 09/14] arm64 linux loader: rename functions and macros and move to common headers

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
On Thu, Aug 3, 2017, 12:14 Leif Lindholm wrote: > In preparation for using the linux loader for 32-bit and 64-bit platforms, > rename > grub_arm64*/GRUB_ARM64* to grub_efi*/GRUB_EFI*. > > Move prototypes for now-common functions to efi/efi.h. > > Signed-off-by: Leif Lindholm > --- > grub-core/l

Re: [PATCH v2 09/14] arm64 linux loader: rename functions and macros and move to common headers

2017-08-03 Thread Vladimir 'phcoder' Serbinenko
We can use armxx as an infix for names that are for both arm and aarch64 On Thu, Aug 3, 2017, 18:44 Vladimir 'phcoder' Serbinenko wrote: > > > On Thu, Aug 3, 2017, 12:14 Leif Lindholm wrote: > >> In preparation for using the linux loader for 32-bit and 64-bit >> platforms, rename >> grub_arm64*

Re: [PATCH] Fix a segfault in lsefi

2017-08-03 Thread Daniel Kiper
On Thu, Jul 27, 2017 at 03:44:08PM +0200, Daniel Kiper wrote: > On Wed, Jul 19, 2017 at 03:47:41PM -0400, Peter Jones wrote: > > From: Rob Clark > > > > when protocols_per_handle returns error, we can't use the pointers we > > passed to it, and that includes trusting num_protocols. > > > > Signed-