]> git.proxmox.com Git - grub2.git/log
grub2.git
5 years agoreleasing package grub2 version 2.02+dfsg1-13
Colin Watson [Thu, 14 Mar 2019 10:36:03 +0000 (10:36 +0000)]
releasing package grub2 version 2.02+dfsg1-13

5 years agodebian/signing-template.json.in: Use new extendable format
Colin Watson [Thu, 14 Mar 2019 10:32:03 +0000 (10:32 +0000)]
debian/signing-template.json.in: Use new extendable format

5 years agoCompleted nb debconf translations
Petter Reinholdtsen [Mon, 11 Mar 2019 16:37:53 +0000 (16:37 +0000)]
Completed nb debconf translations

5 years agoAdd regexp module to signed UEFI images
Colin Watson [Mon, 4 Mar 2019 17:25:45 +0000 (17:25 +0000)]
Add regexp module to signed UEFI images

5 years agoreleasing package grub2 version 2.02+dfsg1-12
Colin Watson [Fri, 1 Mar 2019 12:38:03 +0000 (12:38 +0000)]
releasing package grub2 version 2.02+dfsg1-12

5 years agoutil: Detect more I/O errors
Colin Watson [Thu, 28 Feb 2019 09:35:07 +0000 (09:35 +0000)]
util: Detect more I/O errors

Closes: #922741
5 years agoutil: Detect more I/O errors
Colin Watson [Thu, 28 Feb 2019 09:32:00 +0000 (09:32 +0000)]
util: Detect more I/O errors

Many of GRUB's utilities don't check anywhere near all the possible
write errors.  For example, if grub-install runs out of space when
copying a file, it won't notice.  There were missing checks for the
return values of write, fflush, fsync, and close (or the equivalents on
other OSes), all of which must be checked.

I tried to be consistent with the existing logging practices of the
various hostdisk implementations, but they weren't entirely consistent
to start with so I used my judgement.  The result at least looks
reasonable on GNU/Linux when I provoke a write error:

  Installing for x86_64-efi platform.
  grub-install: error: cannot copy `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' to `/boot/efi/EFI/debian/grubx64.efi': No space left on device.

There are more missing checks in other utilities, but this should fix
the most critical ones.

Bug-Debian: https://bugs.debian.org/922741
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-02/msg00125.html
Last-Update: 2019-02-28

Patch-Name: util-check-errors.patch

5 years agoosdep/freebsd: Fix partition calculation for EBR entries
Colin Watson [Tue, 26 Feb 2019 18:49:36 +0000 (18:49 +0000)]
osdep/freebsd: Fix partition calculation for EBR entries

Closes: #923253
5 years agoosdep/freebsd: Fix partition calculation for EBR entries
James Clarke [Tue, 26 Feb 2019 18:34:22 +0000 (18:34 +0000)]
osdep/freebsd: Fix partition calculation for EBR entries

For EBR partitions, "start" is the relative starting sector of the EBR
header itself, whereas "offset" is the relative starting byte of the
partition's contents, excluding the EBR header and any padding. Thus we
must use "offset", and divide by the sector size to convert to sectors.

Bug-Debian: https://bugs.debian.org/923253
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-02/msg00124.html
Last-Update: 2019-02-26

Patch-Name: freebsd-ebr-partition-offset.patch

5 years agodebian/signing-template.json.in: Add trusted_certs key
Colin Watson [Tue, 26 Feb 2019 18:28:52 +0000 (18:28 +0000)]
debian/signing-template.json.in: Add trusted_certs key

This is empty, since GRUB has no hardcoded list of trusted certificates.

5 years agogrub-install: Check for arm-efi as a default target
Colin Watson [Tue, 26 Feb 2019 14:26:08 +0000 (14:26 +0000)]
grub-install: Check for arm-efi as a default target

Closes: #922104
5 years agoFall back to arm-uboot if booted using EFI but -efi is missing
Steve McIntyre [Tue, 26 Feb 2019 14:14:17 +0000 (14:14 +0000)]
Fall back to arm-uboot if booted using EFI but -efi is missing

It may be possible, particularly in recovery situations, to be booted
using EFI on ARM when only the arm-uboot target is installed.  There's
nothing actually stopping us installing arm-uboot from an EFI
environment, and it's better than returning a confusing error.

(When convenient, this patch should be merged with
install_efi_fallback.patch.)

Forwarded: no
Last-Update: 2019-02-26

Patch-Name: install_efi_fallback_arm.patch

5 years agogrub-install: Check for arm-efi as a default target
Steve McIntyre [Mon, 11 Feb 2019 02:42:34 +0000 (02:42 +0000)]
grub-install: Check for arm-efi as a default target

Much like on x86, we can work out if the system is running on top
of EFI firmware. If so, return "arm-efi". If not, fall back to
"arm-uboot" as previously.

Heavily inspired by the existing code for x86.

Signed-off-by: Steve McIntyre <93sam@debian.org>
Reviewed-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=082fd84d525f8d6602f892160b77c0a948308a78
Bug-Debian: https://bugs.debian.org/922104
Last-Update: 2019-02-26

