From patchwork Fri Feb 23 11:16:02 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: 39966 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 71D84C54E49 for ; Fri, 23 Feb 2024 11:16:16 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web10.8415.1708686975162009039 for ; Fri, 23 Feb 2024 03:16:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=0E0l6+Ht; spf=pass (domain: baylibre.com, ip: 209.85.128.47, mailfrom: pidge@baylibre.com) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4128cfb6c1aso4597655e9.0 for ; Fri, 23 Feb 2024 03:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708686973; x=1709291773; 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=i2pr3YWlSALPUfjdWH6GytsJ3WX/yjsS6qDMImqQMS4=; b=0E0l6+HtMgbvps/0v4yY9OE/KUJ8iN7iSAo+8oZLZS1GPXRG6HCABNirznraI9hX4+ 1Y4r4pDu4ma647VfWXkkpCT2RkZU+WfYvyhio3a6poaY1Y+0caRull7jX/ODN91OQtEw FbkJ2ZNerNXxWfGhyEA6x+ck56jd0URLWAHJxWgwUcPPAC1/u/vNzAbmn1H+VLkZYEqS FF54VLej3B23SkEtmvhBx3SVH5FvOiUvJ+NWdCMaNUyDRSBfhC3bOvN02k/BhnXz8cqa BjyTqyRP5PLVJGOSx9xiHU9B1iDPWPo2hcxCTcU2/ClC0sGpVhhd0LA5iXk0vZGpaoHP 22Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708686973; x=1709291773; 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=i2pr3YWlSALPUfjdWH6GytsJ3WX/yjsS6qDMImqQMS4=; b=Ry1i7u/0MR6xju+zh8bI3Vj8MNlOMJKTAAZL6ruhpDAVIjVD3bhH0W0/nkUfOr54uh Oi7EFYQAFCz7Lhbr1+yz2BOHfwPU9GzXs9nqJwXR7mhb9CDytyLTjxWtB3/eGP1sbGve opTr0MJiSVkkeRaNfDRsg8Fq+k0F7+OS5CM9GsCEhZczbIKhB26Km5efREd48jXN5sZw 8Q3xD/BSl1ViF5ZGI/yMxkmOcrCgba80VRpuOAavhi8JEom1s9coYe6PMHJkvp5ft/sL UhFg/4ZfNYq+ry5tE8ZQonEgJdUXoWJDR/D5v5y7oYtT5p2Q3afyrKAZYBYKGvx+bI1O AxLQ== X-Gm-Message-State: AOJu0YyxnIyqGCNXXHnPV9m+evwg4Cw4nDuC+EivL7zCagTKaTScbxCi Bkcvg9LxzCE5o/U4MSFcYm5bUzZ7ySny8SWiZdUc+eiNXiJXKR1IFvXcd1ywF3XT96UujA6l24b pOBk= X-Google-Smtp-Source: AGHT+IEFy3QTl3htyMLkw4XD8hjkgVgpKSkuCsDVfEq/SL3/xYG/gDlZw5f/IHfMqW4xmefE/8sNLw== X-Received: by 2002:a05:600c:350c:b0:410:78fb:bed2 with SMTP id h12-20020a05600c350c00b0041078fbbed2mr1548077wmq.19.1708686973518; Fri, 23 Feb 2024 03:16:13 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id jd17-20020a05600c68d100b004129335947fsm1895094wmb.8.2024.02.23.03.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:16:13 -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 v2 1/3] useradd.bbclass: Fix order of postinst-useradd-* Date: Fri, 23 Feb 2024 11:16:02 +0000 Message-Id: <5ffe6e8ddd120cd6ac113fd2cf5d1e557974f64e.1708686845.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 11:16:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196057 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 --- 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 Fri Feb 23 11:16:03 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: 39965 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 7EB24C54E4C for ; Fri, 23 Feb 2024 11:16:16 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.web11.8365.1708686975750317250 for ; Fri, 23 Feb 2024 03:16:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=TkVfT7rf; spf=pass (domain: baylibre.com, ip: 209.85.128.47, mailfrom: pidge@baylibre.com) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-41296df8306so1293275e9.2 for ; Fri, 23 Feb 2024 03:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708686974; x=1709291774; 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=TkVfT7rfehBDc7SPGL7WDoyIA5TNhK7rKnq45xgExWyAhG+hIa2iL6a1QuzJbc+DnX LBbfHZLSJX3ylkZkYJ83D7A1tQBFyjYUH3nHSxmm3IXw7umioSM2ewCEZSpqK+G+njDI Ph9cMy4yNRPwPpL/svSqdKxvkoxNExQO96YpsvqVW/8VGR1q/z83ZsJWRIUr+h2VY0Dy qPiper1Oky8yy8AxB7Kgsrt3onVKGhkKmFxXAFeGoAnSZGVF9ZqWdlJttv6PHJBinUY0 q9Qr9duk+craJ+cyQcMkUPnxHQOvXqGcB1ZldtH+wh6AcuHmOegdTq5XoC8m4S40ZD8p /ibw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708686974; x=1709291774; 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=U/J/6lfv0EbkmNprIyws2Z+3J/dN6BD59rHFu9/yn6GANTTSMwd5gmQA8c9OAeQOCD xZHnIgg6AYrCLU9yjI+qUdaDnB+lEuna/m18Mv5KWc6+eRVG/XlSzKOL6AZQl+lzuiMs O+XKWzvljsRRikls9VGWxg1U09TOyifRfwG8P/D9M3EL6lHwOB8mbRQrwKGi+90gCz91 lk/fRmTBnSHznlx014U0UcxhF88GLeTVF+3nQRIioAKRNiRIT6FdGk5iv+59rAo9TEeY FT2gnr/D8HfFPWKLjEz8fNxBKI2aAZDvlXr5M6hMLKF/Kz5nGryeAj7TSx1uSNkKdHgG VElw== X-Gm-Message-State: AOJu0YzsAQqXqktJ2rezra5Khl+ViHlzeuusUkXv4zvD7oFhLt7evilZ ZM+4GNxmmd13pCD6IX9pXEbWWaW+z9sn1Xy5qdogVf4yDQpuyRqHU24YT6rZ246YWZmbrXl3Aj4 Cffs= X-Google-Smtp-Source: AGHT+IH0VQB/cgYTt1+n7xy86VlLULCojduAThl/NRr0ZOCQddkVK5fvQTHrMAZ2kvquZlKWdza1JQ== X-Received: by 2002:a05:600c:3ac7:b0:412:96a0:dada with SMTP id d7-20020a05600c3ac700b0041296a0dadamr459398wms.3.1708686974281; Fri, 23 Feb 2024 03:16:14 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id jd17-20020a05600c68d100b004129335947fsm1895094wmb.8.2024.02.23.03.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:16:13 -0800 (PST) From: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= Subject: [PATCH v2 2/3] selftest-users: Convoluted selftest for USERADD_DEPENDS Date: Fri, 23 Feb 2024 11:16:03 +0000 Message-Id: <3cee65994b559494a038674015164450343238f8.1708686845.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 11:16:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196058 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 Fri Feb 23 11:16:04 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: 39967 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 4954AC5478C for ; Fri, 23 Feb 2024 11:16:26 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.web11.8366.1708686976580392092 for ; Fri, 23 Feb 2024 03:16:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=YUQ5x+ft; spf=pass (domain: baylibre.com, ip: 209.85.128.51, mailfrom: pidge@baylibre.com) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4128cfb6b6fso1605995e9.0 for ; Fri, 23 Feb 2024 03:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1708686975; x=1709291775; 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=YUQ5x+ftqV7voDiUl2w12/gmTVekUMX3B8qlBFiEOjo4sYcmdWZlL558O+N0RAhlsN 1iqVQ10o1BckdfY7u+WUSCCRQofGEoc8SEoqcyvKTWKF8oTu1fUxYF9cp9yb8eKGoWOE 0DFxm8eBL0uJqfJc2NVH0DYWvgAkcg6llQ6vSIx3emA3zLpI2+e4iYFgeSd6FUu2BwgQ UVnD1qmG+/4UQNB5PsZGfKa5gSSESm2CdWW0ig09ONwrwZO2tpfr72mdlvyJWdaI+jg5 be9nz7A8Z/B/HNIeOQ27zfFx4jy7w2aP3cuiYcdW0bM5jW3SHgIYOsBSERrSPeiPwFTd LVzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708686975; x=1709291775; 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=ncxcabiexG7XxI3sK0/smHdO7aQQk4BVr2dYWyUb4u9ktIFHDQe5r2bfIWhtwZyD1H YWGuLdDTJBxyJAm67444pW1qpEsqdZ//VyM5lMPgkGo3ZyZ/8MlCfWeS3crS/gEAJCms s3Y5AabC8N2cyeY4MyLWaihK5pIPaorGb08i1AzwvJuD4T99lM7iCniOq5rNOLxyvDVu UEGrZRi0z3mIMsE8hA20M+W1ymWe1HBj0uzf7514KYR6jzaWRToDAbKgshhcLX5k+1y0 yQs+jvrEF7DyuS6C7mVh8bU0+ZE2pHMxNU5slj3IkIA2kDZaLmaJY/CejJxHaDCiMkpJ u8ag== X-Gm-Message-State: AOJu0YzGNdR6o0HSV5frNKaQ5qSQU9YEVjzMsBYm2jNOgUsoCbzJf5bj yPw035Mp47JH1HWYul3TlHJeEyUV2LDsK4Axx5rhQHFDd1KOBjPG5ThfweogivrYC8w4aGic03D 2Zl8= X-Google-Smtp-Source: AGHT+IGyszs2N2/AcBRn0kbxrhVx7Dwb+eH4P7o6cw20X1xG4iCxHDgjUrayMFSEaV091jwPrT+OLA== X-Received: by 2002:a05:600c:3516:b0:412:9228:d999 with SMTP id h22-20020a05600c351600b004129228d999mr812786wmq.39.1708686975067; Fri, 23 Feb 2024 03:16:15 -0800 (PST) Received: from orm.fritz.box ([194.110.145.164]) by smtp.gmail.com with ESMTPSA id jd17-20020a05600c68d100b004129335947fsm1895094wmb.8.2024.02.23.03.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:16:14 -0800 (PST) From: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?b?RWlsw61zICdwaWRnZScgTsOtIEZobGFubmFnw6Fpbg==?= Subject: [PATCH v2 3/3] creategroup*: Remove coreutils-native as a DEPENDS Date: Fri, 23 Feb 2024 11:16:04 +0000 Message-Id: <1879795b4497d3d2a810ec520283ae0e6f3c4f7e.1708686845.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 11:16:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/196059 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}"