Problems while generating teziimg

I am using Apalis iMX6Q on an Apalis Evaluation Board and I am trying to generate a tezi-compatible image.

I successfully build an image that I could write on a SD card and everything was well until “I” discovered the need to use the eMMC and from here the party started.

There would’ve been no problem whatsoever if I didn’t need to have a custom kernel (based on a quite old one - 4.19) on my system.

I tried to add in local.conf:

IMAGE_CLASSES_append = " image_type_tezi"
PREFERRED_PROVIDER_virtual/kernel = "linux-customed"
include conf/machine/include/${MACHINE}.inc

and in custom-image.bb

# Show Tezi EULA license
TEZI_SHOW_EULA_LICENSE ?= "1"
TEZI_SHOW_EULA_LICENSE_apalis-tk1 ?= "0"

TEZI_SHOW_EULA_LICENSE_use-mainline-bsp ?= "0"
TEZI_SHOW_EULA_LICENSE_colibri-imx6_use-mainline-bsp ?= "1"
TEZI_SHOW_EULA_LICENSE_apalis-imx6_use-mainline-bsp ?= "1"
IMAGE_CLASSES += "image_type_tezi"
IMAGE_FSTYPES_append = " teziimg"
PREFERRED_PROVIDER_virtual/kernel = "linux-customed"

I know I have some redundancy here but this is not the problem. The real problem is that building now (after these changes) I SOMEHOW end up with the mainline kernel (5.4.193)

I have tried to comment from local.conf

include/conf/machine/include/${MACHINE}.inc

This gets me this error:

ERROR: mprouter-full-cmdline-1.0-r0 do_image_teziimg: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:rootfs_tezi_run_json(d)
     0003:
File: '/home/user/workspace/yocto/meta-toradex-bsp-common/classes/image_type_tezi.bbclass', lineno: 343, function: rootfs_tezi_run_json
     0339:        uboot_file = d.getVar('UBOOT_BINARY_TEZI_RAWNAND')
     0340:        artifacts += " " + d.getVar('KERNEL_IMAGETYPE') + " " + d.getVar('KERNEL_DEVICETREE')
     0341:    elif flash_type == "emmc":
     0342:        use_bootfiles = oe.types.boolean(d.getVar('TEZI_USE_BOOTFILES'))
 *** 0343:        flash_data = rootfs_tezi_emmc(d, use_bootfiles)
     0344:        uenv_file = d.getVar('UBOOT_ENV_TEZI_EMMC')
     0345:        uboot_file = d.getVar('UBOOT_BINARY_TEZI_EMMC')
     0346:        # TODO: Multi image/raw NAND with SPL currently not supported
     0347:        uboot_file += " " + d.getVar('SPL_BINARY') if d.getVar('OFFSET_SPL_PAYLOAD') else ""
File: '/home/user/workspace/yocto/meta-toradex-bsp-common/classes/image_type_tezi.bbclass', lineno: 154, function: rootfs_tezi_emmc
     0150:              })
     0151:    bootpart_rawfiles.append(
     0152:              {
     0153:                "filename": d.getVar('UBOOT_BINARY_TEZI_EMMC'),
 *** 0154:                "dd_options": "seek=" + (offset_spl if offset_spl else offset_bootrom)
     0155:              })
     0156:
     0157:    if use_bootfiles:
     0158:        filesystem_partitions.append(
Exception: TypeError: must be str, not NoneType

I also tried to leave the include/conf/machine/include/${MACHINE}.inc from local.conf and modify conf/machine/include/apalis-imx6.inc as:


MACHINE_NAME = "Apalis-iMX6"

KERNEL_DEVICETREE += "imx6q-apalis-ixora-v1.2.dtb"
KERNEL_DEVICETREE_use-mainline-bsp += " \
    imx6q-apalis-eval.dtb \
    imx6q-apalis-ixora-v1.1.dtb \
"
[...]
#PREFERRED_PROVIDER_virtual/kernel = "linux-toradex"
PREFERRED_PROVIDER_virtual/kernel = "linux-customed"

#PREFERRED_PROVIDER_virtual/kernel_preempt-rt = "linux-toradex"
PREFERRED_PROVIDER_virtual/kernel_preempt-rt = "linux-customed"
PREFERRED_PROVIDER_virtual/kernel_use-mainline-bsp = "linux-toradex-mainline"
PREFERRED_PROVIDER_virtual/kernel_use-mainline-bsp_preempt-rt = "linux-toradex-mainline"


PREFERRED_PROVIDER_virtual/dtb_use-mainline-bsp ?= "device-tree-overlays-mainline"
[...]

but I still end up with the mainline kernel.

Any ideas on how can I make it work please? it drives me nuts :slight_smile:

Hello @Andre1,

Thanks for the detailed description of your problem. I would still like to know if you are trying to build a linux reference image or a TorizonCore image from yocto.
In either case, we do have these documents that will help you through the steps:
Build TorizonCore from Source With Yocto Project/OpenEmbedded.
Build a Reference Image with Yocto Project/OpenEmbedded.

We already provide you with the layers and recipes (you will find them in this layer: recipes-bsp/tezi-metadata) to build the image in Toradex Easy Installer format. Therefore, you don’t have to do any additional configuration for that. Please let me know if that helps.

Hello,

I am building a linux reference image.

I will try to use recipes-bsp/tezi-metadata and come back with an answer.

Thank you and have a nice day