Patch-Name: grub-install-arm-default-target.patch

5 years agoarm64/efi: Fix grub_efi_get_ram_base()
Colin Watson [Tue, 26 Feb 2019 12:58:13 +0000 (12:58 +0000)]
arm64/efi: Fix grub_efi_get_ram_base()

5 years agoarm64/efi: Fix grub_efi_get_ram_base()
Leif Lindholm [Thu, 21 Feb 2019 10:15:08 +0000 (10:15 +0000)]
arm64/efi: Fix grub_efi_get_ram_base()

grub_efi_get_ram_base() looks for the lowest available RAM address by
traversing the memory map, comparing lowest address found so far.
Due to a brain glitch, that "so far" was initialized to GRUB_UINT_MAX -
completely preventing boot on systems without RAM below 4GB.

Change the initial value to GRUB_EFI_MAX_USABLE_ADDRESS, as originally
intended.

Reported-by: Steve McIntyre <93sam@debian.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Steve McIntyre <93sam@debian.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=566b16a0dc23d72357d2d75b781d3c7895b8a234
Last-Update: 2019-02-26

Patch-Name: arm64-fix-grub_efi_get_ram_base.patch

5 years agoImprove handling of /dev/disk/by-id/ changes
Colin Watson [Tue, 26 Feb 2019 12:46:25 +0000 (12:46 +0000)]
Improve handling of /dev/disk/by-id/ changes

Preserve previous answer to grub-pc/install_devices if we have to ask
grub-pc/install_devices_disks_changed and the user chooses not to
install to any devices, so that we can recover from temporary bugs that
cause /dev/disk/by-id/ paths to change.

Ideally this would also include explanatory text in the debconf
template, but it's a bit late in the buster release cycle for new
translatable text.  I've left an XXX comment for the time being.

Closes: #919029
5 years agoRemove old /dev/disk/by-id/ migration code
Colin Watson [Tue, 26 Feb 2019 09:55:35 +0000 (09:55 +0000)]
Remove old /dev/disk/by-id/ migration code

Remove code to migrate grub-pc/install_devices to persistent device
names under /dev/disk/by-id/.  This migration happened in
1.98+20100702-1, which was in squeeze (four stable releases ago), so we
no longer need to carry around this complex code.

5 years agoreleasing package grub2 version 2.02+dfsg1-11
Colin Watson [Sun, 10 Feb 2019 18:57:22 +0000 (18:57 +0000)]
releasing package grub2 version 2.02+dfsg1-11

5 years agoFix dpkg-reconfigure of /etc/default/grub items
Colin Watson [Sun, 10 Feb 2019 18:51:01 +0000 (18:51 +0000)]
Fix dpkg-reconfigure of /etc/default/grub items

Based loosely on a patch by Steve Langasek, for which thanks.

Closes: #921702
5 years agoFix setup on Secure Boot systems where cryptodisk is in use
Colin Watson [Sun, 10 Feb 2019 11:31:07 +0000 (11:31 +0000)]
Fix setup on Secure Boot systems where cryptodisk is in use

5 years agoFix setup on Secure Boot systems where cryptodisk is in use
Hervé Werner [Mon, 28 Jan 2019 16:24:23 +0000 (17:24 +0100)]
Fix setup on Secure Boot systems where cryptodisk is in use

On full-encrypted systems, including /boot, the current code omits
cryptodisk commands needed to open the drives if Secure Boot is enabled.
This prevents grub2 from reading any further configuration residing on
the encrypted disk.
This patch fixes this issue by adding the needed "cryptomount" commands in
the load.cfg file that is then copied in the EFI partition.

Bug-Debian: https://bugs.debian.org/917117
Last-Update: 2019-02-10

Patch-Name: uefi-secure-boot-cryptomount.patch

5 years agoieee1275: Include a.out header in assembly of sparc64 boot loader
Colin Watson [Sat, 9 Feb 2019 09:52:11 +0000 (09:52 +0000)]
ieee1275: Include a.out header in assembly of sparc64 boot loader

Closes: #921249
5 years agoieee1275: Include a.out header in assembly of sparc64 boot loader
John Paul Adrian Glaubitz [Sat, 9 Feb 2019 09:49:29 +0000 (09:49 +0000)]
ieee1275: Include a.out header in assembly of sparc64 boot loader

Recent versions of binutils dropped support for the a.out and COFF
formats on sparc64 targets. Since the boot loader on sparc64 is
supposed to be an a.out binary and the a.out header entries are
rather simple to calculate in our case, we just write the header
ourselves instead of relying external tools to do that.

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Bug-Debian: https://bugs.debian.org/921249
Forwarded: https://lists.gnu.org/archive/html/grub-devel/2019-02/msg00014.html
Last-Update: 2019-02-09

Patch-Name: sparc64-aout-fix.patch

5 years agoARM UEFI alignment patches also fix LP: #1812317
Colin Watson [Sat, 9 Feb 2019 09:38:40 +0000 (09:38 +0000)]
ARM UEFI alignment patches also fix LP: #1812317

