Need to manually create device-tree directory during build


Jonas Vautherin
 

As a learning experience, I am trying to build a downstream kernel from source. It works, but it requires that I manually make a directory in the yocto `tmp/` folder, and I am trying to understand why :-).

I created a BSP layer, and I want to use one of the downstream dts files [1]. Because that file is in `arch/arm/boot/dts/qcom/msm8909-pm8916-mpp3-hw00.dts`, my machine configuration sets:

```
KERNEL_DEVICETREE += "qcom/msm8909-pm8916-mpp3-hw00.dtb"
```

I `inherit kernel` in my linux recipe, which I believe will build the dtb from the corresponding dts in the downstream sources. However, somewhere during the build process, I get the following error:

```
|   DTC     arch/arm/boot/dts/qcom/msm8909-pm8916-mpp3-hw00.dtb
| cc1: fatal error: opening output file arch/arm/boot/dts/qcom/.msm8909-pm8916-mpp3-hw00.dtb.dts.tmp: No such file or directory
```

If I create the following `qcom` directory manually and re-run `bitbake virtual/kernel`, then it works:

```
mkdir tmp/work/skycontroller3-poky-linux-gnueabi/linux-skycontroller3/3.18.31-r0/linux-skycontroller3-standard-build/arch/arm/boot/dts/qcom
```

So it feels like this `qcom/` subdirectory poses problems. I am not sure if I am missing a configuration somewhere, or if that could be a bug (or maybe the dts should be in `boot/dts` and never in a subdir like `boot/dts/qcom`?).

I read through `classes/devicetree.bbclass` and `classes/kernel-devicetree.bbclass`, but I don't think that the `*.dts.dtb.tmp` file is created there.

Looking for insights on what may be going wrong here :-).

Best,
Jonas