Bitbake Linux-toradex

Hi all,

I work with imx8x colibri and iris carrier board.
On my desktop I am trying to build a reference image with yocto for this hardware and facing an issue following your tutorial : Tuto

when running bitbake tdx-reference-multimedia-image I have the error :
**WARNING**: linux-toradex-6.6.54+git-r0 do_populate_lic: Could not copy license file /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/linux-toradex/6.6.54+git/git/COPYING to /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/linux-toradex/6.6.54+git/license-destdir/colibri_imx8x/linux-toradex/COPYING: [Errno 2] No such file or directory: '/workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/linux-toradex/6.6.54+git/git/COPYING'

**ERROR**: linux-toradex-6.6.54+git-r0 do_populate_lic: QA Issue: linux-toradex: LIC_FILES_CHKSUM points to an invalid file: /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/linux-toradex/6.6.54+git/git/COPYING [license-checksum]

**ERROR**: linux-toradex-6.6.54+git-r0 do_populate_lic: Fatal QA errors were found, failing task.

**ERROR**: Logfile of failure stored in: /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/linux-toradex/6.6.54+git/temp/log.do_populate_lic.96193

**ERROR**: Task (/workdir/oe-core/build/../layers/meta-toradex-nxp/recipes-kernel/linux/linux-toradex_6.6-2.1.x.bb:do_populate_lic) failed with exit code '1'

here is my bbfile

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-${PV}:"

SUMMARY = "Linux kernel for Toradex Freescale i.MX based modules"
SECTION = "kernel"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM ?= "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"

require recipes-kernel/linux/linux-imx.inc

SRC_URI = " \
    https://git.toradex.com/linux-toradex.git;protocol=https;branch=${SRCBRANCH};name=machine \
    ${KCONFIG_REPO};protocol=https;type=kmeta;name=meta-toradex-bsp;branch=main;destsuffix=${KMETA} \
    file://nxp-imx.cfg \
"
SRC_URI:append:mx9-nxp-bsp = " \
    file://nxp-imx95.cfg \
"
SRC_URI[machine.sha256sum] = "8e5ebd44eff7d36a988f03b2cf54ee5944b46bf1429873830a4f9e919ab1628c"

KCONFIG_REPO = "git://git.toradex.com/linux-toradex-kconfig.git"
KMETA = "kernel-meta-toradex-bsp"
SRCREV_meta-toradex-bsp = "e20ec7290fb752b3fac6164d52c7ecde064c2f01"
SRCREV_meta-toradex-bsp:use-head-next = "${AUTOREV}"

S = "${WORKDIR}/git"

KCONFIG_MODE="--alldefconfig"

# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS)
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}"

inherit kernel-yocto kernel pkgconfig toradex-kernel-deploy-config toradex-kernel-localversion

export DTC_FLAGS = "-@"

KERNEL_VERSION_SANITY_SKIP = "1"
do_kernel_configcheck[noexec] = "1"

DEPENDS += "bc-native"
COMPATIBLE_MACHINE = "(mx8-nxp-bsp|mx9-nxp-bsp)"

LINUX_VERSION = "6.6.54"
SRCBRANCH = "toradex_6.6-2.1.x-imx"
SRCREV_machine = "8de35b7808722fbd9411229ee714852c02b53d14"
SRCREV_machine:use-head-next = "${AUTOREV}"

###############################################################################
# Apply the RT patch and change the configuration to use PREMPT_RT when the
# preempt-rt override is set.
###############################################################################

SUMMARY:preempt-rt = "Real-time Linux kernel for Toradex Freescale i.MX based modules"

MIRRORS:append:preempt-rt = "\
    ${KERNELORG_MIRROR}/linux/kernel/projects/rt/6.6/older/ \
    ${KERNELORG_MIRROR}/linux/kernel/projects/rt/6.6/ \
"

SRC_URI:append:preempt-rt = " \
    ${KERNELORG_MIRROR}/linux/kernel/projects/rt/6.6/older/patch-6.6.53-rt44.patch.xz;name=rt-patch \
"

SRC_URI[rt-patch.sha256sum] = "2f275f591bce00c6f2e36783a346ab41da4f5ee03abfb4962320e1fde1dad3bb"

