4
votes

I am working on an embedded project on Zedboard. I would like (at least for now) to use Bitbake only to produce proper rootfs. I use recipe core-image-minimal, as I need only limited amount of staff there. How can I "tell" it to not compile kernel, not make u-boot, etc. and focus on rootfs only?

Here is what I've done so far:

  1. Created my build environment
  2. Downloaded needed layers
  3. Modified local.conf to add needed packages to rootfs

Then after typing

bitbake core-image-minimal

I get my rootfs, and all this unnecessary staff. How can I avoid it?

4
What are you trying to achieve here? Less time to build the image? Less disk usage? In the scheme of things, the kernel and u-boot are only very small parts of the build process so removing them likely won't make much difference. Most of the build time is taken building the compilers and libc.Richard Purdie
I want to do things in the right way, and I want to understand Yocto better. As you said, time is not crucial, as compiling rootfs is about 3h, and kernel ~15min.Staszek

4 Answers

2
votes

Interesting concept. However, from what I observed, Yocto must get the defconfig in kernel and u-boot to do configuration on the image itself. Therefore, removing the process will make rootfs not bootable.

These happened for me a lot of time since I used different kernels to compile for different machines. I thought that the ARM image will be the same and will work for all machine but I was wrong.

For Debian, the image compiled need to use kernel's corresponding configuration to compile the rootfs for it to work. And Yocto is the same.

2
votes

I recently had the same need to only build the rootfs with yocto, skipping other things such as kernel, uboot, image creation etc. There are many legitimate reasons to do so. Anyways, this is what you have to do:

bitbake core-image-minimal -c image_cpio

in krogoth, this will populate the rootfs directory in build/tmp/work/$MACHINE/core-image-minimal/1.0-r0/ and create a rootfs.cpio file in build/tmp/deploy/images/$MACHINE/

in morty, the rootfs.cpio archives seem to be in build/tmp/work/$MACHINE/core-image-minimal/1.0-r0/deploy-core-image-minimal-image-complete/

2
votes
bitbake -e |grep IMAGE_FSTYPE

will give you something like:

IMAGE_FSTYPES="tar.gz cpio cpio.gz.u-boot ...."

it's a list of all the image that will be generated, to remove the undesired ones, in the local.conf file use:

IMAGE_FSTYPES_remove = " cpio cpio.gz.u-boot"

the space before the first element it's not optional. Regards

2
votes

If you don't want to build a kernel set the preferred provider of virtual/kernel to 'linux-dummy'.