All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: how to bbappend(?) to u-boot-fw-utils to add a custom /etc/fw_env.config??
Date: Wed, 6 Jul 2016 20:16:23 +0200	[thread overview]
Message-ID: <577D4AF7.8040302@mlbassoc.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1607061252280.599@localhost.localdomain>

On 2016-07-06 19:10, Robert P. J. Day wrote:
>
>    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?

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.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


  reply	other threads:[~2016-07-06 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 17:10 how to bbappend(?) to u-boot-fw-utils to add a custom /etc/fw_env.config?? Robert P. J. Day
2016-07-06 18:16 ` Gary Thomas [this message]
2016-07-06 18:21   ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577D4AF7.8040302@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.