LINUX_KERNEL_TYPE:preempt-rt = "preempt-rt"
LINUX_VERSION:preempt-rt = "6.6.53-rt44"

# The downloaded RT patch doesn't have a upstream status tag
ERROR_QA:remove:preempt-rt = "patch-status

"

can you please help ??

Please note that I added the line SRC_URI[machine.sha256sum] = “8e5ebd44eff7d36a988f03b2cf54ee5944b46bf1429873830a4f9e919ab1628c” in the bb files

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question. The error you’re encountering suggests that the COPYING file, necessary for license verification, is missing from your build environment. This file is crucial for confirming the software’s license during the build process.

Here are some steps you can take to address this issue:

  1. Verify the Source Repository: Check the repository specified in your SRC_URI to ensure the COPYING file is present. You can do this by manually cloning the repository and examining its directory structure.

  2. Check the SRC_URI: Ensure that the SRC_URI in your recipe correctly points to the repository and branch where the COPYING file should exist. If the file is missing from the specified branch, consider switching to a different branch or tag where the file is available.

  3. Update the Recipe: If the COPYING file is located in a different directory within the repository, update the LIC_FILES_CHKSUM in your recipe to point to the correct location of the COPYING file.

  4. Check for Updates: Look for any updates or patches to the meta-toradex-nxp layer or the specific recipe that might resolve this issue. Recent changes might have affected the location or presence of the COPYING file.

  5. Consult the Logs: Review the log file mentioned in the error message (log.do_populate_lic) for additional details that might provide more context on why the file is missing.

By following these steps, you should be able to identify and resolve the issue with the missing COPYING file in your Yocto build process.

I hope this helps! If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Linux kernel fetch failure.

Hi @rocher !

Welcome to Toradex Community! :partying_face:

Please feel free to browse around :slight_smile:

Based on your recipe, I see you indeed added the SRC_URI[machine.sha.256sum] (as you pointed out) and you also changed the original git:// to https:// for the linux-toradex repo. Do you have a reason for those changes?

I compared with the tip of the scarthgap-7.x.y manifest: linux-toradex_6.6-2.1.x.bb « linux « recipes-kernel - meta-toradex-nxp.git - Toradex BSP layer, recipes for NXP based modules

Also, if you just get the the layers and build them as is, do you get the same error?

Best regards,

Thanks henrique

Fixed it by cleaning everything and rebuild from scratch bitbake tdx-reference-multimedia-image worked well

Now I am having a last issue if you can help
when running bitbake tdx-reference-multimedia-image -c populate_sdk

I am facing an issue with update-mandb :

**ERROR**: tdx-reference-multimedia-image-1.0-r0 do_populate_sdk: The postinstall intercept hook 'update_mandb' failed, details in /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/tdx-reference-multimedia-image/1.0/temp/log.do_populate_sdk

**ERROR**: Logfile of failure stored in: /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/tdx-reference-multimedia-image/1.0/temp/log.do_populate_sdk.41023

**ERROR**: Task (/workdir/oe-core/build/../layers/meta-toradex-demos/recipes-images/images/tdx-reference-multimedia-image.bb:do_populate_sdk) failed with exit code '1'

In the sdk populate log file :

NOTE: > Executing update_gtk_icon_cache intercept ...
NOTE: > Executing update_mandb intercept ...
NOTE: Exit code 1. Output:
/workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/tdx-reference-multimedia-image/1.0/intercept_scripts-62c06a2d239e0f6fd0be559f90c6df254279ed3e5d05e67643009d89aadb59e9/update_mandb: line 14: binprefix: unbound variable

ERROR: The postinstall intercept hook 'update_mandb' failed, details in /workdir/oe-core/build/tmp/work/colibri_imx8x-tdx-linux/tdx-reference-multimedia-image/1.0/temp/log.do_populate_sdk
DEBUG: Python function do_populate_sdk finished

Did not not worked
Can you help?

Just for info I fixed it :

  • I deleted the /build/tmp repo
  • I ran repo sync
  • Ran bitbake command
  • Had a few errors, not clear why. I rebuild one by one the problematic images, it worked

note : Clean the task which failed and restart building the image somehow fixes the issues I had without doing anything else

Hi @rocher !

Thank you for the feedback!

Please don’t forget to mark the solution as the Solution :wink:

Best regards,