5 years agoReplace out-of-tree arm64 4k alignment patches w/ upstream cherry-picks
dann frazier [Sat, 9 Feb 2019 09:35:48 +0000 (09:35 +0000)]
Replace out-of-tree arm64 4k alignment patches w/ upstream cherry-picks

5 years agoat_keyboard: initialize keyboard in module init if keyboard is ready
Jeroen Dekkers [Sat, 12 Jan 2019 20:02:18 +0000 (21:02 +0100)]
at_keyboard: initialize keyboard in module init if keyboard is ready

The change in 0c62a5b2 caused at_keyboard to fail on some
machines. Immediately initializing the keyboard in the module init if
the keyboard is ready makes the problem go away.

Bug-Debian: https://bugs.debian.org/741464
Last-Update: 2019-02-09

Patch-Name: at-keyboard-module-init.patch

5 years agomkimage: Clarify file alignment in efi case
Alexander Graf [Mon, 28 Jan 2019 13:35:29 +0000 (14:35 +0100)]
mkimage: Clarify file alignment in efi case

There are a few spots in the PE generation code for EFI binaries that uses
the section alignment rather than file alignment, even though the alignment
is really only file bound.

Replace those cases with the file alignment constant instead.

Reported-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Julien ROBIN <julien.robin28@free.fr>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9223eff8f8025511938c7eec908d60bdaa74106a
Bug-Debian: https://bugs.debian.org/919012
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1812317
Last-Update: 2019-02-09

Patch-Name: mkimage_clarify_file_alignment_efi.patch

5 years agomkimage: Align efi sections on 4k boundary
Alexander Graf [Mon, 28 Jan 2019 13:35:28 +0000 (14:35 +0100)]
mkimage: Align efi sections on 4k boundary

There is UEFI firmware popping up in the wild now that implements stricter
permission checks using NX and write protect page table entry bits.

This means that firmware now may fail to load binaries if its individual
sections are not page aligned, as otherwise it can not ensure permission
boundaries.

So let's bump all efi section alignments up to 4k (EFI page size). That way
we will stay compatible going forward.

Unfortunately our internals can't deal very well with a mismatch of alignment
between the virtual and file offsets, so we have to also pad our target
binary a bit.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Julien ROBIN <julien.robin28@free.fr>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=a51f953f4ee87cbfbf25a7df564304c5e9fea6a0
Bug-Debian: https://bugs.debian.org/919012
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1812317
Last-Update: 2019-02-09

Patch-Name: mkimage_Align_efi_sections_on_4k_boundary.patch

5 years agomkimage: Use EFI32_HEADER_SIZE define in arm-efi case
Alexander Graf [Mon, 28 Jan 2019 13:35:27 +0000 (14:35 +0100)]
mkimage: Use EFI32_HEADER_SIZE define in arm-efi case

The efi-arm case was defining its own header size calculation, even though it's
100% identical to the common EFI32_HEADER_SIZE definition.

So let's clean it up to use the common define.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Julien ROBIN <julien.robin28@free.fr>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=e347f40c1af2457a634af71e3cc75e851c641847
Bug-Debian: https://bugs.debian.org/919012
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1812317
Last-Update: 2019-02-09

Patch-Name: mkimage_arm-efi_Use_EFI32_HEADER_SIZE.patch

5 years agoAdd help and ls modules to signed UEFI images
Colin Watson [Sat, 9 Feb 2019 09:04:47 +0000 (09:04 +0000)]
Add help and ls modules to signed UEFI images

Closes: #919955
5 years agoInitialize keyboard in at_keyboard module init if keyboard is ready
Jeroen Dekkers [Sat, 9 Feb 2019 08:53:45 +0000 (08:53 +0000)]
Initialize keyboard in at_keyboard module init if keyboard is ready

Closes: #741464
5 years agoat_keyboard: initialize keyboard in module init if keyboard is ready
Jeroen Dekkers [Sat, 12 Jan 2019 20:02:18 +0000 (21:02 +0100)]
at_keyboard: initialize keyboard in module init if keyboard is ready

The change in 0c62a5b2 caused at_keyboard to fail on some
machines. Immediately initializing the keyboard in the module init if
the keyboard is ready makes the problem go away.

Bug-Debian: https://bugs.debian.org/741464
Last-Update: 2019-02-09

Patch-Name: at-keyboard-module-init.patch

5 years ago[de] German (Helge Kreutzmann and Holger Wansing)
Colin Watson [Fri, 1 Feb 2019 11:26:24 +0000 (11:26 +0000)]
[de] German (Helge Kreutzmann and Holger Wansing)

Closes: #921018
5 years agoAdd debian/.gitignore
Colin Watson [Sun, 20 Jan 2019 17:40:32 +0000 (17:40 +0000)]
Add debian/.gitignore

5 years agoSet Rules-Requires-Root: no
Colin Watson [Mon, 14 Jan 2019 15:07:19 +0000 (15:07 +0000)]
Set Rules-Requires-Root: no

