update to 2.04

This commit is contained in:
hanzj0122_admin 2020-07-29 20:47:36 +08:00
parent 74f4a70de1
commit 572016aeb9
334 changed files with 17609 additions and 37313 deletions

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From a66a5e1ff5e4ad4df490754bfe41839a43cad1d5 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg@redhat.com>
Date: Tue, 10 Jul 2012 11:58:52 -0400
Subject: [PATCH] Add support for Linux EFI stub loading.
Date: Fri, 5 Jul 2019 18:36:44 +0200
Subject: [PATCH 001/220] Add support for Linux EFI stub loading.
Also:
@ -29,7 +29,7 @@ moves the check into grub_dl_load_file.
grub-core/kern/dl.c | 21 +++
grub-core/kern/efi/efi.c | 28 ++++
grub-core/kern/efi/mm.c | 32 ++++
grub-core/loader/arm64/linux.c | 118 +++++++-------
grub-core/loader/arm64/linux.c | 112 +++++++------
grub-core/loader/arm64/xen_boot.c | 1 -
grub-core/loader/efi/linux.c | 70 ++++++++
grub-core/loader/i386/efi/linux.c | 335 ++++++++++++++++++++++++++++++++++++++
@ -38,17 +38,16 @@ moves the check into grub_dl_load_file.
include/grub/arm64/linux.h | 10 ++
include/grub/efi/efi.h | 7 +-
include/grub/efi/linux.h | 31 ++++
include/grub/i386/linux.h | 1 +
14 files changed, 620 insertions(+), 69 deletions(-)
13 files changed, 616 insertions(+), 66 deletions(-)
create mode 100644 grub-core/loader/efi/linux.c
create mode 100644 grub-core/loader/i386/efi/linux.c
create mode 100644 include/grub/efi/linux.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 9590e87d9c0..0b4b0c2122d 100644
index 474a63e..581d9df 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1626,13 +1626,6 @@ module = {
@@ -1709,13 +1709,6 @@ module = {
enable = i386_pc;
};
@ -62,7 +61,7 @@ index 9590e87d9c0..0b4b0c2122d 100644
module = {
name = ntldr;
i386_pc = loader/i386/pc/ntldr.c;
@@ -1685,7 +1678,9 @@ module = {
@@ -1771,7 +1764,9 @@ module = {
module = {
name = linux;
@ -70,13 +69,13 @@ index 9590e87d9c0..0b4b0c2122d 100644
+ i386_pc = loader/i386/pc/linux.c;
+ x86_64_efi = loader/i386/efi/linux.c;
+ i386_efi = loader/i386/efi/linux.c;
i386_xen_pvh = loader/i386/linux.c;
xen = loader/i386/xen.c;
i386_pc = lib/i386/pc/vesa_modes_table.c;
mips = loader/mips/linux.c;
@@ -1696,9 +1691,14 @@ module = {
arm_efi = loader/arm64/linux.c;
arm_uboot = loader/arm/linux.c;
@@ -1786,9 +1781,14 @@ module = {
arm64 = loader/arm64/linux.c;
riscv32 = loader/riscv/linux.c;
riscv64 = loader/riscv/linux.c;
+ emu = loader/emu/linux.c;
+ fdt = lib/fdt.c;
+
@ -89,7 +88,7 @@ index 9590e87d9c0..0b4b0c2122d 100644
module = {
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index e394cd96f8c..04e804d1668 100644
index 48eb5e7..896bebf 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -38,6 +38,14 @@
@ -126,9 +125,9 @@ index e394cd96f8c..04e804d1668 100644
+
grub_boot_time ("Loading module %s", filename);
file = grub_file_open (filename);
file = grub_file_open (filename, GRUB_FILE_TYPE_GRUB_MODULE);
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index 708581fcbde..c8a9d8307c0 100644
index 6e1ceb9..a0faa40 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -273,6 +273,34 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
@ -167,7 +166,7 @@ index 708581fcbde..c8a9d8307c0 100644
/* Search the mods section from the PE32/PE32+ image. This code uses
diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
index 42ad7c570a5..5cdf6c943f2 100644
index b02fab1..a9e3710 100644
--- a/grub-core/kern/efi/mm.c
+++ b/grub-core/kern/efi/mm.c
@@ -113,6 +113,38 @@ grub_efi_drop_alloc (grub_efi_physical_address_t address,
@ -210,7 +209,7 @@ index 42ad7c570a5..5cdf6c943f2 100644
void *
grub_efi_allocate_pages_real (grub_efi_physical_address_t address,
diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
index 1f86229f86b..6c00af98dce 100644
index ef3e9f9..a312c66 100644
--- a/grub-core/loader/arm64/linux.c
+++ b/grub-core/loader/arm64/linux.c
@@ -29,6 +29,7 @@
@ -221,7 +220,7 @@ index 1f86229f86b..6c00af98dce 100644
#include <grub/efi/pe32.h>
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
@@ -40,6 +41,7 @@ static int loaded;
@@ -41,6 +42,7 @@ static int loaded;
static void *kernel_addr;
static grub_uint64_t kernel_size;
@ -229,7 +228,7 @@ index 1f86229f86b..6c00af98dce 100644
static char *linux_args;
static grub_uint32_t cmdline_size;
@@ -66,7 +68,8 @@ grub_armxx_efi_linux_check_image (struct linux_armxx_kernel_header * lh)
@@ -67,7 +69,8 @@ grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh)
static grub_err_t
finalize_params_linux (void)
{
@ -239,20 +238,41 @@ index 1f86229f86b..6c00af98dce 100644
void *fdt;
@@ -101,79 +104,70 @@ finalize_params_linux (void)
@@ -102,6 +105,25 @@ finalize_params_linux (void)
if (grub_fdt_install() != GRUB_ERR_NONE)
goto failure;
- return GRUB_ERR_NONE;
-
-failure:
- grub_fdt_unload();
- return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT");
-}
-
+ grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n",
+ fdt);
+
+ /* Convert command line to UCS-2 */
+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle);
+ if (!loaded_image)
+ goto failure;
+
+ loaded_image->load_options_size = len =
+ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t);
+ loaded_image->load_options =
+ grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
+ if (!loaded_image->load_options)
+ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters");
+
+ loaded_image->load_options_size =
+ 2 * grub_utf8_to_utf16 (loaded_image->load_options, len,
+ (grub_uint8_t *) linux_args, len, NULL);
+
return GRUB_ERR_NONE;
failure:
@@ -109,72 +131,44 @@ failure:
return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT");
}
-grub_err_t
-grub_armxx_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
-{
-grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args)
+static void
+free_params (void)
{
- grub_efi_memory_mapped_device_path_t *mempath;
- grub_efi_handle_t image_handle;
- grub_efi_boot_services_t *b;
@ -270,7 +290,8 @@ index 1f86229f86b..6c00af98dce 100644
- mempath[0].memory_type = GRUB_EFI_LOADER_DATA;
- mempath[0].start_address = addr;
- mempath[0].end_address = addr + size;
-
+ grub_efi_loaded_image_t *loaded_image = NULL;
- mempath[1].header.type = GRUB_EFI_END_DEVICE_PATH_TYPE;
- mempath[1].header.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE;
- mempath[1].header.length = sizeof (grub_efi_device_path_t);
@ -281,74 +302,49 @@ index 1f86229f86b..6c00af98dce 100644
- (void *) addr, size, &image_handle);
- if (status != GRUB_EFI_SUCCESS)
- return grub_error (GRUB_ERR_BAD_OS, "cannot load image");
-
- grub_dprintf ("linux", "linux command line: '%s'\n", args);
+ grub_dprintf ("linux", "Installed/updated FDT configuration table @ %p\n",
+ fdt);
/* Convert command line to UCS-2 */
- loaded_image = grub_efi_get_loaded_image (image_handle);
+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle);
+ if (!loaded_image)
+ goto failure;
+
loaded_image->load_options_size = len =
+ if (loaded_image)
+ {
+ if (loaded_image->load_options)
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_efi_uintn_t)loaded_image->load_options,
+ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
+ loaded_image->load_options = NULL;
+ loaded_image->load_options_size = 0;
+ }
+}
- grub_dprintf ("linux", "linux command line: '%s'\n", args);
+grub_err_t
+grub_arch_efi_linux_boot_image (grub_addr_t addr, char *args)
+{
+ grub_err_t retval;
- /* Convert command line to UCS-2 */
- loaded_image = grub_efi_get_loaded_image (image_handle);
- loaded_image->load_options_size = len =
- (grub_strlen (args) + 1) * sizeof (grub_efi_char16_t);
+ (grub_strlen (linux_args) + 1) * sizeof (grub_efi_char16_t);
loaded_image->load_options =
grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
if (!loaded_image->load_options)
- return grub_errno;
+ return grub_error(GRUB_ERR_BAD_OS, "failed to create kernel parameters");
- loaded_image->load_options =
- grub_efi_allocate_any_pages (GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
- if (!loaded_image->load_options)
+ retval = finalize_params_linux ();
+ if (retval != GRUB_ERR_NONE)
return grub_errno;
loaded_image->load_options_size =
2 * grub_utf8_to_utf16 (loaded_image->load_options, len,
- loaded_image->load_options_size =
- 2 * grub_utf8_to_utf16 (loaded_image->load_options, len,
- (grub_uint8_t *) args, len, NULL);
+ (grub_uint8_t *) linux_args, len, NULL);
-
- grub_dprintf ("linux", "starting image %p\n", image_handle);
- status = b->start_image (image_handle, 0, NULL);
+ return GRUB_ERR_NONE;
+ grub_dprintf ("linux", "linux command line: '%s'\n", args);
- /* When successful, not reached */
- b->unload_image (image_handle);
- grub_efi_free_pages ((grub_addr_t) loaded_image->load_options,
- GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
+failure:
+ grub_fdt_unload();
+ return grub_error(GRUB_ERR_BAD_OS, "failed to install/update FDT");
+}
+ retval = grub_efi_linux_boot ((char *)addr, handover_offset, (void *)addr);
- return grub_errno;
+static void
+free_params (void)
+{
+ grub_efi_loaded_image_t *loaded_image = NULL;
+
+ loaded_image = grub_efi_get_loaded_image (grub_efi_image_handle);
+ if (loaded_image)
+ {
+ if (loaded_image->load_options)
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_efi_uintn_t)loaded_image->load_options,
+ GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size));
+ loaded_image->load_options = NULL;
+ loaded_image->load_options_size = 0;
+ }
+}
+
+grub_err_t
+grub_armxx_efi_linux_boot_image (grub_addr_t addr, char *args)
+{
+ grub_err_t retval;
+
+ retval = finalize_params_linux ();
+ if (retval != GRUB_ERR_NONE)
+ return grub_errno;
+
+ grub_dprintf ("linux", "linux command line: '%s'\n", args);
+
+ retval = grub_efi_linux_boot ((char *)addr, handover_offset, (void *)addr);
+
+ /* Never reached... */
+ free_params();
+ return retval;
@ -360,21 +356,21 @@ index 1f86229f86b..6c00af98dce 100644
- if (finalize_params_linux () != GRUB_ERR_NONE)
- return grub_errno;
-
- return (grub_armxx_efi_linux_boot_image((grub_addr_t)kernel_addr,
- return (grub_arch_efi_linux_boot_image((grub_addr_t)kernel_addr,
- kernel_size, linux_args));
+ return grub_armxx_efi_linux_boot_image((grub_addr_t)kernel_addr, linux_args);
+ return (grub_arch_efi_linux_boot_image((grub_addr_t)kernel_addr, linux_args));
}
static grub_err_t
@@ -287,6 +281,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -288,6 +282,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
{
grub_file_t file = 0;
struct linux_armxx_kernel_header lh;
struct linux_arch_kernel_header lh;
+ struct grub_armxx_linux_pe_header *pe;
grub_err_t err;
grub_dl_ref (my_mod);
@@ -331,6 +326,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -333,6 +328,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
grub_dprintf ("linux", "kernel @ %p\n", kernel_addr);
@ -391,20 +387,20 @@ index 1f86229f86b..6c00af98dce 100644
linux_args = grub_malloc (cmdline_size);
if (!linux_args)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c
index 1003a0b9997..f35b16caa92 100644
index 22cc25e..d9b7a9b 100644
--- a/grub-core/loader/arm64/xen_boot.c
+++ b/grub-core/loader/arm64/xen_boot.c
@@ -266,7 +266,6 @@ xen_boot (void)
return err;
return grub_armxx_efi_linux_boot_image (xen_hypervisor->start,
return grub_arch_efi_linux_boot_image (xen_hypervisor->start,
- xen_hypervisor->size,
xen_hypervisor->cmdline);
}
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
new file mode 100644
index 00000000000..c24202a5dd1
index 0000000..c24202a
--- /dev/null
+++ b/grub-core/loader/efi/linux.c
@@ -0,0 +1,70 @@
@ -480,7 +476,7 @@ index 00000000000..c24202a5dd1
+#pragma GCC diagnostic pop
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
new file mode 100644
index 00000000000..3db82e782df
index 0000000..bb2616a
--- /dev/null
+++ b/grub-core/loader/i386/efi/linux.c
@@ -0,0 +1,335 @@
@ -589,8 +585,7 @@ index 00000000000..3db82e782df
+
+ for (i = 0; i < argc; i++)
+ {
+ grub_file_filter_disable_compression ();
+ files[i] = grub_file_open (argv[i]);
+ files[i] = grub_file_open (argv[i], GRUB_FILE_TYPE_LINUX_INITRD | GRUB_FILE_TYPE_NO_DECOMPRESS);
+ if (! files[i])
+ goto fail;
+ nfiles++;
@ -643,7 +638,7 @@ index 00000000000..3db82e782df
+ int argc, char *argv[])
+{
+ grub_file_t file = 0;
+ struct linux_kernel_header lh;
+ struct linux_i386_kernel_header lh;
+ grub_ssize_t len, start, filelen;
+ void *kernel = NULL;
+
@ -655,7 +650,7 @@ index 00000000000..3db82e782df
+ goto fail;
+ }
+
+ file = grub_file_open (argv[0]);
+ file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
+ if (! file)
+ goto fail;
+
@ -731,7 +726,8 @@ index 00000000000..3db82e782df
+ grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE));
+ grub_create_loader_cmdline (argc, argv,
+ linux_cmdline + sizeof (LINUX_IMAGE) - 1,
+ lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1));
+ lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1),
+ GRUB_VERIFY_KERNEL_CMDLINE);
+
+ lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline;
+
@ -820,10 +816,10 @@ index 00000000000..3db82e782df
+ grub_unregister_command (cmd_initrdefi);
+}
diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c
index b69cb7a3a7f..a3c87cf2fc2 100644
index 47ea294..eea25ea 100644
--- a/grub-core/loader/i386/pc/linux.c
+++ b/grub-core/loader/i386/pc/linux.c
@@ -468,14 +468,20 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
@@ -470,14 +470,20 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
return grub_errno;
}
@ -845,7 +841,7 @@ index b69cb7a3a7f..a3c87cf2fc2 100644
grub_register_command ("initrd16", grub_cmd_initrd,
0, N_("Load initrd."));
my_mod = mod;
@@ -484,5 +490,7 @@ GRUB_MOD_INIT(linux16)
@@ -486,5 +492,7 @@ GRUB_MOD_INIT(linux16)
GRUB_MOD_FINI(linux16)
{
grub_unregister_command (cmd_linux);
@ -854,7 +850,7 @@ index b69cb7a3a7f..a3c87cf2fc2 100644
+ grub_unregister_command (cmd_initrd16);
}
diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h
index 712ba17b9ba..5900fc8a40c 100644
index 2e98a66..775297d 100644
--- a/include/grub/arm/linux.h
+++ b/include/grub/arm/linux.h
@@ -20,6 +20,7 @@
@ -878,13 +874,13 @@ index 712ba17b9ba..5900fc8a40c 100644
+
#if defined(__arm__)
# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE
# define linux_armxx_kernel_header linux_arm_kernel_header
# define linux_arch_kernel_header linux_arm_kernel_header
+# define grub_armxx_linux_pe_header grub_arm_linux_pe_header
#endif
#if defined GRUB_MACHINE_UBOOT
diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h
index 8655067e039..7b533b57139 100644
index 4269adc..a3be9dd 100644
--- a/include/grub/arm64/linux.h
+++ b/include/grub/arm64/linux.h
@@ -19,6 +19,8 @@
@ -909,13 +905,13 @@ index 8655067e039..7b533b57139 100644
+
#if defined(__aarch64__)
# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE
# define linux_armxx_kernel_header linux_arm64_kernel_header
# define linux_arch_kernel_header linux_arm64_kernel_header
+# define grub_armxx_linux_pe_header grub_arm64_linux_pe_header
#endif
#endif /* ! GRUB_ARM64_LINUX_HEADER */
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 2c6648d46fc..1061aee9726 100644
index e90e00d..6840bfe 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -47,6 +47,9 @@ EXPORT_FUNC(grub_efi_allocate_fixed) (grub_efi_physical_address_t address,
@ -939,16 +935,16 @@ index 2c6648d46fc..1061aee9726 100644
@@ -95,8 +99,7 @@ void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void);
grub_err_t EXPORT_FUNC(grub_efi_get_ram_base)(grub_addr_t *);
#include <grub/cpu/linux.h>
grub_err_t grub_armxx_efi_linux_check_image(struct linux_armxx_kernel_header *lh);
-grub_err_t grub_armxx_efi_linux_boot_image(grub_addr_t addr, grub_size_t size,
grub_err_t grub_arch_efi_linux_check_image(struct linux_arch_kernel_header *lh);
-grub_err_t grub_arch_efi_linux_boot_image(grub_addr_t addr, grub_size_t size,
- char *args);
+grub_err_t grub_armxx_efi_linux_boot_image(grub_addr_t addr, char *args);
+grub_err_t grub_arch_efi_linux_boot_image(grub_addr_t addr, char *args);
#endif
grub_addr_t grub_efi_modules_addr (void);
diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h
new file mode 100644
index 00000000000..d9ede36773b
index 0000000..d9ede36
--- /dev/null
+++ b/include/grub/efi/linux.h
@@ -0,0 +1,31 @@
@ -983,15 +979,6 @@ index 00000000000..d9ede36773b
+ void *kernel_param);
+
+#endif /* ! GRUB_EFI_LINUX_HEADER */
diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h
index 60c7c3b5e66..bb19dbd5a77 100644
--- a/include/grub/i386/linux.h
+++ b/include/grub/i386/linux.h
@@ -142,6 +142,7 @@ struct linux_i386_kernel_header
grub_uint64_t setup_data;
grub_uint64_t pref_address;
grub_uint32_t init_size;
+ grub_uint32_t handover_offset;
} GRUB_PACKED;
--
1.8.3.1
/* Boot parameters for Linux based on 2.6.12. This is used by the setup

View File

@ -1,29 +0,0 @@
From 288c6b760bc1e04893178e59b621aaea5bcbdac6 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Wed, 10 Apr 2019 15:38:33 +0100
Subject: [PATCH] fix grub search configfile failed in net
---
grub-core/net/net.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index a571ee9..55af4b0 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -1942,11 +1942,7 @@ grub_net_search_configfile (char *config)
char *client_uuid_var;
grub_size_t client_uuid_var_size;
- client_uuid_var_size = grub_snprintf (NULL, 0,
- "net_%s_clientuuid", inf->name);
- if (client_uuid_var_size <= 0)
- continue;
- client_uuid_var_size += 1;
+ client_uuid_var_size = grub_strlen("net_") + grub_strlen(inf->name) + grub_strlen("_clientuuid") + 1;
client_uuid_var = grub_malloc(client_uuid_var_size);
if (!client_uuid_var)
continue;
--
2.19.1

View File

@ -1,20 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 6dd706679d6a784317929140bdc7bb11c90ab622 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg59@coreos.com>
Date: Sun, 9 Aug 2015 16:12:39 -0700
Subject: [PATCH] Rework linux command
Date: Fri, 5 Jul 2019 20:54:51 +0200
Subject: [PATCH 002/220] Rework linux command
We want a single buffer that contains the entire kernel image in order to
perform a TPM measurement. Allocate one and copy the entire kernel into it
before pulling out the individual blocks later on.
---
grub-core/loader/i386/linux.c | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
grub-core/loader/i386/linux.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index 9b53d3168f9..f7186be4002 100644
index d0501e2..b255c95 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -685,13 +685,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -641,13 +641,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
{
grub_file_t file = 0;
struct linux_i386_kernel_header lh;
@ -31,7 +31,7 @@ index 9b53d3168f9..f7186be4002 100644
grub_dl_ref (my_mod);
@@ -705,7 +707,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -661,7 +663,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (! file)
goto fail;
@ -48,7 +48,7 @@ index 9b53d3168f9..f7186be4002 100644
{
if (!grub_errno)
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
@@ -713,6 +723,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -669,6 +679,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
@ -58,7 +58,7 @@ index 9b53d3168f9..f7186be4002 100644
if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55))
{
grub_error (GRUB_ERR_BAD_OS, "invalid magic number");
@@ -804,6 +817,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -760,6 +773,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
preferred_address))
goto fail;
@ -66,10 +66,10 @@ index 9b53d3168f9..f7186be4002 100644
grub_memset (&linux_params, 0, sizeof (linux_params));
grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
@@ -812,13 +826,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
linux_params.ps_mouse = linux_params.padding10 = 0;
@@ -782,13 +796,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
/* We've already read lh so there is no need to read it second time. */
len -= sizeof(lh);
len = sizeof (linux_params) - sizeof (lh);
- if (grub_file_read (file, (char *) &linux_params + sizeof (lh), len) != len)
- {
- if (!grub_errno)
@ -77,14 +77,13 @@ index 9b53d3168f9..f7186be4002 100644
- argv[0]);
- goto fail;
- }
+
+ linux_params_ptr = (void *)&linux_params;
+ grub_memcpy (linux_params_ptr + sizeof (lh), kernel + kernel_offset, len);
+ kernel_offset += len;
linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
@@ -877,7 +888,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -847,7 +857,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
/* The other parameters are filled when booting. */
@ -93,8 +92,8 @@ index 9b53d3168f9..f7186be4002 100644
grub_dprintf ("linux", "bzImage, setup=0x%x, size=0x%x\n",
(unsigned) real_size, (unsigned) prot_size);
@@ -1025,9 +1036,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
- (sizeof (LINUX_IMAGE) - 1));
@@ -1001,9 +1011,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
len = prot_file_size;
- if (grub_file_read (file, prot_mode_mem, len) != len && !grub_errno)
@ -104,7 +103,7 @@ index 9b53d3168f9..f7186be4002 100644
if (grub_errno == GRUB_ERR_NONE)
{
@@ -1038,6 +1047,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -1014,6 +1022,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
fail:
@ -113,3 +112,6 @@ index 9b53d3168f9..f7186be4002 100644
if (file)
grub_file_close (file);
--
1.8.3.1

View File

@ -1,17 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 84d1fbf3d3a427c168b57f83e8e29a7ae22e7192 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg59@coreos.com>
Date: Sun, 9 Aug 2015 16:20:58 -0700
Subject: [PATCH] Rework linux16 command
Date: Fri, 5 Jul 2019 21:12:00 +0200
Subject: [PATCH 003/220] Rework linux16 command
We want a single buffer that contains the entire kernel image in order to
perform a TPM measurement. Allocate one and copy the entire kernel int it
before pulling out the individual blocks later on.
---
grub-core/loader/i386/pc/linux.c | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
grub-core/loader/i386/pc/linux.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c
index a3c87cf2fc2..caa76bee8af 100644
index eea25ea..73fb91e 100644
--- a/grub-core/loader/i386/pc/linux.c
+++ b/grub-core/loader/i386/pc/linux.c
@@ -123,13 +123,14 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@ -74,12 +74,11 @@ index a3c87cf2fc2..caa76bee8af 100644
if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE)
|| grub_le_to_cpu16 (lh.version) < 0x0200)
@@ -355,10 +363,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -358,9 +366,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
len = grub_linux16_prot_size;
- if (grub_file_read (file, grub_linux_prot_chunk, grub_linux16_prot_size)
- != (grub_ssize_t) grub_linux16_prot_size && !grub_errno)
- if (grub_file_read (file, grub_linux_prot_chunk, len) != len && !grub_errno)
- grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
- argv[0]);
+ grub_memcpy (grub_linux_prot_chunk, kernel + kernel_offset, len);
@ -87,7 +86,7 @@ index a3c87cf2fc2..caa76bee8af 100644
if (grub_errno == GRUB_ERR_NONE)
{
@@ -368,6 +374,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -370,6 +377,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
fail:
@ -96,3 +95,6 @@ index a3c87cf2fc2..caa76bee8af 100644
if (file)
grub_file_close (file);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 703e2ddcf768f52f46d02a59627b91280822c293 Mon Sep 17 00:00:00 2001
From: Raymund Will <rw@suse.com>
Date: Fri, 10 Apr 2015 01:45:02 -0400
Subject: [PATCH] Add secureboot support on efi chainloader
Date: Mon, 8 Jul 2019 11:55:18 +0200
Subject: [PATCH 004/220] Add secureboot support on efi chainloader
Expand the chainloader to be able to verify the image by means of shim
lock protocol. The PE/COFF image is loaded and relocated by the
@ -175,7 +175,7 @@ Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7 files changed, 840 insertions(+), 91 deletions(-)
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index c8a9d8307c0..91129e33566 100644
index a0faa40..3487b06 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -283,14 +283,20 @@ grub_efi_secure_boot (void)
@ -204,18 +204,18 @@ index c8a9d8307c0..91129e33566 100644
if (*secure_boot && !*setup_mode)
ret = 1;
diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
index 6c00af98dce..a1ac7a38867 100644
index a312c66..04994d5 100644
--- a/grub-core/loader/arm64/linux.c
+++ b/grub-core/loader/arm64/linux.c
@@ -282,6 +282,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
grub_file_t file = 0;
struct linux_armxx_kernel_header lh;
@@ -284,6 +284,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
struct linux_arch_kernel_header lh;
struct grub_armxx_linux_pe_header *pe;
grub_err_t err;
+ int rc;
grub_dl_ref (my_mod);
@@ -326,7 +327,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -328,7 +329,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
grub_dprintf ("linux", "kernel @ %p\n", kernel_addr);
@ -226,7 +226,7 @@ index 6c00af98dce..a1ac7a38867 100644
grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]);
goto fail;
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index adc85636633..af2189619a3 100644
index cd92ea3..ef87b06 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -32,6 +32,8 @@
@ -261,7 +261,7 @@ index adc85636633..af2189619a3 100644
grub_dl_unref (my_mod);
return GRUB_ERR_NONE;
@@ -173,7 +181,6 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
@@ -179,7 +187,6 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
/* Fill the file path for the directory. */
d = (grub_efi_device_path_t *) ((char *) file_path
+ ((char *) d - (char *) dp));
@ -269,7 +269,7 @@ index adc85636633..af2189619a3 100644
copy_file_path ((grub_efi_file_path_device_path_t *) d,
dir_start, dir_end - dir_start);
@@ -191,20 +198,690 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
@@ -197,20 +204,690 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename)
return file_path;
}
@ -963,7 +963,7 @@ index adc85636633..af2189619a3 100644
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
@@ -216,15 +893,45 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -222,15 +899,45 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
address = 0;
image_handle = 0;
file_path = 0;
@ -997,7 +997,7 @@ index adc85636633..af2189619a3 100644
+ *(--p16) = 0;
+ }
+
file = grub_file_open (filename);
file = grub_file_open (filename, GRUB_FILE_TYPE_EFI_CHAINLOADED_IMAGE);
if (! file)
goto fail;
@ -1011,7 +1011,7 @@ index adc85636633..af2189619a3 100644
if (! dev)
goto fail;
@@ -261,17 +968,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -267,17 +974,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
if (! file_path)
goto fail;
@ -1032,7 +1032,7 @@ index adc85636633..af2189619a3 100644
status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES,
GRUB_EFI_LOADER_CODE,
@@ -285,7 +989,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -291,7 +995,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
}
boot_image = (void *) ((grub_addr_t) address);
@ -1041,7 +1041,7 @@ index adc85636633..af2189619a3 100644
{
if (grub_errno == GRUB_ERR_NONE)
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
@@ -295,7 +999,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -301,7 +1005,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
}
#if defined (__i386__) || defined (__x86_64__)
@ -1050,7 +1050,7 @@ index adc85636633..af2189619a3 100644
{
struct grub_macho_fat_header *head = boot_image;
if (head->magic
@@ -304,6 +1008,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -310,6 +1014,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
grub_uint32_t i;
struct grub_macho_fat_arch *archs
= (struct grub_macho_fat_arch *) (head + 1);
@ -1065,7 +1065,7 @@ index adc85636633..af2189619a3 100644
for (i = 0; i < grub_cpu_to_le32 (head->nfat_arch); i++)
{
if (GRUB_MACHO_CPUTYPE_IS_HOST_CURRENT (archs[i].cputype))
@@ -318,79 +1030,39 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -324,79 +1036,39 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
> ~grub_cpu_to_le32 (archs[i].size)
|| grub_cpu_to_le32 (archs[i].offset)
+ grub_cpu_to_le32 (archs[i].size)
@ -1097,27 +1097,27 @@ index adc85636633..af2189619a3 100644
- grub_error (GRUB_ERR_BAD_OS, "cannot load image");
-
- goto fail;
+ grub_file_close (file);
+ grub_device_close (dev);
+ grub_loader_set (grub_secureboot_chainloader_boot,
+ grub_secureboot_chainloader_unload, 0);
+ return 0;
}
- }
-
- /* LoadImage does not set a device handler when the image is
- loaded from memory, so it is necessary to set it explicitly here.
- This is a mess. */
- loaded_image = grub_efi_get_loaded_image (image_handle);
- if (! loaded_image)
+ else if (rc == 0)
{
- {
- grub_error (GRUB_ERR_BAD_OS, "no loaded image available");
- goto fail;
- }
+ grub_file_close (file);
+ grub_device_close (dev);
+ grub_loader_set (grub_secureboot_chainloader_boot,
+ grub_secureboot_chainloader_unload, 0);
+ return 0;
}
- loaded_image->device_handle = dev_handle;
-
- if (argc > 1)
- {
+ else if (rc == 0)
{
- int i, len;
- grub_efi_char16_t *p16;
-
@ -1128,11 +1128,7 @@ index adc85636633..af2189619a3 100644
- cmdline = p16 = grub_malloc (len);
- if (! cmdline)
- goto fail;
+ grub_load_and_start_image(boot_image);
+ grub_file_close (file);
+ grub_device_close (dev);
+ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
-
- for (i = 1; i < argc; i++)
- {
- char *p8;
@ -1144,7 +1140,11 @@ index adc85636633..af2189619a3 100644
- *(p16++) = ' ';
- }
- *(--p16) = 0;
-
+ grub_load_and_start_image(boot_image);
+ grub_file_close (file);
+ grub_device_close (dev);
+ grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
- loaded_image->load_options = cmdline;
- loaded_image->load_options_size = len;
+ return 0;
@ -1162,7 +1162,7 @@ index adc85636633..af2189619a3 100644
if (dev)
grub_device_close (dev);
@@ -402,6 +1074,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
@@ -408,6 +1080,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
if (address)
efi_call_2 (b->free_pages, address, pages);
@ -1173,7 +1173,7 @@ index adc85636633..af2189619a3 100644
return grub_errno;
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index c24202a5dd1..c8ecce6dfd0 100644
index c24202a..c8ecce6 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -33,21 +33,34 @@ struct grub_efi_shim_lock
@ -1197,9 +1197,7 @@ index c24202a5dd1..c8ecce6dfd0 100644
+ grub_dprintf ("secureboot", "shim not available\n");
+ return 0;
+ }
- if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS)
- return 1;
+
+ grub_dprintf ("secureboot", "Asking shim to verify kernel signature\n");
+ status = shim_lock->verify (data, size);
+ grub_dprintf ("secureboot", "shim_lock->verify(): %ld\n", (long int)status);
@ -1209,19 +1207,21 @@ index c24202a5dd1..c8ecce6dfd0 100644
+ return 1;
+ }
- return 0;
- if (shim_lock->verify(data, size) == GRUB_EFI_SUCCESS)
- return 1;
+ grub_dprintf ("secureboot", "Kernel signature verification failed (0x%lx)\n",
+ (unsigned long) status);
+
- return 0;
+ return -1;
}
#pragma GCC diagnostic push
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
index 3db82e782df..8db228c5bf5 100644
index bb2616a..6b24cbb 100644
--- a/grub-core/loader/i386/efi/linux.c
+++ b/grub-core/loader/i386/efi/linux.c
@@ -118,6 +118,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
@@ -117,6 +117,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
@ -1230,15 +1230,15 @@ index 3db82e782df..8db228c5bf5 100644
params->ramdisk_size = size;
params->ramdisk_image = (grub_uint32_t)(grub_addr_t) initrd_mem;
@@ -160,6 +162,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
struct linux_kernel_header lh;
@@ -159,6 +161,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
struct linux_i386_kernel_header lh;
grub_ssize_t len, start, filelen;
void *kernel = NULL;
+ int rc;
grub_dl_ref (my_mod);
@@ -185,11 +188,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -184,11 +187,13 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (grub_file_read (file, kernel, filelen) != filelen)
{
@ -1254,7 +1254,7 @@ index 3db82e782df..8db228c5bf5 100644
{
grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"),
argv[0]);
@@ -204,6 +209,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -203,6 +208,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
@ -1263,7 +1263,7 @@ index 3db82e782df..8db228c5bf5 100644
grub_memset (params, 0, 16384);
grub_memcpy (&lh, kernel, sizeof (lh));
@@ -242,6 +249,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -241,6 +248,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
@ -1286,7 +1286,7 @@ index 3db82e782df..8db228c5bf5 100644
grub_file_close (file);
diff --git a/include/grub/efi/linux.h b/include/grub/efi/linux.h
index d9ede36773b..0033d9305a9 100644
index d9ede36..0033d93 100644
--- a/include/grub/efi/linux.h
+++ b/include/grub/efi/linux.h
@@ -22,7 +22,7 @@
@ -1299,10 +1299,10 @@ index d9ede36773b..0033d9305a9 100644
grub_err_t
EXPORT_FUNC(grub_efi_linux_boot) (void *kernel_address, grub_off_t offset,
diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h
index 7d44732d2c3..c03cc599f63 100644
index 0ed8781..a43adf2 100644
--- a/include/grub/efi/pe32.h
+++ b/include/grub/efi/pe32.h
@@ -214,7 +214,11 @@ struct grub_pe64_optional_header
@@ -223,7 +223,11 @@ struct grub_pe64_optional_header
struct grub_pe32_section_table
{
char name[8];
@ -1315,7 +1315,7 @@ index 7d44732d2c3..c03cc599f63 100644
grub_uint32_t virtual_address;
grub_uint32_t raw_data_size;
grub_uint32_t raw_data_offset;
@@ -225,12 +229,18 @@ struct grub_pe32_section_table
@@ -234,12 +238,18 @@ struct grub_pe32_section_table
grub_uint32_t characteristics;
};
@ -1338,7 +1338,7 @@ index 7d44732d2c3..c03cc599f63 100644
#define GRUB_PE32_SCN_ALIGN_1BYTES 0x00100000
#define GRUB_PE32_SCN_ALIGN_2BYTES 0x00200000
@@ -239,10 +249,28 @@ struct grub_pe32_section_table
@@ -248,10 +258,28 @@ struct grub_pe32_section_table
#define GRUB_PE32_SCN_ALIGN_16BYTES 0x00500000
#define GRUB_PE32_SCN_ALIGN_32BYTES 0x00600000
#define GRUB_PE32_SCN_ALIGN_64BYTES 0x00700000
@ -1367,7 +1367,7 @@ index 7d44732d2c3..c03cc599f63 100644
#define GRUB_PE32_SIGNATURE_SIZE 4
struct grub_pe32_header
@@ -265,6 +293,20 @@ struct grub_pe32_header
@@ -274,6 +302,20 @@ struct grub_pe32_header
#endif
};
@ -1388,3 +1388,6 @@ index 7d44732d2c3..c03cc599f63 100644
struct grub_pe32_fixup_block
{
grub_uint32_t page_rva;
--
1.8.3.1

View File

@ -1,14 +1,15 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From a5d1b0391c2875677f3d7a6d762b3fadaa3ecf85 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 6 Oct 2015 16:09:25 -0400
Subject: [PATCH] Make any of the loaders that link in efi mode honor secure
boot.
Subject: [PATCH 005/220] Make any of the loaders that link in efi mode honor
secure boot.
And in this case "honor" means "even if somebody does link this in, they
won't register commands if SB is enabled."
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/Makefile.am | 1 +
grub-core/Makefile.core.def | 1 +
grub-core/commands/iorw.c | 7 +++++
grub-core/commands/memrw.c | 7 +++++
@ -28,7 +29,6 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
include/grub/mips/linux.h | 0
include/grub/powerpc/linux.h | 0
include/grub/sparc64/linux.h | 0
grub-core/Makefile.am | 1 +
20 files changed, 153 insertions(+), 35 deletions(-)
create mode 100644 grub-core/kern/efi/sb.c
create mode 100644 include/grub/efi/sb.h
@ -37,11 +37,23 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
create mode 100644 include/grub/powerpc/linux.h
create mode 100644 include/grub/sparc64/linux.h
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index 3ea8e7f..c6ba5b2 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -71,6 +71,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 0b4b0c2122d..e92a7ef322f 100644
index 581d9df..eb1088f 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -195,6 +195,7 @@ kernel = {
@@ -207,6 +207,7 @@ kernel = {
i386_multiboot = kern/i386/pc/acpi.c;
i386_coreboot = kern/acpi.c;
i386_multiboot = kern/acpi.c;
@ -50,7 +62,7 @@ index 0b4b0c2122d..e92a7ef322f 100644
x86 = kern/i386/tsc.c;
x86 = kern/i386/tsc_pit.c;
diff --git a/grub-core/commands/iorw.c b/grub-core/commands/iorw.c
index a0c164e54f0..41a7f3f0466 100644
index a0c164e..41a7f3f 100644
--- a/grub-core/commands/iorw.c
+++ b/grub-core/commands/iorw.c
@@ -23,6 +23,7 @@
@ -82,7 +94,7 @@ index a0c164e54f0..41a7f3f0466 100644
grub_unregister_extcmd (cmd_read_word);
grub_unregister_extcmd (cmd_read_dword);
diff --git a/grub-core/commands/memrw.c b/grub-core/commands/memrw.c
index 98769eadb34..088cbe9e2bc 100644
index 98769ea..088cbe9 100644
--- a/grub-core/commands/memrw.c
+++ b/grub-core/commands/memrw.c
@@ -22,6 +22,7 @@
@ -114,7 +126,7 @@ index 98769eadb34..088cbe9e2bc 100644
grub_unregister_extcmd (cmd_read_word);
grub_unregister_extcmd (cmd_read_dword);
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index 04e804d1668..621070918d4 100644
index 896bebf..d7718d2 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -32,6 +32,7 @@
@ -126,7 +138,7 @@ index 04e804d1668..621070918d4 100644
/* Platforms where modules are in a readonly area of memory. */
#if defined(GRUB_MACHINE_QEMU)
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index 91129e33566..708581fcbde 100644
index 3487b06..6e1ceb9 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -273,40 +273,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
@ -172,7 +184,7 @@ index 91129e33566..708581fcbde 100644
/* Search the mods section from the PE32/PE32+ image. This code uses
diff --git a/grub-core/kern/efi/sb.c b/grub-core/kern/efi/sb.c
new file mode 100644
index 00000000000..d74778b0cac
index 0000000..d74778b
--- /dev/null
+++ b/grub-core/kern/efi/sb.c
@@ -0,0 +1,64 @@
@ -241,7 +253,7 @@ index 00000000000..d74778b0cac
+#endif
+}
diff --git a/grub-core/loader/efi/appleloader.c b/grub-core/loader/efi/appleloader.c
index 74888c463ba..69c2a10d351 100644
index 74888c4..69c2a10 100644
--- a/grub-core/loader/efi/appleloader.c
+++ b/grub-core/loader/efi/appleloader.c
@@ -24,6 +24,7 @@
@ -272,7 +284,7 @@ index 74888c463ba..69c2a10d351 100644
grub_unregister_command (cmd);
}
diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c
index af2189619a3..5cd9b6e08a8 100644
index ef87b06..5aa3a5d 100644
--- a/grub-core/loader/efi/chainloader.c
+++ b/grub-core/loader/efi/chainloader.c
@@ -34,6 +34,7 @@
@ -284,10 +296,10 @@ index af2189619a3..5cd9b6e08a8 100644
#include <grub/i18n.h>
#include <grub/net.h>
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index 7f96515da65..87709aa23e8 100644
index 3730ed3..5b9b92d 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -38,6 +38,7 @@
@@ -39,6 +39,7 @@
#ifdef GRUB_MACHINE_PCBIOS
#include <grub/machine/int.h>
#endif
@ -295,7 +307,7 @@ index 7f96515da65..87709aa23e8 100644
GRUB_MOD_LICENSE ("GPLv3+");
@@ -2124,6 +2125,9 @@ static grub_command_t cmd_netbsd_module_elf, cmd_openbsd_ramdisk;
@@ -2130,6 +2131,9 @@ static grub_command_t cmd_netbsd_module_elf, cmd_openbsd_ramdisk;
GRUB_MOD_INIT (bsd)
{
@ -305,7 +317,7 @@ index 7f96515da65..87709aa23e8 100644
/* Net and OpenBSD kernels are often compressed. */
grub_dl_load ("gzio");
@@ -2163,6 +2167,9 @@ GRUB_MOD_INIT (bsd)
@@ -2169,6 +2173,9 @@ GRUB_MOD_INIT (bsd)
GRUB_MOD_FINI (bsd)
{
@ -316,18 +328,18 @@ index 7f96515da65..87709aa23e8 100644
grub_unregister_extcmd (cmd_openbsd);
grub_unregister_extcmd (cmd_netbsd);
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index f7186be4002..c84747ea857 100644
index b255c95..376c726 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -35,6 +35,7 @@
#include <grub/i18n.h>
@@ -36,6 +36,7 @@
#include <grub/lib/cmdline.h>
#include <grub/linux.h>
#include <grub/machine/kernel.h>
+#include <grub/efi/sb.h>
GRUB_MOD_LICENSE ("GPLv3+");
@@ -1156,6 +1157,9 @@ static grub_command_t cmd_linux, cmd_initrd;
@@ -1131,6 +1132,9 @@ static grub_command_t cmd_linux, cmd_initrd;
GRUB_MOD_INIT(linux)
{
@ -337,7 +349,7 @@ index f7186be4002..c84747ea857 100644
cmd_linux = grub_register_command ("linux", grub_cmd_linux,
0, N_("Load Linux."));
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
@@ -1165,6 +1169,9 @@ GRUB_MOD_INIT(linux)
@@ -1140,6 +1144,9 @@ GRUB_MOD_INIT(linux)
GRUB_MOD_FINI(linux)
{
@ -348,7 +360,7 @@ index f7186be4002..c84747ea857 100644
grub_unregister_command (cmd_initrd);
}
diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c
index caa76bee8af..783a3cd93bc 100644
index 73fb91e..fe3e1d4 100644
--- a/grub-core/loader/i386/pc/linux.c
+++ b/grub-core/loader/i386/pc/linux.c
@@ -35,6 +35,7 @@
@ -359,7 +371,7 @@ index caa76bee8af..783a3cd93bc 100644
GRUB_MOD_LICENSE ("GPLv3+");
@@ -480,6 +481,9 @@ static grub_command_t cmd_linux, cmd_linux16, cmd_initrd, cmd_initrd16;
@@ -483,6 +484,9 @@ static grub_command_t cmd_linux, cmd_linux16, cmd_initrd, cmd_initrd16;
GRUB_MOD_INIT(linux16)
{
@ -369,7 +381,7 @@ index caa76bee8af..783a3cd93bc 100644
cmd_linux =
grub_register_command ("linux", grub_cmd_linux,
0, N_("Load Linux."));
@@ -497,6 +501,9 @@ GRUB_MOD_INIT(linux16)
@@ -500,6 +504,9 @@ GRUB_MOD_INIT(linux16)
GRUB_MOD_FINI(linux16)
{
@ -380,7 +392,7 @@ index caa76bee8af..783a3cd93bc 100644
grub_unregister_command (cmd_linux16);
grub_unregister_command (cmd_initrd);
diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 40c67e82489..26df46a4161 100644
index 4a98d70..3e6ad16 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -50,6 +50,7 @@
@ -391,7 +403,7 @@ index 40c67e82489..26df46a4161 100644
GRUB_MOD_LICENSE ("GPLv3+");
@@ -446,6 +447,9 @@ static grub_command_t cmd_multiboot, cmd_module;
@@ -444,6 +445,9 @@ static grub_command_t cmd_multiboot, cmd_module;
GRUB_MOD_INIT(multiboot)
{
@ -401,7 +413,7 @@ index 40c67e82489..26df46a4161 100644
cmd_multiboot =
#ifdef GRUB_USE_MULTIBOOT2
grub_register_command ("multiboot2", grub_cmd_multiboot,
@@ -466,6 +470,9 @@ GRUB_MOD_INIT(multiboot)
@@ -464,6 +468,9 @@ GRUB_MOD_INIT(multiboot)
GRUB_MOD_FINI(multiboot)
{
@ -412,18 +424,18 @@ index 40c67e82489..26df46a4161 100644
grub_unregister_command (cmd_module);
}
diff --git a/grub-core/loader/xnu.c b/grub-core/loader/xnu.c
index c9885b1bcd7..df8dfdb4ba0 100644
index 7f74d1d..e0f47e7 100644
--- a/grub-core/loader/xnu.c
+++ b/grub-core/loader/xnu.c
@@ -33,6 +33,7 @@
#include <grub/extcmd.h>
@@ -34,6 +34,7 @@
#include <grub/env.h>
#include <grub/i18n.h>
#include <grub/verify.h>
+#include <grub/efi/sb.h>
GRUB_MOD_LICENSE ("GPLv3+");
@@ -1469,6 +1470,9 @@ static grub_extcmd_t cmd_splash;
@@ -1478,6 +1479,9 @@ static grub_extcmd_t cmd_splash;
GRUB_MOD_INIT(xnu)
{
@ -433,7 +445,7 @@ index c9885b1bcd7..df8dfdb4ba0 100644
cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0,
N_("Load XNU image."));
cmd_kernel64 = grub_register_command ("xnu_kernel64", grub_cmd_xnu_kernel64,
@@ -1509,6 +1513,9 @@ GRUB_MOD_INIT(xnu)
@@ -1518,6 +1522,9 @@ GRUB_MOD_INIT(xnu)
GRUB_MOD_FINI(xnu)
{
@ -444,7 +456,7 @@ index c9885b1bcd7..df8dfdb4ba0 100644
grub_unregister_command (cmd_resume);
#endif
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 1061aee9726..39480b38674 100644
index 6840bfe..090c862 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -85,7 +85,6 @@ EXPORT_FUNC (grub_efi_set_variable) (const char *var,
@ -457,7 +469,7 @@ index 1061aee9726..39480b38674 100644
const grub_efi_device_path_t *dp2);
diff --git a/include/grub/efi/sb.h b/include/grub/efi/sb.h
new file mode 100644
index 00000000000..9629fbb0f9e
index 0000000..9629fbb
--- /dev/null
+++ b/include/grub/efi/sb.h
@@ -0,0 +1,29 @@
@ -492,25 +504,16 @@ index 00000000000..9629fbb0f9e
+#endif /* ! GRUB_EFI_SB_HEADER */
diff --git a/include/grub/ia64/linux.h b/include/grub/ia64/linux.h
new file mode 100644
index 00000000000..e69de29bb2d
index 0000000..e69de29
diff --git a/include/grub/mips/linux.h b/include/grub/mips/linux.h
new file mode 100644
index 00000000000..e69de29bb2d
index 0000000..e69de29
diff --git a/include/grub/powerpc/linux.h b/include/grub/powerpc/linux.h
new file mode 100644
index 00000000000..e69de29bb2d
index 0000000..e69de29
diff --git a/include/grub/sparc64/linux.h b/include/grub/sparc64/linux.h
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index f4ff62b769a..9c69aa88626 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -71,6 +71,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/command.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/device.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/dl.h
+KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/sb.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/env_private.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/err.h
index 0000000..e69de29
--
1.8.3.1

View File

@ -1,19 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 6290701c8bd7183fef478afd5c27053bf9691639 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 14 Feb 2017 16:18:54 -0500
Subject: [PATCH] Handle multi-arch (64-on-32) boot in linuxefi loader.
Date: Mon, 8 Jul 2019 12:32:37 +0200
Subject: [PATCH 006/220] Handle multi-arch (64-on-32) boot in linuxefi loader.
Allow booting 64-bit kernels on 32-bit EFI on x86.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/loader/efi/linux.c | 9 +++-
grub-core/loader/i386/efi/linux.c | 110 ++++++++++++++++++++++++++------------
grub-core/loader/efi/linux.c | 9 ++-
grub-core/loader/i386/efi/linux.c | 114 ++++++++++++++++++++++++++------------
include/grub/i386/linux.h | 7 ++-
3 files changed, 89 insertions(+), 37 deletions(-)
3 files changed, 91 insertions(+), 39 deletions(-)
diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c
index c8ecce6dfd0..0622dfa48d4 100644
index c8ecce6..0622dfa 100644
--- a/grub-core/loader/efi/linux.c
+++ b/grub-core/loader/efi/linux.c
@@ -69,12 +69,17 @@ grub_linuxefi_secure_validate (void *data, grub_uint32_t size)
@ -37,7 +37,7 @@ index c8ecce6dfd0..0622dfa48d4 100644
return GRUB_ERR_BUG;
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
index 8db228c5bf5..800c3e54022 100644
index 6b24cbb..3017d0f 100644
--- a/grub-core/loader/i386/efi/linux.c
+++ b/grub-core/loader/i386/efi/linux.c
@@ -44,14 +44,10 @@ static char *linux_cmdline;
@ -57,12 +57,12 @@ index 8db228c5bf5..800c3e54022 100644
params);
}
@@ -154,14 +150,20 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
@@ -153,14 +149,20 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
return grub_errno;
}
+#define MIN(a, b) \
+ ({ typeof (a) _a = (a); \
+ ({ typeof (a) _a = (a); \
+ typeof (b) _b = (b); \
+ _a < _b ? _a : _b; })
+
@ -71,7 +71,7 @@ index 8db228c5bf5..800c3e54022 100644
int argc, char *argv[])
{
grub_file_t file = 0;
- struct linux_kernel_header lh;
- struct linux_i386_kernel_header lh;
- grub_ssize_t len, start, filelen;
+ struct linux_i386_kernel_header *lh = NULL;
+ grub_ssize_t start, filelen;
@ -80,7 +80,7 @@ index 8db228c5bf5..800c3e54022 100644
int rc;
grub_dl_ref (my_mod);
@@ -201,48 +203,79 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -200,48 +202,79 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
@ -95,14 +95,16 @@ index 8db228c5bf5..800c3e54022 100644
}
- grub_dprintf ("linux", "params = %lx\n", (unsigned long) params);
+ grub_dprintf ("linux", "params = %p\n", params);
-
- grub_memset (params, 0, 16384);
+ grub_memset (params, 0, sizeof(*params));
-
- grub_memcpy (&lh, kernel, sizeof (lh));
-
- if (lh.boot_flag != grub_cpu_to_le16 (0xaa55))
+ grub_dprintf ("linux", "params = %p\n", params);
+
+ grub_memset (params, 0, sizeof(*params));
+
+ setup_header_end_offset = *((grub_uint8_t *)kernel + 0x201);
+ grub_dprintf ("linux", "copying %lu bytes from %p to %p\n",
+ MIN((grub_size_t)0x202+setup_header_end_offset,
@ -172,12 +174,13 @@ index 8db228c5bf5..800c3e54022 100644
if (!linux_cmdline)
{
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("can't allocate cmdline"));
@@ -255,21 +288,23 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
@@ -254,22 +287,24 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
grub_memcpy (linux_cmdline, LINUX_IMAGE, sizeof (LINUX_IMAGE));
grub_create_loader_cmdline (argc, argv,
linux_cmdline + sizeof (LINUX_IMAGE) - 1,
- lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1));
+ lh->cmdline_size - (sizeof (LINUX_IMAGE) - 1));
- lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1),
+ lh->cmdline_size - (sizeof (LINUX_IMAGE) - 1),
GRUB_VERIFY_KERNEL_CMDLINE);
- lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline;
+ grub_dprintf ("linux", "cmdline:%s\n", linux_cmdline);
@ -215,15 +218,15 @@ index 8db228c5bf5..800c3e54022 100644
loaded=1;
+ grub_dprintf ("linux", "setting lh->code32_start to %p\n", kernel_mem);
+ lh->code32_start = (grub_uint32_t)(grub_addr_t) kernel_mem;
+
+ grub_memcpy (kernel_mem, (char *)kernel + start, filelen - start);
- lh.code32_start = (grub_uint32_t)(grub_uint64_t) kernel_mem;
- grub_memcpy (params, &lh, 2 * 512);
+ grub_memcpy (kernel_mem, (char *)kernel + start, filelen - start);
- params->type_of_loader = 0x21;
+ grub_dprintf ("linux", "setting lh->type_of_loader\n");
+ lh->type_of_loader = 0x6;
+
- params->type_of_loader = 0x21;
+ grub_dprintf ("linux", "setting lh->ext_loader_{type,ver}\n");
+ params->ext_loader_type = 0;
+ params->ext_loader_ver = 2;
@ -244,10 +247,10 @@ index 8db228c5bf5..800c3e54022 100644
if (kernel_mem && !loaded)
grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem,
diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h
index bb19dbd5a77..8474a857ed2 100644
index ce30e7f..a093679 100644
--- a/include/grub/i386/linux.h
+++ b/include/grub/i386/linux.h
@@ -133,7 +133,12 @@ struct linux_i386_kernel_header
@@ -136,7 +136,12 @@ struct linux_i386_kernel_header
grub_uint32_t kernel_alignment;
grub_uint8_t relocatable;
grub_uint8_t min_alignment;
@ -261,3 +264,6 @@ index bb19dbd5a77..8474a857ed2 100644
grub_uint32_t cmdline_size;
grub_uint32_t hardware_subarch;
grub_uint64_t hardware_subarch_data;
--
1.8.3.1

View File

@ -1,33 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 22e9b5b6f0e2031bc68d1c3cb0e8e1f33cc68c93 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 8 Aug 2017 12:48:04 -0400
Subject: [PATCH] re-write .gitignore
Date: Mon, 8 Jul 2019 12:55:29 +0200
Subject: [PATCH 007/220] re-write .gitignore
---
.gitignore | 357 +++++++++++++-------------------------
build-aux/.gitignore | 9 +
docs/.gitignore | 4 +
grub-core/.gitignore | 15 ++
grub-core/gnulib/.gitignore | 22 +++
.gitignore | 366 +++++++++++++++-----------------------
docs/.gitignore | 5 +
grub-core/.gitignore | 16 ++
grub-core/lib/.gitignore | 1 +
include/grub/gcrypt/.gitignore | 2 +
po/.gitignore | 4 +
util/bash-completion.d/.gitignore | 1 +
9 files changed, 175 insertions(+), 240 deletions(-)
create mode 100644 build-aux/.gitignore
po/.gitignore | 5 +
util/bash-completion.d/.gitignore | 2 +
7 files changed, 171 insertions(+), 226 deletions(-)
create mode 100644 docs/.gitignore
create mode 100644 grub-core/.gitignore
create mode 100644 grub-core/gnulib/.gitignore
create mode 100644 grub-core/lib/.gitignore
create mode 100644 include/grub/gcrypt/.gitignore
create mode 100644 po/.gitignore
create mode 100644 util/bash-completion.d/.gitignore
diff --git a/.gitignore b/.gitignore
index eca17bec9b8..43f04d47277 100644
index 819cd18..b45a633 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,249 +1,126 @@
@@ -1,237 +1,151 @@
+# things ./autogen.sh will create
+/Makefile.utilgcry.def
+/ABOUT-NLS
+/aclocal.m4
+/autom4te.cache
+/build-aux
+/configure
+/gnulib
+/grub-core/lib/gnulib/
+/Makefile
+
+# things very common editors create that we never want
*~
-00_header
-10_*
-20_linux_xen
@ -36,11 +45,13 @@ index eca17bec9b8..43f04d47277 100644
-41_custom
-*.1
-*.8
-ABOUT-NLS
-aclocal.m4
-ahci_test
-ascii.bitmaps
-ascii.h
-autom4te.cache
-build-aux
-build-grub-gen-asciih
-build-grub-gen-widthspec
-build-grub-mkfont
@ -64,26 +75,18 @@ index eca17bec9b8..43f04d47277 100644
-example_grub_script_test
-example_scripted_test
-example_unit_test
+# things ./autogen.sh will create
+/Makefile.utilgcry.def
+/aclocal.m4
+/autom4te.cache
+/configure
+Makefile
+# we want to enable building in a subdirectory, but we don't want to exclude
+# /build-aux so explicitly don't ignore it.
+/build*/
+!/build-aux/
+
+# things very common editors create that we never want
+*~
+.*.sw?
+*.patch
+
+# stuff you're likely to make while building test trees
+grub.cfg
+/build*/
+
+# built objects across the whole tree
+Makefile.in
+*.a
+*.am
+*.efi
*.exec
-*.exec.exe
-fddboot_test
@ -92,6 +95,7 @@ index eca17bec9b8..43f04d47277 100644
-gentrigtables
-gentrigtables.exe
-gettext_strings_test
-/gnulib
-grub-bin2h
-/grub-bios-setup
-/grub-bios-setup.exe
@ -184,6 +188,7 @@ index eca17bec9b8..43f04d47277 100644
-*.image.exe
-include/grub/cpu
-include/grub/machine
-INSTALL.grub
-install-sh
-lib/libgcrypt-grub
-libgrub_a_init.c
@ -194,6 +199,7 @@ index eca17bec9b8..43f04d47277 100644
-lzocompress_test
*.marker
-Makefile
/m4
*.mod
-mod-*.c
-missing
@ -208,7 +214,11 @@ index eca17bec9b8..43f04d47277 100644
-*.pp
-po/*.mo
-po/grub.pot
-po/Makefile.in.in
-po/Makevars
-po/Makevars.template
-po/POTFILES
-po/Rules-quot
-po/stamp-po
-printf_test
-priority_queue_unit_test
@ -259,25 +269,7 @@ index eca17bec9b8..43f04d47277 100644
-grub-core/*.pp
-grub-core/kernel.img.bin
-util/bash-completion.d/grub
-grub-core/gnulib/alloca.h
-grub-core/gnulib/arg-nonnull.h
-grub-core/gnulib/c++defs.h
-grub-core/gnulib/charset.alias
-grub-core/gnulib/configmake.h
-grub-core/gnulib/float.h
-grub-core/gnulib/getopt.h
-grub-core/gnulib/langinfo.h
-grub-core/gnulib/ref-add.sed
-grub-core/gnulib/ref-del.sed
-grub-core/gnulib/stdio.h
-grub-core/gnulib/stdlib.h
-grub-core/gnulib/string.h
-grub-core/gnulib/strings.h
-grub-core/gnulib/sys
-grub-core/gnulib/unistd.h
-grub-core/gnulib/warn-on-use.h
-grub-core/gnulib/wchar.h
-grub-core/gnulib/wctype.h
-grub-core/lib/gnulib
-grub-core/rs_decoder.h
-widthspec.bin
-widthspec.h
@ -296,10 +288,6 @@ index eca17bec9b8..43f04d47277 100644
-/grub-render-label
-/grub-glue-efi.exe
-/grub-render-label.exe
-grub-core/gnulib/locale.h
-grub-core/gnulib/unitypes.h
-grub-core/gnulib/uniwidth.h
-build-aux/test-driver
+
+# next are things you get if you do ./configure in the topdir (for e.g.
+# "make dist" invocation.
@ -307,9 +295,16 @@ index eca17bec9b8..43f04d47277 100644
+/config.h
+/include/grub/cpu
+/include/grub/machine
+/INSTALL
+/INSTALL.grub
+/po/Makefile.in.in
+/po/Makevars
+/po/Makevars.template
+/po/POTFILES
+/po/Rules-quot
+/stamp-h
+/stamp-h1
+bootstrap.log
+config.log
+config.status
+
@ -338,6 +333,8 @@ index eca17bec9b8..43f04d47277 100644
+/grub*-fs-tester
+/grub*-fstest
+/grub*-fstest.1
+/grub*-get-kernel-settings
+/grub*-get-kernel-settings.3
+/grub*-glue-efi
+/grub*-glue-efi.1
+/grub*-install
@ -348,6 +345,8 @@ index eca17bec9b8..43f04d47277 100644
+/grub*-macbless.8
+/grub*-menulst2cfg
+/grub*-menulst2cfg.1
+/grub*-mount
+/grub*-mount.1
+/grub*-mkconfig
+/grub*-mkconfig.8
+/grub*-mkconfig_lib
@ -375,16 +374,24 @@ index eca17bec9b8..43f04d47277 100644
+/grub*-reboot.8
+/grub*-render-label
+/grub*-render-label.1
+/grub*-rpm-sort
+/grub*-rpm-sort.8
+/grub*-script-check
+/grub*-script-check.1
+/grub*-set-bootflag
+/grub*-set-bootflag.1
+/grub*-set-default
+/grub*-set-default.8
+/grub*-set-password
+/grub*-set-password.8
+/grub*-shell
+/grub*-shell-tester
+/grub*-sparc64-setup
+/grub*-sparc64-setup.8
+/grub*-syslinux2cfg
+/grub*-syslinux2cfg.1
+/grub*-switch-to-blscfg
+/grub*-switch-to-blscfg.8
+/grub_fstest.pp
+/grub_fstest_init.c
+/grub_fstest_init.lst
@ -394,38 +401,25 @@ index eca17bec9b8..43f04d47277 100644
+/libgrub_a_init.lst
+/stamp-h.in
+/widthspec.h
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
new file mode 100644
index 00000000000..f2f17aab9ff
--- /dev/null
+++ b/build-aux/.gitignore
@@ -0,0 +1,9 @@
+/compile
+/config.guess
+/config.sub
+/depcomp
+/install-sh
+/mdate-sh
+/missing
+/test-driver
+/texinfo.tex
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 00000000000..91aee84d3e9
index 0000000..e1d849e
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,4 @@
@@ -0,0 +1,5 @@
+/*.in
+/Makefile
+/stamp-1
+/stamp-vti
+/version*.texi
diff --git a/grub-core/.gitignore b/grub-core/.gitignore
new file mode 100644
index 00000000000..c738ac6c649
index 0000000..2acce28
--- /dev/null
+++ b/grub-core/.gitignore
@@ -0,0 +1,15 @@
@@ -0,0 +1,16 @@
+/*.lst
+/Makefile
+/Makefile.gcry.def
+/unidata.c
+/build-grub-module-verifier
@ -440,44 +434,16 @@ index 00000000000..c738ac6c649
+/symlist.c
+/symlist.h
+/trigtables.c
diff --git a/grub-core/gnulib/.gitignore b/grub-core/gnulib/.gitignore
new file mode 100644
index 00000000000..29e199c2db4
--- /dev/null
+++ b/grub-core/gnulib/.gitignore
@@ -0,0 +1,22 @@
+/alloca.h
+/arg-nonnull.h
+/c++defs.h
+/charset.alias
+/configmake.h
+/getopt.h
+/langinfo.h
+/libgnu.a
+/locale.h
+/ref-add.sed
+/ref-del.sed
+/stdio.h
+/stdlib.h
+/string.h
+/strings.h
+/sys/
+/unistd.h
+/unitypes.h
+/uniwidth.h
+/warn-on-use.h
+/wchar.h
+/wctype.h
diff --git a/grub-core/lib/.gitignore b/grub-core/lib/.gitignore
new file mode 100644
index 00000000000..68154591404
index 0000000..6815459
--- /dev/null
+++ b/grub-core/lib/.gitignore
@@ -0,0 +1 @@
+/libgcrypt-grub/
diff --git a/include/grub/gcrypt/.gitignore b/include/grub/gcrypt/.gitignore
new file mode 100644
index 00000000000..8fbf5646246
index 0000000..8fbf564
--- /dev/null
+++ b/include/grub/gcrypt/.gitignore
@@ -0,0 +1,2 @@
@ -485,18 +451,23 @@ index 00000000000..8fbf5646246
+gcrypt.h
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 00000000000..97b679c3138
index 0000000..f507e77
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,4 @@
@@ -0,0 +1,5 @@
+/Makefile
+/POTFILES*.in
+/grub.pot
+/remove-potcdate.sed
+/stamp-po
diff --git a/util/bash-completion.d/.gitignore b/util/bash-completion.d/.gitignore
new file mode 100644
index 00000000000..b7e1eb12428
index 0000000..6813a52
--- /dev/null
+++ b/util/bash-completion.d/.gitignore
@@ -0,0 +1 @@
@@ -0,0 +1,2 @@
+Makefile
+grub
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 3b4c970a7123c3c29415f41bebee761524597b25 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Thu, 20 Sep 2012 18:07:39 -0300
Subject: [PATCH] IBM client architecture (CAS) reboot support
Subject: [PATCH 008/220] IBM client architecture (CAS) reboot support
This is an implementation of IBM client architecture (CAS) reboot for GRUB.
@ -25,10 +25,10 @@ parameters
4 files changed, 91 insertions(+)
diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c
index 62929d983bf..2d53c0e8608 100644
index 4d493ab..3a6689a 100644
--- a/grub-core/kern/ieee1275/openfw.c
+++ b/grub-core/kern/ieee1275/openfw.c
@@ -588,3 +588,66 @@ grub_ieee1275_get_boot_dev (void)
@@ -591,3 +591,66 @@ grub_ieee1275_get_boot_dev (void)
return bootpath;
}
@ -96,7 +96,7 @@ index 62929d983bf..2d53c0e8608 100644
+ return 0;
+}
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 78a70a8bf47..249e19bc788 100644
index 1b03dfd..222e239 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -33,6 +33,9 @@
@ -133,20 +133,20 @@ index 78a70a8bf47..249e19bc788 100644
grub_errno = GRUB_ERR_NONE;
}
diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c
index a8502d90711..ab78ca87f90 100644
index ee299fd..0d05d6b 100644
--- a/grub-core/script/execute.c
+++ b/grub-core/script/execute.c
@@ -27,6 +27,9 @@
#include <grub/normal.h>
@@ -28,6 +28,9 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/verify.h>
+#ifdef GRUB_MACHINE_IEEE1275
+#include <grub/ieee1275/ieee1275.h>
+#endif
/* Max digits for a char is 3 (0xFF is 255), similarly for an int it
is sizeof (int) * 3, and one extra for a possible -ve sign. */
@@ -877,6 +880,10 @@ grub_script_execute_sourcecode (const char *source)
@@ -878,6 +881,10 @@ grub_script_execute_sourcecode (const char *source)
grub_err_t ret = 0;
struct grub_script *parsed_script;
@ -158,10 +158,10 @@ index a8502d90711..ab78ca87f90 100644
{
char *line;
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
index 8868f3a756f..2310f33dbc2 100644
index 73e2f46..0a59960 100644
--- a/include/grub/ieee1275/ieee1275.h
+++ b/include/grub/ieee1275/ieee1275.h
@@ -252,6 +252,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali
@@ -254,6 +254,8 @@ int EXPORT_FUNC(grub_ieee1275_devalias_next) (struct grub_ieee1275_devalias *ali
void EXPORT_FUNC(grub_ieee1275_children_peer) (struct grub_ieee1275_devalias *alias);
void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath,
struct grub_ieee1275_devalias *alias);
@ -170,3 +170,6 @@ index 8868f3a756f..2310f33dbc2 100644
char *EXPORT_FUNC(grub_ieee1275_get_boot_dev) (void);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 8213eaa16384c332659e2655a7f5f01d09d5b27d Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Wed, 24 Apr 2013 10:51:48 -0300
Subject: [PATCH] for ppc, reset console display attr when clear screen
Subject: [PATCH 009/220] for ppc, reset console display attr when clear screen
v2: Also use \x0c instead of a literal ^L to make future patches less
awkward.
@ -15,7 +15,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c
index d317efa368d..29df35e6d20 100644
index d317efa..29df35e 100644
--- a/grub-core/term/terminfo.c
+++ b/grub-core/term/terminfo.c
@@ -151,7 +151,7 @@ grub_terminfo_set_current (struct grub_term_output *term,
@ -27,3 +27,6 @@ index d317efa368d..29df35e6d20 100644
data->reverse_video_on = grub_strdup ("\e[7m");
data->reverse_video_off = grub_strdup ("\e[m");
if (grub_strcmp ("ieee1275", str) == 0)
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 0a3d7e634bfa38143cdbe1c53aae681ea4432547 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Tue, 11 Jun 2013 15:14:05 -0300
Subject: [PATCH] Disable GRUB video support for IBM power machines
Subject: [PATCH 010/220] Disable GRUB video support for IBM power machines
Should fix the problem in bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=973205
@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=973205
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c
index 3e12e6b24e1..3e14f539368 100644
index 20cbbd7..04df9d2 100644
--- a/grub-core/kern/ieee1275/cmain.c
+++ b/grub-core/kern/ieee1275/cmain.c
@@ -90,7 +90,10 @@ grub_ieee1275_find_options (void)
@ -28,7 +28,7 @@ index 3e12e6b24e1..3e14f539368 100644
/* Old Macs have no key repeat, newer ones have fully working one.
The ones inbetween when repeated key generates an escaoe sequence
diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c
index 17a3dbbb575..b8e4b3feb32 100644
index 17a3dbb..b8e4b3f 100644
--- a/grub-core/video/ieee1275.c
+++ b/grub-core/video/ieee1275.c
@@ -352,9 +352,12 @@ static struct grub_video_adapter grub_video_ieee1275_adapter =
@ -48,15 +48,18 @@ index 17a3dbbb575..b8e4b3feb32 100644
GRUB_MOD_FINI(ieee1275_fb)
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
index 2310f33dbc2..ca08bd96681 100644
index 0a59960..b5a1d49 100644
--- a/include/grub/ieee1275/ieee1275.h
+++ b/include/grub/ieee1275/ieee1275.h
@@ -146,6 +146,8 @@ enum grub_ieee1275_flag
GRUB_IEEE1275_FLAG_BROKEN_REPEAT,
@@ -148,6 +148,8 @@ enum grub_ieee1275_flag
GRUB_IEEE1275_FLAG_CURSORONOFF_ANSI_BROKEN,
GRUB_IEEE1275_FLAG_RAW_DEVNAMES,
+
+ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT
};
extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 100f123a544bc54034cf61646f03f988fc876435 Mon Sep 17 00:00:00 2001
From: Marcel Kolaja <mkolaja@redhat.com>
Date: Tue, 21 Jan 2014 10:57:08 -0500
Subject: [PATCH] Honor a symlink when generating configuration by
Subject: [PATCH 011/220] Honor a symlink when generating configuration by
grub2-mkconfig
Honor a symlink when generating configuration by grub2-mkconfig, so that
@ -11,7 +11,7 @@ the -o option follows it rather than overwriting it with a regular file.
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 33332360eec..bc5a3f17541 100644
index 9f477ff..523d4e0 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -287,7 +287,8 @@ and /etc/grub.d/* files or please file a bug report with
@ -24,3 +24,6 @@ index 33332360eec..bc5a3f17541 100644
fi
fi
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 11d400b4b4f1475cf1a75e7f216524a903e7df7c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 3 Apr 2013 14:35:34 -0400
Subject: [PATCH] Move bash completion script (#922997)
Subject: [PATCH 012/220] Move bash completion script (#922997)
Apparently these go in a new place now.
---
@ -10,10 +10,10 @@ Apparently these go in a new place now.
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c7888e40f66..783118ccdcd 100644
index 7656f24..d283af6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -289,6 +289,14 @@ AC_SUBST(grubdirname)
@@ -305,6 +305,14 @@ AC_SUBST(grubdirname)
AC_DEFINE_UNQUOTED(GRUB_DIR_NAME, "$grubdirname",
[Default grub directory name])
@ -28,7 +28,7 @@ index c7888e40f66..783118ccdcd 100644
#
# Checks for build programs.
#
@@ -498,6 +506,9 @@ HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags"
@@ -516,6 +524,9 @@ HOST_CFLAGS="$HOST_CFLAGS $grub_cv_cc_w_extra_flags"
# Check for target programs.
#
@ -39,7 +39,7 @@ index c7888e40f66..783118ccdcd 100644
if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
tmp_ac_tool_prefix="$ac_tool_prefix"
diff --git a/util/bash-completion.d/Makefile.am b/util/bash-completion.d/Makefile.am
index 136287cf1bf..61108f05429 100644
index 136287c..61108f0 100644
--- a/util/bash-completion.d/Makefile.am
+++ b/util/bash-completion.d/Makefile.am
@@ -6,7 +6,6 @@ EXTRA_DIST = $(bash_completion_source)
@ -50,3 +50,6 @@ index 136287cf1bf..61108f05429 100644
bashcompletion_DATA = $(bash_completion_script)
$(bash_completion_script): $(bash_completion_source) $(top_builddir)/config.status
--
1.8.3.1

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From f12a6d6082e3d532b676e3835e833df2d818416b Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 5 Sep 2014 10:07:04 -0400
Subject: [PATCH] Allow "fallback" to include entries by title, not just
number.
Subject: [PATCH 014/220] Allow "fallback" to include entries by title, not
just number.
Resolves: rhbz#1026084
@ -12,7 +12,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 58 insertions(+), 27 deletions(-)
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index e7a83c2d6e2..d2f64b05e0a 100644
index d5e0c79..9175ad2 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -163,16 +163,41 @@ grub_menu_set_timeout (int timeout)
@ -139,3 +139,6 @@ index e7a83c2d6e2..d2f64b05e0a 100644
/* Get the entry number from the variable NAME. */
static int
get_entry_number (grub_menu_t menu, const char *name)
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From be1ed0f8e7ddf8747049c6e132c25032d2fef9ca Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 4 Sep 2014 16:49:25 -0400
Subject: [PATCH] Add GRUB_DISABLE_UUID.
Subject: [PATCH 015/220] Add GRUB_DISABLE_UUID.
This will cause "search --fs-uuid --set=root ..." not to be generated by
grub2-mkconfig, and instead simply attempt to use the grub device name
@ -15,7 +15,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
3 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/docs/grub.texi b/docs/grub.texi
index 2adfa97bee8..2fd32608c01 100644
index 8779507..6f52430 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -1441,6 +1441,13 @@ enable the use of partition UUIDs, set this option to @samp{false}.
@ -33,7 +33,7 @@ index 2adfa97bee8..2fd32608c01 100644
If graphical video support is required, either because the @samp{gfxterm}
graphical terminal is in use or because @samp{GRUB_GFXPAYLOAD_LINUX} is set,
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index bc5a3f17541..b0a8626dd1c 100644
index 523d4e0..9ecbcfb 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -133,12 +133,12 @@ fi
@ -83,7 +83,7 @@ index bc5a3f17541..b0a8626dd1c 100644
GRUB_GFXMODE \
GRUB_BACKGROUND \
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 0f801cab3e4..1001a12232b 100644
index 0f801ca..1001a12 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -156,7 +156,7 @@ prepare_grub_to_access_device ()
@ -104,3 +104,6 @@ index 0f801cab3e4..1001a12232b 100644
echo "$fs_uuid";
else
echo $device |sed 's, ,_,g'
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 479a8c2d36a28aaac12bf349ea09999655b90353 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 26 Feb 2014 21:49:12 -0500
Subject: [PATCH] Make "exit" take a return code.
Subject: [PATCH 016/220] Make "exit" take a return code.
This adds "exit" with a return code. With this patch, any "exit"
command /may/ include a return code, and on platforms that support
@ -20,17 +20,17 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
grub-core/kern/mips/arc/init.c | 2 +-
grub-core/kern/mips/loongson/init.c | 2 +-
grub-core/kern/mips/qemu_mips/init.c | 2 +-
grub-core/kern/misc.c | 2 +-
grub-core/kern/misc.c | 11 ++++++++++-
grub-core/kern/uboot/init.c | 6 +++---
grub-core/kern/xen/init.c | 2 +-
include/grub/misc.h | 2 +-
14 files changed, 39 insertions(+), 21 deletions(-)
14 files changed, 48 insertions(+), 21 deletions(-)
diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c
index a3a11824172..b25ca4b9f17 100644
index 6bbce31..6d66b7c 100644
--- a/grub-core/commands/minicmd.c
+++ b/grub-core/commands/minicmd.c
@@ -176,12 +176,24 @@ grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)),
@@ -179,12 +179,24 @@ grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)),
}
/* exit */
@ -60,7 +60,7 @@ index a3a11824172..b25ca4b9f17 100644
}
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index 708581fcbde..e339f264b3a 100644
index 6e1ceb9..370ce03 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -164,11 +164,16 @@ grub_reboot (void)
@ -83,7 +83,7 @@ index 708581fcbde..e339f264b3a 100644
}
diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c
index 425bb960347..55ea5a11ccd 100644
index 425bb96..55ea5a1 100644
--- a/grub-core/kern/emu/main.c
+++ b/grub-core/kern/emu/main.c
@@ -67,7 +67,7 @@ grub_reboot (void)
@ -96,10 +96,10 @@ index 425bb960347..55ea5a11ccd 100644
grub_reboot ();
}
diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c
index 76661337f10..82012a72fcb 100644
index 65db79b..19cd007 100644
--- a/grub-core/kern/emu/misc.c
+++ b/grub-core/kern/emu/misc.c
@@ -137,9 +137,10 @@ xasprintf (const char *fmt, ...)
@@ -139,9 +139,10 @@ xasprintf (const char *fmt, ...)
#if !defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL)
void
@ -113,7 +113,7 @@ index 76661337f10..82012a72fcb 100644
#endif
diff --git a/grub-core/kern/i386/coreboot/init.c b/grub-core/kern/i386/coreboot/init.c
index 3314f027fec..36f9134b7b7 100644
index 3314f02..36f9134 100644
--- a/grub-core/kern/i386/coreboot/init.c
+++ b/grub-core/kern/i386/coreboot/init.c
@@ -41,7 +41,7 @@ extern grub_uint8_t _end[];
@ -126,7 +126,7 @@ index 3314f027fec..36f9134b7b7 100644
/* We can't use grub_fatal() in this function. This would create an infinite
loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */
diff --git a/grub-core/kern/i386/qemu/init.c b/grub-core/kern/i386/qemu/init.c
index 271b6fbfabd..9fafe98f015 100644
index 271b6fb..9fafe98 100644
--- a/grub-core/kern/i386/qemu/init.c
+++ b/grub-core/kern/i386/qemu/init.c
@@ -42,7 +42,7 @@ extern grub_uint8_t _end[];
@ -139,10 +139,10 @@ index 271b6fbfabd..9fafe98f015 100644
/* We can't use grub_fatal() in this function. This would create an infinite
loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index 0d8ebf58b95..f5423ce27d9 100644
index d483e35..e71d158 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -68,7 +68,7 @@ grub_addr_t grub_ieee1275_original_stack;
@@ -71,7 +71,7 @@ grub_addr_t grub_ieee1275_original_stack;
#endif
void
@ -152,7 +152,7 @@ index 0d8ebf58b95..f5423ce27d9 100644
grub_ieee1275_exit ();
}
diff --git a/grub-core/kern/mips/arc/init.c b/grub-core/kern/mips/arc/init.c
index 3834a149093..86b3a25ec40 100644
index 3834a14..86b3a25 100644
--- a/grub-core/kern/mips/arc/init.c
+++ b/grub-core/kern/mips/arc/init.c
@@ -276,7 +276,7 @@ grub_halt (void)
@ -165,7 +165,7 @@ index 3834a149093..86b3a25ec40 100644
GRUB_ARC_FIRMWARE_VECTOR->exit ();
diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c
index 7b96531b983..dff598ca7b0 100644
index 7b96531..dff598c 100644
--- a/grub-core/kern/mips/loongson/init.c
+++ b/grub-core/kern/mips/loongson/init.c
@@ -304,7 +304,7 @@ grub_halt (void)
@ -178,7 +178,7 @@ index 7b96531b983..dff598ca7b0 100644
grub_halt ();
}
diff --git a/grub-core/kern/mips/qemu_mips/init.c b/grub-core/kern/mips/qemu_mips/init.c
index be88b77d22d..8b6c55ffc01 100644
index be88b77..8b6c55f 100644
--- a/grub-core/kern/mips/qemu_mips/init.c
+++ b/grub-core/kern/mips/qemu_mips/init.c
@@ -75,7 +75,7 @@ grub_machine_fini (int flags __attribute__ ((unused)))
@ -191,10 +191,10 @@ index be88b77d22d..8b6c55ffc01 100644
grub_halt ();
}
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 3b633d51f4c..952411d5dc6 100644
index 3b633d5..cd63a8c 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -1095,7 +1095,7 @@ grub_abort (void)
@@ -1095,9 +1095,18 @@ grub_abort (void)
grub_getkey ();
}
@ -202,9 +202,20 @@ index 3b633d51f4c..952411d5dc6 100644
+ grub_exit (1);
}
+#if defined (__clang__) && !defined (GRUB_UTIL)
+/* clang emits references to abort(). */
+void __attribute__ ((noreturn))
+abort (void)
+{
+ grub_abort ();
+}
+#endif
+
void
grub_fatal (const char *fmt, ...)
{
diff --git a/grub-core/kern/uboot/init.c b/grub-core/kern/uboot/init.c
index 3e338645c57..be2a5be1d07 100644
index 3e33864..be2a5be 100644
--- a/grub-core/kern/uboot/init.c
+++ b/grub-core/kern/uboot/init.c
@@ -39,9 +39,9 @@ extern grub_size_t grub_total_module_size;
@ -229,10 +240,10 @@ index 3e338645c57..be2a5be1d07 100644
else if (ver > API_SIG_VERSION)
{
diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c
index 0559c033c3d..fce526d417b 100644
index 782ca72..708b060 100644
--- a/grub-core/kern/xen/init.c
+++ b/grub-core/kern/xen/init.c
@@ -549,7 +549,7 @@ grub_machine_init (void)
@@ -584,7 +584,7 @@ grub_machine_init (void)
}
void
@ -242,7 +253,7 @@ index 0559c033c3d..fce526d417b 100644
struct sched_shutdown arg;
diff --git a/include/grub/misc.h b/include/grub/misc.h
index 372f009e84f..83fd69f4ada 100644
index ee48eb7..f9135b6 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -334,7 +334,7 @@ int EXPORT_FUNC(grub_vsnprintf) (char *str, grub_size_t n, const char *fmt,
@ -254,3 +265,6 @@ index 372f009e84f..83fd69f4ada 100644
grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
grub_uint64_t d,
grub_uint64_t *r);
--
1.8.3.1

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 9851c77af2f615927719300b632f38d51d8f1d27 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 22 Jul 2015 11:21:01 -0400
Subject: [PATCH] Mark po/exclude.pot as binary so git won't try to diff
nonprintables.
Subject: [PATCH 017/220] Mark po/exclude.pot as binary so git won't try to
diff nonprintables.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -12,8 +12,11 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000000..33ffaa40460
index 0000000..33ffaa4
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+po/exclude.pot binary
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 2c806ded764dd0e69dbc4e1b95a390bb65bbd019 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 7 Dec 2015 14:20:49 -0500
Subject: [PATCH] Make efi machines load an env block from a variable
Subject: [PATCH 018/220] Make efi machines load an env block from a variable
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -10,10 +10,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index e92a7ef322f..f8065388213 100644
index eb1088f..41b5e16 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -191,6 +191,7 @@ kernel = {
@@ -203,6 +203,7 @@ kernel = {
efi = term/efi/console.c;
efi = kern/acpi.c;
efi = kern/efi/acpi.c;
@ -22,7 +22,7 @@ index e92a7ef322f..f8065388213 100644
i386_multiboot = kern/i386/pc/acpi.c;
i386_coreboot = kern/acpi.c;
diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
index 3dfdf2d22b0..71d2279a0c1 100644
index 3dfdf2d..71d2279 100644
--- a/grub-core/kern/efi/init.c
+++ b/grub-core/kern/efi/init.c
@@ -25,9 +25,40 @@
@ -79,3 +79,6 @@ index 3dfdf2d22b0..71d2279a0c1 100644
char **device,
char **path);
--
1.8.3.1

View File

@ -1,31 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 93dd0d49c319a8611cfe346c21706d2390cbf854 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Tue, 27 Nov 2012 17:18:53 -0200
Subject: [PATCH] DHCP client ID and UUID options added.
Date: Mon, 8 Jul 2019 14:10:58 +0200
Subject: [PATCH 019/220] DHCP client ID and UUID options added.
---
grub-core/net/bootp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++-----
grub-core/net/bootp.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++-----
include/grub/net.h | 2 ++
2 files changed, 81 insertions(+), 8 deletions(-)
2 files changed, 79 insertions(+), 8 deletions(-)
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
index 9e2fdb795f5..f03eeab2fb4 100644
index 04cfbb0..0e6e41a 100644
--- a/grub-core/net/bootp.c
+++ b/grub-core/net/bootp.c
@@ -25,6 +25,49 @@
#include <grub/net/udp.h>
#include <grub/datetime.h>
@@ -95,6 +95,49 @@ enum
/* Max timeout when waiting for BOOTP/DHCP reply */
#define GRUB_DHCP_MAX_PACKET_TIMEOUT 32
+static char *
+grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)),
+ const char *val __attribute__ ((unused)))
+ const char *val __attribute__ ((unused)))
+{
+ return NULL;
+}
+
+static void
+set_env_limn_ro (const char *intername, const char *suffix,
+ const char *value, grub_size_t len)
+ const char *value, grub_size_t len)
+{
+ char *varname, *varvalue;
+ char *ptr;
@ -59,60 +59,58 @@ index 9e2fdb795f5..f03eeab2fb4 100644
+ return val + 'a' - 10;
+}
+
static void
parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
{
@@ -55,6 +98,9 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
taglength = *ptr++;
static const void *
find_dhcp_option (const struct grub_net_bootp_packet *bp, grub_size_t size,
grub_uint8_t opt_code, grub_uint8_t *opt_len)
@@ -152,6 +195,9 @@ again:
if (i + taglength >= size)
return NULL;
+ grub_dprintf("net", "DHCP option %u (0x%02x) found with length %u.\n",
+ tagtype, tagtype, taglength);
+
switch (tagtype)
/* FIXME RFC 3396 options concatentation */
if (tagtype == opt_code)
{
case GRUB_NET_BOOTP_NETMASK:
@@ -120,6 +166,39 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
taglength);
break;
@@ -354,6 +400,37 @@ grub_net_configure_by_dhcp_ack (const char *name,
}
grub_net_add_ipv4_local (inter, mask);
+ case GRUB_NET_BOOTP_CLIENT_ID:
+ set_env_limn_ro (name, "clientid", (char *) ptr, taglength);
+ break;
+ opt = find_dhcp_option (bp, size, GRUB_NET_BOOTP_CLIENT_ID, &opt_len);
+ if (opt)
+ {
+ set_env_limn_ro (name, "clientid", (char *) opt, opt_len);
+ }
+
+ case GRUB_NET_BOOTP_CLIENT_UUID:
+ opt = find_dhcp_option (bp, size, GRUB_NET_BOOTP_CLIENT_UUID, &opt_len);
+ if (opt && opt_len == 17)
+ {
+ /* The format is 9cfe245e-d0c8-bd45-a79f-54ea5fbd3d97 */
+
+ opt += 1;
+ opt_len -= 1;
+
+ char *val = grub_malloc (2 * opt_len + 4 + 1);
+ int i = 0;
+ int j = 0;
+ for (i = 0; i < opt_len; i++)
+ {
+ val[2 * i + j] = hexdigit (opt[i] >> 4);
+ val[2 * i + 1 + j] = hexdigit (opt[i] & 0xf);
+
+ if ((i == 3) || (i == 5) || (i == 7) || (i == 9))
+ {
+ if (taglength != 17)
+ break;
+
+ /* The format is 9cfe245e-d0c8-bd45-a79f-54ea5fbd3d97 */
+
+ ptr += 1;
+ taglength -= 1;
+
+ char *val = grub_malloc (2 * taglength + 4 + 1);
+ int i = 0;
+ int j = 0;
+ for (i = 0; i < taglength; i++)
+ {
+ val[2 * i + j] = hexdigit (ptr[i] >> 4);
+ val[2 * i + 1 + j] = hexdigit (ptr[i] & 0xf);
+
+ if ((i == 3) || (i == 5) || (i == 7) || (i == 9))
+ {
+ j++;
+ val[2 * i + 1+ j] = '-';
+ }
+ }
+
+ set_env_limn_ro (name, "clientuuid", (char *) val, 2 * taglength + 4);
+ j++;
+ val[2 * i + 1+ j] = '-';
+ }
+ break;
+ }
+ set_env_limn_ro (name, "clientuuid", (char *) val, 2 * opt_len + 4);
+ }
+
/* If you need any other options please contact GRUB
development team. */
}
@@ -302,14 +381,6 @@ grub_net_process_dhcp (struct grub_net_buff *nb,
/* We do not implement dead gateway detection and the first entry SHOULD
be preferred one */
opt = find_dhcp_option (bp, size, GRUB_NET_BOOTP_ROUTER, &opt_len);
@@ -631,14 +708,6 @@ grub_net_process_dhcp (struct grub_net_buff *nb,
}
}
@ -128,15 +126,18 @@ index 9e2fdb795f5..f03eeab2fb4 100644
grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)),
int argc, char **args)
diff --git a/include/grub/net.h b/include/grub/net.h
index 1096b24322e..e266bae23f4 100644
index 4a9069a..556c54e 100644
--- a/include/grub/net.h
+++ b/include/grub/net.h
@@ -457,6 +457,8 @@ enum
@@ -462,6 +462,8 @@ enum
GRUB_NET_BOOTP_DOMAIN = 0x0f,
GRUB_NET_BOOTP_ROOT_PATH = 0x11,
GRUB_NET_BOOTP_EXTENSIONS_PATH = 0x12,
+ GRUB_NET_BOOTP_CLIENT_ID = 0x3d,
+ GRUB_NET_BOOTP_CLIENT_UUID = 0x61,
GRUB_NET_BOOTP_END = 0xff
};
GRUB_NET_DHCP_REQUESTED_IP_ADDRESS = 50,
GRUB_NET_DHCP_OVERLOAD = 52,
GRUB_NET_DHCP_MESSAGE_TYPE = 53,
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 07241ef86e2d39264a89c5a3d789cb0cc9f41c81 Mon Sep 17 00:00:00 2001
From: Prarit Bhargava <prarit@redhat.com>
Date: Wed, 12 Mar 2014 10:58:16 -0400
Subject: [PATCH] Fix bad test on GRUB_DISABLE_SUBMENU.
Subject: [PATCH 020/220] Fix bad test on GRUB_DISABLE_SUBMENU.
The file /etc/grub.d/10_linux does
@ -20,7 +20,7 @@ Resolves: rhbz#1063414
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 61ebd7dc714..87a7da34982 100644
index 4532266..58defdb 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -261,7 +261,11 @@ while [ "x$list" != "x" ] ; do
@ -36,3 +36,6 @@ index 61ebd7dc714..87a7da34982 100644
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
--
1.8.3.1

