[yocto] setcap using recipe
Burton, Ross
ross.burton at intel.com
Fri Jun 24 04:39:23 PDT 2016
Hi,
On 24 June 2016 at 11:41, Kumar, Shrawan <Shrawan.Kumar at harman.com> wrote:
> Is there a way to add a capability to a binary (cap_net_raw+ep),into a
> recipe?
>
>
>
> Example :
>
> do_install() {
>
> install -d ${D}${bindir}
>
> install -m 0755 helloworld ${D}${bindir}
>
> install -d ${D}/lib/systemd/system
>
> install -m 0755 hello.service ${D}/lib/systemd/system/
>
> setcap cap_net_raw+ep ${D}${bindir}/helloworld
>
> }
>
>
>
> If yes is this correct approach to achieve the same from package recipe
> itself ?
>
capabilities on files are just extended attributes, so assuming that you
have a fairly recent Yocto and your host and target filesystems support
extended attributes, yes this should work.
Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160624/629f4d8d/attachment.html>
More information about the yocto
mailing list