Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 2/2] quilt,cpio: Create ptest user when ptest is enabled in distro features
Date: Wed,  3 Jan 2024 18:10:52 -0800	[thread overview]
Message-ID: <20240104021052.754030-2-raj.khem@gmail.com> (raw)
In-Reply-To: <20240104021052.754030-1-raj.khem@gmail.com>

Fixes warnings

run.do_install_ptest_base.107960:175 exit 1 from 'chgrp -R ptest /mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux-musl/cpio/2.14/image/usr/lib/cpio/ptest/'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/quilt/quilt.inc   |  8 ++++----
 meta/recipes-extended/cpio/cpio_2.14.bb | 11 +++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-devtools/quilt/quilt.inc b/meta/recipes-devtools/quilt/quilt.inc
index 3374f4dfbf3..89572d70d7c 100644
--- a/meta/recipes-devtools/quilt/quilt.inc
+++ b/meta/recipes-devtools/quilt/quilt.inc
@@ -20,7 +20,7 @@ SRC_URI:append:class-target = " file://gnu_patch_test_fix_target.patch"
 
 SRC_URI[sha256sum] = "3be3be0987e72a6c364678bb827e3e1fcc10322b56bc5f02b576698f55013cc2"
 
-inherit autotools-brokensep ptest
+inherit autotools-brokensep ptest useradd
 
 INHIBIT_AUTOTOOLS_DEPS:class-native = "1"
 PATCHTOOL:class-native = "patch"
@@ -62,9 +62,9 @@ do_install:append:class-native () {
     touch ${D}${sysconfdir}/quiltrc
 }
 
-# The tests need to run as a non-root user, so pull in the ptest user
-DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
-PACKAGE_WRITE_DEPS += "ptest-runner"
+# The tests need to run as a non-root user
+USERADD_PACKAGES = "${PN}-ptest"
+USERADD_PARAM:${PN}-ptest = "--system --home /nonexistent --no-create-home --user-group ptest"
 
 do_install_ptest() {
 	install ${WORKDIR}/test.sh ${D}${PTEST_PATH}
diff --git a/meta/recipes-extended/cpio/cpio_2.14.bb b/meta/recipes-extended/cpio/cpio_2.14.bb
index 560038d2a67..c6ab0054994 100644
--- a/meta/recipes-extended/cpio/cpio_2.14.bb
+++ b/meta/recipes-extended/cpio/cpio_2.14.bb
@@ -14,7 +14,7 @@ SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
 
 SRC_URI[sha256sum] = "145a340fd9d55f0b84779a44a12d5f79d77c99663967f8cfa168d7905ca52454"
 
-inherit autotools gettext texinfo ptest
+inherit autotools gettext texinfo ptest useradd
 
 CVE_STATUS[CVE-2010-4226] = "not-applicable-platform: Issue applies to use of cpio in SUSE/OBS"
 
@@ -63,11 +63,10 @@ do_install_ptest_base:append() {
     chmod -R g+w ${D}${PTEST_PATH}/
 }
 
-# The tests need to run as a non-root user, so pull in the ptest user
-DEPENDS:append:class-target = "${@bb.utils.contains('PTEST_ENABLED', '1', ' ptest-runner', '', d)}"
-PACKAGE_WRITE_DEPS:append:class-target = " ${MLPREFIX}ptest-runner"
-
-RDEPENDS:${PN}-ptest += "ptest-runner"
+# The tests need to run as a non-root user
+USERADD_PACKAGES = "${PN}-ptest"
+USERADD_PARAM:${PN}-ptest = "--system --home /nonexistent --no-create-home \
+                       --user-group ptest"
 
 PACKAGES =+ "${PN}-rmt"
 
-- 
2.43.0



  reply	other threads:[~2024-01-04  2:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-04  2:10 [PATCH 1/2] Revert "opkg-utils: upgrade 0.6.2 -> 0.6.3" Khem Raj
2024-01-04  2:10 ` Khem Raj [this message]
2024-01-09 16:05   ` [OE-core] [PATCH 2/2] quilt,cpio: Create ptest user when ptest is enabled in distro features Ross Burton
2024-01-09 18:42     ` Khem Raj
2024-01-05 16:16 ` [OE-core] [PATCH 1/2] Revert "opkg-utils: upgrade 0.6.2 -> 0.6.3" Alexandre Belloni
2024-01-05 17:43   ` Khem Raj

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=20240104021052.754030-2-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.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