From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailrelay4-2.pub.mailoutpod1-cph3.one.com (mailrelay4-2.pub.mailoutpod1-cph3.one.com [46.30.212.3]) by mx.groups.io with SMTP id smtpd.web11.6016.1615363892097752200 for ; Wed, 10 Mar 2021 00:11:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@berginkonsult.se header.s=20191106 header.b=gpBO25u9; spf=none, err=permanent DNS error (domain: berginkonsult.se, ip: 46.30.212.3, mailfrom: peter@berginkonsult.se) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=berginkonsult.se; s=20191106; h=content-type:in-reply-to:mime-version:date:message-id:from:references:to: subject:from; bh=hmcdvHy+aq3y/Dn3zx3IHkJ4QkUd8bxBC4ozrkUAOs8=; b=gpBO25u9s0VbxBXwj2q6ZW6BVjsIb8Za0ebDWHJHsPLEEDrP+1GxfFbUcN5MZeYmsX40zzU3OGvSr OZ99ouXu8xTLcvIrRZ9e8CWZmInsBgKHtBx3GhVtnFx6v6VZs080YqwD1q+C1U7xBC+eWDv0NV9Y2a jpPHmqCh2h7acEahv3HDEBV3Jvq2oHl47/jdwXpJXPXozjNz9cf7hYqmM5zBOFCBgLVaKFX7ZAuOgg JybcAW2oSX4Jl1Qclgyn18HX/2mHe8Lot5vM1U1iBJWDGfVKldNbYcvd2BAChxsQhGdKjQF05wtIx6 mgT4ZYaaLwFeCr/Oi76tUKCU0X7psBw== X-HalOne-Cookie: 0e573acf657b0d62b93ca4d28619abec20dfeb29 X-HalOne-ID: 36db8ebf-8178-11eb-a8f8-d0431ea8bb10 Received: from [192.168.12.21] (h-79-136-99-68.na.cust.bahnhof.se [79.136.99.68]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 36db8ebf-8178-11eb-a8f8-d0431ea8bb10; Wed, 10 Mar 2021 08:11:28 +0000 (UTC) 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 To: Brian Hutchinson , meta-freescale@lists.yoctoproject.org References: From: "Peter Bergin" Message-ID: <8e28c4fd-752d-6682-4122-8ed44896c341@berginkonsult.se> Date: Wed, 10 Mar 2021 09:12:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------58E4B91683A9A4ED7A8E2DA1" Content-Language: en-US --------------58E4B91683A9A4ED7A8E2DA1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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//glibc//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 --------------58E4B91683A9A4ED7A8E2DA1 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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



--------------58E4B91683A9A4ED7A8E2DA1--