View File

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Wed, 5 Feb 2014 09:42:42 -0200
Subject: [PATCH] trim arp packets with abnormal size
GRUB uses arp request to create the arp response. If the incoming packet
is foobared, GRUB needs to trim the arp response packet before sending it.
---
grub-core/net/arp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/grub-core/net/arp.c b/grub-core/net/arp.c
index 54306e3b16d..d1c69ed2b55 100644
--- a/grub-core/net/arp.c
+++ b/grub-core/net/arp.c
@@ -150,6 +150,12 @@ grub_net_arp_receive (struct grub_net_buff *nb, struct grub_net_card *card,
if (grub_net_addr_cmp (&inf->address, &target_addr) == 0
&& arp_packet->op == grub_cpu_to_be16_compile_time (ARP_REQUEST))
{
+ if ((nb->tail - nb->data) > 50)
+ {
+ grub_dprintf ("net", "arp packet with abnormal size (%ld bytes).\n",
+ nb->tail - nb->data);
+ nb->tail = nb->data + 50;
+ }
grub_net_link_level_address_t target;
struct grub_net_buff nb_reply;
struct arppkt *arp_reply;

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From bfa8c75e6921c3584538c7ecef354f7136133af3 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <matthew.garrett@nebula.com>
Date: Wed, 12 Jun 2013 11:51:49 -0400
Subject: [PATCH] Add support for UEFI operating systems returned by os-prober
Subject: [PATCH 021/220] Add support for UEFI operating systems returned by
os-prober
os-prober returns UEFI operating systems in the form:
@ -14,7 +15,7 @@ contrast to legacy OSes, where path is the device string. Handle this case.
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index 515a68c7aa0..9b8f5968e2d 100644
index 515a68c..9b8f596 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -328,8 +328,23 @@ EOF
@ -44,3 +45,6 @@ index 515a68c7aa0..9b8f5968e2d 100644
+ esac
esac
done
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From b29012d97aac59ab69aff7806cb012d6270706e2 Mon Sep 17 00:00:00 2001
From: Mark Hamzy <hamzy@us.ibm.com>
Date: Wed, 28 Mar 2012 14:46:41 -0500
Subject: [PATCH] Migrate PPC from Yaboot to Grub2
Subject: [PATCH 022/220] Migrate PPC from Yaboot to Grub2
Add configuration support for serial terminal consoles. This will set the
maximum screen size so that text is not overwritten.
@ -12,26 +12,26 @@ maximum screen size so that text is not overwritten.
create mode 100644 util/grub.d/20_ppc_terminfo.in
diff --git a/Makefile.util.def b/Makefile.util.def
index 3180ac880a9..c7b775bce73 100644
index 969d32f..8717774 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -487,6 +487,13 @@ script = {
condition = COND_HOST_LINUX;
@@ -497,6 +497,13 @@ script = {
};
+script = {
script = {
+ name = '20_ppc_terminfo';
+ common = util/grub.d/20_ppc_terminfo.in;
+ installdir = grubconf;
+ condition = COND_HOST_LINUX;
+};
+
script = {
+script = {
name = '30_os-prober';
common = util/grub.d/30_os-prober.in;
installdir = grubconf;
diff --git a/util/grub.d/20_ppc_terminfo.in b/util/grub.d/20_ppc_terminfo.in
new file mode 100644
index 00000000000..10d66586820
index 0000000..10d6658
--- /dev/null
+++ b/util/grub.d/20_ppc_terminfo.in
@@ -0,0 +1,114 @@
@ -149,3 +149,6 @@ index 00000000000..10d66586820
+cat << EOF
+ terminfo -g ${X}x${Y} ${TERMINAL}
+EOF
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 0a416bfa1cb5647bcba96513edf4f6c8b68c79ba Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Wed, 19 Sep 2012 21:22:55 -0300
Subject: [PATCH] Add fw_path variable (revised)
Subject: [PATCH 023/220] Add fw_path variable (revised)
This patch makes grub look for its config file on efi where the app was
found. It was originally written by Matthew Garrett, and adapted to fix the
@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=857936
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
index 9cad0c4485c..8ab7794c47b 100644
index 9cad0c4..8ab7794 100644
--- a/grub-core/kern/main.c
+++ b/grub-core/kern/main.c
@@ -127,16 +127,15 @@ grub_set_prefix_and_root (void)
@ -41,7 +41,7 @@ index 9cad0c4485c..8ab7794c47b 100644
}
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 249e19bc788..759c475c4d9 100644
index 222e239..394bfbe 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -338,7 +338,30 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
@ -59,7 +59,7 @@ index 249e19bc788..759c475c4d9 100644
+ {
+ grub_file_t file;
+
+ file = grub_file_open (config);
+ file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
+ if (file)
+ {
+ grub_file_close (file);
@ -76,3 +76,6 @@ index 249e19bc788..759c475c4d9 100644
prefix = grub_env_get ("prefix");
if (prefix)
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 98acf7f62203f6dda6e735743ce4e4f410d451e1 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 1 Oct 2012 13:24:37 -0400
Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested.
Subject: [PATCH 024/220] Pass "\x[[:hex:]][[:hex:]]" straight through
unmolested.
---
grub-core/commands/wildcard.c | 16 +++++++++++++++-
@ -10,7 +11,7 @@ Subject: [PATCH] Pass "\x[[:hex:]][[:hex:]]" straight through unmolested.
3 files changed, 84 insertions(+), 9 deletions(-)
diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c
index 9b4e72766ff..02c46f9fdfa 100644
index 4a106ca..560d437 100644
--- a/grub-core/commands/wildcard.c
+++ b/grub-core/commands/wildcard.c
@@ -462,6 +462,12 @@ check_file (const char *dir, const char *basename)
@ -44,7 +45,7 @@ index 9b4e72766ff..02c46f9fdfa 100644
*optr++ = iptr[1];
iptr += 2;
diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c
index d5e10ee8798..0a5b2afb94b 100644
index ed0b149..e0fb0a9 100644
--- a/grub-core/lib/cmdline.c
+++ b/grub-core/lib/cmdline.c
@@ -20,6 +20,12 @@
@ -75,7 +76,7 @@ index d5e10ee8798..0a5b2afb94b 100644
size++;
else if (*c == ' ')
space = 1;
@@ -85,7 +97,25 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf,
@@ -86,7 +98,25 @@ grub_create_loader_cmdline (int argc, char *argv[], char *buf,
while (*c)
{
@ -103,10 +104,10 @@ index d5e10ee8798..0a5b2afb94b 100644
*buf++ = *c;
diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c
index ab78ca87f90..cf6cd6601d6 100644
index 0d05d6b..ba38b5e 100644
--- a/grub-core/script/execute.c
+++ b/grub-core/script/execute.c
@@ -55,6 +55,12 @@ static struct grub_script_scope *scope = 0;
@@ -56,6 +56,12 @@ static struct grub_script_scope *scope = 0;
/* Wildcard translator for GRUB script. */
struct grub_script_wildcard_translator *grub_wildcard_translator;
@ -119,7 +120,7 @@ index ab78ca87f90..cf6cd6601d6 100644
static char*
wildcard_escape (const char *s)
{
@@ -71,7 +77,15 @@ wildcard_escape (const char *s)
@@ -72,7 +78,15 @@ wildcard_escape (const char *s)
i = 0;
while ((ch = *s++))
{
@ -136,7 +137,7 @@ index ab78ca87f90..cf6cd6601d6 100644
p[i++] = '\\';
p[i++] = ch;
}
@@ -95,7 +109,14 @@ wildcard_unescape (const char *s)
@@ -96,7 +110,14 @@ wildcard_unescape (const char *s)
i = 0;
while ((ch = *s++))
{
@ -152,7 +153,7 @@ index ab78ca87f90..cf6cd6601d6 100644
p[i++] = *s++;
else
p[i++] = ch;
@@ -397,10 +418,20 @@ parse_string (const char *str,
@@ -398,10 +419,20 @@ parse_string (const char *str,
switch (*ptr)
{
case '\\':
@ -177,3 +178,6 @@ index ab78ca87f90..cf6cd6601d6 100644
break;
case '$':
if (escaped)
--
1.8.3.1

View File

@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 29e1ec69b76c2e5d95cf339e60461f22cb0aeed6 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Tue, 27 Nov 2012 16:58:39 -0200
Subject: [PATCH] Add %X option to printf functions.
Subject: [PATCH 025/220] Add %X option to printf functions.
---
grub-core/kern/misc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 952411d5dc6..8344526be7f 100644
index cd63a8c..2656a67 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -588,7 +588,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r)
@ -53,3 +53,6 @@ index 952411d5dc6..8344526be7f 100644
case 'u':
case 'd':
{
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 0b390eb5dbd310c6c1a92e001b35981c90f27565 Mon Sep 17 00:00:00 2001
From: Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
Date: Tue, 27 Nov 2012 17:22:07 -0200
Subject: [PATCH] Search for specific config file for netboot
Subject: [PATCH 026/220] Search for specific config file for netboot
This patch implements a search for a specific configuration when the config
file is on a remoteserver. It uses the following order:
@ -22,7 +22,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=873406
3 files changed, 135 insertions(+), 4 deletions(-)
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 10773fc3435..0769bf850d3 100644
index d5d726a..0645456 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -1735,6 +1735,124 @@ grub_net_restore_hw (void)
@ -43,7 +43,7 @@ index 10773fc3435..0769bf850d3 100644
+ grub_dprintf ("net", "probe %s\n", config);
+
+ grub_file_t file;
+ file = grub_file_open (config);
+ file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
+
+ if (file)
+ {
@ -151,7 +151,7 @@ index 10773fc3435..0769bf850d3 100644
static grub_command_t cmd_addaddr, cmd_deladdr, cmd_addroute, cmd_delroute;
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 759c475c4d9..b2654ef62e8 100644
index 394bfbe..9ef9848 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -33,6 +33,7 @@
@ -187,10 +187,10 @@ index 759c475c4d9..b2654ef62e8 100644
grub_enter_normal_mode (config);
grub_free (config);
diff --git a/include/grub/net.h b/include/grub/net.h
index e266bae23f4..50d62ab0c8c 100644
index 556c54e..ff6d347 100644
--- a/include/grub/net.h
+++ b/include/grub/net.h
@@ -566,4 +566,7 @@ extern char *grub_net_default_server;
@@ -578,4 +578,7 @@ extern char *grub_net_default_server;
#define VLANTAG_IDENTIFIER 0x8100
@ -198,3 +198,6 @@ index e266bae23f4..50d62ab0c8c 100644
+grub_net_search_configfile (char *config);
+
#endif /* ! GRUB_NET_HEADER */
--
1.8.3.1

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 5c649924a8e4d233f922c21408eeeaac5b30bc73 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 14 Jan 2014 13:12:23 -0500
Subject: [PATCH] Add devicetree loading
Subject: [PATCH 028/220] Add devicetree loading
Signed-off-by: Peter Jones <pjones@redhat.com>
@ -20,7 +20,7 @@ Signed-off-by: David A. Marlin <dmarlin@redhat.com>
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index b0a8626dd1c..f68d4925ee6 100644
index 9ecbcfb..c645351 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -254,7 +254,8 @@ export GRUB_DEFAULT \
@ -34,23 +34,23 @@ index b0a8626dd1c..f68d4925ee6 100644
if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new"
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 87a7da34982..233754ff296 100644
index 58defdb..dd31284 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -153,6 +153,13 @@ EOF
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
@@ -155,6 +155,13 @@ EOF
initrd $(echo $initrd_path)
+EOF
+ fi
EOF
fi
+ if test -n "${fdt}" ; then
+ message="$(gettext_printf "Loading fdt ...")"
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$(echo "$message" | grub_quote)'
+ devicetree ${rel_dirname}/${fdt}
EOF
fi
+EOF
+ fi
sed "s/^/$submenu_indentation/" << EOF
}
EOF
@@ -236,6 +243,14 @@ while [ "x$list" != "x" ] ; do
gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
fi
@ -66,3 +66,6 @@ index 87a7da34982..233754ff296 100644
config=
for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${i}" ; then
--
1.8.3.1

View File

@ -1,248 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Tue, 22 Jan 2013 06:31:38 +0100
Subject: [PATCH] blscfg: add blscfg module to parse Boot Loader Specification
snippets
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
Works like this:
insmod blscfg
bls_import
Done! You should now have menu items for your snippets in place.
Signed-off-by: Peter Jones <grub2-owner@fedoraproject.org>
---
grub-core/Makefile.core.def | 8 ++
grub-core/commands/blscfg.c | 201 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 209 insertions(+)
create mode 100644 grub-core/commands/blscfg.c
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index f8065388213..cd0902b46b8 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -768,6 +768,14 @@ module = {
common = commands/blocklist.c;
};
+module = {
+ name = blscfg;
+ common = commands/blscfg.c;
+ enable = i386_efi;
+ enable = x86_64_efi;
+ enable = i386_pc;
+};
+
module = {
name = boot;
common = commands/boot.c;
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
new file mode 100644
index 00000000000..4274aca5a9d
--- /dev/null
+++ b/grub-core/commands/blscfg.c
@@ -0,0 +1,201 @@
+/*-*- Mode: C; c-basic-offset: 2; indent-tabs-mode: t -*-*/
+
+/* bls.c - implementation of the boot loader spec */
+
+/*
+ * GRUB -- GRand Unified Bootloader
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/types.h>
+#include <grub/misc.h>
+#include <grub/mm.h>
+#include <grub/err.h>
+#include <grub/dl.h>
+#include <grub/extcmd.h>
+#include <grub/i18n.h>
+#include <grub/fs.h>
+#include <grub/env.h>
+#include <grub/file.h>
+#include <grub/normal.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+#ifdef GRUB_MACHINE_EFI
+#define GRUB_LINUX_CMD "linuxefi"
+#define GRUB_INITRD_CMD "initrdefi"
+#define GRUB_BLS_CONFIG_PATH "/EFI/fedora/loader/entries/"
+#define GRUB_BOOT_DEVICE "($boot)"
+#else
+#define GRUB_LINUX_CMD "linux"
+#define GRUB_INITRD_CMD "initrd"
+#define GRUB_BLS_CONFIG_PATH "/loader/entries/"
+#define GRUB_BOOT_DEVICE "($root)"
+#endif
+
+static int parse_entry (
+ const char *filename,
+ const struct grub_dirhook_info *info __attribute__ ((unused)),
+ void *data __attribute__ ((unused)))
+{
+ grub_size_t n;
+ char *p;
+ grub_file_t f = NULL;
+ grub_off_t sz;
+ char *title = NULL, *options = NULL, *clinux = NULL, *initrd = NULL, *src = NULL;
+ const char *args[2] = { NULL, NULL };
+
+ if (filename[0] == '.')
+ return 0;
+
+ n = grub_strlen (filename);
+ if (n <= 5)
+ return 0;
+
+ if (grub_strcmp (filename + n - 5, ".conf") != 0)
+ return 0;
+
+ p = grub_xasprintf (GRUB_BLS_CONFIG_PATH "%s", filename);
+
+ f = grub_file_open (p);
+ if (!f)
+ goto finish;
+
+ sz = grub_file_size (f);
+ if (sz == GRUB_FILE_SIZE_UNKNOWN || sz > 1024*1024)
+ goto finish;
+
+ for (;;)
+ {
+ char *buf;
+
+ buf = grub_file_getline (f);
+ if (!buf)
+ break;
+
+ if (grub_strncmp (buf, "title ", 6) == 0)
+ {
+ grub_free (title);
+ title = grub_strdup (buf + 6);
+ if (!title)
+ goto finish;
+ }
+ else if (grub_strncmp (buf, "options ", 8) == 0)
+ {
+ grub_free (options);
+ options = grub_strdup (buf + 8);
+ if (!options)
+ goto finish;
+ }
+ else if (grub_strncmp (buf, "linux ", 6) == 0)
+ {
+ grub_free (clinux);
+ clinux = grub_strdup (buf + 6);
+ if (!clinux)
+ goto finish;
+ }
+ else if (grub_strncmp (buf, "initrd ", 7) == 0)
+ {
+ grub_free (initrd);
+ initrd = grub_strdup (buf + 7);
+ if (!initrd)
+ goto finish;
+ }
+
+ grub_free(buf);
+ }
+
+ if (!linux)
+ {
+ grub_printf ("Skipping file %s with no 'linux' key.", p);
+ goto finish;
+ }
+
+ args[0] = title ? title : filename;
+
+ src = grub_xasprintf ("load_video\n"
+ "set gfx_payload=keep\n"
+ "insmod gzio\n"
+ GRUB_LINUX_CMD " %s%s%s%s\n"
+ "%s%s%s%s",
+ GRUB_BOOT_DEVICE, clinux, options ? " " : "", options ? options : "",
+ initrd ? GRUB_INITRD_CMD " " : "", initrd ? GRUB_BOOT_DEVICE : "", initrd ? initrd : "", initrd ? "\n" : "");
+
+ grub_normal_add_menu_entry (1, args, NULL, NULL, "bls", NULL, NULL, src, 0);
+
+finish:
+ grub_free (p);
+ grub_free (title);
+ grub_free (options);
+ grub_free (clinux);
+ grub_free (initrd);
+ grub_free (src);
+
+ if (f)
+ grub_file_close (f);
+
+ return 0;
+}
+
+static grub_err_t
+grub_cmd_bls_import (grub_extcmd_context_t ctxt __attribute__ ((unused)),
+ int argc __attribute__ ((unused)),
+ char **args __attribute__ ((unused)))
+{
+ grub_fs_t fs;
+ grub_device_t dev;
+ static grub_err_t r;
+ const char *devid;
+
+ devid = grub_env_get ("root");
+ if (!devid)
+ return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "root");
+
+ dev = grub_device_open (devid);
+ if (!dev)
+ return grub_errno;
+
+ fs = grub_fs_probe (dev);
+ if (!fs)
+ {
+ r = grub_errno;
+ goto finish;
+ }
+
+ r = fs->dir (dev, GRUB_BLS_CONFIG_PATH, parse_entry, NULL);
+
+finish:
+ if (dev)
+ grub_device_close (dev);
+
+ return r;
+}
+
+static grub_extcmd_t cmd;
+
+GRUB_MOD_INIT(bls)
+{
+ cmd = grub_register_extcmd ("bls_import",
+ grub_cmd_bls_import,
+ 0,
+ NULL,
+ N_("Import Boot Loader Specification snippets."),
+ NULL);
+}
+
+GRUB_MOD_FINI(bls)
+{
+ grub_unregister_extcmd (cmd);
+}

View File

@ -1,21 +1,51 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 88cba3a10617ef55989762a4195599a399dca957 Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Wed, 15 May 2013 13:30:20 -0400
Subject: [PATCH] Don't write messages to the screen
Subject: [PATCH 029/220] Don't write messages to the screen
Writing messages to the screen before the menus or boot splash
happens so quickly it looks like something is wrong and isn't
very appealing.
---
grub-core/gettext/gettext.c | 25 +++++--------------------
grub-core/kern/main.c | 5 -----
grub-core/boot/i386/pc/boot.S | 3 ---
grub-core/boot/i386/pc/diskboot.S | 5 -----
grub-core/gettext/gettext.c | 25 +++++--------------------
grub-core/kern/main.c | 5 -----
util/grub.d/10_linux.in | 7 -------
5 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S
index 2bd0b2d..ea167fe 100644
--- a/grub-core/boot/i386/pc/boot.S
+++ b/grub-core/boot/i386/pc/boot.S
@@ -249,9 +249,6 @@ real_start:
/* save drive reference first thing! */
pushw %dx
- /* print a notification message on the screen */
- MSG(notification_string)
-
/* set %si to the disk address packet */
movw $disk_address_packet, %si
diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S
index c1addc0..68d31de 100644
--- a/grub-core/boot/i386/pc/diskboot.S
+++ b/grub-core/boot/i386/pc/diskboot.S
@@ -50,11 +50,6 @@ _start:
/* save drive reference first thing! */
pushw %dx
- /* print a notification message on the screen */
- pushw %si
- MSG(notification_string)
- popw %si
-
/* this sets up for the first run through "bootloop" */
movw $LOCAL(firstlist), %di
diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
index 4880cefe3f8..b22e1bcc94b 100644
index 4d02e62..84d520c 100644
--- a/grub-core/gettext/gettext.c
+++ b/grub-core/gettext/gettext.c
@@ -434,16 +434,12 @@ static char *
@ -97,7 +127,7 @@ index 4880cefe3f8..b22e1bcc94b 100644
grub_register_variable_hook ("locale_dir", NULL, read_main);
grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary);
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
index 8ab7794c47b..da47b18b50e 100644
index 8ab7794..da47b18 100644
--- a/grub-core/kern/main.c
+++ b/grub-core/kern/main.c
@@ -268,11 +268,6 @@ grub_main (void)
@ -112,38 +142,8 @@ index 8ab7794c47b..da47b18b50e 100644
grub_load_config ();
grub_boot_time ("Before loading embedded modules.");
diff --git a/grub-core/boot/i386/pc/boot.S b/grub-core/boot/i386/pc/boot.S
index 2bd0b2d2866..ea167fe1206 100644
--- a/grub-core/boot/i386/pc/boot.S
+++ b/grub-core/boot/i386/pc/boot.S
@@ -249,9 +249,6 @@ real_start:
/* save drive reference first thing! */
pushw %dx
- /* print a notification message on the screen */
- MSG(notification_string)
-
/* set %si to the disk address packet */
movw $disk_address_packet, %si
diff --git a/grub-core/boot/i386/pc/diskboot.S b/grub-core/boot/i386/pc/diskboot.S
index c1addc0df29..68d31de0c4c 100644
--- a/grub-core/boot/i386/pc/diskboot.S
+++ b/grub-core/boot/i386/pc/diskboot.S
@@ -50,11 +50,6 @@ _start:
/* save drive reference first thing! */
pushw %dx
- /* print a notification message on the screen */
- pushw %si
- MSG(notification_string)
- popw %si
-
/* this sets up for the first run through "bootloop" */
movw $LOCAL(firstlist), %di
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 233754ff296..3a5aa0f8dc9 100644
index dd31284..ceb413f 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -138,27 +138,20 @@ linux_entry ()
@ -174,3 +174,6 @@ index 233754ff296..3a5aa0f8dc9 100644
devicetree ${rel_dirname}/${fdt}
EOF
fi
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 9af19d1f8184aad31b3094768a64722316d4f0da Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Wed, 15 May 2013 13:53:48 -0400
Subject: [PATCH] Don't print GNU GRUB header
Subject: [PATCH 030/220] Don't print GNU GRUB header
No one cares.
---
@ -9,10 +9,10 @@ No one cares.
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index b2654ef62e8..f57b7508a76 100644
index a326b19..09d0dfe 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -202,15 +202,16 @@ read_config_file (const char *config)
@@ -208,15 +208,16 @@ read_config_file (const char *config)
/* Initialize the screen. */
void
grub_normal_init_page (struct grub_term_output *term,
@ -32,7 +32,7 @@ index b2654ef62e8..f57b7508a76 100644
msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
if (!msg_formatted)
@@ -235,6 +236,7 @@ grub_normal_init_page (struct grub_term_output *term,
@@ -241,6 +242,7 @@ grub_normal_init_page (struct grub_term_output *term,
grub_putcode ('\n', term);
grub_putcode ('\n', term);
grub_free (unicode_msg);
@ -40,3 +40,6 @@ index b2654ef62e8..f57b7508a76 100644
}
static void
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From fc5204f8800ecfa4f00fab8ab8cd2720a6d5b55e Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Wed, 15 May 2013 17:49:45 -0400
Subject: [PATCH] Don't add '*' to highlighted row
Subject: [PATCH 031/220] Don't add '*' to highlighted row
It is already highlighted.
---
@ -9,7 +9,7 @@ It is already highlighted.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index e22bb91f6e8..a3d1f23f68f 100644
index e22bb91..a3d1f23 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -242,7 +242,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry,
@ -21,3 +21,6 @@ index e22bb91f6e8..a3d1f23f68f 100644
grub_print_ucs4_menu (unicode_title,
unicode_title + len,
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From cc62054bce6fc5f00f4e302d8fa7615d263f1f5b Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 11:09:04 -0400
Subject: [PATCH] Message string cleanups
Subject: [PATCH 032/220] Message string cleanups
Make use of terminology consistent. Remove jargon.
---
@ -9,7 +9,7 @@ Make use of terminology consistent. Remove jargon.
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index a3d1f23f68f..64a83862f66 100644
index a3d1f23..64a8386 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -157,9 +157,8 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run)
@ -66,3 +66,6 @@ index a3d1f23f68f..64a83862f66 100644
if (!msg_translated)
{
grub_print_error ();
--
1.8.3.1

View File

@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 9330deb86a791da573563dc319e1874af72eb97c Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 14:08:23 -0400
Subject: [PATCH] Fix border spacing now that we aren't displaying it
Subject: [PATCH 033/220] Fix border spacing now that we aren't displaying it
---
grub-core/normal/menu_text.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 64a83862f66..1062d64ee29 100644
index 64a8386..1062d64 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -331,12 +331,12 @@ grub_menu_init_page (int nested, int edit,
@ -27,3 +27,6 @@ index 64a83862f66..1062d64ee29 100644
geo->timeout_lines = 2;
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 5e6cef121ba76d88608e6c124ff60e73cf057fe4 Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 14:08:49 -0400
Subject: [PATCH] Use the correct indentation for the term help text
Subject: [PATCH 034/220] Use the correct indentation for the term help text
That is consistent with the menu help text
---
@ -9,10 +9,10 @@ That is consistent with the menu help text
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index f57b7508a76..0ce59fdc3f0 100644
index 09d0dfe..7f61c5b 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -426,8 +426,8 @@ grub_normal_reader_init (int nested)
@@ -432,8 +432,8 @@ grub_normal_reader_init (int nested)
grub_normal_init_page (term, 1);
grub_term_setcursor (term, 1);
@ -23,3 +23,6 @@ index f57b7508a76..0ce59fdc3f0 100644
else
grub_print_message_indented (msg_formatted, 0, 0, term);
grub_putcode ('\n', term);
--
1.8.3.1

View File

@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 7d70ca36c17e14361284f986e4c62e6523bf6b98 Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 14:30:55 -0400
Subject: [PATCH] Indent menu entries
Subject: [PATCH 035/220] Indent menu entries
---
grub-core/normal/menu_text.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 1062d64ee29..ecc60f99fc3 100644
index 1062d64..ecc60f9 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -239,7 +239,8 @@ print_entry (int y, int highlight, grub_menu_entry_t entry,
@ -21,3 +21,6 @@ index 1062d64ee29..ecc60f99fc3 100644
grub_print_ucs4_menu (unicode_title,
unicode_title + len,
--
1.8.3.1

View File

@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 61f83fac37fb9bacac50f75e0aa7d304bfabf410 Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 14:59:36 -0400
Subject: [PATCH] Fix margins
Subject: [PATCH 036/220] Fix margins
---
grub-core/normal/menu_text.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index ecc60f99fc3..0e43f2c10cc 100644
index ecc60f9..0e43f2c 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -333,17 +333,15 @@ grub_menu_init_page (int nested, int edit,
@ -32,3 +32,6 @@ index ecc60f99fc3..0e43f2c10cc 100644
- 1 /* empty line before info message*/
- geo->timeout_lines /* timeout */
- 1 /* empty final line */;
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 10fe905b3b3364436fe5328724b21def775aec60 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 21 Jun 2013 14:44:08 -0400
Subject: [PATCH] Use -2 instead of -1 for our right-hand margin, so
Subject: [PATCH 037/220] Use -2 instead of -1 for our right-hand margin, so
linewrapping works (#976643).
Signed-off-by: Peter Jones <grub2-owner@fedoraproject.org>
@ -10,7 +10,7 @@ Signed-off-by: Peter Jones <grub2-owner@fedoraproject.org>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 0e43f2c10cc..537d4bf86ff 100644
index 0e43f2c..537d4bf 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -334,7 +334,7 @@ grub_menu_init_page (int nested, int edit,
@ -22,3 +22,6 @@ index 0e43f2c10cc..537d4bf86ff 100644
geo->first_entry_y = 3; /* three empty lines*/
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 29aa9344700bc787778391d6176c2b3b220838e6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 28 Oct 2013 10:09:27 -0400
Subject: [PATCH] Enable pager by default. (#985860)
Subject: [PATCH 038/220] Enable pager by default. (#985860)
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 2 insertions(+)
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 93a90233ead..858b526c925 100644
index 93a9023..858b526 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -43,6 +43,8 @@ if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_
@ -21,3 +21,6 @@ index 93a90233ead..858b526c925 100644
if [ -s \$prefix/grubenv ]; then
load_env
fi
--
1.8.3.1

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 72ffa52429b18c75f461c5dfa339c05b4bed2788 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 28 Oct 2013 10:13:27 -0400
Subject: [PATCH] F10 doesn't work on serial, so don't tell the user to hit it
(#987443)
Subject: [PATCH 039/220] F10 doesn't work on serial, so don't tell the user to
hit it (#987443)
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -10,7 +10,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 537d4bf86ff..452d55bf9ff 100644
index 537d4bf..452d55b 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -157,7 +157,7 @@ print_message (int nested, int edit, struct grub_term_output *term, int dry_run)
@ -22,3 +22,6 @@ index 537d4bf86ff..452d55bf9ff 100644
command prompt or Escape to discard edits and return to the menu. Pressing Tab lists possible completions."),
STANDARD_MARGIN, STANDARD_MARGIN,
term, dry_run);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From b2d841ee307560bbc0a3c4fe4a5516fb8e00dd65 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 14 Mar 2011 14:27:42 -0400
Subject: [PATCH] Don't say "GNU/Linux" in generated menus.
Subject: [PATCH 040/220] Don't say "GNU/Linux" in generated menus.
---
util/grub.d/10_linux.in | 4 ++--
@ -9,7 +9,7 @@ Subject: [PATCH] Don't say "GNU/Linux" in generated menus.
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 3a5aa0f8dc9..6299836b5cd 100644
index ceb413f..2b402d8 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@"
@ -25,7 +25,7 @@ index 3a5aa0f8dc9..6299836b5cd 100644
fi
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index e8143b079dc..972a4b5a03d 100644
index 96179ea..47e0d3f 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -29,9 +29,9 @@ export TEXTDOMAINDIR="@localedir@"
@ -40,3 +40,6 @@ index e8143b079dc..972a4b5a03d 100644
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 6d92979792752de9af962a75f399768c655ce92e Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Wed, 15 May 2013 16:47:33 -0400
Subject: [PATCH] Don't draw a border around the menu
Subject: [PATCH 041/220] Don't draw a border around the menu
It looks cleaner without it.
---
@ -9,7 +9,7 @@ It looks cleaner without it.
1 file changed, 43 deletions(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 452d55bf9ff..1ed2bd92cf8 100644
index 452d55b..1ed2bd9 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -108,47 +108,6 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right,
@ -69,3 +69,6 @@ index 452d55bf9ff..1ed2bd92cf8 100644
grub_term_normal_color = old_color_normal;
grub_term_highlight_color = old_color_highlight;
geo->timeout_y = geo->first_entry_y + geo->num_entries
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From ead897508b29261ccf87aa46e778863a351737b2 Mon Sep 17 00:00:00 2001
From: William Jon McCann <william.jon.mccann@gmail.com>
Date: Fri, 7 Jun 2013 10:52:32 -0400
Subject: [PATCH] Use the standard margin for the timeout string
Subject: [PATCH 042/220] Use the standard margin for the timeout string
So that it aligns with the other messages
---
@ -9,7 +9,7 @@ So that it aligns with the other messages
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
index 1ed2bd92cf8..7681f7d2893 100644
index 1ed2bd9..7681f7d 100644
--- a/grub-core/normal/menu_text.c
+++ b/grub-core/normal/menu_text.c
@@ -372,7 +372,7 @@ grub_menu_init_page (int nested, int edit,
@ -38,3 +38,6 @@ index 1ed2bd92cf8..7681f7d2893 100644
}
}
--
1.8.3.1

View File

@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From dcfc32257387a45d41600d52f2393fee402b7271 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Mon, 13 Jan 2014 21:50:59 -0500
Subject: [PATCH] Add .eh_frame to list of relocations stripped
Subject: [PATCH 043/220] Add .eh_frame to list of relocations stripped
---
conf/Makefile.common | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/conf/Makefile.common b/conf/Makefile.common
index 311da61c6c5..044ab3abe88 100644
index 6cd71cb..4ba729e 100644
--- a/conf/Makefile.common
+++ b/conf/Makefile.common
@@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding
@ -20,3 +20,6 @@ index 311da61c6c5..044ab3abe88 100644
CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding
LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d
--
1.8.3.1

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 6fa778275c0765f9d2535118ba0a37065dded86f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 30 Jun 2014 14:16:46 -0400
Subject: [PATCH] Don't munge raw spaces when we're doing our cmdline escaping
(#923374)
Subject: [PATCH 044/220] Don't munge raw spaces when we're doing our cmdline
escaping (#923374)
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -10,10 +10,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c
index 0a5b2afb94b..970ea868c14 100644
index e0fb0a9..8e2294d 100644
--- a/grub-core/lib/cmdline.c
+++ b/grub-core/lib/cmdline.c
@@ -97,16 +97,7 @@ int grub_create_loader_cmdline (int argc, char *argv[], char *buf,
@@ -98,16 +98,7 @@ grub_create_loader_cmdline (int argc, char *argv[], char *buf,
while (*c)
{
@ -31,3 +31,6 @@ index 0a5b2afb94b..970ea868c14 100644
is_hex(*(c+2)) && is_hex(*(c+3)))
{
*buf++ = *c++;
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 226cdd8a7722f5e1a60f21c5a2aea74f458d612d Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 11 Feb 2014 11:14:50 -0500
Subject: [PATCH] Don't require a password to boot entries generated by
Subject: [PATCH 045/220] Don't require a password to boot entries generated by
grub-mkconfig.
When we set a password, we just want that to mean you can't /edit/ an entry.
@ -14,7 +14,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 6299836b5cd..b744438e04a 100644
index 2b402d8..d35b0f4 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -26,7 +26,7 @@ datarootdir="@datarootdir@"
@ -26,3 +26,6 @@ index 6299836b5cd..b744438e04a 100644
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS="$(sed 's, release .*$,,g' /etc/system-release)"
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From a71ee9f8f976cc09c301c8c1ceb8ca0859880130 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 18 Feb 2014 09:37:49 -0500
Subject: [PATCH] Don't emit "Booting ..." message.
Subject: [PATCH 046/220] Don't emit "Booting ..." message.
UI team still hates this stuff, so we're disabling it for RHEL 7.
@ -14,10 +14,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index d2f64b05e0a..5e2f5283d3d 100644
index 9175ad2..783bde5 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -838,12 +838,14 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
@@ -839,12 +839,14 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
/* Callback invoked immediately before a menu entry is executed. */
static void
@ -34,7 +34,7 @@ index d2f64b05e0a..5e2f5283d3d 100644
/* Callback invoked when a default menu entry executed because of a timeout
diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c
index cdf3590a364..5785f67ee1c 100644
index cdf3590..5785f67 100644
--- a/grub-core/normal/menu_entry.c
+++ b/grub-core/normal/menu_entry.c
@@ -1167,9 +1167,6 @@ run (struct screen *screen)
@ -47,3 +47,6 @@ index cdf3590a364..5785f67ee1c 100644
errs_before = grub_err_printed_errors;
--
1.8.3.1

View File

@ -1,12 +1,12 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 4e27eb84b310a600b89481245735a7b053f2250c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 4 Mar 2014 11:00:23 -0500
Subject: [PATCH] Replace a lot of man pages with slightly nicer ones.
Subject: [PATCH 047/220] Replace a lot of man pages with slightly nicer ones.
Replace a bunch of machine generated ones with ones that look nicer.
---
configure.ac | 23 ++++++
conf/Makefile.extra-dist | 1 -
configure.ac | 23 ++++++
docs/Makefile.am | 2 -
docs/man/grub-bios-setup.h2m | 6 --
docs/man/grub-editenv.h2m | 5 --
@ -121,11 +121,23 @@ Replace a bunch of machine generated ones with ones that look nicer.
create mode 100644 util/grub-set-default.8
create mode 100644 util/grub-sparc64-setup.8
diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
index 46c4e95..58d7d95 100644
--- a/conf/Makefile.extra-dist
+++ b/conf/Makefile.extra-dist
@@ -11,7 +11,6 @@ EXTRA_DIST += unicode
EXTRA_DIST += util/import_gcry.py
EXTRA_DIST += util/import_unicode.py
-EXTRA_DIST += docs/man
EXTRA_DIST += docs/autoiso.cfg
EXTRA_DIST += docs/grub.cfg
EXTRA_DIST += docs/osdetect.cfg
diff --git a/configure.ac b/configure.ac
index 783118ccdcd..d5db2803ec4 100644
index d283af6..8df400e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,29 @@ grub_TRANSFORM([grub-set-default])
@@ -74,6 +74,29 @@ grub_TRANSFORM([grub-set-default])
grub_TRANSFORM([grub-sparc64-setup])
grub_TRANSFORM([grub-render-label])
grub_TRANSFORM([grub-file])
@ -155,20 +167,8 @@ index 783118ccdcd..d5db2803ec4 100644
# Optimization flag. Allow user to override.
if test "x$TARGET_CFLAGS" = x; then
diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
index b16bd925320..39eb94bded6 100644
--- a/conf/Makefile.extra-dist
+++ b/conf/Makefile.extra-dist
@@ -11,7 +11,6 @@ EXTRA_DIST += unicode
EXTRA_DIST += util/import_gcry.py
EXTRA_DIST += util/import_unicode.py
-EXTRA_DIST += docs/man
EXTRA_DIST += docs/autoiso.cfg
EXTRA_DIST += docs/grub.cfg
EXTRA_DIST += docs/osdetect.cfg
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 93eb3962765..ab28f199694 100644
index 93eb396..ab28f19 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -5,5 +5,3 @@ info_TEXINFOS = grub.texi grub-dev.texi
@ -179,7 +179,7 @@ index 93eb3962765..ab28f199694 100644
-
diff --git a/docs/man/grub-bios-setup.h2m b/docs/man/grub-bios-setup.h2m
deleted file mode 100644
index ac6ede36296..00000000000
index ac6ede3..0000000
--- a/docs/man/grub-bios-setup.h2m
+++ /dev/null
@@ -1,6 +0,0 @@
@ -191,7 +191,7 @@ index ac6ede36296..00000000000
-.BR grub-mkrescue (1)
diff --git a/docs/man/grub-editenv.h2m b/docs/man/grub-editenv.h2m
deleted file mode 100644
index 3859d3d4c4f..00000000000
index 3859d3d..0000000
--- a/docs/man/grub-editenv.h2m
+++ /dev/null
@@ -1,5 +0,0 @@
@ -202,7 +202,7 @@ index 3859d3d4c4f..00000000000
-.BR grub-set-default (8)
diff --git a/docs/man/grub-emu.h2m b/docs/man/grub-emu.h2m
deleted file mode 100644
index ef1c000656a..00000000000
index ef1c000..0000000
--- a/docs/man/grub-emu.h2m
+++ /dev/null
@@ -1,6 +0,0 @@
@ -214,7 +214,7 @@ index ef1c000656a..00000000000
-rather than this program.
diff --git a/docs/man/grub-file.h2m b/docs/man/grub-file.h2m
deleted file mode 100644
index e09bb4d3101..00000000000
index e09bb4d..0000000
--- a/docs/man/grub-file.h2m
+++ /dev/null
@@ -1,2 +0,0 @@
@ -222,7 +222,7 @@ index e09bb4d3101..00000000000
-grub-file \- check file type
diff --git a/docs/man/grub-fstest.h2m b/docs/man/grub-fstest.h2m
deleted file mode 100644
index 9676b159afd..00000000000
index 9676b15..0000000
--- a/docs/man/grub-fstest.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -232,7 +232,7 @@ index 9676b159afd..00000000000
-.BR grub-probe (8)
diff --git a/docs/man/grub-glue-efi.h2m b/docs/man/grub-glue-efi.h2m
deleted file mode 100644
index c1c6ded49ff..00000000000
index c1c6ded..0000000
--- a/docs/man/grub-glue-efi.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -242,7 +242,7 @@ index c1c6ded49ff..00000000000
-grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format.
diff --git a/docs/man/grub-install.h2m b/docs/man/grub-install.h2m
deleted file mode 100644
index 8cbbc87a0f2..00000000000
index 8cbbc87..0000000
--- a/docs/man/grub-install.h2m
+++ /dev/null
@@ -1,6 +0,0 @@
@ -254,7 +254,7 @@ index 8cbbc87a0f2..00000000000
-.BR grub-mkrescue (1)
diff --git a/docs/man/grub-kbdcomp.h2m b/docs/man/grub-kbdcomp.h2m
deleted file mode 100644
index d81f9157e01..00000000000
index d81f915..0000000
--- a/docs/man/grub-kbdcomp.h2m
+++ /dev/null
@@ -1,10 +0,0 @@
@ -270,7 +270,7 @@ index d81f9157e01..00000000000
-.BR grub-mklayout (8)
diff --git a/docs/man/grub-macbless.h2m b/docs/man/grub-macbless.h2m
deleted file mode 100644
index 0197c0087d7..00000000000
index 0197c00..0000000
--- a/docs/man/grub-macbless.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -280,7 +280,7 @@ index 0197c0087d7..00000000000
-.BR grub-install (1)
diff --git a/docs/man/grub-macho2img.h2m b/docs/man/grub-macho2img.h2m
deleted file mode 100644
index d79aaeed8f9..00000000000
index d79aaee..0000000
--- a/docs/man/grub-macho2img.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -290,7 +290,7 @@ index d79aaeed8f9..00000000000
-.BR grub-mkimage (1)
diff --git a/docs/man/grub-menulst2cfg.h2m b/docs/man/grub-menulst2cfg.h2m
deleted file mode 100644
index c2e0055ed7e..00000000000
index c2e0055..0000000
--- a/docs/man/grub-menulst2cfg.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -300,7 +300,7 @@ index c2e0055ed7e..00000000000
-.BR grub-mkconfig (8)
diff --git a/docs/man/grub-mkconfig.h2m b/docs/man/grub-mkconfig.h2m
deleted file mode 100644
index 9b42f813010..00000000000
index 9b42f81..0000000
--- a/docs/man/grub-mkconfig.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -310,7 +310,7 @@ index 9b42f813010..00000000000
-.BR grub-install (8)
diff --git a/docs/man/grub-mkfont.h2m b/docs/man/grub-mkfont.h2m
deleted file mode 100644
index d46fe600eca..00000000000
index d46fe60..0000000
--- a/docs/man/grub-mkfont.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -320,7 +320,7 @@ index d46fe600eca..00000000000
-.BR grub-mkconfig (8)
diff --git a/docs/man/grub-mkimage.h2m b/docs/man/grub-mkimage.h2m
deleted file mode 100644
index f0fbc2bb197..00000000000
index f0fbc2b..0000000
--- a/docs/man/grub-mkimage.h2m
+++ /dev/null
@@ -1,6 +0,0 @@
@ -332,7 +332,7 @@ index f0fbc2bb197..00000000000
-.BR grub-mknetdir (8)
diff --git a/docs/man/grub-mklayout.h2m b/docs/man/grub-mklayout.h2m
deleted file mode 100644
index 1e43409c0ab..00000000000
index 1e43409..0000000
--- a/docs/man/grub-mklayout.h2m
+++ /dev/null
@@ -1,10 +0,0 @@
@ -348,7 +348,7 @@ index 1e43409c0ab..00000000000
-.BR grub-mkconfig (8)
diff --git a/docs/man/grub-mknetdir.h2m b/docs/man/grub-mknetdir.h2m
deleted file mode 100644
index a2ef13ec111..00000000000
index a2ef13e..0000000
--- a/docs/man/grub-mknetdir.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -358,7 +358,7 @@ index a2ef13ec111..00000000000
-.BR grub-mkimage (1)
diff --git a/docs/man/grub-mkpasswd-pbkdf2.h2m b/docs/man/grub-mkpasswd-pbkdf2.h2m
deleted file mode 100644
index 4d202f3da7e..00000000000
index 4d202f3..0000000
--- a/docs/man/grub-mkpasswd-pbkdf2.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -368,7 +368,7 @@ index 4d202f3da7e..00000000000
-.BR grub-mkconfig (8)
diff --git a/docs/man/grub-mkrelpath.h2m b/docs/man/grub-mkrelpath.h2m
deleted file mode 100644
index d01f3961e3f..00000000000
index d01f396..0000000
--- a/docs/man/grub-mkrelpath.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -378,7 +378,7 @@ index d01f3961e3f..00000000000
-.BR grub-probe (8)
diff --git a/docs/man/grub-mkrescue.h2m b/docs/man/grub-mkrescue.h2m
deleted file mode 100644
index a427f02e3c6..00000000000
index a427f02..0000000
--- a/docs/man/grub-mkrescue.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -388,7 +388,7 @@ index a427f02e3c6..00000000000
-.BR grub-mkimage (1)
diff --git a/docs/man/grub-mkstandalone.h2m b/docs/man/grub-mkstandalone.h2m
deleted file mode 100644
index c77313978ad..00000000000
index c773139..0000000
--- a/docs/man/grub-mkstandalone.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -398,7 +398,7 @@ index c77313978ad..00000000000
-.BR grub-mkimage (1)
diff --git a/docs/man/grub-mount.h2m b/docs/man/grub-mount.h2m
deleted file mode 100644
index 8d168982d72..00000000000
index 8d16898..0000000
--- a/docs/man/grub-mount.h2m
+++ /dev/null
@@ -1,2 +0,0 @@
@ -406,7 +406,7 @@ index 8d168982d72..00000000000
-grub-mount \- export GRUB filesystem with FUSE
diff --git a/docs/man/grub-ofpathname.h2m b/docs/man/grub-ofpathname.h2m
deleted file mode 100644
index 74b43eea039..00000000000
index 74b43ee..0000000
--- a/docs/man/grub-ofpathname.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -416,7 +416,7 @@ index 74b43eea039..00000000000
-.BR grub-probe (8)
diff --git a/docs/man/grub-pe2elf.h2m b/docs/man/grub-pe2elf.h2m
deleted file mode 100644
index 7ca29bd703c..00000000000
index 7ca29bd..0000000
--- a/docs/man/grub-pe2elf.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -426,7 +426,7 @@ index 7ca29bd703c..00000000000
-.BR grub-mkimage (1)
diff --git a/docs/man/grub-probe.h2m b/docs/man/grub-probe.h2m
deleted file mode 100644
index 6e1ffdcf937..00000000000
index 6e1ffdc..0000000
--- a/docs/man/grub-probe.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -436,7 +436,7 @@ index 6e1ffdcf937..00000000000
-.BR grub-fstest (1)
diff --git a/docs/man/grub-reboot.h2m b/docs/man/grub-reboot.h2m
deleted file mode 100644
index e4acace65ce..00000000000
index e4acace..0000000
--- a/docs/man/grub-reboot.h2m
+++ /dev/null
@@ -1,5 +0,0 @@
@ -447,7 +447,7 @@ index e4acace65ce..00000000000
-.BR grub-editenv (1)
diff --git a/docs/man/grub-render-label.h2m b/docs/man/grub-render-label.h2m
deleted file mode 100644
index 50ae5247c05..00000000000
index 50ae524..0000000
--- a/docs/man/grub-render-label.h2m
+++ /dev/null
@@ -1,3 +0,0 @@
@ -456,7 +456,7 @@ index 50ae5247c05..00000000000
-
diff --git a/docs/man/grub-script-check.h2m b/docs/man/grub-script-check.h2m
deleted file mode 100644
index 3653682671a..00000000000
index 3653682..0000000
--- a/docs/man/grub-script-check.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -466,7 +466,7 @@ index 3653682671a..00000000000
-.BR grub-mkconfig (8)
diff --git a/docs/man/grub-set-default.h2m b/docs/man/grub-set-default.h2m
deleted file mode 100644
index 7945001c154..00000000000
index 7945001..0000000
--- a/docs/man/grub-set-default.h2m
+++ /dev/null
@@ -1,5 +0,0 @@
@ -477,7 +477,7 @@ index 7945001c154..00000000000
-.BR grub-editenv (1)
diff --git a/docs/man/grub-sparc64-setup.h2m b/docs/man/grub-sparc64-setup.h2m
deleted file mode 100644
index 18f803a50db..00000000000
index 18f803a..0000000
--- a/docs/man/grub-sparc64-setup.h2m
+++ /dev/null
@@ -1,6 +0,0 @@
@ -489,7 +489,7 @@ index 18f803a50db..00000000000
-.BR grub-mkrescue (1)
diff --git a/docs/man/grub-syslinux2cfg.h2m b/docs/man/grub-syslinux2cfg.h2m
deleted file mode 100644
index ad25c8ab753..00000000000
index ad25c8a..0000000
--- a/docs/man/grub-syslinux2cfg.h2m
+++ /dev/null
@@ -1,4 +0,0 @@
@ -498,10 +498,10 @@ index ad25c8ab753..00000000000
-[SEE ALSO]
-.BR grub-menulst2cfg (8)
diff --git a/gentpl.py b/gentpl.py
index da67965a41a..bf8439fa743 100644
index 387588c..f05812e 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -802,10 +802,7 @@ def manpage(defn, adddeps):
@@ -805,10 +805,7 @@ def manpage(defn, adddeps):
output("if COND_MAN_PAGES\n")
gvar_add("man_MANS", name + "." + mansection)
@ -515,7 +515,7 @@ index da67965a41a..bf8439fa743 100644
diff --git a/util/grub-bios-setup.8 b/util/grub-bios-setup.8
new file mode 100644
index 00000000000..56f582b3d75
index 0000000..56f582b
--- /dev/null
+++ b/util/grub-bios-setup.8
@@ -0,0 +1,54 @@
@ -575,7 +575,7 @@ index 00000000000..56f582b3d75
+.BR "info grub"
diff --git a/util/grub-editenv.1 b/util/grub-editenv.1
new file mode 100644
index 00000000000..d28ba03ba42
index 0000000..d28ba03
--- /dev/null
+++ b/util/grub-editenv.1
@@ -0,0 +1,46 @@
@ -627,7 +627,7 @@ index 00000000000..d28ba03ba42
+.BR "info grub"
diff --git a/util/grub-file.1 b/util/grub-file.1
new file mode 100644
index 00000000000..b29cb327889
index 0000000..b29cb32
--- /dev/null
+++ b/util/grub-file.1
@@ -0,0 +1,165 @@
@ -798,7 +798,7 @@ index 00000000000..b29cb327889
+.BR "info grub"
diff --git a/util/grub-fstest.1 b/util/grub-fstest.1
new file mode 100644
index 00000000000..792fa78634c
index 0000000..792fa78
--- /dev/null
+++ b/util/grub-fstest.1
@@ -0,0 +1,99 @@
@ -903,7 +903,7 @@ index 00000000000..792fa78634c
+.BR "info grub"
diff --git a/util/grub-glue-efi.1 b/util/grub-glue-efi.1
new file mode 100644
index 00000000000..72bd555d577
index 0000000..72bd555
--- /dev/null
+++ b/util/grub-glue-efi.1
@@ -0,0 +1,31 @@
@ -940,7 +940,7 @@ index 00000000000..72bd555d577
+.BR "info grub"
diff --git a/util/grub-install.8 b/util/grub-install.8
new file mode 100644
index 00000000000..76272a39d2e
index 0000000..76272a3
--- /dev/null
+++ b/util/grub-install.8
@@ -0,0 +1,129 @@
@ -1075,7 +1075,7 @@ index 00000000000..76272a39d2e
+.BR "info grub"
diff --git a/util/grub-kbdcomp.1 b/util/grub-kbdcomp.1
new file mode 100644
index 00000000000..0bb969a5b43
index 0000000..0bb969a
--- /dev/null
+++ b/util/grub-kbdcomp.1
@@ -0,0 +1,19 @@
@ -1100,7 +1100,7 @@ index 00000000000..0bb969a5b43
+.BR "info grub"
diff --git a/util/grub-macbless.1 b/util/grub-macbless.1
new file mode 100644
index 00000000000..41a96186f70
index 0000000..41a9618
--- /dev/null
+++ b/util/grub-macbless.1
@@ -0,0 +1,22 @@
@ -1128,7 +1128,7 @@ index 00000000000..41a96186f70
+.BR "info grub"
diff --git a/util/grub-menulst2cfg.1 b/util/grub-menulst2cfg.1
new file mode 100644
index 00000000000..91e2ef87113
index 0000000..91e2ef8
--- /dev/null
+++ b/util/grub-menulst2cfg.1
@@ -0,0 +1,12 @@
@ -1146,7 +1146,7 @@ index 00000000000..91e2ef87113
+.BR "info grub"
diff --git a/util/grub-mkconfig.8 b/util/grub-mkconfig.8
new file mode 100644
index 00000000000..a2d1f577b9b
index 0000000..a2d1f57
--- /dev/null
+++ b/util/grub-mkconfig.8
@@ -0,0 +1,17 @@
@ -1169,7 +1169,7 @@ index 00000000000..a2d1f577b9b
+.BR "info grub"
diff --git a/util/grub-mkfont.1 b/util/grub-mkfont.1
new file mode 100644
index 00000000000..3494857987d
index 0000000..3494857
--- /dev/null
+++ b/util/grub-mkfont.1
@@ -0,0 +1,87 @@
@ -1262,7 +1262,7 @@ index 00000000000..3494857987d
+.BR "info grub"
diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1
new file mode 100644
index 00000000000..4dea4f54597
index 0000000..4dea4f5
--- /dev/null
+++ b/util/grub-mkimage.1
@@ -0,0 +1,95 @@
@ -1363,7 +1363,7 @@ index 00000000000..4dea4f54597
+.BR "info grub"
diff --git a/util/grub-mklayout.1 b/util/grub-mklayout.1
new file mode 100644
index 00000000000..d1bbc2ec515
index 0000000..d1bbc2e
--- /dev/null
+++ b/util/grub-mklayout.1
@@ -0,0 +1,27 @@
@ -1396,7 +1396,7 @@ index 00000000000..d1bbc2ec515
+.BR "info grub"
diff --git a/util/grub-mknetdir.1 b/util/grub-mknetdir.1
new file mode 100644
index 00000000000..fa7e8d4ef0d
index 0000000..fa7e8d4
--- /dev/null
+++ b/util/grub-mknetdir.1
@@ -0,0 +1,12 @@
@ -1414,7 +1414,7 @@ index 00000000000..fa7e8d4ef0d
+.BR "info grub"
diff --git a/util/grub-mkpasswd-pbkdf2.1 b/util/grub-mkpasswd-pbkdf2.1
new file mode 100644
index 00000000000..73c437c15d8
index 0000000..73c437c
--- /dev/null
+++ b/util/grub-mkpasswd-pbkdf2.1
@@ -0,0 +1,27 @@
@ -1447,7 +1447,7 @@ index 00000000000..73c437c15d8
+.BR "info grub"
diff --git a/util/grub-mkrelpath.1 b/util/grub-mkrelpath.1
new file mode 100644
index 00000000000..85f1113621d
index 0000000..85f1113
--- /dev/null
+++ b/util/grub-mkrelpath.1
@@ -0,0 +1,12 @@
@ -1465,7 +1465,7 @@ index 00000000000..85f1113621d
+.BR "info grub"
diff --git a/util/grub-mkrescue.1 b/util/grub-mkrescue.1
new file mode 100644
index 00000000000..4ed9fc723fd
index 0000000..4ed9fc7
--- /dev/null
+++ b/util/grub-mkrescue.1
@@ -0,0 +1,123 @@
@ -1594,7 +1594,7 @@ index 00000000000..4ed9fc723fd
+.BR "info grub"
diff --git a/util/grub-mkstandalone.1 b/util/grub-mkstandalone.1
new file mode 100644
index 00000000000..ba2d2bdf279
index 0000000..ba2d2bd
--- /dev/null
+++ b/util/grub-mkstandalone.1
@@ -0,0 +1,100 @@
@ -1700,7 +1700,7 @@ index 00000000000..ba2d2bdf279
+.BR "info grub"
diff --git a/util/grub-ofpathname.8 b/util/grub-ofpathname.8
new file mode 100644
index 00000000000..bf3743aeba1
index 0000000..bf3743a
--- /dev/null
+++ b/util/grub-ofpathname.8
@@ -0,0 +1,12 @@
@ -1718,7 +1718,7 @@ index 00000000000..bf3743aeba1
+.BR "info grub"
diff --git a/util/grub-probe.8 b/util/grub-probe.8
new file mode 100644
index 00000000000..04e26c832bb
index 0000000..04e26c8
--- /dev/null
+++ b/util/grub-probe.8
@@ -0,0 +1,80 @@
@ -1804,7 +1804,7 @@ index 00000000000..04e26c832bb
+.BR "info grub"
diff --git a/util/grub-reboot.8 b/util/grub-reboot.8
new file mode 100644
index 00000000000..faa5e4eece2
index 0000000..faa5e4e
--- /dev/null
+++ b/util/grub-reboot.8
@@ -0,0 +1,21 @@
@ -1831,7 +1831,7 @@ index 00000000000..faa5e4eece2
+.BR "info grub"
diff --git a/util/grub-render-label.1 b/util/grub-render-label.1
new file mode 100644
index 00000000000..4d51c8abf01
index 0000000..4d51c8a
--- /dev/null
+++ b/util/grub-render-label.1
@@ -0,0 +1,51 @@
@ -1888,7 +1888,7 @@ index 00000000000..4d51c8abf01
+.BR "info grub"
diff --git a/util/grub-script-check.1 b/util/grub-script-check.1
new file mode 100644
index 00000000000..0f1f625b05d
index 0000000..0f1f625
--- /dev/null
+++ b/util/grub-script-check.1
@@ -0,0 +1,21 @@
@ -1915,7 +1915,7 @@ index 00000000000..0f1f625b05d
+.BR "info grub"
diff --git a/util/grub-set-default.8 b/util/grub-set-default.8
new file mode 100644
index 00000000000..a96265a1509
index 0000000..a96265a
--- /dev/null
+++ b/util/grub-set-default.8
@@ -0,0 +1,21 @@
@ -1942,7 +1942,7 @@ index 00000000000..a96265a1509
+.BR "info grub"
diff --git a/util/grub-sparc64-setup.8 b/util/grub-sparc64-setup.8
new file mode 100644
index 00000000000..37ea2dd5eaa
index 0000000..37ea2dd
--- /dev/null
+++ b/util/grub-sparc64-setup.8
@@ -0,0 +1,12 @@
@ -1958,3 +1958,6 @@ index 00000000000..37ea2dd5eaa
+
+.SH SEE ALSO
+.BR "info grub"
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 612e9b3820efe48896ba9faf320e4f042d053dc2 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Wed, 19 Feb 2014 15:58:43 -0500
Subject: [PATCH] use fw_path prefix when fallback searching for grub config
Subject: [PATCH 048/220] use fw_path prefix when fallback searching for grub
config
When PXE booting via UEFI firmware, grub was searching for grub.cfg
in the fw_path directory where the grub application was found. If
@ -17,10 +18,10 @@ Signed-off-by: Mark Salter <msalter@redhat.com>
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 0ce59fdc3f0..a3713efcd90 100644
index 7f61c5b..8add30e 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -343,7 +343,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
@@ -349,7 +349,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
char *config;
const char *prefix, *fw_path;
@ -29,7 +30,7 @@ index 0ce59fdc3f0..a3713efcd90 100644
if (fw_path)
{
config = grub_xasprintf ("%s/grub.cfg", fw_path);
@@ -366,7 +366,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
@@ -372,7 +372,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
}
}
@ -39,3 +40,6 @@ index 0ce59fdc3f0..a3713efcd90 100644
if (prefix)
{
grub_size_t config_len;
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 03c186bcadb3cae7a86d1674de33c6a2b8d81089 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 6 Mar 2014 11:51:33 -0500
Subject: [PATCH] Try mac/guid/etc before grub.cfg on tftp config files.
Date: Mon, 8 Jul 2019 17:33:22 +0200
Subject: [PATCH 049/220] Try mac/guid/etc before grub.cfg on tftp config
files.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -9,10 +10,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 43 insertions(+), 37 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index a3713efcd90..7d9c4f09b9b 100644
index 8add30e..d93bee6 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -341,53 +341,59 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
@@ -347,53 +347,59 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
/* Guess the config filename. It is necessary to make CONFIG static,
so that it won't get broken by longjmp. */
char *config;
@ -26,7 +27,7 @@ index a3713efcd90..7d9c4f09b9b 100644
- {
- grub_file_t file;
-
- file = grub_file_open (config);
- file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
- if (file)
- {
- grub_file_close (file);
@ -47,65 +48,68 @@ index a3713efcd90..7d9c4f09b9b 100644
prefix = grub_env_get ("prefix");
+
if (prefix)
- {
{
- grub_size_t config_len;
- config_len = grub_strlen (prefix) +
- sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
- config = grub_malloc (config_len);
+ {
+ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
+ {
+ grub_size_t config_len;
+ config_len = grub_strlen (prefix) +
+ sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
+ config = grub_malloc (config_len);
+ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
+ {
+ grub_size_t config_len;
+ config_len = grub_strlen (prefix) +
+ sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
+ config = grub_malloc (config_len);
- if (! config)
- goto quit;
+ if (! config)
+ goto quit;
+ if (! config)
+ goto quit;
- grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
- if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
- grub_net_search_configfile (config);
+ grub_net_search_configfile (config);
+ grub_net_search_configfile (config);
- grub_enter_normal_mode (config);
- grub_free (config);
+ grub_enter_normal_mode (config);
+ grub_free (config);
+ config = NULL;
+ }
- }
+ grub_enter_normal_mode (config);
+ grub_free (config);
+ config = NULL;
+ }
+
+ if (!config)
+ {
+ config = grub_xasprintf ("%s/grub.cfg", prefix);
+ if (config)
+ {
+ grub_file_t file;
+ if (!config)
+ {
+ config = grub_xasprintf ("%s/grub.cfg", prefix);
+ if (config)
+ {
+ grub_file_t file;
+
+ file = grub_file_open (config);
+ if (file)
+ {
+ grub_file_close (file);
+ grub_enter_normal_mode (config);
+ }
+ else
+ {
+ /* Ignore all errors. */
+ grub_errno = 0;
+ }
+ grub_free (config);
+ }
+ }
}
+ file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
+ if (file)
+ {
+ grub_file_close (file);
+ grub_enter_normal_mode (config);
+ }
+ else
+ {
+ /* Ignore all errors. */
+ grub_errno = 0;
+ }
+ grub_free (config);
+ }
+ }
+ }
else
- grub_enter_normal_mode (0);
+ {
+ grub_enter_normal_mode (0);
+ }
+ {
+ grub_enter_normal_mode (0);
+ }
}
else
grub_enter_normal_mode (argv[0]);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From d876203ac9bfea1f5f0cea015dfa70ba3988d08a Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 18 Feb 2014 11:34:00 -0500
Subject: [PATCH] Fix convert function to support NVMe devices
Subject: [PATCH 050/220] Fix convert function to support NVMe devices
This is adapted from the patch at
https://bugzilla.redhat.com/show_bug.cgi?id=1019660 , which is against
@ -18,7 +18,7 @@ Signed-off-by: Peter Jones <grub2-owner@fedoraproject.org>
1 file changed, 19 insertions(+)
diff --git a/util/getroot.c b/util/getroot.c
index 847406fbab0..fa3460d6cd8 100644
index 847406f..fa3460d 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -153,6 +153,7 @@ convert_system_partition_to_system_disk (const char *os_dev, int *is_part)
@ -54,3 +54,6 @@ index 847406fbab0..fa3460d6cd8 100644
if (grub_util_device_is_mapped_stat (&st))
return grub_util_devmapper_part_to_disk (&st, is_part, os_dev);
--
1.8.3.1

View File

@ -0,0 +1,85 @@
From a2099170d2f7e9cca6a743c15b6cb649b88fd873 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 8 Jul 2019 21:46:52 +0200
Subject: [PATCH 051/220] Add grub_util_readlink()
Add grub_util_readlink(). This requires pulling in stat and readlink from
gnulib, which pulls in stat and related headers, but after that the
implementation is straightforward.
Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
---
grub-core/osdep/windows/hostdisk.c | 6 ++++++
include/grub/osdep/hostfile_aros.h | 6 ++++++
include/grub/osdep/hostfile_unix.h | 6 ++++++
include/grub/osdep/hostfile_windows.h | 2 ++
4 files changed, 20 insertions(+)
diff --git a/grub-core/osdep/windows/hostdisk.c b/grub-core/osdep/windows/hostdisk.c
index 3551007..87a106c 100644
--- a/grub-core/osdep/windows/hostdisk.c
+++ b/grub-core/osdep/windows/hostdisk.c
@@ -365,6 +365,12 @@ grub_util_mkdir (const char *dir)
free (windows_name);
}
+ssize_t
+grub_util_readlink (const char *name, char *buf, size_t bufsize)
+{
+ return readlink(name, buf, bufsize);
+}
+
int
grub_util_rename (const char *from, const char *to)
{
diff --git a/include/grub/osdep/hostfile_aros.h b/include/grub/osdep/hostfile_aros.h
index a059c0f..161fbb7 100644
--- a/include/grub/osdep/hostfile_aros.h
+++ b/include/grub/osdep/hostfile_aros.h
@@ -68,6 +68,12 @@ grub_util_rename (const char *from, const char *to)
return rename (from, to);
}
+static inline ssize_t
+grub_util_readlink (const char *name, char *buf, size_t bufsize)
+{
+ return readlink(name, buf, bufsize);
+}
+
#define grub_util_mkdir(a) mkdir ((a), 0755)
struct grub_util_fd
diff --git a/include/grub/osdep/hostfile_unix.h b/include/grub/osdep/hostfile_unix.h
index 9ffe46f..17cd3aa 100644
--- a/include/grub/osdep/hostfile_unix.h
+++ b/include/grub/osdep/hostfile_unix.h
@@ -71,6 +71,12 @@ grub_util_rename (const char *from, const char *to)
return rename (from, to);
}
+static inline ssize_t
+grub_util_readlink (const char *name, char *buf, size_t bufsize)
+{
+ return readlink(name, buf, bufsize);
+}
+
#define grub_util_mkdir(a) mkdir ((a), 0755)
#if defined (__NetBSD__)
diff --git a/include/grub/osdep/hostfile_windows.h b/include/grub/osdep/hostfile_windows.h
index bf6451b..8c92d05 100644
--- a/include/grub/osdep/hostfile_windows.h
+++ b/include/grub/osdep/hostfile_windows.h
@@ -41,6 +41,8 @@ typedef struct grub_util_fd_dir *grub_util_fd_dir_t;
int
grub_util_rename (const char *from, const char *to);
+ssize_t
+grub_util_readlink (const char *name, char *buf, size_t bufsize);
int
grub_util_unlink (const char *name);
void
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 33c5ef791304cd9c320dd0e6ec67e2bd5e7e8d30 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 3 Sep 2014 10:38:00 -0400
Subject: [PATCH] Make editenv chase symlinks including those across devices.
Subject: [PATCH 052/220] Make editenv chase symlinks including those across
devices.
This lets us make /boot/grub2/grubenv a symlink to
/boot/efi/EFI/fedora/grubenv even though they're different mount points,
@ -11,15 +12,15 @@ which allows /usr/bin/grub2-editenv to be the same across platforms
Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
---
Makefile.util.def | 9 +++++++++
Makefile.util.def | 11 +++++++++++
util/editenv.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 53 insertions(+), 2 deletions(-)
2 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/Makefile.util.def b/Makefile.util.def
index c7b775bce73..d08713b5500 100644
index 8717774..1f298d0 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -231,8 +231,17 @@ program = {
@@ -240,8 +240,19 @@ program = {
common = util/grub-editenv.c;
common = util/editenv.c;
@ -29,6 +30,8 @@ index c7b775bce73..d08713b5500 100644
+ extra_dist = grub-core/osdep/unix/compress.c;
+ extra_dist = grub-core/osdep/basic/compress.c;
+ common = util/mkimage.c;
+ common = util/grub-mkimage32.c;
+ common = util/grub-mkimage64.c;
+ common = grub-core/osdep/config.c;
+ common = util/config.c;
+ common = util/resolve.c;
@ -38,7 +41,7 @@ index c7b775bce73..d08713b5500 100644
ldadd = libgrubgcry.a;
ldadd = libgrubkern.a;
diff --git a/util/editenv.c b/util/editenv.c
index c6f8d2298c3..d8d1dad6ab9 100644
index eb2d0c0..e61dc12 100644
--- a/util/editenv.c
+++ b/util/editenv.c
@@ -37,6 +37,7 @@ grub_util_create_envblk_file (const char *name)
@ -49,7 +52,7 @@ index c6f8d2298c3..d8d1dad6ab9 100644
buf = xmalloc (DEFAULT_ENVBLK_SIZE);
@@ -59,7 +60,48 @@ grub_util_create_envblk_file (const char *name)
@@ -60,7 +61,48 @@ grub_util_create_envblk_file (const char *name)
free (buf);
fclose (fp);
@ -100,3 +103,6 @@ index c6f8d2298c3..d8d1dad6ab9 100644
free (namenew);
+ free (rename_target);
}
--
1.8.3.1

View File

@ -1,43 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Sat, 15 Feb 2014 15:10:22 -0500
Subject: [PATCH] reopen SNP protocol for exclusive use by grub
---
grub-core/net/drivers/efi/efinet.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index 5388f952ba9..ea0e0ca360e 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -330,6 +330,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
{
struct grub_net_card *card;
grub_efi_device_path_t *dp;
+ grub_efi_simple_network_t *net;
dp = grub_efi_get_device_path (hnd);
if (! dp)
@@ -383,6 +384,21 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
&pxe_mode->dhcp_ack,
sizeof (pxe_mode->dhcp_ack),
1, device, path);
+ net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
+ GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
+ if (net) {
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
+ && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
+ continue;
+
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
+ continue;
+
+ if (net->mode->state == GRUB_EFI_NETWORK_STARTED
+ && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
+ continue;
+ card->efi_net = net;
+ }
return;
}
}

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 708e24f2d6ffadfa2d1b6638538ddc03a82dbbd6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 4 Sep 2014 14:23:23 -0400
Subject: [PATCH] Generate OS and CLASS in 10_linux from /etc/os-release
Subject: [PATCH 053/220] Generate OS and CLASS in 10_linux from
/etc/os-release
This makes us use pretty names in the titles we generate in
grub2-mkconfig when GRUB_DISTRIBUTOR isn't set.
@ -14,7 +15,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index b744438e04a..43d98476b88 100644
index d35b0f4..d12d2d7 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -29,7 +29,8 @@ export TEXTDOMAINDIR="@localedir@"
@ -27,3 +28,6 @@ index b744438e04a..43d98476b88 100644
else
OS="${GRUB_DISTRIBUTOR}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
--
1.8.3.1

View File

@ -1,51 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 4 Mar 2016 15:13:59 -0500
Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by grub"
This reverts commit a3f2c756ce34c9666bddef35e3b3b85ccecdcffc , which is
obsoleted by these:
49426e9 efinet: open Simple Network Protocol exclusively
f348aee efinet: enable hardware filters when opening interface
c52ae40 efinet: skip virtual IPv4 and IPv6 devices when enumerating cards
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/net/drivers/efi/efinet.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index ea0e0ca360e..5388f952ba9 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -330,7 +330,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
{
struct grub_net_card *card;
grub_efi_device_path_t *dp;
- grub_efi_simple_network_t *net;
dp = grub_efi_get_device_path (hnd);
if (! dp)
@@ -384,21 +383,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
&pxe_mode->dhcp_ack,
sizeof (pxe_mode->dhcp_ack),
1, device, path);
- net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
- GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
- if (net) {
- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
- && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
- continue;
-
- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
- continue;
-
- if (net->mode->state == GRUB_EFI_NETWORK_STARTED
- && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
- continue;
- card->efi_net = net;
- }
return;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 0fe1927a2ff37806bcdca1243dd2df9cba116091 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 4 Sep 2014 15:52:08 -0400
Subject: [PATCH] Minimize the sort ordering for .debug and -rescue- kernels.
Subject: [PATCH 054/220] Minimize the sort ordering for .debug and -rescue-
kernels.
Resolves: rhbz#1065360
Signed-off-by: Peter Jones <pjones@redhat.com>
@ -10,7 +11,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 8 insertions(+)
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 1001a12232b..1a4a57898f9 100644
index 1001a12..1a4a578 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -249,6 +249,14 @@ version_test_gt ()
@ -28,3 +29,6 @@ index 1001a12232b..1a4a57898f9 100644
esac
version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp" "$version_test_gt_b"
return "$?"
--
1.8.3.1

View File

@ -1,22 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 75f23ba5e4f8e84b595b0b13f5f7ed744a866099 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 3 Oct 2014 11:08:03 -0400
Subject: [PATCH] Try $prefix if $fw_path doesn't work.
Date: Tue, 9 Jul 2019 10:35:16 +0200
Subject: [PATCH 055/220] Try $prefix if $fw_path doesn't work.
Related: rhbz#1148652
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/kern/ieee1275/init.c | 28 +++++-----
grub-core/kern/ieee1275/init.c | 30 ++++++-----
grub-core/net/net.c | 2 +-
grub-core/normal/main.c | 120 ++++++++++++++++++++---------------------
grub-core/normal/main.c | 118 ++++++++++++++++++++---------------------
3 files changed, 75 insertions(+), 75 deletions(-)
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index f5423ce27d9..e01bc6eab19 100644
index e71d158..0cd2a62 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -124,23 +124,25 @@ grub_machine_get_bootlocation (char **device, char **path)
@@ -127,23 +127,25 @@ grub_machine_get_bootlocation (char **device, char **path)
grub_free (canon);
}
else
@ -35,10 +35,11 @@ index f5423ce27d9..e01bc6eab19 100644
{
- *lastslash = '\0';
- grub_translate_ieee1275_path (filename);
+ char *lastslash = grub_strrchr (filename, '\\');
-
- *path = filename;
- }
+ char *lastslash = grub_strrchr (filename, '\\');
+
+ /* Truncate at last directory. */
+ if (lastslash)
+ {
@ -56,7 +57,7 @@ index f5423ce27d9..e01bc6eab19 100644
}
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 0769bf850d3..16d2ce06d5a 100644
index 0645456..4b7972b 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -1850,7 +1850,7 @@ grub_net_search_configfile (char *config)
@ -69,10 +70,10 @@ index 0769bf850d3..16d2ce06d5a 100644
static struct grub_preboot *fini_hnd;
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 7d9c4f09b9b..b69f9e738fa 100644
index d93bee6..2fe6743 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -331,74 +331,72 @@ grub_enter_normal_mode (const char *config)
@@ -337,74 +337,72 @@ grub_enter_normal_mode (const char *config)
grub_boot_time ("Exiting normal mode");
}
@ -89,31 +90,31 @@ index 7d9c4f09b9b..b69f9e738fa 100644
+
+ if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
+ {
+ grub_size_t config_len;
+ config_len = grub_strlen (prefix) +
+ sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
+ config = grub_malloc (config_len);
+ grub_size_t config_len;
+ config_len = grub_strlen (prefix) +
+ sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
+ config = grub_malloc (config_len);
+
+ if (! config)
+ return GRUB_ERR_FILE_NOT_FOUND;
+ if (! config)
+ return GRUB_ERR_FILE_NOT_FOUND;
+
+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
+ err = grub_net_search_configfile (config);
+ grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
+ err = grub_net_search_configfile (config);
+ }
+
+ if (err != GRUB_ERR_NONE)
+ {
+ config = grub_xasprintf ("%s/grub.cfg", prefix);
+ if (config)
+ {
+ grub_file_t file;
+ file = grub_file_open (config);
+ if (file)
+ {
+ grub_file_close (file);
+ err = GRUB_ERR_NONE;
+ }
+ }
+ config = grub_xasprintf ("%s/grub.cfg", prefix);
+ if (config)
+ {
+ grub_file_t file;
+ file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
+ if (file)
+ {
+ grub_file_close (file);
+ err = GRUB_ERR_NONE;
+ }
+ }
+ }
+
+ if (err == GRUB_ERR_NONE)
@ -130,7 +131,10 @@ index 7d9c4f09b9b..b69f9e738fa 100644
int argc, char *argv[])
{
- if (argc == 0)
- {
+ if (argc)
+ grub_enter_normal_mode (argv[0]);
+ else
{
- /* Guess the config filename. It is necessary to make CONFIG static,
- so that it won't get broken by longjmp. */
- char *config;
@ -141,58 +145,52 @@ index 7d9c4f09b9b..b69f9e738fa 100644
- prefix = grub_env_get ("prefix");
-
- if (prefix)
- {
- if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
- {
- grub_size_t config_len;
- config_len = grub_strlen (prefix) +
- sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
- config = grub_malloc (config_len);
- {
- if (grub_strncmp (prefix + 1, "tftp", sizeof ("tftp") - 1) == 0)
- {
- grub_size_t config_len;
- config_len = grub_strlen (prefix) +
- sizeof ("/grub.cfg-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
- config = grub_malloc (config_len);
-
- if (! config)
- goto quit;
- if (! config)
- goto quit;
-
- grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
- grub_snprintf (config, config_len, "%s/grub.cfg", prefix);
-
- grub_net_search_configfile (config);
- grub_net_search_configfile (config);
-
- grub_enter_normal_mode (config);
- grub_free (config);
- config = NULL;
- }
- grub_enter_normal_mode (config);
- grub_free (config);
- config = NULL;
- }
-
- if (!config)
- {
- config = grub_xasprintf ("%s/grub.cfg", prefix);
- if (config)
- {
- grub_file_t file;
- if (!config)
- {
- config = grub_xasprintf ("%s/grub.cfg", prefix);
- if (config)
- {
- grub_file_t file;
-
- file = grub_file_open (config);
- if (file)
- {
- grub_file_close (file);
- grub_enter_normal_mode (config);
- }
- else
- {
- /* Ignore all errors. */
- grub_errno = 0;
- }
- grub_free (config);
- }
- }
- }
- file = grub_file_open (config, GRUB_FILE_TYPE_CONFIG);
- if (file)
- {
- grub_file_close (file);
- grub_enter_normal_mode (config);
- }
- else
- {
- /* Ignore all errors. */
- grub_errno = 0;
- }
- grub_free (config);
- }
- }
- }
- else
- {
- grub_enter_normal_mode (0);
- }
- }
- else
+ if (argc)
grub_enter_normal_mode (argv[0]);
+ else
+ {
- {
- grub_enter_normal_mode (0);
- }
+ /* Guess the config filename. */
+ grub_err_t err;
+ err = grub_try_normal ("fw_path");
@ -200,9 +198,14 @@ index 7d9c4f09b9b..b69f9e738fa 100644
+ err = grub_try_normal ("prefix");
+ if (err == GRUB_ERR_FILE_NOT_FOUND)
+ grub_enter_normal_mode (0);
+ }
}
- else
- grub_enter_normal_mode (argv[0]);
-quit:
return 0;
}
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From c2361e2d8c4b0d15eb78605097a9d2fa38c06d76 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 16 Mar 2015 16:34:51 -0400
Subject: [PATCH] Update info with grub.cfg netboot selection order (#1148650)
Subject: [PATCH 056/220] Update info with grub.cfg netboot selection order
(#1148650)
Added documentation to the grub info page that specifies the order
netboot clients will use to select a grub configuration file.
@ -12,7 +13,7 @@ Resolves rhbz#1148650
1 file changed, 42 insertions(+)
diff --git a/docs/grub.texi b/docs/grub.texi
index 2fd32608c01..a7155c22ffe 100644
index 6f52430..221064b 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -2493,6 +2493,48 @@ grub-mknetdir --net-directory=/srv/tftp --subdir=/boot/grub -d /usr/lib/grub/i38
@ -64,3 +65,6 @@ index 2fd32608c01..a7155c22ffe 100644
After GRUB has started, files on the TFTP server will be accessible via the
@samp{(tftp)} device.
--
1.8.3.1

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From e8cf594751f7bbce4ff01504197ebc25c71c2dc2 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 16 Mar 2015 14:14:19 -0400
Subject: [PATCH] Use Distribution Package Sort for grub2-mkconfig (#1124074)
Subject: [PATCH 057/220] Use Distribution Package Sort for grub2-mkconfig
(#1124074)
Users reported that newly installed kernels on their systems installed
with grub-mkconfig would not appear on the grub boot list in order
@ -9,22 +10,52 @@ starting with the most recent. Added an option for rpm-based systems to
use the rpm-sort library to sort kernels instead.
Resolves rhbz#1124074
---
configure.ac | 29 +++++
Makefile.util.def | 16 +++
util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++
.gitignore | 2 +
util/grub-mkconfig_lib.in | 8 +-
util/grub-rpm-sort.8 | 12 ++
6 files changed, 347 insertions(+), 1 deletion(-)
create mode 100644 util/grub-rpm-sort.c
create mode 100644 util/grub-rpm-sort.8
Signed-off-by: Robert Marshall <rmarshall@redhat.com>
[pjones: fix --enable-rpm-sort configure option]
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Makefile.util.def | 16 +++
configure.ac | 29 +++++
util/grub-mkconfig_lib.in | 11 +-
util/grub-rpm-sort.8 | 12 ++
util/grub-rpm-sort.c | 281 ++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 348 insertions(+), 1 deletion(-)
create mode 100644 util/grub-rpm-sort.8
create mode 100644 util/grub-rpm-sort.c
diff --git a/Makefile.util.def b/Makefile.util.def
index 1f298d0..843ce09 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -696,6 +696,22 @@ program = {
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
+program = {
+ name = grub-rpm-sort;
+ mansection = 8;
+ installdir = sbin;
+
+ common = grub-core/kern/emu/misc.c;
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+ common = util/misc.c;
+ common = util/grub-rpm-sort.c;
+
+ ldadd = libgrubkern.a;
+ ldadd = grub-core/lib/gnulib/libgnu.a;
+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)';
+};
+
script = {
name = grub-mkconfig;
common = util/grub-mkconfig.in;
diff --git a/configure.ac b/configure.ac
index d5db2803ec4..056df1cbaf9 100644
index 8df400e..6927615 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath])
@@ -69,6 +69,7 @@ grub_TRANSFORM([grub-mkrelpath])
grub_TRANSFORM([grub-mkrescue])
grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot])
@ -32,7 +63,7 @@ index d5db2803ec4..056df1cbaf9 100644
grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default])
grub_TRANSFORM([grub-sparc64-setup])
@@ -88,6 +89,7 @@ grub_TRANSFORM([grub-mkrescue.1])
@@ -92,6 +93,7 @@ grub_TRANSFORM([grub-mkrescue.1])
grub_TRANSFORM([grub-mkstandalone.3])
grub_TRANSFORM([grub-ofpathname.3])
grub_TRANSFORM([grub-probe.3])
@ -40,14 +71,14 @@ index d5db2803ec4..056df1cbaf9 100644
grub_TRANSFORM([grub-reboot.3])
grub_TRANSFORM([grub-render-label.3])
grub_TRANSFORM([grub-script-check.3])
@@ -1790,6 +1792,33 @@ fi
@@ -1802,6 +1804,33 @@ fi
AC_SUBST([LIBDEVMAPPER])
+AC_ARG_ENABLE([rpm-sort],
+ [AS_HELP_STRING([--enable-rpm-sort],
+ [enable native rpm sorting of kernels in grub (default=guessed)])])
+if test x"$enable_rpm-sort" = xno ; then
+if test x"$enable_rpm_sort" = xno ; then
+ rpm_sort_excuse="explicitly disabled"
+fi
+
@ -74,36 +105,63 @@ index d5db2803ec4..056df1cbaf9 100644
LIBGEOM=
if test x$host_kernel = xkfreebsd; then
AC_CHECK_LIB([geom], [geom_gettree], [],
diff --git a/Makefile.util.def b/Makefile.util.def
index d08713b5500..406d96861b6 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -685,6 +685,22 @@ program = {
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
};
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 1a4a578..113a41f 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -33,6 +33,9 @@ fi
if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/@grub_mkrelpath@"
fi
+if test "x$grub_rpm_sort" = x; then
+ grub_rpm_sort="${sbindir}/@grub_rpm_sort@"
+fi
+program = {
+ name = grub-rpm-sort;
+ mansection = 8;
+ installdir = sbin;
if which gettext >/dev/null 2>/dev/null; then
:
@@ -214,6 +217,12 @@ version_sort ()
esac
}
+if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then
+ kernel_sort="$grub_rpm_sort"
+else
+ kernel_sort=version_sort
+fi
+
+ common = grub-core/kern/emu/misc.c;
+ common = grub-core/kern/emu/argp_common.c;
+ common = grub-core/osdep/init.c;
+ common = util/misc.c;
+ common = util/grub-rpm-sort.c;
version_test_numeric ()
{
version_test_numeric_a="$1"
@@ -230,7 +239,7 @@ version_test_numeric ()
version_test_numeric_a="$version_test_numeric_b"
version_test_numeric_b="$version_test_numeric_c"
fi
- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then
return 0
else
return 1
diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8
new file mode 100644
index 0000000..8ce2148
--- /dev/null
+++ b/util/grub-rpm-sort.8
@@ -0,0 +1,12 @@
+.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014"
+.SH NAME
+\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare.
+
+ ldadd = grub-core/gnulib/libgnu.a;
+ ldadd = libgrubkern.a;
+ ldadd = '$(LIBDEVMAPPER) $(LIBRPM)';
+};
+.SH SYNOPSIS
+\fBgrub-rpm-sort\fR [OPTIONS].
+
script = {
name = grub-mkconfig;
common = util/grub-mkconfig.in;
+.SH DESCRIPTION
+You should not normally run this program directly. Use grub-mkconfig instead.
+
+.SH SEE ALSO
+.BR "info grub"
diff --git a/util/grub-rpm-sort.c b/util/grub-rpm-sort.c
new file mode 100644
index 00000000000..f33bd1ed568
index 0000000..f33bd1e
--- /dev/null
+++ b/util/grub-rpm-sort.c
@@ -0,0 +1,281 @@
@ -388,60 +446,6 @@ index 00000000000..f33bd1ed568
+
+ return 0;
+}
diff --git a/.gitignore b/.gitignore
index 43f04d47277..fa2e5b609b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,6 +105,8 @@ grub-*.tar.*
/grub*-reboot.8
/grub*-render-label
/grub*-render-label.1
+/grub*-rpm-sort
+/grub*-rpm-sort.8
/grub*-script-check
/grub*-script-check.1
/grub*-set-default
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 1a4a57898f9..7fe3598435c 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -214,6 +214,12 @@ version_sort ()
esac
}
--
1.8.3.1
+if [ "x$RPMLIB" = x ]; then
+ kernel_sort=version_sort
+else
+ kernel_sort="${sbindir}/grub-rpm-sort"
+fi
+
version_test_numeric ()
{
version_test_numeric_a="$1"
@@ -230,7 +236,7 @@ version_test_numeric ()
version_test_numeric_a="$version_test_numeric_b"
version_test_numeric_b="$version_test_numeric_c"
fi
- if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | version_sort | head -n 1 | grep -qx "$version_test_numeric_b" ; then
+ if (echo "$version_test_numeric_a" ; echo "$version_test_numeric_b") | "$kernel_sort" | head -n 1 | grep -qx "$version_test_numeric_b" ; then
return 0
else
return 1
diff --git a/util/grub-rpm-sort.8 b/util/grub-rpm-sort.8
new file mode 100644
index 00000000000..8ce21488448
--- /dev/null
+++ b/util/grub-rpm-sort.8
@@ -0,0 +1,12 @@
+.TH GRUB-RPM-SORT 8 "Wed Feb 26 2014"
+.SH NAME
+\fBgrub-rpm-sort\fR \(em Sort input according to RPM version compare.
+
+.SH SYNOPSIS
+\fBgrub-rpm-sort\fR [OPTIONS].
+
+.SH DESCRIPTION
+You should not normally run this program directly. Use grub-mkconfig instead.
+
+.SH SEE ALSO
+.BR "info grub"

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 186a94f0f82bbebcbf607573ba792647acebf9cd Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 30 Jun 2015 15:50:41 -0400
Subject: [PATCH] Handle rssd storage devices.
Subject: [PATCH 058/220] Handle rssd storage devices.
Resolves: rhbz#1087962
@ -11,7 +11,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 13 insertions(+)
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 90d92d3ad5c..6d9f4e5faa2 100644
index 90d92d3..6d9f4e5 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -921,6 +921,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
@ -34,3 +34,6 @@ index 90d92d3ad5c..6d9f4e5faa2 100644
/* If this is a loop device */
if ((strncmp ("loop", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
{
--
1.8.3.1

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 95e793ef45a127c800525d629b2fdec583ae8266 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.
Subject: [PATCH 059/220] Make grub2-mkconfig construct titles that look like
the ones we want elsewhere.
Resolves: rhbz#1215839
@ -12,7 +12,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 43d98476b88..a8a8e2cf325 100644
index d12d2d7..12a20c9 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -78,6 +78,32 @@ case x"$GRUB_FS" in
@ -67,3 +67,6 @@ index 43d98476b88..a8a8e2cf325 100644
fi
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
else
--
1.8.3.1

View File

@ -1,84 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From a524d461543f57da4f36a9c9c12b329ea8b6629c Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Thu, 25 Jun 2015 11:13:11 -0400
Subject: [PATCH] Add friendly grub2 password config tool (#985962)
Subject: [PATCH 060/220] Add friendly grub2 password config tool (#985962)
Provided a tool for users to reset the grub2 root user password
without having to alter the grub.cfg. The hashed password now
lives in a root-only-readable configuration file.
Resolves: rhbz#985962
Signed-off-by: Robert Marshall <rmarshall@redhat.com>
[pjones: fix the efidir in grub-setpassword and rename tool]
Signed-off-by: Peter Jones <pjones@redhat.com>
[luto: fix grub-setpassword -o's output path]
Andy Lutomirski <luto@kernel.org>
---
configure.ac | 1 +
Makefile.util.def | 13 +++++
.gitignore | 2 +
util/grub-mkconfig.in | 2 +
util/grub-setpassword.8 | 28 +++++++++++
util/grub-setpassword.in | 123 +++++++++++++++++++++++++++++++++++++++++++++++
util/grub.d/01_users.in | 11 +++++
7 files changed, 180 insertions(+)
create mode 100644 util/grub-setpassword.8
create mode 100644 util/grub-setpassword.in
Makefile.util.def | 13 +++++
configure.ac | 1 +
util/grub-mkconfig.in | 2 +
util/grub-set-password.8 | 28 ++++++++++
util/grub-set-password.in | 128 ++++++++++++++++++++++++++++++++++++++++++++++
util/grub.d/01_users.in | 11 ++++
6 files changed, 183 insertions(+)
create mode 100644 util/grub-set-password.8
create mode 100644 util/grub-set-password.in
create mode 100644 util/grub.d/01_users.in
diff --git a/configure.ac b/configure.ac
index 056df1cbaf9..679f634ce4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,7 @@ grub_TRANSFORM([grub-mkrelpath])
grub_TRANSFORM([grub-mkrescue])
grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot])
+grub_TRANSFORM([grub-setpassword])
grub_TRANSFORM([grub-rpm-sort])
grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default])
diff --git a/Makefile.util.def b/Makefile.util.def
index 406d96861b6..fd91045bd6d 100644
index 843ce09..e50436a 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -440,6 +440,12 @@ script = {
installdir = grubconf;
@@ -452,6 +452,12 @@ script = {
};
+script = {
script = {
+ name = '01_users';
+ common = util/grub.d/01_users.in;
+ installdir = grubconf;
+};
+
script = {
+script = {
name = '10_windows';
common = util/grub.d/10_windows.in;
@@ -722,6 +728,13 @@ script = {
installdir = sbin;
installdir = grubconf;
@@ -734,6 +740,13 @@ script = {
};
+script = {
+ name = grub-setpassword;
+ common = util/grub-setpassword.in;
script = {
+ name = grub-set-password;
+ common = util/grub-set-password.in;
+ mansection = 8;
+ installdir = sbin;
+};
+
script = {
+script = {
name = grub-mkconfig_lib;
common = util/grub-mkconfig_lib.in;
diff --git a/.gitignore b/.gitignore
index fa2e5b609b1..5066689bc0a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -111,6 +111,8 @@ grub-*.tar.*
/grub*-script-check.1
/grub*-set-default
/grub*-set-default.8
+/grub*-setsetpassword
+/grub*-setsetpassword.8
/grub*-shell
/grub*-shell-tester
/grub*-sparc64-setup
installdir = noinst;
diff --git a/configure.ac b/configure.ac
index 6927615..6850166 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,7 @@ grub_TRANSFORM([grub-mkrelpath])
grub_TRANSFORM([grub-mkrescue])
grub_TRANSFORM([grub-probe])
grub_TRANSFORM([grub-reboot])
+grub_TRANSFORM([grub-set-password])
grub_TRANSFORM([grub-rpm-sort])
grub_TRANSFORM([grub-script-check])
grub_TRANSFORM([grub-set-default])
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index f68d4925ee6..bdb9982aefb 100644
index c645351..4e7a875 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -282,6 +282,8 @@ for i in "${grub_mkconfig_dir}"/* ; do
@ -90,21 +82,21 @@ index f68d4925ee6..bdb9982aefb 100644
*)
if grub_file_is_not_garbage "$i" && test -x "$i" ; then
echo
diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8
diff --git a/util/grub-set-password.8 b/util/grub-set-password.8
new file mode 100644
index 00000000000..49200a848b7
index 0000000..9646546
--- /dev/null
+++ b/util/grub-setpassword.8
+++ b/util/grub-set-password.8
@@ -0,0 +1,28 @@
+.TH GRUB-SETPASSWORD 3 "Thu Jun 25 2015"
+.TH GRUB-SET-PASSWORD 3 "Thu Jun 25 2015"
+.SH NAME
+\fBgrub-setpassword\fR \(em Generate the user.cfg file containing the hashed grub bootloader password.
+\fBgrub-set-password\fR \(em Generate the user.cfg file containing the hashed grub bootloader password.
+
+.SH SYNOPSIS
+\fBgrub-setpassword\fR [OPTION]
+\fBgrub-set-password\fR [OPTION]
+
+.SH DESCRIPTION
+\fBgrub-setpassword\fR outputs the user.cfg file which contains the hashed GRUB bootloader password. This utility only supports configurations where there is a single root user.
+\fBgrub-set-password\fR outputs the user.cfg file which contains the hashed GRUB bootloader password. This utility only supports configurations where there is a single root user.
+
+The file has the format:
+GRUB2_PASSWORD=<\fIhashed password\fR>.
@ -117,23 +109,24 @@ index 00000000000..49200a848b7
+-v, --version
+Display the current version.
+.TP
+-o, --output[=\fIDIRECTORY PATH\fR]
+-o, --output=<\fIDIRECTORY\fR>
+Choose the file path to which user.cfg will be written.
+
+.SH SEE ALSO
+.BR "info grub"
+
+.BR "info grub2-mkpasswd-pbkdf2"
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
diff --git a/util/grub-set-password.in b/util/grub-set-password.in
new file mode 100644
index 00000000000..dd76f00fc0e
index 0000000..5ebf505
--- /dev/null
+++ b/util/grub-setpassword.in
@@ -0,0 +1,123 @@
+++ b/util/grub-set-password.in
@@ -0,0 +1,128 @@
+#!/bin/sh -e
+
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
+if [ -d /sys/firmware/efi/efivars/ ]; then
+ grubdir=`echo "/@bootdirname@/efi/EFI/redhat/" | sed 's,//*,/,g'`
+ grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
+else
+ grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+fi
@ -148,15 +141,14 @@ index 00000000000..dd76f00fc0e
+# Print the usage.
+usage () {
+ cat <<EOF
+Usage: $0 [OPTION] [SOURCE]
+Run GRUB script in a Qemu instance.
+
+ -h, --help print this message and exit
+ -v, --version print the version information and exit
+ -o, --output_path choose a custom output path for user.cfg
+
+Usage: $0 [OPTION]
+$0 prompts the user to set a password on the grub bootloader. The password
+is written to a file named user.cfg.
+is written to a file named user.cfg which lives in the GRUB directory
+located by default at ${grubdir}.
+
+ -h, --help print this message and exit
+ -v, --version print the version information and exit
+ -o, --output_path <DIRECTORY> put user.cfg in a user-selected directory
+
+Report bugs at https://bugzilla.redhat.com.
+EOF
@ -237,7 +229,7 @@ index 00000000000..dd76f00fc0e
+ P1="$1" && shift
+
+ ( echo ${P0} ; echo ${P1} ) | \
+ ${grub_mkpasswd} | \
+ LC_ALL=C ${grub_mkpasswd} | \
+ grep -v '[eE]nter password:' | \
+ sed -e "s/PBKDF2 hash of your password is //"
+}
@ -250,12 +242,17 @@ index 00000000000..dd76f00fc0e
+
+# on the ESP, these will fail to set the permissions, but it's okay because
+# the directory is protected.
+install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || :
+chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
+echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
+install -m 0600 /dev/null "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
+chmod 0600 "${OUTPUT_PATH}/user.cfg" 2>/dev/null || :
+echo "GRUB2_PASSWORD=${MYPASS}" > "${OUTPUT_PATH}/user.cfg"
+
+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${OUTPUT_PATH}/grub.cfg"; then
+ echo "WARNING: The current configuration lacks password support!"
+ echo "Update your configuration with @grub_mkconfig@ to support this feature."
+fi
diff --git a/util/grub.d/01_users.in b/util/grub.d/01_users.in
new file mode 100644
index 00000000000..db2f44bfb78
index 0000000..db2f44b
--- /dev/null
+++ b/util/grub.d/01_users.in
@@ -0,0 +1,11 @@
@ -270,3 +267,6 @@ index 00000000000..db2f44bfb78
+ fi
+fi
+EOF
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 685960c950e661dec0d57a353ca01304b94a7092 Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik@fb.com>
Date: Wed, 12 Aug 2015 08:57:55 -0700
Subject: [PATCH] tcp: add window scaling support
Subject: [PATCH 061/220] tcp: add window scaling support
Sometimes we have to provision boxes across regions, such as California to
Sweden. The http server has a 10 minute timeout, so if we can't get our 250mb
@ -17,7 +17,7 @@ Signed-off-by: Josef Bacik <jbacik@fb.com>
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c
index e8ad34b84d4..7d4b822626d 100644
index e8ad34b..7d4b822 100644
--- a/grub-core/net/tcp.c
+++ b/grub-core/net/tcp.c
@@ -106,6 +106,18 @@ struct tcphdr
@ -85,3 +85,6 @@ index e8ad34b84d4..7d4b822626d 100644
tcp_socket_register (socket);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 8483464867a872744a2c40a3b4016d3b81033a5d Mon Sep 17 00:00:00 2001
From: Hector Marco-Gisbert <hecmargi@upv.es>
Date: Fri, 13 Nov 2015 16:21:09 +0100
Subject: [PATCH] Fix security issue when reading username and password
Subject: [PATCH 062/220] Fix security issue when reading username and password
This patch fixes two integer underflows at:
* grub-core/lib/crypto.c
@ -17,7 +17,7 @@ Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/lib/crypto.c b/grub-core/lib/crypto.c
index ca334d5a40e..e6c78d16d39 100644
index ca334d5..e6c78d1 100644
--- a/grub-core/lib/crypto.c
+++ b/grub-core/lib/crypto.c
@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned buf_size)
@ -30,7 +30,7 @@ index ca334d5a40e..e6c78d16d39 100644
if (cur_len)
cur_len--;
diff --git a/grub-core/normal/auth.c b/grub-core/normal/auth.c
index 6be678c0de1..c35ce972473 100644
index 6be678c..c35ce97 100644
--- a/grub-core/normal/auth.c
+++ b/grub-core/normal/auth.c
@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned buf_size)
@ -42,3 +42,6 @@ index 6be678c0de1..c35ce972473 100644
{
if (cur_len)
{
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From eb8bcbb4845d6b87f16774ee62de3e5a11ccd6f1 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 14 Jun 2016 16:18:44 -0400
Subject: [PATCH] Add a url parser.
Subject: [PATCH 063/220] Add a url parser.
This patch adds a url parser that can parse http, https, tftp, and tftps
urls, and is easily extensible to handle more types.
@ -20,10 +20,10 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
create mode 100644 include/grub/net/url.h
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index cd0902b46b8..991891a6e09 100644
index 57e253a..99466b1 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -2185,6 +2185,7 @@ module = {
@@ -2284,6 +2284,7 @@ module = {
common = net/ethernet.c;
common = net/arp.c;
common = net/netbuff.c;
@ -32,7 +32,7 @@ index cd0902b46b8..991891a6e09 100644
module = {
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 8344526be7f..f1fab700048 100644
index 2656a67..1c560ea 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -296,6 +296,19 @@ grub_strrchr (const char *s, int c)
@ -57,7 +57,7 @@ index 8344526be7f..f1fab700048 100644
{
diff --git a/grub-core/net/url.c b/grub-core/net/url.c
new file mode 100644
index 00000000000..146858284cd
index 0000000..1468582
--- /dev/null
+++ b/grub-core/net/url.c
@@ -0,0 +1,861 @@
@ -923,7 +923,7 @@ index 00000000000..146858284cd
+}
+#endif
diff --git a/include/grub/misc.h b/include/grub/misc.h
index 83fd69f4ada..fcaf1201e39 100644
index f9135b6..b433922 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -85,6 +85,7 @@ int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n);
@ -987,7 +987,7 @@ index 83fd69f4ada..fcaf1201e39 100644
{
diff --git a/include/grub/net/url.h b/include/grub/net/url.h
new file mode 100644
index 00000000000..a215fa27d0a
index 0000000..a215fa2
--- /dev/null
+++ b/include/grub/net/url.h
@@ -0,0 +1,28 @@
@ -1019,3 +1019,6 @@ index 00000000000..a215fa27d0a
+ char **host, int *port, char **file);
+
+#endif /* GRUB_URL_HEADER */
--
1.8.3.1

View File

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 3 Aug 2015 11:46:42 -0400
Subject: [PATCH] Try to make sure configure.ac and grub-rpm-sort play nice.
Apparently the test for whether to use grub-rpm-sort and also the
renaming of it to grub2-rpm-sort on the runtime side weren't right.
Related: rhbz#1124074
Signed-off-by: Peter Jones <pjones@redhat.com>
---
configure.ac | 2 +-
util/grub-mkconfig_lib.in | 9 ++++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 679f634ce4c..71d1056969e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1796,7 +1796,7 @@ AC_SUBST([LIBDEVMAPPER])
AC_ARG_ENABLE([rpm-sort],
[AS_HELP_STRING([--enable-rpm-sort],
[enable native rpm sorting of kernels in grub (default=guessed)])])
-if test x"$enable_rpm-sort" = xno ; then
+if test x"$enable_rpm_sort" = xno ; then
rpm_sort_excuse="explicitly disabled"
fi
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 7fe3598435c..113a41f9409 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -33,6 +33,9 @@ fi
if test "x$grub_mkrelpath" = x; then
grub_mkrelpath="${bindir}/@grub_mkrelpath@"
fi
+if test "x$grub_rpm_sort" = x; then
+ grub_rpm_sort="${sbindir}/@grub_rpm_sort@"
+fi
if which gettext >/dev/null 2>/dev/null; then
:
@@ -214,10 +217,10 @@ version_sort ()
esac
}
-if [ "x$RPMLIB" = x ]; then
+if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then
+ kernel_sort="$grub_rpm_sort"
+else
kernel_sort=version_sort
-else
- kernel_sort="${sbindir}/grub-rpm-sort"
fi
version_test_numeric ()

View File

@ -1,20 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From af6fa4f3b319c6d71badfba50fcb16619c38605a Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 8 Jun 2016 21:03:37 -0400
Subject: [PATCH] efinet and bootp: add support for dhcpv6
Date: Tue, 9 Jul 2019 11:47:37 +0200
Subject: [PATCH 064/220] efinet and bootp: add support for dhcpv6
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/net/bootp.c | 174 +++++++++++++++++++++++++++++++++++++
grub-core/net/drivers/efi/efinet.c | 55 ++++++++++--
grub-core/net/drivers/efi/efinet.c | 54 ++++++++++--
grub-core/net/net.c | 72 +++++++++++++++
grub-core/net/tftp.c | 4 +
include/grub/efi/api.h | 129 +++++++++++++++++++++++++--
include/grub/net.h | 60 +++++++++++++
6 files changed, 480 insertions(+), 14 deletions(-)
6 files changed, 479 insertions(+), 14 deletions(-)
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
index f03eeab2fb4..da3e454466b 100644
index 0e6e41a..8c96959 100644
--- a/grub-core/net/bootp.c
+++ b/grub-core/net/bootp.c
@@ -23,6 +23,7 @@
@ -24,10 +24,10 @@ index f03eeab2fb4..da3e454466b 100644
+#include <grub/net/url.h>
#include <grub/datetime.h>
static char *
@@ -349,6 +350,179 @@ grub_net_configure_by_dhcp_ack (const char *name,
return inter;
}
struct grub_dhcp_discover_options
@@ -935,6 +936,179 @@ grub_cmd_bootp (struct grub_command *cmd __attribute__ ((unused)),
static grub_command_t cmd_getdhcp, cmd_bootp, cmd_dhcp;
+struct grub_net_network_level_interface *
+grub_net_configure_by_dhcpv6_ack (const char *name,
@ -203,10 +203,10 @@ index f03eeab2fb4..da3e454466b 100644
+
+
void
grub_net_process_dhcp (struct grub_net_buff *nb,
struct grub_net_card *card)
grub_bootp_init (void)
{
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index a3ce4c67cce..329024b6f2c 100644
index 5388f95..a57189e 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -18,11 +18,15 @@
@ -225,7 +225,7 @@ index a3ce4c67cce..329024b6f2c 100644
GRUB_MOD_LICENSE ("GPLv3+");
@@ -409,7 +413,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
@@ -329,7 +333,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
char **path)
{
struct grub_net_card *card;
@ -234,16 +234,13 @@ index a3ce4c67cce..329024b6f2c 100644
dp = grub_efi_get_device_path (hnd);
if (! dp)
@@ -420,16 +424,22 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
@@ -340,14 +344,19 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
grub_efi_device_path_t *cdp;
struct grub_efi_pxe *pxe;
struct grub_efi_pxe_mode *pxe_mode;
+
if (card->driver != &efidriver)
continue;
+
if (hnd != card->efi_handle)
continue;
+
cdp = grub_efi_get_device_path (card->efi_handle);
if (! cdp)
@ -258,7 +255,7 @@ index a3ce4c67cce..329024b6f2c 100644
int match;
/* EDK2 UEFI PXE driver creates pseudo devices with type IPv4/IPv6
@@ -438,7 +448,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
@@ -356,7 +365,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
devices. We skip them when enumerating cards, so here we need to
find matching MAC device.
*/
@ -266,7 +263,7 @@ index a3ce4c67cce..329024b6f2c 100644
if (GRUB_EFI_DEVICE_PATH_TYPE (ldp) != GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE
|| (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE
&& GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) != GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE))
@@ -455,16 +464,46 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
@@ -373,16 +381,46 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
if (!match)
continue;
}
@ -319,7 +316,7 @@ index a3ce4c67cce..329024b6f2c 100644
}
}
diff --git a/grub-core/net/net.c b/grub-core/net/net.c
index 16d2ce06d5a..4be228d9576 100644
index 4b7972b..f24f1fd 100644
--- a/grub-core/net/net.c
+++ b/grub-core/net/net.c
@@ -955,6 +955,78 @@ grub_net_network_level_interface_register (struct grub_net_network_level_interfa
@ -402,7 +399,7 @@ index 16d2ce06d5a..4be228d9576 100644
grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inter,
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
index 7d90bf66e76..1157524fc50 100644
index 7d90bf6..1157524 100644
--- a/grub-core/net/tftp.c
+++ b/grub-core/net/tftp.c
@@ -379,19 +379,23 @@ tftp_open (struct grub_file *file, const char *filename)
@ -430,7 +427,7 @@ index 7d90bf66e76..1157524fc50 100644
grub_free (data);
return grub_errno;
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index 97b9aa7a4d7..02488ec35ae 100644
index addcbfa..d97cdf9 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -572,10 +572,16 @@ typedef void *grub_efi_handle_t;
@ -454,7 +451,7 @@ index 97b9aa7a4d7..02488ec35ae 100644
typedef grub_efi_uint64_t grub_efi_physical_address_t;
typedef grub_efi_uint64_t grub_efi_virtual_address_t;
@@ -1454,16 +1460,127 @@ struct grub_efi_simple_text_output_interface
@@ -1450,16 +1456,127 @@ struct grub_efi_simple_text_output_interface
};
typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t;
@ -585,10 +582,10 @@ index 97b9aa7a4d7..02488ec35ae 100644
typedef struct grub_efi_pxe
diff --git a/include/grub/net.h b/include/grub/net.h
index 50d62ab0c8c..f8f3ec13acc 100644
index ff6d347..3647012 100644
--- a/include/grub/net.h
+++ b/include/grub/net.h
@@ -442,6 +442,51 @@ struct grub_net_bootp_packet
@@ -447,6 +447,51 @@ struct grub_net_bootp_packet
grub_uint8_t vendor[0];
} GRUB_PACKED;
@ -640,7 +637,7 @@ index 50d62ab0c8c..f8f3ec13acc 100644
#define GRUB_NET_BOOTP_RFC1048_MAGIC_0 0x63
#define GRUB_NET_BOOTP_RFC1048_MAGIC_1 0x82
#define GRUB_NET_BOOTP_RFC1048_MAGIC_2 0x53
@@ -470,6 +515,21 @@ grub_net_configure_by_dhcp_ack (const char *name,
@@ -482,6 +527,21 @@ grub_net_configure_by_dhcp_ack (const char *name,
grub_size_t size,
int is_def, char **device, char **path);
@ -662,3 +659,6 @@ index 50d62ab0c8c..f8f3ec13acc 100644
grub_err_t
grub_net_add_ipv4_local (struct grub_net_network_level_interface *inf,
int mask);
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 6f9c2df8b9b7905038bab5f3627806c00199ae25 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 23 Jun 2016 11:01:39 -0400
Subject: [PATCH] Add grub-get-kernel-settings and use it in 10_linux
Subject: [PATCH 065/220] Add grub-get-kernel-settings and use it in 10_linux
This patch adds grub-get-kernel-settings, which reads the system kernel
installation configuration from /etc/sysconfig/kernel, and outputs
@ -11,23 +11,40 @@ debug stanzas.
Resolves: rhbz#1226325
---
Makefile.util.def | 7 ++
configure.ac | 2 +
Makefile.util.def | 7 +++
.gitignore | 2 +
util/bash-completion.d/grub-completion.bash.in | 22 ++++++++
util/grub-get-kernel-settings.3 | 20 +++++++
util/grub-get-kernel-settings.in | 78 ++++++++++++++++++++++++++
util/bash-completion.d/grub-completion.bash.in | 22 +++++++
util/grub-get-kernel-settings.3 | 20 ++++++
util/grub-get-kernel-settings.in | 88 ++++++++++++++++++++++++++
util/grub-mkconfig.in | 3 +
util/grub.d/10_linux.in | 23 ++++++--
8 files changed, 152 insertions(+), 5 deletions(-)
util/grub.d/10_linux.in | 23 +++++--
7 files changed, 160 insertions(+), 5 deletions(-)
create mode 100644 util/grub-get-kernel-settings.3
create mode 100644 util/grub-get-kernel-settings.in
diff --git a/Makefile.util.def b/Makefile.util.def
index e50436a..2215cc7 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -726,6 +726,13 @@ script = {
};
script = {
+ name = grub-get-kernel-settings;
+ common = util/grub-get-kernel-settings.in;
+ mansection = 3;
+ installdir = sbin;
+};
+
+script = {
name = grub-set-default;
common = util/grub-set-default.in;
mansection = 8;
diff --git a/configure.ac b/configure.ac
index 71d1056969e..aa06ed59c8d 100644
index 6850166..fc3c2b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,7 @@ grub_TRANSFORM([grub-install])
@@ -62,6 +62,7 @@ grub_TRANSFORM([grub-install])
grub_TRANSFORM([grub-mkconfig])
grub_TRANSFORM([grub-mkfont])
grub_TRANSFORM([grub-mkimage])
@ -35,7 +52,7 @@ index 71d1056969e..aa06ed59c8d 100644
grub_TRANSFORM([grub-glue-efi])
grub_TRANSFORM([grub-mklayout])
grub_TRANSFORM([grub-mkpasswd-pbkdf2])
@@ -75,6 +76,7 @@ grub_TRANSFORM([grub-file])
@@ -79,6 +80,7 @@ grub_TRANSFORM([grub-file])
grub_TRANSFORM([grub-bios-setup.3])
grub_TRANSFORM([grub-editenv.1])
grub_TRANSFORM([grub-fstest.3])
@ -43,46 +60,14 @@ index 71d1056969e..aa06ed59c8d 100644
grub_TRANSFORM([grub-glue-efi.3])
grub_TRANSFORM([grub-install.1])
grub_TRANSFORM([grub-kbdcomp.3])
diff --git a/Makefile.util.def b/Makefile.util.def
index fd91045bd6d..2d032643de7 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -714,6 +714,13 @@ script = {
installdir = sbin;
};
+script = {
+ name = grub-get-kernel-settings;
+ common = util/grub-get-kernel-settings.in;
+ mansection = 3;
+ installdir = sbin;
+};
+
script = {
name = grub-set-default;
common = util/grub-set-default.in;
diff --git a/.gitignore b/.gitignore
index 5066689bc0a..54795fa60be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,6 +68,8 @@ grub-*.tar.*
/grub*-fs-tester
/grub*-fstest
/grub*-fstest.1
+/grub*-get-kernel-settings
+/grub*-get-kernel-settings.3
/grub*-glue-efi
/grub*-glue-efi.1
/grub*-install
diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in
index 44bf135b9f8..5c4acd496d4 100644
index 44bf135..5c4acd4 100644
--- a/util/bash-completion.d/grub-completion.bash.in
+++ b/util/bash-completion.d/grub-completion.bash.in
@@ -264,6 +264,28 @@ have ${__grub_sparc64_setup_program} && \
unset __grub_sparc64_setup_program
@@ -265,6 +265,28 @@ unset __grub_sparc64_setup_program
+#
#
+# grub-get-kernel-settings
+#
+_grub_get_kernel_settings () {
@ -104,12 +89,13 @@ index 44bf135b9f8..5c4acd496d4 100644
+unset __grub_get_kernel_settings_program
+
+
#
+#
# grub-install
#
_grub_install () {
diff --git a/util/grub-get-kernel-settings.3 b/util/grub-get-kernel-settings.3
new file mode 100644
index 00000000000..ba33330e28d
index 0000000..ba33330
--- /dev/null
+++ b/util/grub-get-kernel-settings.3
@@ -0,0 +1,20 @@
@ -135,10 +121,10 @@ index 00000000000..ba33330e28d
+.BR "info grub"
diff --git a/util/grub-get-kernel-settings.in b/util/grub-get-kernel-settings.in
new file mode 100644
index 00000000000..12046219878
index 0000000..7e87dfc
--- /dev/null
+++ b/util/grub-get-kernel-settings.in
@@ -0,0 +1,78 @@
@@ -0,0 +1,88 @@
+#!/bin/sh
+set -e
+
@ -217,8 +203,18 @@ index 00000000000..12046219878
+ echo GRUB_LINUX_DEBUG_TITLE_POSTFIX=\" with debugging\"
+ echo export GRUB_LINUX_DEBUG_TITLE_POSTFIX
+fi
+if [ "$DEFAULTDEBUG" = "yes" ]; then
+ echo GRUB_DEFAULT_TO_DEBUG=true
+else
+ echo GRUB_DEFAULT_TO_DEBUG=false
+fi
+echo export GRUB_DEFAULT_TO_DEBUG
+if [ "$UPDATEDEFAULT" = "yes" ]; then
+ echo GRUB_UPDATE_DEFAULT_KERNEL=true
+ echo export GRUB_UPDATE_DEFAULT_KERNEL
+fi
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index bdb9982aefb..8218f3d477f 100644
index 4e7a875..6247a0b 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -45,6 +45,7 @@ grub_probe="${sbindir}/@grub_probe@"
@ -239,7 +235,7 @@ index bdb9982aefb..8218f3d477f 100644
if [ -z "$GRUB_DEVICE_UUID" ]; then
GRUB_DEVICE_UUID="$GRUB_DEVICE_UUID_GENERATED"
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index a8a8e2cf325..4e49ccdf742 100644
index 12a20c9..55f4aa7 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -111,7 +111,8 @@ linux_entry ()
@ -298,3 +294,6 @@ index a8a8e2cf325..4e49ccdf742 100644
"single ${GRUB_CMDLINE_LINUX}"
fi
--
1.8.3.1

View File

@ -1,18 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From be6b7ff630f73fe21b797d5396a29944262d3805 Mon Sep 17 00:00:00 2001
From: Lenny Szubowicz <lszubowi@redhat.com>
Date: Mon, 29 Aug 2016 11:04:48 -0400
Subject: [PATCH] Normalize slashes in tftp paths.
Subject: [PATCH 066/220] Normalize slashes in tftp paths.
Some tftp servers do not handle multiple consecutive slashes correctly;
this patch avoids sending tftp requests with non-normalized paths.
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
[msalter: fix malformed tftp packets]
Signed-off-by: Mark Salter <msalter@redhat.com>
---
grub-core/net/tftp.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
grub-core/net/tftp.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
index 1157524fc50..5ca0a96a6f6 100644
index 1157524..dcd8249 100644
--- a/grub-core/net/tftp.c
+++ b/grub-core/net/tftp.c
@@ -300,6 +300,25 @@ destroy_pq (tftp_data_t data)
@ -41,15 +43,22 @@ index 1157524fc50..5ca0a96a6f6 100644
static grub_err_t
tftp_open (struct grub_file *file, const char *filename)
{
@@ -337,7 +356,10 @@ tftp_open (struct grub_file *file, const char *filename)
@@ -337,9 +356,12 @@ tftp_open (struct grub_file *file, const char *filename)
rrqlen = 0;
tftph->opcode = grub_cpu_to_be16_compile_time (TFTP_RRQ);
- grub_strcpy (rrq, filename);
- rrqlen += grub_strlen (filename) + 1;
- rrq += grub_strlen (filename) + 1;
+
+ /* Copy and normalize the filename to work-around issues on some tftp
+ servers when file names are being matched for remapping. */
+ grub_normalize_filename (rrq, filename);
rrqlen += grub_strlen (filename) + 1;
rrq += grub_strlen (filename) + 1;
+ rrqlen += grub_strlen (rrq) + 1;
+ rrq += grub_strlen (rrq) + 1;
grub_strcpy (rrq, "octet");
rrqlen += grub_strlen ("octet") + 1;
--
1.8.3.1

View File

@ -1,45 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik@fb.com>
Date: Mon, 31 Aug 2015 13:34:35 -0400
Subject: [PATCH] efinet: retransmit if our device is busy
When I fixed the txbuf handling I ripped out the retransmission code since it
was flooding our network when we had the buggy behavior. Turns out this was too
heavy handed as we can still have transient tx timeouts. So instead make sure
we retry our transmission once per timeout. This way we can deal with transient
transmission problems without flooding the box. This fixes an issue we were
seeing in production. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
grub-core/net/drivers/efi/efinet.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index 5388f952ba9..3f112438a93 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -38,6 +38,7 @@ send_card_buffer (struct grub_net_card *dev,
grub_efi_simple_network_t *net = dev->efi_net;
grub_uint64_t limit_time = grub_get_time_ms () + 4000;
void *txbuf;
+ int retry = 0;
if (dev->txbusy)
while (1)
@@ -60,6 +61,15 @@ send_card_buffer (struct grub_net_card *dev,
dev->txbusy = 0;
break;
}
+ if (!retry)
+ {
+ st = efi_call_7 (net->transmit, net, 0, dev->last_pkt_size,
+ dev->txbuf, NULL, NULL, NULL);
+ if (st != GRUB_EFI_SUCCESS)
+ return grub_error (GRUB_ERR_IO,
+ N_("couldn't send network packet"));
+ retry = 1;
+ }
if (limit_time < grub_get_time_ms ())
return grub_error (GRUB_ERR_TIMEOUT,
N_("couldn't send network packet"));

View File

@ -1,221 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 11 Sep 2015 17:30:49 -0400
Subject: [PATCH] Be more aggro about actually using the *configured* network
device.
Right now we use any SNP device with the same mac+IP block, but when
it's discovered there will be more than one of them. We need to pick
the same one we were loaded with, so that it'll be configured the same
way as it was before, and won't be re-used by the system firmware later.
Resolves: rhbz#1257475
Signed-off-by: Peter Jones <example@example.com>
---
grub-core/net/drivers/efi/efinet.c | 124 +++++++++++++++++++++++++++++--------
include/grub/efi/api.h | 4 ++
2 files changed, 102 insertions(+), 26 deletions(-)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index 3f112438a93..a3ce4c67cce 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -239,46 +239,85 @@ grub_efinet_get_device_handle (struct grub_net_card *card)
return card->efi_handle;
}
-static void
-grub_efinet_findcards (void)
+static int
+grub_efinet_find_snp_cards (int preferred_only, grub_efi_handle_t preferred,
+ int *i)
{
- grub_efi_uintn_t num_handles;
- grub_efi_handle_t *handles;
+ grub_efi_uintn_t num_handles = 0;
+ grub_efi_handle_t *handles = NULL;
grub_efi_handle_t *handle;
- int i = 0;
+ grub_efi_device_path_t *pdp = NULL, *pp = NULL, *pc = NULL;
+ int ret = 0;
- /* Find handles which support the disk io interface. */
+ if (preferred)
+ {
+ grub_efi_device_path_t *pdpc;
+ pdpc = pdp = grub_efi_get_device_path (preferred);
+ if (pdp == NULL)
+ {
+ grub_print_error ();
+ return -1;
+ }
+
+ for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (pdpc);
+ pdpc = GRUB_EFI_NEXT_DEVICE_PATH (pdpc))
+ {
+ pp = pc;
+ pc = pdpc;
+ }
+ }
+
+ /* Find handles which support the SNP interface. */
handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &net_io_guid,
0, &num_handles);
- if (! handles)
- return;
- for (handle = handles; num_handles--; handle++)
+
+ for (handle = handles; handle && num_handles--; handle++)
{
grub_efi_simple_network_t *net;
struct grub_net_card *card;
grub_efi_device_path_t *dp, *parent = NULL, *child = NULL;
- /* EDK2 UEFI PXE driver creates IPv4 and IPv6 messaging devices as
- children of main MAC messaging device. We only need one device with
- bound SNP per physical card, otherwise they compete with each other
- when polling for incoming packets.
- */
+ /* if we're looking for only the preferred handle, skip anything that
+ isn't it. */
+ if (preferred_only && preferred != NULL && *handle != preferred)
+ continue;
+
+ /* if we're not looking for the preferred handle, skip it if it's
+ found. */
+ if (!preferred_only && *handle == preferred)
+ continue;
+
dp = grub_efi_get_device_path (*handle);
if (!dp)
continue;
- for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp); dp = GRUB_EFI_NEXT_DEVICE_PATH (dp))
+
+ for (; ! GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp);
+ dp = GRUB_EFI_NEXT_DEVICE_PATH (dp))
{
parent = child;
child = dp;
}
- if (child
- && GRUB_EFI_DEVICE_PATH_TYPE (child) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE
- && (GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE
- || GRUB_EFI_DEVICE_PATH_SUBTYPE (child) == GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE)
- && parent
- && GRUB_EFI_DEVICE_PATH_TYPE (parent) == GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE
- && GRUB_EFI_DEVICE_PATH_SUBTYPE (parent) == GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE)
- continue;
+
+ if (!preferred_only)
+ {
+ if (pp && pc
+ && grub_efi_compare_device_paths (pp, parent) == 0
+ && grub_efi_compare_device_paths (pc, child) == 0)
+ continue;
+
+ if (child
+ && (GRUB_EFI_DEVICE_PATH_IS_TYPE(child,
+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE,
+ GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE) ||
+ GRUB_EFI_DEVICE_PATH_IS_TYPE(child,
+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE,
+ GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE))
+ && parent
+ && (GRUB_EFI_DEVICE_PATH_IS_TYPE(parent,
+ GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE,
+ GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE)))
+ continue;
+ }
net = grub_efi_open_protocol (*handle, &net_io_guid,
GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
@@ -302,7 +341,7 @@ grub_efinet_findcards (void)
{
grub_print_error ();
grub_free (handles);
- return;
+ return -1;
}
card->mtu = net->mode->max_packet_size;
@@ -313,13 +352,14 @@ grub_efinet_findcards (void)
grub_print_error ();
grub_free (handles);
grub_free (card);
- return;
+ return -1;
}
card->txbusy = 0;
card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256;
- card->name = grub_xasprintf ("efinet%d", i++);
+ card->name = grub_xasprintf ("efinet%d", *i);
+ *i = (*i)+1;
card->driver = &efidriver;
card->flags = 0;
card->default_address.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET;
@@ -330,8 +370,38 @@ grub_efinet_findcards (void)
card->efi_handle = *handle;
grub_net_card_register (card);
+ ret++;
}
grub_free (handles);
+
+ return ret;
+}
+
+static void
+grub_efinet_findcards (void)
+{
+ grub_efi_loaded_image_t *image = NULL;
+ int rc;
+ int efinet_number = 0;
+
+ image = grub_efi_get_loaded_image (grub_efi_image_handle);
+
+ if (image && image->device_handle)
+ {
+ rc = grub_efinet_find_snp_cards (1, image->device_handle, &efinet_number);
+ if (rc < 0)
+ return;
+
+ rc = grub_efinet_find_snp_cards (0, image->device_handle, &efinet_number);
+ if (rc < 0)
+ return;
+ }
+ else
+ {
+ rc = grub_efinet_find_snp_cards (0, NULL, &efinet_number);
+ if (rc < 0)
+ return;
+ }
}
static void
@@ -352,6 +422,8 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
struct grub_efi_pxe_mode *pxe_mode;
if (card->driver != &efidriver)
continue;
+ if (hnd != card->efi_handle)
+ continue;
cdp = grub_efi_get_device_path (card->efi_handle);
if (! cdp)
continue;
diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h
index c7c9f0e1db1..97b9aa7a4d7 100644
--- a/include/grub/efi/api.h
+++ b/include/grub/efi/api.h
@@ -622,6 +622,10 @@ typedef struct grub_efi_device_path grub_efi_device_path_t;
It seems to be identical to EFI_DEVICE_PATH. */
typedef struct grub_efi_device_path grub_efi_device_path_protocol_t;
+#define GRUB_EFI_DEVICE_PATH_IS_TYPE(dp, type, subtype) \
+ ((GRUB_EFI_DEVICE_PATH_TYPE(dp) == (type)) && \
+ (GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) == (subtype)))
+
#define GRUB_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f)
#define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype)
#define GRUB_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length)

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 293c75639a43d2ff06fe4824cb306ed81e1aa5af Mon Sep 17 00:00:00 2001
From: Masahiro Matsuya <mmatsuya@redhat.com>
Date: Sat, 29 Oct 2016 08:35:26 +0900
Subject: [PATCH] bz1374141 fix incorrect mask for ppc64
Subject: [PATCH 067/220] bz1374141 fix incorrect mask for ppc64
The netmask configured in firmware is not respected on ppc64 (big endian).
When 255.255.252.0 is set as netmask in firmware, the following is the value of bootpath string in grub_ieee1275_parse_bootpath().
@ -30,7 +30,7 @@ The count of zero with __builtin_clz can be 22. (clz counts the number of one bi
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c
index 002446be1c3..3df75357a70 100644
index ac4e62a..3860b6f 100644
--- a/grub-core/net/drivers/ieee1275/ofnet.c
+++ b/grub-core/net/drivers/ieee1275/ofnet.c
@@ -220,8 +220,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath,
@ -43,3 +43,6 @@ index 002446be1c3..3df75357a70 100644
}
if (gateway_addr.ipv4 != 0)
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From fc5bc8610eb9e556ced1f1b91f9c4f34a51f3852 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 27 Jan 2016 09:22:42 -0500
Subject: [PATCH] Make grub_fatal() also backtrace.
Subject: [PATCH 068/220] Make grub_fatal() also backtrace.
---
grub-core/Makefile.core.def | 3 ++
@ -13,10 +13,10 @@ Subject: [PATCH] Make grub_fatal() also backtrace.
create mode 100644 grub-core/lib/arm64/backtrace.c
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 991891a6e09..27563743ba9 100644
index 99466b1..ebc5580 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -175,6 +175,9 @@ kernel = {
@@ -186,6 +186,9 @@ kernel = {
softdiv = lib/division.c;
@ -25,9 +25,9 @@ index 991891a6e09..27563743ba9 100644
+
i386 = kern/i386/dl.c;
i386_xen = kern/i386/dl.c;
i386_xen_pvh = kern/i386/dl.c;
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index f1fab700048..5ce89a40c68 100644
index 1c560ea..04371ac 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -24,6 +24,7 @@
@ -55,7 +55,7 @@ index f1fab700048..5ce89a40c68 100644
#endif
diff --git a/grub-core/lib/arm64/backtrace.c b/grub-core/lib/arm64/backtrace.c
new file mode 100644
index 00000000000..1079b5380e1
index 0000000..1079b53
--- /dev/null
+++ b/grub-core/lib/arm64/backtrace.c
@@ -0,0 +1,62 @@
@ -122,7 +122,7 @@ index 00000000000..1079b5380e1
+}
+
diff --git a/grub-core/lib/backtrace.c b/grub-core/lib/backtrace.c
index 825a8800e25..c0ad6ab8be1 100644
index 825a880..c0ad6ab 100644
--- a/grub-core/lib/backtrace.c
+++ b/grub-core/lib/backtrace.c
@@ -29,6 +29,7 @@ GRUB_MOD_LICENSE ("GPLv3+");
@ -142,7 +142,7 @@ index 825a8800e25..c0ad6ab8be1 100644
}
diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c
index c3e03c7275c..c67273db3ae 100644
index c3e03c7..c67273d 100644
--- a/grub-core/lib/i386/backtrace.c
+++ b/grub-core/lib/i386/backtrace.c
@@ -15,11 +15,23 @@
@ -170,3 +170,6 @@ index c3e03c7275c..c67273db3ae 100644
#include <grub/mm.h>
#include <grub/term.h>
#include <grub/backtrace.h>
--
1.8.3.1

View File

@ -1,59 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: RHEL Ninjas <example@example.com>
Date: Fri, 25 Sep 2015 16:24:23 +0900
Subject: [PATCH] efinet: add filter for the first exclusive reopen of SNP
---
grub-core/net/drivers/efi/efinet.c | 39 ++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index a3ce4c67cce..b870d3f1938 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -465,6 +465,45 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
&pxe_mode->dhcp_ack,
sizeof (pxe_mode->dhcp_ack),
1, device, path);
+ net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
+ GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
+ if (net) {
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
+ && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
+ continue;
+
+ if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
+ continue;
+
+ if (net->mode->state == GRUB_EFI_NETWORK_STARTED
+ && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
+ continue;
+
+ /* Enable hardware receive filters if driver declares support for it.
+ We need unicast and broadcast and additionaly all nodes and
+ solicited multicast for IPv6. Solicited multicast is per-IPv6
+ address and we currently do not have API to do it so simply
+ try to enable receive of all multicast packets or evertyhing in
+ the worst case (i386 PXE driver always enables promiscuous too).
+
+ This does trust firmware to do what it claims to do.
+ */
+ if (net->mode->receive_filter_mask)
+ {
+ grub_uint32_t filters = GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
+ GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST |
+ GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;
+
+ filters &= net->mode->receive_filter_mask;
+ if (!(filters & GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST))
+ filters |= (net->mode->receive_filter_mask &
+ GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS);
+
+ efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL);
+ }
+
+ card->efi_net = net;
+ }
return;
}
}

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From b059bbecd37f4111fa514a6b7bbda9910325a0f5 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 23 Sep 2014 09:58:49 -0400
Subject: [PATCH] Fix up some man pages rpmdiff noticed.
Subject: [PATCH 069/220] Fix up some man pages rpmdiff noticed.
---
configure.ac | 2 ++
@ -13,10 +13,10 @@ Subject: [PATCH] Fix up some man pages rpmdiff noticed.
create mode 100644 util/grub-syslinux2cfg.1
diff --git a/configure.ac b/configure.ac
index aa06ed59c8d..f69f8986791 100644
index fc3c2b4..eb851b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,7 @@ grub_TRANSFORM([grub-get-kernel-settings.3])
@@ -84,6 +84,7 @@ grub_TRANSFORM([grub-get-kernel-settings.3])
grub_TRANSFORM([grub-glue-efi.3])
grub_TRANSFORM([grub-install.1])
grub_TRANSFORM([grub-kbdcomp.3])
@ -24,7 +24,7 @@ index aa06ed59c8d..f69f8986791 100644
grub_TRANSFORM([grub-menulst2cfg.1])
grub_TRANSFORM([grub-mkconfig.1])
grub_TRANSFORM([grub-mkfont.3])
@@ -98,6 +99,7 @@ grub_TRANSFORM([grub-render-label.3])
@@ -102,6 +103,7 @@ grub_TRANSFORM([grub-render-label.3])
grub_TRANSFORM([grub-script-check.3])
grub_TRANSFORM([grub-set-default.1])
grub_TRANSFORM([grub-sparc64-setup.3])
@ -34,7 +34,7 @@ index aa06ed59c8d..f69f8986791 100644
if test "x$TARGET_CFLAGS" = x; then
diff --git a/util/grub-macbless.8 b/util/grub-macbless.8
new file mode 100644
index 00000000000..ae842f3a606
index 0000000..ae842f3
--- /dev/null
+++ b/util/grub-macbless.8
@@ -0,0 +1,26 @@
@ -65,7 +65,7 @@ index 00000000000..ae842f3a606
+.SH SEE ALSO
+.BR "info grub"
diff --git a/util/grub-mkimage.1 b/util/grub-mkimage.1
index 4dea4f54597..0eaaafe505b 100644
index 4dea4f5..0eaaafe 100644
--- a/util/grub-mkimage.1
+++ b/util/grub-mkimage.1
@@ -17,7 +17,7 @@
@ -79,7 +79,7 @@ index 4dea4f54597..0eaaafe505b 100644
.TP
diff --git a/util/grub-syslinux2cfg.1 b/util/grub-syslinux2cfg.1
new file mode 100644
index 00000000000..85309482718
index 0000000..8530948
--- /dev/null
+++ b/util/grub-syslinux2cfg.1
@@ -0,0 +1,65 @@
@ -148,3 +148,6 @@ index 00000000000..85309482718
+
+.SH SEE ALSO
+.BR "info grub"
--
1.8.3.1

View File

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Mon, 22 Feb 2016 15:30:05 -0500
Subject: [PATCH] Warn if grub password will not be read (#1290803)
It is possible for a system to have never run grub-mkconfig and add the
section that reads the user.cfg file which contains a user set GRUB
password. Users in that scenario will now be warned that grub-mkconfig
must be run prior to their newly set password taking effect.
Resolves: rhbz#1290803
---
util/grub-setpassword.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
index dd76f00fc0e..fb9d3a3b6f9 100644
--- a/util/grub-setpassword.in
+++ b/util/grub-setpassword.in
@@ -121,3 +121,8 @@ fi
install -m 0600 /dev/null "${grubdir}/user.cfg" 2>/dev/null || :
chmod 0600 "${grubdir}/user.cfg" 2>/dev/null || :
echo "GRUB2_PASSWORD=${MYPASS}" > "${grubdir}/user.cfg"
+
+if ! grep -q "^### BEGIN /etc/grub.d/01_users ###$" "${grubdir}/grub.cfg"; then
+ echo "WARNING: The current configuration lacks password support!"
+ echo "Update your configuration with @grub_mkconfig@ to support this feature."
+fi

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 32025dc603bdf22bdb60ebbd881a4b43b587a1a0 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
Date: Mon, 17 Apr 2017 08:44:29 -0400
Subject: [PATCH] arm64: make sure fdt has #address-cells and #size-cells
properties
Subject: [PATCH 070/220] arm64: make sure fdt has #address-cells and
#size-cells properties
Recent upstream changes to kexec-tools relies on #address-cells
and #size-cells properties in the FDT. If grub2 needs to create
@ -14,10 +14,10 @@ make sure they exist.
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c
index a1ac7a38867..93b5cd306eb 100644
index 04994d5..4c0a09c 100644
--- a/grub-core/loader/arm64/linux.c
+++ b/grub-core/loader/arm64/linux.c
@@ -80,7 +80,21 @@ finalize_params_linux (void)
@@ -81,7 +81,21 @@ finalize_params_linux (void)
node = grub_fdt_find_subnode (fdt, 0, "chosen");
if (node < 0)
@ -40,3 +40,6 @@ index a1ac7a38867..93b5cd306eb 100644
if (node < 1)
goto failure;
--
1.8.3.1

View File

@ -1,55 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Tue, 26 Jan 2016 10:28:35 -0500
Subject: [PATCH] Clean up grub-setpassword documentation (#1290799)
The output for --help had some errors. Corrected those and polished the
text to be a little easier to follow. Carried verbage over to man page
to maintain internal consistency.
Resolves: rhbz#1290799
---
util/grub-setpassword.8 | 2 +-
util/grub-setpassword.in | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/util/grub-setpassword.8 b/util/grub-setpassword.8
index 49200a848b7..dc91dd6697b 100644
--- a/util/grub-setpassword.8
+++ b/util/grub-setpassword.8
@@ -19,7 +19,7 @@ Display program usage and exit.
-v, --version
Display the current version.
.TP
--o, --output[=\fIDIRECTORY PATH\fR]
+-o, --output=<\fIDIRECTORY\fR>
Choose the file path to which user.cfg will be written.
.SH SEE ALSO
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
index fb9d3a3b6f9..c8c0fa4199d 100644
--- a/util/grub-setpassword.in
+++ b/util/grub-setpassword.in
@@ -16,15 +16,14 @@ grub_mkpasswd="${bindir}/@grub_mkpasswd_pbkdf2@"
# Print the usage.
usage () {
cat <<EOF
-Usage: $0 [OPTION] [SOURCE]
-Run GRUB script in a Qemu instance.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- -o, --output_path choose a custom output path for user.cfg
-
+Usage: $0 [OPTION]
$0 prompts the user to set a password on the grub bootloader. The password
-is written to a file named user.cfg.
+is written to a file named user.cfg which lives in the GRUB directory
+located by default at ${grubdir}.
+
+ -h, --help print this message and exit
+ -v, --version print the version information and exit
+ -o, --output_path <DIRECTORY> put user.cfg in a user-selected directory
Report bugs at https://bugzilla.redhat.com.
EOF

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 13afb4d63420d8e1578efc8f5a3fe66c9c14e88a Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 6 May 2016 18:43:08 -0400
Subject: [PATCH] Make our info pages say "grub2" where appropriate.
Date: Tue, 9 Jul 2019 12:59:58 +0200
Subject: [PATCH 071/220] Make our info pages say "grub2" where appropriate.
This needs to be hooked up to --program-transform=, but I haven't had
time.
@ -13,7 +13,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
2 files changed, 161 insertions(+), 161 deletions(-)
diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
index a9f4de6318c..3ce827ab726 100644
index ee389fd..e3fed73 100644
--- a/docs/grub-dev.texi
+++ b/docs/grub-dev.texi
@@ -1,7 +1,7 @@
@ -35,7 +35,7 @@ index a9f4de6318c..3ce827ab726 100644
@setchapternewpage odd
diff --git a/docs/grub.texi b/docs/grub.texi
index a7155c22ffe..2b7b7faf847 100644
index 221064b..960e5f3 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -1,7 +1,7 @@
@ -609,7 +609,7 @@ index a7155c22ffe..2b7b7faf847 100644
@samp{GRUB_SAVEDEFAULT} (@pxref{Simple configuration}).
@@ -4396,7 +4396,7 @@ Translate @var{string} into the current language.
@@ -4398,7 +4398,7 @@ Translate @var{string} into the current language.
The current language code is stored in the @samp{lang} variable in GRUB's
environment (@pxref{lang}). Translation files in MO format are read from
@ -618,7 +618,7 @@ index a7155c22ffe..2b7b7faf847 100644
@end deffn
@@ -4791,7 +4791,7 @@ Define a user named @var{user} with password @var{clear-password}.
@@ -4793,7 +4793,7 @@ Define a user named @var{user} with password @var{clear-password}.
@deffn Command password_pbkdf2 user hashed-password
Define a user named @var{user} with password hash @var{hashed-password}.
@ -627,7 +627,7 @@ index a7155c22ffe..2b7b7faf847 100644
to generate password hashes. @xref{Security}.
@end deffn
@@ -5614,8 +5614,8 @@ The @samp{password} (@pxref{password}) and @samp{password_pbkdf2}
@@ -5651,8 +5651,8 @@ The @samp{password} (@pxref{password}) and @samp{password_pbkdf2}
which has an associated password. @samp{password} sets the password in
plain text, requiring @file{grub.cfg} to be secure; @samp{password_pbkdf2}
sets the password hashed using the Password-Based Key Derivation Function
@ -638,7 +638,7 @@ index a7155c22ffe..2b7b7faf847 100644
In order to enable authentication support, the @samp{superusers} environment
variable must be set to a list of usernames, separated by any of spaces,
@@ -5659,7 +5659,7 @@ menuentry "May be run by user1 or a superuser" --users user1 @{
@@ -5696,7 +5696,7 @@ menuentry "May be run by user1 or a superuser" --users user1 @{
@end group
@end example
@ -647,7 +647,7 @@ index a7155c22ffe..2b7b7faf847 100644
generating configuration files with authentication. You can use
@file{/etc/grub.d/40_custom} to add simple superuser authentication, by
adding @kbd{set superusers=} and @kbd{password} or @kbd{password_pbkdf2}
@@ -5684,15 +5684,15 @@ verified with a public key currently trusted by GRUB
@@ -5721,15 +5721,15 @@ verified with a public key currently trusted by GRUB
validation fails, then file @file{foo} cannot be opened. This failure
may halt or otherwise impact the boot process.
@ -668,7 +668,7 @@ index a7155c22ffe..2b7b7faf847 100644
GRUB uses GPG-style detached signatures (meaning that a file
@file{foo.sig} will be produced when file @file{foo} is signed), and
@@ -5712,8 +5712,8 @@ gpg --detach-sign /path/to/file
@@ -5749,8 +5749,8 @@ gpg --detach-sign /path/to/file
For successful validation of all of GRUB's subcomponents and the
loaded OS kernel, they must all be signed. One way to accomplish this
is the following (after having already produced the desired
@ -679,7 +679,7 @@ index a7155c22ffe..2b7b7faf847 100644
@example
@group
@@ -5735,7 +5735,7 @@ See also: @ref{check_signatures}, @ref{verify_detached}, @ref{trust},
@@ -5772,7 +5772,7 @@ See also: @ref{check_signatures}, @ref{verify_detached}, @ref{trust},
Note that internally signature enforcement is controlled by setting
the environment variable @code{check_signatures} equal to
@code{enforce}. Passing one or more @code{--pubkey} options to
@ -688,7 +688,7 @@ index a7155c22ffe..2b7b7faf847 100644
equal to @code{enforce} in @file{core.img} prior to processing any
configuration files.
@@ -6092,10 +6092,10 @@ Required files are:
@@ -6189,10 +6189,10 @@ Required files are:
GRUB's normal start-up procedure involves setting the @samp{prefix}
environment variable to a value set in the core image by
@ -701,7 +701,7 @@ index a7155c22ffe..2b7b7faf847 100644
things GRUB is supposed to do.
If, instead, you only get a rescue shell, this usually means that GRUB
@@ -6121,8 +6121,8 @@ normal
@@ -6218,8 +6218,8 @@ normal
However, any problem that leaves you in the rescue shell probably means that
GRUB was not correctly installed. It may be more useful to try to reinstall
@ -712,7 +712,7 @@ index a7155c22ffe..2b7b7faf847 100644
@itemize @bullet{}
@item
@@ -6134,7 +6134,7 @@ is usually better to use UUIDs or file system labels and avoid depending on
@@ -6231,7 +6231,7 @@ is usually better to use UUIDs or file system labels and avoid depending on
drive ordering entirely.
@item
@ -721,8 +721,8 @@ index a7155c22ffe..2b7b7faf847 100644
to a partition but GRUB has already been installed in the master boot
record, then the GRUB installation in the partition will be ignored.
@@ -6154,21 +6154,21 @@ support has not yet been added to GRUB.
@end itemize
@@ -6262,21 +6262,21 @@ entry which claims partition start at block 0. This change will not hamper
bootability on other machines.
-@node Invoking grub-install
@ -749,7 +749,7 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item --help
@@ -6184,13 +6184,13 @@ separate partition or a removable disk.
@@ -6292,13 +6292,13 @@ separate partition or a removable disk.
If this option is not specified then it defaults to @file{/boot}, so
@example
@ -765,7 +765,7 @@ index a7155c22ffe..2b7b7faf847 100644
@end example
Here is an example in which you have a separate @dfn{boot} partition which is
@@ -6198,16 +6198,16 @@ mounted on
@@ -6306,16 +6306,16 @@ mounted on
@file{/mnt/boot}:
@example
@ -785,7 +785,7 @@ index a7155c22ffe..2b7b7faf847 100644
extra space in the bootloader embedding area for Reed-Solomon
error-correcting codes. This enables GRUB to still boot successfully
if some blocks are corrupted. The exact amount of protection offered
@@ -6220,17 +6220,17 @@ installation}) where GRUB does not reside in any unpartitioned space
@@ -6328,17 +6328,17 @@ installation}) where GRUB does not reside in any unpartitioned space
outside of the MBR. Disable the Reed-Solomon codes with this option.
@end table
@ -808,7 +808,7 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item --help
@@ -6246,17 +6246,17 @@ it to standard output.
@@ -6354,17 +6354,17 @@ it to standard output.
@end table
@ -830,7 +830,7 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item -c @var{number}
@@ -6274,23 +6274,23 @@ Length of the salt. Defaults to 64.
@@ -6382,23 +6382,23 @@ Length of the salt. Defaults to 64.
@end table
@ -860,7 +860,7 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item --help
@@ -6301,17 +6301,17 @@ Print the version number of GRUB and exit.
@@ -6409,17 +6409,17 @@ Print the version number of GRUB and exit.
@end table
@ -882,7 +882,7 @@ index a7155c22ffe..2b7b7faf847 100644
passed on directly to @command{xorriso} in @command{mkisofs} emulation mode.
Options passed to @command{xorriso} will normally be interpreted as
@command{mkisofs} options; if the option @samp{--} is used, then anything
@@ -6326,7 +6326,7 @@ mkdir -p disk/boot/grub
@@ -6434,7 +6434,7 @@ mkdir -p disk/boot/grub
grub-mkrescue -o grub.iso disk
@end example
@ -891,7 +891,7 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item --help
@@ -6354,15 +6354,15 @@ Use @var{file} as the @command{xorriso} program, rather than the built-in
@@ -6462,15 +6462,15 @@ Use @var{file} as the @command{xorriso} program, rather than the built-in
default.
@item --grub-mkimage=@var{file}
@ -911,7 +911,7 @@ index a7155c22ffe..2b7b7faf847 100644
system or file system image that GRUB understands, using GRUB's file system
drivers via FUSE. (It is only available if FUSE development files were
present when GRUB was built.) This has a number of uses:
@@ -6394,13 +6394,13 @@ even if nobody has yet written a FUSE module specifically for that file
@@ -6502,13 +6502,13 @@ even if nobody has yet written a FUSE module specifically for that file
system type.
@end itemize
@ -927,7 +927,7 @@ index a7155c22ffe..2b7b7faf847 100644
non-option arguments (if it is given more than one image, it will treat them
as a RAID set), and also accepts the following options:
@@ -6422,13 +6422,13 @@ Show debugging output for conditions matching @var{string}.
@@ -6530,13 +6530,13 @@ Show debugging output for conditions matching @var{string}.
@item -K prompt|@var{file}
@itemx --zfs-key=prompt|@var{file}
Load a ZFS encryption key. If you use @samp{prompt} as the argument,
@ -943,7 +943,7 @@ index a7155c22ffe..2b7b7faf847 100644
root of the supplied file system.
If @var{device} is just a number, then it will be treated as a partition
@@ -6446,10 +6446,10 @@ Print verbose messages.
@@ -6554,10 +6554,10 @@ Print verbose messages.
@end table
@ -957,7 +957,7 @@ index a7155c22ffe..2b7b7faf847 100644
or device.
@example
@@ -6457,7 +6457,7 @@ grub-probe --target=fs /boot/grub
@@ -6565,7 +6565,7 @@ grub-probe --target=fs /boot/grub
grub-probe --target=drive --device /dev/sda1
@end example
@ -966,7 +966,7 @@ index a7155c22ffe..2b7b7faf847 100644
argument, and also accepts the following options:
@table @option
@@ -6470,16 +6470,16 @@ Print the version number of GRUB and exit.
@@ -6578,16 +6578,16 @@ Print the version number of GRUB and exit.
@item -d
@itemx --device
If this option is given, then the non-option argument is a system device
@ -986,7 +986,7 @@ index a7155c22ffe..2b7b7faf847 100644
@item -t @var{target}
@itemx --target=@var{target}
@@ -6532,19 +6532,19 @@ Print verbose messages.
@@ -6640,19 +6640,19 @@ Print verbose messages.
@end table
@ -1011,3 +1011,6 @@ index a7155c22ffe..2b7b7faf847 100644
@table @option
@item --help
--
1.8.3.1

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Marshall <rmarshall@redhat.com>
Date: Fri, 29 Jan 2016 16:56:11 -0500
Subject: [PATCH] Fix locale issue in grub-setpassword (#1294243)
A shell substitution was expecting non-translated output to grab the
hashed password and put it in the user.cfg file. Modified code to force
the generic C locale when this particular piece of code is run.
Resolves: rhbz#1294243
---
util/grub-setpassword.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/grub-setpassword.in b/util/grub-setpassword.in
index c8c0fa4199d..d7924af5192 100644
--- a/util/grub-setpassword.in
+++ b/util/grub-setpassword.in
@@ -104,7 +104,7 @@ getpass() {
P1="$1" && shift
( echo ${P0} ; echo ${P1} ) | \
- ${grub_mkpasswd} | \
+ LC_ALL=C ${grub_mkpasswd} | \
grep -v '[eE]nter password:' | \
sed -e "s/PBKDF2 hash of your password is //"
}

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 2b61111bf5f5fa076faa6c7ad1066823b16b1474 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 1 May 2017 11:19:40 -0400
Subject: [PATCH] print more debug info in our module loader.
Subject: [PATCH 072/220] print more debug info in our module loader.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index e339f264b3a..562d6887e0e 100644
index 370ce03..a1af9b4 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -313,13 +313,23 @@ grub_efi_modules_addr (void)
@ -39,3 +39,6 @@ index e339f264b3a..562d6887e0e 100644
return (grub_addr_t) info;
}
--
1.8.3.1

View File

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robert Elliott <elliott@hpe.com>
Date: Fri, 22 Jan 2016 13:32:30 +0100
Subject: [PATCH] efiemu: Handle persistent RAM and unknown possible future
additions.
(cherry picked from commit ae3b83a4d4df75a01198a2fed7542391e7c449e0)
Resolves: rhbz#1288608
---
grub-core/efiemu/mm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c
index 52a032f7b2e..92e7df7e501 100644
--- a/grub-core/efiemu/mm.c
+++ b/grub-core/efiemu/mm.c
@@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_ACPI_MEMORY_NVS);
- case GRUB_MEMORY_PERSISTENT:
- case GRUB_MEMORY_PERSISTENT_LEGACY:
+ case GRUB_MEMORY_PRAM:
+ case GRUB_MEMORY_PMEM:
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_PERSISTENT_MEMORY);
default:

View File

@ -1,7 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 86b5e0f596cd6266c48dd1829d97f0debb5dc5c6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 24 May 2017 12:42:32 -0400
Subject: [PATCH] macos: just build chainloader entries, don't try any xnu xnu.
Subject: [PATCH 073/220] macos: just build chainloader entries, don't try any
xnu xnu.
Since our bugs tell us that the xnu boot entries really just don't work
most of the time, and they create piles of extra boot entries, because
@ -20,7 +21,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 18 insertions(+), 60 deletions(-)
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index 9b8f5968e2d..13a3a6bc752 100644
index 9b8f596..13a3a6b 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -42,68 +42,25 @@ if [ -z "${OSPROBED}" ] ; then
@ -122,3 +123,6 @@ index 9b8f5968e2d..13a3a6bc752 100644
;;
hurd)
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
--
1.8.3.1

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Fri, 22 Jan 2016 14:10:30 +0100
Subject: [PATCH] efiemu: Fix compilation failure
(cherry picked from commit b6a03dfd327489d53ee07c6d7d593b99c7b7cb62)
Resolves: rhbz#1288608
---
grub-core/efiemu/mm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c
index 92e7df7e501..52a032f7b2e 100644
--- a/grub-core/efiemu/mm.c
+++ b/grub-core/efiemu/mm.c
@@ -410,8 +410,8 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_ACPI_MEMORY_NVS);
- case GRUB_MEMORY_PRAM:
- case GRUB_MEMORY_PMEM:
+ case GRUB_MEMORY_PERSISTENT:
+ case GRUB_MEMORY_PERSISTENT_LEGACY:
return grub_efiemu_add_to_mmap (addr, size,
GRUB_EFI_PERSISTENT_MEMORY);
default:

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 4f25cd0b089dadc0be92e9226fd1eb9e2dda594f Mon Sep 17 00:00:00 2001
From: Jeff Mahoney <jeffm@suse.com>
Date: Wed, 18 Dec 2013 09:57:04 +0000
Subject: [PATCH] grub2/btrfs: Add ability to boot from subvolumes
Date: Tue, 9 Jul 2019 13:39:45 +0200
Subject: [PATCH 074/220] grub2/btrfs: Add ability to boot from subvolumes
This patch adds the ability to specify a different root on a btrfs
filesystem too boot from other than the default one.
@ -19,25 +19,25 @@ variable and loading the config file from the subvolume.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
grub-core/fs/btrfs.c | 552 +++++++++++++++++++++++++++++++++++++++++++++++++--
grub-core/fs/btrfs.c | 548 +++++++++++++++++++++++++++++++++++++++++++++++++--
include/grub/btrfs.h | 1 +
2 files changed, 533 insertions(+), 20 deletions(-)
2 files changed, 531 insertions(+), 18 deletions(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index be195448dbe..51ed63d429b 100644
index 48bd3d0..6823d97 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -29,6 +29,9 @@
#include <minilzo.h>
@@ -38,6 +38,9 @@
#include <zstd.h>
#include <grub/i18n.h>
#include <grub/btrfs.h>
+#include <grub/command.h>
+#include <grub/env.h>
+#include <grub/extcmd.h>
#include <grub/crypto.h>
#include <grub/diskfilter.h>
GRUB_MOD_LICENSE ("GPLv3+");
@@ -64,9 +67,11 @@ struct grub_btrfs_superblock
@@ -78,9 +81,11 @@ struct grub_btrfs_superblock
grub_uint64_t generation;
grub_uint64_t root_tree;
grub_uint64_t chunk_tree;
@ -51,7 +51,7 @@ index be195448dbe..51ed63d429b 100644
struct grub_btrfs_device this_device;
char label[0x100];
grub_uint8_t dummy4[0x100];
@@ -105,6 +110,7 @@ struct grub_btrfs_data
@@ -120,6 +125,7 @@ struct grub_btrfs_data
grub_uint64_t exttree;
grub_size_t extsize;
struct grub_btrfs_extent_data *extent;
@ -59,7 +59,7 @@ index be195448dbe..51ed63d429b 100644
};
struct grub_btrfs_chunk_item
@@ -171,6 +177,14 @@ struct grub_btrfs_leaf_descriptor
@@ -188,6 +194,14 @@ struct grub_btrfs_leaf_descriptor
} *data;
};
@ -74,7 +74,7 @@ index be195448dbe..51ed63d429b 100644
struct grub_btrfs_time
{
grub_int64_t sec;
@@ -215,6 +229,14 @@ struct grub_btrfs_extent_data
@@ -233,6 +247,14 @@ struct grub_btrfs_extent_data
#define GRUB_BTRFS_OBJECT_ID_CHUNK 0x100
@ -89,7 +89,7 @@ index be195448dbe..51ed63d429b 100644
static grub_disk_addr_t superblock_sectors[] = { 64 * 2, 64 * 1024 * 2,
256 * 1048576 * 2, 1048576ULL * 1048576ULL * 2
};
@@ -837,6 +859,62 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
@@ -1153,6 +1175,62 @@ grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
return GRUB_ERR_NONE;
}
@ -152,7 +152,7 @@ index be195448dbe..51ed63d429b 100644
static struct grub_btrfs_data *
grub_btrfs_mount (grub_device_t dev)
{
@@ -872,6 +950,13 @@ grub_btrfs_mount (grub_device_t dev)
@@ -1188,6 +1266,13 @@ grub_btrfs_mount (grub_device_t dev)
data->devices_attached[0].dev = dev;
data->devices_attached[0].id = data->sblock.this_device.device_id;
@ -166,11 +166,10 @@ index be195448dbe..51ed63d429b 100644
return data;
}
@@ -1232,6 +1317,91 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
return GRUB_ERR_NONE;
@@ -1654,6 +1739,91 @@ get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
}
+static grub_err_t
static grub_err_t
+find_pathname(struct grub_btrfs_data *data, grub_uint64_t objectid,
+ grub_uint64_t fs_root, const char *name, char **pathname)
+{
@ -255,10 +254,11 @@ index be195448dbe..51ed63d429b 100644
+ return 0;
+}
+
static grub_err_t
+static grub_err_t
find_path (struct grub_btrfs_data *data,
const char *path, struct grub_btrfs_key *key,
@@ -1250,14 +1420,26 @@ find_path (struct grub_btrfs_data *data,
grub_uint64_t *tree, grub_uint8_t *type)
@@ -1671,14 +1841,26 @@ find_path (struct grub_btrfs_data *data,
char *origpath = NULL;
unsigned symlinks_max = 32;
@ -289,7 +289,7 @@ index be195448dbe..51ed63d429b 100644
while (1)
{
while (path[0] == '/')
@@ -1430,9 +1612,21 @@ find_path (struct grub_btrfs_data *data,
@@ -1851,9 +2033,21 @@ find_path (struct grub_btrfs_data *data,
path = path_alloc = tmp;
if (path[0] == '/')
{
@ -314,50 +314,45 @@ index be195448dbe..51ed63d429b 100644
}
continue;
}
@@ -1673,18 +1867,10 @@ grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len)
@@ -2094,6 +2288,20 @@ grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len)
data->tree, file->offset, buf, len);
}
-static grub_err_t
-grub_btrfs_uuid (grub_device_t device, char **uuid)
+static char *
+btrfs_unparse_uuid(struct grub_btrfs_data *data)
{
- struct grub_btrfs_data *data;
-
- *uuid = NULL;
-
- data = grub_btrfs_mount (device);
- if (!data)
- return grub_errno;
-
- *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
+{
+ return grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
grub_be_to_cpu16 (data->sblock.uuid[0]),
grub_be_to_cpu16 (data->sblock.uuid[1]),
grub_be_to_cpu16 (data->sblock.uuid[2]),
@@ -1693,6 +1879,20 @@ grub_btrfs_uuid (grub_device_t device, char **uuid)
grub_be_to_cpu16 (data->sblock.uuid[5]),
grub_be_to_cpu16 (data->sblock.uuid[6]),
grub_be_to_cpu16 (data->sblock.uuid[7]));
+ grub_be_to_cpu16 (data->sblock.uuid[0]),
+ grub_be_to_cpu16 (data->sblock.uuid[1]),
+ grub_be_to_cpu16 (data->sblock.uuid[2]),
+ grub_be_to_cpu16 (data->sblock.uuid[3]),
+ grub_be_to_cpu16 (data->sblock.uuid[4]),
+ grub_be_to_cpu16 (data->sblock.uuid[5]),
+ grub_be_to_cpu16 (data->sblock.uuid[6]),
+ grub_be_to_cpu16 (data->sblock.uuid[7]));
+}
+
+static grub_err_t
+grub_btrfs_uuid (grub_device_t device, char **uuid)
+{
+ struct grub_btrfs_data *data;
+
+ *uuid = NULL;
+
+ data = grub_btrfs_mount (device);
+ if (!data)
+ return grub_errno;
+
static grub_err_t
grub_btrfs_uuid (grub_device_t device, char **uuid)
{
@@ -2105,15 +2313,7 @@ grub_btrfs_uuid (grub_device_t device, char **uuid)
if (!data)
return grub_errno;
- *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
- grub_be_to_cpu16 (data->sblock.uuid[0]),
- grub_be_to_cpu16 (data->sblock.uuid[1]),
- grub_be_to_cpu16 (data->sblock.uuid[2]),
- grub_be_to_cpu16 (data->sblock.uuid[3]),
- grub_be_to_cpu16 (data->sblock.uuid[4]),
- grub_be_to_cpu16 (data->sblock.uuid[5]),
- grub_be_to_cpu16 (data->sblock.uuid[6]),
- grub_be_to_cpu16 (data->sblock.uuid[7]));
+ *uuid = btrfs_unparse_uuid(data);
grub_btrfs_unmount (data);
@@ -1749,6 +1949,242 @@ grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
@@ -2170,6 +2370,242 @@ grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
}
#endif
@ -599,8 +594,8 @@ index be195448dbe..51ed63d429b 100644
+
static struct grub_fs grub_btrfs_fs = {
.name = "btrfs",
.dir = grub_btrfs_dir,
@@ -1764,12 +2200,88 @@ static struct grub_fs grub_btrfs_fs = {
.fs_dir = grub_btrfs_dir,
@@ -2185,12 +2621,88 @@ static struct grub_fs grub_btrfs_fs = {
#endif
};
@ -690,7 +685,7 @@ index be195448dbe..51ed63d429b 100644
+
+// vim: si et sw=2:
diff --git a/include/grub/btrfs.h b/include/grub/btrfs.h
index 9d93fb6c182..234ad976771 100644
index 9d93fb6..234ad97 100644
--- a/include/grub/btrfs.h
+++ b/include/grub/btrfs.h
@@ -29,6 +29,7 @@ enum
@ -701,3 +696,6 @@ index 9d93fb6c182..234ad976771 100644
GRUB_BTRFS_ITEM_TYPE_CHUNK = 0xe4
};
--
1.8.3.1

View File

@ -1,65 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 7 Apr 2016 10:58:06 -0400
Subject: [PATCH] Revert "reopen SNP protocol for exclusive use by grub"
I *think* this should have been replaced by upstream's
49426e9fd2e562c73a4f1206f32eff9e424a1a73, so I'm reverting for now.
May resolve rhbz#1273974.
This reverts commit 147daeab22db793978f952b6f0d832919a1b0081.
---
grub-core/net/drivers/efi/efinet.c | 39 --------------------------------------
1 file changed, 39 deletions(-)
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
index b870d3f1938..a3ce4c67cce 100644
--- a/grub-core/net/drivers/efi/efinet.c
+++ b/grub-core/net/drivers/efi/efinet.c
@@ -465,45 +465,6 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
&pxe_mode->dhcp_ack,
sizeof (pxe_mode->dhcp_ack),
1, device, path);
- net = grub_efi_open_protocol (card->efi_handle, &net_io_guid,
- GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
- if (net) {
- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
- && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
- continue;
-
- if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
- continue;
-
- if (net->mode->state == GRUB_EFI_NETWORK_STARTED
- && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
- continue;
-
- /* Enable hardware receive filters if driver declares support for it.
- We need unicast and broadcast and additionaly all nodes and
- solicited multicast for IPv6. Solicited multicast is per-IPv6
- address and we currently do not have API to do it so simply
- try to enable receive of all multicast packets or evertyhing in
- the worst case (i386 PXE driver always enables promiscuous too).
-
- This does trust firmware to do what it claims to do.
- */
- if (net->mode->receive_filter_mask)
- {
- grub_uint32_t filters = GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST |
- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;
-
- filters &= net->mode->receive_filter_mask;
- if (!(filters & GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST))
- filters |= (net->mode->receive_filter_mask &
- GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS);
-
- efi_call_6 (net->receive_filters, net, filters, 0, 0, 0, NULL);
- }
-
- card->efi_net = net;
- }
return;
}
}

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 2f9525397b30997f24ff1e9fd508839b6d149da5 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Wed, 18 Dec 2013 09:57:04 +0000
Subject: [PATCH] export btrfs_subvol and btrfs_subvolid
Subject: [PATCH 075/220] export btrfs_subvol and btrfs_subvolid
We should export btrfs_subvol and btrfs_subvolid to have both visible
to subsidiary configuration files loaded using configfile.
@ -12,10 +12,10 @@ Signed-off-by: Michael Chang <mchang@suse.com>
1 file changed, 2 insertions(+)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 51ed63d429b..88d727d161f 100644
index 6823d97..2d099b1 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -2273,6 +2273,8 @@ GRUB_MOD_INIT (btrfs)
@@ -2694,6 +2694,8 @@ GRUB_MOD_INIT (btrfs)
subvol_set_env);
grub_register_variable_hook ("btrfs_subvolid", subvolid_get_env,
subvolid_set_env);
@ -24,3 +24,6 @@ index 51ed63d429b..88d727d161f 100644
}
GRUB_MOD_FINI (btrfs)
--
1.8.3.1

View File

@ -1,17 +1,17 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 698e60b157eaa58d81150e74a3402a38047a9314 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 21 Aug 2014 03:39:11 +0000
Subject: [PATCH] grub2-btrfs-03-follow_default
Subject: [PATCH 076/220] grub2-btrfs-03-follow_default
---
grub-core/fs/btrfs.c | 107 ++++++++++++++++++++++++++++++++++++---------------
1 file changed, 76 insertions(+), 31 deletions(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 88d727d161f..a47d297567f 100644
index 2d099b1..2db89f7 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -920,6 +920,7 @@ grub_btrfs_mount (grub_device_t dev)
@@ -1236,6 +1236,7 @@ grub_btrfs_mount (grub_device_t dev)
{
struct grub_btrfs_data *data;
grub_err_t err;
@ -19,7 +19,7 @@ index 88d727d161f..a47d297567f 100644
if (!dev->disk)
{
@@ -950,11 +951,14 @@ grub_btrfs_mount (grub_device_t dev)
@@ -1266,11 +1267,14 @@ grub_btrfs_mount (grub_device_t dev)
data->devices_attached[0].dev = dev;
data->devices_attached[0].id = data->sblock.this_device.device_id;
@ -38,7 +38,7 @@ index 88d727d161f..a47d297567f 100644
}
return data;
@@ -1414,24 +1418,39 @@ find_path (struct grub_btrfs_data *data,
@@ -1835,24 +1839,39 @@ find_path (struct grub_btrfs_data *data,
grub_size_t allocated = 0;
struct grub_btrfs_dir_item *direl = NULL;
struct grub_btrfs_key key_out;
@ -85,7 +85,7 @@ index 88d727d161f..a47d297567f 100644
}
else
{
@@ -1442,15 +1461,23 @@ find_path (struct grub_btrfs_data *data,
@@ -1863,15 +1882,23 @@ find_path (struct grub_btrfs_data *data,
while (1)
{
@ -118,7 +118,7 @@ index 88d727d161f..a47d297567f 100644
if (*type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY)
{
@@ -1461,7 +1488,9 @@ find_path (struct grub_btrfs_data *data,
@@ -1882,7 +1909,9 @@ find_path (struct grub_btrfs_data *data,
if (ctokenlen == 1 && ctoken[0] == '.')
{
@ -129,7 +129,7 @@ index 88d727d161f..a47d297567f 100644
continue;
}
if (ctokenlen == 2 && ctoken[0] == '.' && ctoken[1] == '.')
@@ -1492,8 +1521,9 @@ find_path (struct grub_btrfs_data *data,
@@ -1913,8 +1942,9 @@ find_path (struct grub_btrfs_data *data,
*type = GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY;
key->object_id = key_out.offset;
@ -141,7 +141,7 @@ index 88d727d161f..a47d297567f 100644
continue;
}
@@ -1562,7 +1592,9 @@ find_path (struct grub_btrfs_data *data,
@@ -1983,7 +2013,9 @@ find_path (struct grub_btrfs_data *data,
return err;
}
@ -152,7 +152,7 @@ index 88d727d161f..a47d297567f 100644
if (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_SYMLINK)
{
struct grub_btrfs_inode inode;
@@ -1612,14 +1644,26 @@ find_path (struct grub_btrfs_data *data,
@@ -2033,14 +2065,26 @@ find_path (struct grub_btrfs_data *data,
path = path_alloc = tmp;
if (path[0] == '/')
{
@ -186,7 +186,7 @@ index 88d727d161f..a47d297567f 100644
}
else
{
@@ -2275,6 +2319,7 @@ GRUB_MOD_INIT (btrfs)
@@ -2696,6 +2740,7 @@ GRUB_MOD_INIT (btrfs)
subvolid_set_env);
grub_env_export ("btrfs_subvol");
grub_env_export ("btrfs_subvolid");
@ -194,3 +194,6 @@ index 88d727d161f..a47d297567f 100644
}
GRUB_MOD_FINI (btrfs)
--
1.8.3.1

View File

@ -1,19 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From d88b2fed5b13498999a6a186cf5a707ce0819f67 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 21 Aug 2014 03:39:11 +0000
Subject: [PATCH] grub2-btrfs-04-grub2-install
Subject: [PATCH 077/220] grub2-btrfs-04-grub2-install
---
grub-core/osdep/linux/getroot.c | 7 +++++++
grub-core/osdep/unix/config.c | 17 +++++++++++++++--
include/grub/emu/config.h | 1 +
util/config.c | 10 ++++++++++
util/grub-install.c | 15 +++++++++++++++
util/grub-mkrelpath.c | 6 ++++++
include/grub/emu/config.h | 1 +
6 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 6d9f4e5faa2..5d50dd6f8dc 100644
index 6d9f4e5..5d50dd6 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -376,6 +376,7 @@ get_btrfs_fs_prefix (const char *mount_path)
@ -38,7 +38,7 @@ index 6d9f4e5faa2..5d50dd6f8dc 100644
else if (!retry && grub_strcmp (entries[i].fstype, "autofs") == 0)
{
diff --git a/grub-core/osdep/unix/config.c b/grub-core/osdep/unix/config.c
index 65effa9f3a7..b637c58efb7 100644
index 65effa9..b637c58 100644
--- a/grub-core/osdep/unix/config.c
+++ b/grub-core/osdep/unix/config.c
@@ -82,6 +82,19 @@ grub_util_load_config (struct grub_util_config *cfg)
@ -72,8 +72,20 @@ index 65effa9f3a7..b637c58efb7 100644
argv[2] = script;
argv[3] = '\0';
diff --git a/include/grub/emu/config.h b/include/grub/emu/config.h
index 875d589..c9a7e5f 100644
--- a/include/grub/emu/config.h
+++ b/include/grub/emu/config.h
@@ -37,6 +37,7 @@ struct grub_util_config
{
int is_cryptodisk_enabled;
char *grub_distributor;
+ int is_suse_btrfs_snapshot_enabled;
};
void
diff --git a/util/config.c b/util/config.c
index ebcdd8f5e22..f044a880a76 100644
index ebcdd8f..f044a88 100644
--- a/util/config.c
+++ b/util/config.c
@@ -42,6 +42,16 @@ grub_util_parse_config (FILE *f, struct grub_util_config *cfg, int simple)
@ -94,10 +106,10 @@ index ebcdd8f5e22..f044a880a76 100644
sizeof ("GRUB_DISTRIBUTOR=") - 1) == 0)
{
diff --git a/util/grub-install.c b/util/grub-install.c
index 78d0138cb0a..4375c161955 100644
index 8a55ad4..0e807b0 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -816,6 +816,8 @@ fill_core_services (const char *core_services)
@@ -819,6 +819,8 @@ fill_core_services (const char *core_services)
free (sysv_plist);
}
@ -106,7 +118,7 @@ index 78d0138cb0a..4375c161955 100644
int
main (int argc, char *argv[])
{
@@ -849,6 +851,9 @@ main (int argc, char *argv[])
@@ -852,6 +854,9 @@ main (int argc, char *argv[])
grub_util_load_config (&config);
@ -116,7 +128,7 @@ index 78d0138cb0a..4375c161955 100644
if (!bootloader_id && config.grub_distributor)
{
char *ptr;
@@ -1321,6 +1326,16 @@ main (int argc, char *argv[])
@@ -1344,6 +1349,16 @@ main (int argc, char *argv[])
fprintf (load_cfg_f, "set debug='%s'\n",
debug_image);
}
@ -134,7 +146,7 @@ index 78d0138cb0a..4375c161955 100644
char *install_drive = NULL;
diff --git a/util/grub-mkrelpath.c b/util/grub-mkrelpath.c
index 47a241a391b..5db7a9a7d97 100644
index 47a241a..5db7a9a 100644
--- a/util/grub-mkrelpath.c
+++ b/util/grub-mkrelpath.c
@@ -40,9 +40,12 @@ struct arguments
@ -160,15 +172,6 @@ index 47a241a391b..5db7a9a7d97 100644
case ARGP_KEY_ARG:
if (state->arg_num == 0)
arguments->pathname = xstrdup (arg);
diff --git a/include/grub/emu/config.h b/include/grub/emu/config.h
index 875d5896ce1..c9a7e5f4ade 100644
--- a/include/grub/emu/config.h
+++ b/include/grub/emu/config.h
@@ -37,6 +37,7 @@ struct grub_util_config
{
int is_cryptodisk_enabled;
char *grub_distributor;
+ int is_suse_btrfs_snapshot_enabled;
};
--
1.8.3.1
void

View File

@ -1,18 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 62438d289c38a88cd0d3d1efad8a52f0de44b6b3 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 21 Aug 2014 03:39:11 +0000
Subject: [PATCH] grub2-btrfs-05-grub2-mkconfig
Subject: [PATCH 078/220] grub2-btrfs-05-grub2-mkconfig
Signed-off-by: Michael Chang <mchang@suse.com>
---
util/grub-mkconfig.in | 3 ++-
util/grub-mkconfig_lib.in | 4 ++++
util/grub.d/00_header.in | 24 +++++++++++++++++++++++-
util/grub.d/00_header.in | 25 ++++++++++++++++++++++++-
util/grub.d/10_linux.in | 4 ++++
util/grub.d/20_linux_xen.in | 4 ++++
5 files changed, 37 insertions(+), 2 deletions(-)
5 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 8218f3d477f..4248b9341ab 100644
index 6247a0b..4649e92 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -258,7 +258,8 @@ export GRUB_DEFAULT \
@ -26,7 +27,7 @@ index 8218f3d477f..4248b9341ab 100644
if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new"
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 113a41f9409..b3aae534ddc 100644
index 113a41f..b3aae53 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -52,7 +52,11 @@ grub_warn ()
@ -42,7 +43,7 @@ index 113a41f9409..b3aae534ddc 100644
is_path_readable_by_grub ()
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 858b526c925..e2a53300126 100644
index 858b526..de727e6 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -27,6 +27,14 @@ export TEXTDOMAINDIR="@localedir@"
@ -71,12 +72,13 @@ index 858b526c925..e2a53300126 100644
load_env
fi
EOF
@@ -356,3 +366,15 @@ fi
@@ -356,3 +366,16 @@ fi
if [ "x${GRUB_BADRAM}" != "x" ] ; then
echo "badram ${GRUB_BADRAM}"
fi
+
+if [ "x${SUSE_BTRFS_SNAPSHOT_BOOTING}" = "xtrue" ] &&
+ [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ] &&
+ [ "x${GRUB_FS}" = "xbtrfs" ] ; then
+ # Note: No $snapshot_num on *read-only* rollback! (bsc#901487)
+ cat <<EOF
@ -88,7 +90,7 @@ index 858b526c925..e2a53300126 100644
+EOF
+fi
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 4e49ccdf742..d9a05937e46 100644
index 55f4aa7..5cab299 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -66,10 +66,14 @@ fi
@ -107,7 +109,7 @@ index 4e49ccdf742..d9a05937e46 100644
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index 972a4b5a03d..bcdc3ceac02 100644
index 47e0d3f..1519ec6 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -73,10 +73,14 @@ fi
@ -125,3 +127,6 @@ index 972a4b5a03d..bcdc3ceac02 100644
fi;;
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
--
1.8.3.1

View File

@ -1,28 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 226e9d1f9fde6c6ccf711ba7112135bfa1c01868 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Fri, 22 May 2015 11:45:25 +0000
Subject: [PATCH] grub2-btrfs-06-subvol-mount
Date: Tue, 9 Jul 2019 13:56:16 +0200
Subject: [PATCH 079/220] grub2-btrfs-06-subvol-mount
---
grub-core/fs/btrfs.c | 195 +++++++++++++++++++++++++++++++++++++++-
grub-core/osdep/linux/getroot.c | 148 +++++++++++++++++++++++++++++-
util/grub-install.c | 49 ++++++++++
include/grub/emu/getroot.h | 5 ++
util/grub-install.c | 49 ++++++++++
4 files changed, 392 insertions(+), 5 deletions(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index a47d297567f..2e36ac47e8a 100644
index 2db89f7..1627234 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -32,6 +32,7 @@
@@ -41,6 +41,7 @@
#include <grub/command.h>
#include <grub/env.h>
#include <grub/extcmd.h>
+#include <grub/list.h>
#include <grub/crypto.h>
#include <grub/diskfilter.h>
GRUB_MOD_LICENSE ("GPLv3+");
@@ -245,6 +246,12 @@ static grub_err_t
@@ -263,6 +264,12 @@ static grub_err_t
grub_btrfs_read_logical (struct grub_btrfs_data *data,
grub_disk_addr_t addr, void *buf, grub_size_t size,
int recursion_depth);
@ -35,7 +35,7 @@ index a47d297567f..2e36ac47e8a 100644
static grub_err_t
read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
@@ -887,9 +894,26 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path)
@@ -1203,9 +1210,26 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path)
grub_err_t err;
grub_uint64_t tree = 0;
grub_uint8_t type;
@ -62,7 +62,7 @@ index a47d297567f..2e36ac47e8a 100644
if (err)
return grub_error(GRUB_ERR_FILE_NOT_FOUND, "couldn't locate %s\n", path);
@@ -1758,11 +1782,20 @@ grub_btrfs_dir (grub_device_t device, const char *path,
@@ -2179,11 +2203,20 @@ grub_btrfs_dir (grub_device_t device, const char *path,
int r = 0;
grub_uint64_t tree;
grub_uint8_t type;
@ -84,7 +84,7 @@ index a47d297567f..2e36ac47e8a 100644
if (err)
{
grub_btrfs_unmount (data);
@@ -1864,11 +1897,21 @@ grub_btrfs_open (struct grub_file *file, const char *name)
@@ -2285,11 +2318,21 @@ grub_btrfs_open (struct grub_file *file, const char *name)
struct grub_btrfs_inode inode;
grub_uint8_t type;
struct grub_btrfs_key key_in;
@ -107,7 +107,7 @@ index a47d297567f..2e36ac47e8a 100644
if (err)
{
grub_btrfs_unmount (data);
@@ -2039,6 +2082,150 @@ grub_cmd_btrfs_info (grub_command_t cmd __attribute__ ((unused)), int argc,
@@ -2460,6 +2503,150 @@ grub_cmd_btrfs_info (grub_command_t cmd __attribute__ ((unused)), int argc,
return 0;
}
@ -258,7 +258,7 @@ index a47d297567f..2e36ac47e8a 100644
static grub_err_t
get_fs_root(struct grub_btrfs_data *data, grub_uint64_t tree,
grub_uint64_t objectid, grub_uint64_t offset,
@@ -2245,6 +2432,7 @@ static struct grub_fs grub_btrfs_fs = {
@@ -2666,6 +2853,7 @@ static struct grub_fs grub_btrfs_fs = {
};
static grub_command_t cmd_info;
@ -266,7 +266,7 @@ index a47d297567f..2e36ac47e8a 100644
static grub_extcmd_t cmd_list_subvols;
static char *
@@ -2308,6 +2496,9 @@ GRUB_MOD_INIT (btrfs)
@@ -2729,6 +2917,9 @@ GRUB_MOD_INIT (btrfs)
cmd_info = grub_register_command("btrfs-info", grub_cmd_btrfs_info,
"DEVICE",
"Print BtrFS info about DEVICE.");
@ -277,7 +277,7 @@ index a47d297567f..2e36ac47e8a 100644
grub_cmd_btrfs_list_subvols, 0,
"[-p|-n] [-o var] DEVICE",
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 5d50dd6f8dc..4c5a13022dc 100644
index 5d50dd6..4c5a130 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -107,6 +107,14 @@ struct btrfs_ioctl_search_key
@ -459,11 +459,27 @@ index 5d50dd6f8dc..4c5a13022dc 100644
char *
grub_make_system_path_relative_to_its_root_os (const char *path)
{
diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h
index 73fa2d3..9c642ae 100644
--- a/include/grub/emu/getroot.h
+++ b/include/grub/emu/getroot.h
@@ -53,6 +53,11 @@ char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);
#endif
+#ifdef __linux__
+char *
+grub_util_get_btrfs_subvol (const char *path, char **mount_path);
+#endif
+
/* Devmapper functions provided by getroot_devmapper.c. */
void
grub_util_pull_devmapper (const char *os_dev);
diff --git a/util/grub-install.c b/util/grub-install.c
index 4375c161955..a0ad99729fd 100644
index 0e807b0..3e718b9 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -1535,6 +1535,55 @@ main (int argc, char *argv[])
@@ -1561,6 +1561,55 @@ main (int argc, char *argv[])
prefix_drive = xasprintf ("(%s)", grub_drives[0]);
}
@ -519,19 +535,6 @@ index 4375c161955..a0ad99729fd 100644
char mkimage_target[200];
const char *core_name = NULL;
diff --git a/include/grub/emu/getroot.h b/include/grub/emu/getroot.h
index 73fa2d34abb..9c642ae3fe3 100644
--- a/include/grub/emu/getroot.h
+++ b/include/grub/emu/getroot.h
@@ -53,6 +53,11 @@ char **
grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);
#endif
--
1.8.3.1
+#ifdef __linux__
+char *
+grub_util_get_btrfs_subvol (const char *path, char **mount_path);
+#endif
+
/* Devmapper functions provided by getroot_devmapper.c. */
void
grub_util_pull_devmapper (const char *os_dev);

View File

@ -1,8 +1,8 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From dea875db30d83eeed6b53c3fc72a0dbb178abb94 Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidjaar@gmail.com>
Date: Tue, 21 Jun 2016 16:44:17 +0000
Subject: [PATCH] Fallback to old subvol name scheme to support old snapshot
config
Subject: [PATCH 080/220] Fallback to old subvol name scheme to support old
snapshot config
Ref: bsc#953538
---
@ -10,14 +10,13 @@ Ref: bsc#953538
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 2e36ac47e8a..4a31d39ee74 100644
index 1627234..69c30e6 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -924,11 +924,41 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path)
return GRUB_ERR_NONE;
@@ -1241,10 +1241,40 @@ lookup_root_by_name(struct grub_btrfs_data *data, const char *path)
}
+static grub_err_t
static grub_err_t
+lookup_root_by_name_fallback(struct grub_btrfs_data *data, const char *path)
+{
+ grub_err_t err;
@ -36,7 +35,7 @@ index 2e36ac47e8a..4a31d39ee74 100644
+ return GRUB_ERR_NONE;
+}
+
static grub_err_t
+static grub_err_t
btrfs_handle_subvol(struct grub_btrfs_data *data __attribute__ ((unused)))
{
if (btrfs_default_subvol)
@ -56,3 +55,6 @@ index 2e36ac47e8a..4a31d39ee74 100644
if (btrfs_default_subvolid)
return lookup_root_by_id(data, btrfs_default_subvolid);
--
1.8.3.1

View File

@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Salter <msalter@redhat.com>
Date: Tue, 7 Mar 2017 18:26:17 -0500
Subject: [PATCH] Fix malformed tftp packets
0088-Normalize-slashes-in-tftp-paths.patch collapses multiple contiguous
slashes in a filename into one slash in the tftp packet filename field.
However, the packet buffer pointer is advanced using the original name.
This leaves unitialized data between the name field and the type field
leading to tftp errors. Use the length of the normalized name to avoid
this.
Signed-off-by: Mark Salter <msalter@redhat.com>
---
grub-core/net/tftp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
index 5ca0a96a6f6..dcd82494309 100644
--- a/grub-core/net/tftp.c
+++ b/grub-core/net/tftp.c
@@ -360,8 +360,8 @@ tftp_open (struct grub_file *file, const char *filename)
/* Copy and normalize the filename to work-around issues on some tftp
servers when file names are being matched for remapping. */
grub_normalize_filename (rrq, filename);
- rrqlen += grub_strlen (filename) + 1;
- rrq += grub_strlen (filename) + 1;
+ rrqlen += grub_strlen (rrq) + 1;
+ rrq += grub_strlen (rrq) + 1;
grub_strcpy (rrq, "octet");
rrqlen += grub_strlen ("octet") + 1;

View File

@ -1,17 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 0a31b397d0d3bc28e19401abe9b675fe7d3bb526 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 11 May 2017 08:56:57 +0000
Subject: [PATCH] Grub not working correctly with btrfs snapshots (bsc#1026511)
Subject: [PATCH 081/220] Grub not working correctly with btrfs snapshots
(bsc#1026511)
---
grub-core/fs/btrfs.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 238 insertions(+)
diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
index 4a31d39ee74..7002ad81b7e 100644
index 69c30e6..ba99d04 100644
--- a/grub-core/fs/btrfs.c
+++ b/grub-core/fs/btrfs.c
@@ -2446,6 +2446,238 @@ out:
@@ -2867,6 +2867,238 @@ out:
return 0;
}
@ -249,8 +250,8 @@ index 4a31d39ee74..7002ad81b7e 100644
+
static struct grub_fs grub_btrfs_fs = {
.name = "btrfs",
.dir = grub_btrfs_dir,
@@ -2464,6 +2696,7 @@ static struct grub_fs grub_btrfs_fs = {
.fs_dir = grub_btrfs_dir,
@@ -2885,6 +3117,7 @@ static struct grub_fs grub_btrfs_fs = {
static grub_command_t cmd_info;
static grub_command_t cmd_mount_subvol;
static grub_extcmd_t cmd_list_subvols;
@ -258,7 +259,7 @@ index 4a31d39ee74..7002ad81b7e 100644
static char *
subvolid_set_env (struct grub_env_var *var __attribute__ ((unused)),
@@ -2534,6 +2767,11 @@ GRUB_MOD_INIT (btrfs)
@@ -2955,6 +3188,11 @@ GRUB_MOD_INIT (btrfs)
"[-p|-n] [-o var] DEVICE",
"Print list of BtrFS subvolumes on "
"DEVICE.", options);
@ -270,3 +271,6 @@ index 4a31d39ee74..7002ad81b7e 100644
grub_register_variable_hook ("btrfs_subvol", subvol_get_env,
subvol_set_env);
grub_register_variable_hook ("btrfs_subvolid", subvolid_get_env,
--
1.8.3.1

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From 67fceb3fe4d6a167f26478fa2c3fdbac9a9bc871 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 1 Jun 2017 09:59:56 -0400
Subject: [PATCH] Add grub_efi_allocate_pool() and grub_efi_free_pool()
Subject: [PATCH 082/220] Add grub_efi_allocate_pool() and grub_efi_free_pool()
wrappers.
Signed-off-by: Peter Jones <pjones@redhat.com>
@ -10,7 +10,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h
index 39480b38674..09a18e56302 100644
index 090c862..5e2b479 100644
--- a/include/grub/efi/efi.h
+++ b/include/grub/efi/efi.h
@@ -24,6 +24,10 @@
@ -70,3 +70,6 @@ index 39480b38674..09a18e56302 100644
extern int EXPORT_VAR(grub_efi_is_finished);
struct grub_net_card;
--
1.8.3.1

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 4 Mar 2016 16:29:13 -0500
Subject: [PATCH] Make grub-editenv build again.
36212460d3565b18439a3a8130b28e6c97702c6a split how some of the mkimage
utility functions are defined, and they wind up being linked into
grub-editenv. Most utilities got fixed, but this one was missed.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Makefile.util.def | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile.util.def b/Makefile.util.def
index 2d032643de7..879e8eb98a4 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -237,6 +237,8 @@ program = {
extra_dist = grub-core/osdep/unix/compress.c;
extra_dist = grub-core/osdep/basic/compress.c;
common = util/mkimage.c;
+ common = util/grub-mkimage32.c;
+ common = util/grub-mkimage64.c;
common = grub-core/osdep/config.c;
common = util/config.c;
common = util/resolve.c;

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