[OE-core] [PATCH 6/7] wic:bootimg-efi:try other place for efi

Tom Rini trini at konsulko.com
Tue Sep 4 02:26:09 UTC 2018


On Tue, Sep 04, 2018 at 10:15:44AM +0800, Lu.Jiang wrote:
> 
> 在 2018年09月03日 10:01, Lu.Jiang 写道:
> >在 2018年08月31日 21:52, Tom Rini 写道:
> >>On Fri, Aug 31, 2018 at 10:15:09AM +0800, Jiang Lu wrote:
> >>
> >>>When there is no useful efi in $kerneldir, try copy
> >>>all efi from EFI/BOOT into boot image.
> >>>
> >>>Signed-off-by: Jiang Lu <lu.jiang at windriver.com>
> >>>---
> >>>  .../wic/files/wic/plugins/source/bootimg-efi.py | 12 ++++++++++++
> >>>  1 file changed, 12 insertions(+)
> >>>
> >>>diff --git
> >>>a/meta/recipes-support/wic/files/wic/plugins/source/bootimg-efi.py
> >>>b/meta/recipes-support/wic/files/wic/plugins/source/bootimg-efi.py
> >>>index 0eb86a0..d435268 100644
> >>>--- a/meta/recipes-support/wic/files/wic/plugins/source/bootimg-efi.py
> >>>+++ b/meta/recipes-support/wic/files/wic/plugins/source/bootimg-efi.py
> >>>@@ -231,6 +231,18 @@ class BootimgEFIPlugin(SourcePlugin):
> >>>              else:
> >>>                  raise WicError("unrecognized bootimg-efi loader: %s"
> >>>%
> >>>                                 source_params['loader'])
> >>>+            os.listdir("%s/EFI/BOOT/" % hdddir)
> >>>+            found_efi = False
> >>>+            for x in os.listdir("%s/EFI/BOOT/" % hdddir) :
> >>>+                if x.endswith(".efi"):
> >>>+                    found_efi = True
> >>>+                    break;
> >>>+            if not found_efi:
> >>>+                cp_cmd = "cp %s/EFI/BOOT/*.efi %s/EFI/BOOT/" %
> >>>(kernel_dir, hdddir)
> >>>+                try:
> >>>+                    exec_cmd(cp_cmd, True)
> >>>+                except:
> >>>+                    pass
> >>>          except KeyError:
> >>>              raise WicError("bootimg-efi requires a loader, none
> >>>specified")
> >>I'm not sure this is the right approach.  If you don't have things set
> >>up for automagic finding you should use bootimg-partition and
> >>IMAGE_BOOT_FILES.  I'm doing this right now for some EFI projects
> >>because it's also bad form to dump everything into EFI/BOOT and some
> >>things should end up in EFI/vendorname or similar.
> >>
> 
> Hi Tom,
> 
> By indicating IMAGE_BOOT_FILES for bootimg-partition, can perform copy file
> work. While we still need the code in bootimg-efi to re-generate grub.cfg.
> 
> I prefer use bootimg-efi for this case, but we can add a new parameter to
> distinguish kernel dir & bootloader dir(for efi files)

I'm still not seeing why we need this, sorry.

If we need files in the ESP in EFI/BOOT/ then in our root filesystem
they're already in as /boot/efi/EFI/BOOT and we say that we populate
things from /boot/efi and this also gets us things like
/boot/efi/EFI/vendor and so forth populated and matches other Linux
distributions.

If we need something more complex, we have IMAGE_BOOT_FILES available
and can and should be populating the deploy directory like other
architectures and loaders do.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180903/fe4b7151/attachment-0002.sig>


More information about the Openembedded-core mailing list