How to use same user in two recipes?
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
Signature · 1 line
Fabien
Quoted 11 lines
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?
Quoted 11 lines
What happen if I use different USERADD_PARAM_${PN} in each recipe?
I also try to use
EXTRA_USERS_PARAMSbut without success?Is there a way to populate sysroot with users?
Thanks
Signature · 2 lines
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.
Quoted 47 lines · On Tue, 2017-10-10 at 15:31 -0700, [email protected] wrote:
Quoted 37 lines
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_PARAMSbut without success?Is there a way to populate sysroot with users?
Thanks
Quoted 7 lines
--
Fabien
--
Quoted 5 lines
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.
Both of your recipes will need to depend on the user-creating recipe.
Ross
Quoted 45 lines · Fabien Lahoudere
Quoted 15 lines · On Tue, 2017-10-10 at 15:31 -0700, [email protected] 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_PARAMSbut without success?Quoted 7 lines
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
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
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
Quoted 73 lines · Ross
Both of your recipes will need to depend on the user-creating recipe. Ross
Quoted 70 lines · Fabien Lahoudere
Quoted 47 lines · On Tue, 2017-10-10 at 15:31 -0700, [email protected] wrote:
Quoted 37 lines
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_PARAMSbut without success?Is there a way to populate sysroot with users?
Thanks
Quoted 7 lines
--
Fabien
--
Quoted 5 lines
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
--
Fabien
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.
Quoted 132 lines · Fabien Lahoudere
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 functionextend_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:
Quoted 15 lines · On Tue, 2017-10-10 at 15:31 -0700, [email protected] 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_PARAMSbut without success?Quoted 7 lines
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
[email protected]
https://lists.yoctoproject.org/listinfo/yocto--
Fabien
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
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.
Quoted 33 lines · Fabien Lahoudere
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/shUsers are not found
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Quoted 4 lines · Henrik Lindblom
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.
Quoted 28 lines · Fabien Lahoudere
Quoted 27 lines
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/shUsers are not found
--_______________________________________________
Quoted 7 lines
Quoted 7 lines
yocto mailing list
--
Fabien
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
Quoted 52 lines · Fabien Lahoudere
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 < [email protected]> 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/shUsers are not found
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto--
Fabien
Hi Fabien,
Quoted 8 lines · Henrik Lindblom
Quoted 4 lines
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
From 36c75e348cd5bb3cff242783550b925623492297 Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <[email protected]>
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]
--- meta/classes/sstate.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/sstate.bbclass +2 -1
@@ -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
Signature · 1 line
2.4.0
Thanks a lot Maxin
Your patch fix the issue.
\o/
Quoted 17 lines · Maxin B. John
Hi Fabien,
Quoted 9 lines · Henrik Lindblom
Quoted 5 lines
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
Signature · 1 line
Fabien
Maxin,
Is this patch submitted or applied for next release?
Thanks
Quoted 17 lines · Maxin B. John
Hi Fabien,
Quoted 9 lines · Henrik Lindblom
Quoted 5 lines
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
Signature · 1 line
Fabien
Hi Fabien,
Good to know that it helps here.
Quoted 3 lines · Fabien Lahoudere
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
Quoted 15 lines
Thanks
Quoted 13 lines · Maxin B. John
Hi Fabien,
Quoted 9 lines · Henrik Lindblom
Quoted 5 lines
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.
Quoted 6 lines
Quoted 4 lines
Could you apply this patch and see if it helps here ?
Best Regards,
MaxinSignature · 1 line
Fabien
Thanks and Regards,
Maxin
Den 2017-10-10 kl. 23:30, skrev Fabien Lahoudere:
Quoted 10 lines
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?
Quoted 8 lines
What happen if I use different USERADD_PARAM_${PN} in each recipe?
I also try to use
EXTRA_USERS_PARAMSbut without success?Is there a way to populate sysroot with users?
Thanks
Don't You need to RDEPEND on A?
Signature · 2 lines
Best Regards Ulf Samuelsson