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).

We should use the variables provided on top of poky/meta/conf/bitbake.conf, instead of pointing to hardcoded paths. For example, use ${sysconfdir} instead of /etc, and ${bindir} in place of /usr/bin.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.143.31