5 years agoUpgrade to debhelper v10
Colin Watson [Mon, 14 Jan 2019 15:07:04 +0000 (15:07 +0000)]
Upgrade to debhelper v10

5 years agoMake grub-efi-amd64-signed recommend shim-signed
Steve McIntyre [Sat, 12 Jan 2019 15:08:57 +0000 (15:08 +0000)]
Make grub-efi-amd64-signed recommend shim-signed

Closes: #919067
5 years agoSet arm64-efi code offset to EFI_PAGE_SIZE
Colin Watson [Sat, 12 Jan 2019 10:44:47 +0000 (10:44 +0000)]
Set arm64-efi code offset to EFI_PAGE_SIZE

Closes: #919012
5 years agomkimage: arm64-efi: Align first section to page
Alexander Graf [Sun, 23 Dec 2018 02:52:07 +0000 (03:52 +0100)]
mkimage: arm64-efi: Align first section to page

In order to enforce NX semantics on non-code pages, UEFI firmware
may require that all code is EFI_PAGE_SIZE (4k) aligned. A similar
change has recently been applied to edk2 to accomodate for the same
fact:

  https://lists.01.org/pipermail/edk2-devel/2018-December/033708.html

This patch adapts grub to also implement the same alignment guarantees
and thus ensures we can boot even when strict permission checks are in
place.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Origin: other, https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00055.html
Bug-Debian: https://bugs.debian.org/919012
Last-Update: 2019-01-12

Patch-Name: mkimage-arm64-efi-align-first-section-to-page.patch

5 years agomkimage: Simplify header size logic
Alexander Graf [Sun, 23 Dec 2018 02:52:06 +0000 (03:52 +0100)]
mkimage: Simplify header size logic

For EFI images, we always have the following layout:

  [PE header]
  [padding]
  [first section (which also is the entry point)]

Currently there are 2 places where we define how big header+padding are:
in the .vaddr_offset member of our target image definition struct as well
as in code in grub_install_generate_image().

Remove the latter, so that we only have a single place to modify if we
need to change the padding.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Origin: other, https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00054.html
Bug-Debian: https://bugs.debian.org/919012
Last-Update: 2019-01-12

Patch-Name: mkimage-simplify-header-size-logic.patch

5 years agoreleasing package grub2 version 2.02+dfsg1-10
Colin Watson [Fri, 11 Jan 2019 15:27:43 +0000 (15:27 +0000)]
releasing package grub2 version 2.02+dfsg1-10

5 years agoTesting credit
Colin Watson [Mon, 7 Jan 2019 21:17:07 +0000 (21:17 +0000)]
Testing credit

5 years agoRun grub-install for i386-xen_pvh
Colin Watson [Mon, 7 Jan 2019 21:12:38 +0000 (21:12 +0000)]
Run grub-install for i386-xen_pvh

5 years agoRemove accidentally-added debian/files
Colin Watson [Mon, 7 Jan 2019 11:43:49 +0000 (11:43 +0000)]
Remove accidentally-added debian/files

5 years agoAdd PVH builds to grub-xen-bin and grub-xen-host
Colin Watson [Mon, 7 Jan 2019 11:43:11 +0000 (11:43 +0000)]
Add PVH builds to grub-xen-bin and grub-xen-host

5 years agoBackport Xen PVH guest support from upstream
Colin Watson [Mon, 7 Jan 2019 09:06:56 +0000 (09:06 +0000)]
Backport Xen PVH guest support from upstream

Closes: #776450
5 years agoxen_pvh: Add support to configure
Juergen Gross [Fri, 7 Dec 2018 12:11:48 +0000 (13:11 +0100)]
xen_pvh: Add support to configure

Support platform i386/xen_pvh in configure.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=d789e70e26340bd35b36d595a948dbc399b9ffba
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-configure.patch

5 years agoxen_pvh: Support grub-install for xen_pvh
Juergen Gross [Fri, 7 Dec 2018 12:11:47 +0000 (13:11 +0100)]
xen_pvh: Support grub-install for xen_pvh

Add xen_pvh support to grub-install.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=90b7b14fa5293c83c0645bfdcf4ef0cdac230d09
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-install.patch

5 years agoxen_pvh: Support building a standalone image
Juergen Gross [Fri, 7 Dec 2018 12:11:46 +0000 (13:11 +0100)]
xen_pvh: Support building a standalone image

Support mkimage for xen_pvh.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=78899c42d74d638a48c9b3f0f25f39445b3c1d4c
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-mkimage.patch

5 years agoxen: Use elfnote defines instead of plain numbers
Juergen Gross [Fri, 7 Dec 2018 12:11:45 +0000 (13:11 +0100)]
xen: Use elfnote defines instead of plain numbers

In order to avoid using plain integers for the ELF notes use the
available Xen include instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9bce25213a44553c71527776f65fabc3b729c2f3
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-elfnote-defines.patch

