Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id A5B63E00C9F; Wed, 11 Oct 2017 02:10:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [46.235.227.227 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 7592FE00CB6 for ; Wed, 11 Oct 2017 02:10:07 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aragua) with ESMTPSA id 1912726DA35 Message-ID: <1507713002.9509.25.camel@collabora.co.uk> From: Fabien Lahoudere To: "Burton, Ross" Date: Wed, 11 Oct 2017 11:10:02 +0200 In-Reply-To: References: <1507671003.9509.21.camel@collabora.co.uk> <1507704333.9509.23.camel@collabora.co.uk> X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Cc: "yocto@yoctoproject.org" Subject: Re: How to use same user in two recipes? X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 09:10:15 -0000 Content-Type: multipart/alternative; boundary="=-CeDgum2twCAg+Guh/P92" --=-CeDgum2twCAg+Guh/P92 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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 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 --=-CeDgum2twCAg+Guh/P92 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Thanks Ross

The prob= lem is that it fails with Pyro and also with oe-core master:

=
I use recipe in meta-skeleton/recipes-skeleton/useradd/ to creat= e users and the following testuser.bb:

-----------= ---------------------------------------------testuser.bb-------------------= -------------------------------------
SUMMARY =3D ""
DE= SCRIPTION =3D ""
PR =3D "r1"
LICENSE =3D "MIT"
LIC_FILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D3da9cfbcb= 788c80a0384361b4de20420"

DEPENDS +=3D " useradd-ex= ample "

SRC_URI =3D " "

S= =3D "${WORKDIR}"

do_install () {
insta= ll -d -m 755 ${D}${datadir}/testuser1
echo hello > ${D}${data= dir}/testuser1/file
chown -R user1 ${D}${datadir}/testuser1
}

FILES_${PN} =3D "${datadir}/testuser1/* "<= /div>
-----------------------------------------------------------------= ----------------------------------------------------------

and I have the following error and users are not populated in test= user recipe-sysroot/etc/passwd

ERROR: testuser-1.0= -r1 do_install: Function failed: do_install (log file is located at /home/a= ragua/src/oe-core/build/tmp-glibc/work/cortexa9hf-neon-oe-linux-gnueabi/tes= tuser/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-o= e-linux-gnueabi/testuser/1.0-r1/temp/log.do_install.26924
Log dat= a follows:
| DEBUG: Executing python function extend_recipe_sysro= ot
| NOTE: Direct dependencies are ['/home/aragua/src/oe-core/bui= ld/../meta-coerd/recipes-test/useradd/useradd-example.bb:do_populate_sysroo= t', 'virtual:native:/home/aragua/src/oe-core/meta/recipes-devtools/pseudo/p= seudo_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/m= eta/recipes-devtools/gcc/gcc-runtime_7.2.bb:do_populate_sysroot', '/home/ar= agua/src/oe-core/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_popula= te_sysroot', '/home/aragua/src/oe-core/meta/recipes-devtools/gcc/gcc-cross_= 7.2.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: ['ps= eudo-native']
| NOTE: Skipping as already exists in sysroot: ['us= eradd-example', 'glibc', 'gcc-runtime', 'quilt-native', 'gcc-cross-arm', 's= hadow', '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-nat= ive', 'automake-native', 'mpfr-native', 'autoconf-native', 'opkg-utils', 'a= ttr', 'gettext-minimal-native', 'flex-native', 'bison-native', 'm4-native']=
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| chown: invalid u= ser: =E2=80=98user1=E2=80=99
| WARNING: exit code 1 from a shell = command.
| ERROR: Function failed: do_install (log file is locate= d 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:5= 4 +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_W= right@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 =3D "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 reci= pe that creates the user, and have all the other recipes depend on it.<= /tt>
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/pa= sswd.

--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto<= br>

-- 
Fabi= en
--=-CeDgum2twCAg+Guh/P92--