[yocto] How to define and build device tree in Yocto?

Gabriele Zampieri gabbla.malist at gmail.com
Mon May 6 23:41:42 PDT 2019


Hi all,

Bas' defconfig trick (do_set_custom_defconfig) is already implemented by
Yocto itself: just add a file called defconfig to SRC_URI and the system
will apply it for you  (you can read kernel_do_configure in kernel.bbclass)
. For more information check
https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#changing-the-configuration

> how did you do the defconfig usually?

The link I put above asks this question too.

>> # The first patch simply appends my custom DTS to the list of DTD files
in the Makefile

and

>> I usually don't need to make large modifications to the kernel source,
>> so I don't need to clone the kernel, but use the default kernel for the
>> SoC with some patches.

How do you generate that patches?

I know that the kernel repo is huge, but having a local kernel tree can be
very useful and allows you to do all the patchworks easily. It also speeds
up the test if you are planning to upgrade some part of it.

Best regards,
Gabriele

Il giorno mar 7 mag 2019 alle ore 02:14 JH <jupiter.hce at gmail.com> ha
scritto:

> Hi Bas and Gabriele,
>
> Thank you so much for you advice.
>
> > My usual way of doing it is as follows:
> >
> > I usually don't need to make large modifications to the kernel source,
> > so I don't need to clone the kernel, but use the default kernel for the
> > SoC with some patches.
>
> So do I.
>
> > I use a platform support layer and add a .bbappend file for the (arm)
> > kernel to add a custom dts and .config files, together with some small
> > patches:
> >
> > *** File meta-<platform>/recipes-kernel/linux/linux-<version>_%.bbappend:
> >
> > THISAPPENDFILESDIR := "${THISDIR}/files"
> > FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> >
> > require linux-set-custom-defconfig.inc
> > require linux-add-custom-dts.inc
> >
> > # The first patch simply appends my custom DTS to the list of DTD files
> > in the Makefile
> > SRC_URI += \
> >          "file://add-custom-dts.patch \
> >           file://some_other.patch \
> >           file://another_driver_patch.patch \
> >          "
> >
> > *** File meta-<platform>/recipes-kernel/linux/linux-add-custom-dts.inc
> >
> > do_add_platform_dts() {
> >       cp -f "${THISAPPENDFILESDIR}/custom.dts" \
> >              "${WORKDIR}/git/arch/arm/boot/dts"
> > }
>
> That is exactly I am looking for the proper location of the dts files,
> thank you so much.
>
> > addtask add_platform_dts before do_preconfigure after do_patch
> >
> > *** File
> > meta-<platform>/recipes-kernel/linux/linux-set-custom-defconfig.inc
> >
> > do_set_custom_defconfig() {
> >          cp -f "${THISAPPENDFILESDIR}/defconfig" "${WORKDIR}/defconfig"
> > }
> >
> > addtask set_custom_defconfig before do_preconfigure after do_patch
>
> Good advice, I missed that one, how did you do the defconfig usually?
> Compile it in kernel source like using following command?
>
> make ARCH=arm imx_v6_v7_defconfig
>
> > It is maybe a bit complex, but it saves cloning the kernel for the sake
> > of just adding a single DTS with defconfig and a few patches.
>
> That is procedure I was looking for.
>
> > Hope this helps,
>
> Great helps, thank you so much.
>
> - jupiter
>
> > Bas.
> >
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190507/859d4ebb/attachment.html>


More information about the yocto mailing list