[yocto] Openssh patch being overriden by original unpatched file

Jack Kiefer jack.c.kiefer at gmail.com
Mon Jul 10 11:16:45 PDT 2017


Ah, yes, apologies if I wasn't very clear. That is what I ended up doing.
What I was originally after was trying to modify the file in a way such
that if an update to openssh were to change the way the config file is laid
out there would be a better chance that my modifications would still be
compatible. That is, a potential update to the default config file is
unlikely to change the way a specific option I'm modifying is handled, but
if any other major/breaking changes are made to how the config file works
then my own layer's entire sshd_config would be inappropriate for the new
version of openssh and would need to be manually replaced and updated. This
manual work is what I am trying to avoid.

On Mon, Jul 10, 2017 at 12:02 PM Khem Raj <raj.khem at gmail.com> wrote:

> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170710/b3aac385/attachment.html>


More information about the yocto mailing list