diff --git a/debian/changelog b/debian/changelog index 1d1e39574..79b83d8b8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ grub2 (2.06-8) UNRELEASED; urgency=medium devices. * /etc/default/grub: Fix comment about text-mode console. Fixes #845683 + * grub-install: Don't install the shim fallback program when called + with --removable. Closes: #1016737 -- Steve McIntyre <93sam@debian.org> Thu, 29 Dec 2022 13:36:22 +0000 diff --git a/debian/patches/grub-install-removable-shim.patch b/debian/patches/grub-install-removable-shim.patch index a38438709..53c28d698 100644 --- a/debian/patches/grub-install-removable-shim.patch +++ b/debian/patches/grub-install-removable-shim.patch @@ -21,10 +21,10 @@ Patch-Name: grub-install-removable-shim.patch util/grub-install.c | 83 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 66 insertions(+), 17 deletions(-) -diff --git a/util/grub-install.c b/util/grub-install.c -index 05b695226..43fc27c55 100644 ---- a/util/grub-install.c -+++ b/util/grub-install.c +Index: grub.git/util/grub-install.c +=================================================================== +--- grub.git.orig/util/grub-install.c ++++ grub.git/util/grub-install.c @@ -891,17 +891,13 @@ check_component_exists(const char *dir, static void also_install_removable(const char *src, @@ -107,10 +107,10 @@ index 05b695226..43fc27c55 100644 fb_src = grub_util_path_concat (2, "/usr/lib/shim/", fb_signed); -@@ -2153,30 +2151,81 @@ main (int argc, char *argv[]) - fb_file); - grub_install_copy_file (fb_src, - fb_dst, 0); +@@ -2154,30 +2152,81 @@ main (int argc, char *argv[]) + if (!removable) + grub_install_copy_file (fb_src, + fb_dst, 0); + + csv_src = grub_util_path_concat (2, "/usr/lib/shim/", + csv_file); diff --git a/debian/patches/install-signed.patch b/debian/patches/install-signed.patch index bfeb3a938..847606ee7 100644 --- a/debian/patches/install-signed.patch +++ b/debian/patches/install-signed.patch @@ -11,18 +11,18 @@ Author: Steve Langasek Author: Linn Crosetto Author: Mathieu Trudel-Lapierre Forwarded: no -Last-Update: 2021-09-24 +Last-Update: 2023-01-15 Patch-Name: install-signed.patch --- util/grub-install.c | 212 ++++++++++++++++++++++++++++++++------------ 1 file changed, 153 insertions(+), 59 deletions(-) -diff --git a/util/grub-install.c b/util/grub-install.c -index 48e2d3779..f49c78d0b 100644 ---- a/util/grub-install.c -+++ b/util/grub-install.c -@@ -80,6 +80,7 @@ static char *label_color; +Index: grub.git/util/grub-install.c +=================================================================== +--- grub.git.orig/util/grub-install.c ++++ grub.git/util/grub-install.c +@@ -79,6 +79,7 @@ static char *label_color; static char *label_bgcolor; static char *product_version; static int add_rs_codes = 1; @@ -30,7 +30,7 @@ index 48e2d3779..f49c78d0b 100644 enum { -@@ -110,7 +111,9 @@ enum +@@ -109,7 +110,9 @@ enum OPTION_LABEL_FONT, OPTION_LABEL_COLOR, OPTION_LABEL_BGCOLOR, @@ -41,7 +41,7 @@ index 48e2d3779..f49c78d0b 100644 }; static int fs_probe = 1; -@@ -234,6 +237,14 @@ argp_parser (int key, char *arg, struct argp_state *state) +@@ -233,6 +236,14 @@ argp_parser (int key, char *arg, struct bootloader_id = xstrdup (arg); return 0; @@ -56,7 +56,7 @@ index 48e2d3779..f49c78d0b 100644 case ARGP_KEY_ARG: if (install_device) grub_util_error ("%s", _("More than one install device?")); -@@ -303,6 +314,14 @@ static struct argp_option options[] = { +@@ -302,6 +313,14 @@ static struct argp_option options[] = { {"label-color", OPTION_LABEL_COLOR, N_("COLOR"), 0, N_("use COLOR for label"), 2}, {"label-bgcolor", OPTION_LABEL_BGCOLOR, N_("COLOR"), 0, N_("use COLOR for label background"), 2}, {"product-version", OPTION_PRODUCT_VERSION, N_("STRING"), 0, N_("use STRING as product version"), 2}, @@ -71,7 +71,7 @@ index 48e2d3779..f49c78d0b 100644 {0, 0, 0, 0, 0, 0} }; -@@ -833,7 +852,8 @@ main (int argc, char *argv[]) +@@ -832,7 +851,8 @@ main (int argc, char *argv[]) { int is_efi = 0; const char *efi_distributor = NULL; @@ -81,7 +81,7 @@ index 48e2d3779..f49c78d0b 100644 char **grub_devices; grub_fs_t grub_fs; grub_device_t grub_dev = NULL; -@@ -1103,6 +1123,39 @@ main (int argc, char *argv[]) +@@ -1102,6 +1122,39 @@ main (int argc, char *argv[]) */ char *t; efi_distributor = bootloader_id; @@ -121,7 +121,7 @@ index 48e2d3779..f49c78d0b 100644 if (removable) { /* The specification makes stricter requirements of removable -@@ -1111,66 +1164,16 @@ main (int argc, char *argv[]) +@@ -1110,66 +1163,16 @@ main (int argc, char *argv[]) must have a specific file name depending on the architecture. */ efi_distributor = "BOOT"; @@ -192,7 +192,7 @@ index 48e2d3779..f49c78d0b 100644 } t = grub_util_path_concat (3, efidir, "EFI", efi_distributor); free (efidir); -@@ -1376,14 +1379,41 @@ main (int argc, char *argv[]) +@@ -1375,14 +1378,41 @@ main (int argc, char *argv[]) } } @@ -236,7 +236,7 @@ index 48e2d3779..f49c78d0b 100644 { char *uuid = NULL; /* generic method (used on coreboot and ata mod). */ -@@ -1941,7 +1971,71 @@ main (int argc, char *argv[]) +@@ -1927,7 +1957,72 @@ main (int argc, char *argv[]) case GRUB_INSTALL_PLATFORM_IA64_EFI: { char *dst = grub_util_path_concat (2, efidir, efi_file); @@ -289,8 +289,9 @@ index 48e2d3779..f49c78d0b 100644 + fb_signed); + fb_dst = grub_util_path_concat (2, efidir, + fb_file); -+ grub_install_copy_file (fb_src, -+ fb_dst, 0); ++ if (!removable) ++ grub_install_copy_file (fb_src, ++ fb_dst, 0); + free (fb_src); + free (fb_dst); + }