From patchwork Thu Mar 10 13:13:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 5049 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 585DBC433FE for ; Thu, 10 Mar 2022 13:13:36 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by mx.groups.io with SMTP id smtpd.web09.9062.1646918014544661286 for ; Thu, 10 Mar 2022 05:13:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@denx.de header.s=phobos-20191101 header.b=iz4EOgal; spf=pass (domain: denx.de, ip: 85.214.62.61, mailfrom: ch@denx.de) Received: from localhost (dslb-002-205-233-017.002.205.pools.vodafone-ip.de [2.205.233.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ch@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 3083D83A9F; Thu, 10 Mar 2022 14:13:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646918012; bh=EPtbk6P4pc3bXmNhgMwdIn7JqUL3fBEncVUgZupMa10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iz4EOgalfmHOqkRgUI4Aw8UOa78Xk6XfNad5ZYWbLdkxlp7JwFGxsuI6sRc3g/y4o xn3uy2GRGmHd6Mwqgld9z2fh94Nf17svGUrdwjNdLq/F58Wh54vDXSvVKdMxMpTYSg zlYW8Mj90dkMtj8VWnR2F5qU/zEDlpxzXU5c4Z5sFZ5V2Xx6LCpDNxF0UIvCkYDlJk 6xIparljua083pVJ5Bo3JBpML6nx9HK6edyi2/1yN+krGK+gPlo7THkxmwwr5Kfl7Q hR4763XzUczUVZ82CAvd5VmKhrMA2WVORiz7fM7P13tKBk2pFHOFuKtwpciMpJAdYN S50rR0xksgzkw== From: Claudius Heine To: openembedded-core@lists.openembedded.org Cc: Vyacheslav Yurkov , Claudius Heine Subject: [PATCH v2 1/4] overlayfs-etc: add condition to package-management feature conflict Date: Thu, 10 Mar 2022 14:13:26 +0100 Message-Id: <20220310131329.1906537-2-ch@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310131329.1906537-1-ch@denx.de> References: <20220310131329.1906537-1-ch@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Mar 2022 13:13:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163019 The conflict with the `package-managment` only happens if the `overlayfs-etc` class overwrites `/sbin/init`, which is not the case when `OVERLAYFS_ETC_USE_ORIG_INIT_NAME` is set to `0`. Signed-off-by: Claudius Heine --- meta/classes/overlayfs-etc.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/classes/overlayfs-etc.bbclass b/meta/classes/overlayfs-etc.bbclass index 4ced07ba11..b593a4d9eb 100644 --- a/meta/classes/overlayfs-etc.bbclass +++ b/meta/classes/overlayfs-etc.bbclass @@ -26,7 +26,8 @@ # overlay is out of scope of this class ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "overlayfs-etc", "create_overlayfs_etc_preinit;", "", d)}' -IMAGE_FEATURES_CONFLICTS_overlayfs-etc = "package-management" +IMAGE_FEATURES_CONFLICTS_overlayfs-etc = " \ + ${@ 'package-management' if bb.utils.to_boolean(d.getVar('OVERLAYFS_ETC_USE_ORIG_INIT_NAME'), True) else ''}" OVERLAYFS_ETC_MOUNT_POINT ??= "" OVERLAYFS_ETC_FSTYPE ??= "" From patchwork Thu Mar 10 13:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 5047 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 59E5EC433EF for ; Thu, 10 Mar 2022 13:13:36 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by mx.groups.io with SMTP id smtpd.web08.9216.1646918014562522492 for ; Thu, 10 Mar 2022 05:13:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@denx.de header.s=phobos-20191101 header.b=GMknQYfh; spf=pass (domain: denx.de, ip: 85.214.62.61, mailfrom: ch@denx.de) Received: from localhost (dslb-002-205-233-017.002.205.pools.vodafone-ip.de [2.205.233.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ch@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id BEB1583AAD; Thu, 10 Mar 2022 14:13:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646918012; bh=7uyqnZnwMCLaZRUNF+mOEyPP3+YzZCnemd1tOu+lGJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GMknQYfhQ1ZWY8sveZ5WN3JNirgZpb3PZUfL7FtDun62iU63hnZw9fAwtC1SVSyox i9F+tfrxZpr7sMo/+j2eluPwpPC4B1k//RNxZQAKcEnrFVTbDc4lHQKNhEer7GlZwb OgcStu8uTCL0fLGrDowTWjWuiLPJhpF2eHepyytOuxeS1n8JQYcFxOSUCoT1TZRSjc i49X81nnYHuE+h1HM8Rri4F86Oed0XeBoCt1SvZX/J1KIW0zaZ8zVo0S6xQXCkwKak BFKwIT3r3h0LD8PSYriYJT2A3oou4rQcFrGYAefq01PPE6YGZg4TFJNCHbqN5BJtbI Kzf0UMBaQtp4w== From: Claudius Heine To: openembedded-core@lists.openembedded.org Cc: Vyacheslav Yurkov , Claudius Heine Subject: [PATCH v2 2/4] overlayfs: add systemd unit path prefix to FILES:${PN} array Date: Thu, 10 Mar 2022 14:13:27 +0100 Message-Id: <20220310131329.1906537-3-ch@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310131329.1906537-1-ch@denx.de> References: <20220310131329.1906537-1-ch@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Mar 2022 13:13:36 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163018 The 'FILES:${PN}' array is missing the systemd unit dir prefix causing them to not be packaged and the build fails with the `installed-vs-shipped` error. This adds the `systemd_system_unitdir` variable in front of every unit file added with this class. Signed-off-by: Claudius Heine --- meta/classes/overlayfs.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/classes/overlayfs.bbclass b/meta/classes/overlayfs.bbclass index 4a860f7308..25e30aee83 100644 --- a/meta/classes/overlayfs.bbclass +++ b/meta/classes/overlayfs.bbclass @@ -103,7 +103,8 @@ python () { unitList = unitFileList(d) for unit in unitList: d.appendVar('SYSTEMD_SERVICE:' + d.getVar('PN'), ' ' + unit) - d.appendVar('FILES:' + d.getVar('PN'), ' ' + strForBash(unit)) + d.appendVar('FILES:' + d.getVar('PN'), ' ' + + d.getVar('systemd_system_unitdir') + '/' + strForBash(unit)) d.setVar('OVERLAYFS_UNIT_LIST', ' '.join([strForBash(s) for s in unitList])) } From patchwork Thu Mar 10 13:13:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 5050 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 53D80C4332F for ; Thu, 10 Mar 2022 13:13:37 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by mx.groups.io with SMTP id smtpd.web12.9293.1646918015448119844 for ; Thu, 10 Mar 2022 05:13:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@denx.de header.s=phobos-20191101 header.b=IGT09ZKN; spf=pass (domain: denx.de, ip: 85.214.62.61, mailfrom: ch@denx.de) Received: from localhost (dslb-002-205-233-017.002.205.pools.vodafone-ip.de [2.205.233.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ch@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 56D3283AAF; Thu, 10 Mar 2022 14:13:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646918013; bh=8zsenyUVpefTsznO5ed4twTsPmx7V7O9l+L/0//92/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGT09ZKNfM0Yf5d1edY6Sat8khJkRReh1Rv4kUs1zn/cIVh6HS42ZxcqZCM1TIA2P L0lECAvfe7iHX4gAmR3VTABRSSTCY0c1XbqlmiF52RQmCqGeWMibAbaG7IwQzsGUuB m/VrHH2TL+oOpRqDMpgKNGEYoyVU+Sb4G84nv5E6MQ0xwRGRpJwyYQRMCpwm1D/tnf h1b4GhSv9xoZRcym33cqubOpPTII7nc97ce3g+Cbc5cK0WjBoeo9joenlQ2werm4ID iEl2/Lxp8ljBMY2bJOibxSjwK4f/PMQCbkKCB7vHQwlLxecyDFEjNBvEhO8jl0r9v4 LkNf6yDXPkGrQ== From: Claudius Heine To: openembedded-core@lists.openembedded.org Cc: Vyacheslav Yurkov , Claudius Heine Subject: [PATCH v2 3/4] files: overlayfs-etc: wrap long lines of preinit file Date: Thu, 10 Mar 2022 14:13:28 +0100 Message-Id: <20220310131329.1906537-4-ch@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310131329.1906537-1-ch@denx.de> References: <20220310131329.1906537-1-ch@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Mar 2022 13:13:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163020 Make it easier to see what is happening by wrapping the overly long lines in the preinit file for the overlayfs-etc. Signed-off-by: Claudius Heine --- meta/files/overlayfs-etc-preinit.sh.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta/files/overlayfs-etc-preinit.sh.in b/meta/files/overlayfs-etc-preinit.sh.in index 2ebb6c9224..e5f5001a05 100644 --- a/meta/files/overlayfs-etc-preinit.sh.in +++ b/meta/files/overlayfs-etc-preinit.sh.in @@ -16,11 +16,18 @@ mount -t sysfs sysfs /sys [ -z "$CONSOLE" ] && CONSOLE="/dev/console" mkdir -p {OVERLAYFS_ETC_MOUNT_POINT} -if mount -n -t {OVERLAYFS_ETC_FSTYPE} -o {OVERLAYFS_ETC_MOUNT_OPTIONS} {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT} +if mount -n -t {OVERLAYFS_ETC_FSTYPE} \ + -o {OVERLAYFS_ETC_MOUNT_OPTIONS} \ + {OVERLAYFS_ETC_DEVICE} {OVERLAYFS_ETC_MOUNT_POINT} then mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper mkdir -p {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work - mount -n -t overlay -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper,lowerdir=/etc,workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || echo "PREINIT: Mounting etc-overlay failed!" + mount -n -t overlay \ + -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper \ + -o lowerdir=/etc \ + -o workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work \ + {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || \ + echo "PREINIT: Mounting etc-overlay failed!" else echo "PREINIT: Mounting failed!" fi From patchwork Thu Mar 10 13:13:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 5048 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 59063C43217 for ; Thu, 10 Mar 2022 13:13:37 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by mx.groups.io with SMTP id smtpd.web11.9022.1646918015641518960 for ; Thu, 10 Mar 2022 05:13:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@denx.de header.s=phobos-20191101 header.b=XqpC4JJE; spf=pass (domain: denx.de, ip: 85.214.62.61, mailfrom: ch@denx.de) Received: from localhost (dslb-002-205-233-017.002.205.pools.vodafone-ip.de [2.205.233.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ch@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id E3B9883AB3; Thu, 10 Mar 2022 14:13:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646918014; bh=x5ZyHI3LkqYc8PJxB2X93KnD4nYA4CY95kA8/lx+bIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqpC4JJEs/HfeE9QcmyehIeUv0s7M3871AdI/QTR0TLGhcRWSCGao1YO8K4NKoozV 67+msVRpW6is0q828xzzo1ENxRwU+fzmWcKm3XfewfKCSd16QKM+6jKtA8YR5Ppoec 8d6Y3teEsu2XPREzrIuGuYJ6+8M8ZvmTxa+meNzCSAPMe3qwLcIwH39qCZ4d0gjVQ8 msyf45DxSZLH+92sTAWtI77wRvMYNeK3me4Ii3C0LvJ9Q+h9iAbfHaht/oymINzYxW 4dz65rcbga8dG02CBf8ocLb3JHKs+kLk0cJ5j2oGCMa3cPIsusxDBiF80BE7TPH2nq rK8XiP4ifvU1g== From: Claudius Heine To: openembedded-core@lists.openembedded.org Cc: Vyacheslav Yurkov , Claudius Heine Subject: [PATCH v2 4/4] files: overlayfs-etc: add overlay mount options to preinit Date: Thu, 10 Mar 2022 14:13:29 +0100 Message-Id: <20220310131329.1906537-5-ch@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310131329.1906537-1-ch@denx.de> References: <20220310131329.1906537-1-ch@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Mar 2022 13:13:37 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/163021 Overlayfs-etc is useful if the rootfs is read-only. One reason to have the rootfs read-only is to allow image based updating. Image based updating will change the underlying root file system, which is unsupported by overlayfs when with some mount options [1]. This disables those options. [1] https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html?highlight=overlayfs#changes-to-underlying-filesystems Signed-off-by: Claudius Heine --- meta/files/overlayfs-etc-preinit.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/files/overlayfs-etc-preinit.sh.in b/meta/files/overlayfs-etc-preinit.sh.in index e5f5001a05..43c9b04eb9 100644 --- a/meta/files/overlayfs-etc-preinit.sh.in +++ b/meta/files/overlayfs-etc-preinit.sh.in @@ -26,6 +26,7 @@ then -o upperdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper \ -o lowerdir=/etc \ -o workdir={OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/work \ + -o index=off,xino=off,redirect_dir=off,metacopy=off \ {OVERLAYFS_ETC_MOUNT_POINT}/overlay-etc/upper /etc || \ echo "PREINIT: Mounting etc-overlay failed!" else