Book Image

Embedded Linux Development using Yocto Projects - Second Edition

By : Otavio Salvador, Daiane Angolini
Book Image

Embedded Linux Development using Yocto Projects - Second Edition

By: Otavio Salvador, Daiane Angolini

Overview of this book

Yocto Project is turning out to be the best integration framework for creating reliable embedded Linux projects. It has the edge over other frameworks because of its features such as less development time and improved reliability and robustness. Embedded Linux Development using Yocto Project starts with an in-depth explanation of all Yocto Project tools, to help you perform different Linux-based tasks. The book then moves on to in-depth explanations of Poky and BitBake. It also includes some practical use cases for building a Linux subsystem project using Yocto Project tools available for embedded Linux. The book also covers topics such as SDK, recipetool, and others. By the end of the book, you will have learned how to generate and run an image for real hardware boards and will have gained hands-on experience at building efficient Linux systems using Yocto Project.
Table of Contents (22 chapters)
Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
7
Diving into BitBake Metadata
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's filesystem. The file is copied from ${WORKDIR} to ${D} as these are the directories 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).

Note

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