From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id E325AE00BE8; Wed, 11 Oct 2017 02:14:14 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.214.53 listed in list.dnswl.org] * 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source * [209.85.214.53 listed in dnsbl.sorbs.net] * -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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id DAC5CE00B83 for ; Wed, 11 Oct 2017 02:14:13 -0700 (PDT) Received: by mail-it0-f53.google.com with SMTP id c3so2129841itc.3 for ; Wed, 11 Oct 2017 02:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yU0lfK8CdBMU5qCqb9QaguXGgDPC/iOPKJsWOFiWID4=; b=r/vQ2AYwSQ+Jjyp/0xfp2nu6eGG/GNUgt5015Z0ZjJ3hL95btiTebJKh13Q/RbC74h UtQOiPGNl00oQz+JaPfNSFpfj3zN7kWstAKCq/B3Md7XYy1MsYfNRdSYAt+1M7U+D2z0 Qvf8WRh1PlYgfpM/xGdglQMM6aStI6kKuSRcwbWymJ4kf50FSfEsNMS+6Uu5P4bDm6tV y9H51hLvakyiP+eD8vuF5YLHEwImqQ6F0zB0njx2Q4fcJnPftO+erbPpm0/a3Sm1reRH YrNQfU6ETuJzupCvK+jqmcL94zr06MvHRbOhpoGAx0f4Pal1qecYG9ML1gXYaLHjp/ap RXIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yU0lfK8CdBMU5qCqb9QaguXGgDPC/iOPKJsWOFiWID4=; b=hmdwLA5I1hQvRYblKi+TPDrHQAAbPzSsoyny8i5qPfUiibP3okrDZ9klIiss3RrPlv RD9mX8ZcKe9jsdkaz7q04tWANAn7ljyYK+E+peDVpR/g17DcOxuqfvlFDJi/o6+5qFdc MLyyJn5AKA46eWsg//PU2MomXLDuRjwjtV67TUBVakzjj4b44Tlh7vonf/1wmso7rx6n vF+LDjTgPSw+cDaAa6I+a7zYzCF+E0cIJ47Se6nS0L3zBF2NHg9woNDsCYLKctwA6hnh 4WvbtD9W5DfwDeO7BGxzU1Dh3zkSw1DFzZH8TFPZ2NP8vlolX772lKqI5smJtYQ5apis iljQ== X-Gm-Message-State: AMCzsaU34zQifbF0ekZyVq9w/PAe+4FtOfeRzJqvvZLJUznFg4qGyqAG 1h3C2kPeCgIjhDGQANL9gWfENR48YILlJ5YVbtOVxw== X-Google-Smtp-Source: AOwi7QBs0fhJSr+LDP83sehSyTwwfFPbXtCitOpOEWmVNgL3d7Hdg9jWtBBXGnXcXuggxTddoNr6uVfGx0LbrVpC5Xg= X-Received: by 10.36.150.4 with SMTP id z4mr23445913itd.48.1507713253010; Wed, 11 Oct 2017 02:14:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.162.205 with HTTP; Wed, 11 Oct 2017 02:13:52 -0700 (PDT) In-Reply-To: <1507713002.9509.25.camel@collabora.co.uk> References: <1507671003.9509.21.camel@collabora.co.uk> <1507704333.9509.23.camel@collabora.co.uk> <1507713002.9509.25.camel@collabora.co.uk> From: "Burton, Ross" Date: Wed, 11 Oct 2017 10:13:52 +0100 Message-ID: To: Fabien Lahoudere 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:14:14 -0000 Content-Type: multipart/alternative; boundary="94eb2c07ea98de9611055b41d8b9" --94eb2c07ea98de9611055b41d8b9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D "" > DESCRIPTION =3D "" > PR =3D "r1" > LICENSE =3D "MIT" > LIC_FILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D > 3da9cfbcb788c80a0384361b4de20420" > > DEPENDS +=3D " useradd-example " > > SRC_URI =3D " " > > S =3D "${WORKDIR}" > > do_install () { > install -d -m 755 ${D}${datadir}/testuser1 > echo hello > ${D}${datadir}/testuser1/file > chown -R user1 ${D}${datadir}/testuser1 > } > > FILES_${PN} =3D "${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_s= ysroot', > '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_popula= te_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: =E2=80=98user1=E2=80=99 > | 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 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 =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 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 th= e > 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 > --94eb2c07ea98de9611055b41d8b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Looks like the useradd-example recipe isn't working pr= operly. 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, Fab= ien Lahoudere <fabien.lahoudere@collabora.co.uk> wrote:
Thanks Ross

