From patchwork Fri Feb 23 13:25:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= X-Patchwork-Id: 39983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6764C54798 for ; Fri, 23 Feb 2024 13:25:47 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web10.10422.1708694739765506944 for ; Fri, 23 Feb 2024 05:25:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=1Kyhjbxt; spf=pass (domain: baylibre.com, ip: 209.85.221.48, mailfrom: pidge@baylibre.com) Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-33d26da3e15so267163f8f.1 for ; Fri, 23 Feb 2024 05:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708694738; x=1709299538; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aph5P/Kv2AO23irQf6D2+R9rjXILBwXIKJcdwrJOByA=; b=1KyhjbxtDlun2Hoj6UydhbZCvDf9VKgqpvpyHn0wGZAtGcOg+eop+TR4hE/fy3yrJg 8Ts4y1V8b9Q5MlqGAkTE7pBhyMLrU/UGb4DsoYKt6DEWE3fNhjDeclxdYdWaZV4yXwWy /WFEP0ZwUz9pSHHb5iH0lymn/nE7mvHGu5uKiS7tF887WHcpEJGgmwuFY9ZrRc5grdAk 3hhTPG/f275zNgpLhPSdS08OrPScsV0VhajW0vUMDGmI1F+wyEpvPNSlgKQPncC1k7v6 A65KoahAR+Vf6JBolgt3RlY2IDhQs4b+XEswk5AbjG+fPQXlm3I6s/t6z/cBk6s4vrGZ esPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708694738; x=1709299538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aph5P/Kv2AO23irQf6D2+R9rjXILBwXIKJcdwrJOByA=; b=BrVsqu9Uriuu0CjfHpB/3ca87zv8eKqQey2t0eQq90P8XDwFl2ltHlxVgERvOywsUD lzKY00kksx9edzvaOlZduCfqAKX2Y4dfbb4yOafu9605/XOKM654DTFcjghKcZI+Cf9x CX634ApboR/at/JFd4tG4xs2ZQD+IHfCwk1opdV1hB1l9ocwhdYZ7OrtXLw6iKyNknt5 /zwW7TQtBGhyb+DIWqSsb9Fahbgth+XnB3M1oKuNfCUhEmyctdF3rmq2HhOdsi2MxSLO WMT771uHd4IsAuGKoTTP/9y6sJjzx9+7z07xOnbZRYw8TK70F2u2Tax261LOhIpEyHHA oFUw== X-Gm-Message-State: AOJu0Yz7RkaOLgMJmQ7twl7GlqBd0g1dYDEDlPwUoaKcHxwvNya1FWfS pgY35nxBoVBCQu+Fw3F2SMqSW6eP7Th/9xMVQa8M0OYpwH1JpYpXp18Xgp3UDVLgaqbHwjY9rMb 2i7Y= X-Google-Smtp-Source: AGHT+IFHXGcMeGM8MnpOTAf0Q/igJf6bndHTc0caGoT017A3WgLKxpH8V0FpgKLGNECFyc6ZB8rR7A== X-Received: by 2002:adf:e792:0:b0:33d:3896:be55 with SMTP id n18-20020adfe792000000b0033d3896be55mr1874144wrm.5.1708694738115; Fri, 23 Feb 2024 05:25:38 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b0033d3b8820f8sm2793450wrb.109.2024.02.23.05.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:25:37 -0800 (PST) From: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?q?Piotr_=C5=81obacz?= , =?utf-8?b?RWlsw61z?= =?utf-8?b?ICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= , =?utf-8?q?Jan_G=C3=B3rski?= Subject: [PATCH v3 1/3] useradd.bbclass: Fix order of postinst-useradd-* Date: Fri, 23 Feb 2024 13:25:20 +0000 Message-Id: <07eb596dd4e8cfc319add777a3069d6e50d33e56.1708694024.git.pidge@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 23 Feb 2024 13:25:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196076 From: Piotr Łobacz postinst-useradd-* haven't been running in order of dependency. This patch is reworked from Piotr Łobacz's patch and fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15084 https://bugzilla.yoctoproject.org/show_bug.cgi?id=13904 basepasswd_sysroot_postinst in base-passwd can install postinst-useradd-* scripts with any order. Sometimes this means, for example a useradd postinst will attempt to run without the corresponding group postinst causing errors. This patch ensures that we first run groupadd, then useradd and then group membership. Signed-off-by: Eilís 'pidge' Ní Fhlannagáin Signed-off-by: Piotr Łobacz Signed-off-by: Jan Górski --- meta/classes-global/staging.bbclass | 4 +- meta/classes/useradd.bbclass | 67 ++++++++++++++++++----------- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass index ab3e1d71b52..3678a1b4415 100644 --- a/meta/classes-global/staging.bbclass +++ b/meta/classes-global/staging.bbclass @@ -245,7 +245,7 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): continue staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) - for p in postinsts: + for p in sorted(postinsts): bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) # @@ -629,7 +629,7 @@ python extend_recipe_sysroot() { for f in fixme: staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d) - for p in postinsts: + for p in sorted(postinsts): bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) for dep in manifests: diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index f0ec0809203..198be82228b 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass @@ -103,6 +103,18 @@ fi } useradd_sysroot () { + user_group_groupmems_add_sysroot user +} + +groupadd_sysroot () { + user_group_groupmems_add_sysroot group +} + +groupmemsadd_sysroot () { + user_group_groupmems_add_sysroot groupmems +} + +user_group_groupmems_add_sysroot () { # Pseudo may (do_prepare_recipe_sysroot) or may not (do_populate_sysroot_setscene) be running # at this point so we're explicit about the environment so pseudo can load if # not already present. @@ -131,9 +143,15 @@ useradd_sysroot () { fi # Add groups and users defined for all recipe packages - GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" - USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" - GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}" + if test "$1" = "group"; then + GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" + elif test "$1" = "user"; then + USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" + elif test "$1" = "groupmems"; then + GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}" + elif test "x$1" = "x"; then + bbwarn "missing type of passwd db action" + fi # Tell the system to use the environment vars UA_SYSROOT=1 @@ -148,29 +166,26 @@ useradd_sysroot () { EXTRA_STAGING_FIXMES += "PSEUDO_SYSROOT PSEUDO_LOCALSTATEDIR LOGFIFO" python useradd_sysroot_sstate () { - scriptfile = None - task = d.getVar("BB_CURRENTTASK") - if task == "package_setscene": - bb.build.exec_func("useradd_sysroot", d) - elif task == "prepare_recipe_sysroot": - # Used to update this recipe's own sysroot so the user/groups are available to do_install - - # If do_populate_sysroot is triggered and we write the file here, there would be an overlapping - # files. See usergrouptests.UserGroupTests.test_add_task_between_p_sysroot_and_package - scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}-recipedebug") - - bb.build.exec_func("useradd_sysroot", d) - elif task == "populate_sysroot": - # Used when installed in dependent task sysroots - scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}") - - if scriptfile: - bb.utils.mkdirhier(os.path.dirname(scriptfile)) - with open(scriptfile, 'w') as script: - script.write("#!/bin/sh -e\n") - bb.data.emit_func("useradd_sysroot", script, d) - script.write("useradd_sysroot\n") - os.chmod(scriptfile, 0o755) + for type, sort_prefix in [("group", "01"), ("user", "02"), ("groupmems", "03")]: + scriptfile = None + task = d.getVar("BB_CURRENTTASK") + if task == "package_setscene": + bb.build.exec_func(f"{type}add_sysroot", d) + elif task == "prepare_recipe_sysroot": + # Used to update this recipe's own sysroot so the user/groups are available to do_install + scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/" f"postinst-useradd-{sort_prefix}{type}" "-${PN}") + bb.build.exec_func(f"{type}add_sysroot", d) + elif task == "populate_sysroot": + # Used when installed in dependent task sysroots + scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/" f"postinst-useradd-{sort_prefix}{type}" "-${PN}") + + if scriptfile: + bb.utils.mkdirhier(os.path.dirname(scriptfile)) + with open(scriptfile, 'w') as script: + script.write("#!/bin/sh\n") + bb.data.emit_func(f"{type}add_sysroot", script, d) + script.write(f"{type}add_sysroot\n") + os.chmod(scriptfile, 0o755) } do_prepare_recipe_sysroot[postfuncs] += "${SYSROOTFUNC}" From patchwork Fri Feb 23 13:25:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= X-Patchwork-Id: 39985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F09A2C54E41 for ; Fri, 23 Feb 2024 13:25:47 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.web11.10339.1708694740300563152 for ; Fri, 23 Feb 2024 05:25:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=MoHM29ZS; spf=pass (domain: baylibre.com, ip: 209.85.221.41, mailfrom: pidge@baylibre.com) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-33da6f289cfso310500f8f.2 for ; Fri, 23 Feb 2024 05:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708694739; x=1709299539; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U0BSSTx3OYUXeI5PPdhJ1bfPylh3EZmIzQWPYW3/Zko=; b=MoHM29ZS8aPsFltZvAFTDVzj7VJbET6bN8CQM+r5Ca8Cm1xu+SfenxRUOFRJrcZ/bx nWgvV8XA0DLF3/pkDKxSWJnDA7nhLJJviTCb2ztBse//GQLZ89c8gXc7CCzKBe0KLvA/ CkFxTiGihkqbsOE8GAhOLuNiy0j6a/Xh4aWu+KK+dcBYxXcllss0J8jH9mIhAABs4wyX tiFk2tJKmMifPfX0WKW4zxlUOCR1QYGtP8fSFJ6gyKDmdUlIH48KXCn1B4eHG6YkL8DK lfTvyz4YpunHwXBFLMX+5CmtkJWSYNd/Ozb7eh7RAa/GSPRTQm8oOW60ryC1JEgPmJdk spUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708694739; x=1709299539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U0BSSTx3OYUXeI5PPdhJ1bfPylh3EZmIzQWPYW3/Zko=; b=XhIwKBiIibOuSyVowcbZlDMIGikxyhRbjSz18viE6n3PdY8R48wIRXQoSVwomf7lVS sWsdl/mxRWQhlbmr4PpXaqxKevxCq/Bdx4vseZOIEpMRqv45d40eSYmQxiHGJjevDb1W vEtAHb6KT+7O8FKNNtZZPtmacxyRRdqrnFZFf+2guYFyT4YlLTV1fAe2SSavYivCCCtO upkhY6tCm/ixCqeIZ2YNoVHd7GG/Z71UEmp6hEjrKDokwNs8vk1JEbp4FgLhJ2dMLyw7 PElL/AG9T/i181rdGWCtoADx/UpPHL4JyULF3Eql3OCySj73h8QjAAEJL1xorAVWTgZv /bNw== X-Gm-Message-State: AOJu0YwMlng92LpqPG7UIDLQMavfBHqOu2h+KAdCAXU9WQ5phaYyXAm/ an3cVSR86u0KNE1cHAxMwD9NIsEXvJBH19gaOaCSwolJFvIYi8tfBFjDBMyGYimz62pcn70XyjJ vY2Y= X-Google-Smtp-Source: AGHT+IFN0vj/uYl0fMwCWcf8Ufh4Y86BFCuD1FVtVmll3KwDllSoA9noO0evGPNLeyLgf8FsF8+18w== X-Received: by 2002:adf:fe87:0:b0:33d:2629:c518 with SMTP id l7-20020adffe87000000b0033d2629c518mr1574332wrr.64.1708694738872; Fri, 23 Feb 2024 05:25:38 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b0033d3b8820f8sm2793450wrb.109.2024.02.23.05.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:25:38 -0800 (PST) From: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= Subject: [PATCH v3 2/3] selftest-users: Convoluted selftest for USERADD_DEPENDS Date: Fri, 23 Feb 2024 13:25:21 +0000 Message-Id: <5385ea75165e7973c7c0c9e635fff2502b086fe3.1708694024.git.pidge@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 23 Feb 2024 13:25:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196077 This adds a test for 13904's fix by creating a convoluted set of recipes with USERADD_DEPENDS in non-alpha order. Signed-off-by: Eilís 'pidge' Ní Fhlannagáin --- .../selftest-users/acreategroup.bb | 32 ++++++++++++++++ .../selftest-users/bcreategroup.bb | 37 +++++++++++++++++++ .../selftest-users/ccreategroup.bb | 34 +++++++++++++++++ .../selftest-users/dcreategroup.bb | 33 +++++++++++++++++ .../lib/oeqa/selftest/cases/usergrouptests.py | 4 ++ 5 files changed, 140 insertions(+) create mode 100644 meta-selftest/recipes-test/selftest-users/acreategroup.bb create mode 100644 meta-selftest/recipes-test/selftest-users/bcreategroup.bb create mode 100644 meta-selftest/recipes-test/selftest-users/ccreategroup.bb create mode 100644 meta-selftest/recipes-test/selftest-users/dcreategroup.bb diff --git a/meta-selftest/recipes-test/selftest-users/acreategroup.bb b/meta-selftest/recipes-test/selftest-users/acreategroup.bb new file mode 100644 index 00000000000..66ed5695a26 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/acreategroup.bb @@ -0,0 +1,32 @@ +SUMMARY = "creategroup_a" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +S = "${WORKDIR}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5560 --gid a_group a_user" +GROUPADD_PARAM:${PN} = "-r a_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown a_user:a_group ${TESTDIR}/file + chown -R a_user:a_group ${TESTDIR}/dir + chown -h a_user:a_group ${TESTDIR}/symlink + chown -R a_user:a_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" diff --git a/meta-selftest/recipes-test/selftest-users/bcreategroup.bb b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb new file mode 100644 index 00000000000..c4844dd0da0 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/bcreategroup.bb @@ -0,0 +1,37 @@ +SUMMARY = "creategroup_b" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +# This recipe requires a and c. C requires A. Reverse alpha. + +USERADD_DEPENDS = "acreategroup ccreategroup" + +S = "${WORKDIR}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5561 -g b_group -G a_group,c_group b_user " +GROUPADD_PARAM:${PN} = "-r b_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown a_user:a_group ${TESTDIR}/file + chown -R c_user:c_group ${TESTDIR}/dir + chown -h a_user:a_group ${TESTDIR}/symlink + chown -R b_user:b_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" + diff --git a/meta-selftest/recipes-test/selftest-users/ccreategroup.bb b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb new file mode 100644 index 00000000000..021b1ebbf77 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/ccreategroup.bb @@ -0,0 +1,34 @@ +SUMMARY = "creategroup_c" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +USERADD_DEPENDS = "acreategroup" + +S = "${WORKDIR}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5563 --gid c_group -G a_group c_user" +GROUPADD_PARAM:${PN} = "-r c_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown c_user:c_group ${TESTDIR}/file + chown -R c_user:c_group ${TESTDIR}/dir + chown -h c_user:c_group ${TESTDIR}/symlink + chown -R c_user:c_group ${TESTDIR}/fifotest +} + +FILES:${PN} = "${sysconfdir}/creategroup/*" diff --git a/meta-selftest/recipes-test/selftest-users/dcreategroup.bb b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb new file mode 100644 index 00000000000..b96ca92a160 --- /dev/null +++ b/meta-selftest/recipes-test/selftest-users/dcreategroup.bb @@ -0,0 +1,33 @@ +SUMMARY = "creategroup_d" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +LICENSE = "MIT" + +USERADD_DEPENDS = "bcreategroup" + +S = "${WORKDIR}" + +EXCLUDE_FROM_WORLD="1" + +inherit useradd allarch + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "-u 5564 -g d_group -G b_group d_user " +GROUPADD_PARAM:${PN} = "-r d_group" + +TESTDIR = "${D}${sysconfdir}/creategroup" + +do_install() { + install -d ${TESTDIR} + install -d ${TESTDIR}/dir + touch ${TESTDIR}/file + ln -s ./file ${TESTDIR}/symlink + install -d ${TESTDIR}/fifotest + mkfifo ${TESTDIR}/fifotest/fifo + + chown d_user:d_group ${TESTDIR}/file + chown -R d_user:b_group ${TESTDIR}/dir + chown -h d_user:d_group ${TESTDIR}/symlink + chown -R d_user:b_group ${TESTDIR}/fifotest +} + diff --git a/meta/lib/oeqa/selftest/cases/usergrouptests.py b/meta/lib/oeqa/selftest/cases/usergrouptests.py index a331ca9f2c4..3c59b0f2908 100644 --- a/meta/lib/oeqa/selftest/cases/usergrouptests.py +++ b/meta/lib/oeqa/selftest/cases/usergrouptests.py @@ -22,6 +22,10 @@ class UserGroupTests(OESelftestTestCase): # Test for YOCTO #14961 self.assertTrue(bitbake('useraddbadtask -C fetch')) + def test_postinst_order(self): + self.logger.info("Building dcreategroup") + self.assertTrue(bitbake(' dcreategroup')) + def test_static_useradd_from_dynamic(self): metaselftestpath = get_test_layer() self.logger.info("Building core-image-minimal to generate passwd/group file") From patchwork Fri Feb 23 13:25:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= X-Patchwork-Id: 39984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AB68C54E4F for ; Fri, 23 Feb 2024 13:25:48 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web10.10423.1708694741005357877 for ; Fri, 23 Feb 2024 05:25:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=yCxdfe/v; spf=pass (domain: baylibre.com, ip: 209.85.221.42, mailfrom: pidge@baylibre.com) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-33d32f74833so437015f8f.3 for ; Fri, 23 Feb 2024 05:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708694739; x=1709299539; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s7s0jYH3p2f8i8kU2ab3hX2akhry3jIJ7/rjn58WBII=; b=yCxdfe/vzvkpqKX52livNTxXAmJZ1nVDhtkFJys5JOyXCA1oHelLX17MGTiZWMT9+X /cgwUCTtIPjZWcsyBIB7+fklzxdY9UgpLxf78AZUEuRvmAWg7BYVxSEi1MVyP8lb4c/+ ooPTX7GpUPvspYdvGTtOrdN/7dnj6KBuGRaLfwJNvormv8JlCmXL+AhC0VPVa1xaDsHK JSL8ncVz0iW1QTXC+zQkkJfr5XzE418pZk5ud+4ks4k/X5yUOWsrza7QQS4egAh2MsKm w4Y2QbAPjfI9ep0wZct4tAB8kY3GWmx7XSk8/etioMBRl69V3PUXxHlx1wYylrf/z/fN 3ppA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708694739; x=1709299539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s7s0jYH3p2f8i8kU2ab3hX2akhry3jIJ7/rjn58WBII=; b=N+48FWPxKImDNOsiXeN2hjZwJcegcjY+TRSiAZ9TpRBd477dfe3XJpxfpa+IcgGo17 u+rA/G61WN1Srl4ROOJ857v0V1jcz6ofVNQpeA4ss2j8z+uL512mz8QCyNkeU4EIoRtt cjg02O1xhmF92o1/t5081RI6KTgKZ8GgiGV/QCC5qOTxCIKhsIj+MfsFHj2COqghaOsj VamdpjwvAeoEmqnnllWLn27OCo9Z3pMNeSLDRwjlRaUstPPxPvxVN73QANCl9Tl7psSJ ov0HWje1eMk8+b96SDFjt5nfNA4/7Q0k9CUyf0Ta7XevHhD6M1+aaSe3uUqwx8USO05b ZDHQ== X-Gm-Message-State: AOJu0Yy0oJGpGQBxy9npUwhVmdEWauWJHUcF/htwgYaNaEF9qhB8Vm47 +NWEpdZa4JB4BXmF4GPCTJIbLeDHyBMZGQdhpReYfAwei9+VUq4nQNS/cy1lNjsUVCp52zS9XOA Dr4U= X-Google-Smtp-Source: AGHT+IGTISZW+aJ/SBVOBIq5FiYKgeIvjJLDrF9ufR9Hq1Ay/q0iq/0vjvymuYq5QgQACcEkhz5/qw== X-Received: by 2002:a5d:55cd:0:b0:33d:4630:a106 with SMTP id i13-20020a5d55cd000000b0033d4630a106mr1575557wrw.37.1708694739596; Fri, 23 Feb 2024 05:25:39 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id cx16-20020a056000093000b0033d3b8820f8sm2793450wrb.109.2024.02.23.05.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:25:39 -0800 (PST) From: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= Subject: [PATCH v3 3/3] creategroup*: Remove coreutils-native as a DEPENDS Date: Fri, 23 Feb 2024 13:25:22 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 23 Feb 2024 13:25:48 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196078 There isn't any reason for coreutils-native as a DEPENDS, so remove it to speed up tests. Signed-off-by: Eilís 'pidge' Ní Fhlannagáin --- meta-selftest/recipes-test/selftest-users/creategroup1.bb | 2 -- meta-selftest/recipes-test/selftest-users/creategroup2.bb | 1 - 2 files changed, 3 deletions(-) diff --git a/meta-selftest/recipes-test/selftest-users/creategroup1.bb b/meta-selftest/recipes-test/selftest-users/creategroup1.bb index ebbbfaa83d3..afd23ed1eea 100644 --- a/meta-selftest/recipes-test/selftest-users/creategroup1.bb +++ b/meta-selftest/recipes-test/selftest-users/creategroup1.bb @@ -3,8 +3,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda LICENSE = "MIT" -DEPENDS = "coreutils-native" - S = "${WORKDIR}" inherit useradd allarch diff --git a/meta-selftest/recipes-test/selftest-users/creategroup2.bb b/meta-selftest/recipes-test/selftest-users/creategroup2.bb index ef697f09b4d..f776f43aedf 100644 --- a/meta-selftest/recipes-test/selftest-users/creategroup2.bb +++ b/meta-selftest/recipes-test/selftest-users/creategroup2.bb @@ -3,7 +3,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda LICENSE = "MIT" -DEPENDS = "coreutils-native" USERADD_DEPENDS = "creategroup1" S = "${WORKDIR}"