Rebased to newer upstream for fedora-29

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2018-07-16 15:30:28 -04:00
parent b5667e66a1
commit ce0f493268
243 changed files with 541 additions and 336 deletions

View File

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cao jin <caoj.fnst@cn.fujitsu.com>
Date: Tue, 3 Jul 2018 18:51:13 +0800
Subject: [PATCH] grub-setup: Debug message cleanup
Variable "root" is initialized after root device probing and is null in
current place, so, drop it.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
util/setup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/util/setup.c b/util/setup.c
index 80363075d34..9c1e1b7da6a 100644
--- a/util/setup.c
+++ b/util/setup.c
@@ -305,9 +305,8 @@ SETUP (const char *dir,
bl.first_block = (struct grub_boot_blocklist *) (core_img
+ GRUB_DISK_SECTOR_SIZE
- sizeof (*bl.block));
- grub_util_info ("root is `%s', dest is `%s'", root, dest);
- grub_util_info ("Opening dest");
+ grub_util_info ("Opening dest `%s'", dest);
dest_dev = grub_device_open (dest);
if (! dest_dev)
grub_util_error ("%s", grub_errmsg);

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 26 Jun 2018 20:05:32 +0200
Subject: [PATCH] EFI: console: Fix the "enter" key not working on X86 tablets
Date: Tue, 26 Jun 2018 20:15:01 +0200
Subject: [PATCH] efi/console: Fix the "enter" key not working on x86 tablets
Most 8" or 7" x86 Windows 10 tablets come with volume up/down buttons and
a power-button. In their UEFI these are almost always mapped to arrow
@ -22,19 +22,20 @@ This fixes things getting stuck at the grub-menu and allows the user
to choice a grub-menu entry using the buttons on the tablet.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/term/efi/console.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
index a5abaf8e722..59786e30d66 100644
index 02f64ea7441..4840cc59d3f 100644
--- a/grub-core/term/efi/console.c
+++ b/grub-core/term/efi/console.c
@@ -127,6 +127,9 @@ grub_efi_translate_key (grub_efi_input_key_t key)
@@ -122,6 +122,9 @@ grub_efi_translate_key (grub_efi_input_key_t key)
else
return key.unicode_char;
}
+ /* Some devices send enter with scan_code 0x0d (F3) and unicode_char 0x0d */
+ /* Some devices send enter with scan_code 0x0d (F3) and unicode_char 0x0d. */
+ else if (key.scan_code == '\r' && key.unicode_char == '\r')
+ return key.unicode_char;
else if (key.scan_code < ARRAY_SIZE (efi_codes))

View File

