All of lore.kernel.org
 help / color / mirror / Atom feed
* How to use same user in two recipes?
@ 2017-10-10 21:30 Fabien Lahoudere
  2017-10-10 22:31 ` Aaron_Wright
  2019-02-11 19:40 ` Ulf Samuelsson
  0 siblings, 2 replies; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-10 21:30 UTC (permalink / raw)
  To: yocto

Hi

I want to use the same user in two different recipe. 
I create the user in recipe A.bb and it works fine.
Now I want to use the same user in B.bb so I add DEPENDS = "A" thinking that sysroot will be
populated with A.bb users.

But when I bitbake the recipe, user is not found. 
I conclude that I have to use USERADD_* in each recipe, right?

What happen if I use different USERADD_PARAM_${PN} in each recipe?

I also try to use EXTRA_USERS_PARAMS but without success?

Is there a way to populate sysroot with users?

Thanks

-- 
Fabien


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-10 21:30 How to use same user in two recipes? Fabien Lahoudere
@ 2017-10-10 22:31 ` Aaron_Wright
  2017-10-11  6:45   ` Fabien Lahoudere
  2019-02-11 19:40 ` Ulf Samuelsson
  1 sibling, 1 reply; 16+ messages in thread
From: Aaron_Wright @ 2017-10-10 22:31 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

> Hi
> 
> I want to use the same user in two different recipe. 
> I create the user in recipe A.bb and it works fine.
> Now I want to use the same user in B.bb so I add DEPENDS = "A" 
> thinking that sysroot will be
> populated with A.bb users.
> 
> But when I bitbake the recipe, user is not found. 
> I conclude that I have to use USERADD_* in each recipe, right?
> 
> What happen if I use different USERADD_PARAM_${PN} in each recipe?
> 
> I also try to use EXTRA_USERS_PARAMS but without success?
> 
> Is there a way to populate sysroot with users?
> 
> Thanks
> 
> -- 
> Fabien
> -- 

When I have this issue I just make a separate recipe that creates the 
user, and have all the other recipes depend on it.
That way the user is always created with the same parameters, without 
possibility of getting out of sync.

[-- Attachment #2: Type: text/html, Size: 1114 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-10 22:31 ` Aaron_Wright
@ 2017-10-11  6:45   ` Fabien Lahoudere
  2017-10-11  8:54     ` Burton, Ross
  0 siblings, 1 reply; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11  6:45 UTC (permalink / raw)
  To: Aaron_Wright, yocto

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

On Tue, 2017-10-10 at 15:31 -0700, Aaron_Wright@selinc.com wrote:
> > Hi
> 
> > 
> 
> > I want to use the same user in two different recipe. 
> 
> > I create the user in recipe A.bb and it works fine.
> 
> > Now I want to use the same user in B.bb so I add DEPENDS = "A"
> 
> 
> > thinking that sysroot will be
> 
> > populated with A.bb users.
> 
> > 
> 
> > But when I bitbake the recipe, user is not found. 
> 
> > I conclude that I have to use USERADD_* in each recipe, right?
> 
> > 
> 
> > What happen if I use different USERADD_PARAM_${PN} in each recipe?
> 
> > 
> 
> > I also try to use EXTRA_USERS_PARAMS but without success?
> 
> > 
> 
> > Is there a way to populate sysroot with users?
> 
> > 
> 
> > Thanks
> 
> > 
> 
> > -- 
> 
> > Fabien
> 
> > -- 
> 
> 
> 
> When I have this issue I just make a separate recipe
> that creates the user, and have all the other recipes depend on it.
> 
> That way the user is always created with the same
> parameters, without possibility of getting out of sync.

Thanks Aaron

Yes it is exactly what we do before with morty but now we use pyro and the sysroot is per recipe and
not common to all recipe.
And I search in the sysroot and the users created in recipe A are not applied to /etc/passwd.

