From 2bb757626a09677e2cf3c46428b498f5df683bf4972d57b6d6d3ba77a21e6852 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 15 Mar 2021 12:52:44 +0000 Subject: [PATCH] Accepting request 878495 from home:gary_lin:branches:Base:System - Add fwupd-bsc1182057-fix-sbat-section-copy.patch to set the proper section flags for .sbat section so that objcopy can copy it into fwupd*.efi (bsc#1182057) OBS-URL: https://build.opensuse.org/request/show/878495 OBS-URL: https://build.opensuse.org/package/show/Base:System/fwupd?expand=0&rev=101 --- fwupd-bsc1182057-fix-sbat-section-copy.patch | 34 ++++++++++++++++++++ fwupd.changes | 7 ++++ fwupd.spec | 2 ++ 3 files changed, 43 insertions(+) create mode 100644 fwupd-bsc1182057-fix-sbat-section-copy.patch diff --git a/fwupd-bsc1182057-fix-sbat-section-copy.patch b/fwupd-bsc1182057-fix-sbat-section-copy.patch new file mode 100644 index 0000000..c901ef3 --- /dev/null +++ b/fwupd-bsc1182057-fix-sbat-section-copy.patch @@ -0,0 +1,34 @@ +From b283395049be8071d3699dfa3a411a3b37406f0b Mon Sep 17 00:00:00 2001 +From: Gary Lin +Date: Tue, 9 Mar 2021 15:26:20 +0800 +Subject: [PATCH] uefi-capsule: Specify the section flags for .sbat + +When using "objcopy -O binary" to generate AArch64 EFI images, it +silently drops the sections without "alloc" or "load" or the sections +with "unload", and this caused the content of .sbat was skipped in the +final EFI image. + +This commit sets the common read-only data section flags to .sbat to +make sure the content will be copied. + +Signed-off-by: Gary Lin +--- + plugins/uefi-capsule/efi/generate_sbat.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/plugins/uefi-capsule/efi/generate_sbat.py b/plugins/uefi-capsule/efi/generate_sbat.py +index 227bc841..18f7c4c7 100755 +--- a/plugins/uefi-capsule/efi/generate_sbat.py ++++ b/plugins/uefi-capsule/efi/generate_sbat.py +@@ -70,6 +70,8 @@ def _generate_sbat(args): + args.objcopy, + "--add-section", + ".sbat={}".format(sfd.name), ++ "--set-section-flags", ++ ".sbat=contents,alloc,load,readonly,data", + args.outfile, + ] + subprocess.run(argv, check=True) +-- +2.29.2 + diff --git a/fwupd.changes b/fwupd.changes index 7d87291..ffea2a9 100644 --- a/fwupd.changes +++ b/fwupd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 12 08:30:32 UTC 2021 - Gary Ching-Pang Lin + +- Add fwupd-bsc1182057-fix-sbat-section-copy.patch to set the + proper section flags for .sbat section so that objcopy can + copy it into fwupd*.efi (bsc#1182057) + ------------------------------------------------------------------- Wed Feb 24 01:50:12 UTC 2021 - Gary Ching-Pang Lin diff --git a/fwupd.spec b/fwupd.spec index 6178bce..eef1b6d 100644 --- a/fwupd.spec +++ b/fwupd.spec @@ -44,6 +44,8 @@ Source: %{name}-%{version}.tar.xz Patch1: fwupd-bsc1130056-change-shim-path.patch # PATCH-FIX-OPENSUSE fwupd-jscSLE-11766-close-efidir-leap-gap.patch jsc#SLE-11766 qkzhu@suse.com -- Set SLE and openSUSE esp os dir at runtime Patch2: fwupd-jscSLE-11766-close-efidir-leap-gap.patch +# PATCH-FIX-UPSTRAEM fwupd-bsc1182057-fix-sbat-section-copy.patch bsc#1182057 glin@suse.com -- Set the proper section flags for .sbat +Patch3: fwupd-bsc1182057-fix-sbat-section-copy.patch BuildRequires: dejavu-fonts %if %{with fish_support}