5 years agogrub-module-verifier: Ignore all_video for xen_pvh
Hans van Kranenburg [Fri, 7 Dec 2018 12:11:44 +0000 (13:11 +0100)]
grub-module-verifier: Ignore all_video for xen_pvh

This solves the build failing with "Error: no symbol table and no
.moddeps section"

Also see:
6371e9c10433578bb236a8284ddb9ce9e201eb59
- https://savannah.gnu.org/bugs/?49012

Signed-off-by: Hans van Kranenburg <hans@knorrie.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=a40b219e269ac407c10a569ce6b0c5d7f419d127
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-module-verifier.patch

5 years agoxen_pvh: Add build runes for grub-core
Juergen Gross [Fri, 7 Dec 2018 12:11:43 +0000 (13:11 +0100)]
xen_pvh: Add build runes for grub-core

Add the modifications to the build system needed to build a xen_pvh
grub.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9c062ad42c32a42b677da4b066cb33debf1dfe30
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-build.patch

5 years agoxen: Init memory regions for PVH
Juergen Gross [Fri, 7 Dec 2018 12:11:42 +0000 (13:11 +0100)]
xen: Init memory regions for PVH

Add all usable memory regions to grub memory management and add the
needed mmap iterate code, which will be used by grub core (e.g.
grub-core/lib/relocator.c or grub-core/mmap/mmap.c).

As we are running in 32-bit mode don't add memory above 4GB.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1d2473a024a9e1f46a7caa75d5c8186ed2cdb6e1
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-init-memory-regions.patch

5 years agoxen: Setup Xen specific data for PVH
Juergen Gross [Fri, 7 Dec 2018 12:11:41 +0000 (13:11 +0100)]
xen: Setup Xen specific data for PVH

Initialize the needed Xen specific data. This is:

- the Xen start of day page containing the console and Xenstore ring
  page PFN and event channel
- the grant table
- the shared info page

Write back the possibly modified memory map to the hypervisor in case
the guest is reading it from there again.

Set the RSDP address for the guest from the start_info page passed
as boot parameter.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=4c9b4a7c92c9373315fd8b0f8f889275814bba41
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-setup-data.patch

5 years agoxen: Get memory map from hypervisor for PVH
Juergen Gross [Fri, 7 Dec 2018 12:11:40 +0000 (13:11 +0100)]
xen: Get memory map from hypervisor for PVH

Retrieve the memory map from the hypervisor and normalize it to contain
no overlapping entries and to be sorted by address.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2b7a21afd319b829941a928f5763e017d1cc2951
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-get-memory-map.patch

5 years agoxen: Setup hypercall page for PVH
Juergen Gross [Fri, 7 Dec 2018 12:11:39 +0000 (13:11 +0100)]
xen: Setup hypercall page for PVH

Add the needed code to setup the hypercall page for calling into the
Xen hypervisor.

Import the XEN_HVM_DEBUGCONS_IOPORT define from Xen unstable into
include/xen/arch-x86/xen.h

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=da81e42a7ccb545513368ec7488cdf5019c1c2ba
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-setup-hypercall-page.patch

5 years agoxen: Add PVH boot entry code
Juergen Gross [Fri, 7 Dec 2018 12:11:38 +0000 (13:11 +0100)]
xen: Add PVH boot entry code

Add the code for the Xen PVH mode boot entry.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1a4d83af2fc1eb0a0951775a2b86860ab074c699
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-boot-entry.patch

5 years agoxen: Add basic hooks for PVH in current code
Juergen Gross [Fri, 7 Dec 2018 12:11:37 +0000 (13:11 +0100)]
xen: Add basic hooks for PVH in current code

Add the hooks to current code needed for Xen PVH. They will be filled
with code later when the related functionality is being added.

loader/i386/linux.c needs to include machine/kernel.h now as it needs
to get GRUB_KERNEL_USE_RSDP_ADDR from there. This in turn requires to
add an empty kernel.h header for some i386 platforms (efi, coreboot,
ieee1275, xen) and for x86_64 efi.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0b3e4eb2d2e1875e6045e838962f769f2ce161dd
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-basic-hooks.patch

5 years agoxen: Add PVH specific defines to offset.h
Juergen Gross [Fri, 7 Dec 2018 12:11:36 +0000 (13:11 +0100)]
xen: Add PVH specific defines to offset.h

include/grub/offsets.h needs some defines for Xen PVH mode.

Add them. While at it line up the values in the surrounding lines to
start at the same column.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=53a92dea8b675afb3f46aed15c04528695d46d59
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-offsets.patch

5 years agoxen: Modify grub_xen_ptr2mfn() for Xen PVH
Juergen Gross [Fri, 7 Dec 2018 12:11:35 +0000 (13:11 +0100)]
xen: Modify grub_xen_ptr2mfn() for Xen PVH

grub_xen_ptr2mfn() returns the machine frame number for a given pointer
value. For Xen-PVH guests this is just the PFN. Add the PVH specific
variant.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=3b8d09c7742a1890eadad6987852c82947ea5d4a
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-ptr2mfn.patch

