Re: [OE-core] [PATCH] meta: handle UBOOT_CONFIG in image.bbclass

2019-05-16 Thread Ming Liu
> I wonder if we need to make it warn about missing functionality if
someone is using the old option though?

Agreed, will do that in V2.

//Ming Liu

 於 2019年5月16日 週四 下午12:55寫道:

> On Thu, 2019-05-16 at 10:56 +0200, Ming Liu wrote:
> > Hi, Richard:
> >
> > > I'd imagine the code is designed so you'd inherit uboot-config in
> > the machine and this therefore could be made to work as is.
> >
> > Yes, that probably is how the author intended it to be used, but
> > unfortunately, that's not how it's being used in BSP layers, that
> > fact is, in most BSP meta layers, they do not put it into INHERIT,
> > only u-boot recipes are inheriting uboot-config.
> >
> > I am on board there is no need to set IMAGE_FSTYPES in uboot-
> > config.bbclass, maybe we should drop it from UBOOT_CONFIG and it
> > would be like: 'UBOOT_CONFIG = "config,,binary"', there will be a
> > empty item in the middle, so the BSP meta layers would work as usual.
> >
> > Will send a V2 if you agree with this.
>
> I agree, I wonder if we need to make it warn about missing
> functionality if someone is using the old option though?
>
> Cheers,
>
> Richard
>
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] meta: handle UBOOT_CONFIG in image.bbclass

2019-05-16 Thread richard . purdie
On Thu, 2019-05-16 at 10:56 +0200, Ming Liu wrote:
> Hi, Richard:
> 
> > I'd imagine the code is designed so you'd inherit uboot-config in
> the machine and this therefore could be made to work as is.
> 
> Yes, that probably is how the author intended it to be used, but
> unfortunately, that's not how it's being used in BSP layers, that
> fact is, in most BSP meta layers, they do not put it into INHERIT,
> only u-boot recipes are inheriting uboot-config.
> 
> I am on board there is no need to set IMAGE_FSTYPES in uboot-
> config.bbclass, maybe we should drop it from UBOOT_CONFIG and it
> would be like: 'UBOOT_CONFIG = "config,,binary"', there will be a
> empty item in the middle, so the BSP meta layers would work as usual.
> 
> Will send a V2 if you agree with this.

I agree, I wonder if we need to make it warn about missing
functionality if someone is using the old option though?

Cheers,

Richard

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


Re: [OE-core] [PATCH] meta: handle UBOOT_CONFIG in image.bbclass

2019-05-16 Thread Ming Liu
Hi, Richard:

> I'd imagine the code is designed so you'd inherit uboot-config in the
machine and this therefore could be made to work as is.

Yes, that probably is how the author intended it to be used, but
unfortunately, that's not how it's being used in BSP layers, that fact is,
in most BSP meta layers, they do not put it into INHERIT, only u-boot
recipes are inheriting uboot-config.

I am on board there is no need to set IMAGE_FSTYPES in
uboot-config.bbclass, maybe we should drop it from UBOOT_CONFIG and it
would be like: 'UBOOT_CONFIG = "config,,binary"', there will be a empty
item in the middle, so the BSP meta layers would work as usual.

Will send a V2 if you agree with this.

//Ming Liu

Richard Purdie  於 2019年5月16日 週四
上午10:23寫道:

> On Wed, 2019-05-15 at 21:22 +0200, liu.min...@gmail.com wrote:
> > From: Ming Liu 
> >
> > The code dealing with IMAGE_FSTYPES in uboot-config.bbclass would not
> > take any effect since it's in a uboot particular class, but it's not
> > being inherited by any image recipes.
> >
> > Move the IMAGE_FSTYPES handling part to image.bbclass would make it
> > really work.
> >
> > Also drop some trivial debug code.
> >
> > Signed-off-by: Ming Liu 
> > ---
> >  meta/classes/image.bbclass| 12 
> >  meta/classes/uboot-config.bbclass | 17 -
> >  meta/conf/documentation.conf  |  2 +-
> >  3 files changed, 17 insertions(+), 14 deletions(-)
>
> This doesn't make sense, if we want to set IMAGE_FSTYPES, lets just set
> that.
>
> I'd imagine the code is designed so you'd inherit uboot-config in the
> machine and this therefore could be made to work as is.
>
> Moving the code to image.bbclass is the wrong thing to do though and
> I'd question whether we want UBOOT_CONFIG doing this at all...
>
> Cheers,
>
> Richard
>
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] meta: handle UBOOT_CONFIG in image.bbclass

