[yocto] Openssh patch being overriden by original unpatched file

Khem Raj raj.khem at gmail.com
Mon Jul 10 11:02:33 PDT 2017


On 7/10/17 10:48 AM, Jack Kiefer wrote:
> Howdy all,
> 
> I've been having a bit of an interesting time trying to ship a modified
> sshd_config file to my images using Yocto Morty. I first tried adding a
> .bbappend to the openssh recipe in which I prepended a patch file that
> would modify sshd_config to my liking. Interestingly, Yocto would
> definitely run do_patch and presumably patch the file successfully (I
> ensured the patch was correct by manually using the patch command), but
> somehow the patched file was still overridden by the original file in
> the final version of the image.
> 
> I've been able to temporarily remedy this by using the .bbappend to
> simply use an entire modified sshd_config file from its FILES directory
> rather than applying a patch.
> 
> Is this how Yocto is supposed to behave? Is there a more correct way of
> providing fairly version-agnostic modifications to config files like this?
> 

this file is specified in SRC_URI as a whole to be copied from recipe
area to build area

SRC_URI =
"http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
           file://sshd_config \
           file://ssh_config \
...

when you want to override such cases where a conf file is provides via
the metadata on top of original sources then you can create a .bbappend
in your own layer and let bitbake parse it via adding


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

and then put your sshd_config file in your own layer e.g under
recipes-connectivity/openssh/openssh/

This will instruct bitbake to use the config file from your overlay
also pay attention to layer priority, usually you want your own layer
to have higher priority and appear before other layers in BBPATH


> Thanks!
> Jack
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: OpenPGP digital signature
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170710/cb1ddca8/attachment.pgp>


More information about the yocto mailing list