Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-13 Thread Uwe Geuder
On Mon, Nov 12, 2018 at 3:09 PM Markus W markus4dev-at-gmail.com wrote: > > Thanks Uwe! > > I tried the global approach by adding the following to my local.conf file: > > ROOTFS_POSTPROCESS_COMMAND += "my_setcap_function" > > my_setcap_function() { > setcap cap_net_raw+eip

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-12 Thread Mike Looijmans
Sometimes the problem is that parts of the underscored function name are seen as overrides, so you should try using "mysetcapfunction" instead as a name. Also, there's a semicolon missing: ROOTFS_POSTPROCESS_COMMAND += "my_setcap_function;" On 12-11-18 14:09, Markus W wrote: > Thanks Uwe! > >

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-12 Thread Markus W
Thanks Uwe! I tried the global approach by adding the following to my local.conf file: ROOTFS_POSTPROCESS_COMMAND += "my_setcap_function" my_setcap_function() { setcap cap_net_raw+eip ${IMAGE_ROOTFS}/usr/bin/node } But got the following warning: WARNING: core-image-full-cmdline-1.0-r0

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-09 Thread Uwe Geuder
Hi! On Fri, Nov 9, 2018 at 12:16 PM Markus W markus4dev-at-gmail.com wrote: > On Thu, 8 Nov 2018 at 22:53, Piotr Tworek wrote: ... >> pkg_postinst_ontarget_${PN} () { >>setcap cap_net_raw+eip $D${bindir}/node >> } ... > How can this be achieved when the rootfs is created and not on first >

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-09 Thread Markus W
Thanks Piotr, that worked! How can this be achieved when the rootfs is created and not on first boot? I would like not to ship libcap binaries with the target in production. /Markus On Thu, 8 Nov 2018 at 22:53, Piotr Tworek wrote: > Hi Markus, > > Have you tried doing it in the postinst step

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-08 Thread Piotr Tworek
Hi Markus, Have you tried doing it in the postinst step executed on your target? Try: pkg_postinst_ontarget_${PN} () { setcap cap_net_raw+eip $D${bindir}/node } RDEPENDS_${PN} += "libcap-bin" /ptw > I have tested to set capabilities on the node binary within a custom recipe > (custom

Re: [yocto] Set linux capabilities on binary on a recipe in meta-oe layer

2018-11-08 Thread Markus W
I have tested to set capabilities on the node binary within a custom recipe (custom layer) but that failed. pkg_postinst_${PN} () { setcap cap_net_raw+eip $D${bindir}/node } PACKAGE_WRITE_DEPS = "libcap-native" RDEPENDS_${PN} = "libcap" The error message: ERROR: