From patchwork Thu Feb 22 14:53:54 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: 39931 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 6652AC48BF8 for ; Thu, 22 Feb 2024 14:54:18 +0000 (UTC) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mx.groups.io with SMTP id smtpd.web11.14487.1708613649939340084 for ; Thu, 22 Feb 2024 06:54:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=BAOIB+dc; spf=pass (domain: baylibre.com, ip: 209.85.216.48, mailfrom: pidge@baylibre.com) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-299dba8fd24so2371469a91.2 for ; Thu, 22 Feb 2024 06:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708613649; x=1709218449; 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=TbSbCnHGoa9s9Kx3mlCOrxXN31Y3UBWwiF72ad7qz04=; b=BAOIB+dcz6q/TXQtUcKB/yejsaD0BcNJ0oXRSckfIC6kTE9NNMghZtB3hCgV0O1HfU x/ku3h3EdaTHv637DUFSfIjYCtNKmRKD3NTRXM7yjSpTRtNsnCHGhbsd9z9XT1naJcz0 /16a2L23mS0mWtfbognv56dIbp9MPm4SrrBxahb8H6MqBPj1AtaDchqDLkFhJc4bR7Co 849xRIU/UG8tMwOZ4bnGVIcInfQFk7qR0dfQ2WSnmN8TUMm6VdFr2nXtMu3NuNJYXTbI CQp7Oysgz07SBOUMWXhDOUtGI56fzMufbo29qa7CvxlqmkTtMlFsKCAXg71YCH1G9LaC 6Pig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708613649; x=1709218449; 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=TbSbCnHGoa9s9Kx3mlCOrxXN31Y3UBWwiF72ad7qz04=; b=F+14IQvkOrX2o63Kcn0+O0vwwHvGyd3iMTWnsAGhtCuTPz55ELgj3I+H3xu3zIlLh3 9LquYMYkHGpXs2XhzcdKtpyBfTBdZhDQAPiIvOi6m5b4wKZa47McNJE2RMEcZgqAwhZO UMary6Eq1r0wOcqTlL0Yb0N3mrGtlpgsa2BzO3/fF8xl7rdLn/77hM6xBjG94zIUGU0B UjIsi5VQ6n9SGA4A5oP/Jdhv+Jc9esBImk9yee011zPsSwImvisMcQdXgZxEkHTx/9SA 2g1hyL7QyiJV5OEZWTC4nleD8lV5wVBUcft0pv8nFRNeuOK4RrVKRRjZHItufQTQU+eX 8GVg== X-Gm-Message-State: AOJu0Yy8lYgmDnqYjq9D/rNeDrbEJJpoStHYc7hrWslBqDg2a75K8QKe vDAYaDb//S/i4JXgDEV03yceX1OHHnQARw395L60TmObDBa3eB7AXAMv6QNohhGqphXD3E0fs3X EkL4= X-Google-Smtp-Source: AGHT+IGIYbEfvP08ccOXeij9u2DSC4jlFuekx7YbTccNwpq+895qTV89berrhiOjMP8GUCbhxVJniQ== X-Received: by 2002:a17:90a:3482:b0:299:3990:4e11 with SMTP id p2-20020a17090a348200b0029939904e11mr16107157pjb.34.1708613649388; Thu, 22 Feb 2024 06:54:09 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id sz5-20020a17090b2d4500b00298cc4c56cdsm4067410pjb.22.2024.02.22.06.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:54:09 -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==?= Subject: [PATCH 1/3] useradd.bbclass: Fix order of postinst-useradd-* Date: Thu, 22 Feb 2024 14:53:54 +0000 Message-Id: <5eb199fe11d71f598726b75808b3330cd3efd2e5.1708613381.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 ; Thu, 22 Feb 2024 14:54:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196031 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 It ensures that groups, users and groupmems are all run in the correct order. Signed-off-by: Eilís 'pidge' Ní Fhlannagáin --- meta/classes-global/staging.bbclass | 7 +-- meta/classes/useradd.bbclass | 72 ++++++++++++++++++----------- 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass index ab3e1d71b5..6c21510377 100644 --- a/meta/classes-global/staging.bbclass +++ b/meta/classes-global/staging.bbclass @@ -245,8 +245,9 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): continue staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) - for p in postinsts: - bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) + bb.warn(sorted(postinsts)) + for p in sorted(postinsts): + bb.warn("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) # # Manifests here are complicated. The main sysroot area has the unpacked sstate @@ -629,7 +630,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 a58f8287c9..924eeadf9c 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. @@ -130,10 +142,19 @@ useradd_sysroot () { exit 0 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')}" + # Add groups and users defined for all recipe packages + if test "x$1" = "xgroup"; then + GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}" + fi + if test "x$1" = "xuser"; then + USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}" + fi + if test "x$1" = "xgroupmems"; then + GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}" + fi + if 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 +169,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 Thu Feb 22 14:53:55 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: 39932 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 776AFC54798 for ; Thu, 22 Feb 2024 14:54:18 +0000 (UTC) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mx.groups.io with SMTP id smtpd.web10.14602.1708613653146364260 for ; Thu, 22 Feb 2024 06:54:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=0Z7Z/8WY; spf=pass (domain: baylibre.com, ip: 209.85.215.171, mailfrom: pidge@baylibre.com) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-5c66b093b86so718429a12.0 for ; Thu, 22 Feb 2024 06:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708613652; x=1709218452; 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=a4ApzvAikFO9oc5ZJQqzlgOspPqZe3SqYbktvFDaFZ4=; b=0Z7Z/8WY3Uj714bakzyBn5Y2JuLbv9vP4sn277lbwRLrQ7TjZZqpkVm/nhv6/sSWWt wm+XXYgAlrVifcWnK0HveTQ50tZB8qTuMyb2ra6PEo5S+HadsVTvhfJr73vO2iI16hFj 49SMihS7viVkKdnYLwAqLSMGQ8M/vsNZPrckpOOz5NSnEi4Smzn1JlxY35yY6bbi+hV6 BtX5ClDhcl1xSHv7LJDb5tS++fG6oEF9TxW+U7vu3DlIMDoCTc9wR3UaNHZMypg7HVXa yv48o2u+K/0C5QocHs1p9ojbTbFmiEXQwQU+5OPH711hSvXmNVqGjxShXC7o/1j/qevH lncA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708613652; x=1709218452; 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=a4ApzvAikFO9oc5ZJQqzlgOspPqZe3SqYbktvFDaFZ4=; b=Q09WyLPfYuq5mZP1evpFiSyn/2RIKZEuBIhwTML14oMqH3Cj9LWDzQ0VRCEh2FH9CL Jf7M8MgKAGECQ+NzYKALKqI0elCCPB2nNJiqTZsfSASQowzkDLL4B0E24DxBr97KqubP V5DWCm4Zcp8c9orr2WqWQRC6ww/PmHQPKt4bYxl3q3/ndqOnosnF3WNRlbt+tRfNevIQ qyrIEAXttTp0FdrIfJi5Q48yKX/+PhuwvWF1onnKQDVBkLOXa6eK7Y3Dt4aqv7qx9p8+ Us9uLaSC1O2s6qZ1ycIFGjVd9nfuhgS4XZliqFO/ivfOFEWBP+O8GOSWQdNbuII9bu9z cdug== X-Gm-Message-State: AOJu0YwlIUBn2QlELlaDOsRm9pjGiWVJzDT7/FC7YUYOQwxfvJHq6VnZ xEJkomIZyl/Numlh89XDSS+obpusLvmSFvgFDZKTw8p0S7lE2W1PyiRyNi9JqoWjwH4Z2L/mELC JvU4= X-Google-Smtp-Source: AGHT+IFHwHremysLoMdBC7fyskRdeQBDPejJ7rNXKWjBOH57sZc8Fy1IZaujhLhulCdRySfi2f7Wtg== X-Received: by 2002:a17:90a:77c9:b0:296:2afd:ead2 with SMTP id e9-20020a17090a77c900b002962afdead2mr3857982pjs.21.1708613652594; Thu, 22 Feb 2024 06:54:12 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id sz5-20020a17090b2d4500b00298cc4c56cdsm4067410pjb.22.2024.02.22.06.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:54:12 -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==?= Subject: [PATCH 2/3] selftest-users: Convoluted selftest for USERADD_DEPENDS Date: Thu, 22 Feb 2024 14:53:55 +0000 Message-Id: <1a32096c84c5124388a1c47ae3105cab5207cd8b.1708613381.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 ; Thu, 22 Feb 2024 14:54:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196032 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 0000000000..66ed5695a2 --- /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 0000000000..c4844dd0da --- /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 0000000000..021b1ebbf7 --- /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 0000000000..b96ca92a16 --- /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 a331ca9f2c..3c59b0f290 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 Thu Feb 22 14:53:56 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: 39933 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 7A5EBC54788 for ; Thu, 22 Feb 2024 14:54:18 +0000 (UTC) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.14604.1708613656293431443 for ; Thu, 22 Feb 2024 06:54:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=pOpEawer; spf=pass (domain: baylibre.com, ip: 209.85.210.177, mailfrom: pidge@baylibre.com) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6e471caaa71so2738139b3a.2 for ; Thu, 22 Feb 2024 06:54:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708613656; x=1709218456; 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=2CFclcN12JTKAHVOE7eXKqbPuOKmNPtKLFSRNJbCnVY=; b=pOpEawer03dIO7yiJEgfMo3iJPP21vShGaWPyKPcyGsnfR28JAI8aeg8lIMc2HWQ40 DbaZxaRyx0xKl8QSooN3VUVugQyxJlmVDXl5RU9f5jOVM7snfoyAC5F3yVw/L38x/SX4 0JQKYmXJ/wuwgMbjo0LKiVEuNXJ7CCuBJhZ/kMmLkbn6gxRkkmdzNe9lRZTpB14TOWdI hugWK7FM8TfOkKh4JYsiNXhmWwbmrlYU43aOsllZzhNQaEP1kWhpYShgnrZzoaQcJQvN uJsffFVJwlqKAHsjuXKu7etMnx1VReidIREME5KtOz9HYGT9uMjpV1qwRI62QnIzbOzu iIDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708613656; x=1709218456; 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=2CFclcN12JTKAHVOE7eXKqbPuOKmNPtKLFSRNJbCnVY=; b=KWbK8te4UBvcGpLg2/CotYEtb3Hwrwu1NJRo9x+cXTSkgcZEfy+iMGOfdjPqwvfW5w TiYi/5vc8a/2chZJBr2CAgFqVUmi9BgJOHn5iHClWNlfQJUxOEelPXU48ZN3zEelSFB9 c2Shru+I/AMnaCDbLrnDUpwfWwO+dOETXuOJ5DUHPe9WMwBP5cT7Hpl1EzMfoZmlg67y +FXRKF2YgFXINCtyIsflEJ5l7T7TOsBDfgvsD6J/gQscfOmvECLHmwYA4IJiB4xM/mos IcQNui6sOe8xCyjA10/0N2rm6MpLei/CP/fnInL6vU7rxCUS0+SCIZ8oaI7DSelvhmWW k+EQ== X-Gm-Message-State: AOJu0YwaWdUITdzt+N6hSQiAGfNc6qwdJqWnswXM4Dw6hgtIo9PQqNnn Vj2TVAYbMeD2bB95/zIpiePjTEIRsL597hw7p9D7QELr9g6CY0dx++Zgvjsk+IGkET3PEVmHyDZ V5ms= X-Google-Smtp-Source: AGHT+IEma1ZjwQFEcX8OqmxmGvwhBkpq1QKBGF4HZ1jLBqiOlgjXmtAGRMCkW52bVYbVcFbGbF5gNA== X-Received: by 2002:a05:6a20:c890:b0:19b:a07a:344d with SMTP id hb16-20020a056a20c89000b0019ba07a344dmr21289739pzb.7.1708613655808; Thu, 22 Feb 2024 06:54:15 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id sz5-20020a17090b2d4500b00298cc4c56cdsm4067410pjb.22.2024.02.22.06.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 06:54:15 -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==?= Subject: [PATCH 3/3] creategroup*: Remove coreutils-native as a DEPENDS Date: Thu, 22 Feb 2024 14:53:56 +0000 Message-Id: <97cfc595eab6c1a79a010719eee60c6fef96e998.1708613381.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 ; Thu, 22 Feb 2024 14:54:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196033 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 ebbbfaa83d..afd23ed1ee 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 ef697f09b4..f776f43aed 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}"