Re: [OE-core] [PATCH v2 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications

2019-09-17 Thread richard . purdie
On Tue, 2019-09-17 at 12:33 +0300, Dmitry Eremin-Solenikov wrote:
> вт, 17 сент. 2019 г. в 01:17, Richard Purdie
> :
> > On Fri, 2019-09-13 at 18:44 +0300, dbarysh...@gmail.com wrote:
> > > From: Dmitry Eremin-Solenikov  > > >
> > > 
> > > Create new bbclass defining common variables for all UEFI-related
> > > packages (bootloaders, test applications, etc).
> > > 
> > > Signed-off-by: Dmitry Eremin-Solenikov <
> > > dmitry_eremin-soleni...@mentor.com>
> > > ---
> > >  meta/classes/uefi.bbclass | 26 ++
> > >  1 file changed, 26 insertions(+)
> > >  create mode 100644 meta/classes/uefi.bbclass
> > 
> > I really want to get away from the proliferation of bbclass files
> > we
> > have. Wouldn't this make more sense as a .conf file?
> 
> Moving configuration to .conf file might make sense. I even can
> implement anonymous function as per-arch override. However there are
> still functions like efi_populate_common() and
> efi_iso_populate_common(), which can not be moved to .conf file.
> 
> Would you prefer separate uefi.conf file and uefi-bootloader.bbclass
> files

Would functions like this not be better suited to a lib/oe/efi.py ?

Its really easy to just put everything in a bbclass but I'm not
convinced its scaling well...

Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications

2019-09-17 Thread Dmitry Eremin-Solenikov
вт, 17 сент. 2019 г. в 01:17, Richard Purdie
:
>
> On Fri, 2019-09-13 at 18:44 +0300, dbarysh...@gmail.com wrote:
> > From: Dmitry Eremin-Solenikov 
> >
> > Create new bbclass defining common variables for all UEFI-related
> > packages (bootloaders, test applications, etc).
> >
> > Signed-off-by: Dmitry Eremin-Solenikov <
> > dmitry_eremin-soleni...@mentor.com>
> > ---
> >  meta/classes/uefi.bbclass | 26 ++
> >  1 file changed, 26 insertions(+)
> >  create mode 100644 meta/classes/uefi.bbclass
>
> I really want to get away from the proliferation of bbclass files we
> have. Wouldn't this make more sense as a .conf file?

Moving configuration to .conf file might make sense. I even can
implement anonymous function as per-arch override. However there are
still functions like efi_populate_common() and
efi_iso_populate_common(), which can not be moved to .conf file.

Would you prefer separate uefi.conf file and uefi-bootloader.bbclass files?

> The anonymous function could be done with overrides, or an appropriate
> function from lib/oe/.
>
> I appreciate we don't use conf files so much but we need to start
> somewhere and I think this is a good candidate for it.

-- 
With best wishes
Dmitry
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications

2019-09-16 Thread Richard Purdie
On Fri, 2019-09-13 at 18:44 +0300, dbarysh...@gmail.com wrote:
> From: Dmitry Eremin-Solenikov 
> 
> Create new bbclass defining common variables for all UEFI-related
> packages (bootloaders, test applications, etc).
> 
> Signed-off-by: Dmitry Eremin-Solenikov <
> dmitry_eremin-soleni...@mentor.com>
> ---
>  meta/classes/uefi.bbclass | 26 ++
>  1 file changed, 26 insertions(+)
>  create mode 100644 meta/classes/uefi.bbclass

I really want to get away from the proliferation of bbclass files we
have. Wouldn't this make more sense as a .conf file? 

The anonymous function could be done with overrides, or an appropriate
function from lib/oe/.

I appreciate we don't use conf files so much but we need to start
somewhere and I think this is a good candidate for it.

Cheers,

Richard


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications

2019-09-13 Thread dbaryshkov
From: Dmitry Eremin-Solenikov 

Create new bbclass defining common variables for all UEFI-related
packages (bootloaders, test applications, etc).

Signed-off-by: Dmitry Eremin-Solenikov 
---
 meta/classes/uefi.bbclass | 26 ++
 1 file changed, 26 insertions(+)
 create mode 100644 meta/classes/uefi.bbclass

diff --git a/meta/classes/uefi.bbclass b/meta/classes/uefi.bbclass
new file mode 100644
index ..7991640a2aaa
--- /dev/null
+++ b/meta/classes/uefi.bbclass
@@ -0,0 +1,26 @@
+# Location of EFI files inside EFI System Partition
+EFIDIR ?= "/EFI/BOOT"
+
+# Prefix where ESP is mounted inside rootfs. Set to empty if package is going
+# to be installed to ESP directly
+EFI_PREFIX ?= "/boot"
+
+# Location inside rootfs.
+EFI_FILES_PATH = "${EFI_PREFIX}${EFIDIR}"
+
+# Determine name of bootloader image
+python __anonymous () {
+import re
+target = d.getVar('TARGET_ARCH')
+if target == "x86_64":
+image = "bootx64.efi"
+elif re.match('i.86', target):
+image = "bootia32.efi"
+elif re.match('aarch64', target):
+image = "bootaa64.efi"
+elif re.match('arm', target):
+image = "bootarm.efi"
+else:
+raise bb.parse.SkipRecipe("UEFI unsupported on target %s, skipping" % 
target)
+d.setVar("EFI_BOOT_IMAGE", image)
+}
-- 
2.23.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core