More bug "fixes"...

Don't mangle fw_path even harder.
  Resolves: rhbz#1626844
Fix reboot being missing on some platforms, and make it alias to
  "reset" as well.
More dprintf().

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2018-09-11 11:07:04 -04:00
parent 5376ad0c95
commit 371309b06e
5 changed files with 132 additions and 10 deletions

View File

@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 31 Aug 2018 16:42:03 -0400
Subject: [PATCH] Make "reset" an alias for the "reboot" command.
I'm really tired of half the tools I get to use having one and the other half
having the other.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/commands/reboot.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/grub-core/commands/reboot.c b/grub-core/commands/reboot.c
index 46d364c99a9..f5cc2283636 100644
--- a/grub-core/commands/reboot.c
+++ b/grub-core/commands/reboot.c
@@ -32,15 +32,18 @@ grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)),
grub_reboot ();
}
-static grub_command_t cmd;
+static grub_command_t reboot_cmd, reset_cmd;
GRUB_MOD_INIT(reboot)
{
- cmd = grub_register_command ("reboot", grub_cmd_reboot,
- 0, N_("Reboot the computer."));
+ reboot_cmd = grub_register_command ("reboot", grub_cmd_reboot,
+ 0, N_("Reboot the computer."));
+ reset_cmd = grub_register_command ("reset", grub_cmd_reboot,
+ 0, N_("Reboot the computer."));
}
GRUB_MOD_FINI(reboot)
{
- grub_unregister_command (cmd);
+ grub_unregister_command (reboot_cmd);
+ grub_unregister_command (reset_cmd);
}

View File

@ -0,0 +1,66 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 10 Sep 2018 13:01:24 -0400
Subject: [PATCH] EFI: more debug output on GOP and UGA probing.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/video/efi_gop.c | 8 +++++++-
grub-core/video/efi_uga.c | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/grub-core/video/efi_gop.c b/grub-core/video/efi_gop.c
index c9e40e8d4e9..be446f8d291 100644
--- a/grub-core/video/efi_gop.c
+++ b/grub-core/video/efi_gop.c
@@ -71,7 +71,10 @@ check_protocol (void)
handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL,
&graphics_output_guid, NULL, &num_handles);
if (!handles || num_handles == 0)
- return 0;
+ {
+ grub_dprintf ("video", "GOP: no handles\n");
+ return 0;
+ }
for (i = 0; i < num_handles; i++)
{
@@ -81,6 +84,7 @@ check_protocol (void)
grub_video_gop_iterate (check_protocol_hook, &have_usable_mode);
if (have_usable_mode)
{
+ grub_dprintf ("video", "GOP: found usable mode\n");
grub_free (handles);
return 1;
}
@@ -89,6 +93,8 @@ check_protocol (void)
gop = 0;
gop_handle = 0;
+ grub_dprintf ("video", "GOP: no usable mode\n");
+
return 0;
}
diff --git a/grub-core/video/efi_uga.c b/grub-core/video/efi_uga.c
index 97a607c01a5..e74d6c23500 100644
--- a/grub-core/video/efi_uga.c
+++ b/grub-core/video/efi_uga.c
@@ -110,7 +110,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
{
int i;
- grub_dprintf ("fb", "Display controller: %d:%d.%d\nDevice id: %x\n",
+ grub_dprintf ("video", "Display controller: %d:%d.%d\nDevice id: %x\n",
grub_pci_get_bus (dev), grub_pci_get_device (dev),
grub_pci_get_function (dev), pciid);
addr += 8;
@@ -140,7 +140,7 @@ find_card (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
base64 <<= 32;
base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK);
- grub_dprintf ("fb", "%s(%d): 0x%" PRIxGRUB_UINT64_T "\n",
+ grub_dprintf ("video", "%s(%d): 0x%" PRIxGRUB_UINT64_T "\n",
((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ?
"VMEM" : "MMIO"), type == GRUB_PCI_ADDR_MEM_TYPE_64 ? i - 1 : i,
base64);

View File

@ -5,24 +5,31 @@ Subject: [PATCH] fw_path: don't prepend / unless we're on http(s)
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/kern/main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
grub-core/kern/main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
index fc8d8c6c9d4..db5238179f8 100644
index fc8d8c6c9d4..dcf48726d54 100644
--- a/grub-core/kern/main.c
+++ b/grub-core/kern/main.c
@@ -130,8 +130,12 @@ grub_set_prefix_and_root (void)
@@ -130,11 +130,19 @@ grub_set_prefix_and_root (void)
if (fwdevice && fwpath)
{
char *fw_path;
+ char separator = '\x0';
+ char separator[3] = ")";
- fw_path = grub_xasprintf ("(%s)%s%s", fwdevice, fwpath[0] == '/' ? "" : "/", fwpath);
+ if (!grub_strncmp(fwdevice, "http", 4) && fwpath[0] != '/')
+ separator = '/';
+ grub_dprintf ("fw_path", "\n");
+ grub_dprintf ("fw_path", "fwdevice:\"%s\" fwpath:\"%s\"\n", fwdevice, fwpath);
+
+ fw_path = grub_xasprintf ("(%s)%c%s", fwdevice, separator, fwpath);
+ if (!grub_strncmp(fwdevice, "http", 4) && fwpath[0] != '/')
+ grub_strcpy(separator, ")/");
+
+ fw_path = grub_xasprintf ("(%s%s%s", fwdevice, separator, fwpath);
if (fw_path)
{
grub_env_set ("fw_path", fw_path);
+ grub_dprintf ("fw_path", "fw_path:\"%s\"\n", fw_path);
grub_free (fw_path);
}
}

View File

@ -235,4 +235,6 @@ Patch0234: 0234-arm-arm64-loader-Better-memory-allocation-and-error-.patch
Patch0235: 0235-Fix-GRUB_EFI_MAX_USABLE_ADDRESS-to-be-64-bit-on-x86_.patch
Patch0236: 0236-Try-to-pick-better-locations-for-kernel-and-initrd.patch
Patch0237: 0237-Try-again-to-pick-better-locations-for-kernel-and-in.patch
Patch0238: 0238-fw_path-don-t-prepend-unless-we-re-on-http-s.patch
Patch0238: 0238-Make-reset-an-alias-for-the-reboot-command.patch
Patch0239: 0239-EFI-more-debug-output-on-GOP-and-UGA-probing.patch
Patch0240: 0240-fw_path-don-t-prepend-unless-we-re-on-http-s.patch

View File

@ -7,7 +7,7 @@
Name: grub2
Epoch: 1
Version: 2.02
Release: 55%{?dist}
Release: 56%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more
Group: System Environment/Base
License: GPLv3+
@ -498,6 +498,13 @@ fi
%endif
%changelog
* Tue Sep 11 2018 Peter Jones <pjones@redhat.com> - 2.02-56
- Don't mangle fw_path even harder.
Resolves: rhbz#1626844
- Fix reboot being missing on some platforms, and make it alias to
"reset" as well.
- More dprintf().
* Mon Sep 10 2018 Peter Jones <pjones@redhat.com> - 2.02-55
- Fix UEFI memory problem in a different way.
Related: rhbz#1624532