Skip to content

Commit

Permalink
Add 2 GRUB patches and update build-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ValdikSS committed Mar 6, 2019
1 parent ff5335c commit afc58b9
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rpmbuild -ba grub2.spec --define "_sourcedir $PWD" --define "_topdir $PWD/rpmbui

unpack everything

grub2-mkimage -v -C auto -O i386-pc --prefix '(,msdos1)/efi/grub' -o EFI/grub/i386-pc/core.img 'fat' 'part_msdos' 'biosdisk' 'xzio' 'gcry_crc'
grub2-mkimage -v -C auto -O i386-pc --prefix '(,msdos1)/efi/grub' -o EFI/grub/i386-pc/core.img 'iso9660' 'fat' 'part_msdos' 'part_gpt' 'part_apple' 'biosdisk' 'xzio' 'gcry_crc'

fallocate -l 501M uefi-insecureboot-minimal.img
fdisk uefi-insecureboot-minimal.img
Expand Down
81 changes: 81 additions & 0 deletions grub-patches/9003-Split-linux-and-linuxefi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From d154160e518ca93ba2d39ff5d2ca8d986b7ee8b2 Mon Sep 17 00:00:00 2001
From: ValdikSS <[email protected]>
Date: Tue, 5 Mar 2019 00:51:47 +0300
Subject: [PATCH] Split linux and linuxefi

---
grub-core/Makefile.core.def | 11 ++++++++---
grub-core/loader/i386/efi/linux.c | 13 ++-----------
2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 1bf666b..297ccaf 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1711,9 +1711,7 @@ module = {

module = {
name = linux;
- i386_pc = loader/i386/pc/linux.c;
- x86_64_efi = loader/i386/efi/linux.c;
- i386_efi = loader/i386/efi/linux.c;
+ x86 = loader/i386/linux.c;
xen = loader/i386/xen.c;
i386_pc = lib/i386/pc/vesa_modes_table.c;
mips = loader/mips/linux.c;
@@ -1728,8 +1726,15 @@ module = {

common = loader/linux.c;
common = lib/cmdline.c;
+};

+module = {
+ name = linuxefi;
+ efi = loader/i386/efi/linux.c;
efi = loader/efi/linux.c;
+ /* efi = lib/cmdline.c; */
+ enable = i386_efi;
+ enable = x86_64_efi;
};

module = {
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
index 851bce7..918b662 100644
--- a/grub-core/loader/i386/efi/linux.c
+++ b/grub-core/loader/i386/efi/linux.c
@@ -375,30 +375,21 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
return grub_errno;
}

-static grub_command_t cmd_linux, cmd_initrd;
static grub_command_t cmd_linuxefi, cmd_initrdefi;

-GRUB_MOD_INIT(linux)
+GRUB_MOD_INIT(linuxefi)
{
- cmd_linux =
- grub_register_command ("linux", grub_cmd_linux,
- 0, N_("Load Linux."));
cmd_linuxefi =
grub_register_command ("linuxefi", grub_cmd_linux,
0, N_("Load Linux."));
- cmd_initrd =
- grub_register_command ("initrd", grub_cmd_initrd,
- 0, N_("Load initrd."));
cmd_initrdefi =
grub_register_command ("initrdefi", grub_cmd_initrd,
0, N_("Load initrd."));
my_mod = mod;
}

-GRUB_MOD_FINI(linux)
+GRUB_MOD_FINI(linuxefi)
{
- grub_unregister_command (cmd_linux);
grub_unregister_command (cmd_linuxefi);
- grub_unregister_command (cmd_initrd);
grub_unregister_command (cmd_initrdefi);
}
--
2.20.1

34 changes: 34 additions & 0 deletions grub-patches/9004-Enable-locale-copying-is-that-a-bug.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 22f59cc94b59c99aa0f259fb2f6b43ee4c52e3c2 Mon Sep 17 00:00:00 2001
From: ValdikSS <[email protected]>
Date: Mon, 4 Mar 2019 19:55:38 +0300
Subject: [PATCH] Enable locale copying (is that a bug?)

---
util/grub-install-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/grub-install-common.c b/util/grub-install-common.c
index 0a2e24a..cf3fd2e 100644
--- a/util/grub-install-common.c
+++ b/util/grub-install-common.c
@@ -592,7 +592,7 @@ copy_all (const char *srcd,
grub_util_fd_closedir (d);
}

-#if !(defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS)
+#if (defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS)
static const char *
get_localedir (void)
{
@@ -653,7 +653,7 @@ static void
grub_install_copy_nls(const char *src __attribute__ ((unused)),
const char *dst __attribute__ ((unused)))
{
-#if !(defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS)
+#if (defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS)
char *dst_locale;

dst_locale = grub_util_path_concat (2, dst, "locale");
--
2.20.1

0 comments on commit afc58b9

Please sign in to comment.