Re: [yocto] setcap using recipe

2016-07-01 Thread Mathieu Allard
Hello,

I think that the main issue here is that the pkg_postinst function runs its 
action at the rootfs creation time, and not on the target as advised by Ross.

The chapter 5.3.16, "post-installation scripts" in the mega-manual offers some 
detailed explanations on how to make it run after the first boot.


Regards,

Mathieu


- Original Message -
From: "Daniel." 
To: "Kumar, Shrawan" 
Cc: yocto@yoctoproject.org
Sent: Friday, July 1, 2016 3:54:15 PM
Subject: Re: [yocto] setcap using recipe

Does your target filesystem support it? ubifs doesn't :(
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_xattr

2016-07-01 9:53 GMT-03:00 Kumar, Shrawan :
> Hello Ross,
>
>
>
> None of the approach is working .  I have attached the  recipe where I am
> trying to execute postinst . It builds successfully , But when I run getcap
> on the target , does not return the set capabilities.
>
>
>
> Help will be highly appreciated .
>
>
>
> Regards
>
> Shrawan
>
> From: Burton, Ross [mailto:ross.bur...@intel.com]
> Sent: Friday, June 24, 2016 6:40 PM
>
>
> To: Kumar, Shrawan
> Cc: yocto@yoctoproject.org
> Subject: Re: [yocto] setcap using recipe
>
>
>
> Looks like using setcap directly is broken currently, there are two
> workarounds:
>
>
>
> 1) use a postinst to invoke setcap on the target instead
>
> 2) test the patch for pseudo that is on this list ([PATCH] Add capset pseudo
> function that always succeeds) and verify that it fixes the problem for you.
>
>
>
> Ross
>
>
>
> On 24 June 2016 at 13:31, Kumar, Shrawan  wrote:
>
> I am using Yocto 2.0.2
>
>
>
> Thanks and Regards
>
> Shrawan
>
>
>
> From: Burton, Ross [mailto:ross.bur...@intel.com]
> Sent: Friday, June 24, 2016 5:56 PM
>
>
> To: Kumar, Shrawan
> Cc: yocto@yoctoproject.org
> Subject: Re: [yocto] setcap using recipe
>
>
>
> What version of OE/Yocto are you using?  Old versions of pseudo didn't
> support xattrs at all.
>
>
>
> Ross
>
>
>
> On 24 June 2016 at 13:23, Kumar, Shrawan  wrote:
>
> Thanks Ross for your quick turn around , I am getting below error
>
>
>
> “Unable le to set CAP_SETFCAP effective capability: Operation not
> permitted.”
>
>
>
> But when I use# sudo setcap cap_net_raw+ep  helloworldon command
> line I am able to set the cap.
>
>
>
> To achieve the sudo realization  in recipe , I tried  as below , but no
> luck…… Can you suggest something here  ?
>
>
>
> fakeroot 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
>
>
>
> }
>
>
>
> Thanks and Regards
>
> Shrawan
>
>
>
> From: Burton, Ross [mailto:ross.bur...@intel.com]
> Sent: Friday, June 24, 2016 5:09 PM
> To: Kumar, Shrawan
> Cc: yocto@yoctoproject.org
> Subject: Re: [yocto] setcap using recipe
>
>
>
> Hi,
>
>
>
> On 24 June 2016 at 11:41, Kumar, Shrawan  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
>
>
>
>
>
>
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
"Do or do not. There is no try"
  Yoda Master
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Adding ntfs3g to image and mouting ntfs partitions!?

2016-09-15 Thread Mathieu Allard
Hi,

it seems to me that the name of the recipe is ntfs-3g-ntfsprogs and not just 
ntfs-3g.


PS: I'm not sure using arch linux is a good choice for yocto builds, you get a 
lot of updates and that will probably result in weird errors quite often.
I would advise to use a supported distro, maybe in a chroot/container (or 
eventually debian stable with which I never had a problem so far)


- Original Message -
From: "Daniel." 
To: yocto@yoctoproject.org
Sent: Wednesday, September 14, 2016 11:18:17 PM
Subject: [yocto] Adding ntfs3g to image and mouting ntfs partitions!?

Hi,

I'm trying to compile ntfs-3g but I get "nothing provides ntfs-3g"
error, the weird part is that I have that recipe:

Some commands and its outputs:

[geckos@csi24 build_x11]$ find ../sources/ -name
"ntfs*.bb*"../sources/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2013.1.13.bb


