layers and adding a new system

Chris Austen austenc at us.ibm.com
Sat Sep 2 03:27:17 AEST 2017




As the popularity of OpenBMC grows the project will hopefully find itself
with additional pull requests to support more systems.  As I did when I
first started out you could easily be allured to simply copy/past the
entire contents of a similar system under meta-openbmc-machines/... and
call it your own.  However scale that to anything greater then a few
machines and the shier volume of duplicate code will become bulky and
unmanageable.   Yocto recognized this as an issue and has provided support
to reduce.  I would like to build a list of recommendations on how to add
new hardware in to the OpenBMC Project.


For hardware based on a similar design this is...

Not good
========
meta-mfg/meta-redfish/
meta-mfg/meta-bluefish/
meta-mfg/meta-yellowfish/
meta-mfg/meta-greenfish/


Good
========
meta-mfg/meta-fish/


So how can you do that?  With a single variable in your local.conf...
MACHINE.  You change the MACHINE variable per system type but let default
and use the base platform for common items.

    MACHINE = "bluefish"

A bbappend that are specific to the bluefish system you append the
_bluefish

    FILESEXTRAPATHS_prepend_bluefish := "${THISDIR}/${PN}:"
    SRC_URI_append_bluefish = " file://0001-blueworms.patch"

A bbappend that make a common change to all of the fish type.  This means
anyone adding the meta-fish layer gets this bbappend and the rainbowworms.

    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
    SRC_URI_append = " file://0001-rainbowworms.patch"

Machine and default are all good until If you use a bluefish system but you
have a company policy use the MACHINEOVERRIDES variable

    FILESEXTRAPATHS_prepend_orgXfis := "${THISDIR}/${PN}:"
    SRC_URI_append_orgXfis = " file://0001-blueXworms.patch"

Note yocto matches and runs every hit.  That means if you add a default,
machine and machine override in the same bbappend, you get all three files.
So use with caution...

    FILESEXTRAPATHS_prepend_orgXfis := "${THISDIR}/${PN}:"
    SRC_URI_append_orgXfis = " file://0001-blueXworms.patch"
    SRC_URI_append = " file://0001-rainbowworms.patch"
    SRC_URI_append_bluefish = " file://0001-blueworms.patch"

    $ ls
    0001-blueXworms.patch
    0001-rainbowworms.patch
    0001-blueworms.patch


TBD.. need to add example of something being added, replaced and kernel
device tree needs.


Thoughts?



Chris Austen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20170901/d51a754a/attachment.html>


More information about the openbmc mailing list