From: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
To: grub-devel@gnu.org
Cc: dja@axtens.net, jan.setjeeilers@oracle.com,
julian.klode@canonical.com, mate.kukri@canonical.com,
pjones@redhat.com, Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Subject: [PATCH v3 2/2] mkimage: adding sbat metadata into sbat ELF Note on powerpc
Date: Fri, 13 Sep 2024 16:57:59 +0530 [thread overview]
Message-ID: <20240913112759.3055065-3-sudhakar@linux.ibm.com> (raw)
In-Reply-To: <20240913112759.3055065-1-sudhakar@linux.ibm.com>
The SBAT metadata, which is read from .csv file and transformed into an ELF note,
is made into an image using the -s option.
Signed-off-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Co-authored-by: Daniel Axtens <dja@axtens.net>
---
util/mkimage.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/util/mkimage.c b/util/mkimage.c
index e67f7ce73..bafe190b0 100644
--- a/util/mkimage.c
+++ b/util/mkimage.c
@@ -943,8 +943,9 @@ grub_install_generate_image (const char *dir, const char *prefix,
total_module_size += dtb_size + sizeof (struct grub_module_header);
}
- if (sbat_path != NULL && image_target->id != IMAGE_EFI)
- grub_util_error (_(".sbat section can be embedded into EFI images only"));
+ if (sbat_path != NULL && (image_target->id != IMAGE_EFI && image_target->id != IMAGE_PPC))
+ grub_util_error (_(".sbat section can be embedded into EFI images/"
+ "sbat ELF Note can be added into powerpc-ieee1275 images only"));
if (disable_shim_lock)
total_module_size += sizeof (struct grub_module_header);
@@ -1814,6 +1815,13 @@ grub_install_generate_image (const char *dir, const char *prefix,
{
grub_uint64_t target_addr;
char *sbat = NULL;
+ if (sbat_path != NULL)
+ {
+ sbat_size = grub_util_get_image_size (sbat_path);
+ sbat = xmalloc (sbat_size);
+ grub_util_load_image (sbat_path, sbat);
+ layout.sbat_size = sbat_size;
+ }
if (image_target->id == IMAGE_LOONGSON_ELF)
{
if (comp == GRUB_COMPRESSION_NONE)
--
2.43.5
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2024-09-13 11:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 11:27 [PATCH v3 0/2] Secure Boot Advanced Targeting (SBAT) support on powerpc Sudhakar Kuppusamy
2024-09-13 11:27 ` [PATCH v3 1/2] mkimage: create new ELF Note for SBAT Sudhakar Kuppusamy
2024-10-16 15:06 ` Daniel Kiper
2024-10-23 5:06 ` sudhakar
2024-09-13 11:27 ` Sudhakar Kuppusamy [this message]
2024-10-16 15:12 ` [PATCH v3 2/2] mkimage: adding sbat metadata into sbat ELF Note on powerpc Daniel Kiper
2024-10-22 8:32 ` sudhakar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240913112759.3055065-3-sudhakar@linux.ibm.com \
--to=sudhakar@linux.ibm.com \
--cc=dja@axtens.net \
--cc=grub-devel@gnu.org \
--cc=jan.setjeeilers@oracle.com \
--cc=julian.klode@canonical.com \
--cc=mate.kukri@canonical.com \
--cc=pjones@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.