4

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?

Staszek
  • 849
  • 11
  • 28
  • 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 Sep 18 '16 at 09:59
  • 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 Sep 19 '16 at 10:25

4 Answers4

2

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/

Sam F
  • 499
  • 7
  • 19
2

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.

Charles C.
  • 3,725
  • 4
  • 28
  • 50
  • Well, as I already said, I just ignore kernel and U-boot from Yocto, and take only rootfs, and it works. Probably it's because default kernel config is similar to mine. I will investigate in this, thanks! +1 for pointing important thing (I hope it's not illegal:)) – Staszek Mar 28 '17 at 14:00
2
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

ECO
  • 359
  • 2
  • 13
  • Why is not that space optional? ARe we back to the good old times of tabs for spacing and such? :) – mlvljr Jun 25 '18 at 21:38
  • 2
    no, is because is appended to an existing list. if, for example, the list is "A B C" and you append "D E F" without the space the resulting list will be "A B CD E F" and that is not what we want. – ECO Sep 21 '19 at 05:43
2

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

Ross Burton
  • 3,516
  • 13
  • 12