Yocto Project Documentation
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: YP docs mailing list <docs@lists.yoctoproject.org>
Subject: why does ptest for cpio and quilt need to "chgrp" to ptest?
Date: Thu, 25 Jun 2026 10:07:56 -0400 (EDT)	[thread overview]
Message-ID: <6869149f-ded1-0105-c94e-dcbd595609eb@crashcourse.ca> (raw)


  currently writing some additional documentation for ptest and poring
over the class and recipes and ran across something i had not noticed
before.

  the ptest-runner recipe, near the end, creates a "ptest" account:

# Create a non-root user that test suites can use easily
inherit useradd
USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = "--system --no-create-home --home / --user-group ptest"

  ok, so that suggests that *some* ptests will want to, what, run
under the "ptest" user or group? so i kept looking and, first, in
"ptest.bbclass", there's this in the middle of do
_install_ptest_base():

    do_install_ptest
    chown -R root:root ${D}${PTEST_PATH}

ok, so the ptest directory for any ptest-enabled recipe will be
"root:root", meaning that a non-root account will have no ability to
write anything under there.

  but the cpio recipe (as is quilt) is a special case as it contains
the following:

# ptest.bbclass currently chowns the ptest directory explicitly, so we need to
# change permission after that has happened so the ptest user can write a
# temporary directory.
do_install_ptest_base:append() {
    chgrp -R ptest ${D}${PTEST_PATH}/
    chmod -R g+w ${D}${PTEST_PATH}/
}

  so i guess the ptest for cpio wants to write under the ptest
directory; hence the need for "chgrp" to "ptest". i'm not sure what is
going on here since i see only two recipes -- cpio and quilt -- that
do this. i am unclear on the relationship between the user and group
under which ptest-runner is running, and what about cpio *requires*
its ptest directory to have a group of "ptest".

  i just find it odd that ptest-runner creates a "ptest" account, but
only two OE recipes take advantage of it.

rday


                 reply	other threads:[~2026-06-25 14:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6869149f-ded1-0105-c94e-dcbd595609eb@crashcourse.ca \
    --to=rpjday@crashcourse.ca \
    --cc=docs@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox