diff options
5 files changed, 52 insertions, 84 deletions
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc index d0de1b2..2e97de1 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc | |||
@@ -28,7 +28,6 @@ SRC_URI += "\ | |||
28 | file://Grub-get-and-set-efi-variables.patch \ | 28 | file://Grub-get-and-set-efi-variables.patch \ |
29 | file://uefi_verify.patch \ | 29 | file://uefi_verify.patch \ |
30 | file://0001-grub-verify-Add-strict_security-variable.patch \ | 30 | file://0001-grub-verify-Add-strict_security-variable.patch \ |
31 | file://0001-fs-ext2-fix-the-file-not-found-error-when-symlink-fi.patch \ | ||
32 | file://grub-efi.cfg \ | 31 | file://grub-efi.cfg \ |
33 | file://boot-menu.inc \ | 32 | file://boot-menu.inc \ |
34 | ${@d.getVar('GRUB_MOKVERIFY_PATCH', True) if d.getVar('UEFI_SELOADER', True) == '1' else ''} \ | 33 | ${@d.getVar('GRUB_MOKVERIFY_PATCH', True) if d.getVar('UEFI_SELOADER', True) == '1' else ''} \ |
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-fs-ext2-fix-the-file-not-found-error-when-symlink-fi.patch b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-fs-ext2-fix-the-file-not-found-error-when-symlink-fi.patch deleted file mode 100644 index a9b3693..0000000 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-fs-ext2-fix-the-file-not-found-error-when-symlink-fi.patch +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | From 5fe53d80b7294198687a96e72471ddb968c7de34 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yi Zhao <yi.zhao@windriver.com> | ||
3 | Date: Wed, 6 Jan 2021 17:07:26 +0800 | ||
4 | Subject: [PATCH] fs/ext2: fix the file not found error when symlink filesize | ||
5 | is 60 | ||
6 | |||
7 | We encountered a file not found error when the symlink filesize is 60: | ||
8 | $ ls -l initrd | ||
9 | lrwxrwxrwx 1 root root 60 Jan 6 16:37 initrd -> secure-core-image-initramfs-5.10.2-yoctodev-standard.cpio.gz | ||
10 | |||
11 | When booting, we got the following error in grub: | ||
12 | error: file `/initrd' not found | ||
13 | |||
14 | The root cause is although the size of diro->inode.symlink is 60, it | ||
15 | includes the trailing '\0'. So if the symlink filesize is exactly 60, it | ||
16 | is also stored in a separate block rather than in the inode. | ||
17 | |||
18 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2021-01/msg00018.html] | ||
19 | |||
20 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
21 | --- | ||
22 | grub-core/fs/ext2.c | 2 +- | ||
23 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
24 | |||
25 | diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c | ||
26 | index ac33bcd68..cb5058e8b 100644 | ||
27 | --- a/grub-core/fs/ext2.c | ||
28 | +++ b/grub-core/fs/ext2.c | ||
29 | @@ -732,7 +732,7 @@ grub_ext2_read_symlink (grub_fshelp_node_t node) | ||
30 | /* If the filesize of the symlink is bigger than | ||
31 | 60 the symlink is stored in a separate block, | ||
32 | otherwise it is stored in the inode. */ | ||
33 | - if (grub_le_to_cpu32 (diro->inode.size) <= sizeof (diro->inode.symlink)) | ||
34 | + if (grub_le_to_cpu32 (diro->inode.size) < sizeof (diro->inode.symlink)) | ||
35 | grub_memcpy (symlink, | ||
36 | diro->inode.symlink, | ||
37 | grub_le_to_cpu32 (diro->inode.size)); | ||
38 | -- | ||
39 | 2.25.1 | ||
40 | |||
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-grub-verify-Add-strict_security-variable.patch b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-grub-verify-Add-strict_security-variable.patch index 11bfe76..198c018 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-grub-verify-Add-strict_security-variable.patch +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/0001-grub-verify-Add-strict_security-variable.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 8a7ad88b4880e25df1f54b80631dc035e1e25662 Mon Sep 17 00:00:00 2001 | 1 | From 9f330999565e1e82ce5b9460ffefa933cc47d67c Mon Sep 17 00:00:00 2001 |
2 | From: Jason Wessel <jason.wessel@windriver.com> | 2 | From: Jason Wessel <jason.wessel@windriver.com> |
3 | Date: Thu, 17 Oct 2019 12:35:01 -0700 | 3 | Date: Thu, 17 Oct 2019 12:35:01 -0700 |
4 | Subject: [PATCH] grub verify: Add strict_security variable | 4 | Subject: [PATCH] grub verify: Add strict_security variable |
5 | 5 | ||
6 | With strict_security set to 1, it is impossible to change the value of | 6 | With strict_security set to 1, it is impossible to change the value of |
7 | check_signatures. It will also cause grub to reboot instead of | 7 | check_signatures. It will also cause grub to reboot instead of |
@@ -12,14 +12,16 @@ Upstream-Status: Pending | |||
12 | 12 | ||
13 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | 13 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
14 | --- | 14 | --- |
15 | grub-core/commands/pgp.c | 16 +++++++++++++++- | 15 | grub-core/commands/pgp.c | 16 +++++++++++++++- |
16 | grub-core/kern/main.c | 9 +++++++++ | 16 | grub-core/kern/main.c | 9 +++++++++ |
17 | grub-core/normal/main.c | 7 +++++-- | 17 | grub-core/normal/main.c | 7 +++++-- |
18 | 3 files changed, 29 insertions(+), 3 deletions(-) | 18 | 3 files changed, 29 insertions(+), 3 deletions(-) |
19 | 19 | ||
20 | diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c | ||
21 | index 5daa1e9..ed8514c 100644 | ||
20 | --- a/grub-core/commands/pgp.c | 22 | --- a/grub-core/commands/pgp.c |
21 | +++ b/grub-core/commands/pgp.c | 23 | +++ b/grub-core/commands/pgp.c |
22 | @@ -864,6 +864,7 @@ grub_cmd_verify_signature (grub_extcmd_c | 24 | @@ -864,6 +864,7 @@ grub_cmd_verify_signature (grub_extcmd_context_t ctxt, |
23 | } | 25 | } |
24 | 26 | ||
25 | static int sec = 0; | 27 | static int sec = 0; |
@@ -60,17 +62,19 @@ Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | |||
60 | 62 | ||
61 | grub_pk_trusted = 0; | 63 | grub_pk_trusted = 0; |
62 | FOR_MODULES (header) | 64 | FOR_MODULES (header) |
65 | diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c | ||
66 | index 73967e2..86e7f35 100644 | ||
63 | --- a/grub-core/kern/main.c | 67 | --- a/grub-core/kern/main.c |
64 | +++ b/grub-core/kern/main.c | 68 | +++ b/grub-core/kern/main.c |
65 | @@ -29,6 +29,7 @@ | 69 | @@ -30,6 +30,7 @@ |
66 | #include <grub/command.h> | ||
67 | #include <grub/reader.h> | 70 | #include <grub/reader.h> |
68 | #include <grub/parser.h> | 71 | #include <grub/parser.h> |
72 | #include <grub/verify.h> | ||
69 | +#include <grub/time.h> | 73 | +#include <grub/time.h> |
70 | 74 | ||
71 | #ifdef GRUB_MACHINE_PCBIOS | 75 | #ifdef GRUB_MACHINE_PCBIOS |
72 | #include <grub/machine/memory.h> | 76 | #include <grub/machine/memory.h> |
73 | @@ -308,5 +309,13 @@ grub_main (void) | 77 | @@ -312,5 +313,13 @@ grub_main (void) |
74 | grub_boot_time ("After execution of embedded config. Attempt to go to normal mode"); | 78 | grub_boot_time ("After execution of embedded config. Attempt to go to normal mode"); |
75 | 79 | ||
76 | grub_load_normal_mode (); | 80 | grub_load_normal_mode (); |
@@ -84,9 +88,11 @@ Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | |||
84 | + } | 88 | + } |
85 | grub_rescue_run (); | 89 | grub_rescue_run (); |
86 | } | 90 | } |
91 | diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c | ||
92 | index c4ebe9e..2c3f4f8 100644 | ||
87 | --- a/grub-core/normal/main.c | 93 | --- a/grub-core/normal/main.c |
88 | +++ b/grub-core/normal/main.c | 94 | +++ b/grub-core/normal/main.c |
89 | @@ -301,8 +301,11 @@ grub_enter_normal_mode (const char *conf | 95 | @@ -302,8 +302,11 @@ grub_enter_normal_mode (const char *config) |
90 | grub_boot_time ("Entering normal mode"); | 96 | grub_boot_time ("Entering normal mode"); |
91 | nested_level++; | 97 | nested_level++; |
92 | grub_normal_execute (config, 0, 0); | 98 | grub_normal_execute (config, 0, 0); |
@@ -100,3 +106,6 @@ Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | |||
100 | nested_level--; | 106 | nested_level--; |
101 | if (grub_normal_exit_level) | 107 | if (grub_normal_exit_level) |
102 | grub_normal_exit_level--; | 108 | grub_normal_exit_level--; |
109 | -- | ||
110 | 2.17.1 | ||
111 | |||
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/Grub-get-and-set-efi-variables.patch b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/Grub-get-and-set-efi-variables.patch index c7b8039..38ece4a 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/Grub-get-and-set-efi-variables.patch +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/Grub-get-and-set-efi-variables.patch | |||
@@ -158,7 +158,7 @@ index 0000000..6aeda80 | |||
158 | + if (EFI_VAR_INVALID == efi_type) | 158 | + if (EFI_VAR_INVALID == efi_type) |
159 | + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid format specifier")); | 159 | + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid format specifier")); |
160 | + | 160 | + |
161 | + efi_var = grub_efi_get_variable (args[0], &global, &efi_var_size); | 161 | + grub_efi_get_variable (args[0], &global, &efi_var_size, &efi_var); |
162 | + if (!efi_var || !efi_var_size) | 162 | + if (!efi_var || !efi_var_size) |
163 | + { | 163 | + { |
164 | + status = grub_error (GRUB_ERR_READ_ERROR, N_("cannot read variable")); | 164 | + status = grub_error (GRUB_ERR_READ_ERROR, N_("cannot read variable")); |
diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch index a5f4e31..9262f84 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 3aa619ea2c9d35cc242f0ae870782522176ce018 Mon Sep 17 00:00:00 2001 | 1 | From 14eda2e512ec14fcae9de63f87457e4dad1a0206 Mon Sep 17 00:00:00 2001 |
2 | From: Lans Zhang <jia.zhang@windriver.com> | 2 | From: Lans Zhang <jia.zhang@windriver.com> |
3 | Date: Wed, 12 Jul 2017 16:02:13 +0800 | 3 | Date: Wed, 12 Jul 2017 16:02:13 +0800 |
4 | Subject: [PATCH] mok2verify: support to verify non-PE file with PKCS#7 | 4 | Subject: [PATCH] mok2verify: support to verify non-PE file with PKCS#7 |
@@ -52,10 +52,10 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | |||
52 | create mode 100644 include/grub/efi/mok2verify.h | 52 | create mode 100644 include/grub/efi/mok2verify.h |
53 | 53 | ||
54 | diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def | 54 | diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def |
55 | index 18d2316..59a5cf1 100644 | 55 | index 2f2765e..f07d6ea 100644 |
56 | --- a/grub-core/Makefile.core.def | 56 | --- a/grub-core/Makefile.core.def |
57 | +++ b/grub-core/Makefile.core.def | 57 | +++ b/grub-core/Makefile.core.def |
58 | @@ -1869,6 +1869,12 @@ module = { | 58 | @@ -1894,6 +1894,12 @@ module = { |
59 | enable = efi; | 59 | enable = efi; |
60 | }; | 60 | }; |
61 | 61 | ||
@@ -101,7 +101,7 @@ index bbca81e..3f44a7e 100644 | |||
101 | grub_machine_fini (grub_loader_flags); | 101 | grub_machine_fini (grub_loader_flags); |
102 | 102 | ||
103 | diff --git a/grub-core/gfxmenu/gui_label.c b/grub-core/gfxmenu/gui_label.c | 103 | diff --git a/grub-core/gfxmenu/gui_label.c b/grub-core/gfxmenu/gui_label.c |
104 | index a4c8178..da49c9e 100644 | 104 | index 1c19054..52d4755 100644 |
105 | --- a/grub-core/gfxmenu/gui_label.c | 105 | --- a/grub-core/gfxmenu/gui_label.c |
106 | +++ b/grub-core/gfxmenu/gui_label.c | 106 | +++ b/grub-core/gfxmenu/gui_label.c |
107 | @@ -24,6 +24,9 @@ | 107 | @@ -24,6 +24,9 @@ |
@@ -157,11 +157,11 @@ index a4c8178..da49c9e 100644 | |||
157 | + value = _("enter: boot, `e': options, `c': cmd-line"); | 157 | + value = _("enter: boot, `e': options, `c': cmd-line"); |
158 | + } | 158 | + } |
159 | /* FIXME: Add more templates here if needed. */ | 159 | /* FIXME: Add more templates here if needed. */ |
160 | self->template = grub_strdup (value); | 160 | |
161 | self->text = grub_xasprintf (value, self->value); | 161 | if (grub_printf_fmt_check(value, "%d") != GRUB_ERR_NONE) |
162 | diff --git a/grub-core/lib/efi/mok2verify.c b/grub-core/lib/efi/mok2verify.c | 162 | diff --git a/grub-core/lib/efi/mok2verify.c b/grub-core/lib/efi/mok2verify.c |
163 | new file mode 100644 | 163 | new file mode 100644 |
164 | index 0000000..790efa0 | 164 | index 0000000..eb268a2 |
165 | --- /dev/null | 165 | --- /dev/null |
166 | +++ b/grub-core/lib/efi/mok2verify.c | 166 | +++ b/grub-core/lib/efi/mok2verify.c |
167 | @@ -0,0 +1,182 @@ | 167 | @@ -0,0 +1,182 @@ |
@@ -241,11 +241,11 @@ index 0000000..790efa0 | |||
241 | +grub_is_secured (void) | 241 | +grub_is_secured (void) |
242 | +{ | 242 | +{ |
243 | + grub_efi_guid_t global_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; | 243 | + grub_efi_guid_t global_guid = GRUB_EFI_GLOBAL_VARIABLE_GUID; |
244 | + void *var; | 244 | + void *var = NULL; |
245 | + grub_size_t var_size = 0; | 245 | + grub_size_t var_size = 0; |
246 | + int secured = 0; | 246 | + int secured = 0; |
247 | + | 247 | + |
248 | + var = grub_efi_get_variable ("SecureBoot", &global_guid, &var_size); | 248 | + grub_efi_get_variable ("SecureBoot", &global_guid, &var_size, &var); |
249 | + if (!var) | 249 | + if (!var) |
250 | + return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read variable")); | 250 | + return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read variable")); |
251 | + | 251 | + |
@@ -254,8 +254,8 @@ index 0000000..790efa0 | |||
254 | + | 254 | + |
255 | + grub_free (var); | 255 | + grub_free (var); |
256 | + | 256 | + |
257 | + var = grub_efi_get_variable ("MokSBState", &grub_efi_mok2_verify_protoco_guid, | 257 | + grub_efi_get_variable ("MokSBState", &grub_efi_mok2_verify_protoco_guid, |
258 | + &var_size); | 258 | + &var_size, &var); |
259 | + if (!var || (var_size == 1 && *(grub_uint8_t *) var == 0)) | 259 | + if (!var || (var_size == 1 && *(grub_uint8_t *) var == 0)) |
260 | + secured = 1; | 260 | + secured = 1; |
261 | + | 261 | + |
@@ -348,20 +348,20 @@ index 0000000..790efa0 | |||
348 | + | 348 | + |
349 | +#pragma GCC diagnostic error "-Wvla" | 349 | +#pragma GCC diagnostic error "-Wvla" |
350 | diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c | 350 | diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c |
351 | index 3a264b9..9caabdd 100644 | 351 | index 14d6a80..cfbb858 100644 |
352 | --- a/grub-core/loader/i386/linux.c | 352 | --- a/grub-core/loader/i386/linux.c |
353 | +++ b/grub-core/loader/i386/linux.c | 353 | +++ b/grub-core/loader/i386/linux.c |
354 | @@ -40,6 +40,9 @@ | 354 | @@ -41,6 +41,9 @@ |
355 | #include <grub/lib/cmdline.h> | ||
356 | #include <grub/linux.h> | 355 | #include <grub/linux.h> |
357 | #include <grub/machine/kernel.h> | 356 | #include <grub/machine/kernel.h> |
357 | #include <grub/safemath.h> | ||
358 | +#ifdef GRUB_MACHINE_EFI | 358 | +#ifdef GRUB_MACHINE_EFI |
359 | +#include <grub/efi/mok2verify.h> | 359 | +#include <grub/efi/mok2verify.h> |
360 | +#endif | 360 | +#endif |
361 | 361 | ||
362 | GRUB_MOD_LICENSE ("GPLv3+"); | 362 | GRUB_MOD_LICENSE ("GPLv3+"); |
363 | 363 | ||
364 | @@ -656,6 +659,55 @@ grub_shim_verify (grub_addr_t addr, grub_ssize_t size) | 364 | @@ -664,6 +667,55 @@ grub_shim_verify (grub_addr_t addr, grub_ssize_t size) |
365 | return GRUB_ERR_NONE; | 365 | return GRUB_ERR_NONE; |
366 | } | 366 | } |
367 | 367 | ||
@@ -417,7 +417,7 @@ index 3a264b9..9caabdd 100644 | |||
417 | static grub_err_t | 417 | static grub_err_t |
418 | grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), | 418 | grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), |
419 | int argc, char *argv[]) | 419 | int argc, char *argv[]) |
420 | @@ -678,6 +730,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), | 420 | @@ -686,6 +738,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), |
421 | goto fail; | 421 | goto fail; |
422 | } | 422 | } |
423 | 423 | ||
@@ -427,7 +427,7 @@ index 3a264b9..9caabdd 100644 | |||
427 | file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL); | 427 | file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL); |
428 | if (! file) | 428 | if (! file) |
429 | goto fail; | 429 | goto fail; |
430 | @@ -1139,6 +1194,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), | 430 | @@ -1145,6 +1200,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), |
431 | fail: | 431 | fail: |
432 | grub_initrd_close (&initrd_ctx); | 432 | grub_initrd_close (&initrd_ctx); |
433 | 433 | ||
@@ -440,7 +440,7 @@ index 3a264b9..9caabdd 100644 | |||
440 | } | 440 | } |
441 | 441 | ||
442 | diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c | 442 | diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c |
443 | index 8c8565a..7b989d4 100644 | 443 | index 3fe390f..8b743d7 100644 |
444 | --- a/grub-core/loader/linux.c | 444 | --- a/grub-core/loader/linux.c |
445 | +++ b/grub-core/loader/linux.c | 445 | +++ b/grub-core/loader/linux.c |
446 | @@ -5,6 +5,9 @@ | 446 | @@ -5,6 +5,9 @@ |
@@ -453,7 +453,7 @@ index 8c8565a..7b989d4 100644 | |||
453 | 453 | ||
454 | struct newc_head | 454 | struct newc_head |
455 | { | 455 | { |
456 | @@ -279,6 +282,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, | 456 | @@ -278,6 +281,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, |
457 | int newc = 0; | 457 | int newc = 0; |
458 | struct dir *root = 0; | 458 | struct dir *root = 0; |
459 | grub_ssize_t cursize = 0; | 459 | grub_ssize_t cursize = 0; |
@@ -461,7 +461,7 @@ index 8c8565a..7b989d4 100644 | |||
461 | 461 | ||
462 | for (i = 0; i < initrd_ctx->nfiles; i++) | 462 | for (i = 0; i < initrd_ctx->nfiles; i++) |
463 | { | 463 | { |
464 | @@ -322,6 +326,25 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, | 464 | @@ -321,6 +325,25 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, |
465 | grub_initrd_close (initrd_ctx); | 465 | grub_initrd_close (initrd_ctx); |
466 | return grub_errno; | 466 | return grub_errno; |
467 | } | 467 | } |
@@ -487,7 +487,7 @@ index 8c8565a..7b989d4 100644 | |||
487 | ptr += cursize; | 487 | ptr += cursize; |
488 | } | 488 | } |
489 | if (newc) | 489 | if (newc) |
490 | @@ -330,7 +353,9 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, | 490 | @@ -329,7 +352,9 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, |
491 | ptr += ALIGN_UP_OVERHEAD (cursize, 4); | 491 | ptr += ALIGN_UP_OVERHEAD (cursize, 4); |
492 | ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); | 492 | ptr = make_header (ptr, "TRAILER!!!", sizeof ("TRAILER!!!") - 1, 0, 0); |
493 | } | 493 | } |
@@ -499,10 +499,10 @@ index 8c8565a..7b989d4 100644 | |||
499 | + return err; | 499 | + return err; |
500 | } | 500 | } |
501 | diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c | 501 | diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c |
502 | index 316ce53..5610106 100644 | 502 | index 2c3f4f8..c97df84 100644 |
503 | --- a/grub-core/normal/main.c | 503 | --- a/grub-core/normal/main.c |
504 | +++ b/grub-core/normal/main.c | 504 | +++ b/grub-core/normal/main.c |
505 | @@ -33,6 +33,9 @@ | 505 | @@ -34,6 +34,9 @@ |
506 | #include <grub/charset.h> | 506 | #include <grub/charset.h> |
507 | #include <grub/script_sh.h> | 507 | #include <grub/script_sh.h> |
508 | #include <grub/bufio.h> | 508 | #include <grub/bufio.h> |
@@ -512,7 +512,7 @@ index 316ce53..5610106 100644 | |||
512 | 512 | ||
513 | GRUB_MOD_LICENSE ("GPLv3+"); | 513 | GRUB_MOD_LICENSE ("GPLv3+"); |
514 | 514 | ||
515 | @@ -195,6 +198,8 @@ read_config_file (const char *config) | 515 | @@ -196,6 +199,8 @@ read_config_file (const char *config) |
516 | return newmenu; | 516 | return newmenu; |
517 | } | 517 | } |
518 | 518 | ||
@@ -521,7 +521,7 @@ index 316ce53..5610106 100644 | |||
521 | /* Initialize the screen. */ | 521 | /* Initialize the screen. */ |
522 | void | 522 | void |
523 | grub_normal_init_page (struct grub_term_output *term, | 523 | grub_normal_init_page (struct grub_term_output *term, |
524 | @@ -202,13 +207,24 @@ grub_normal_init_page (struct grub_term_output *term, | 524 | @@ -203,13 +208,24 @@ grub_normal_init_page (struct grub_term_output *term, |
525 | { | 525 | { |
526 | grub_ssize_t msg_len; | 526 | grub_ssize_t msg_len; |
527 | int posx; | 527 | int posx; |
@@ -547,7 +547,7 @@ index 316ce53..5610106 100644 | |||
547 | if (!msg_formatted) | 547 | if (!msg_formatted) |
548 | return; | 548 | return; |
549 | 549 | ||
550 | @@ -233,6 +249,8 @@ grub_normal_init_page (struct grub_term_output *term, | 550 | @@ -234,6 +250,8 @@ grub_normal_init_page (struct grub_term_output *term, |
551 | grub_free (unicode_msg); | 551 | grub_free (unicode_msg); |
552 | } | 552 | } |
553 | 553 | ||
@@ -556,7 +556,7 @@ index 316ce53..5610106 100644 | |||
556 | static void | 556 | static void |
557 | read_lists (const char *val) | 557 | read_lists (const char *val) |
558 | { | 558 | { |
559 | @@ -273,6 +291,20 @@ grub_normal_execute (const char *config, int nested, int batch) | 559 | @@ -274,6 +292,20 @@ grub_normal_execute (const char *config, int nested, int batch) |
560 | 560 | ||
561 | if (config) | 561 | if (config) |
562 | { | 562 | { |
@@ -577,7 +577,7 @@ index 316ce53..5610106 100644 | |||
577 | menu = read_config_file (config); | 577 | menu = read_config_file (config); |
578 | 578 | ||
579 | /* Ignore any error. */ | 579 | /* Ignore any error. */ |
580 | @@ -304,7 +336,10 @@ grub_enter_normal_mode (const char *config) | 580 | @@ -305,7 +337,10 @@ grub_enter_normal_mode (const char *config) |
581 | const char *val = grub_env_get ("strict_security"); | 581 | const char *val = grub_env_get ("strict_security"); |
582 | if (!(val && (val[0] == '1' || val[0] == 'e'))) { | 582 | if (!(val && (val[0] == '1' || val[0] == 'e'))) { |
583 | grub_boot_time ("Entering shell"); | 583 | grub_boot_time ("Entering shell"); |
@@ -589,7 +589,7 @@ index 316ce53..5610106 100644 | |||
589 | } | 589 | } |
590 | nested_level--; | 590 | nested_level--; |
591 | if (grub_normal_exit_level) | 591 | if (grub_normal_exit_level) |
592 | @@ -341,6 +376,13 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), | 592 | @@ -359,6 +394,13 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), |
593 | grub_enter_normal_mode (argv[0]); | 593 | grub_enter_normal_mode (argv[0]); |
594 | 594 | ||
595 | quit: | 595 | quit: |
@@ -603,7 +603,7 @@ index 316ce53..5610106 100644 | |||
603 | return 0; | 603 | return 0; |
604 | } | 604 | } |
605 | 605 | ||
606 | @@ -528,8 +570,11 @@ GRUB_MOD_INIT(normal) | 606 | @@ -546,8 +588,11 @@ GRUB_MOD_INIT(normal) |
607 | /* Register a command "normal" for the rescue mode. */ | 607 | /* Register a command "normal" for the rescue mode. */ |
608 | grub_register_command ("normal", grub_cmd_normal, | 608 | grub_register_command ("normal", grub_cmd_normal, |
609 | 0, N_("Enter normal mode.")); | 609 | 0, N_("Enter normal mode.")); |
@@ -618,7 +618,7 @@ index 316ce53..5610106 100644 | |||
618 | /* Reload terminal colors when these variables are written to. */ | 618 | /* Reload terminal colors when these variables are written to. */ |
619 | grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); | 619 | grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); |
620 | diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c | 620 | diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c |
621 | index d5e0c79..512f710 100644 | 621 | index 8397886..76c3f5a 100644 |
622 | --- a/grub-core/normal/menu.c | 622 | --- a/grub-core/normal/menu.c |
623 | +++ b/grub-core/normal/menu.c | 623 | +++ b/grub-core/normal/menu.c |
624 | @@ -32,6 +32,9 @@ | 624 | @@ -32,6 +32,9 @@ |
@@ -631,7 +631,7 @@ index d5e0c79..512f710 100644 | |||
631 | 631 | ||
632 | /* Time to delay after displaying an error message about a default/fallback | 632 | /* Time to delay after displaying an error message about a default/fallback |
633 | entry failing to boot. */ | 633 | entry failing to boot. */ |
634 | @@ -773,18 +776,30 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) | 634 | @@ -772,18 +775,30 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot) |
635 | break; | 635 | break; |
636 | 636 | ||
637 | case 'c': | 637 | case 'c': |