[OE-core] how to bbappend(?) to u-boot-fw-utils to add a custom /etc/fw_env.config??

Robert P. J. Day rpjday at crashcourse.ca
Wed Jul 6 17:10:48 UTC 2016


  i may be looking at this entirely incorrectly at the moment, but
what is the preferred way to sneak in a custom, target-specific
/etc/fw_env.config file when adding u-boot-fw-utils to one's image?

  if i examine u-boot-fw-utils_2016.03.bb, i can see that that package
is based on (predictably) the source code for u-boot:

  SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
  S = "${WORKDIR}/git"

which is fine, but if look at the overriding do_install() routine in
that recipe file, i see:

  do_install () {
        install -d ${D}${base_sbindir}
        install -d ${D}${sysconfdir}
        install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
        install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
        install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config

so as i read it, the last action of do_install() is to install ... the
generic fw_env.config file sitting in u-boot's tools/env/ directory,
which really has no value. so how does one overcome this?

  i poked around and found a couple layers, here's meta-mender:

https://github.com/mendersoftware/meta-mender/blob/master/recipes-bsp/u-boot/u-boot-fw-utils_2015.10.bbappend

which adds a whole new task just to install a custom config file:


# Keep this separately from the rest of the .bb file in case that .bb file is
# overridden from another layer.
require u-boot-mender.inc

DEPENDS = "u-boot"

# Configure fw_printenv so that it looks in the right place for the environment.
do_configure_fw_printenv () {
    cat > ${D}${sysconfdir}/fw_env.config <<EOF
/uboot/uboot.env 0x0000 ${BOOTENV_SIZE}
EOF
}
addtask do_configure_fw_printenv before do_package after do_install


  i was expecting to see SRC_URI appending that file; however, if i
look in u-boot.inc, i can see:

    if [ -e ${WORKDIR}/fw_env.config ] ; then
        install -d ${D}${sysconfdir}
        install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
    fi

which is sort of what i was looking for, but the fact that that is in
u-boot.inc doesn't seem to affect the u-boot-fw-utils recipe.

  so what is the recommended way to add a custom /etc/fw_env.config to
my image if i'm adding u-boot-fw-utils?

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 Openembedded-core mailing list