5 years agoxen: Rearrange xen/init.c to prepare it for Xen PVH mode
Juergen Gross [Fri, 7 Dec 2018 12:11:34 +0000 (13:11 +0100)]
xen: Rearrange xen/init.c to prepare it for Xen PVH mode

Rearrange grub-core/kern/xen/init.c to prepare adding PVH mode support
to it. This includes putting some code under #ifdef GRUB_MACHINE_XEN
as it will not be used when running as PVH.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=bec9edf53f4d0b629a52a7d1145f38f88df8dd1d
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-rearrange-init.patch

5 years agoxen: Add some dummy headers for PVH mode
Juergen Gross [Fri, 7 Dec 2018 12:11:33 +0000 (13:11 +0100)]
xen: Add some dummy headers for PVH mode

With Xen PVH mode adding a new machine type the machine related headers
need to be present for the build to succeed. Most of the headers just
need to include the related common i386 headers. Add those to the tree.

Note that xen_pvh/int.h needs to include pc/int_types.h instead of
pc/int.h in order to avoid the definition of grub_bios_interrupt().

xen_pvh/memory.h needs to include coreboot/memory.h (like some other
<machine>/memory.h do as well) as this contains just the needed stubs.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=408de833bbd1ccad39ad439eaf3cddd528b039b5
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-add-dummy-headers.patch

5 years agoxen: Prepare common code for Xen PVH support
Juergen Gross [Fri, 7 Dec 2018 12:11:32 +0000 (13:11 +0100)]
xen: Prepare common code for Xen PVH support

Some common code needs to be special cased for Xen PVH mode. This hits
mostly Xen PV mode specific areas.

Split include/grub/i386/pc/int_types.h off from
include/grub/i386/pc/int.h to support including this file later from
xen_pvh code without the grub_bios_interrupt definition.

Move definition of struct grub_e820_mmap_entry from
grub-core/mmap/i386/pc/mmap.c to include/grub/i386/memory.h in order
to make it usable from xen_pvh code.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=fc9d47ead56365c3335bb42cf651008c9ac1f494
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-prepare-common-code.patch

5 years agoxen: Carve out grant tab initialization into dedicated function
Juergen Gross [Fri, 7 Dec 2018 12:11:31 +0000 (13:11 +0100)]
xen: Carve out grant tab initialization into dedicated function

Initialize the grant tab in a dedicated function. This will enable
using it for PVH guests, too.

Call the new function from grub_machine_init() as this will later
be common between Xen PV and Xen PVH mode.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=c84927272cea59084ad5b0705c55547e8c85b28d
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-refactor-grant-tab-init.patch

5 years agoloader/linux: Support passing RSDP address via boot params
Juergen Gross [Fri, 7 Dec 2018 12:11:30 +0000 (13:11 +0100)]
loader/linux: Support passing RSDP address via boot params

Xen PVH guests will have the RSDP at an arbitrary address. Support that
by passing the RSDP address via the boot parameters to Linux.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=d170be42f12b0b2ab91d8d943d7b0bf563c906dd
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-rsdp-boot-params.patch

5 years agoxen: Add some Xen headers
Juergen Gross [Fri, 7 Dec 2018 12:11:29 +0000 (13:11 +0100)]
xen: Add some Xen headers

In order to support grub2 in Xen PVH environment some additional Xen
headers are needed as grub2 will be started in PVH mode requiring to
use several HVM hypercalls and structures.

Add the needed headers from Xen 4.10 being the first Xen version with
full (not only experimental) PVH guest support.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9118effd1b1fb67d82168b37cf6dd1142feced3b
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07

Patch-Name: xen-pvh-add-headers.patch

5 years agoAvoid spurious ucf prompts
Colin Watson [Sat, 5 Jan 2019 18:15:10 +0000 (18:15 +0000)]
Avoid spurious ucf prompts

Keep track of the previous version of /usr/share/grub/default/grub and
set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
can't figure this out for itself since we apply debconf-based
customisations on top of the template configuration file.

Closes: #812574
LP: #564853

5 years agoAdd luks modules to signed UEFI images
Colin Watson [Sat, 5 Jan 2019 08:55:21 +0000 (08:55 +0000)]
Add luks modules to signed UEFI images

Omission pointed out by Alex Griffin and Hervé Werner.

Closes: #908162
LP: #1565950

5 years agogrub-core/loader/efi/fdt.c: do not copy random memory
Colin Watson [Fri, 21 Dec 2018 21:20:43 +0000 (21:20 +0000)]
grub-core/loader/efi/fdt.c: do not copy random memory

5 years agogrub-core/loader/efi/fdt.c: do not copy random memory
Heinrich Schuchardt [Mon, 17 Dec 2018 21:00:24 +0000 (22:00 +0100)]
grub-core/loader/efi/fdt.c: do not copy random memory

We should not try to copy any memory area which is outside of the original
fdt. If this extra memory is controlled by a hypervisor this might end
with a crash.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Origin: other, https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00042.html
Last-Update: 2018-12-21

