[yocto] a couple notes/questions on UBOOT_CONFIG

Robert P. J. Day rpjday at crashcourse.ca
Sun Jun 26 01:46:30 PDT 2016


  fresh off perusing the variable glossary for this variable:

http://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-UBOOT_CONFIG

and the uboot-config.bbclass file, some observations.

  first, the variable glossary *strongly* suggests that the default
value is a single value only, and i quote:

 "Following is an example from the meta-fsl-arm layer.

     UBOOT_CONFIG ??= "sd"
... snip ...
In this example, "sd" is selected as the configuration of the possible
                                     ^^^
four for the UBOOT_MACHINE."

  i'm assuming that should have read "is selected as the *default*
configuration", but it's also true that the default can be a multitude
of values, which is not at all obvious from that explanation. A small
set of examples:

meta-fsl-ppc/conf/machine/p5020ds-64b.conf:UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
meta-fsl-ppc/conf/machine/p5040ds.conf:UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"
meta-fsl-ppc/conf/machine/p4080ds.conf:UBOOT_CONFIG ??= "secure-boot sdcard spi nor"
meta-fsl-ppc/conf/machine/c293pcie.conf:UBOOT_CONFIG ??= "spi secboot spi-secboot nor"
meta-fsl-ppc/conf/machine/p5040ds-64b.conf:UBOOT_CONFIG ??= "nand secure-boot sdcard spi nor"

so it might be worth extending the explanation in the glossary to make
that clear (and even throw in an example or two).

  next, from uboot-config.bbclass, we read:

    # Handle U-Boot config for a machine
    #
    # The format to specify it, in the machine, is:
    #
    # UBOOT_CONFIG ??= <default>
    # UBOOT_CONFIG[foo] = "config,images"
    ... snip ...

again, no hint that the default can be more than one value, and also,
since "images" is optional, should that next line not read:

    # UBOOT_CONFIG[foo] = "config[,images]"

also related to that, can you really have *multiple* images listed
there after the config value? if so, it would appear they would need
to be space-separated given the "split()" operation in that class
file. however, i have yet to run across a single example of the form:

  UBOOT_CONFIG[foo] = "config,image1 image2 image3 ..."

does an example like that exist? is it supported?

  finally, the variable glosssary reads:

"The "sd" configuration defines "mx6qsabreauto_config" as the value
for UBOOT_MACHINE, while the "sdcard" specifies the IMAGE_FSTYPES to
use for the U-boot image."

  but doesn't that define the image type(s) that will be *appended* to
the current value of IMAGE_FSTYPES? if you look toward the bottom of
uboot-config.bbclass, you see:

   # 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])

my python is not great, but that certainly suggests that values are
being *appended* to whatever is already in IMAGE_FSTYPES, despite what
one reads in the glossary. or am i misreading that?

  oh, and one last bit of nitpicky pedantry, right at the bottom of
the uboot-config.bbclass file:

  elif len(ubootconfig) == 0:
     raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')

is there really any need to test if that value is "== 0"? given the
earlier test of "if len(ubootconfig) > 0:", i would think a simple
"else" would suffice there, no?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the yocto mailing list