Book Image

Embedded Linux Development with Yocto Project

Book Image

Embedded Linux Development with Yocto Project

Overview of this book

Table of Contents (22 chapters)
Embedded Linux Development with Yocto Project
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
References
Index

Adding extra files to the existing packages


If we need to include an extra configuration file, we should use FILESEXTRAPATHS, as explained in the previous example and shown in the following lines of code:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" 

SRC_URI += "file://newconfigfile.conf" 

do_install_append() { 
    install -m 644 ${WORKDIR}/newconfig.conf ${D}${sysconfdir} 
}

The do_install_append function appends the provided block below the metadata already available in the original do_install function. It includes the command needed to copy our new configuration file into the package filesystem. The file is copied from ${WORKDIR} to ${D} as the directory used by Poky to build the package and the destination directory used by Poky to create the package. The ${sysconfdir} directory is the system configuration directory (usually with /etc).

Tip

We should use the variables provided on top of poky/meta/conf/bitbake.conf instead of pointing to hardcoded paths. For example, use ${sysconfdir...