Update image.json file and adding a custom device tree during Yocto build - iMX6ULL BSP 6

Hi @daniel_m.tx ,

I did some test. Unfortunately, didn’t solve. Please, check the result below:

1. Test

  • In local.conf has the MACHINE ?= "colibri-imx6ull".
  • I copy the colibri-imx6ull.inc file to my layer, layers/meta-custom/conf/machine/include/colibri-imx6ull.inc and update the TORADEX_PRODUCT_IDS variable to my-custom-devicetree-file.dtb.
  • Also, I changed the BBFILE_PRIORITY_meta-custom = "99" inside the layer.conf.
  • And run the commands
$ bitbake -c cleansstate tdx-reference-multimedia-image
$ bitbake -f tdx-reference-multimedia-image
  • Result: It Didn’t work. After build, the image.json still with the Toradex’s device tree file.
├── conf
│   ├── layer.conf
│   └── machine
│       ├── colibri-imx6ull-extra.conf
│       └── include
│           └── colibri-imx6ull.inc
├── COPYING.MIT
├── README
├── recipes-bsp
│   └── u-boot
│       └── u-boot-toradex_%.bbappend
├── recipes-example
│   └── example
│       └── example_0.1.bb
└── recipes-kernel
    └── linux
        ├── linux-toradex
        │   └── my-custom-devicetree-file.dts
        └── linux-toradex%.bbappend

2. Test

  • I copied the colibri-imx6ull.conf file to my layer.

  • and run the commands to clean the state and build again the tdx-reference-multimedia-image recipes.

  • Result: It Didn’t work. After build, the image.json still with the Toradex’s device tree file.

├── conf
│   ├── layer.conf
│   └── machine
│       ├── colibri-imx6ull.conf
│       ├── colibri-imx6ull-extra.conf
│       └── include
│           └── colibri-imx6ull.inc
├── COPYING.MIT
├── README
├── recipes-bsp
│   └── u-boot
│       └── u-boot-toradex_%.bbappend
├── recipes-example
│   └── example
│       └── example_0.1.bb
└── recipes-kernel
    └── linux
        ├── linux-toradex
        │   └── my-custom-devicetree-file.dts
        └── linux-toradex%.bbappend

3. Test

Following these instructions,

  • I copied the colibri-imx6ull.conf file to my layer.
  • I created my own MACHINE my-colibri-imx6ull.conf. Inside the my-colibri-imx6ull.conf has just:
require conf/machine/colibri-imx6ull.conf
  • Changed the file name from 'colibri-imx6ull.inc to my-colibri-imx6ull.inc.
  • Updated the local.conf to MACHINE ?= "my-colibri-imx6ull".
  • I remove the build/tmp and sstate-cache folders

My layer structure is:

├── conf
│   ├── layer.conf
│   └── machine
│       ├── colibri-imx6ull.conf
│       ├── colibri-imx6ull-extra.conf
│       ├── include
│       │   └── my-colibri-imx6ull.inc
│       └── my-colibri-imx6ull.conf
├── COPYING.MIT
├── README
├── recipes-bsp
│   └── u-boot
│       └── u-boot-toradex_%.bbappend
├── recipes-example
│   └── example
│       └── example_0.1.bb
└── recipes-kernel
    └── linux
        ├── linux-toradex
        │   └── my-custom-devicetree-file.dts
        └── linux-toradex%.bbappend

But I got the errors:

ERROR: u-boot-toradex-1_2022.07-r0 do_deploy: ExecutionError('/home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_deploy.3242530', 1, None, None)
ERROR: Logfile of failure stored in: /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/log.do_deploy.3242530
Log data follows:
| DEBUG: Executing python function sstate_task_prefunc
| DEBUG: Python function sstate_task_prefunc finished
| DEBUG: Executing shell function do_deploy
| install: cannot stat '/home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/build/u-boot-nand.imx': No such file or directory
| WARNING: /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_deploy.3242530:202 exit 1 from 'install -D -m 644 /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/build/u-boot-nand.imx /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/deploy-u-boot-toradex/u-boot-nand-my-colibri-imx6ull-2022.07-r0.imx'
| WARNING: Backtrace (BB generated script):
| 	#1: do_deploy, /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_deploy.3242530, line 202
| 	#2: main, /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_deploy.3242530, line 458
ERROR: Task (/home/imx6ull/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb:do_deploy) failed with exit code '1'
ERROR: u-boot-toradex-1_2022.07-r0 do_install: ExecutionError('/home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_install.3242537', 1, None, None)
ERROR: Logfile of failure stored in: /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/log.do_install.3242537
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-core/glibc/glibc_2.35.bb:do_populate_sysroot', '/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/gcc/gcc-cross_11.4.bb:do_populate_sysroot', '/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/gcc/gcc-runtime_11.4.bb:do_populate_sysroot', '/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot', '/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-connectivity/openssl/openssl_3.0.10.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/bison/bison_3.8.2.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/flex/flex_2.6.4.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/python/python3-setuptools_59.5.0.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/python/python3_3.10.13.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-devtools/swig/swig_4.0.2.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', 'virtual:native:/home/imx6ull/oe-core/build/../layers/openembedded-core/meta/recipes-kernel/dtc/dtc_1.6.1.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['glibc', 'gcc-cross-arm', 'gcc-runtime', 'quilt-native', 'kern-tools-native', 'openssl-native', 'bison-native', 'flex-native', 'patch-native', 'pkgconfig-native', 'pseudo-native', 'python3-setuptools-native', 'python3-native', 'swig-native', 'bc-native', 'dtc-native', 'texinfo-dummy-native', 'gettext-minimal-native', 'libtool-native', 'xz-native', 'sqlite3-native', 'libffi-native', 'readline-native', 'libtirpc-native', 'gdbm-native', 'zlib-native', 'bzip2-native', 'libnsl2-native', 'ncurses-native', 'util-linux-libuuid-native', 'mpfr-native', 'libmpc-native', 'gnu-config-native', 'binutils-cross-arm', 'gmp-native', 'zstd-native', 'linux-libc-headers', 'libpcre-native', 'attr-native', 'perl-native', 'm4-native', 'libgcc', 'python3-wheel-native', 'python3-installer-native', 'make-native', 'python3-flit-core-native', 'unzip-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: cannot stat '/home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/build/u-boot-nand.imx': No such file or directory
| WARNING: /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_install.3242537:176 exit 1 from 'install -D -m 644 /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/build/u-boot-nand.imx /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/image/boot/u-boot-nand-my-colibri-imx6ull-2022.07-r0.imx'
| WARNING: Backtrace (BB generated script):
| 	#1: do_install, /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_install.3242537, line 176
| 	#2: main, /home/imx6ull/oe-core/build/tmp/work/my_colibri_imx6ull-tdx-linux-gnueabi/u-boot-toradex/1_2022.07-r0/temp/run.do_install.3242537, line 319
ERROR: Task (/home/imx6ull/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 6521 tasks of which 0 didn't need to be rerun and 2 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 10 seconds

Whether, inside the colibri-imx6ull.conf, I modified the MACHINEOVERRIDES =. "my-colibri-imx6ull:", I still got those errors.

Do you have another suggestion? Thanks!