I am experimenting with Yocto project for generating custom Linux images for my embedded devices.
I have a requirement to add a persistent custom kernel parameter to /etc/sysctl.conf
of the generated image.
i.e.
kernel.core_pipe_limit = 1
/etc/sysctl.conf
is generated by procps
package that comes with Yocto
base system (meta/recipes-extended/procps/procps/sysctl.conf
). However, I believe editing the sysctl.conf
in the base system is not the recommended approach.
I am using a new layer for defining my custom configurations. I hope there is a way to apply a patch to a base package via a custom layer after deploying the base layer.
How can I do this?
I am aware how to persistently change a kernel variable by updating /etc/sysctl.conf
(or, preferably, /etc/sysctl.d/xxx.conf
). My question is, how to generate the Linux image with the necessary update applied?
You can add something like this in image recipe or
local.conf
:If you want to override
/etc/sysctl.conf
file, you can create ameta-custom/recipes-extended/procps/procps_%.bbappend
file with:Then create a folder
meta-custom/recipes-extended/procps/files
and copy your customsysctl.conf
file in it.Finally you can create a
meta-custom/recipe-custom/custom-config/custom-config.bb
recipe with:And copy your
kernel_core_pipe_limit.conf
inmeta-custom/recipe-custom/custom-config/files/