linuxyoctobitbakeicu

Yocto Reducing libicudata size


I am building a Yocto image for small embedded Linux device. One of the largest files on the filesystem is libicudata.so at 27MB.

I want to decrease the size of the image by removing unneeded locales from this library using the technique described here: https://lists.openembedded.org/g/openembedded-core/topic/72740450#

I created a bbappend for the icu recipe ( https://git.yoctoproject.org/poky/plain/meta/recipes-support/icu/icu_72-1.bb ) and added the following filter.json:

{
  "localeFilter": {
    "filterType": "locale",
    "whitelist": [
      "en"
    ]
}

bbappend:

FILESEXTRAPATHS:prepend := "${THISDIR}/icu:"

SRC_URI += "file://filter.json"

I have verified that my modified filter.json is present in the ~/poky/build directory.

The problem is that the resulting binary is always 27 MB, and is not shrinking due to the filter.json.

How can I reduce the libicu shared object file in Yocto be removing unneeded locales? Thanks.


Solution

  • According to your bb file : ${@bb.utils.contains('PACKAGECONFIG', 'make-icudata', '', 'exit 0', d)} you should set PACKAGECONFIG += "make-icudata"