From patchwork Mon Mar 13 12:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20869 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 B95AAC77B62 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mx.groups.io with SMTP id smtpd.web11.18078.1678709754883925084 for ; Mon, 13 Mar 2023 05:15:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=htJOTAmM; spf=pass (domain: gmail.com, ip: 209.85.208.54, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id ek18so16708638edb.6 for ; Mon, 13 Mar 2023 05:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nXMfidt6WhQuahWGl6Bo/kclS+ZWpxVKXApQuEAzJzw=; b=htJOTAmM+fHt1/kKA44rGwLFm4YBGTb5pUkF00BDsa4VO3Xm5hr7S4fsCfqXH6otHC Gk2J2QghaxCoMDXeTCKEEDyjquw8SiEQFqFZjqSmhdtgfPpxNkfga5tP9OQ6cvlpzOB2 iCczPnoD92V2tXEJ0yOLKxpPhpTxzlm9f/sMbgnbYdINka0mVv/cm5gFqlBR/uSRJY9M cvOEeu0VHjdV6CHW2DpNnxq2JiMikb9SD74cdsxr+JDquPQDBlcDKVtfIhgc/3Krzo25 SBAQC60u18BTqbSfPUeFlFVdOkCV8+hjpHAowo+dKgsn/nVDA+uB1EtdR88tUQN2XAvu dPqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nXMfidt6WhQuahWGl6Bo/kclS+ZWpxVKXApQuEAzJzw=; b=x4jUiI0G4WzXr62k6Uz7i81+nLWsdheSHIPRozkHOYbZhZUq+Nt7LlqwDmf81vBNzQ kVsY3VXsR1vuAv+vP3zZuH/CjArSmUqVNJFl//q4ykmg6U51e3+oQSkR9d51+mQPZBAv p6a9y5RVf7sy93Qul3Egbnkl7a87CtL3QNsl59CyYuAjaX5rlXI0IndEdlaCAyhNDrt5 7bMsTVMAA/3FhJeemks36d+mkvi2UEsS8yP76RELFiOfNM8yNjrVv09SWBRg7oPU+xZ2 MI0IrFz3sGnAMODgPQnYSLfgMpgrR71y9qBE6YVwO5CQNgP8iGG3A9jkNn8QgRgqO/2+ NELA== X-Gm-Message-State: AO0yUKULqy99QZb2CoA5l105zOeRhvPOT7KDZpUo6cd379d+pTmO5vFV /L7wu4XlQiQTE3j8u6gR6r8l6JTajDg= X-Google-Smtp-Source: AK7set/rbpTvZhhhgxlXugQtvJsm3AInpNgc+f+T/KnQ2pWMh8yvr714+KvzGXHVFQXScngZqSnB+w== X-Received: by 2002:a05:6402:1605:b0:4fa:aee8:235f with SMTP id f5-20020a056402160500b004faaee8235fmr6237165edv.9.1678709753354; Mon, 13 Mar 2023 05:15:53 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id m2-20020a509302000000b004f1e91c9f87sm3172805eda.3.2023.03.13.05.15.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:53 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 01/14] git-submodule-test: disable upstream version check Date: Mon, 13 Mar 2023 13:15:28 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178433 * this is one of the failures from distrodata.Distrodata.test_checkpkg: 2023-03-11 14:26:21,482 - oe-selftest - INFO - ====================================================================== 2023-03-11 14:26:21,482 - oe-selftest - INFO - FAIL: test_checkpkg (distrodata.Distrodata.test_checkpkg) 2023-03-11 14:26:21,482 - oe-selftest - INFO - ---------------------------------------------------------------------- 2023-03-11 14:26:21,482 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/selftest/cases/distrodata.py", line 40, in test_checkpkg self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg) AssertionError: False is not true : The following packages failed upstream version checks. Please fix them using UPSTREAM_CHECK_URI/UPSTREAM_CHECK_REGEX (when using tarballs) or UPSTREAM_CHECK_GITTAGREGEX (when using git). If an upstream version check cannot be performed (for example, if upstream does not use git tags), you can set UPSTREAM_VERSION_UNKNOWN to '1' in the recipe to acknowledge that the check cannot be performed. git-submodule-test binutils Stdout: Loading cache...done. Loaded 0 entries from dependency cache. Parsing recipes...done. Parsing of 947 .bb files complete (0 cached, 947 parsed). 1764 targets, 46 skipped, 0 masked, 0 errors. ---------------------------------------------------------------------- 2023-03-11 14:26:21,482 - oe-selftest - INFO - Ran 1 test in 193.764s 2023-03-11 14:26:21,482 - oe-selftest - INFO - FAILED 2023-03-11 14:26:21,483 - oe-selftest - INFO - (failures=1) 2023-03-11 14:26:26,258 - oe-selftest - INFO - RESULTS: martin@jama /OE/build/poky/build $ devtool check-upgrade-status git-submodule-test NOTE: Could not list remote: Fetcher failure for URL: 'gitsm://git.yoctoproject.org/git-submodule-test;branch=master'. The command git -c gc.autoDetach=false -c core.pager=cat ls-remote git://git.yoctoproject.org/git-submodule-test refs/tags/* gave empty output unexpectedly INFO: git-submodule-test 1.0 UNKNOWN_BROKEN None and there are no tags in this test repo: $ git ls-remote git://git.yoctoproject.org/git-submodule-test a2885dd7d25380d23627e7544b7bbb55014b16ee HEAD d199bbf9ed2216bd1f38aec000d865ae08279119 refs/heads/changed-url a2885dd7d25380d23627e7544b7bbb55014b16ee refs/heads/master 049da4a6cb198d7c0302e9e8b243a1443cb809a7 refs/heads/ssh-gitsm-tests bbe99a1465c5cc52720936d075ddbc5ebe2ed731 refs/meta/cgit * the binutils failure is strange, when I've added some debug output to see why it's listed the issue disappeared, maybe some temporary network glitch or something Signed-off-by: Martin Jansa --- .../recipes-test/git-submodule-test/git-submodule-test.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb index fa3041b7d8..90d9b66b2c 100644 --- a/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb +++ b/meta-selftest/recipes-test/git-submodule-test/git-submodule-test.bb @@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda INHIBIT_DEFAULT_DEPS = "1" +UPSTREAM_VERSION_UNKNOWN = "1" + SRC_URI = "gitsm://git.yoctoproject.org/git-submodule-test;branch=master" SRCREV = "a2885dd7d25380d23627e7544b7bbb55014b16ee" From patchwork Mon Mar 13 12:15:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20868 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 B440AC77B61 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) by mx.groups.io with SMTP id smtpd.web10.17697.1678709755781897260 for ; Mon, 13 Mar 2023 05:15:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jJby9cvZ; spf=pass (domain: gmail.com, ip: 209.85.208.42, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id k10so47726293edk.13 for ; Mon, 13 Mar 2023 05:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9SBrNI0jWSdkK4DAxOYGVcslq2cytPOcx5KcyTuWRkc=; b=jJby9cvZwbdT+Y/KZhVyDUwxPwt2uMYw5mWXLD1thmMVd21mMa8SvlP3dKCzg2jS7O 8+NaijwUNZZofs2dK4VzvWtgyFjaSFdyDjyWrX3ODchMjsecY5Lx9VKoaz9MextjesGA QmA3KydvoqHl13lJaVsdtq01df9S1Y+FfgNwr+++qLSdifBhO+QPloSF8FVAITl2IG/n wiLLy30n+33YOCLjl++jI64fJl6rArjPNYwoMHGP4l4qJYNGOaC+Msjo3wh2CwBw4odS WvGh/9I8D1pqxIP1JlJ2Dj12LuM2ShSqqk+cA9TfhAiF5tl0JPzPG1k6pJY8PPSEVugB BxXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9SBrNI0jWSdkK4DAxOYGVcslq2cytPOcx5KcyTuWRkc=; b=nQQzyfiqdf0drKpANV2KI9PicP8FKWw8WYtrFc1OwOsBT29OUI4l+XpWXdic+VaAFy zV1Bg1IUw9i68Z3XrXv2Pw+ut0T6OWIp/+jWEzMlztOrUzxmscrO1WK2zf4UyTZmEm1C FlqCabFOC5Dl28B9XhNS1SoP7XfH3xmLp4Yg9jQLLPzBKMulxgmne5g2PnIL7wvBJVNU nGTJFV+lH7hyMjyNiDtemMrNP1fRfJHlw9jUDDbUMKchdGg2TAS/BGCqdP4LhBaiCvUB EjNcZ4F7t+xt+eO2w61Q1vYO48O0Y6a9k33XXuLjv7fBy2xGsFlK4QbJSDLZb3SC7Slv 1avw== X-Gm-Message-State: AO0yUKVdWwo+pv31zaTOO0hU3kCrLLnDYzoypShti0eZBsKJIWT9tFj0 eO2bbflZpXvAfGa7yNA22u2YqTvsL1Q= X-Google-Smtp-Source: AK7set9H6hMMA3U7jlo+pWmKC+TIwBjIafXIKWrNEUya9y7aB3esX/p6RSA6wK/xYxZXBJVYZ3eYig== X-Received: by 2002:a17:907:787:b0:8dd:76d5:a82 with SMTP id xd7-20020a170907078700b008dd76d50a82mr45343729ejb.47.1678709754060; Mon, 13 Mar 2023 05:15:54 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id u11-20020a170906408b00b009294524ac21sm1221848ejj.60.2023.03.13.05.15.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:53 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 02/14] selftest: devtool: set BB_HASHSERVE_UPSTREAM when setting SSTATE_MIRROR Date: Mon, 13 Mar 2023 13:15:29 +0100 Message-Id: <67903dd0b38525697c767a2a3bb5e3abe29f6cf5.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178434 * with my build/conf/local.conf: SSTATE_DIR = "/OE/build/poky/build/sstate-cache" these devtool tests will first set own SSTATE_DIR and the original one set as SSTATE_MIRROR: 2023-03-11 11:51:46,837 - oe-selftest - INFO - test_devtool_update_recipe_append (devtool.DevtoolUpdateTests.test_devtool_update_recipe_append) 2023-03-11 11:51:46,846 - oe-selftest - DEBUG - Appending to: /OE/build/poky/build/build-st-2023-03-11-patch2/devtool.DevtoolUpdateTests.test_devtool_update_recipe_append/build-st/conf/selftest.inc SSTATE_DIR = "/OE/build/poky/build/build-st-2023-03-11-patch2/devtool.DevtoolUpdateTests.test_devtool_update_recipe_append/build-st/sstate_devtool" SSTATE_MIRRORS += "file://.* file:////OE/build/poky/build/sstate-cache/PATH" * but that unfortunately leads to a warning from sanity.bbclass about SSTATE_MIRRORS without matching BB_HASHSERVE, because BB_HASHSERVE is set to "auto" by default these tests failing with: 2023-03-11 11:55:39,610 - oe-selftest - INFO - ====================================================================== 2023-03-11 11:55:39,610 - oe-selftest - INFO - FAIL: test_devtool_update_recipe_append_git (devtool.DevtoolUpdateTests.test_devtool_update_recipe_append_git) 2023-03-11 11:55:39,610 - oe-selftest - INFO - ---------------------------------------------------------------------- 2023-03-11 11:55:39,611 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/selftest/cases/devtool.py", line 1118, in test_devtool_update_recipe_append_git self.assertNotIn('WARNING:', result.output) AssertionError: 'WARNING:' unexpectedly found in 'NOTE: Starting bitbake server...\nWARNING: You are using a local hash equivalence server but have configured an sstate mirror. This will likely mean no sstate will match from the mirror. You may wish to disable the hash equivalence use (BB_HASHSERVE), or use a hash equivalence server alongside the sstate mirror.\nLoading cache...done.\nLoaded 0 entries from dependency cache.\nParsing recipes...done.\nParsing of 947 .bb files complete (0 cached, 947 parsed). 1764 targets, 52 skipped, 0 masked, 0 errors.\n\nSummary: There was 1 WARNING message.\nINFO: Updating SRCREV in recipe mtd-utils-selftest_git.bb\nNOTE: Writing append file /tmp/devtoolqa1m2lh02v/layer/recipes-devtools/mtd/mtd-utils-selftest_git.bbappend' ---------------------------------------------------------------------- * just setting BB_HASHSERVE to empty doesn't work, because then we would need to disable OEEquivHash as well as it fails with: ERROR: OEEquivHash requires BB_HASHSERVE to be set Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/devtool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 86014d2557..81d02017c1 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -276,6 +276,7 @@ class DevtoolBase(DevtoolTestCase): cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n' % cls.original_sstate) + cls.sstate_conf += ('BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"\n') @classmethod def tearDownClass(cls): From patchwork Mon Mar 13 12:15:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20870 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 AE95BC761AF for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web10.17698.1678709756204472166 for ; Mon, 13 Mar 2023 05:15:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QVs3j0E6; spf=pass (domain: gmail.com, ip: 209.85.208.48, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f48.google.com with SMTP id cn21so17663531edb.0 for ; Mon, 13 Mar 2023 05:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FklETNJYSgxIablJBxOsB/0XN/yTU65l2qUMmM33Nho=; b=QVs3j0E6mPVlUT6CzX8zXtE2yPoBYGBUZZGILmi/3qqyg1pl/4CFF5dJgOGviaVsW9 3N/WsTahSk5craZYAehOQ9d6+D7PxjcJGsld1n9AoLKj7a6xk5CFqiZJ+53hV67BNtjh cKZ4Vtz+d8kmV4fzjbYOekjNkJVISonSueeMAwS0zztvi1YpiKYZQKFH4kqezPBKdH8z lXuVkEbEpEUHeQNYqKuoSyWevkibgSV/F1wXiOC/z1/aEy7Utrl4Jfsj31282Z6wkfFA 5teckPkfJm5oinQbXhByya4fnLOFnCO/iplj5UsdhHT1mkSjTKdaRffrFKBnXgsXU1mA 0zPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FklETNJYSgxIablJBxOsB/0XN/yTU65l2qUMmM33Nho=; b=uaYvLdsFJJpdXPgqyTcLfghzH1AUVUAy6eerBWOf3Z+TtatEDi/y+rK2Uaor5fFGmv leHA6NCoOneUEEDJXxcc4NnTgK7ETHIdfldfYyM+T/qgY0kvbNrSZ7DEmFX3GboG/Vu5 HxcxMTHPsnP6qNWHclPRABgv5Xnkcah4XQCy8i08i8Zv1WA4FD5HEzqaP8ZRLey7sMX1 2Uny6T9gWXJ4IuTgZuw3XAcAK4SqBXjPrTzFp55uQ4tx7AeRn8IXKIK8Bz7lcTzl07z1 GBpjI4TLryB21uSfxr2io/Ue2hDiZ1aKyI/9zrq+nK23va/gwZ6fYU6KxEt6hmg3xkOM CnWQ== X-Gm-Message-State: AO0yUKWOwSK3suXsvsXK0vB8MOHMfaaPE/OJ7lDqla2dclLMl0UCuXW2 XdnyxlVSXIQ1jcb0O5O/nIlG85oZJSo= X-Google-Smtp-Source: AK7set/BAFyIL1nCbmHqJaxl0mO9P2Y4llWD5err61CRj3jiSQkuKzNDTehV0f0FvJAoO0xCASOGbQ== X-Received: by 2002:a17:907:3186:b0:92b:dff4:f8e9 with SMTP id xe6-20020a170907318600b0092bdff4f8e9mr465196ejb.8.1678709754712; Mon, 13 Mar 2023 05:15:54 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id ku16-20020a170907789000b0090e0a4e1bacsm3356347ejc.159.2023.03.13.05.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:54 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 03/14] selftest: wic: respect IMAGE_LINK_NAME Date: Mon, 13 Mar 2023 13:15:30 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178435 * use IMAGE_LINK_NAME instead of hardcoding core-image-minimal-${MACHINE} assumption [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/wic.py | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b9430cdb3b..7c31848732 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -805,12 +805,13 @@ class Wic2(WicTestCase): config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\ 'MACHINE_FEATURES:append = " efi"\n' self.append_config(config) - bitbake('wic-image-minimal') + image = 'wic-image-minimal' + bitbake(image) self.remove_config(config) - deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') - machine = self.td['MACHINE'] - prefix = os.path.join(deploy_dir, 'wic-image-minimal-%s.' % machine) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + prefix = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.' % bb_vars['IMAGE_LINK_NAME']) + # check if we have result image and manifests symlinks # pointing to existing files for suffix in ('wic', 'manifest'): @@ -1049,14 +1050,14 @@ class Wic2(WicTestCase): def _rawcopy_plugin(self, fstype): """Test rawcopy plugin""" - img = 'core-image-minimal' - machine = self.td["MACHINE"] + image = 'core-image-minimal' + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) params = ',unpack' if fstype.endswith('.gz') else '' with NamedTemporaryFile("w", suffix=".wks") as wks: - wks.write('part / --source rawcopy --sourceparams="file=%s-%s.%s%s"\n'\ - % (img, machine, fstype, params)) + wks.write('part / --source rawcopy --sourceparams="file=%s.%s%s"\n'\ + % (bb_vars['IMAGE_LINK_NAME'], fstype, params)) wks.flush() - cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir) + cmd = "wic create %s -e %s -o %s" % (wks.name, image, self.resultdir) runCmd(cmd) wksname = os.path.splitext(os.path.basename(wks.name))[0] out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname)) @@ -1077,12 +1078,11 @@ class Wic2(WicTestCase): """Test empty plugin""" config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n' self.append_config(config) - bitbake('core-image-minimal') + image = 'core-image-minimal' + bitbake(image) self.remove_config(config) - deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') - machine = self.td['MACHINE'] - - image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME']) self.assertTrue(os.path.exists(image_path)) sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') @@ -1297,12 +1297,12 @@ class Wic2(WicTestCase): # build an image config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n' self.append_config(config) - bitbake('core-image-minimal') + image = 'core-image-minimal' + bitbake(image) # get path to the image - deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') - machine = self.td['MACHINE'] - image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], '%s.wic' % bb_vars['IMAGE_LINK_NAME']) self.remove_config(config) @@ -1310,7 +1310,7 @@ class Wic2(WicTestCase): # expand image to 1G new_image_path = None with NamedTemporaryFile(mode='wb', suffix='.wic.exp', - dir=deploy_dir, delete=False) as sparse: + dir=bb_vars['DEPLOY_DIR_IMAGE'], delete=False) as sparse: sparse.truncate(1024 ** 3) new_image_path = sparse.name From patchwork Mon Mar 13 12:15:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20867 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 A1110C77B60 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mx.groups.io with SMTP id smtpd.web11.18079.1678709756829506490 for ; Mon, 13 Mar 2023 05:15:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nOQr2Aef; spf=pass (domain: gmail.com, ip: 209.85.208.49, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f49.google.com with SMTP id o12so47827589edb.9 for ; Mon, 13 Mar 2023 05:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MieWw1+YmZwDMgxkUbJCoeC0im+AzofyPYtIaiPQlHQ=; b=nOQr2Aef4yLdm2F12sZeqQOLXPN9xemCnu+AfIk62XfQddzAezbvmNQRsJO9AtaThW C/wdlegIdo0p1+ots2RJfnFsMymhiGDHC8xPm1QGM4vOlju8o8TrRdIA0IqV0OmmOUTV eRDn33pHuXiM/b8T+aDzOob8HiqiaRIb9rwpHcoKJyGq6sRmTTGA0NA40T3zblrNf2YP JWuURrRvHIbrhn/wKgkOsW6sI3NS1W0zaCpAF0Gh3fzhPpVHhvNwvc1nTdD3K9slrwM2 JOD6fwd4vRaWtS/3lGcboC+ossQaw/qWU6eerXPM7+m4Ms27jvfubHnF+t4HRpCUHN7Q 008g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MieWw1+YmZwDMgxkUbJCoeC0im+AzofyPYtIaiPQlHQ=; b=G17VTQE8AbTgChZn4tFdyIQACJbf9tqP1aNYYBlg53Fa582ir49qsgVodUChWZRWLz SpI3SbbFKPpWM9olet8OXRrprWAiUpIB9Jh6OKR+TfTgXIyOBR/hzjVKjHg2wR3Vi+/4 Y/xbXYXY40s8W7KhvSIp6c2/DmzP9+9nC9tc/pLGkTM3KqNniIMEU2g+VMDF/2spC3Fl MScVhA62haQIyrnD4+6KPmsXlXIgqb8ogH38m3GHiqvPVmSj4CBtgCeQLwRA4wPNlSCL PbFpzI9K7/vsXsF5b2yfGExy831YVQ+mR3jlIIHq/JVbmwylO2HWcUbYqv1Y6S2YsUuB oy7A== X-Gm-Message-State: AO0yUKXHOTrJur9IZXYqIM8RWIioGOHvzNdttUdHt0PujF9bL3hrf2L9 AnWfbytb53T27aWm5YHnhpceFzaZSrE= X-Google-Smtp-Source: AK7set8Tm/TSIEZcfpzNQHxMvjCS+yaM/NrdaI1BCSothjs8eM+xnWDsp7nUJq19zUWizrt7AaLBmw== X-Received: by 2002:a17:906:a3c2:b0:887:9a7f:4326 with SMTP id ca2-20020a170906a3c200b008879a7f4326mr32668635ejb.8.1678709755384; Mon, 13 Mar 2023 05:15:55 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id x16-20020a170906135000b00928de86245fsm1284785ejb.135.2023.03.13.05.15.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:55 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 04/14] selftest: wic: respect IMAGE_LINK_NAME also in test_rawcopy_plugin_qemu Date: Mon, 13 Mar 2023 13:15:31 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178437 * this one is more tricky, because the test_rawcopy_plugin.wks.in file is used while building core-image-minimal-mtdutils, but the image filename inside wks.in is from core-image-minimal, so we cannot just let bitbake expand IMAGE_LINK_NAME, use separate variable set in the same config fragment IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL [YOCTO #12937] Signed-off-by: Martin Jansa --- meta-selftest/wic/test_rawcopy_plugin.wks.in | 2 +- meta/lib/oeqa/selftest/cases/wic.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-selftest/wic/test_rawcopy_plugin.wks.in b/meta-selftest/wic/test_rawcopy_plugin.wks.in index 83be4be914..a865dd1d32 100644 --- a/meta-selftest/wic/test_rawcopy_plugin.wks.in +++ b/meta-selftest/wic/test_rawcopy_plugin.wks.in @@ -1,6 +1,6 @@ # short-description: This file is used in oe-selftest wic module to test rawcopy plugin part /boot --active --source bootimg-pcbios -part / --source rawcopy --sourceparams="file=core-image-minimal-${MACHINE}.ext4" --use-uuid +part / --source rawcopy --sourceparams="file=${IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL}.ext4" --use-uuid bootloader --timeout=0 --append="console=ttyS0,115200n8" diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index 7c31848732..b26b649c3a 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py @@ -1034,9 +1034,13 @@ class Wic2(WicTestCase): config = 'IMAGE_FSTYPES = "ext4"\n' self.append_config(config) bitbake('core-image-minimal') + image_link_name = get_bb_var('IMAGE_LINK_NAME', 'core-image-minimal') self.remove_config(config) - config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' + config = 'IMAGE_FSTYPES = "wic"\n' \ + 'IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL = "%s"\n'\ + 'WKS_FILE = "test_rawcopy_plugin.wks.in"\n'\ + % image_link_name self.append_config(config) bitbake('core-image-minimal-mtdutils') self.remove_config(config) From patchwork Mon Mar 13 12:15:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20865 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 9F37BC761A6 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.web11.18077.1678709754344914061 for ; Mon, 13 Mar 2023 05:15:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VfdrSJKZ; spf=pass (domain: gmail.com, ip: 209.85.208.44, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id ek18so16709199edb.6 for ; Mon, 13 Mar 2023 05:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8lJ9GTn+ROGH2KBTGtr7eqmRluYH0fC3ZnPmyMTcw0A=; b=VfdrSJKZf4jCbw6hx1LNt73HCvvrWpNNJMN7DtYxI4CJBBXfqFwiX/2bpHGn8mfmAq 6uQoJLRDT0eLjyer5cfSaLx/fg5B6OkGDx5CKS4PiicSgIs40zuYHaWcyrqgtALtu9Bq 1hulTb+9Yz53JhUzowz6eBQ341t3L7c9sn8ZcEcjwP89Hmm9SnTDKOR47EvWK0sfWNEL rwz/0bmBmAGvMJAfNDEfHMbgpnGNdn5Bh1Bqkxidw+FBkcmquaeEx0KPiXvdwe2uXoof cY8RZi7mcmHjtZF8jgi2H4k2cG1M87NCUM1KDymyU0M5UaIL1YRcn6hvG3enkP9OgYbe 9jwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8lJ9GTn+ROGH2KBTGtr7eqmRluYH0fC3ZnPmyMTcw0A=; b=Yg/8MjHnx1Js8s+/hBFqdNXoyrv48Y4sMhcu4qF2H5DO6nRCKacxa+nDZ2GIvhP5IF 6wF8Y5xUVlj8gzhUQaANbrmimJ89qL7a62dHcty5hlqjE+09NdYfJzCOSQ9XZv7AWVmw 5gkMpkDxHxAEyenHSGMBjh86Be3ICqywm78hecdNilHpLwU+4RHqwPZtr2Yun6dvAYwX yH8KNTiiSdZTzowUnTNj13IyHV7J0GpWfzlcC+oh77/2G5VFHiTGMf6b8EZ9kBeh4haX xtlwdZxdtE4fkP7R6KTIz4JRve+O+5kVIjRRLjkhXxwroq46Ow3i8aLFBpBYM1EiIojT NsIQ== X-Gm-Message-State: AO0yUKXJRsm7E0Eu8W08fO6H+WKxMv8FE5CIkbCbxUSSivFVpt3mdBZY XOa3n9OVv7VdZ9pfi1gWS+e/tymz0O4= X-Google-Smtp-Source: AK7set+MW/1wl62vNhqr1w4LlYV+KlvJrGDk+8kylYzIyXjkY3jou9tqzTPZota6yweHai0JTeZkHQ== X-Received: by 2002:a17:907:7b83:b0:925:9900:2df with SMTP id ne3-20020a1709077b8300b00925990002dfmr6212218ejc.35.1678709756071; Mon, 13 Mar 2023 05:15:56 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id h25-20020a170906399900b008cda6560404sm3333837eje.193.2023.03.13.05.15.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:55 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 05/14] selftest: runqemu: respect IMAGE_LINK_NAME Date: Mon, 13 Mar 2023 13:15:32 +0100 Message-Id: <3272c0f7bb3829eee4ff5a69546071ee08237eff.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178436 * don't assume that every built image is named: -. [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/runqemu.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py index c2c3fbc924..e72ff529c4 100644 --- a/meta/lib/oeqa/selftest/cases/runqemu.py +++ b/meta/lib/oeqa/selftest/cases/runqemu.py @@ -24,6 +24,7 @@ class RunqemuTests(OESelftestTestCase): super(RunqemuTests, self).setUpLocal() self.recipe = 'core-image-minimal' self.machine = self.td['MACHINE'] + self.image_link_name = get_bb_var('IMAGE_LINK_NAME', self.recipe) self.fstypes = "ext4" if self.td["HOST_ARCH"] in ('i586', 'i686', 'x86_64'): @@ -127,7 +128,7 @@ SYSLINUX_TIMEOUT = "10" def test_boot_qemu_boot(self): """Test runqemu /path/to/image.qemuboot.conf""" - qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine) + qemuboot_conf = "%s.qemuboot.conf" % (self.image_link_name) qemuboot_conf = os.path.join(self.deploy_dir_image, qemuboot_conf) if not os.path.exists(qemuboot_conf): self.skipTest("%s not found" % qemuboot_conf) @@ -138,7 +139,7 @@ SYSLINUX_TIMEOUT = "10" def test_boot_rootfs(self): """Test runqemu /path/to/rootfs.ext4""" - rootfs = "%s-%s.ext4" % (self.recipe, self.machine) + rootfs = "%s.ext4" % (self.image_link_name) rootfs = os.path.join(self.deploy_dir_image, rootfs) if not os.path.exists(rootfs): self.skipTest("%s not found" % rootfs) @@ -167,8 +168,9 @@ class QemuTest(OESelftestTestCase): cls.recipe = 'core-image-minimal' cls.machine = get_bb_var('MACHINE') cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') + cls.image_link_name = get_bb_var('IMAGE_LINK_NAME', cls.recipe) cls.cmd_common = "runqemu nographic" - cls.qemuboot_conf = "%s-%s.qemuboot.conf" % (cls.recipe, cls.machine) + cls.qemuboot_conf = "%s.qemuboot.conf" % (cls.image_link_name) cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf) bitbake(cls.recipe) @@ -200,7 +202,7 @@ class QemuTest(OESelftestTestCase): self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout)) def test_qemu_can_boot_nfs_and_shutdown(self): - rootfs_tar = "%s-%s.tar.bz2" % (self.recipe, self.machine) + rootfs_tar = "%s.tar.bz2" % (self.image_link_name) rootfs_tar = os.path.join(self.deploy_dir_image, rootfs_tar) self.assertExists(rootfs_tar) cmd = "%s %s" % (self.cmd_common, rootfs_tar) From patchwork Mon Mar 13 12:15:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20866 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 9A0D9C76195 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mx.groups.io with SMTP id smtpd.web11.18078.1678709754883925084 for ; Mon, 13 Mar 2023 05:15:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=G4i18C4P; spf=pass (domain: gmail.com, ip: 209.85.208.54, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id ek18so16709323edb.6 for ; Mon, 13 Mar 2023 05:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5c2E6WOxZ/Cw6BBC3253PXbKJVut+wrJI+KYSV7aXI8=; b=G4i18C4PEtZt/oBhCnWigxhcmAhvC48Cjx8mdkJXX2S5nHcfcMUefJh4A8c567K3JQ RbedvkLuNDqrV+t8QMJkhlOH9WND4yE/i7MJmP4Nkcs/RM65v/QJm1nC3ej+K2XPtuRF TF/zhubGmSPf3qqpSHnmQxwxgkFM8AG0mj3Vz1BG9OSSDt6UFB24uHZJ3xTLJFhxw+yT ofMkHfzqCi5N9bQUbjUrdPQfjdILxvlIS0cjHPWylDmq9/Nz9CZetfi0LNe/5+8o7GWo d2y+xz+c3PlWkTnbNqpClCKeaENUiwpTlFyQR/t2oGAMzA/drya7+MQAyKHOjez2iaTJ hhEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5c2E6WOxZ/Cw6BBC3253PXbKJVut+wrJI+KYSV7aXI8=; b=sQi9aek+xWUBox3oxAthMq+uQd2ElUD/T9CN/SxNXVQb0KJE9iyQLl807rTtf6d+yS THLJNWumWTxlFo8dLh59/+8ZP/L3rw+oYYRC8N8uiuIZMIyTg/62+Gulbemn0kfdevUg gCvqqOmk14XMGcHW3W7A82RJwEl+U5kGuRhr4XT3Ss2opi7LkKTx9r8Tfy+aHf/Vkana W5bKSajZjfqjzHsETrX8AlZ+5E0p/v5PoT3EjieKxy86BrHHOXdpVdRCfV/UMI6V9bg+ f5q7BIMwSkwJ/Ox5BrXXSY54Q5O3NQAjigaiRjp3mDpMJx8TldvxKYja4NzDPJLZh6Rd FvpQ== X-Gm-Message-State: AO0yUKW6q88tI514vspObLY8A50pTshYcaLNaLDt4DejUAWIHoNrmU6n upwwkoEOHAECrSKiTEE9l6dONbhxKEQ= X-Google-Smtp-Source: AK7set/7OHoRdZOkfThPsO6fGtVH/4lwbZE9T3i5T76CuYrwmTkZAR+Y8IGLpJMgPHtawVAkHfGaxw== X-Received: by 2002:a17:906:1c1b:b0:92a:3b19:9a4c with SMTP id k27-20020a1709061c1b00b0092a3b199a4cmr2393776ejg.27.1678709756764; Mon, 13 Mar 2023 05:15:56 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id lf17-20020a170907175100b008db605598b9sm3377708ejc.67.2023.03.13.05.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:56 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 06/14] selftest: multiconfig-image-packager: try to respect IMAGE_LINK_NAME Date: Mon, 13 Mar 2023 13:15:33 +0100 Message-Id: <5984d0506771aa4016478e94a62d49882d4dffdd.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178438 * this still assumes that IMAGE_LINK_NAME will contain IMAGE_BASENAME which will be BPN 'multiconfig-image-packager' and that replacing it with 'core-image-minimal' will match with the actual IMAGE_LINK_NAME from core-image-minimal recipe - there is no good way to query core-image-minimal's context, but this is still closer than assuming: core-image-minimal-${MCMACHINE}.${MCIMGTYPE} which works only with the current default: IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" [YOCTO #12937] Signed-off-by: Martin Jansa --- .../multiconfig-image-packager_0.1.bb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb index daf2834958..d7785cee2e 100644 --- a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb +++ b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb @@ -7,15 +7,19 @@ MCIMGTYPE:virtclass-mcextend-musl = "ext4" MCIMGTYPE:virtclass-mcextend-tiny = "cpio.gz" MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" +MC_DEPLOY_IMAGE_BASENAME = "core-image-minimal" do_install[mcdepends] += "mc::${MCNAME}:core-image-minimal:do_image_complete mc::${MCNAME}:virtual/kernel:do_deploy" do_install () { install -d ${D}/var/lib/machines/${MCNAME} - install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE} + install ${MC_DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/${MC_DEPLOY_IMAGE_BASENAME}.${MCIMGTYPE} install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME} } +# for IMAGE_LINK_NAME, IMAGE_BASENAME +inherit image-artifact-names + python () { mcname = d.getVar('MCNAME') if not mcname: @@ -23,6 +27,18 @@ python () { multiconfigs = d.getVar('BBMULTICONFIG') or "" if mcname not in multiconfigs: raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname) + + # these will most likely start with my BPN multiconfig-image-packager, but I want them from core-image-minimal + # as there is no good way to query core-image-minimal's context lets assume that there are no overrides + # and that we can just replace IMAGE_BASENAME + image_link_name = d.getVar('IMAGE_LINK_NAME') + image_basename = d.getVar('IMAGE_BASENAME') + machine = d.getVar('MACHINE') + mcmachine = d.getVar('MCMACHINE') + image_to_deploy = d.getVar('MC_DEPLOY_IMAGE_BASENAME') + image_link_name_to_deploy = image_link_name.replace(image_basename, image_to_deploy).replace(machine, mcmachine) + bb.warn('%s: assuming that "%s" built for "%s" has IMAGE_LINK_NAME "%s"' % (d.getVar('PN'), mcmachine, image_to_deploy, image_link_name_to_deploy)) + d.setVar('IMAGE_LINK_NAME_CORE_IMAGE_MINIMAL', image_link_name_to_deploy) } BBCLASSEXTEND = "mcextend:tiny mcextend:musl" From patchwork Mon Mar 13 12:15:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20863 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 84414C76196 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by mx.groups.io with SMTP id smtpd.web10.17699.1678709758962351284 for ; Mon, 13 Mar 2023 05:15:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Mqo5BA4O; spf=pass (domain: gmail.com, ip: 209.85.208.44, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f44.google.com with SMTP id r15so20638881edq.11 for ; Mon, 13 Mar 2023 05:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=W1CS1YCv7Dnz2AOpLFWitdlyME3wgbwbhMu97MvtRbg=; b=Mqo5BA4OwXgJ6MMrN7Oc93cRFn3yQsR+Qoh+v9yWJniEqATaAN7u/oy9EjM1AGM6hs yCVtAriYadvm1VZgny41aVgho8NT4drIwENvMvbJQRe2NOe5R/h9ChLFl6Qdrwvhjvbw nQyiHfmAONUp/r2LRX7/BvUnWSvhALh1+MhRW6605W544z6UwPideB3YeoIUrVIHqsC9 lly8XfArUm4VqnVgJWxNpRmSlzO8u2mu4Zx/wltMGyFFAUfHNfGEkQ0EZCg190rME1k0 e0SvHex2oWnp6dbN8VdxBFhaaSTbfUb0mIZBvyqb27upTEREZAthUmesu/JF8xI26JZo VVuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W1CS1YCv7Dnz2AOpLFWitdlyME3wgbwbhMu97MvtRbg=; b=EQ6vfsqnUZiorFqYTLQN7PqkIB+h3lgTTt1eMGRZL8LHyXOE8W8/29D5RNiU+NRCc0 PMdabghQIuPy9oqqBVsmR/S9Kwt2QO7OZnyHDzH4kL680VL4q/egIyXdaBFExkympOmK RhUqvKCkgG536j+IYES8xXVgztRv9XGOvWdgvnCd7L0/1YDPWTZe3ZSAuc2xwEEQeUA6 BMPZXdM54Mg1l1IkT4YPhG+1vTkwvGpmsu2j5M/iADEk92L7iuDhCp5wqzxeBeXWPLAi wNb2zOtVH9g+vmqJDfYjh4n99aaCw9RpJgmefQF9SJkXQHm+OpoCJqR8C+iFv7laWaMM o9CQ== X-Gm-Message-State: AO0yUKU6etWiCkcXw4aiy3sg1UwIUnUk+XB5MQa43hsAyxbmeZNgbiGj zzDxs/tzoOMSz4UF2yXECuQxUkOC7HI= X-Google-Smtp-Source: AK7set8arBO1/rZqM8ZIkWkZ/LNjzdJxwmH+E7+StaJaPm3mePjDmFlBD55bh+Dl2Wx4nKOOPpfanw== X-Received: by 2002:a17:906:1604:b0:879:bff:55c with SMTP id m4-20020a170906160400b008790bff055cmr7107773ejd.1.1678709757393; Mon, 13 Mar 2023 05:15:57 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id u13-20020a50950d000000b004af70c546dasm3138695eda.87.2023.03.13.05.15.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:57 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 07/14] image-artifact-names.bbclass: add INITRAMFS_IMAGE_NAME from kernel.bbclass Date: Mon, 13 Mar 2023 13:15:34 +0100 Message-Id: <94b43880d87f405dec680b0a6f666af7b0c774a0.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178439 * move it from kernel.bbclass, because it needs to stay in sync with IMAGE_LINK_NAME structure * image-artifact-names.bbclass is also inheritted from kernel-artifact-names.bbclass so every recipe which needs this variable probably already inherits one of these * fixes kernel-fitimage.bbclass with modified IMAGE_LINK_NAME [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/classes-recipe/image-artifact-names.bbclass | 3 +++ meta/classes-recipe/kernel.bbclass | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/image-artifact-names.bbclass b/meta/classes-recipe/image-artifact-names.bbclass index 5c4e746b90..9dc25b6dde 100644 --- a/meta/classes-recipe/image-artifact-names.bbclass +++ b/meta/classes-recipe/image-artifact-names.bbclass @@ -14,6 +14,9 @@ IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH" IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" +# This needs to stay in sync with IMAGE_LINK_NAME, but with INITRAMFS_IMAGE instead of IMAGE_BASENAME +INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}" + # IMAGE_NAME is the base name for everything produced when building images. # The actual image that contains the rootfs has an additional suffix (.rootfs # by default) followed by additional suffices which describe the format (.ext4, diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 92090ac14e..aefa0d21bc 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass @@ -33,7 +33,6 @@ INHIBIT_DEFAULT_DEPS = "1" KERNEL_IMAGETYPE ?= "zImage" INITRAMFS_IMAGE ?= "" -INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}" INITRAMFS_TASK ?= "" INITRAMFS_IMAGE_BUNDLE ?= "" INITRAMFS_DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR_IMAGE}" From patchwork Mon Mar 13 12:15:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20864 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 86EC2C7619A for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mx.groups.io with SMTP id smtpd.web11.18080.1678709759521615330 for ; Mon, 13 Mar 2023 05:15:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LvN7S8nO; spf=pass (domain: gmail.com, ip: 209.85.208.49, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f49.google.com with SMTP id j11so47845967edq.4 for ; Mon, 13 Mar 2023 05:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6ycQ2HUyoiiLKSMarD7UHyDMX5t5B9d2d15K+0m7BJA=; b=LvN7S8nOwgalL0Q74VOEDjY0Zb1DF3jeB97n/byvfcG0Ngq7R3SZVeM9YB4acgrtMa DGNoiAB7dhz5b4/7Ux2lsqnxRMZCx7Su4dlTnhXfQXzQO/zZkPB5SYvehXxwREInL7rO 4j8ymyP6YVPb67ftpnA8af7bExcs0y+qxX7LQ3UYLbbCSady0idp5G38T2tubE5/4H3g uTkzj3oAvjU+VkF821f+B7wJsK+DL1wo4Roz8xNjg/EBKvRpcKok5iaYGHMucAgvniDy H0NTBJ7Snj8trxWe0ETYtjPt3o9XRxoYsKDTlamfFlddlRHOc+cX17GP5uOmef6Voa67 L58A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ycQ2HUyoiiLKSMarD7UHyDMX5t5B9d2d15K+0m7BJA=; b=br6TQY9QMpNhS+GXQ9g/uwRQLf2i4BMlEMJcPupHKjh69bgEOr1Y8531D6kYa1aGPB VEiz+uhoXQqTFKR0SdrJRf7XSuHY3lvsuw69YAEMecczSmoIjWXAVtHfO5fchCvBHdbr irPnDk/tPnP2rfME5lW7AG9SoQ5E3snkBoKHeMGa5WExlY9w6fbnfCDPMZGhuj9Zs9s1 RfAiAddSRHajiJtttpL4uqFhFHPlJeCFKvR90btzpY44zBTGF081EO7Tm8n04F4kn0ph jxlGZIgEmX4ZzL+asyYoKQRZjtw+N8Z8pF+tpGdR6zru3KbtlY4xIjceyFy09tjPGgc/ AVUA== X-Gm-Message-State: AO0yUKVj3xlV4qFxJZPgGQX+pRAHJk4wR/aA8ynkJZLilqhxctH6Sbxy fBvm+EeONE1PADGXTzK801qaW5s5q1E= X-Google-Smtp-Source: AK7set+7onMxJztN9llUaK+I0EleU5098rnkZg3xaDUGmkE24UZXoaD+++MlsabB6q6yYWwgeG7x3w== X-Received: by 2002:a17:906:1643:b0:871:dd2:4af0 with SMTP id n3-20020a170906164300b008710dd24af0mr35785004ejd.26.1678709758082; Mon, 13 Mar 2023 05:15:58 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id vo11-20020a170907a80b00b008b17de9d1f2sm3399253ejc.15.2023.03.13.05.15.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:57 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 08/14] selftest: fitimage.py: respect INITRAMFS_IMAGE_NAME and KERNEL_FIT_LINK_NAME Date: Mon, 13 Mar 2023 13:15:35 +0100 Message-Id: <6a87e08d2b541553ef7bb93b2afbd0a28e4177ea.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178440 * use these variables instead of assuming: "fitImage-its-%s-%s-%s" % (image_type, machine, machine) notice that these files have no extension and the -machine suffix is duplicated (once from core-image-minimal and once from kernel-fitimage.bbclass:kernel_do_deploy:append through KERNEL_FIT_LINK_NAME which is MACHINE by default: KERNEL_FIT_NAME ?= "${KERNEL_ARTIFACT_NAME}" KERNEL_FIT_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}" KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}" [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/fitimage.py | 34 +++++++++++------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py index 1570d54dfb..7bc171e02d 100644 --- a/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/meta/lib/oeqa/selftest/cases/fitimage.py @@ -5,7 +5,7 @@ # from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import runCmd, bitbake, get_bb_var +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars import os import re @@ -42,15 +42,14 @@ FIT_DESC = "A model description" self.write_config(config) # fitImage is created as part of linux recipe - bitbake("virtual/kernel") + image = "virtual/kernel" + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'INITRAMFS_IMAGE_NAME', 'KERNEL_FIT_LINK_NAME'], image) - image_type = "core-image-minimal" - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - machine = get_bb_var('MACHINE') - fitimage_its_path = os.path.join(deploy_dir_image, - "fitImage-its-%s-%s-%s" % (image_type, machine, machine)) - fitimage_path = os.path.join(deploy_dir_image, - "fitImage-%s-%s-%s" % (image_type, machine, machine)) + fitimage_its_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], + "fitImage-its-%s-%s" % (bb_vars['INITRAMFS_IMAGE_NAME'], bb_vars['KERNEL_FIT_LINK_NAME'])) + fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], + "fitImage-%s-%s" % (bb_vars['INITRAMFS_IMAGE_NAME'], bb_vars['KERNEL_FIT_LINK_NAME'])) self.assertTrue(os.path.exists(fitimage_its_path), "%s image tree source doesn't exist" % (fitimage_its_path)) @@ -123,15 +122,14 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" self.write_config(config) # fitImage is created as part of linux recipe - bitbake("virtual/kernel") - - image_type = "core-image-minimal" - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - machine = get_bb_var('MACHINE') - fitimage_its_path = os.path.join(deploy_dir_image, - "fitImage-its-%s" % (machine,)) - fitimage_path = os.path.join(deploy_dir_image, - "fitImage-%s.bin" % (machine,)) + image = "virtual/kernel" + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'KERNEL_FIT_LINK_NAME'], image) + + fitimage_its_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], + "fitImage-its-%s" % (bb_vars['KERNEL_FIT_LINK_NAME'])) + fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], + "fitImage-%s.bin" % (bb_vars['KERNEL_FIT_LINK_NAME'])) self.assertTrue(os.path.exists(fitimage_its_path), "%s image tree source doesn't exist" % (fitimage_its_path)) From patchwork Mon Mar 13 12:15:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20862 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 84350C7618E for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mx.groups.io with SMTP id smtpd.web11.18081.1678709760320240602 for ; Mon, 13 Mar 2023 05:16:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=H9A9nalU; spf=pass (domain: gmail.com, ip: 209.85.208.41, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f41.google.com with SMTP id fd5so13954487edb.7 for ; Mon, 13 Mar 2023 05:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8abbq+PjyCVRZ+oaXsw+0IWSp1RY1n+4YNXwFKz1knQ=; b=H9A9nalUYkPkgRZoat1q0olydFz8T08I3qyEZfB0KbOst5rncJYI9DEmFskyL7Rlwn 7P3IhpT5xh616CRDYsop3mJx3BhdNy5rQc/751b6H166oZ2BiS3IgMEfLlRWNMQbCvn4 JAkZeKnv0MKzhpm2pFGZn8a7edS4yxZEJVl5xFjT7X6+RHZXOOd6wzK/X5JR+DV5jnW0 8zUav9C3a9mMkAzcxWaJV/8AOnU+afBRQpwyb+BrQ6+9j4GX4qWr4/rqrnPItEYXuABJ XcKlX0CxNI5fBWAlTNeLJU02wsuhCRTGgIthesid0y9phdifhjbXhwUs4DfRobuCkRC6 61xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8abbq+PjyCVRZ+oaXsw+0IWSp1RY1n+4YNXwFKz1knQ=; b=AQ0KTIZ6WYyPGo9bGMkoPMUElEUCQLQ0oL0680IhUnpOZHXg8g3HTwBbTg85aomlp1 MpnadMNBdts/0RCUW/rIKRzwbSoVD+NZY63PtIVXf0dBE+5B8bJB4IW3jnWxHmY7aKSM r9+Zlz1nPSvOnOjHgAMT5RAUYa2CL/ihQTvN1RHkg5KHdKqdK0SzJm+ly9L2bJOFb4v3 FQrAmVcLeG0NkFJ9BOJlk/G6GL/AujhGHqlTHfmQceE2ezqP8X2d7GV9t1ntvePpSU0n zlJgCtm423XfZ7fETFcKrb6aMaGZLIC6Sep0OkoWEciwCzefIhxUkK4zTTK0Yrt0KCij FURQ== X-Gm-Message-State: AO0yUKXz5Tievjap/31N+ntZDlHitM/YLPxRAAQn5DnH3VHLdlF/HdQt 0/nFc2Tn+dGuR1MYLd9156M+JOtSrbg= X-Google-Smtp-Source: AK7set/FecBhG7P1mCLlkPjnx3IkUJIC+XS53xHHppdq2SPAux4fzsFCM7U7dUDv4oN5Ens69V4DLw== X-Received: by 2002:a17:906:66d8:b0:872:b17a:9b59 with SMTP id k24-20020a17090666d800b00872b17a9b59mr32505403ejp.38.1678709758799; Mon, 13 Mar 2023 05:15:58 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id y24-20020a50ce18000000b004fc2a75c6b3sm1272986edi.23.2023.03.13.05.15.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:58 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 09/14] image-artifact-names: add IMAGE_MACHINE_SUFFIX variable Date: Mon, 13 Mar 2023 13:15:36 +0100 Message-Id: <06c7db2b170b9cf47c803ea12c83b58f886074b2.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178441 * to make it easier for projects to avoid default -${MACHINE} suffix if the ${MACHINE} named DEPLOY_DIR_IMAGE works better for them * also use IMAGE_LINK_NAME in IMAGE_NAME to make it more clear that IMAGE_NAME is the same as IMAGE_LINK_NAME but with version suffix * adding it as separate variable helps us to catch the cases where we didn't respect ${IMAGE_LINK_NAME} variable and just used the common default ${IMAGE_BASENAME}-${MACHINE}. [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/classes-recipe/image-artifact-names.bbclass | 15 ++++++++++++--- meta/classes-recipe/kernel-artifact-names.bbclass | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/meta/classes-recipe/image-artifact-names.bbclass b/meta/classes-recipe/image-artifact-names.bbclass index 9dc25b6dde..ac2376d59a 100644 --- a/meta/classes-recipe/image-artifact-names.bbclass +++ b/meta/classes-recipe/image-artifact-names.bbclass @@ -11,11 +11,20 @@ IMAGE_BASENAME ?= "${PN}" IMAGE_VERSION_SUFFIX ?= "-${DATETIME}" IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH" -IMAGE_NAME ?= "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" -IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_NAME ?= "${IMAGE_LINK_NAME}${IMAGE_VERSION_SUFFIX}" +IMAGE_LINK_NAME ?= "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}" # This needs to stay in sync with IMAGE_LINK_NAME, but with INITRAMFS_IMAGE instead of IMAGE_BASENAME -INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}" +INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}${IMAGE_MACHINE_SUFFIX}', ''][d.getVar('INITRAMFS_IMAGE') == '']}" + +# The default DEPLOY_DIR_IMAGE is ${MACHINE} directory: +# meta/conf/bitbake.conf:DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}" +# so many people find it unnecessary to include this suffix to every image +# stored there, but other people often fetch various images for different +# MACHINEs to the same downloads directory and then the suffix is very helpful +# add separate variable for projects to decide which scheme works best for them +# without understanding the IMAGE_NAME/IMAGE_LINK_NAME structure. +IMAGE_MACHINE_SUFFIX ??= "-${MACHINE}" # IMAGE_NAME is the base name for everything produced when building images. # The actual image that contains the rootfs has an additional suffix (.rootfs diff --git a/meta/classes-recipe/kernel-artifact-names.bbclass b/meta/classes-recipe/kernel-artifact-names.bbclass index 311075c68d..1a7611a15e 100644 --- a/meta/classes-recipe/kernel-artifact-names.bbclass +++ b/meta/classes-recipe/kernel-artifact-names.bbclass @@ -12,7 +12,7 @@ inherit image-artifact-names -KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" +KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}${IMAGE_MACHINE_SUFFIX}${IMAGE_VERSION_SUFFIX}" KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}" KERNEL_ARTIFACT_BIN_EXT ?= ".bin" From patchwork Mon Mar 13 12:15:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20859 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 7127BC74A4B for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) by mx.groups.io with SMTP id smtpd.web10.17700.1678709760911844287 for ; Mon, 13 Mar 2023 05:16:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SHk8oXWK; spf=pass (domain: gmail.com, ip: 209.85.208.43, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f43.google.com with SMTP id cy23so47743087edb.12 for ; Mon, 13 Mar 2023 05:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=njhpSlO+dH1xrPJ+Lg6kD+yHdRQzV3XMF4BU10W/xhw=; b=SHk8oXWKmxcO2CKtxbLSMr+mmTVaHLiC0F4IgHXiv685IwA/5cgUKcrJ3/m/m7mYym r2VIhhI3oUsUS2mEdfkIZ0p3vT6qaU2dR/0yb4qhAUG7LRK1UnXPRG3FVMIEZRbzH7O3 u5wM+A1+MZwsPu9rqUz4PCvepmKF4cy4NBvtGpZYsYIr7rV5PhY3Ugmd71V7P3NNAx2H 6OYFG72PygKXXQqmzyNXa9kq+Hlk7gbd1QVsjjH4nHxnWnkFM42f4u8+i131KjAb0BGs 7JyBgblvhHnIn8yeDAlXRY7mkSdd2tUJalABpzBJi5nYoXpaRCzQN0lj6PBKGrJEC/4d 6T9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=njhpSlO+dH1xrPJ+Lg6kD+yHdRQzV3XMF4BU10W/xhw=; b=wiCxCzXxjK2gjzqtsx0aRL4KEzBe0DNEvIPEKoP/7XfRjbpPXRzewxXmBDRLAZehNV ooHTzLB03r5u0srMlrmY4JdvyQ16ffAmIOSNl4hkik8q3Aoj0OsiYsAJ7bOjdAGbyEKo FF88XBgdfVqUEArcxf44jbnjR0QOhv4zaX9WEXUAQFoU3WAHn2oPZjL4UuV8E0hdZR/F /D7ngd+THL+dzUrXK31452JWZmcS/zeR3iI6ocGVUHCNluQK/h3CY5YWgY0DOLrPJPoQ sVjkckFltRejcn7FkeJe1DmMW6PybztNVDJ7V2G6hPhuId/FpEOghfyaozXZt2swFV0U a3xg== X-Gm-Message-State: AO0yUKVNnK2i6tF45QVmObGn4Ytv4TgS3BLes742LWjkEObI6q10y/cp LAXG9ll0sgiyjtwqCfNXwIhusCar2jk= X-Google-Smtp-Source: AK7set+KuPT2nzIC/4Yyen89yZJ13lmwo9Cva97y3jQrRJEBBgxXRkHY60Z46+2Hr3M2iunOp/VHsQ== X-Received: by 2002:a17:907:c25:b0:8b2:fb3d:95e6 with SMTP id ga37-20020a1709070c2500b008b2fb3d95e6mr41128622ejc.74.1678709759430; Mon, 13 Mar 2023 05:15:59 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id d3-20020a50cd43000000b004bbb691a334sm3179208edj.2.2023.03.13.05.15.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:59 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 10/14] selftest: gdbserver.py: respect IMAGE_LINK_NAME Date: Mon, 13 Mar 2023 13:15:37 +0100 Message-Id: <631e960b15079d04c24a407810c2af2bd6bf1416.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178442 * use IMAGE_LINK_NAME instead of hardcoding core-image-minimal-${MACHINE} assumption [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/gdbserver.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/gdbserver.py b/meta/lib/oeqa/selftest/cases/gdbserver.py index 3621d9c13e..9da97ae780 100644 --- a/meta/lib/oeqa/selftest/cases/gdbserver.py +++ b/meta/lib/oeqa/selftest/cases/gdbserver.py @@ -10,13 +10,12 @@ import shutil import concurrent.futures from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, get_bb_var, runqemu, runCmd +from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars , runqemu, runCmd class GdbServerTest(OESelftestTestCase): def test_gdb_server(self): target_arch = self.td["TARGET_ARCH"] target_sys = self.td["TARGET_SYS"] - deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE") features = """ IMAGE_GEN_DEBUGFS = "1" @@ -34,11 +33,13 @@ CORE_IMAGE_EXTRA_INSTALL = "gdbserver" r = runCmd("%s --version" % gdb_binary, native_sysroot=native_sysroot, target_sys=target_sys) self.assertEqual(r.status, 0) self.assertIn("GNU gdb", r.output) + image = 'core-image-minimal' + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) with tempfile.TemporaryDirectory(prefix="debugfs-") as debugfs: - filename = os.path.join(deploy_dir, "core-image-minimal-%s-dbg.tar.bz2" % self.td["MACHINE"]) + filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s-dbg.tar.bz2" % bb_vars['IMAGE_LINK_NAME']) shutil.unpack_archive(filename, debugfs) - filename = os.path.join(deploy_dir, "core-image-minimal-%s.tar.bz2" % self.td["MACHINE"]) + filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.tar.bz2" % bb_vars['IMAGE_LINK_NAME']) shutil.unpack_archive(filename, debugfs) with runqemu("core-image-minimal", runqemuparams="nographic") as qemu: From patchwork Mon Mar 13 12:15:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20860 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 7396BC7618B for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by mx.groups.io with SMTP id smtpd.web10.17701.1678709761506297772 for ; Mon, 13 Mar 2023 05:16:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=E6LywRHs; spf=pass (domain: gmail.com, ip: 209.85.208.45, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f45.google.com with SMTP id x3so47782359edb.10 for ; Mon, 13 Mar 2023 05:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=57WaDLJG9kvhgQCcZ9Eyd3zHWgrC1gV3xBCF+F7P/Lc=; b=E6LywRHsQ+Zk5KBBhliAFgxTNSGeDEN+VG8s3/WQZU/+0JAvHuthJINJQPYMQdlnDp XGWTIqBqgvNTskXHRNBK+iE7mEaLJBA6iZXLsrUuORmK4sEDecV+B7x9MABo25iId5O/ NIfYtVhjMjw1OxoAkXkO8dFGGBrVAXyX+XOKeCz7YxXMEAmDbhSIfWNJ0apTLeiD2PjA pLoK9OsNmxBCcsjCY8iKU3DXeVfarY9vblw2RBpZ53WsL9sXzuEQXY4bKz96UDqLt87Q IBVSigL2qMm/EXagDKg0Sieam9kersSPhPGLROboqk18pmzaM1Ug0kbz/eZveWNXWoTq CUAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709760; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=57WaDLJG9kvhgQCcZ9Eyd3zHWgrC1gV3xBCF+F7P/Lc=; b=NEs1X7f7TIZT0p4Pu/Ox6qQToO7P3e5YEgQhc8IADIgRb6VNm+6liBH9mULPi3HEw8 OMElMWiEHbSTJG/+ZuLUxf1g+ZZAhLmbeDgsK35dD29Oi/iVQThearkFT+Yspi718uhZ 9HtITE5oYQg3Gu5F0BEn7FeFPyf8rzO8gxXSV6G9b4IXVlTv4rKtcg0xGAn/WTZRUTIA Qgo/Fghm+4ag0/XG3aBym9jnNZ7Y8wfO6LVCaXIVtztLPpZPNRLpJW0LocZCYbtYD2GU r95B5151rv4DRbKMb9CImeqIYLVdpXBBWVqeu/JQ59NrMUghivSvH32ospKItoXGelNH 403g== X-Gm-Message-State: AO0yUKVnzklckFIAJx0HtCise6PY8JLvNudS3FZqklrqaMYkzjB3z/Df xtnsRIUMvW78nnYQP50Euk/w3s7LyrQ= X-Google-Smtp-Source: AK7set8YUtUVoan8WRlf+pzmALxWTdL6QT5OYMYLyNs9OZrLZ+s5bDG10zx2DOT7shk2/L/m3Ep1GA== X-Received: by 2002:a17:906:66d8:b0:872:b17a:9b59 with SMTP id k24-20020a17090666d800b00872b17a9b59mr32505477ejp.38.1678709760058; Mon, 13 Mar 2023 05:16:00 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id hb1-20020a170906b88100b008e385438c76sm3393559ejb.55.2023.03.13.05.15.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:15:59 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/14] selftest: minidebuginfo.py respect IMAGE_LINK_NAME Date: Mon, 13 Mar 2023 13:15:38 +0100 Message-Id: <7e8b511f1c9772a23c7666062883f15dac90a472.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178443 * use IMAGE_LINK_NAME instead of hardcoding core-image-minimal-${MACHINE} assumption [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/minidebuginfo.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/minidebuginfo.py b/meta/lib/oeqa/selftest/cases/minidebuginfo.py index 7947c3803c..aa1f9fa1f7 100644 --- a/meta/lib/oeqa/selftest/cases/minidebuginfo.py +++ b/meta/lib/oeqa/selftest/cases/minidebuginfo.py @@ -9,7 +9,7 @@ import tempfile import shutil from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, get_bb_var, runCmd +from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runCmd class Minidebuginfo(OESelftestTestCase): @@ -17,27 +17,28 @@ class Minidebuginfo(OESelftestTestCase): target_sys = get_bb_var("TARGET_SYS") binutils = "binutils-cross-{}".format(get_bb_var("TARGET_ARCH")) + image = 'core-image-minimal' + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME', 'READELF'], image) + self.write_config(""" PACKAGE_MINIDEBUGINFO = "1" IMAGE_FSTYPES = "tar.bz2" """) - bitbake("core-image-minimal {}:do_addto_recipe_sysroot".format(binutils)) + bitbake("{} {}:do_addto_recipe_sysroot".format(image, binutils)) - deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE") native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", binutils) - readelf = get_bb_var("READELF", "core-image-minimal") # confirm that executables and shared libraries contain an ELF section # ".gnu_debugdata" which stores minidebuginfo. with tempfile.TemporaryDirectory(prefix = "unpackfs-") as unpackedfs: - filename = os.path.join(deploy_dir, "core-image-minimal-{}.tar.bz2".format(self.td["MACHINE"])) + filename = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "{}.tar.bz2".format(bb_vars['IMAGE_LINK_NAME'])) shutil.unpack_archive(filename, unpackedfs) - r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "bin", "busybox")], + r = runCmd([bb_vars['READELF'], "-W", "-S", os.path.join(unpackedfs, "bin", "busybox")], native_sysroot = native_sysroot, target_sys = target_sys) self.assertIn(".gnu_debugdata", r.output) - r = runCmd([readelf, "-W", "-S", os.path.join(unpackedfs, "lib", "libc.so.6")], + r = runCmd([bb_vars['READELF'], "-W", "-S", os.path.join(unpackedfs, "lib", "libc.so.6")], native_sysroot = native_sysroot, target_sys = target_sys) self.assertIn(".gnu_debugdata", r.output) From patchwork Mon Mar 13 12:15:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20858 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 72568C7618D for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by mx.groups.io with SMTP id smtpd.web11.18084.1678709762321138910 for ; Mon, 13 Mar 2023 05:16:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CEEWoYCt; spf=pass (domain: gmail.com, ip: 209.85.208.54, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f54.google.com with SMTP id x13so550641edd.1 for ; Mon, 13 Mar 2023 05:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=frcfsW8gyrHmpET78rxcCSF0PPOsgcaxdCPTbJt+CBQ=; b=CEEWoYCtNI3C/V8Vkfu7vSxAU77oQmLYJ85n3xXrO2F309xTW6QpNUGITm3e+rGrXM oLiu/IPM/aqqOE0IrQzQ6zRwsQdHGuIXl1/vdLIe534aD0hJsecU2Si+EquirC8QnCLz 5mYx8vGSSNvaL09twPe0PCdwhAiYQDPLNWg1MxevodQNLvMqxNZV9MECIi5lrrwN1VHQ 3LyGsMBx3o20JfvZwFEuz8zdKsY6qpVUlVNVsDfeAaFenvijq7SecVKPif2r8l5kT9eS S/LhUfMYRbt8z0jbRfgFSskZuf0oB4/JDggjCSQ09AKp/+XxO/ofKfY6UZtnC7gic2CE Uu0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=frcfsW8gyrHmpET78rxcCSF0PPOsgcaxdCPTbJt+CBQ=; b=xV/DLJYSltB4XnoJK+f3RGNgNG36XSjJ0dZ+KmOnQThUAUPBFqfQwtqDRI8sREfkPs K4xR9Cc5rHqDiYlFKplphmvYbs5xNizTJM8mc2E9decfvntobwD64biBAfQp4b88fc74 LfQgag4LrgqH2+EMEWyDDYcUrqf630zMfGhSF8NHkAzObV2H9YHCrPXsx5r3F8NWNmSW ySlciRM+VFLcmERlWiX6meLkSZjImDra6A/SXSuNvlVHL7vnyxVdcoikQpATCOdh7RPN qSQ8L3Sd4XlwbCO6wor1XEwmZvf8ORRX9jYPnQGkxVOvxRyTb9sYTkn8rKvdS8bqULpy qe6Q== X-Gm-Message-State: AO0yUKV+ST6kq1PMval4hpqzMq0xRdzVXvn8hqkJTiCwsTqd/CvHVikc F2tiIYwCd+cyqsBKTa0T0Y6c2hbFAH4= X-Google-Smtp-Source: AK7set8Qxgury4dzkce/GQG3JtwY1ZIF+ewHvJdW2BNuswCKSltyhRnmLKZiao3FHKDPwaLHW0/YFA== X-Received: by 2002:a17:906:70c4:b0:90b:208:6179 with SMTP id g4-20020a17090670c400b0090b02086179mr10452423ejk.28.1678709760750; Mon, 13 Mar 2023 05:16:00 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id hs16-20020a1709073e9000b0092be4b381b7sm17310ejc.81.2023.03.13.05.16.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:16:00 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 12/14] selftest: efibootpartition.py: fix QEMU_USE_KVM usage Date: Mon, 13 Mar 2023 13:15:39 +0100 Message-Id: <2e250b90f5866bb730e53d01f5350662ecd2a335.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178444 * it's not in self.td causing: 2023-03-12 18:06:29,591 - oe-selftest - DEBUG - Checking if qemux86-64 is not this MACHINE 2023-03-12 18:06:29,594 - oe-selftest - INFO - ... ERROR 2023-03-12 18:06:29,594 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/OE/build/poky/meta/lib/oeqa/selftest/cases/efibootpartition.py", line 18, in test_boot_efi if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]): ~~~~~~~^^^^^^^^^^^^^^^^ KeyError: 'QEMU_USE_KVM' [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/efibootpartition.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py index e17da9f9a0..d34698c6ad 100644 --- a/meta/lib/oeqa/selftest/cases/efibootpartition.py +++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py @@ -6,7 +6,7 @@ # from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, runqemu +from oeqa.utils.commands import bitbake, get_bb_var, runqemu from oeqa.core.decorator.data import skipIfNotMachine import oe.types @@ -15,7 +15,7 @@ class GenericEFITest(OESelftestTestCase): @skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently") def test_boot_efi(self): cmd = "runqemu nographic serial wic ovmf" - if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]): + if oe.types.qemu_use_kvm(get_bb_var('QEMU_USE_KVM'), self.td["TARGET_ARCH"]): cmd += " kvm" image = "core-image-minimal" From patchwork Mon Mar 13 12:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20856 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 62775C6FD19 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web10.17703.1678709762979691063 for ; Mon, 13 Mar 2023 05:16:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=c+8MTVOe; spf=pass (domain: gmail.com, ip: 209.85.208.46, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id x13so550786edd.1 for ; Mon, 13 Mar 2023 05:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=O6ifxvTjVmLO6WCdj2emtiWk54cTg+OJhSureo9A9Zs=; b=c+8MTVOezHg3OBfzNLh5bxi4SwoRW+lnCKFN9eXkRutNtV8iJA8CQVyNAZnQQbypIW TgwxmMJlK+QESApXKJX1MxuZpEP8CY/9ccH2YWWDKrspAT86MLnpyGIqCSO5Uqr9EKcB hqIg0hHV+SLRe56wUmrrxjsKMM5gb5C6DdSFtbIeKJqyKh8XXyYPePWz5sNruLlv2OX3 q7Px6cTldeb3U7QuXXbEr5dH+LD+Qk3SBBNWditVgKGdzwYIM+BDKkmTciZwNXx5/Y7W ic9MVNko2R1Kruu7foBHQNTvRce6vFQ3yrMDxq34oagS3+JNtDwfXd2fhK4dRiEJTvMY f31Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O6ifxvTjVmLO6WCdj2emtiWk54cTg+OJhSureo9A9Zs=; b=DBilaJBekiJJgRZ3aEBxdwoZOeYYg9Il0opmdbUKYOUbMUN+1LSQQnfMUUm+PcFztG GYSSNTbqy0+hd8cnRXZQCUOFYC3d95PjpnMgRgGQxffvboHzD9wE9HiwZyQVpLiAxOeH 6o6Qrtgaxk4HFUZMDFkrMOYVWolM/ocDtanWZgrWW63A5YggUs7eqZrnc8HskTNMZtxD G3D8verloHiXW3MQCleO70OAPiO9Ni10tksU7p5v63qEhvgeF10Tz3N/jQli/+r/2NMR rupqkXvo+kXvZ6D+xInVUhmW8n5R03wxasBRy2YUkMqPNbM+qcR6CYUvHPB+nquuQlxF Ak/g== X-Gm-Message-State: AO0yUKWVv1P9cwLW30RtOTWtUNFy08m6ffRF7hFBvuaqgFnozF3XsJYW A3qBuhOUhuQ/ZuiGOpSr4DONa4NjXto= X-Google-Smtp-Source: AK7set/B/oXoEljzBAAwoASQoiUYqr7o1xXeqcFwaj/xJCHHr0nC4WteIf1D1qGKXxFKXXlF8z0tRQ== X-Received: by 2002:a17:906:30d3:b0:878:7291:d558 with SMTP id b19-20020a17090630d300b008787291d558mr31057589ejb.34.1678709761465; Mon, 13 Mar 2023 05:16:01 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id d2-20020a50f682000000b004fb1a83cb00sm2175588edn.75.2023.03.13.05.16.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:16:01 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 13/14] runqemu: get_first_file() rename cmd* to glob* Date: Mon, 13 Mar 2023 13:15:40 +0100 Message-Id: <8f10918980e1e7ab6634b687f9c4325b71f1f319.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178445 * to better indicate how it's used in get_first_file * cmd* is used in other places for actual shell commands to execute * RunQemuError('KERNEL not found: %s, %s or %s' % cmds) also looked weird to me, but that works (to my python-noob surprise) [YOCTO #12937] Signed-off-by: Martin Jansa --- scripts/runqemu | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index 58b0c191e1..32b0c5699c 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -116,10 +116,10 @@ def check_tun(): if not os.access(dev_tun, os.W_OK): raise RunQemuError("TUN control device %s is not writable, please fix (e.g. sudo chmod 666 %s)" % (dev_tun, dev_tun)) -def get_first_file(cmds): - """Return first file found in wildcard cmds""" - for cmd in cmds: - all_files = glob.glob(cmd) +def get_first_file(globs): + """Return first file found in wildcard globs""" + for g in globs: + all_files = glob.glob(g) if all_files: for f in all_files: if not os.path.isdir(f): @@ -676,12 +676,12 @@ class BaseConfig(object): self.rootfs, self.get('MACHINE'), self.fstype) elif not self.rootfs: - cmd_name = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_NAME'), self.fstype) - cmd_link = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype) - cmds = (cmd_name, cmd_link) - self.rootfs = get_first_file(cmds) + glob_name = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_NAME'), self.fstype) + glob_link = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype) + globs = (glob_name, glob_link) + self.rootfs = get_first_file(globs) if not self.rootfs: - raise RunQemuError("Failed to find rootfs: %s or %s" % cmds) + raise RunQemuError("Failed to find rootfs: %s or %s" % globs) if not os.path.exists(self.rootfs): raise RunQemuError("Can't find rootfs: %s" % self.rootfs) @@ -741,10 +741,10 @@ class BaseConfig(object): kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name) kernel_match_link = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE')) kernel_startswith = "%s/%s*" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE')) - cmds = (kernel_match_name, kernel_match_link, kernel_startswith) - self.kernel = get_first_file(cmds) + globs = (kernel_match_name, kernel_match_link, kernel_startswith) + self.kernel = get_first_file(globs) if not self.kernel: - raise RunQemuError('KERNEL not found: %s, %s or %s' % cmds) + raise RunQemuError('KERNEL not found: %s, %s or %s' % globs) if not os.path.exists(self.kernel): raise RunQemuError("KERNEL %s not found" % self.kernel) @@ -761,13 +761,13 @@ class BaseConfig(object): dtb = self.get('QB_DTB') if dtb: deploy_dir_image = self.get('DEPLOY_DIR_IMAGE') - cmd_match = "%s/%s" % (deploy_dir_image, dtb) - cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb) - cmd_wild = "%s/*.dtb" % deploy_dir_image - cmds = (cmd_match, cmd_startswith, cmd_wild) - self.dtb = get_first_file(cmds) + glob_match = "%s/%s" % (deploy_dir_image, dtb) + glob_startswith = "%s/%s*" % (deploy_dir_image, dtb) + glob_wild = "%s/*.dtb" % deploy_dir_image + globs = (glob_match, glob_startswith, glob_wild) + self.dtb = get_first_file(globs) if not os.path.exists(self.dtb): - raise RunQemuError('DTB not found: %s, %s or %s' % cmds) + raise RunQemuError('DTB not found: %s, %s or %s' % globs) def check_bios(self): """Check and set bios""" From patchwork Mon Mar 13 12:15:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 20861 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 651B2C61DA4 for ; Mon, 13 Mar 2023 12:16:04 +0000 (UTC) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by mx.groups.io with SMTP id smtpd.web11.18085.1678709763724408824 for ; Mon, 13 Mar 2023 05:16:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=k7R8G0L0; spf=pass (domain: gmail.com, ip: 209.85.208.48, mailfrom: martin.jansa@gmail.com) Received: by mail-ed1-f48.google.com with SMTP id y4so18379978edo.2 for ; Mon, 13 Mar 2023 05:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678709762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AxF2tG8wEUCxlxQ7IJA6KmC+x3V1m3dWrrlezVh6IRw=; b=k7R8G0L05ZgbXhPEhkXmpmuXAjOrUiD5f3eLnT2nGm7HKfgRaMqAlNrLJaW6VhOZnG 55jRXn9EbMhKqB9UKs6PvSSaWFeEk5sLXqA3pNF50qa9byeqeP9kIzcy/70L6j7TM0Ps /htuNefZbPXVn8DZRTCMoOqPShC5CTwKM3wasjUCJ1XKFi/LMiALUR08TtabmJNDysMH fuTF19/izrQ4aJOCNIhovbfRs1Zisyb71PbPFrmg98gZCAyPW6A7nsZN3u+bO40WBLdI 4PGxUeWG6Nzo9kGMKGUNCpStk4yttqEMMq01KeZNSLP9CvmAMou6kLFIH/7JjOk5bCYq R8ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AxF2tG8wEUCxlxQ7IJA6KmC+x3V1m3dWrrlezVh6IRw=; b=n58aZVBrq+zKe8GxVPQHO2pFudX/EhrXXOjE1UmiUigz5PjvaUYZeVUeITr4uoFKoN GyJZYNPk5+GPLTWBzVWx3gXGsr92cj1sk2tVyXJI8786JyTpO/td04+16cIbdS46Eskh g2aAKxPBPrdKn2fRoaOpYShCmRJhB9bbrh7i/6jjBk+RHM+aSyRBZumxneJ4Lka1wDc8 jc23ieyZXasVNn9RmQCSqVvRSm+4Fl/fxpT0t7+Z7gozSuhphamayoXUZdLzCt3GhzKs v4pwKtSy545WVQvpq/1qwlAXhtvMS0pq7z3nuiXrVdJCm6rh8Zp8dvQtpqyDVOOK2miO AAhA== X-Gm-Message-State: AO0yUKXOBbsTzncbKWCu0Gl6KJO+HbRI+/EZfRWZWVyub0QwpCWnVYBn sdsPaCPCrM7U9OdCDbbuw5BTnVsdR4I= X-Google-Smtp-Source: AK7set8YfZryoStKwsTnLr/Jqz/tscNfGMGO0qq8gsA3msGJEyUxebLDFD6eUTeWarMcvyHIEvjV0Q== X-Received: by 2002:a17:906:2c18:b0:926:fce:c080 with SMTP id e24-20020a1709062c1800b009260fcec080mr4324307ejh.17.1678709762140; Mon, 13 Mar 2023 05:16:02 -0700 (PDT) Received: from localhost (ip-109-238-218-228.aim-net.cz. [109.238.218.228]) by smtp.gmail.com with ESMTPSA id bn19-20020a170906c0d300b008e57b5e0ce9sm3372054ejb.108.2023.03.13.05.16.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 05:16:01 -0700 (PDT) From: Martin Jansa X-Google-Original-From: Martin Jansa To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/14] selftest: imagefeatures.py: respect IMAGE_LINK_NAME for debugfs and manifest as well Date: Mon, 13 Mar 2023 13:15:41 +0100 Message-Id: <47de38963f1a5b4d03d3fd9afed7edc662ac85d9.1678709427.git.Martin.Jansa@gmail.com> X-Mailer: git-send-email 2.39.2 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 ; Mon, 13 Mar 2023 12:16:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178446 * these cases were correctly respecting IMAGE_LINK_NAME in most tests * the only exception was relatively wide glob for manifest: "test-empty-image-*.manifest" * and even wider glob for -dbg: "*-dbg.rootfs.tar.bz2" * replace them with the exact filename we expect for given image * be aware that gzip won't accept the symlink in IMAGE_LINK_NAME causing: 2023-03-13 08:58:23,845 - oe-selftest - INFO - ... FAIL 2023-03-13 08:58:23,845 - oe-selftest - INFO - Traceback (most recent call last): File "/OE/build/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py", line 124, in test_bmap self.assertTrue(runCmd('gzip -t %s' % gzip_path)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/OE/build/poky/meta/lib/oeqa/utils/commands.py", line 214, in runCmd raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output)) AssertionError: Command 'gzip -t /OE/build/poky/build/build-st-2023-03-12-todo-patch2/imagefeatures.ImageFeatures.test_bmap/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs.ext4.bmap.gz' returned non-zero exit status 1: gzip: skipping: /OE/build/poky/build/build-st-2023-03-12-todo-patch2/imagefeatures.ImageFeatures.test_bmap/build-st/tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.rootfs.ext4.bmap.gz is a symbolic link * and "*-dbg.rootfs.tar.bz2" doesn't work if IMAGE_NAME_SUFFIX is changed to anything else than ".rootfs" or moved into IMAGE_LINK_NAME (like I plan in future changes where this will need to be updated again). Luckily we can use the symlink which currently doesn't have IMAGE_NAME_SUFFIX nor the DATETIME, so we don't need to search for it with glob, e.g. currently: core-image-minimal-qemux86-64-dbg-20230313112546-dbg.rootfs.tar.bz2 core-image-minimal-qemux86-64-dbg.tar.bz2 -> core-image-minimal-qemux86-64-dbg-20230313112546-dbg.rootfs.tar.bz2 [YOCTO #12937] Signed-off-by: Martin Jansa --- meta/lib/oeqa/selftest/cases/imagefeatures.py | 82 +++++++++---------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py index bdd4d3200e..3dc750594c 100644 --- a/meta/lib/oeqa/selftest/cases/imagefeatures.py +++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py @@ -6,7 +6,7 @@ from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator import OETestTag -from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu from oeqa.utils.sshcontrol import SSHControl import glob import os @@ -102,12 +102,11 @@ class ImageFeatures(OESelftestTestCase): features = 'IMAGE_FSTYPES += " ext4 ext4.bmap ext4.bmap.gz"' self.write_config(features) - image_name = 'core-image-minimal' - bitbake(image_name) + image = 'core-image-minimal' + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - link_name = get_bb_var('IMAGE_LINK_NAME', image_name) - image_path = os.path.join(deploy_dir_image, "%s.ext4" % link_name) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.ext4" % bb_vars['IMAGE_LINK_NAME']) bmap_path = "%s.bmap" % image_path gzip_path = "%s.gz" % bmap_path @@ -120,8 +119,8 @@ class ImageFeatures(OESelftestTestCase): image_stat = os.stat(image_path) self.assertGreater(image_stat.st_size, image_stat.st_blocks * 512) - # check if the resulting gzip is valid - self.assertTrue(runCmd('gzip -t %s' % gzip_path)) + # check if the resulting gzip is valid, --force is needed in case gzip_path is a symlink + self.assertTrue(runCmd('gzip --test --force %s' % gzip_path)) def test_hypervisor_fmts(self): """ @@ -139,14 +138,13 @@ class ImageFeatures(OESelftestTestCase): features += 'IMAGE_FSTYPES += "ext4.%s"\n' % itype self.write_config(features) - image_name = 'core-image-minimal' - bitbake(image_name) + image = 'core-image-minimal' + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - link_name = get_bb_var('IMAGE_LINK_NAME', image_name) for itype in img_types: - image_path = os.path.join(deploy_dir_image, "%s.ext4.%s" % - (link_name, itype)) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.ext4.%s" % + (bb_vars['IMAGE_LINK_NAME'], itype)) # check if result image file is in deploy directory self.assertTrue(os.path.exists(image_path)) @@ -177,13 +175,11 @@ class ImageFeatures(OESelftestTestCase): features = 'IMAGE_FSTYPES += "%s %s.sha256sum"' % (conv, conv) self.write_config(features) - image_name = 'core-image-minimal' - bitbake(image_name) - - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - link_name = get_bb_var('IMAGE_LINK_NAME', image_name) - image_path = os.path.join(deploy_dir_image, "%s.%s" % - (link_name, conv)) + image = 'core-image-minimal' + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.%s" % + (bb_vars['IMAGE_LINK_NAME'], conv)) # check if resulting image is in the deploy directory self.assertTrue(os.path.exists(image_path)) @@ -191,7 +187,7 @@ class ImageFeatures(OESelftestTestCase): # check if the resulting sha256sum agrees self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' % - (deploy_dir_image, link_name, conv))) + (bb_vars['DEPLOY_DIR_IMAGE'], bb_vars['IMAGE_LINK_NAME'], conv))) def test_image_fstypes(self): """ @@ -200,9 +196,9 @@ class ImageFeatures(OESelftestTestCase): Product: oe-core Author: Ed Bartosh """ - image_name = 'core-image-minimal' + image = 'core-image-minimal' - all_image_types = set(get_bb_var("IMAGE_TYPES", image_name).split()) + all_image_types = set(get_bb_var("IMAGE_TYPES", image).split()) skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst', 'squashfs-lzo')) img_types = all_image_types - skip_image_types @@ -214,12 +210,11 @@ UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512" """ % ' '.join(img_types) self.write_config(config) - bitbake(image_name) + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - link_name = get_bb_var('IMAGE_LINK_NAME', image_name) for itype in img_types: - image_path = os.path.join(deploy_dir_image, "%s.%s" % (link_name, itype)) + image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.%s" % (bb_vars['IMAGE_LINK_NAME'], itype)) # check if result image is in deploy directory self.assertTrue(os.path.exists(image_path), "%s image %s doesn't exist" % (itype, image_path)) @@ -271,19 +266,20 @@ SKIP_RECIPE[busybox] = "Don't build this" Yeoh Ee Peng """ - image_name = 'core-image-minimal' + image = 'core-image-minimal' + image_fstypes_debugfs = 'tar.bz2' features = 'IMAGE_GEN_DEBUGFS = "1"\n' - features += 'IMAGE_FSTYPES_DEBUGFS = "tar.bz2"\n' + features += 'IMAGE_FSTYPES_DEBUGFS = "%s"\n' % image_fstypes_debugfs self.write_config(features) - bitbake(image_name) - deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') - dbg_tar_file = os.path.join(deploy_dir_image, "*-dbg.rootfs.tar.bz2") - debug_files = glob.glob(dbg_tar_file) - self.assertNotEqual(len(debug_files), 0, 'debug filesystem not generated at %s' % dbg_tar_file) - result = runCmd('cd %s; tar xvf %s' % (deploy_dir_image, dbg_tar_file)) + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + + dbg_tar_file = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s-dbg.%s" % (bb_vars['IMAGE_LINK_NAME'], image_fstypes_debugfs)) + self.assertTrue(os.path.exists(dbg_tar_file), 'debug filesystem not generated at %s' % dbg_tar_file) + result = runCmd('cd %s; tar xvf %s' % (bb_vars['DEPLOY_DIR_IMAGE'], dbg_tar_file)) self.assertEqual(result.status, 0, msg='Failed to extract %s: %s' % (dbg_tar_file, result.output)) - result = runCmd('find %s -name %s' % (deploy_dir_image, "udevadm")) + result = runCmd('find %s -name %s' % (bb_vars['DEPLOY_DIR_IMAGE'], "udevadm")) self.assertTrue("udevadm" in result.output, msg='Failed to find udevadm: %s' % result.output) dbg_symbols_targets = result.output.splitlines() self.assertTrue(dbg_symbols_targets, msg='Failed to split udevadm: %s' % dbg_symbols_targets) @@ -293,11 +289,13 @@ SKIP_RECIPE[busybox] = "Don't build this" def test_empty_image(self): """Test creation of image with no packages""" - bitbake('test-empty-image') - res_dir = get_bb_var('DEPLOY_DIR_IMAGE') - images = os.path.join(res_dir, "test-empty-image-*.manifest") - result = glob.glob(images) - with open(result[1],"r") as f: + image = 'test-empty-image' + bitbake(image) + bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], image) + manifest = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], "%s.manifest" % bb_vars['IMAGE_LINK_NAME']) + self.assertTrue(os.path.exists(manifest)) + + with open(manifest, "r") as f: self.assertEqual(len(f.read().strip()),0) def test_mandb(self):