0
votes

I am updating a device tree in Beagle Bone Black to enable i2c configuration. I have created a new layer meta-test. In meta-test there is a recipes-kernel where I have a leds.cfg and am335x-boneblack.dts file with linux-yocto_%.bbappend file. The bbappend file looks like this:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI += "\
file://am335x-boneblack.dts \
file://leds.cfg \
"

After building the kernel with bitbake both the files are transferred to "build/tmp/work/beaglebone_yocto-poky-linux-gnueabi/linux-yocto/4.18.25+git**" directory

But I want the dts file to get transfer to another directory "build/tmp/work-shared/beaglebone-yocto/kernel-source/arch/arm/boot/dts "

How do I achieve this within the bbappend file?

2
Why do you want to do that? kernel-devicetree.bbclass should take care of it without doing it manually I suppose. Otherwise you can maybe add something like do_compile_prepend(){ cp ${WORKDIR}/am335x-boneblack.dts ${S}/arch/${ARCH}/boot/dts/ }Nayfe

2 Answers

2
votes

I was able to solve it adding this line:

do_configure_append() {
    cp ${WORKDIR}/am335x-boneblack.dts ${S}/arch/arm/boot/dts/
}
1
votes

Appending the files to SRC_URI in the linux-yocto recipe you're adding the files to the linux-yocto workdir not to the actual kernel-source workdir. You have 2 options in order to make those files available from the kernel-source folder:

  • Move/C&P the files. Inside the linux-yocto workdir, the folder linux-beaglebone_yocto-standard-build/sources is a symlink to build/tmp/work-shared/beaglebone_yocto/kernel-source. Hence, you can copy&paste/move the files to that folder using cp/mv in your bbappend.
  • Create a patch. You can add those files in the form of a patch to the kernel source instead and, thus, just include the patch in your bbappend (appending it to SRC_URI, as usual).

These are, IMO, the best options. However, you could just keep your files in a folder structure like linux-beaglebone-yocto-standard-build/sources/arch/arm/boot/dts/yourfile.dtb (inside the directory of the recipe) and then add them to SRC_URI (they will be automatically added to that path).