Yocto devtool issue

Hi,

I tried to modify torizon with yocto devtool within Docker crops/poky container, however it stopped with the error as follow. I’m able to modify source with yocto devshell. Due to Verdin SOM and carrier board (Dahlia and Development Board) configuration hardware version I have to use torizon 5.1.0.

$repo init -u https://git.toradex.com/toradex-manifest.git -b refs/tags/5.1.0 -m torizoncore/default.xml
$repo sync --no-clone-bundle
$docker run --rm -it -v $(pwd):$(pwd) crops/poky --workdir=$(pwd)
$MACHINE=verdin-imx8mm DISTRO=torizon-rt source setup-environment build-rt
$devtool modify virtual/kernel
........
NOTE: Executing Tasks
ERROR: 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:devtool_post_patch(d)
     0003:
File: '/mnt/Work/PROJs/yocto/tz/build-rt-test-devtool/conf/../../layers/openembedded-core/meta/classes/devtool-source.bbclass', lineno: 207, function: devtool_post_patch
     0203:            rm_patches()
     0204:            # Now we need to reconcile the dev branch with the no-overrides one
     0205:            # (otherwise we'd likely be left with identical commits that have different hashes)
     0206:            bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
 *** 0207:            bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
     0208:        else:
     0209:            bb.process.run('git checkout %s -b devtool-no-overrides' % devbranch, cwd=srcsubdir)
     0210:
     0211:        for override in extra_overrides:
File: '/mnt/Work/PROJs/yocto/tz/layers/openembedded-core/bitbake/lib/bb/process.py', lineno: 182, function: run
     0178:        if not stderr is None:
     0179:            stderr = stderr.decode("utf-8")
     0180:
     0181:    if pipe.returncode != 0:
 *** 0182:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0183:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of 'git rebase devtool-no-overrides' failed with exit code 1:

It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
        git rebase (--continue | --abort | --skip)
If that is not the case, please
        rm -fr "/mnt/Work/PROJs/yocto/tz/build-rt-test-devtool/tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/5.4.77+gitAUTOINC+cea1f4fd7e_322691f7b5-r0/devtooltmp-nx2wisn7/workdir/git/.git/rebase-apply"
and run me again.  I am stopping in case you still have something
valuable there.


ERROR: Logfile of failure stored in: /mnt/Work/PROJs/yocto/tz/build-rt-test-devtool/tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/5.4.77+gitAUTOINC+cea1f4fd7e_322691f7b5-r0/devtooltmp-nx2wisn7/temp/log.do_patch.11329
........

Thanks in advance.
ierturk

Greetings @ierturk,

First of all may I ask for what reason you’re building/modifying Torizon? I can see you’re trying to modify the kernel but what exactly are you attempting to do?

I’m just wondering in case there’s an opportunity to improve on our side.

Finally you mentioned you’re using 5.1.0 because of your Verdin SOM, I assume you have an older 1st generation version then?

As for your issue, I was able to reproduce this issue, however I don’t have a good idea on what a simple fix would look like here. In short this type of error occurs when devtool can’t properly create a override branch for the recipe that is being modified. This usually comes down to how the recipe in question is defined and constructed. That being said I’m not completely sure what part of the kernel recipe breaks this process.

But we have workarounds/alternatives available to us. For now I suggest just cloning and working on the kernel outside of Yocto. Then add the patches back into the kernel recipe in Yocto. While it may be possible to fix the devtool issue, there’s no guarantee it will stay fixed. Testing functionality of devtool is not part of our testing suite.

edit: Forgot to mention, since you’re using crops I wanted to mention we have our own version of the crops container as well: Build TorizonCore from Source With Yocto Project/OpenEmbedded | Toradex Developer Center

It’s not much different then the default crops it just has some extra tools and scripts to setup the torizon environment easier.

Best Regards,
Jeremias

Hi @jeremias.tx,

Thanks for detailed information on the issue that I experienced. I’m trying to fix the issue that I already posted here PPS Generator on Verdin Mini SOM.

I have two Verdin SOM set up 1st and 2nd generation but I have to use 5.1.0 due to it supports both of them.

I also tried devshell, instead of devtool and I’m able to fix it and build image. But I think that devtool is more convenient method than devshell as stated here Using devtool to modify recipes in Yocto.

Also as you mentioned there is a CROPS container from Toradex. I’m able to build custom image with it for adding extra layers and packages like that ROS2 and some PTP tools. Other than these I also tried torizoncore-builder tool for fixing device tree but it is not sufficient to fix the issue regarding the PPS generation because it also needs to be modified the kernel driver source other than device-tree.

I hope Toradex fix the issue regarding devtool soon.

Thanks and regards,
Ibrahim

Glad you were able to work-around this for the time being. I’ll see what can be done but again no guarantees since devtool is not a tool we guarantee will work with all of our recipes in our Yocto BSP.

Best Regards,
Jeremias