@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Leif Lindholm <leif.lindholm@linaro.org>
Date: Mon, 25 Jun 2018 18:01:28 +0100
Subject: [PATCH] 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>
---
grub-core/commands/file.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c
index 63c84499bab..ab0c9fb9694 100644
--- a/grub-core/commands/file.c
+++ b/grub-core/commands/file.c
@@ -27,6 +27,7 @@
#include <grub/elf.h>
#include <grub/xen_file.h>
#include <grub/efi/pe32.h>
+#include <grub/arm/linux.h>
#include <grub/i386/linux.h>
#include <grub/xnu.h>
#include <grub/machoload.h>
@@ -383,21 +384,19 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
}
case IS_ARM_LINUX:
{
- grub_uint32_t sig, sig_pi;
- if (grub_file_read (file, &sig_pi, 4) != 4)
+ struct linux_arm_kernel_header lh;
+
+ if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
break;
- /* Raspberry pi. */
- if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006))
+ /* Short forward branch in A32 state (for Raspberry pi kernels). */
+ if (lh.code0 == grub_cpu_to_le32_compile_time (0xea000006))
{
ret = 1;
break;
}
- if (grub_file_seek (file, 0x24) == (grub_size_t) -1)
- break;
- if (grub_file_read (file, &sig, 4) != 4)
- break;
- if (sig == grub_cpu_to_le32_compile_time (0x016f2818))
+ if (lh.magic ==
+ grub_cpu_to_le32_compile_time (GRUB_LINUX_ARM_MAGIC_SIGNATURE))
{
ret = 1;
break;

View File

@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Leif Lindholm <leif.lindholm@linaro.org>
Date: Mon, 25 Jun 2018 18:01:29 +0100
Subject: [PATCH] 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>
---
grub-core/commands/file.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c
index ab0c9fb9694..3ff6d5522d2 100644
--- a/grub-core/commands/file.c
+++ b/grub-core/commands/file.c
@@ -28,6 +28,7 @@
#include <grub/xen_file.h>
#include <grub/efi/pe32.h>
#include <grub/arm/linux.h>
+#include <grub/arm64/linux.h>
#include <grub/i386/linux.h>
#include <grub/xnu.h>
#include <grub/machoload.h>
@@ -405,13 +406,13 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
}
case IS_ARM64_LINUX:
{
- grub_uint32_t sig;
+ struct linux_arm64_kernel_header lh;
- if (grub_file_seek (file, 0x38) == (grub_size_t) -1)
+ if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
break;
- if (grub_file_read (file, &sig, 4) != 4)
- break;
- if (sig == grub_cpu_to_le32_compile_time (0x644d5241))
+
+ if (lh.magic ==
+ grub_cpu_to_le32_compile_time (GRUB_LINUX_ARM64_MAGIC_SIGNATURE))
{
ret = 1;
break;

View File

@ -1,64 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 28 Apr 2015 11:15:03 -0400
Subject: [PATCH] Make grub2-mkconfig construct titles that look like the ones
we want elsewhere.
Resolves: rhbz#1215839
Signed-off-by: Peter Jones <pjones@redhat.com>
---
util/grub.d/10_linux.in | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index a05be9d3047..4ad98fbd767 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -80,11 +80,28 @@ esac
mktitle ()
{
- local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
- local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
+ local title_type
+ local version
+ local OS_NAME
+ local OS_VERS
- local titlestr="${OS_NAME} (%s) ${OS_VERS}"
- echo -n ${titlestr}
+ title_type=$1 && shift
+ version=$1 && shift
+
+ OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
+ OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
+
+ case $title_type in
+ recovery)
+ title=$(printf '%s (%s) %s (recovery mode)' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ *)
+ title=$(printf '%s (%s) %s' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ esac
+ echo -n ${title}
}
title_correction_code=
@@ -114,12 +131,7 @@ linux_entry ()
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
- case $type in
- recovery)
- title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;;
- *)
- title="$(printf "$(mktitle)" "${version}")" ;;
- esac
+ title=$(mktitle "$type" "$version")
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"

View File

@ -8,39 +8,57 @@ Resolves: rhbz#1215839
Signed-off-by: Peter Jones <pjones@redhat.com>
---
util/grub.d/10_linux.in | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
util/grub.d/10_linux.in | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 03ea8460bfd..a05be9d3047 100644
index 03ea8460bfd..4ad98fbd767 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -78,6 +78,15 @@ case x"$GRUB_FS" in
@@ -78,6 +78,32 @@ case x"$GRUB_FS" in
;;
esac
+mktitle ()
+{
+ local OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
+ local OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
+ local title_type
+ local version
+ local OS_NAME
+ local OS_VERS
+
+ local titlestr="${OS_NAME} (%s) ${OS_VERS}"
+ echo -n ${titlestr}
+ title_type=$1 && shift
+ version=$1 && shift
+
+ OS_NAME="$(eval $(grep ^NAME= /etc/os-release) ; echo ${NAME})"
+ OS_VERS="$(eval $(grep ^VERSION= /etc/os-release) ; echo ${VERSION})"
+
+ case $title_type in
+ recovery)
+ title=$(printf '%s (%s) %s (recovery mode)' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ *)
+ title=$(printf '%s (%s) %s' \
+ "${OS_NAME}" "${version}" "${OS_VERS}")
+ ;;
+ esac
+ echo -n ${title}
+}
+
title_correction_code=
linux_entry ()
@@ -107,15 +116,14 @@ linux_entry ()
@@ -105,17 +131,11 @@ linux_entry ()
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
fi
if [ x$type != xsimple ] ; then
case $type in
recovery)
- case $type in
- recovery)
- title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
+ title="$(printf "$(mktitle) (recovery mode)" "${version}")" ;;
*)
- *)
- title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
+ title="$(printf "$(mktitle)" "${version}")" ;;
esac
- esac
+ title=$(mktitle "$type" "$version")
if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"

Some files were not shown because too many files have changed in this diff Show More