Bug 16298

Summary: Can't create fitImage with kernel-devicetree support
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Gyorgy Sarvari <skandigraun>
Component: kernelAssignee: Gyorgy Sarvari <skandigraun>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: ccasciato, randy.macleod, sivakumar.bs
Version: unspecified   
Target Milestone: 6.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Gyorgy Sarvari 2026-05-23 14:28:52 UTC
The current state:
- kernel-devicetree.bbclass contains a do_compile:append snippet, which is shell
- kernel-fit-image.bbclass defines its own do_compile - which is in python
- as one extra note, kernel.bbclass inherits kernel-devicetree.bbclass (though I guess this class can be avoided if one really wants to...)

When trying to create a fit image while also using the kernel-devicetree class, parsing errors out due to this mixed shell-python do_compile. Usually it ends in an error something like this:

```
ERROR: Unable to parse /home/meee/stuff/yocto/build/../meta-pine64/recipes-kernel/linux/linux-pine64_6.17.bb
Traceback (most recent call last):
  File "/home/meee/stuff/yocto/bitbake/lib/bb/cooker.py", line 2334, in parse_next
    raise result
  File "/home/meee/stuff/yocto/build/../oe-core/meta/classes-recipe/kernel-fit-image.bbclass", line 202
    }
     ^
IndentationError: unexpected indent
```

I think the kernel-devicetree and kernel-fit-image classes should be able to work together, but if I would be mistaken by this, handling this error in a special was would be nice, because it took some head scratching to find the actual problem.
Comment 1 Gyorgy Sarvari 2026-05-23 14:40:27 UTC
Apologies, I posted a wrong error output in my original description. That was a mid-debugging output. When using these classes, the actual error is a TabError:

```
ERROR: Unable to parse /home/meee/stuff/yocto/build/../meta-pine64/recipes-kernel/linux/linux-pine64_6.17.bb
Traceback (most recent call last):
  File "/home/meee/stuff/yocto/bitbake/lib/bb/cooker.py", line 2334, in parse_next
    raise result
  File "/home/meee/stuff/yocto/build/../oe-core/meta/classes-recipe/kernel-fit-image.bbclass", line 202
    }
    ^
TabError: inconsistent use of tabs and spaces in indentation
```
Comment 2 Randy MacLeod 2026-05-28 14:47:57 UTC
A work-around may be to change the appends to postfuncs
This would avoid the syntax errors.
Comment 3 Siva Balasubramanian 2026-07-02 10:37:40 UTC
Hi Gyorgy,

I looked into this and can reproduce the root cause from source:
kernel-devicetree.bbclass uses do_compile:append() (shell) which
conflicts with kernel-fit-image.bbclass's python do_compile(), causing
the TabError at parse time.

I have a fix ready following Randy's postfuncs suggestion - converting
the do_compile:append() to a named function registered via
do_compile[postfuncs], which is language-agnostic and avoids the
conflict entirely. Shell code is unchanged so behavior is identical for
recipes not using kernel-fit-image.

Are you still planning to work on this? If not, happy to send a patch.

Thanks,
Siva
Comment 4 Gyorgy Sarvari 2026-07-09 08:13:23 UTC
I have no intention to send any patches to the project in the near future. Please feel free to use this bugreport as you see it fit.