Amit,

First, I suggest you change
PRINC = "4"
to
PRINC := "${@int(PRINC) + 1}"

This way your bbappend will always increment the PR to one more than the PR 
called out by the main recipe.  So if the openssh recipe would get updated and 
increment the PR, you do not have to change your bbappend.

Change
SRC_URI = "file://banner"
To
SRC_URI += "file://banner"

The += appends your banner file to the SRC_URI for the openssh recipe.  With 
your line, you are overriding all the SRC_URI for the entire openssh recipe and 
the openssh recipe will only include the banner file.  I've taken to the habit 
of writing the SRC_URI as follows:

SRC_URI += " \
file://banner \
"
just to ensure that words aren't joined together when my SRC_URI is appended to 
the existing one.  I don't know if this is strictly necessary, but it's not a 
bad habit.

Change
FILESEXTRAPATHS_prepend := "${THISDIR}/openssh-6.1p1:"
to
FILESEXTRAPATHS_prepend := "${THISDIR}:"

so Bitbake can find your banner file and sshd_config that you have in the same 
directory as the bbappend.

I can't remember if you get a warning if Bitbake can't find the license file at 
all or if it fails on each attempt through the filepath.  Since your new path 
is first, it won't find LICENCE in your layer since you didn't copy it.  Once 
way to quiet this warning would be to copy the license file to your directory.

-Bryan

From: Amit Tomer [mailto:amittome...@gmail.com]
Sent: Thursday, October 03, 2013 8:23 AM
To: Bryan Evenson
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] Fwd: OpenSSH pre login banner

Hi Brayan

Thanks for your help

The way I modify .bbapend file is below

PRINC = "4"
SRC_URI = "file://banner<file:///\\banner>"
FILESEXTRAPATHS_prepend := "${THISDIR}/openssh-6.1p1:"
do_install_append() {

Install -m 755 ${WORKDIR}/banner ${D}${sysconfdir}/ssh
}



But it gives me

Below problem

WARNING: 
/tmp/work/cortexa15hf-vfp-neon-poky-linux-gnueabi/openssh/6.1p1-r3/openssh-6.1p1/LICENCE
 could not be copied for some reason. It may not exist. WARN for now.

And my build process is really got slow and sometimes I am getting the error 
also

What could be the reason for above??






On Thu, Oct 3, 2013 at 5:49 PM, Bryan Evenson 
<beven...@melinkcorp.com<mailto:beven...@melinkcorp.com>> wrote:
Amit,

>From your message, I'm assuming you have a bbappend file for openssh.  
>Following the example in section of 5.1.4 of the Mega Manual (located at 
>http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#using-bbappend-files)
> and from personal experience, put the following in your bbappend file:

FILESEXTRAPATHS_prepend := " ${THISDIR}: "
SRC_URI += " file://banner<file:///\\banner> "
FILES_${PN} += " /etc/ssh/banner "

do_install_append() {
                install -d ${D}${sysconfdir}/ssh
                install -m 0644 ${WORKDIR}/banner ${D}${sysconfdir/ssh/banner
}
PRINC := "${@int(PRINC) + 1}"

then place your banner file and sshd_config in the same directory as your 
bbappend.  When openssh gets built, Bitbake will find your sshd_config first 
and use and install that file instead of the one from the main layer.  The 
recipe also tells it how to handle the new banner file that is not part of the 
original recipe; you do not need to put these rules in place for sshd_config 
because that is already part of the original recipe.  Then in the future every 
time you make a change to the openssh package in your layer, increment the 
PRINC so your package management tools will see it as an upgrade.  For example, 
if you change the contents of the banner file, then change the "+ 1" to "+ 2".

-Bryan

From: yocto-boun...@yoctoproject.org<mailto:yocto-boun...@yoctoproject.org> 
[mailto:yocto-boun...@yoctoproject.org<mailto:yocto-boun...@yoctoproject.org>] 
On Behalf Of Amit Tomer
Sent: Thursday, October 03, 2013 7:05 AM
To: yocto@yoctoproject.org<mailto:yocto@yoctoproject.org>
Subject: [yocto] Fwd: OpenSSH pre login banner


---------- Forwarded message ----------
From: Amit Tomer <amittome...@gmail.com<mailto:amittome...@gmail.com>>
Date: Thu, Oct 3, 2013 at 1:50 PM
Subject: OpenSSH pre login banner
To: "yocto-requ...@yoctoproject.org<mailto:yocto-requ...@yoctoproject.org>" 
<yocto-requ...@yoctoproject.org<mailto:yocto-requ...@yoctoproject.org>>
I am new to OpenEmbedded Yocto and have a requirement where OpenSSH pre login 
banner
should come when do ssh from target board

Now I know I have to create a simple .txt file(banner) and put my banner in to 
it and add the following to sshd_config

Banner /etc/ssh/banner

But now  wanted to know where should I keep my banner file in yocto so that 
Yocto build infrastructure will pack banner file  to /etc/ssh/banner into final 
image.

I do have receipes for openssh in meta-xyz/recipes-connectivity/openssh  folder

Thanks
Amit





_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to