2019-05-16 Thread Richard Purdie
On Wed, 2019-05-15 at 21:22 +0200, liu.min...@gmail.com wrote:
> From: Ming Liu 
> 
> The code dealing with IMAGE_FSTYPES in uboot-config.bbclass would not
> take any effect since it's in a uboot particular class, but it's not
> being inherited by any image recipes.
> 
> Move the IMAGE_FSTYPES handling part to image.bbclass would make it
> really work.
> 
> Also drop some trivial debug code.
> 
> Signed-off-by: Ming Liu 
> ---
>  meta/classes/image.bbclass| 12 
>  meta/classes/uboot-config.bbclass | 17 -
>  meta/conf/documentation.conf  |  2 +-
>  3 files changed, 17 insertions(+), 14 deletions(-)

This doesn't make sense, if we want to set IMAGE_FSTYPES, lets just set
that.

I'd imagine the code is designed so you'd inherit uboot-config in the
machine and this therefore could be made to work as is.

Moving the code to image.bbclass is the wrong thing to do though and
I'd question whether we want UBOOT_CONFIG doing this at all...

Cheers,

Richard

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


[OE-core] [PATCH] meta: handle UBOOT_CONFIG in image.bbclass

2019-05-15 Thread liu . ming50
From: Ming Liu 

The code dealing with IMAGE_FSTYPES in uboot-config.bbclass would not
take any effect since it's in a uboot particular class, but it's not
being inherited by any image recipes.

Move the IMAGE_FSTYPES handling part to image.bbclass would make it
really work.

Also drop some trivial debug code.

Signed-off-by: Ming Liu 
---
 meta/classes/image.bbclass| 12 
 meta/classes/uboot-config.bbclass | 17 -
 meta/conf/documentation.conf  |  2 +-
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index d2b2fb9..b1d63c6 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -365,6 +365,18 @@ python () {
 
 return basetype
 
+# Check UBOOT_CONFIG
+ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
+ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+ubootconfigflags.pop('doc', None)
+if len(ubootconfig) > 0:
+for config in ubootconfig:
+for f, v in ubootconfigflags.items():
+if config == f:
+items = v.split(',')
+if len(items) > 1 and items[1]:
+d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+
 basetypes = {}
 alltypes = d.getVar('IMAGE_FSTYPES').split()
 typedeps = {}
diff --git a/meta/classes/uboot-config.bbclass 
b/meta/classes/uboot-config.bbclass
index 89ff970..59dcd04 100644
--- a/meta/classes/uboot-config.bbclass
+++ b/meta/classes/uboot-config.bbclass
@@ -15,18 +15,15 @@ UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
 
 python () {
 ubootmachine = d.getVar("UBOOT_MACHINE")
-ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
 ubootbinary = d.getVar('UBOOT_BINARY')
 ubootbinaries = d.getVar('UBOOT_BINARIES')
+ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
+ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+
 # The "doc" varflag is special, we don't want to see it here
 ubootconfigflags.pop('doc', None)
-ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
 
 if not ubootmachine and not ubootconfig:
-PN = d.getVar("PN")
-FILE = os.path.basename(d.getVar("FILE"))
-bb.debug(1, "To build %s, see %s for instructions on \
- setting up your machine config" % (PN, FILE))
 raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must 
be set in the %s machine configuration." % d.getVar("MACHINE"))
 
 if ubootmachine and ubootconfig:
@@ -40,18 +37,12 @@ python () {
 for f, v in ubootconfigflags.items():
 if config == f: 
 items = v.split(',')
-if items[0] and len(items) > 3:
+if len(items) == 0 or len(items) > 3:
 raise bb.parse.SkipRecipe('Only config,images,binary 
can be specified!')
 d.appendVar('UBOOT_MACHINE', ' ' + items[0])
-# IMAGE_FSTYPES appending
-if len(items) > 1 and items[1]:
-bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % 
items[1])
-d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
 if len(items) > 2 and items[2]:
-bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % 
items[2])
 d.appendVar('UBOOT_BINARIES', ' ' + items[2])
 else:
-bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % 
ubootbinary)
 d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
 break
 }
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 550df20..048ce12 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -439,7 +439,7 @@ TUNEVALID[doc] = "Descriptions, stored as flags, of valid 
tuning features."
 
 #U
 
-UBOOT_CONFIG[doc] = "Configures the UBOOT_MACHINE and can also define 
IMAGE_FSTYPES for individual cases."
+UBOOT_CONFIG[doc] = "Configures the UBOOT_MACHINE and can also define 
IMAGE_FSTYPES, UBOOT_BINARIES for individual cases."
 UBOOT_ENTRYPOINT[doc] = "Specifies the entry point for the U-Boot image."
 UBOOT_LOADADDRESS[doc] = "Specifies the load address for the U-Boot image."
 UBOOT_LOCALVERSION[doc] = "Appends a string to the name of the local version 
of the U-Boot image."
-- 
2.7.4

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