[yocto] Patching a file in $WORKDIR

Siegel, Jeffrey (Nokia - US/Murray Hill) jeffrey.siegel at nokia.com
Tue Jul 16 09:44:02 PDT 2019


Hi,
I am trying to use a bbappend file to patch a file in $WORKDIR. To my understanding, the native Yocto patching process only works for patching files in $S.
I have come up with a solution:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI_append =" file://inputrc.ptch"
do_patch_append () {
    cmd="patch <inputrc.ptch"
    (exitstatus, output) = oe.utils.getstatusoutput(cmd)
    if exitstatus != 0:
       raise bb.process.CmdError(cmd, output)
    return output
}

It does work. But I think this is line is not very elegant: cmd="patch <inputrc.ptch". Using devshell, I have confirmed that the "patch" program being executed is the one from the Yocto environment ($BUILDDIR/tmp-glibc/hosttools), not the build host. But I still suspect there is a better way. Any suggestions?

Regards,
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190716/dee1ffc1/attachment.html>


More information about the yocto mailing list