Yocto: create a small(er) core-image-minimal (sysinitv) w/o graphics and systemd but sysvinit ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Yocto: create a small(er) core-image-minimal (sysinitv) w/o graphics and systemd but sysvinit ?

Jump to solution
2,674 Views
s_arendt
Contributor III

Bases on latest 6.1.22 release for imx8 (imx8mp in my case) I created with:

DISTRO=fsl-imx-wayland MACHINE=imx8mp-lpddr4-evk source imx-setup-release.sh -b build

and bitbake core-image-minimal an basic image. The problem with that: It's already 135MB in size! (a "normal" core-image-minimal is of around 32MB - w/o kernel)

I would like to have a shrinked version without optee/security/systemd but with sysvinit. That seems not so easy.

For the above mention command DISTRO must be a wayland (although I don't need any graphics). As a workaround I changed in layer.conf DISTRO to poky. That almost works, but for some reason it try to build a linux-fslc-imx 6.1.24 (meta-freescale/recipes-kernel/linux/linux-fslc-imx_6.1.bb) instead of the linux-imx 6.1.22 kernel that I need to work together with NPU (so tensorflow-lite-vx-delegate is the only additional package to add on top of the core-image-minimal)  Anyhow that 6.1.24 kernel build fails with (No rule to make target 'arch/arm64/boot/dts/freescale/imx8mp-evk-revb4.dtb')

Can someone show a way of either stripdown the DISTRO wayland or change the kernel for poky? The usual commands as INIT_MANAGER or chose a certain virtual/kernel in image-recipe seems to fail, I guess due to hard coded dependencies. What line to follow to unwind the dependencies of MACHINE, DISTRO and layers?

My prefered way would be to use a simple standard poky distro with just adding support of the imx8mp and its imx-kernel  and NPU/ML section. But the dependencies of the bunch of layers are hard to unwind, especially with the meta-freescale and meta-imx.

Can you give me some helping hand to start that?  Either:

* deselect optee, security, systemd on top of a DISTRO wayland or

* add the only required things (imx8mp kernel, libs, drivers) to a poky DISTRO?

Thanks!

0 Kudos
Reply
1 Solution
2,652 Views
ramprakash08
Contributor IV

It sounds like you're trying to create a minimal image for the imx8mp using Yocto, but you're running into some issues with the size of the image and the dependencies. Here are a few suggestions that might help:

1. To reduce the size of your image, you can try to remove unnecessary packages from your image recipe. You can do this by editing your local.conf file and adding the following line:

 IMAGE_INSTALL_remove = ' package-name ' 

Replace 'package-name' with the name of the package you want to remove. You can repeat this line for each package you want to remove.

2. If you want to use sysvinit instead of systemd, you can set the INIT_MANAGER variable in your local.conf file to 'sysvinit'. Here is the line you need to add:

 INIT_MANAGER = 'sysvinit' 

3. If you're having trouble with the kernel version, you can specify the version you want to use in your local.conf file. Here is an example:

 PREFERRED_VERSION_linux-imx = '6.1.22' 

Replace '6.1.22' with the version you want to use.

4. If you're having trouble with the dependencies, you might find it helpful to use the bitbake-layers command to show the dependencies of your layers. Here is an example:

 bitbake-layers show-depends 

This command will show you a list of all the layers and their dependencies.

I hope this helps! Let me know if you have any other questions.

View solution in original post

2 Replies
2,653 Views
ramprakash08
Contributor IV

It sounds like you're trying to create a minimal image for the imx8mp using Yocto, but you're running into some issues with the size of the image and the dependencies. Here are a few suggestions that might help:

1. To reduce the size of your image, you can try to remove unnecessary packages from your image recipe. You can do this by editing your local.conf file and adding the following line:

 IMAGE_INSTALL_remove = ' package-name ' 

Replace 'package-name' with the name of the package you want to remove. You can repeat this line for each package you want to remove.

2. If you want to use sysvinit instead of systemd, you can set the INIT_MANAGER variable in your local.conf file to 'sysvinit'. Here is the line you need to add:

 INIT_MANAGER = 'sysvinit' 

3. If you're having trouble with the kernel version, you can specify the version you want to use in your local.conf file. Here is an example:

 PREFERRED_VERSION_linux-imx = '6.1.22' 

Replace '6.1.22' with the version you want to use.

4. If you're having trouble with the dependencies, you might find it helpful to use the bitbake-layers command to show the dependencies of your layers. Here is an example:

 bitbake-layers show-depends 

This command will show you a list of all the layers and their dependencies.

I hope this helps! Let me know if you have any other questions.

2,546 Views
s_arendt
Contributor III

Thank you so much! I did the "poky"-way and changed just the local.conf. I need to set the "PREFERRED_PROVIDER_virtual/kernel = "linux-imx" only.

What I did wrong before in all my attempts: I change/added settings in core-image-my-minimal.bb. It seems to make a big difference to image-recipe or in local.conf. Can you explain why? Is there rule where to set what?

 

 

0 Kudos
Reply