[OE-core] [PATCH] sanity.bbclass: Add syntax check on MACHINE variable

Baptiste Durand baptiste.durand at gmail.com
Thu Mar 5 08:50:39 UTC 2015


Hello,

I noticed an issue when I tried to develop a BSP meta  for a NUC (model
E3815TKHE).

In my first implementation, I named the conf file nuc_E3815.conf.

This leads to a bitbake error described in  the commit message.
ERROR: initramfs-live-boot not found in the base feeds (nuc_E3815
corei7-64-intel-common corei7-64 core2-64 x86_64 noarch any all).

When I renamed the file without upercase (ie nuc_e3815.conf) , the error
disappeared.

As I never saw any Machine name with uppercase, I thought that it was
forbidden ( and the root cause of the issue I saw).

This seems to be linked to the path name generation of the rpm
repositories.

Sorry for the noise.

Baptiste



2015-03-05 7:26 GMT+01:00 Michael Gloff <mgloff at emacinc.com>:

> Why? Uppercase letters should be allowed and work fine for the most part.
> Below are a few excerpts from last year:
>
> On Wed, Mar 5, 2014 at 11:45 AM, Paul Eggleton <
> paul.eggleton at linux.intel.com> wrote:
> On Wednesday 05 March 2014 11:00:31 Michael Gloff wrote:
> > On Mon, Mar 3, 2014 at 12:52 PM, Paul Eggleton
> > <paul.eggleton at linux.intel.com
>>
>> > wrote:
>> > > On Sunday 02 March 2014 19:58:41 Michael Gloff wrote:
>> > > > Is there a reason why the toolchain cannot be built with a machine
>> name
>> > > > that contains capital letters? Seems weird, everything else builds
>> fine,
>> > > > but meta-toolchain fails complaining about caps.
>> > >
>> > > Although machine names are traditionally all lower case in our build
>> > > system, there's no deliberate restriction in place that enforces this.
>> > >
>> > > Would you be able to provide more details, such as the version of the
>> > > build system you are using, the exact capital letters you used in the
>> > > machine name, and the error you received?
>> >
>> > The error is below. Machine name: PMX-090T. This is on dora 1.5.1
>> >
>> > ERROR: Function failed: opkg-build execution failed
>> > ERROR: Logfile of failure stored in:
>> >
>> /opt/oe/build/tmp/work/i686-nativesdk-emacsdk-linux/meta-environment-PMX-090
>> > T/1.0-r8/temp/log.do_package_write_ipk.15358
>> > Log data follows:
>> > | DEBUG: Executing python function sstate_task_prefunc
>> > | DEBUG: Python function sstate_task_prefunc finished
>> > | DEBUG: Executing python function do_package_write_ipk
>> > | DEBUG: Executing python function read_subpackage_metadata
>> > | DEBUG: Python function read_subpackage_metadata finished
>> > | DEBUG: Executing python function do_package_ipk
>> > | meta-environment-PMX-090T
>> > | *** Error: Package name  contains illegal characters, (other than
>> > [a-z0-9.+-])
>>
>> Perhaps I spoke too soon. There might not be a direct restriction on
>> machine
>> names; but opkg does restrict characters allowed in package names, and for
>> meta-environment the machine name ends up as part of the package name. You
>> could probably hack around it if you felt the need to, but the simplest
>> thing
>> would be to just change the machine name to be all lower-case.
>>
>> Cheers,
>> Paul
>>
>
>
> =============================================================================================
> Paul Barker <paul at paulbarker.me.uk>
> 3/6/14
>
>
> to Khem, me, Paul, Yocto
> On 5 March 2014 21:14, Khem Raj <raj.khem at gmail.com> wrote:
> > On Wed, Mar 5, 2014 at 9:00 AM, Michael Gloff <mgloff at emacinc.com>
> wrote:
> >> | *** Error: Package name  contains illegal characters, (other than
> >> [a-z0-9.+-])
> >
> > hmm meta-environment-PMX-090T is a package name and
> > thats limitation of opkg backend, if you are too tied to
>
> opkg itself doesn't seem to have this limitation, I just created and
> installed a
> test package named 'A' perfectly fine.
>
> The Debian policy says:
>     Package names (both source and binary, see Package, Section 5.6.7) must
>     consist only of lower case letters (a-z), digits (0-9), plus (+) and
> minus
>     (-) signs, and periods (.). They must be at least two characters long
> and
>     must start with an alphanumeric character.
>
> So I think the restriction is there to keep generated packages
> compatible with dpkg-deb.
>
> We could consider removing the restriction if that compatibility isn't
> necessary.
>
> ===========================================================================
>
> I think we should fix the SDK generation that has a problem with caps
> instead of dis-allowing it completely.
>
> Michael Gloff
>
>
>
> On Tue, Mar 3, 2015 at 5:01 AM, Baptiste DURAND <baptiste.durand at gmail.com
> > wrote:
>
>> MACHINE variable should not contain uppercase characters.
>>
>> Having uppercase in Machine name can lead to this kind of error : (here
>> Machine is set to nuc-E3815)
>> ERROR: initramfs-live-boot not found in the base feeds (nuc_E3815
>> corei7-64-intel-common corei7-64 core2-64 x86_64 noarch any all).
>>
>> Signed-off-by: Baptiste DURAND <baptiste.durand at gmail.com>
>> ---
>>  meta/classes/sanity.bbclass | 15 ++++++++++-----
>>  1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
>> index 31b99d4..1fa2e58 100644
>> --- a/meta/classes/sanity.bbclass
>> +++ b/meta/classes/sanity.bbclass
>> @@ -713,12 +713,17 @@ def check_sanity_everybuild(status, d):
>>
>>      # Check that the MACHINE is valid, if it is set
>>      machinevalid = True
>> -    if d.getVar('MACHINE', True):
>> -        if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
>> -            status.addresult('Please set a valid MACHINE in your
>> local.conf or environment\n')
>> -            machinevalid = False
>> +    machinevar = d.getVar('MACHINE', True)
>> +    if machinevar:
>> +        if machinevar == machinevar.lower():
>> +            if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
>> +               status.addresult('Please set a valid MACHINE in your
>> local.conf or environment\n')
>> +               machinevalid = False
>> +            else:
>> +               status.addresult(check_sanity_validmachine(d))
>>          else:
>> -            status.addresult(check_sanity_validmachine(d))
>> +            status.addresult('Please set a valid MACHINE : uppercase
>> characters are not allowed in machine name : ${MACHINE} should be ' +
>> machinevar.lower() + ' \n    Please rename file
>> conf/machine/${MACHINE}.conf as conf/machine/' + machinevar.lower() +
>> '.conf\n')
>> +            machinevalid = False
>>      else:
>>          status.addresult('Please set a MACHINE in your local.conf or
>> environment\n')
>>          machinevalid = False
>> --
>> 1.8.1.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>
>


-- 
Baptiste DURAND
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150305/a07e89a2/attachment-0002.html>


More information about the Openembedded-core mailing list