[yocto] Setting home directory ownership

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


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/71078cc8/attachment.html>


More information about the yocto mailing list