[yocto] How Do I add users in /etc/passwd in Yocto

Davide Soldan davide.soldan at kynetics.it
Tue Oct 22 01:42:40 PDT 2013


In data martedì 22 ottobre 2013 14:00:22, Amit Tomer ha scritto:
> For some requirement I wante to add some new users in /etc/passwd .
> 
> I tried doing it in couple of way but none of it worked out well
> 
> I tried to patcth the /etc/passwd file but getting few errors while
> bitbaking my image.
> 
> Paul Eggleton suggests me that patching /etc/passwd  file won't work
> 
> Then I tried doing it in below way
> 
> SRC_URI += "file://passwd"
> 
> do_install_append() {
> install -d ${D}${sysconfdir}/base-passwd ${D}${sysconfdir}
> passwd/passwd${STAGING_DIR_TARGET}${sysconfdir}/passwd
> 
>                     install -m 0644 ${WORKDIR}/passwd ${D}${sysconfdir}/passwd
> }
> 
>  With above method I am able to add new user to /etc/passwd file
> 
> but testing this image gives me trouble and now when I login to board
> it is asking password.
> 
> Now would like to know what are the ways to add new users in
> /etc/passwd file in yocto.
> 
> Thanks
> Amit
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

I've done it creating my useradd recipe following
poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb



More information about the yocto mailing list