[-- Attachment #2: Type: text/html, Size: 1556 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11  6:45   ` Fabien Lahoudere
@ 2017-10-11  8:54     ` Burton, Ross
  2017-10-11  9:10       ` Fabien Lahoudere
  0 siblings, 1 reply; 16+ messages in thread
From: Burton, Ross @ 2017-10-11  8:54 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

Both of your recipes will need to depend on the user-creating recipe.

Ross

On 11 October 2017 at 07:45, Fabien Lahoudere <
fabien.lahoudere@collabora.co.uk> wrote:

> On Tue, 2017-10-10 at 15:31 -0700, Aaron_Wright@selinc.com wrote:
>
> > Hi
> >
> > I want to use the same user in two different recipe.
> > I create the user in recipe A.bb and it works fine.
> > Now I want to use the same user in B.bb so I add DEPENDS = "A"
> > thinking that sysroot will be
> > populated with A.bb users.
> >
> > But when I bitbake the recipe, user is not found.
> > I conclude that I have to use USERADD_* in each recipe, right?
> >
> > What happen if I use different USERADD_PARAM_${PN} in each recipe?
> >
> > I also try to use EXTRA_USERS_PARAMS but without success?
> >
> > Is there a way to populate sysroot with users?
> >
> > Thanks
> >
> > --
> > Fabien
> > --
>
> When I have this issue I just make a separate recipe that creates the
> user, and have all the other recipes depend on it.
> That way the user is always created with the same parameters, without
> possibility of getting out of sync.
>
>
> Thanks Aaron
>
> Yes it is exactly what we do before with morty but now we use pyro and the
> sysroot is per recipe and not common to all recipe.
> And I search in the sysroot and the users created in recipe A are not
> applied to /etc/passwd.
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>

[-- Attachment #2: Type: text/html, Size: 2438 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11  8:54     ` Burton, Ross
@ 2017-10-11  9:10       ` Fabien Lahoudere
  2017-10-11  9:13         ` Burton, Ross
  2017-10-11  9:16         ` Fabien Lahoudere
  0 siblings, 2 replies; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11  9:10 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 4937 bytes --]

Thanks Ross
The problem is that it fails with Pyro and also with oe-core master:
I use recipe in meta-skeleton/recipes-skeleton/useradd/ to create users and the following
testuser.bb:
--------------------------------------------------------testuser.bb---------------------------------
-----------------------SUMMARY = ""DESCRIPTION = ""PR = "r1"LICENSE = "MIT"LIC_FILES_CHKSUM =
"file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
DEPENDS += " useradd-example "
SRC_URI = " "
S = "${WORKDIR}"
do_install () {	install -d -m 755 ${D}${datadir}/testuser1	echo hello >
${D}${datadir}/testuser1/file	chown -R user1 ${D}${datadir}/testuser1}
FILES_${PN} = "${datadir}/testuser1/* "-------------------------------------------------------------
--------------------------------------------------------------
and I have the following error and users are not populated in testuser recipe-sysroot/etc/passwd
ERROR: testuser-1.0-r1 do_install: Function failed: do_install (log file is located at
/home/aragua/src/oe-core/build/tmp-glibc/work/cortexa9hf-neon-oe-linux-gnueabi/testuser/1.0-
r1/temp/log.do_install.26924)ERROR: Logfile of failure stored in: /home/aragua/src/oe-
core/build/tmp-glibc/work/cortexa9hf-neon-oe-linux-gnueabi/testuser/1.0-
r1/temp/log.do_install.26924Log data follows:| DEBUG: Executing python function
extend_recipe_sysroot| NOTE: Direct dependencies are ['/home/aragua/src/oe-core/build/../meta-
coerd/recipes-test/useradd/useradd-example.bb:do_populate_sysroot',
'virtual:native:/home/aragua/src/oe-core/meta/recipes-
devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/aragua/src/oe-core/meta/recipes-
core/glibc/glibc_2.26.bb:do_populate_sysroot', '/home/aragua/src/oe-core/meta/recipes-
devtools/gcc/gcc-runtime_7.2.bb:do_populate_sysroot', '/home/aragua/src/oe-core/meta/recipes-
devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', '/home/aragua/src/oe-core/meta/recipes-
devtools/gcc/gcc-cross_7.2.bb:do_populate_sysroot']| NOTE: Installed into sysroot: ['pseudo-
native']| NOTE: Skipping as already exists in sysroot: ['useradd-example', 'glibc', 'gcc-runtime',
'quilt-native', 'gcc-cross-arm', 'shadow', 'base-files', 'base-passwd', 'shadow-sysroot', 'linux-
libc-headers', 'libgcc', 'xz-native', 'texinfo-dummy-native', 'binutils-cross-arm', 'gmp-native',
'libtool-native', 'zlib-native', 'libmpc-native', 'gnu-config-native', 'automake-native', 'mpfr-
native', 'autoconf-native', 'opkg-utils', 'attr', 'gettext-minimal-native', 'flex-native', 'bison-
native', 'm4-native']| DEBUG: Python function extend_recipe_sysroot finished| DEBUG: Executing shell
function do_install| chown: invalid user: ‘user1’| WARNING: exit code 1 from a shell command.|
ERROR: Function failed: do_install (log file is located at /home/aragua/src/oe-core/build/tmp-
glibc/work/cortexa9hf-neon-oe-linux-gnueabi/testuser/1.0-r1/temp/log.do_install.26924)
Thanks
On Wed, 2017-10-11 at 09:54 +0100, Burton, Ross wrote:
> Both of your recipes will need to depend on the user-creating recipe.
> Ross
> On 11 October 2017 at 07:45, Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> wrote:
> > On Tue, 2017-10-10 at 15:31 -0700, Aaron_Wright@selinc.com wrote:
> > > > Hi
> > > 
> > > > 
> > > 
> > > > I want to use the same user in two different recipe. 
> > > 
> > > > I create the user in recipe A.bb and it works fine.
> > > 
> > > > Now I want to use the same user in B.bb so I add DEPENDS = "A"
> > > 
> > > 
> > > > thinking that sysroot will be
> > > 
> > > > populated with A.bb users.
> > > 
> > > > 
> > > 
> > > > But when I bitbake the recipe, user is not found. 
> > > 
> > > > I conclude that I have to use USERADD_* in each recipe, right?
> > > 
> > > > 
> > > 
> > > > What happen if I use different USERADD_PARAM_${PN} in each recipe?
> > > 
> > > > 
> > > 
> > > > I also try to use EXTRA_USERS_PARAMS but without success?
> > > 
> > > > 
> > > 
> > > > Is there a way to populate sysroot with users?
> > > 
> > > > 
> > > 
> > > > Thanks
> > > 
> > > > 
> > > 
> > > > -- 
> > > 
> > > > Fabien
> > > 
> > > > -- 
> > > 
> > > 
> > > 
> > > When I have this issue I just make a separate recipe
> > > that creates the user, and have all the other recipes depend on it.
> > > 
> > > That way the user is always created with the same
> > > parameters, without possibility of getting out of sync.
> > 
> > Thanks Aaron
> > 
> > Yes it is exactly what we do before with morty but now we use pyro and the sysroot is per recipe
> > and not common to all recipe.
> > And I search in the sysroot and the users created in recipe A are not applied to /etc/passwd.
> > --
> > 
> > _______________________________________________
> > 
> > yocto mailing list
> > 
> > yocto@yoctoproject.org
> > 
> > https://lists.yoctoproject.org/listinfo/yocto
> > 
> > 
-- 
Fabien

[-- Attachment #2: Type: text/html, Size: 6014 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11  9:10       ` Fabien Lahoudere
@ 2017-10-11  9:13         ` Burton, Ross
  2017-10-11  9:16         ` Fabien Lahoudere
  1 sibling, 0 replies; 16+ messages in thread
From: Burton, Ross @ 2017-10-11  9:13 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 5065 bytes --]

Looks like the useradd-example recipe isn't working properly. Check the
contents of the files in the sysroot to see if it did the right thing, and
for errors in the recipe's logs.

On 11 October 2017 at 10:10, Fabien Lahoudere <
fabien.lahoudere@collabora.co.uk> wrote:

> Thanks Ross
>
> The problem is that it fails with Pyro and also with oe-core master:
>
> I use recipe in meta-skeleton/recipes-skeleton/useradd/ to create users
> and the following testuser.bb:
>
> --------------------------------------------------------
> testuser.bb--------------------------------------------------------
> SUMMARY = ""
> DESCRIPTION = ""
> PR = "r1"
> LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=
> 3da9cfbcb788c80a0384361b4de20420"
>
> DEPENDS += " useradd-example "
>
> SRC_URI = " "
>
> S = "${WORKDIR}"
>
> do_install () {
> install -d -m 755 ${D}${datadir}/testuser1
> echo hello > ${D}${datadir}/testuser1/file
> chown -R user1 ${D}${datadir}/testuser1
> }
>
> FILES_${PN} = "${datadir}/testuser1/* "
> ------------------------------------------------------------
> ---------------------------------------------------------------
>
> and I have the following error and users are not populated in testuser
> recipe-sysroot/etc/passwd
>
> ERROR: testuser-1.0-r1 do_install: Function failed: do_install (log file
> is located at /home/aragua/src/oe-core/build/tmp-glibc/work/
> cortexa9hf-neon-oe-linux-gnueabi/testuser/1.0-r1/temp/
> log.do_install.26924)
> ERROR: Logfile of failure stored in: /home/aragua/src/oe-core/
> build/tmp-glibc/work/cortexa9hf-neon-oe-linux-
> gnueabi/testuser/1.0-r1/temp/log.do_install.26924
> Log data follows:
> | DEBUG: Executing python function extend_recipe_sysroot
> | NOTE: Direct dependencies are ['/home/aragua/src/oe-core/
> build/../meta-coerd/recipes-test/useradd/useradd-example.bb:do_populate_sysroot',
> 'virtual:native:/home/aragua/src/oe-core/meta/recipes-
> devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot',
> '/home/aragua/src/oe-core/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot',
> '/home/aragua/src/oe-core/meta/recipes-devtools/gcc/gcc-runtime_7.2.bb:
> do_populate_sysroot', '/home/aragua/src/oe-core/
> meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot',
> '/home/aragua/src/oe-core/meta/recipes-devtools/gcc/gcc-cross_7.2.bb:
> do_populate_sysroot']
> | NOTE: Installed into sysroot: ['pseudo-native']
> | NOTE: Skipping as already exists in sysroot: ['useradd-example',
> 'glibc', 'gcc-runtime', 'quilt-native', 'gcc-cross-arm', 'shadow',
> 'base-files', 'base-passwd', 'shadow-sysroot', 'linux-libc-headers',
> 'libgcc', 'xz-native', 'texinfo-dummy-native', 'binutils-cross-arm',
> 'gmp-native', 'libtool-native', 'zlib-native', 'libmpc-native',
> 'gnu-config-native', 'automake-native', 'mpfr-native', 'autoconf-native',
> 'opkg-utils', 'attr', 'gettext-minimal-native', 'flex-native',
> 'bison-native', 'm4-native']
> | DEBUG: Python function extend_recipe_sysroot finished
> | DEBUG: Executing shell function do_install
> | chown: invalid user: ‘user1’
> | WARNING: exit code 1 from a shell command.
> | ERROR: Function failed: do_install (log file is located at
> /home/aragua/src/oe-core/build/tmp-glibc/work/cortexa9hf-neon-oe-linux-
> gnueabi/testuser/1.0-r1/temp/log.do_install.26924)
>
> Thanks
>
>
> On Wed, 2017-10-11 at 09:54 +0100, Burton, Ross wrote:
>
> Both of your recipes will need to depend on the user-creating recipe.
>
> Ross
>
> On 11 October 2017 at 07:45, Fabien Lahoudere <fabien.lahoudere@collabora.
> co.uk> wrote:
>
> On Tue, 2017-10-10 at 15:31 -0700, Aaron_Wright@selinc.com wrote:
>
> > Hi
> >
> > I want to use the same user in two different recipe.
> > I create the user in recipe A.bb and it works fine.
> > Now I want to use the same user in B.bb so I add DEPENDS = "A"
> > thinking that sysroot will be
> > populated with A.bb users.
> >
> > But when I bitbake the recipe, user is not found.
> > I conclude that I have to use USERADD_* in each recipe, right?
> >
> > What happen if I use different USERADD_PARAM_${PN} in each recipe?
> >
> > I also try to use EXTRA_USERS_PARAMS but without success?
> >
> > Is there a way to populate sysroot with users?
> >
> > Thanks
> >
> > --
> > Fabien
> > --
>
> When I have this issue I just make a separate recipe that creates the
> user, and have all the other recipes depend on it.
> That way the user is always created with the same parameters, without
> possibility of getting out of sync.
>
>
> Thanks Aaron
>
> Yes it is exactly what we do before with morty but now we use pyro and the
> sysroot is per recipe and not common to all recipe.
> And I search in the sysroot and the users created in recipe A are not
> applied to /etc/passwd.
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
> --
>
> Fabien
>

[-- Attachment #2: Type: text/html, Size: 7330 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11  9:10       ` Fabien Lahoudere
  2017-10-11  9:13         ` Burton, Ross
@ 2017-10-11  9:16         ` Fabien Lahoudere
  2017-10-11 10:06           ` Henrik Lindblom
  1 sibling, 1 reply; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11  9:16 UTC (permalink / raw)
  To: ross.burton; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

FI, with bitbake testuser -c devshell

# cat ../1.0-r1/recipe-sysroot/etc/passwd 
root::0:0:root:/root:/bin/sh
daemon:*:1:1:daemon:/usr/sbin:/bin/sh
bin:*:2:2:bin:/bin:/bin/sh
sys:*:3:3:sys:/dev:/bin/sh
sync:*:4:65534:sync:/bin:/bin/sync
games:*:5:60:games:/usr/games:/bin/sh
man:*:6:12:man:/var/cache/man:/bin/sh
lp:*:7:7:lp:/var/spool/lpd:/bin/sh
mail:*:8:8:mail:/var/mail:/bin/sh
news:*:9:9:news:/var/spool/news:/bin/sh
uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:*:13:13:proxy:/bin:/bin/sh
www-data:*:33:33:www-data:/var/www:/bin/sh
backup:*:34:34:backup:/var/backups:/bin/sh
list:*:38:38:Mailing List Manager:/var/list:/bin/sh
irc:*:39:39:ircd:/var/run/ircd:/bin/sh
gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:*:65534:65534:nobody:/nonexistent:/bin/sh

Users are not found

[-- Attachment #2: Type: text/html, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11  9:16         ` Fabien Lahoudere
@ 2017-10-11 10:06           ` Henrik Lindblom
  2017-10-11 10:18             ` Fabien Lahoudere
  0 siblings, 1 reply; 16+ messages in thread
From: Henrik Lindblom @ 2017-10-11 10:06 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS
implies build time dependencies (e.g. libraries) while RDEPENDS actually
gets the component installed as a runtime dependency.

On Wed, Oct 11, 2017 at 12:16 PM, Fabien Lahoudere <
fabien.lahoudere@collabora.co.uk> wrote:

> FI, with bitbake testuser -c devshell
>
> # cat ../1.0-r1/recipe-sysroot/etc/passwd
> root::0:0:root:/root:/bin/sh
> daemon:*:1:1:daemon:/usr/sbin:/bin/sh
> bin:*:2:2:bin:/bin:/bin/sh
> sys:*:3:3:sys:/dev:/bin/sh
> sync:*:4:65534:sync:/bin:/bin/sync
> games:*:5:60:games:/usr/games:/bin/sh
> man:*:6:12:man:/var/cache/man:/bin/sh
> lp:*:7:7:lp:/var/spool/lpd:/bin/sh
> mail:*:8:8:mail:/var/mail:/bin/sh
> news:*:9:9:news:/var/spool/news:/bin/sh
> uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
> proxy:*:13:13:proxy:/bin:/bin/sh
> www-data:*:33:33:www-data:/var/www:/bin/sh
> backup:*:34:34:backup:/var/backups:/bin/sh
> list:*:38:38:Mailing List Manager:/var/list:/bin/sh
> irc:*:39:39:ircd:/var/run/ircd:/bin/sh
> gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
> nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
>
>
> Users are not found
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>

[-- Attachment #2: Type: text/html, Size: 2126 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 10:06           ` Henrik Lindblom
@ 2017-10-11 10:18             ` Fabien Lahoudere
  2017-10-11 11:24               ` Burton, Ross
  2017-10-11 11:37               ` Maxin B. John
  0 siblings, 2 replies; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11 10:18 UTC (permalink / raw)
  To: Henrik Lindblom; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
> I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS implies build time
> dependencies (e.g. libraries) while RDEPENDS actually gets the component installed as a runtime
> dependency.
> 

Thanks Henrik
I tried to add RDEPENDS too without success. The problem is that users and groups are not installed
IIUC.
> On Wed, Oct 11, 2017 at 12:16 PM, Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> wrote:
> > FI, with bitbake testuser -c devshell
> > 
> > # cat ../1.0-r1/recipe-sysroot/etc/passwd 
> > root::0:0:root:/root:/bin/sh
> > daemon:*:1:1:daemon:/usr/sbin:/bin/sh
> > bin:*:2:2:bin:/bin:/bin/sh
> > sys:*:3:3:sys:/dev:/bin/sh
> > sync:*:4:65534:sync:/bin:/bin/sync
> > games:*:5:60:games:/usr/games:/bin/sh
> > man:*:6:12:man:/var/cache/man:/bin/sh
> > lp:*:7:7:lp:/var/spool/lpd:/bin/sh
> > mail:*:8:8:mail:/var/mail:/bin/sh
> > news:*:9:9:news:/var/spool/news:/bin/sh
> > uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
> > proxy:*:13:13:proxy:/bin:/bin/sh
> > www-data:*:33:33:www-data:/var/www:/bin/sh
> > backup:*:34:34:backup:/var/backups:/bin/sh
> > list:*:38:38:Mailing List Manager:/var/list:/bin/sh
> > irc:*:39:39:ircd:/var/run/ircd:/bin/sh
> > gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
> > nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
> > 
> > Users are not found
> > --
> > 
> > _______________________________________________
> > 
> > yocto mailing list
> > 
> > yocto@yoctoproject.org
> > 
> > https://lists.yoctoproject.org/listinfo/yocto
> > 
> > 
-- 
Fabien

[-- Attachment #2: Type: text/html, Size: 2528 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 10:18             ` Fabien Lahoudere
@ 2017-10-11 11:24               ` Burton, Ross
  2017-10-11 11:37               ` Maxin B. John
  1 sibling, 0 replies; 16+ messages in thread
From: Burton, Ross @ 2017-10-11 11:24 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

For this you definitely want DEPENDS.  Read the do_prepare_sysroot log to
for the recipe you're building, it might have an error that isn't causing
the build to fail.

Ross

On 11 October 2017 at 11:18, Fabien Lahoudere <
fabien.lahoudere@collabora.co.uk> wrote:

> On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
>
> I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS
> implies build time dependencies (e.g. libraries) while RDEPENDS actually
> gets the component installed as a runtime dependency.
>
>
> Thanks Henrik
>
> I tried to add RDEPENDS too without success. The problem is that users and
> groups are not installed IIUC.
>
> On Wed, Oct 11, 2017 at 12:16 PM, Fabien Lahoudere <
> fabien.lahoudere@collabora.co.uk> wrote:
>
> FI, with bitbake testuser -c devshell
>
> # cat ../1.0-r1/recipe-sysroot/etc/passwd
> root::0:0:root:/root:/bin/sh
> daemon:*:1:1:daemon:/usr/sbin:/bin/sh
> bin:*:2:2:bin:/bin:/bin/sh
> sys:*:3:3:sys:/dev:/bin/sh
> sync:*:4:65534:sync:/bin:/bin/sync
> games:*:5:60:games:/usr/games:/bin/sh
> man:*:6:12:man:/var/cache/man:/bin/sh
> lp:*:7:7:lp:/var/spool/lpd:/bin/sh
> mail:*:8:8:mail:/var/mail:/bin/sh
> news:*:9:9:news:/var/spool/news:/bin/sh
> uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
> proxy:*:13:13:proxy:/bin:/bin/sh
> www-data:*:33:33:www-data:/var/www:/bin/sh
> backup:*:34:34:backup:/var/backups:/bin/sh
> list:*:38:38:Mailing List Manager:/var/list:/bin/sh
> irc:*:39:39:ircd:/var/run/ircd:/bin/sh
> gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
> nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
>
>
> Users are not found
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
> --
>
> Fabien
>

[-- Attachment #2: Type: text/html, Size: 3232 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 10:18             ` Fabien Lahoudere
  2017-10-11 11:24               ` Burton, Ross
@ 2017-10-11 11:37               ` Maxin B. John
  2017-10-11 17:17                 ` Fabien Lahoudere
  2017-10-11 17:48                 ` Fabien Lahoudere
  1 sibling, 2 replies; 16+ messages in thread
From: Maxin B. John @ 2017-10-11 11:37 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Hi Fabien,

On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
>> I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS implies build time
>> dependencies (e.g. libraries) while RDEPENDS actually gets the component installed as a runtime
>> dependency.
>> 

>Thanks Henrik
>I tried to add RDEPENDS too without success. The problem is that users and groups are not installed
>IIUC.

Could you apply this patch and see if it helps here ?

Best Regards,
Maxin

[-- Attachment #2: useradd.patch --]
[-- Type: text/plain, Size: 1432 bytes --]

From 36c75e348cd5bb3cff242783550b925623492297 Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Wed, 20 Sep 2017 18:05:49 +0300
Subject: [PATCH] sstate.bbclass: provide an exception for useradd scenario

Packages, which depend on users/groups created from other packages,
needs "shadow-native" as a build time dependency. So, add an exception
to the "shadow-native" from otherwise discarded native/cross tools
dependency.

Fixes [YOCTO #11960]

Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
 meta/classes/sstate.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 2a54993..e30fbe1 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -967,7 +967,8 @@ def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
             if isNativeCross(taskdependees[dep][0]):
                 return False
             # Native/cross tools depended upon by target sysroot are not needed
-            if isNativeCross(taskdependees[task][0]):
+            # Add an exception for shadow-native as required by useradd.bbclass
+            if isNativeCross(taskdependees[task][0]) and taskdependees[task][0] != 'shadow-native':
                 continue
             # Target populate_sysroot need their dependencies
             return False
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 11:37               ` Maxin B. John
@ 2017-10-11 17:17                 ` Fabien Lahoudere
  2017-10-11 17:48                 ` Fabien Lahoudere
  1 sibling, 0 replies; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11 17:17 UTC (permalink / raw)
  To: Maxin B. John; +Cc: yocto

Thanks a lot Maxin

Your patch fix the issue.

\o/

On Wed, 2017-10-11 at 14:37 +0300, Maxin B. John wrote:
> Hi Fabien,
> 
> On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
> > > I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS implies build time
> > > dependencies (e.g. libraries) while RDEPENDS actually gets the component installed as a
> > > runtime
> > > dependency.
> > > 
> > Thanks Henrik
> > I tried to add RDEPENDS too without success. The problem is that users and groups are not
> > installed
> > IIUC.
> 
> Could you apply this patch and see if it helps here ?
> 
> Best Regards,
> Maxin
-- 
Fabien


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 11:37               ` Maxin B. John
  2017-10-11 17:17                 ` Fabien Lahoudere
@ 2017-10-11 17:48                 ` Fabien Lahoudere
  2017-10-12  8:19                   ` Maxin B. John
  1 sibling, 1 reply; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-11 17:48 UTC (permalink / raw)
  To: Maxin B. John; +Cc: yocto

Maxin,

Is this patch submitted or applied for next release?

Thanks

On Wed, 2017-10-11 at 14:37 +0300, Maxin B. John wrote:
> Hi Fabien,
> 
> On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
> > > I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS implies build time
> > > dependencies (e.g. libraries) while RDEPENDS actually gets the component installed as a
> > > runtime
> > > dependency.
> > > 
> > Thanks Henrik
> > I tried to add RDEPENDS too without success. The problem is that users and groups are not
> > installed
> > IIUC.
> 
> Could you apply this patch and see if it helps here ?
> 
> Best Regards,
> Maxin
-- 
Fabien


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-11 17:48                 ` Fabien Lahoudere
@ 2017-10-12  8:19                   ` Maxin B. John
  0 siblings, 0 replies; 16+ messages in thread
From: Maxin B. John @ 2017-10-12  8:19 UTC (permalink / raw)
  To: Fabien Lahoudere; +Cc: yocto

Hi Fabien,

Good to know that it helps here.

On Wed, Oct 11, 2017 at 07:48:46PM +0200, Fabien Lahoudere wrote:
> Maxin,
> 
> Is this patch submitted or applied for next release?

Submitted the patch to oe-core mailing list today:
http://lists.openembedded.org/pipermail/openembedded-core/2017-October/143288.html

> Thanks
> On Wed, 2017-10-11 at 14:37 +0300, Maxin B. John wrote:
> > Hi Fabien,
> > 
> > On Wed, 2017-10-11 at 13:06 +0300, Henrik Lindblom wrote:
> > > > I think you'll want RDEPENDS instead of DEPENDS in your recipe. DEPENDS implies build time
> > > > dependencies (e.g. libraries) while RDEPENDS actually gets the component installed as a
> > > > runtime
> > > > dependency.
> > > > 
> > > Thanks Henrik
> > > I tried to add RDEPENDS too without success. The problem is that users and groups are not
> > > installed
> > > IIUC.
> > 
> > Could you apply this patch and see if it helps here ?
> > 
> > Best Regards,
> > Maxin
> -- 
> Fabien

Thanks and Regards,
Maxin


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: How to use same user in two recipes?
  2017-10-10 21:30 How to use same user in two recipes? Fabien Lahoudere
  2017-10-10 22:31 ` Aaron_Wright
@ 2019-02-11 19:40 ` Ulf Samuelsson
  1 sibling, 0 replies; 16+ messages in thread
From: Ulf Samuelsson @ 2019-02-11 19:40 UTC (permalink / raw)
  To: yocto

Den 2017-10-10 kl. 23:30, skrev Fabien Lahoudere:
> Hi
> 
> I want to use the same user in two different recipe.
> I create the user in recipe A.bb and it works fine.
> Now I want to use the same user in B.bb so I add DEPENDS = "A" thinking that sysroot will be
> populated with A.bb users.
> 
> But when I bitbake the recipe, user is not found.
> I conclude that I have to use USERADD_* in each recipe, right?
> 
> What happen if I use different USERADD_PARAM_${PN} in each recipe?
> 
> I also try to use EXTRA_USERS_PARAMS but without success?
> 
> Is there a way to populate sysroot with users?
> 
> Thanks
> 
Don't You need to RDEPEND on A?

-- 
Best Regards
Ulf Samuelsson


^ permalink raw reply	[flat|nested] 16+ messages in thread

* How to use same user in two recipes?
  2017-10-10 18:37 Replacing Openssl with a custom version? Ryan Pabis (pabisr)
@ 2017-10-10 19:54 ` Fabien Lahoudere
  0 siblings, 0 replies; 16+ messages in thread
From: Fabien Lahoudere @ 2017-10-10 19:54 UTC (permalink / raw)
  To: yocto

Hello

I want to use the same user in two different recipe. 
I create the user in recipe A.bb and it works fine.
Now I want to use the same user in B.bb so I add DEPENDS = "A" thinking that sysroot will be
populated with A.bb users.

But when I bitbake the recipe, user is not found. 
I conclude that I have to use USERADD_* in each recipe, right?

What happen if I use different USERADD_PARAM_${PN} in each recipe?

I also try to use EXTRA_USERS_PARAMS but without success?

Is there a way to populate sysroot with users?

Thanks

-- 
Fabien


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-02-11 19:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 21:30 How to use same user in two recipes? Fabien Lahoudere
2017-10-10 22:31 ` Aaron_Wright
2017-10-11  6:45   ` Fabien Lahoudere
2017-10-11  8:54     ` Burton, Ross
2017-10-11  9:10       ` Fabien Lahoudere
2017-10-11  9:13         ` Burton, Ross
2017-10-11  9:16         ` Fabien Lahoudere
2017-10-11 10:06           ` Henrik Lindblom
2017-10-11 10:18             ` Fabien Lahoudere
2017-10-11 11:24               ` Burton, Ross
2017-10-11 11:37               ` Maxin B. John
2017-10-11 17:17                 ` Fabien Lahoudere
2017-10-11 17:48                 ` Fabien Lahoudere
2017-10-12  8:19                   ` Maxin B. John
2019-02-11 19:40 ` Ulf Samuelsson
  -- strict thread matches above, loose matches on Subject: below --
2017-10-10 18:37 Replacing Openssl with a custom version? Ryan Pabis (pabisr)
2017-10-10 19:54 ` How to use same user in two recipes? Fabien Lahoudere

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.