[yocto] Looking for help in building a custom device tree based kernel

Andrew Wafaa awafaa at opensuse.org
Thu Jun 28 06:49:38 PDT 2012


Aloha,

I was wondering if someone could advise on how I would go about
creating a custom device tree based kernel?

I've created my meta-foo repo which includes my defconfig etc. The bit
I'm stuck on is how I would create the steps that I would manually do,
within Yocto. As in which files need what entries, below are the
manual steps I would do:

git clone git://kernel.repo.git
git checkout branch

I would then build a kernel zImage with:

make ARCH=arm platform_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j5 zImage

I then need to build and append the dtb:

git clone git://dts.repo.git
git checkout branch

I would then copy the motherboard.dtsi and processor.dts into
kernel.repo/arch/arm/boot/dts

Then do:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- rtsm_ve-cortex_a15x2.dtb

This creates a dtb entry in kernel.repo/arch/arm/boot

To append the blob to the kernel I do:

cat ./zImage ./rtsm_ve-cortex_a15x2.dtb | dd of=zimageProcessor.bin
bs=4 conv=sync

With the root tarballs I use manually I then have to create an
initramfs enabled rootfs by doing:

sudo sh -c 'find . | cpio --quiet -H newc -o | gzip -3 -n >
../filesystem.cpio.gz'

Now I'm not sure whether the last step is required if I use Yocto or
not, but I need to build the kernel with the dtb appended. Ant ideas?

Many thanks,

Andy



More information about the yocto mailing list