how to bbappend(?) to u-boot-fw-utils to add a custom /etc/fw_env.config??
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.configso 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:
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
fiwhich 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
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================Quoted 55 lines · Robert P. J. Day
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.configfile 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.configso as i read it, the last action of
do_install()is to install ... the generic fw_env.config file sitting in u-boot'stools/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:
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.incDEPENDS = "u-boot"
# Configure
fw_printenvso 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
}
addtaskdo_configure_fw_printenvbeforedo_packageafterdo_installi was expecting to see
SRC_URIappending 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
Quoted 5 lines
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.configto
my image if i'm adding u-boot-fw-utils?
I do something like this in my machine layer, in a .u-boot-fw-utils_%.bbappend file:
====================================================================FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://fw_env.config"
do_install_append() {
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
====================================================================
Yes, this "installs" the same file twice, but it does what you need, it installs the desired file in the correct place. And, yes, it's too bad that this "info" is kept in two completely different recipes.
Signature · 4 lines
------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------
On Wed, 6 Jul 2016, Gary Thomas wrote:
,,, snip ...
Quoted 13 lines
I do something like this in my machine layer, in a .u-boot-fw-utils_%.bbappend file:
====================================================================
FILESEXTRAPATHS_prepend:= "${THISDIR}/${PN}:"
SRC_URI+= "file://fw_env.config"do_install_append() { install -d ${D}${sysconfdir} install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config }
Quoted 8 lines
PACKAGE_ARCH= "${MACHINE_ARCH}"====================================================================
Yes, this "installs" the same file twice, but it does what you need, it installs the desired file in the correct place. And, yes, it's too bad that this "info" is kept in two completely different recipes.
that is, pretty much, line for line what i came up with as well. as
you suggest, it just seems ... sloppy.
rday
Signature · 7 lines
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================