[geckos@csi24 build_x11]$ cat
../sources/meta-openembedded/meta-filesystems/recipes-filesystems/ntfs-3g-ntfsprogs/ntfs-3g-ntfsprogs_2013.1.13.bb
DESCRIPTION = "The NTFS-3G driver is an open source, freely available
NTFS driver for Linux with read and write support."
HOMEPAGE = "http://www.ntfs-3g.org/";
DEPENDS = "fuse libgcrypt"
PROVIDES = "ntfsprogs ntfs-3g"
LICENSE = "GPLv2 & LGPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a"

SRC_URI = "http://tuxera.com/opensource/ntfs-3g_ntfsprogs-${PV}.tgz";
S = "${WORKDIR}/ntfs-3g_ntfsprogs-${PV}"

SRC_URI[md5sum] = "2d6fb47ddf62b51733227126fe9227fe"
SRC_URI[sha256sum] =
"4b383f0074a3ab7683339d1f18222b107aaeb4983db119292c43c2b275cefb27"

inherit autotools

PACKAGECONFIG ??= ""
PACKAGECONFIG[uuid] = "--with-uuid,--without-uuid,util-linux"

# required or it calls ldconfig at install step
EXTRA_OEMAKE = "LDCONFIG=echo"

PACKAGES =+ "ntfs-3g ntfsprogs libntfs-3g"

FILES_ntfs-3g = "${base_sbindir}/*.ntfs-3g ${bindir}/ntfs-3g*
${base_sbindir}/mount.ntfs"
RDEPENDS_ntfs-3g += "fuse"
RRECOMMENDS_ntfs-3g = "util-linux-mount"

FILES_ntfsprogs = "${base_sbindir}/* ${bindir}/* ${sbindir}/*"
FILES_libntfs-3g = "${libdir}/*${SOLIBS}"

do_install_append() {
# Standard mount will execute the program /sbin/mount.TYPE
# when called. Add the symbolic to let mount could find ntfs.
ln -sf mount.ntfs-3g ${D}/${base_sbindir}/mount.ntfs
}

# Satisfy the -dev runtime dependency
ALLOW_EMPTY_${PN} = "1"
[geckos@csi24 build_x11]$



[geckos@csi24 build_x11]$ bitbake ntfs-3g
WARNING: Host distribution "Arch-Linux" has not been validated with
this version of the build system; you may possibly experience
unexpected failures. It is recommended that you use a tested
distribution.
Loading cache: 100%
|#|
ETA:  00:00:00
Loaded 2228 entries from dependency cache.
ERROR: Nothing PROVIDES 'ntfs-3g'

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[geckos@csi24 build_x11]$
[geckos@csi24 build_x11]$
[geckos@csi24 build_x11]$ bitbake ntfsprogs
WARNING: Host distribution "Arch-Linux" has not been validated with
this version of the build system; you may possibly experience
unexpected failures. It is recommended that you use a tested
distribution.
Loading cache: 100%
|#|
ETA:  00:00:00
Loaded 2228 entries from dependency cache.
ERROR: Nothing PROVIDES 'ntfsprogs'. Close matches:
  e2fsprogs

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[geckos@csi24 build_x11]$
[geckos@csi24 build_x11]$
[geckos@csi24 build_x11]$ bitbake ntfs-3g-ntfsprogs
WARNING: Host distribution "Arch-Linux" has not been validated with
this version of the build system; you may possibly experience
unexpected failures. It is recommended that you use a tested
distribution.
Loading cache: 100%
|#|
ETA:  00:00:00
Loaded 2228 entries from dependency cache.
ERROR: Nothing PROVIDES 'ntfs-3g-ntfsprogs'

Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[geckos@csi24 build_x11]$


Thanks in advance
Best regards,

-- 
"Do or do not. There is no try"
  Yoda Master
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [toaster] import config

2016-09-16 Thread Mathieu Allard
Hi!

It maybe is a naive question and I assume it's not possible because I didn't 
find anything related in the manual.

Is it possible to launch a toaster instance on an already command-line-setup 
build?
Like inheriting the toaster bbclass and maybe some magic trick?

Or am I stuck in reconfiguring everything manually through the web interface?

Now that I have some working builds, I just wanted to know is there is a quick 
way to get some overview over it on our local network, and to quickly build my 
application again when I have an update.

Otherwise I'll just hack some cheap script to launch a remote rebuild of my 
package when I need it.
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto