[yocto] How /etc/shadow packed into my final image?

ChenQi Qi.Chen at windriver.com
Tue Oct 24 19:53:00 PDT 2017


On 10/24/2017 07:58 PM, Bacheh Karaji wrote:
> Hi,
>
> I wanted to modify the content of /etc/shadow,
> but don't know how /etc/shadow files is packed into final image.
>
> Can anybody how it is packed and way to modify it?
> Thanks
>
>
>
>

The file is created in postinst of the shadow package.

Codes are like below:
root at qemux86-64:~# rpm -q --scripts shadow
postinstall scriptlet (using /bin/sh):
# shadow - postinst
     if [ "x$D" != "x" ]; then
       rootarg="--root $D"
     else
       rootarg=""
     fi

     pwconv $rootarg || exit 1
     grpconv $rootarg || exit 1
[snip]

There are several ways to modify the file, depending on your purpose.
If you just want to modify/add/delete user/group in recipe, please try 
to make use of useradd*.bbclass.
http://www.yoctoproject.org/docs/2.3.2/mega-manual/mega-manual.html#ref-classes-useradd

If you want to do user/group operation in conf file, please try to make 
use of extrausers.bbclass.
http://www.yoctoproject.org/docs/2.3.2/mega-manual/mega-manual.html#ref-classes-extrausers

The above should be basically enough.

Best Regards,
Chen Qi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171025/2adc59e0/attachment.html>


More information about the yocto mailing list