Patch-Name: efi-fdt-do-not-copy-random-memory.patch

5 years agoreleasing package grub2 version 2.02+dfsg1-9
Colin Watson [Fri, 7 Dec 2018 10:41:37 +0000 (10:41 +0000)]
releasing package grub2 version 2.02+dfsg1-9

5 years agoImprove changelog credits
Colin Watson [Fri, 7 Dec 2018 10:37:52 +0000 (10:37 +0000)]
Improve changelog credits

5 years agoDon't enforce Shim signature validation if Secure Boot is disabled
Colin Watson [Fri, 7 Dec 2018 10:34:01 +0000 (10:34 +0000)]
Don't enforce Shim signature validation if Secure Boot is disabled

5 years agoDon't enforce Shim signature validation if Secure Boot is disabled
Matthew Garrett [Wed, 5 Dec 2018 23:07:21 +0000 (15:07 -0800)]
Don't enforce Shim signature validation if Secure Boot is disabled

The linuxefi command fails if used on a system without shim, even if
Secure Boot is disabled. There's no need to do the validation if we're
not in Secure Boot mode (an attacker could just boot a modified grub),
so skip this to make it easier to use the Linux EFI entry point even on
non-Secure Boot systems.

Last-Update: 2018-12-07

Patch-Name: linuxefi-skip-validation-without-secure-boot.patch

5 years agoBuild with GCC 8
Colin Watson [Fri, 7 Dec 2018 09:43:46 +0000 (09:43 +0000)]
Build with GCC 8

This includes a cherry-pick from upstream to fix packed-not-aligned
errors.

Closes: #915735
5 years agoFix packed-not-aligned error on GCC 8
Michael Chang [Mon, 26 Mar 2018 08:52:34 +0000 (16:52 +0800)]
Fix packed-not-aligned error on GCC 8

When building with GCC 8, there are several errors regarding packed-not-aligned.

./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]

This patch fixes the build error by cleaning up the ambiguity of placing
aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
has to be packed, to ensure the structure is bit-to-bit mapped to the format
laid on disk. I think we could blame to copy and paste error here for the
mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
the name suggests. :)

Signed-off-by: Michael Chang <mchang@suse.com>
Tested-by: Michael Chang <mchang@suse.com>
Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=563b1da6e6ae7af46cc8354cadb5dab416989f0a
Bug-Debian: https://bugs.debian.org/915735
Last-Update: 2018-10-07

Patch-Name: gcc-8-packed-not-aligned.patch

5 years agoarm loader updates from Leif Lindholm
Colin Watson [Thu, 29 Nov 2018 20:47:02 +0000 (20:47 +0000)]
arm loader updates from Leif Lindholm

Apply patch series (mostly) from upstream to switch the arm loader over
to use the arm64 loader code and improve arm/arm64 initrd handling.

Closes: #907596, #909420, #915091
5 years agoi386/efi: update loader to new interfaces
Leif Lindholm [Thu, 15 Nov 2018 01:03:00 +0000 (01:03 +0000)]
i386/efi: update loader to new interfaces

This updates the non-upstream loader/i386/efi/linux.c to build
correctly with the patches in this branch appled.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Bug-Debian: https://bugs.debian.org/915091
Last-Update: 2018-12-06

Patch-Name: linuxefi-update-to-new-interfaces.patch

5 years agoefi/fdt: Set address/size cells to 2 for empty tree
Leif Lindholm [Mon, 11 Jun 2018 16:24:59 +0000 (17:24 +0100)]
efi/fdt: Set address/size cells to 2 for empty tree

When booting an arm* system on UEFI with an empty device tree (currently
only when hardware description comes from ACPI), we don't currently set
default to 1 cell (32 bits).

Set both of these properties, to 2 cells (64 bits), to resolve issues
with kexec on some platforms.

This change corresponds with linux kernel commit ae8a442dfdc4
("efi/libstub/arm*: Set default address and size cells values for an empty dtb")
and ensures booting through grub does not behave differently from booting
the stub loader directly.

See also https://patchwork.kernel.org/patch/9561201/

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=347210a5d5ce655b95315f320faa515afb723c11
Bug-Debian: https://bugs.debian.org/915091
Last-Update: 2018-12-06

Patch-Name: efi-fdt-set-address-size-cells-to-2-for-empty-tree.patch

5 years agofdt: Move prop_entry_size to fdt.h
Leif Lindholm [Mon, 11 Jun 2018 16:24:58 +0000 (17:24 +0100)]
fdt: Move prop_entry_size to fdt.h

To be able to resuse the prop_entry_size macro, move it to
<grub/fdt.h> and rename it grub_fdt_prop_entry_size.

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=e93fd6b776a7e6cef36c445d00436e5a23cfeba5
Bug-Debian: https://bugs.debian.org/915091
Last-Update: 2018-12-06

Patch-Name: fdt-move-prop_entry_size-to-fdt-h.patch