The problem is that it fails with Pyro and also with oe-co= re master:

I use recipe in meta-skeleton/recipes-<= wbr>skeleton/useradd/ to create users and the following testuser.bb:

---= -----------------------------------------------------testuser.bb-= -------------------------------------------------------
SUMMARY =3D ""
DESCRIPTION =3D ""
= PR =3D "r1"
LICENSE =3D "MIT"
LIC_F= ILES_CHKSUM =3D "file://${COREBASE}/meta/COPYING.MIT;md5=3D3= da9cfbcb788c80a0384361b4de20420"

DEPENDS= +=3D " useradd-example "

SRC_URI =3D &q= uot; "

S =3D "${WORKDIR}"

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

FILES_${PN} =3D "${datadir}/testuser1/* "
-------= -----------------------------------------------------------------= ---------------------------------------------------
and I have the following error and users are not populated in t= estuser recipe-sysroot/etc/passwd

ERROR: testuser-= 1.0-r1 do_install: Function failed: do_install (log file is located at /hom= e/aragua/src/oe-core/build/tmp-glibc/work/cortexa9hf-neon-oe-linu= x-gnueabi/testuser/1.0-r1/temp/log.do_install.26924)
ER= ROR: 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: Ex= ecuting python function extend_recipe_sysroot
| NOTE: Direct depe= ndencies are ['/home/aragua/src/oe-core/build/../meta-coerd/recipe= s-test/useradd/useradd-example.bb:do_populate_sysroot', '= virtual:native:/home/aragua/src/oe-core/meta/recipes-devtools/pse= udo/pseudo_1.8.2.bb:do_populate_sysroot', '/home/aragua/src/oe= -core/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot&#= 39;, '/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_populat= e_sysroot', '/home/aragua/src/oe-core/meta/recipes-devtools/gc= c/gcc-cross_7.2.bb:do_populate_sysroot']
| NOTE: In= stalled into sysroot: ['pseudo-native']
| NOTE: Skipping = as already exists in sysroot: ['useradd-example', 'glibc', = 'gcc-runtime', 'quilt-native', 'gcc-cross-arm', = 9;shadow', 'base-files', 'base-passwd', 'shadow-sys= root', 'linux-libc-headers', 'libgcc', 'xz-native&#= 39;, 'texinfo-dummy-native', 'binutils-cross-arm', 'gmp= -native', 'libtool-native', 'zlib-native', 'libmpc-= native', 'gnu-config-native', 'automake-native', 'm= pfr-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_ins= tall
| chown: invalid user: =E2=80=98user1=E2=80=99
| W= ARNING: exit code 1 from a shell command.
| ERROR: Function faile= d: do_install (log file is located at /home/aragua/src/oe-core/build/t= mp-glibc/work/cortexa9hf-neon-oe-linux-gnueabi/testuser/1.0-r1/te= mp/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.=C2=A0
> 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&q= uot;
> thinking that sysroot will be
> populated with A.bb users.
>
> But when I bitbake the recipe, user is not found.=C2=A0
> 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@yoctoproj= ect.org
https://lists.yoctoproject.org/listinfo/yocto<= br>

-- 
Fabien

--94eb2c07ea98de9611055b41d8b9--