From 9c910dfa10b136439ceb019b78d242d54f19771d Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Thu, 24 Feb 2022 20:10:21 +0000 Subject: [PATCH] Fix appending signature support commit (thanks: pjones) Signed-off-by: Robbie Harwood --- ...igning-grub-with-an-appended-signatu.patch | 24 ++++++++++--------- ...-support-embedding-x509-certificates.patch | 4 ++-- grub2.spec | 5 +++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch b/0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch index caab8d58..ef644149 100644 --- a/0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch +++ b/0160-Add-suport-for-signing-grub-with-an-appended-signatu.patch @@ -43,16 +43,16 @@ that verifies these signatures. You can find one at: I will be proposing this for inclusion in a future Power Architecture Platform Reference (PAPR). --- - util/grub-install-common.c | 18 ++++++++++++++++-- + util/grub-install-common.c | 18 ++++++++++++++---- util/grub-mkimage.c | 15 +++++++++++++-- util/grub-mkimagexx.c | 39 ++++++++++++++++++++++++++++++++++++++- util/mkimage.c | 13 +++++++------ include/grub/util/install.h | 8 ++++++-- include/grub/util/mkimage.h | 4 ++-- - 6 files changed, 82 insertions(+), 15 deletions(-) + 6 files changed, 80 insertions(+), 17 deletions(-) diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index 4e212e690c5..aab2a941f85 100644 +index 4e212e690c5..a74fee16e22 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -461,10 +461,12 @@ static size_t npubkeys; @@ -81,22 +81,24 @@ index 4e212e690c5..aab2a941f85 100644 default: return 0; } -@@ -665,7 +673,13 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -661,11 +669,13 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, + " --output '%s' " + " --dtb '%s' " + "--sbat '%s' " +- "--format '%s' --compression '%s' %s %s %s\n", ++ "--format '%s' --compression '%s' " ++ "--appended-signature-size %zu %s %s %s\n", dir, prefix, outname, dtb ? : "", sbat ? : "", mkimage_target, - compnames[compression], note ? "--note" : "", +- compnames[compression], note ? "--note" : "", - disable_shim_lock ? "--disable-shim-lock" : "", s); -+ disable_shim_lock ? "--disable-shim-lock" : "", -+ "--format '%s' --compression '%s' " -+ "--appended-signature-size %zu %s %s\n", -+ dir, prefix, -+ outname, dtb ? : "", mkimage_target, + compnames[compression], appsig_size, ++ disable_shim_lock ? "--disable-shim-lock" : "", + note ? "--note" : "", s); free (s); tgt = grub_install_get_image_target (mkimage_target); -@@ -675,7 +689,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -675,7 +685,7 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, grub_install_generate_image (dir, prefix, fp, outname, modules.entries, memdisk_path, pubkeys, npubkeys, config_path, tgt, diff --git a/0172-grub-install-support-embedding-x509-certificates.patch b/0172-grub-install-support-embedding-x509-certificates.patch index bd02e6de..136d2165 100644 --- a/0172-grub-install-support-embedding-x509-certificates.patch +++ b/0172-grub-install-support-embedding-x509-certificates.patch @@ -33,7 +33,7 @@ index 355a43844ac..b81ac0ae46c 100644 pseudo_file.fs = &pseudo_fs; diff --git a/util/grub-install-common.c b/util/grub-install-common.c -index aab2a941f85..422f82362c7 100644 +index a74fee16e22..2d9693ffeb7 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -460,6 +460,8 @@ static char **pubkeys; @@ -82,7 +82,7 @@ index aab2a941f85..422f82362c7 100644 for (md = modules.entries; *md; md++) { *p++ = '\''; -@@ -688,7 +706,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, +@@ -684,7 +702,9 @@ grub_install_make_image_wrap_file (const char *dir, const char *prefix, grub_install_generate_image (dir, prefix, fp, outname, modules.entries, memdisk_path, diff --git a/grub2.spec b/grub2.spec index 8635342e..a7f8cb39 100644 --- a/grub2.spec +++ b/grub2.spec @@ -16,7 +16,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 16%{?dist} +Release: 17%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -525,6 +525,9 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Thu Feb 24 2022 Robbie Harwood - 2.06-17 +- Fix appended signature support commit (thanks: pjones) + * Thu Feb 24 2022 Robbie Harwood - 2.06-16 - Suffer through updating gnulib