This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3359: | DEBUG: Executing python function extend_recipe_sysroot (failed to execute the function inside machine file)

Part Number: AM3359

Dear Experts,

      I'm working on the Yocto Project (Kirkstone) on a custom System on Module (SoM) featuring the AM335x. While executing the bitbake <target> command, it fails to execute the function for deploying the build component images into a custom directory using Yocto variables "DEPLOY_DIR_IMAGE" and "DEPLOYDIR".

Could someone please help me resolve this issue? I've also attached the log file for your reference.

Thanks in advance.

Regards,

Ravikumar

Loading cache: 100% |                                                                                                                                           | ETA:  --:--:--
Loaded 0 entries from dependency cache.
Parsing recipes: 100% |##########################################################################################################################################| Time: 0:00:57
Parsing of 886 .bb files complete (0 cached, 886 parsed). 1647 targets, 66 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "am335x-versa-nxt256"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.18"
TUNE_FEATURES        = "arm vfp cortexa8 neon callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "kirkstone:2b21c6009aa6b955e1a0e7312c3c0ad66557681b"
meta-calixto-ti      = "kirkstone:ce1fa3bed4e545c2a76aaf1a501747b9ed9730f9"

NOTE: Tainting hash to force rebuild of task /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb, do_build00
WARNING: /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb:do_build is tainted from a forced run:  0:00:00
Initialising tasks: 100% |#######################################################################################################################################| Time: 0:00:03
Sstate summary: Wanted 2 Local 0 Mirrors 0 Missed 2 Current 1346 (0% match, 99% complete)
Removing 1 stale sstate objects for arch am335x_versa_nxt256: 100% |#############################################################################################| Time: 0:00:00
NOTE: Executing Tasks
ERROR: calixto-image-minimal-1.0-r0 do_image_complete: ExecutionError('/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/work/am335x_versa_nxt256-poky-linux-gnueabi/calixto-image-minimal/1.0-r0/temp/run.create_calixto_versa_image.3580043', 127, None, None)
ERROR: Logfile of failure stored in: /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/work/am335x_versa_nxt256-poky-linux-gnueabi/calixto-image-minimal/1.0-r0/temp/log.do_image_complete.3580043
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-bsp/u-boot/u-boot-calixto-ti.bb:do_populate_sysroot', '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-core/glibc/cross-localedef-native_2.35.bb:do_populate_sysroot', '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot', '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot', '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/createrepo-c/createrepo-c_0.19.0.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/dnf/dnf_4.11.1.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.5.0.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/opkg/opkg_0.5.0.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-devtools/rpm/rpm_4.17.1.bb:do_populate_sysroot', 'virtual:native:/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/poky/meta/recipes-extended/pigz/pigz_2.7.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['u-boot-calixto-ti', 'cross-localedef-native', 'ldconfig-native', 'qemuwrapper-cross', 'depmodwrapper-cross', 'update-rc.d-native', 'createrepo-c-native', 'dnf-native', 'makedevs-native', 'opkg-utils-native', 'opkg-native', 'pseudo-native', 'rpm-native', 'pigz-native', 'perl-native', 'kmod-native', 'zlib-native', 'openssl-native', 'xz-native', 'glib-2.0-native', 'libxml2-native', 'cmake-native', 'curl-native', 'file-native', 'python3-native', 'sqlite3-native', 'expat-native', 'shadow-native', 'glibc', 'gcc-runtime', 'zstd-native', 'libtool-native', 'elfutils-native', 'gettext-minimal-native', 'lua-native', 'libgcrypt-native', 'popt-native', 'bzip2-native', 'librepo-native', 'libdnf-native', 'python3-iniparse-native', 'libcomps-native', 'qemu-native', 'shared-mime-info-native', 'debianutils-native', 'libsolv-native', 'libarchive-native', 'make-native', 'gdbm-native', 'gettext-native', 'libffi-native', 'libpcre-native', 'util-linux-native', 'ncurses-native', 'readline-native', 'libtirpc-native', 'libnsl2-native', 'util-linux-libuuid-native', 'linux-libc-headers', 'libgcc', 'texinfo-dummy-native', 'libmicrohttpd-native', 'libcap-native', 'libgpg-error-native', 'attr-native', 'gpgme-native', 'libmodulemd-native', 'json-c-native', 'libcheck-native', 'gobject-introspection-native', 'swig-native', 'python3-wheel-native', 'python3-setuptools-native', 'python3-six-native', 'python3-installer-native', 'itstool-native', 'lzo-native', 'libpcre2-native', 'libcap-ng-native', 'gnutls-native', 'libassuan-native', 'libyaml-native', 'flex-native', 'python3-flit-core-native', 'unzip-native', 'libidn2-native', 'libunistring-native', 'gmp-native', 'nettle-native', 'm4-native', 'gnu-config-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing python function sstate_task_prefunc
| DEBUG: Python function sstate_task_prefunc finished
| DEBUG: Executing python function do_image_complete
| NOTE: Executing create_calixto_versa_image ...
| DEBUG: Executing shell function create_calixto_versa_image
| '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/deploy/images/am335x-versa-nxt256/zImage' -> '/home/calixto-systems/eagle/nxp-linux-platform/yocto/calixto-nxp-yocto/calixto-images/am335x-versa-nxt256/calixto-image-minimal/sdcard/zImage'
| '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/deploy/images/am335x-versa-nxt256/am335x-calixto-nxt.dtb' -> '/home/calixto-systems/eagle/nxp-linux-platform/yocto/calixto-nxp-yocto/calixto-images/am335x-versa-nxt256/calixto-image-minimal/sdcard/am335x-calixto-nxt.dtb'
| '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/deploy/images/am335x-versa-nxt256/u-boot.img' -> '/home/calixto-systems/eagle/nxp-linux-platform/yocto/calixto-nxp-yocto/calixto-images/am335x-versa-nxt256/calixto-image-minimal/sdcard/u-boot.img'
| /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/calixto-images/work/am335x_versa_nxt256-poky-linux-gnueabi/calixto-image-minimal/1.0-r0/temp/run.create_calixto_versa_image.3580043: 166: s: not found
| WARNING: exit code 127 from a shell command.
| DEBUG: Python function do_image_complete finished
ERROR: Task (/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb:do_image_complete) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3385 tasks of which 3379 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb:do_image_complete
Summary: There was 1 WARNING message.
Summary: There was 1 ERROR message, returning a non-zero exit code.

  • Can you provide some steps to re-create this using the one of the images that comes with the TI SDK (e.g., tisdk-base-image).

    Regards, Andreas

  • Hi Andreas,
     

    Thanks for your response & i resolve that above error.


    After completion of  the $bitbake calixto-image-minimal image, its deploying the all components images into custom directory excluding the rootfs image - calixto-image-minimal-am335x-versa-nxt256-20240515141228.rootfs.tar

     Now I'm facing issue with the copying the above rootfs image into custom directory 

    Summary:
    inside MACHINE/create-calixto-image.inc file & I'm maintaining script for copying the rootfs image & following code will be:

     

    CALIXTO_IMAGE_PATH_COMMON = '${DEPOLY_DIR}/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/calixto-images/${MACHINE}'
    CALIXTO_IMAGE_PATH_SDCARD = '${DEPOLY_DIR}/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/calixto-images/${MACHINE}/sdcard'
    
    create_calixto_versa_image () {
    
    mkdir -p ${CALIXTO_IMAGE_PATH_COMMON}
    rm -rf ${CALIXTO_IMAGE_PATH_COMMON}/*
    
    cp -v ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}-${DATETIME}.rootfs.tar ${CALIXTO_IMAGE_PATH_SDCARD}/rootfs.tar
    
    }

    For the above script code i got following error:

    | cp: cannot stat '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/deploy/images/am335x-versa-nxt256/calixto-image-minimal-am335x-versa-nxt256-20240515141228.rootfs.tar': No such file or directory
    | WARNING: exit code 1 from a shell command.
    | DEBUG: Python function do_image_complete finished
    ERROR: Task (/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb:do_image_complete) failed with exit code '1'
    NOTE: Tasks Summary: Attempted 3385 tasks of which 3379 didn't need to be rerun and 1 failed.
    
    Summary: 1 task failed:
      /home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/meta-calixto-ti/recipes-calixto/images/calixto-image-minimal.bb:do_image_complete
    Summary: There was 1 WARNING message.
    Summary: There were 63 ERROR messages, returning a non-zero exit code.

    So, Please help out the above issue.


    Thanks in advance.



    Regards, 

    Ravikumar

  • Thanks for the additional info. I'm on business travel this week so it wont' be until next week the earliest I can look at this more closely.

    Regards, Andreas

  • Hi Ravikumar,

    I just noticed this thread here is still open. Do you need still help with the additional concern you ran into?

    Regards, Andreas

  • Hi Andreas,

    Thanks for your concern & response.

    As per above posted code i am facing issue with the copying the rootfs.tar (along with time stamp) into out off build_dir so its not copying file after build process completion. 

    help me to resolve this issue.



    Thanks & Regards,

    Ravikumar

  • Hi Ravikumar,
    from your output...

    `| cp: cannot stat '/home/calixto-systems/rpr/yocto/calixto-yocto-wordir-ti/build_ti/tmp/deploy/images/am335x-versa-nxt256/calixto-image-minimal-am335x-versa-nxt256-20240515141228.rootfs.tar': No such file or directory`

    Does this file exist after the build?

    If it does, perhaps it wasn't there when your script ran, which means there's a race condition at play here. You may want look at customizing the do_image_completion task, this should run after pretty much everything was created. As per Yocto documentation:

    https://docs.yoctoproject.org/overview-manual/concepts.html#image-generation

    "...The final task involved in image creation is the do_image_complete task. This task completes the image by applying any image post processing as defined through the IMAGE_POSTPROCESS_COMMAND variable. The variable specifies a list of functions to call once the build system has created the final image output files..."

    Regards, Andreas

  • Hi

    Thanks for information,

    As you point out my issue is correct,  Basically I'm trying to copy the build output file rootfs.tar into out of build directory so for that i used the shell script to copy the rootfs.tar file after build process completion and also introduced the yocto project variable IMAGE_POSTPROCESS_COMMAND in the machine (.conf) file as the yocto project documentation. 

    but as of now i used the script like this below :

     

    # include file (create-calixto-image.inc) contains the below code :
    
    CALIXTO_IMAGE_PATH_SDCARD = "${DEPOLY_DIR}/../../../calixto-images/${MACHINE}/sdcard"
    
    create_am335x_versa_image () {
    
    mkdir -p ${CALIXTO_IMAGE_PATH_SDCARD}
    rm -rf ${CALIXTO_IMAGE_PATH_SDCARD}/*
    
    cp -v ${DEPLOY_DIR_IMAGE}/zImage ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/am335x-calixto-nxt.dtb ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/u-boot.img ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/MLO ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/MLO.byteswap ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}-${DATETIME}.rootfs.tar ${CALIXTO_IMAGE_PATH_SDCARD}/rootfs.tar
    
    }
    
    


    if i used the above script, the build process won't creating the rootfs.tar file in the DELOPY_DIR_IMAGE folder as per the yocto things. 



    So plz help out this issue.



    Thanks and Regards, 

    Ravikumar.

  • Hi 

    Thanks for information,

    As you point out my issue is correct,  Basically I'm trying to copy the build output file rootfs.tar into out of build directory so for that i used the shell script to copy the rootfs.tar file after build process completion and also introduced the yocto project variable IMAGE_POSTPROCESS_COMMAND in the machine (.conf) file as the yocto project documentation. 

    but as of now i used the script like this below :

     

    # include file (create-calixto-image.inc) contains the below code :
    
    CALIXTO_IMAGE_PATH_SDCARD = "${DEPOLY_DIR}/../../../calixto-images/${MACHINE}/sdcard"
    
    create_am335x_versa_image () {
    
    mkdir -p ${CALIXTO_IMAGE_PATH_SDCARD}
    rm -rf ${CALIXTO_IMAGE_PATH_SDCARD}/*
    
    cp -v ${DEPLOY_DIR_IMAGE}/zImage ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/am335x-calixto-nxt.dtb ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/u-boot.img ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/MLO ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/MLO.byteswap ${CALIXTO_IMAGE_PATH_SDCARD}
    
    cp -v ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}-${DATETIME}.rootfs.tar ${CALIXTO_IMAGE_PATH_SDCARD}/rootfs.tar
    
    }
    
    


    if i used the above script, the build process won't creating the rootfs.tar file in the DELOPY_DIR_IMAGE folder as per the yocto things. 

    I think the timestamp within the rootfs.tar file is the issue,!


    So plz help out this issue.



    Thanks and Regards, 

    Ravikumar.

  • How are you calling create_am335x_versa_image()? Are you saying you are already doing this using IMAGE_POSTPROCESS_COMMAND?

    The other thing you can try is to set BB_NUMBER_THREADS = "1" in your conf/local.conf file. This often works around race condition type if issues (however if it does is should not be considered to be a clean solution!).

    Regards, Andreas