5 years agoefi: Restrict arm/arm64 linux loader initrd placement
Leif Lindholm [Mon, 9 Jul 2018 17:33:05 +0000 (18:33 +0100)]
efi: Restrict arm/arm64 linux loader initrd placement

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 - so enable the same restriction in grub.

For arm64, the requirement is within a 1GB aligned 32GB window also
covering the (runtime) kernel image. Since the EFI stub loader itself
will attempt to relocate to near start of RAM, force initrd to be loaded
completely within the first 32GB of RAM.

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=a2f26adfef2fc8a7d7392c3704031df4624c67b0
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/915091
Last-Update: 2018-12-06

Patch-Name: efi-restrict-arm-arm64-linux-loader-initrd-placement.patch

5 years agoarm: Delete unused efi support from loader/arm
Leif Lindholm [Mon, 9 Jul 2018 17:33:04 +0000 (18:33 +0100)]
arm: Delete unused efi support from loader/arm

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 <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=77808dd66bda72ff14873bcd701ec25a0db1dfee
Bug-Debian: https://bugs.debian.org/907596
Last-Update: 2018-12-06

Patch-Name: arm-delete-unused-efi-support-from-loader-arm.patch

5 years agoarm/efi: Switch to arm64 linux loader
Leif Lindholm [Mon, 9 Jul 2018 17:33:03 +0000 (18:33 +0100)]
arm/efi: Switch to arm64 linux loader

The arm64 and arm linux kernel EFI-stub support presents pretty much
identical interfaces, so the same linux loader source can be used for
both architectures.

Switch 32-bit ARM UEFI platforms over to the existing EFI-stub aware
loader initially developed for arm64.

This *WILL* stop non-efistub Linux kernels from booting on arm-efi.

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=d0c070179d4d78c297364e41ece54fd7755c4b58
Bug-Debian: https://bugs.debian.org/907596
Bug-Debian: https://bugs.debian.org/909420
Last-Update: 2018-12-06

Patch-Name: arm-efi-switch-to-arm64-linux-loader.patch

5 years agoarm64/linux/loader: Rename functions and macros and move to common headers
Leif Lindholm [Mon, 9 Jul 2018 17:33:02 +0000 (18:33 +0100)]
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

5 years agoefi: Add grub_efi_get_ram_base() function for arm64
Leif Lindholm [Mon, 9 Jul 2018 17:33:01 +0000 (18:33 +0100)]
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

5 years agoefi: Add central copy of grub_efi_find_mmap_size
Leif Lindholm [Mon, 9 Jul 2018 17:33:00 +0000 (18:33 +0100)]
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

5 years agocommands/file: Use definitions from arm64/linux.h
Leif Lindholm [Mon, 25 Jun 2018 17:01:29 +0000 (18:01 +0100)]
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

5 years agocommands/file: Use definitions from arm/linux.h
Leif Lindholm [Mon, 25 Jun 2018 17:01:28 +0000 (18:01 +0100)]
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

5 years agoarm: make linux.h safe to include for non-native builds
Leif Lindholm [Thu, 1 Feb 2018 18:18:56 +0000 (18:18 +0000)]
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

5 years agoarm: switch linux loader to linux_arm_kernel_header struct
Leif Lindholm [Thu, 1 Feb 2018 18:18:55 +0000 (18:18 +0000)]
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

5 years agoarm64: align linux kernel magic macro naming with i386
Leif Lindholm [Thu, 1 Feb 2018 18:18:54 +0000 (18:18 +0000)]
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

5 years agoarm64: align linux kernel header struct naming with i386
Leif Lindholm [Thu, 1 Feb 2018 18:18:53 +0000 (18:18 +0000)]
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

5 years agoi386: make struct linux_kernel_header architecture specific
Leif Lindholm [Thu, 1 Feb 2018 18:18:52 +0000 (18:18 +0000)]
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

5 years agomake GRUB_LINUX_MAGIC_SIGNATURE architecture-specific
Leif Lindholm [Thu, 1 Feb 2018 18:18:51 +0000 (18:18 +0000)]
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

5 years agoMake arch-specific linux.h include guards architecture unique
Leif Lindholm [Thu, 1 Feb 2018 18:18:50 +0000 (18:18 +0000)]
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

5 years agoarm64/efi: move EFI_PAGE definitions to efi/memory.h
Leif Lindholm [Thu, 1 Feb 2018 18:18:49 +0000 (18:18 +0000)]
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

5 years agoefi: change heap allocation type to GRUB_EFI_LOADER_CODE
Leif Lindholm [Thu, 3 Aug 2017 10:04:32 +0000 (11:04 +0100)]
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

5 years agoarm64 linux loader: improve type portability
Leif Lindholm [Thu, 3 Aug 2017 10:04:26 +0000 (11:04 +0100)]
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

5 years agoefi: Add GRUB_PE32_MAGIC definition
Leif Lindholm [Thu, 3 Aug 2017 10:04:25 +0000 (11:04 +0100)]
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

5 years agoefi: move fdt helper library
Leif Lindholm [Thu, 3 Aug 2017 10:04:24 +0000 (11:04 +0100)]
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