[yocto] Setting home directory ownership

Sergio Torres Soldado torres.soldado at gmail.com
Fri Jul 19 06:52:00 PDT 2019


Sorry. I was using NFS boot and was copying over the rootfs with "cp -r"
instead of "cp -a", the permissions are fine. The only issue that remains
is that I have to use "chmod -R 1000" i.e. the UID instead of the username
otherwise I get the following error:
"""
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: invalid user ‘someusername’
"""

On Fri, 19 Jul 2019 at 14:17, Sergio Torres Soldado <
torres.soldado at gmail.com> wrote:

> I am unable to set the home directory ownership. I am using poky at warrior
> and my last attempt was the following recipe:
>
> """
> inherit useradd
> USERADD_PACKAGES = "${PN}"
>
> USERADD_PARAM_${PN} = "-P someusername -u 1000 -d /home/someusername -r -s
> /bin/bash foosomeusername"
>
> LICENSE = "CLOSED"
>
> do_install () {
>   install -d ${D}/home/someusername
>   # If I don't use the UID I get an error message saying "invalid user:
> hubshuffle", although it seems to work for some usernames e.g. "user1" like
> in the skeleton recipe for useradd.
>   chown -R 1000 ${D}/home/foosomeusername
> }
>
> pkg_postinst_${PN} () {
>   chown -R 1000 $D/home/someusername
> }
>
> FILES_${PN} = " \
>   /home/someusername \
> "
> """
>
> I don't know what I am doing wrong, any hint is very welcome thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20190719/116f7e9a/attachment.html>


More information about the yocto mailing list