From patchwork Fri Apr 29 08:11:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 7346 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 2CC98C433F5 for ; Fri, 29 Apr 2022 08:12:16 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by mx.groups.io with SMTP id smtpd.web09.7641.1651219928874982118 for ; Fri, 29 Apr 2022 01:12:10 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@denx.de header.s=phobos-20191101 header.b=VwQF63UM; spf=pass (domain: denx.de, ip: 85.214.62.61, mailfrom: ch@denx.de) Received: from localhost (dslb-084-057-071-010.084.057.pools.vodafone-ip.de [84.57.71.10]) (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 F134F83DD9; Fri, 29 Apr 2022 10:12:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1651219926; bh=K1z4eixL1RrvyPwCMN/TtsIbmhO3bM9gNOBS2tgG6P4=; h=From:To:Cc:Subject:Date:From; b=VwQF63UMh8F0+m8qcekuAxzzlv+yVkZ4PqcIenAwWDEFNibSrq3hPdXzMh5o7cYu8 JFAiQ6VLSYkdJpt6bWG05NUVwCRFYukfH3PlpEXCdho5P8MAQXBWPmZUh7j8B7+g2A +rEphL9lCbOLnAxpRcxp0LdMVCWM3gXn4PTX3IMM6ZomeQfE5uWvxxE4CXs8B1fSBF /cj0K1Mwsc/oUezGL9FCUzHYePFRQ7YQMfMHsGCGJ3D40qBuW7QIAN9l2op+87hP3m wVJLPHmLq7DGYAqEeabMY8gK6cOxL4UTNMAnxrMoKYRHSkXQOb2LHh5HSK0YI+0aYu 30UZH2xAhjFXg== From: Claudius Heine To: openembedded-core@lists.openembedded.org Cc: Stefan Herbrechtsmeier , Vyacheslav Yurkov , Claudius Heine Subject: [PATCH] classes: rootfs-postcommands: add skip option to overlayfs_qa_check Date: Fri, 29 Apr 2022 10:11:45 +0200 Message-Id: <20220429081145.225361-1-ch@denx.de> X-Mailer: git-send-email 2.33.3 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 ; Fri, 29 Apr 2022 08:12:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/165000 The overlayfs_qa_check checks if the current root file system has a mount configured for each overlayfs, when the overlayfs class is used. However there are certain instances where this mount point is created at runtime and not static in a fstab entry or systemd mount unit. One such case would be if overlayfs-etc is used, where the device is mounted in the preinit script and not via a mount unit or fstab entry. However there are other possibilities for this as well, like startup scripts that support a dynamic partition layout. For instance when systemd-repart is used. This adds the `OVERLAYFS_QA_SKIP` variable, which allows to define QA skips via its flags. In principle it supports multiple QA skip flags separated by whitespace, but only one (`mount-configured`) is implemented here. To skip this QA check simply add `mount-configured` to the flag of `OVERLAYFS_QA_SKIP` with the same name. For instance if a overlayfs is configured as: OVERLAYFS_MOUNT_POINT[data] = "/data" Skipping this QA check can be done by setting: OVERLAYFS_QA_SKIP[data] = "mount-configured" Signed-off-by: Claudius Heine --- meta/classes/rootfs-postcommands.bbclass | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 7b92df69c5..8df175e42e 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -398,6 +398,10 @@ python overlayfs_qa_check() { allUnitExist = True; for mountPoint in overlayMountPoints: + qaSkip = (d.getVarFag("OVERLAYFS_QA_SKIP", mountPoint) or "").split() + if "mount-configured" in qaSkip: + continue + mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) if mountPath in fstabDevices: continue @@ -407,8 +411,10 @@ python overlayfs_qa_check() { for dirpath in searchpaths): continue - bb.warn('Mount path %s not found in fstat and unit %s not found ' - 'in systemd unit directories' % (mountPath, mountUnit)) + bb.warn(f'Mount path {mountPath} not found in fstab and unit ' + f'{mountUnit} not found in systemd unit directories.') + bb.warn(f'Skip this check by setting OVERLAYFS_QA_SKIP[{mountPoint}] = ' + '"mount-configured"') allUnitExist = False; if not allUnitExist: