This page introduces a simple way to add packages to your own Linux filesystem in Yocto Linux. Take the example that add the package “ethtool” to your own target adsp-custom-ramdisk image.
Users could add their own packages instead of the “ethtool”, the first step is to find out the Yocto Project recipe that includes “ethtool”. The way to find recipes is to go to the Openembedded Layer Index web site.
Below picture shows how to find the package “gstreamer” in this website.
Method 1: After finding the specific recipe name, users need to add it to the image by adding this line to conf/local.conf which is highly recommended:
IMAGE_INSTALL_append = "ethtool"
Method 2: Users can also add the package into your own custom-recipe.bb file directly, for example, apply below patch would add the ethtool package into ramdisk filesystem.
diff --git a/meta-custom/recipes-custom/images/adsp-custom-ramdisk.bb b/meta-custom/recipes-custom/images/adsp-custom-ramdisk.bb index a98b1f9..e070e6f 100644 --- a/meta-custom/recipes-custom/images/adsp-custom-ramdisk.bb +++ b/meta-custom/recipes-custom/images/adsp-custom-ramdisk.bb @@ -6,6 +6,8 @@ IMAGE_INSTALL = " \ packagegroup-core-boot \ linux-firmware-fastboot \ fastboot-listener \ + ethtool \ " DISTRO_FEATURES = " ram"
Run below command to bitbake the ramdisk filesystem, the package ethtool would be deployed into Linux filesystem directly. Refer to the Building The Linux Components for more details on how to build the Yocto Linux Images.
bitbake adsp-custom-ramdisk
options: