At present Tianocore uses a 'name' property to figure out what each
image is for. However this is not in the UPL spec.

For now, add a work-around so that Tianocore can boot.

Signed-off-by: Simon Glass <[email protected]>
---

 boot/upl_write.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/boot/upl_write.c b/boot/upl_write.c
index a9d25f607fe..d8211b2cf77 100644
--- a/boot/upl_write.c
+++ b/boot/upl_write.c
@@ -280,6 +280,7 @@ static int add_upl_images(const struct upl *upl, ofnode 
options)
 
        alist_for_each(img, &upl->image) {
                char buf[sizeof(u64) * 4];
+               const char *ptr = NULL;
                ofnode subnode;
                char name[30];
                int len;
@@ -313,6 +314,15 @@ static int add_upl_images(const struct upl *upl, ofnode 
options)
                if (ret < 0)
                        return log_msg_ret("uma", ret);
 
+               if (!strcmp(img->description, "UEFI Firmware Volume"))
+                       ptr = "uefi-fv";
+               else if (!strcmp(img->description, "BDS Firmware Volume"))
+                       ptr = "bds-fv";
+               if (ptr) {
+                       ret = ofnode_write_string(node, "name", ptr);
+                       if (ret < 0)
+                               return log_msg_ret("uma", ret);
+               }
        }
 
        return 0;
-- 
2.43.0

Reply via email to