Andrew Ellis
Andrew Ellis

Reputation: 139

Overriding firmware installion recipe in Yocto

I am trying to reduce the amount of firmware that is included in a Yocto image to reduce its size. for example I have these i915/bxt_dmc_ver1_07.bin and i915/bxt_guc_ver9_29.bin, which are not needed.

My Yocto project build platform has this recipe linux-firmware_git.bb at meta/recipes-kernel/linux-firmware. Obviously I can edit this file to exclude items of firmware. But because it is one of the base files of the distribution I'm using I want to leave it intact.

I have tried creating a linux-firmware_git.bbappend file which contains the following entries:

LICENSE_${PN}-i915       = ""
LICENSE_${PN}-i915-license = ""
FILES_${PN}-i915-license = ""
FILES_${PN}-i915-license = ""
FILES_${PN}-i915-license = ""
FILES_${PN}-i915         = ""
RDEPENDS_${PN}-i915      = ""

Unfortunately this bbappend prevents all firmware being installed in the image rather than just excluding the *-i915 files.

Could someone please tell my how to override the linux-firmware recipe so that unneeded files are excluded.

Thanks in advance

Andrew

Upvotes: 3

Views: 1170

Answers (2)

Gunther
Gunther

Reputation: 546

Firmwares are now organized in sub-packages. These can be added separately.

Alternatively you can only add the firmwares you need in local.conf:

# Add minimum firmware package
IMAGE_INSTALL:append = " \
    linux-firmware-rtl8168 \
"

Please keep in mind, that you do not also add "linux-firmware" which would add all the rest.

This works with kirkstone or better.

Upvotes: 2

Andrew Ellis
Andrew Ellis

Reputation: 139

After much digging around, I found it was quite easy to achieve what I wanted.

To remove particular items firmware, eg i915, I needed to do this:

FILES_${PN}_remove += "${nonarch_base_libdir}/firmware/LICENSE.i915 \
                       ${nonarch_base_libdir}/firmware/i915"

RDEPENDS_${PN}-i915      = "${PN}-i915-license"

do_install_append() {        
   rm -r ${D}/${nonarch_base_libdir}/firmware/i915
}

I hope this is helpful to others.

Upvotes: 2

Related Questions