fwupd/fwupd-bsc1182057-fix-sbat-section-copy.patch

35 lines
1.2 KiB
Diff
Raw Normal View History

From b283395049be8071d3699dfa3a411a3b37406f0b Mon Sep 17 00:00:00 2001
From: Gary Lin <glin@suse.com>
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 <glin@suse.com>
---
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