Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E635C433EF for ; Mon, 22 Nov 2021 08:15:50 +0000 (UTC) Subject: Useradd recipe not generating /etc/passwd entries #dunfell To: yocto@lists.yoctoproject.org From: taylor.winning@fundamentals-group.com X-Originating-Location: Perth, Western Australia, AU (110.145.30.150) X-Originating-Platform: Windows Firefox 95 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 22 Nov 2021 00:15:49 -0800 Message-ID: Content-Type: multipart/alternative; boundary="8kECA91v9w1FWkSv7SLh" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 22 Nov 2021 08:15:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/55380 --8kECA91v9w1FWkSv7SLh Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I=E2=80=99m attempting to create a few service users for our software produ= cts. Initially I had inherited useradd in each recipe that required the use= r, then had a corresponding user added from within the image recipe. I know= this is not ideal, however I have been unable to solve some issues I=E2=80= =99m having so I=E2=80=99m hoping someone can help. I'm on Dunfell branch. I now have a recipe that creates two users, that all other recipes DEPENDS = on. Here is the contents of that recipe (adh-user-add.bb): FILESEXTRAPATHS_prepend :=3D "${THISDIR}:" SUMMARY =3D "Add adh and adhX user for other recipes" LICENSE=3D"CLOSED" PV =3D "${ADH_ADH_SVN_REVISION}" require require/revisions.inc PACKAGE_ARCH =3D "${MACHINE_ARCH}" inherit useradd USERADD_PACKAGES =3D "${PN}" USERADD_PARAM_${PN} =3D "--system --uid 420 -g adh adh; --system --uid 421 = -g adhX adhX " GROUPADD_PARAM_${PN} =3D "-g 420 adh; -g 421 adhX " Each recipe that needs these users simply DEPENDS on it from within its own= recipe. I understand that is the preferred way of doing this? However, inside my image (development-image.bb) once its built, my /etc/pas= swd file does not contain these users at all. I have tried the following th= ings: * IMAGE_INSTALL_append +=3D =E2=80=9C adh-user-add=E2=80=9D * DEPENDS +=3D =E2=80=9C adh-user-add=E2=80=9D * RDEPENDS +=3D =E2=80=9C adh-user-add=E2=80=9D Each time I get a passwd file inside of adh-user-add/recipe-sysroots and de= velopment-image/recipe-sysroots that contains both users, however the passw= d file on the device is missing those users entirely. My image recipe looks like this: SUMMARY =3D "Development image" inherit core-image extrausers require require/revisions.inc PV =3D "${CUBE_IMAGE_VERSION}" PR =3D "${CUBE_IMAGE_REVISION}" IMAGE_FSTYPES_append +=3D "wic wic.xz" WKS_FILE =3D "sgc30cube.wks" IMAGE_INSTALL =3D "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL} " IMAGE_INSTALL_append =3D " \ *** packages removed *** " IMAGE_FEATURES_append =3D " ssh-server-dropbear" MACHINE_FEATURES_remove =3D "kernel26 nc screen ext2 alsa gpu touchscreen q= emu-usermode" DEPENDS +=3D "adh-user-add" IMAGE_FEATURES_append =3D " debug-tweaks" I feel like I'm going crazy trying to figure this out. I wish I could figur= e out how the final passwd file is generated. I've looked in some logs that= I've seen suggested online, but have been unable to ascertain if there are= any errors occurring. Any help would be greatly appreciated, Thanks, Taylor W --8kECA91v9w1FWkSv7SLh Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi,

I=E2=80=99m attempti= ng to create a few service users for our software products. Initially I had= inherited useradd in each recipe that required the user, then had a corres= ponding user added from within the image recipe. I know this is not ideal, = however I have been unable to solve some issues I=E2=80=99m having so I=E2= =80=99m hoping someone can help.

I'm on Dunfell branch.
<= br/>I now have a recipe that creates two users, that all other recipes DEPE= NDS on. Here is the contents of that recipe (adh-user-add.bb):

=C2=A0

FILESEXTRAPATHS_prepend :=3D "${THI= SDIR}:"

SUMMARY =3D "Add adh and adhX user = for other recipes"

LICENSE=3D"CLOSED"

PV =3D "${ADH_ADH_SVN_REVISION}"= ;

require require/revisions.inc

PACKAGE_ARCH =3D "${MACHINE_ARCH}&#= 34;

=C2=A0

inherit useradd

=C2=A0

USERADD_PACKAGES =3D "${PN}"

USERADD_PARAM_${PN} =3D "--system -= -uid 420 -g adh adh; --system --uid 421 -g adhX adhX "

GROUPADD_PARAM_${PN} =3D "-g 420 ad= h; -g 421 adhX "

=C2=A0

Each recipe that needs= these users simply DEPENDS on it from within its own recipe. I understand = that is the preferred way of doing this?

=C2=A0

However, inside my ima= ge (development-image.bb) once its built, my /etc/passwd file does not cont= ain these users at all. I have tried the following things:

=C2=A0

  1. IMAGE_INSTALL_append +=3D =E2=80=9C adh-user-add=E2=80=9D
  2. DEPENDS +=3D =E2=80=9C adh-user-add=E2=80=9D
  3. RDEPENDS +=3D =E2=80=9C adh-user-add=E2=80=9D

=C2=A0

Each time I get a pass= wd file inside of adh-user-add/recipe-sysroots and development-image/recipe= -sysroots that contains both users, however the passwd file on the device i= s missing those users entirely.

=C2=A0

My image recipe looks = like this:

=C2=A0

SUMMARY =3D "Development image"=

inherit core-image extrausers

require require/revisions.inc

=C2=A0

PV =3D "${CUBE_IMAGE_VERSION}"<= /span>

PR =3D "${CUBE_IMAGE_REVISION}"=

=C2=A0

IMAGE_FSTYPES_append +=3D "wic wic.= xz"

=C2=A0

WKS_FILE =3D "sgc30cube.wks"

IMAGE_INSTALL =3D "packagegroup-cor= e-boot ${CORE_IMAGE_EXTRA_INSTALL}=C2=A0= "

=C2=A0

IMAGE_INSTALL_append =3D " \=

=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0*** packages removed ***

=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0"

=C2=A0

IMAGE_FEATURES_append =3D " ssh-ser= ver-dropbear"

MACHINE_FEATURES_remove =3D "kernel= 26 nc screen ext2 alsa gpu touchscreen qemu-usermode"

=C2=A0

DEPENDS +=3D "adh-user-add"

IMAGE_FEATURES_append =3D " debug-t= weaks"

I feel like I'm going crazy trying to figure this out. I wish I cou= ld figure out how the final passwd file is generated. I've looked in so= me logs that I've seen suggested online, but have been unable to ascert= ain if there are any errors occurring.

Any help would be greatly appreciated,

Thanks,

Taylor W

--8kECA91v9w1FWkSv7SLh--