meta-freescale.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: "Peter Bergin" <peter@berginkonsult.se>
To: Brian Hutchinson <b.hutchman@gmail.com>,
	meta-freescale@lists.yoctoproject.org
Subject: Re: [meta-freescale] bitbake of core-image-minimal is sending my fw_env.config file to PC filesystem instead of my squashfs for target
Date: Wed, 10 Mar 2021 09:12:07 +0100	[thread overview]
Message-ID: <8e28c4fd-752d-6682-4122-8ed44896c341@berginkonsult.se> (raw)
In-Reply-To: <CAFZh4h_QP-Xwm=QvPY75jWj0-m5rxB7zNqn6ao_syEYbZ8Myaw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4483 bytes --]

Hi,

On 2021-03-10 00:04, Brian Hutchinson wrote:
> Hi,
>
> I should have done this from the start and started a new topic so 
> please forgive me if you've already seen this on "No 
> u-boot-fslc-fw-utils recipe for Dunfell?" thread.
>
> I added libubootenv to my image because I'm using RAUC for updates etc..
>
> Anyway, I'm building a read-only rootfs with squashfs (already working 
> from my NOR flash) but needed to update that image with libubootenv 
> and needed a fw_env.config file in /etc.
>
> So first attempt was to make a libubootenv_0.3.1.bbappend like:
>
> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}/:"
>
> SRC_URI_append += " file://fw_env.config"
>
> do_install_append() {
>        install -d ${D}${sysconfdir}
>        install -m 0644 ${WORKDIR}/fw_env.config 
> ${D}${sysconfdir}/fw_env.config
> }
>
> FILES_${PN} += "${sysconfdir}/fw_env.config"
>
> When I would bitbake core-image-minimal, it updated my squashfs file 
> but looking at the resulting tar of the rootfs showed it didn't 
> contain /etc/fw_env.config.  Turns out it's in the directory by itself 
> under tmp/deploy/images/imx8mmevk!
>
> I checked out the examples in meta-freescale-3rdparty/recipes-bsp that 
> some of the toradex boards are using and did some other reading online 
> and can't quite figure out what I'm doing wrong and how to get 
> fw_env.config into my squashfs image.
>
> I'm using Dunfell with this effort and core-image-minimal to keep size 
> down since this is a small NOR I'm working on.
>
> Listing so you can see what I'm talking about:
>
> -rw-r--r-- 2 hutch hutch      1895 Mar  9 15:31 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.manifest
> -rw-r--r-- 2 hutch hutch   9613312 Mar  9 15:32 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.squashfs
> -rw-r--r-- 2 hutch hutch   9201440 Mar  9 15:32 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.tar.bz2
> -rw-r--r-- 2 hutch hutch    532719 Mar  9 15:31 
> core-image-minimal-imx8mmevk-20210309203126.testdata.json
> lrwxrwxrwx 2 hutch hutch        59 Mar  9 15:31 
> core-image-minimal-imx8mmevk.manifest-> 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.manifest
> lrwxrwxrwx 2 hutch hutch        59 Mar  9 15:32 
> core-image-minimal-imx8mmevk.squashfs-> 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.squashfs
> -rw-r--r-- 1 hutch hutch   9605120 Mar  8 09:36 
> core-image-minimal-imx8mmevk.squashfs_keep
> lrwxrwxrwx 2 hutch hutch        58 Mar  9 15:32 
> core-image-minimal-imx8mmevk.tar.bz2-> 
> core-image-minimal-imx8mmevk-20210309203126.rootfs.tar.bz2
> lrwxrwxrwx 2 hutch hutch        57 Mar  9 15:31 
> core-image-minimal-imx8mmevk.testdata.json-> 
> core-image-minimal-imx8mmevk-20210309203126.testdata.json
> lrwxrwxrwx 2 hutch hutch        34 Mar  9 16:48 fw_env.config-> 
> fw_env.config-imx8mmevk-2020.04-r0
> lrwxrwxrwx 2 hutch hutch        34 Mar  9 16:48 
> fw_env.config-imx8mmevk-> fw_env.config-imx8mmevk-2020.04-r0
> -rw-r--r-- 2 hutch hutch      2858 Mar  9 16:48 
> fw_env.config-imx8mmevk-2020.04-r0
>
>
The file /etc/fw_env.config is packaged in u-boot-imx-env (if using 
u-boot-imx), and more general in ${PN}-env in the u-boot.inc file. There 
is also a generic name for that package independent of which u-boot you 
are based on at this is u-boot-default-env. Make sure you have 
u-boot-default-env in your IMAGE_INSTALL variable or RDEPEND on it in 
some way.

You can use buildhistory bbclass in your builds. With that enabled it is 
easy to track where files are packaged and also which packages that are 
installed in your image.

     build$ grep -r '/etc/fw_env.config' buildhistory/ | grep 
files-in-package
     ...
buildhistory/packages/esp5_nxp_eval-fslc-linux/u-boot-imx/u-boot-imx-env/files-in-package.txt:-rw-r--r-- 
root       root              137    ./etc/fw_env.config

     build$ grep -r 'u-boot-imx-env' buildhistory/ | grep 
installed-package-names
buildhistory/images/<machine>/glibc/<image>/installed-package-names.txt:u-boot-imx-env


Another tool that can be used to find relation between a file and a 
package is oe-pkgdata-util.

     build$ oe-pkgdata-util find-path /etc/fw_env.config
     u-boot-imx-env: /etc/fw_env.config

I hope this can help you forward!

Best regards,
/Peter




[-- Attachment #2: Type: text/html, Size: 12890 bytes --]

  reply	other threads:[~2021-03-10  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 23:04 bitbake of core-image-minimal is sending my fw_env.config file to PC filesystem instead of my squashfs for target Brian Hutchinson
2021-03-10  8:12 ` Peter Bergin [this message]
2021-03-10 14:06   ` [meta-freescale] " Brian Hutchinson

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=8e28c4fd-752d-6682-4122-8ed44896c341@berginkonsult.se \
    --to=peter@berginkonsult.se \
    --cc=b.hutchman@gmail.com \
    --cc=meta-freescale@lists.yoctoproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).