From patchwork Wed Mar 2 14:33:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 4585 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 4CFC9C433EF for ; Wed, 2 Mar 2022 14:33:56 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.49]) by mx.groups.io with SMTP id smtpd.web08.7732.1646231632021920063 for ; Wed, 02 Mar 2022 06:33:55 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@weidmueller.onmicrosoft.com header.s=selector1-weidmueller-onmicrosoft-com header.b=2MUb20nX; spf=pass (domain: weidmueller.com, ip: 40.107.22.49, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZcPB17l3Zzf1SHIqtNomkK/PdjQAKcbX6ZMIguD3I4DWpQ156xSqh1guAjFl68GBwD+sg+M6SoIq/9G1SbI89PMBtboKFVCauH3S6knwphHu6MTlNsJt0eJNOmIOzuvjUayZ6pttzDs09trtKOU9RSgbFNNAyfQfKFXzkstMNcZegG58KjctBVMp8fCxAgWNpPZjEoi7dckk2AXRMJDqMhAcahtrqkgaib6VJKdQO3/ETXM5p2/nrF/xQDzn6R9T1g+jHG56XCX4NxgK8dKi/ejpuPi7jXnzttfwlnaS7wBxovZTA2MRSfkAuuvsoHp8J3+JTCw4T/fXLRhgEfAzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Jb5+3ZTGJizhcqh2Vb/snQVvaFCW36K5YEwGRYdI1uc=; b=hIla3RfhOJSLadC3ELKD/WVEVZlobq+RCBl2LcnaL+Hue4xAm8ROs+3NueQQvRKr7qppzLQrR4eh2SkvukYd+cfXZlBcMz0nRa+ccVLgOIu36d45chiRELRIiNWIrIZ1qr2NRJVHv4kLYM6ab5r5a3USHSaQGCQSyeUr8U5Li+uKiRwXcGSafLCrZE8z5YLDUHwqvgqjflRckY4RU0j1rWMtHYKMkvC1MZPg4l2VTv+grUkPZEYmhv1EgK+YDaTPBlFprS3dUPnljcMCI/4rUCklFWyJsz5Of3/jgeWpJiXTHvVOYgQvqHPIhwPJ0X2Odaqy11vrQXszkWGxLhPA8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.onmicrosoft.com; s=selector1-weidmueller-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jb5+3ZTGJizhcqh2Vb/snQVvaFCW36K5YEwGRYdI1uc=; b=2MUb20nXXwlewj/brL7y8XmdQqb0RzmJ4wvBLDJp1Jh+vdTTcmF2TAmpqOt3rsS17jMQYdNfbNQAZVB4olaGBQ9LmHz0qTLKx1UL5F5IYGZyFSPBwRr0+i5pgWhsN7VRxBd5hEEK75193VgZD0n9XDSmvz7zVA31WdEY3f+RLGk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by AM9PR08MB6983.eurprd08.prod.outlook.com (2603:10a6:20b:416::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Wed, 2 Mar 2022 14:33:48 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::4a1:bad9:11c2:7de0]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::4a1:bad9:11c2:7de0%4]) with mapi id 15.20.5017.027; Wed, 2 Mar 2022 14:33:48 +0000 From: Stefan Herbrechtsmeier To: openembedded-core@lists.openembedded.org, Vyacheslav Yurkov CC: Stefan Herbrechtsmeier Subject: [RFC PATCH 1/2] classes: rootfs-postcommands: include /etc/fstab in overlayfs_qa_check Date: Wed, 2 Mar 2022 15:33:28 +0100 Message-ID: <20220302143329.4168-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AM6PR10CA0061.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::38) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd528f8f-75fa-4400-5a95-08d9fc59a9d4 X-MS-TrafficTypeDiagnostic: AM9PR08MB6983:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nk1uqQBVOigxBUE0bnAqoNJNakLiaYWAo0FQhSCAQvy4e2g2AqqWaUP8duxNnraFA94t9xoHcSvCjWmbZ6UMAqZLB7dBUw91jAMcOmf+my+I2jXazTP6qTbTtHUpVNYcCgTFAJHLBLnDmiGP/TbynNcmUWyCIYl1I2o5OxuVLCI6pCBOVQLdjrR5nlGc2s9s40oH7M9vRCJeoL/7+sepjUtDzcNJ5g70l7OH1zRgZiZpoW7Wvu/820Mu3kDlTegVTk1cOLghv41eSddIMLlBZeHdAd4ZZ3LjkS6eNauArigCXjTWHZ5ThvwQtBcrclYv/FqR3JyQIsKPiSWB9Y9eC6TI1r1ohhSXxeAeKWjox9l3BRXb0K9MMzH+EanexjbRuaIumJwBeXtgHJPhynq2DzLWnnQV3TMcS9vnSIeAlDA34Lcwj544bZZasAhYlxkzDpK8b1Utw2WdHuEDA3GQ86nYzt5/x24lGmuuHl0aUH6IO2oH5Y7+tsk18dOxaI3qMzONQZpYsZSNQrcYP2BjVo0snzAM2emhFlKDQMRsFN+2JA8lz+sk7UHGT9DlD1a0NMl+E+RNnJxtZTVmIgF1AXKu1Oa8lvSMM602xcMGTHNFXPbaYeE7HUGeHuwaCGnR8mpA5FFfFZDfR2EcO4JK7yHR8E3UDL9ecWjIWdEMG3pp1k8nkUrzIZnZgsjv5qQbW0kuPsOYJEvifZY3cl6thw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(5660300002)(8936002)(38100700002)(38350700002)(6916009)(1076003)(316002)(966005)(6486002)(86362001)(508600001)(2616005)(52116002)(83380400001)(2906002)(4326008)(8676002)(36756003)(66946007)(66476007)(66556008)(107886003)(6666004)(186003)(26005)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1ZlStqUuTiI+8LsQz/5aZwcmdXvQ2qnGaUWqwIJvMX5Wg+E8UNFZmjwVofoqzmIIt7/GXbLbOLB2j2HTfBkrWZJDOy9sPgKn9v3l0goqMCu6qmS/277zYvus91GrXPX7Jj2vw6HxMDNaKbwm/1icrwVWOhGyO3NL5XG9UHpZWXAjFqpIu6xeEafcEjdr4mpyGNhe21UQS0rCBF3UTg52+cf/M3URDUfoCt1ctkr2XBIcXuSuQVJEWLd0LX8JIh7nvs2VzzxC6PFxlAgg6AMwNOOrDoIs6T17bJaurTaMfqIU3B2sSCwnMHutaThHtQhcXJFj7voCJ/DxXQOrqTIdZD6iqqmaMLrQ/Us90Xt40DJQBAULSRmqCpm2NvGwRFQ8X55ETplOmRdZla1vEslG1yp0u847Qc+wNz+xVMKfmTwb1IRMNifN1ahWbSOQP7Z8Mu0KlJOpZ8BUPqoVMaO6t7r03L/Vnul9wtys+UkQhhsQWtMGo/AX2GrmqI6B/xIwupk76bywn62mw5Tg8a3ErgMwxbVyryICibwFyFpa1spazLfdRgHBkwfCME9lof5fjgcamc2Aj4IinWg1SgFxgUXH2Z96YtmaFrCFPqAPfsCvaLyU5qdUpeEmp48aQLTqAZYWaRkJwTSpLEUMmIsjfBL4/YqlsU4nL2Bvz2+RCNfmUmdFM3tQFU+rrxb6jCtY65xXuQVgk13wrgMWUi7j99MJzArn7tVnDQJMF7eK2vG0wcqME7TQDKeb+mytCujPOuNfQ8rTwoGSosKz4XhUAqhxAsg097zRtpIdOekrZ2HwrRs+yKn2hiDl2vggPFxd4B7AQLpZLB26C2LRsVNRmpocdXuFT3gbP3e2/p8NJnxid/ZROcRbrntEOB+AX9ojNT2iH+Mq8L91yjbUdBGpDKVlE18xHaEqB/Ltpzo/bL572xOLQI04REZWJrP7nRtY28WZeOPUZiGMLN5ki32Y6UgkFkdzMUqJMzMU9zqGgmbAYCw0z2MQC/aVq8fVPPSOANA/FpFeulhqj8//yAZc0G8hL+5eed2TYoUgQ4Ihfq278oA361vGe1QC92ignwLpFtv1xGQXeiGcfo/ptkM0E3w0hhsvJb3FrGEHULkZLY7ooHvurXZ4MrbEyAbRf5wfEqqAh7LhngAP2M7BdWaI98O5R1wS8A5lK2H6dAWw4I9qkMxpFkqc5GvESIyEiJ4WkYW3c0Yj0yjKMCFwb7tCpUR1tdA/dPr9w292ogZJw1k5HeVwBqno8GoOi56CC6i/ddCbzWpOzoi3sy9XmZfCF8OEf6ZLMfQJjt/KqC0ZAaWW1u4VhxMOfmaXQPphH5ZmSfl17T16jx5qB83Sw0mIxxv5MWn0BfHiQB/fijw8TSrpqAQ0RGBOjj5YPadT0BziomtWior4CPPf4GF9FMOy6KnWzSY3OvLMdReCI6aYf1goGpspcFs5nkIOaDgUpfaDvwzvOCKV518JSSwAGeZ61Uw1WoQ6ffiJ+8nP64xYrdr5WkJAMy/3PgJBhSZEVVryUFGpxLSpog6D65WDVdH+OKWaktwhzurc6XCOTECZSNLxbmLDJMKd2ZRJqP1Fg9tptbRSM5tvT56QkhgGqG1oF08oi7BGOpDQUli7/OS0Hpo= X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd528f8f-75fa-4400-5a95-08d9fc59a9d4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 14:33:48.3547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0kIkL8uIfo8dmsxf4BLbHO/NY7VSzEUH9Jfy4b/uFYBo7/iLwz/YnQu7Fq15HkySIHWjRZipRlON1sK0zpM2Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6983 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 ; Wed, 02 Mar 2022 14:33:56 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/162612 From: Stefan Herbrechtsmeier The systemd init manager support mount point configuration via mount units and /etc/fstab. 'Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring mount points through /etc/fstab is the preferred approach.' [1] Read mount points from /etc/fstab to determine dynamic mount units. [1] https://www.freedesktop.org/software/systemd/man/systemd.mount.html Signed-off-by: Stefan Herbrechtsmeier --- meta/classes/rootfs-postcommands.bbclass | 38 +++++++++++++++++------ meta/lib/oeqa/selftest/cases/overlayfs.py | 4 +-- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index cd8986d8a9..e1276a220a 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -376,25 +376,45 @@ rootfs_reproducible () { fi } +# Perform a dumb check for unit existence, not its validity python overlayfs_qa_check() { from oe.overlayfs import mountUnitName - # this is a dumb check for unit existence, not its validity overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") or {} imagepath = d.getVar("IMAGE_ROOTFS") - searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"), + sysconfdir = d.getVar("sysconfdir") + searchpaths = [oe.path.join(imagepath, sysconfdir, "systemd", "system"), oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))] + fstabpath = oe.path.join(imagepath, sysconfdir, "fstab") + + if not any(os.path.exists(path) for path in [*searchpaths, fstabpath]): + return + + fstabDevices = [] + if os.path.isfile(fstabpath): + with open(fstabpath, 'r') as f: + for line in f: + if line[0] == '#': + continue + path = line.split(maxsplit=2) + if len(path) > 2: + fstabDevices.append(path[1]) allUnitExist = True; for mountPoint in overlayMountPoints: - path = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) - unit = mountUnitName(path) + mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) + if mountPath in fstabDevices: + continue + + mountUnit = mountUnitName(mountPath) + if any(os.path.isfile(oe.path.join(dirpath, mountUnit)) + for dirpath in searchpaths): + continue - if not any(os.path.isfile(oe.path.join(dirpath, unit)) - for dirpath in searchpaths): - bb.warn('Unit name %s not found in systemd unit directories' % unit) - allUnitExist = False; + bb.warn('Mount path %s not found in fstat and unit %s not found ' + 'in systemd unit directories' % (mountPath, mountUnit)) + allUnitExist = False; if not allUnitExist: - bb.fatal('Not all mount units are installed by the BSP') + bb.fatal('Not all mount paths and units are installed in the image') } diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index 82007fade7..79d36fa93c 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -61,9 +61,9 @@ DISTRO_FEATURES += "systemd overlayfs" self.add_overlay_conf_to_machine() res = bitbake('core-image-minimal', ignore_status=True) - line = getline(res, "Unit name mnt-overlay.mount not found in systemd unit directories") + line = getline(res, " Mount path /mnt/overlay not found in fstat and unit mnt-overlay.mount not found in systemd unit directories") self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) - line = getline(res, "Not all mount units are installed by the BSP") + line = getline(res, "Not all mount paths and units are installed in the image") self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) def test_mount_unit_not_set(self): From patchwork Wed Mar 2 14:33:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Herbrechtsmeier X-Patchwork-Id: 4586 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 248E0C433F5 for ; Wed, 2 Mar 2022 14:33:58 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.49]) by mx.groups.io with SMTP id smtpd.web08.7732.1646231632021920063 for ; Wed, 02 Mar 2022 06:33:57 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@weidmueller.onmicrosoft.com header.s=selector1-weidmueller-onmicrosoft-com header.b=FsEEK8XC; spf=pass (domain: weidmueller.com, ip: 40.107.22.49, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lPeSIqRQbECZ48/LgotJjNg1PYRSYJZoLH9KvnOWQZNvFn6i8LsQjioo4EmMWZkDTQQiKxi4zYOWAAC4mn4Pz/mLhRQgfv7rlCOCFgTHoIuRObiab/KyME3z6ceRYQVsHi5Bg+D54GSCoyu5PGIAQTa5m2P+ZhFmwZErjT4JDw5ciKDnm7vefJLFn4+PNDnaS0XXm/nb1RsF9U/E1dlpEsZKfZLhJTQGfkzG8lIekedCfASBzczoFdaRGhsvkcEj90Cq0GhlqfDkzAkgfrBfA05TF/zNZhC1+vpA1pnbefWjghWRuyhXnWT/O6JHpx+nNKWMdeuJDfgFN5q3m3ef6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gyYlhVJHVbwclsVQa9xRrWcNPxuRoNmDq0syQP7D5LQ=; b=eKNO8h+uo4zsCSY3AvvchAsTFYdDzq0iljHF/ePnFlgT7OONkgxumTubIq7+zYrFFDskhOgu2ai3o5KOsFFoKvJPjf94/zFOuhrKftAeX+QPe9F/HCxznuKIcCFkPcg/Gtx7wJeWqufbLV0QMVT5wXHHXRENpvt3FHAdq8qBTUDDMusKVAfXuHyUfqnhcRFuqmkP4Ry4rTkAaa1iZ1+zPzYzmjXUfRT2Zx7rB0aWlNr5N8pt8PuESH7XyRUC9VkmwWaXazobdHjRsQvPVYm3OikoT1qrX+5+gK9A/ZaIl1yTXV5iC04iCcHx30LCbfTP9/qB7f07doV3Ew0dIOE92w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.onmicrosoft.com; s=selector1-weidmueller-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gyYlhVJHVbwclsVQa9xRrWcNPxuRoNmDq0syQP7D5LQ=; b=FsEEK8XCMSXcBPfra1j9j0+lF1jzuxtTRWreaUC0xuJVT2ewfqLa74aC2l2g/NzIufRAfLuw+Sq5zsniMB0pwSF6IhtpLr7fhVb7tyskZjs5Hg7JG+J/SfVPSA8Cs1Rhu7HclatvxwjrZ5c/qF+AMUy0+Jl6/uTGS9m/iX8M8hY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) by AM9PR08MB6983.eurprd08.prod.outlook.com (2603:10a6:20b:416::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Wed, 2 Mar 2022 14:33:49 +0000 Received: from PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::4a1:bad9:11c2:7de0]) by PAXPR08MB6969.eurprd08.prod.outlook.com ([fe80::4a1:bad9:11c2:7de0%4]) with mapi id 15.20.5017.027; Wed, 2 Mar 2022 14:33:49 +0000 From: Stefan Herbrechtsmeier To: openembedded-core@lists.openembedded.org, Vyacheslav Yurkov CC: Stefan Herbrechtsmeier Subject: [RFC PATCH 2/2] oeqa: selftest: overlayfs: add test for image with fstab entry Date: Wed, 2 Mar 2022 15:33:29 +0100 Message-ID: <20220302143329.4168-2-stefan.herbrechtsmeier-oss@weidmueller.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220302143329.4168-1-stefan.herbrechtsmeier-oss@weidmueller.com> References: <20220302143329.4168-1-stefan.herbrechtsmeier-oss@weidmueller.com> X-ClientProxiedBy: AM6PR10CA0061.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::38) To PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db97994f-795d-4fe6-5ffd-08d9fc59aa2a X-MS-TrafficTypeDiagnostic: AM9PR08MB6983:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 51xcopZ6vlMaHKom9RWPg5c1T5TaxdnSt4xSFK9CYS8Gz3mNFnnp5jG9sZwnfpHWJuVWCuthqUOdvOEbDGwwx4KaX/SwfZpphlyPPyuXEFQHD6FaD4WNj3RDcaTw8we1Kp1AtIK8M7vhijOC1tzYkuqqkaOa4i9srI+w0mED+rxlZhozwsNUOlqih+MX9/WJtkcYU+sjKnlPuEBRyfVD/KDKzBvPtz9LF0LK1CWmGX7HOMDDIPVbp08d+oWr7YrjUs7qsL0izS2CHy5yQV2V+Zug7i5GPn7geb9vWGBSOH7Ofre5PO3D/GeU+wPmJN6l2U32adNYSRsxgFx8XxMuXl1t+oSr/IKlAGbRYrNPnZTCYRx8qqnFmcyIpTYjq9suBzC2dNjNC3ZjdR9nSLMnZtCeeXbO2B0uNgqqWMRhZbVur4O0+Be/bcV2ZPDHudfEMXvTGwBII1WH+ZyR8y+1faYlA+TOxtu9pB772AujoZqbb5OgPp1n2f9Hl8R5nwbYfdQ6eo8jU1qFTzcxJr+E1ypcP3dNgtTwvdNbuooF722lkdSk0Y2DzRbrXiNXNY/IrvxJUL/Fj7fD6ZZAHZlAondAgvk+B/pL7c4cXZvzUGwG68qO0gnA1pGwMMs+QxD7VTSfIUcPbMeA3r7up7h2tUtCH0wZr9hKn669O2Vxy9A0VUJwNz+kgoF3SvjF9z/sqSeuj7hrq7O4QhCZ2qcLwg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB6969.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(5660300002)(8936002)(38100700002)(38350700002)(6916009)(1076003)(316002)(6486002)(86362001)(508600001)(2616005)(52116002)(83380400001)(2906002)(4326008)(8676002)(36756003)(66946007)(66476007)(66556008)(107886003)(6666004)(186003)(26005)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YVxDd/luwMLQNQVEWux+Pr5NVdHL/vcZcajEtBDjzAFQim3d8fDpE3daPe5+v55TD6IlYU8dYcF4mjA3DIx07ByNwq0BthBq+5fY27WtIP9EvBfvp3isjPKrbR6v3mFC2KP/+tpJYXA0KS5d9mken0l99hryl6Q2BP27bPlNXm/U5ukrUWNqnkhRYleIAilJ+0erHq8Z5OwNi/T3/j2aVB4CtQCzc2peoNR2uQevAvMZ6rNhvWhB/FkmP1MmTd14TYVzscHvMUtA4W8/RO9udgpg6yt/rSnVNun+OV1CLoZUzoZIAJa+6ShHqtjV/is36uIkkEmzUYOwO/zE355Sn9Dyn3peK9cTCbS83X1EkzrLM73sZPYpb1mqH2BWn2cEIfBjlMO9XXHwyOE3M6oDQUG1si9psWHsuiY4S7QTSop0Pu21mQ6A22CfOkVCJDbWnSjKBgV6BVtdRq9hI6a1CmNj5CizkivLX6C4VmktT1Pyu+8iew99Tgjm0soB0c9vNNbfXMl6ktonw7/wlztccP1EO8MQceOSJN1EAv7N/NP9+4Mx0xEqYf4mHNmuRIXaMkppEkM5zb1BvwRCvB2K/DHaGtNmkkNCLyijJMFCCee2GgKqIrOsmywIGKBydX8f1r9T1ryphTs/8zLCWlaEIDQh0Yv9ljl+W15PLKOiZazdQaedo/smzTnXTk7PXcn2aT/aKAMRsZOiI1gpXp9UtIAjqrONbR0xDUOa3oogWJrjZeYnzp8pczYfGGcH8jdAOViNG7NukF91BWFd3zK0u2kpsvx1Jfx6o4sFM+PRd1nr1zo/F+jwIvdzomwuLbYcgeKVyzOYm3kmSEPgPW78BZ3YmQQK7RcrO3rGt/BY0HaHcEsz2oXn0uDmgDDHaW88IudiqLdWB8xU84meXkMTOBX/lxaKp8eMywyqleYKp3ps4M5SeutXmmmcrj6HH+PIaZ4E2fd7oT4251cgJ7le1NLA3VhxFca6SKtNylqUMozagrc+BmRDEJM8KpTdQhCnBzpA9FaGDyz/HsnjQBsJfq09sx60MIzbeTMuqqF7wU0Hcl7S+1QeeKZx0EkwizjB5fiEDo8Neh+TpIDB77QcEw+aUjVyiwusK1BzkNPFOAXM01KrifOwgAiaKMWrvtqW/hztrbtE9qCG6y9VQTKGHF2TND3PyUQmgwlnG5nwQW1oCEOj/wztJBM2X132svzz9bFgvvO/uiOGLC4OPgst4ejSqzOJZdW5d07jS1bQ4kXNn++joVr/emjhecbibm+odSh9fF/Dcja6eeLognCJj1ZmoZ46hWoDZVTI69nTzD+OBfTE3pzKvCd8WKO1ogVwDAmfFZ0e56KzY89hwvhX/h/OPhkFRc/HlvWejgoHzAZ+rke5LN5hG7XoZ7hHnMGfMLV6Dpsc2DBAe5BbKu9xyh4FWH8UPEK98gZNjnam0gSTSpiJih5jE34tB4n9s6JfWMSttGgaanG41Ep8Y8dM1UKE3s83cQosJufr2Vf3AnVV8v8c+YPM9JCTO3HyKExq+XT+AEg/FEHrZstm2LuIKkqy8ixE7LJgPcrkfmcqMHXWh8pT9c6MMbkKpajYUDT43/loZ6uZC6zDYo2GcEaXQ7bocLqPOnwW5fBVhr9WIWY= X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: db97994f-795d-4fe6-5ffd-08d9fc59aa2a X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6969.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 14:33:48.8546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U2MPKkFhRGHHVsx0ZWAN2a+maTYKAQPzN5+rjleK0m2Xaij2vjHGKNUYpcKVPCM0br4DUtIi1FGlHoc03SmoRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6983 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 ; Wed, 02 Mar 2022 14:33:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/162613 From: Stefan Herbrechtsmeier Signed-off-by: Stefan Herbrechtsmeier --- .../base-files/base-files_%.bbappend | 2 + meta/lib/oeqa/selftest/cases/overlayfs.py | 82 +++++++++++++------ 2 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 meta-selftest/recipes-test/base-files/base-files_%.bbappend diff --git a/meta-selftest/recipes-test/base-files/base-files_%.bbappend b/meta-selftest/recipes-test/base-files/base-files_%.bbappend new file mode 100644 index 0000000000..205720982c --- /dev/null +++ b/meta-selftest/recipes-test/base-files/base-files_%.bbappend @@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index 79d36fa93c..56ae48ce64 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -107,7 +107,7 @@ OVERLAYFS_MOUNT_POINT[usr-share-overlay] = "/usr/share/overlay" line = getline(res, "Missing required mount point for OVERLAYFS_MOUNT_POINT[mnt-overlay] in your MACHINE configuration") self.assertTrue(line and line.startswith("Parsing recipes...ERROR:"), msg=res.output) - def test_correct_image(self): + def _test_correct_image(self, recipe, data): """ Summary: Check that we can create an image when all parameters are set correctly @@ -124,31 +124,6 @@ VIRTUAL-RUNTIME_init_manager = "systemd" # enable overlayfs in the kernel KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc" -""" - - systemd_machine_unit_append = """ -SYSTEMD_SERVICE:${PN} += " \ - mnt-overlay.mount \ -" - -do_install:append() { - install -d ${D}${systemd_system_unitdir} - cat < ${D}${systemd_system_unitdir}/mnt-overlay.mount -[Unit] -Description=Tmpfs directory -DefaultDependencies=no - -[Mount] -What=tmpfs -Where=/mnt/overlay -Type=tmpfs -Options=mode=1777,strictatime,nosuid,nodev - -[Install] -WantedBy=multi-user.target -EOT -} - """ overlayfs_recipe_append = """ @@ -179,7 +154,7 @@ EOT self.write_config(config) self.add_overlay_conf_to_machine() - self.write_recipeinc('systemd-machine-units', systemd_machine_unit_append) + self.write_recipeinc(recipe, data) self.write_recipeinc('overlayfs-user', overlayfs_recipe_append) bitbake('core-image-minimal') @@ -210,6 +185,59 @@ EOT line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/another-overlay-mount") self.assertTrue(line and line.startswith("overlay"), msg=output) + def test_correct_image_fstab(self): + """ + Summary: Check that we can create an image when all parameters are + set correctly via fstab + Expected: Image is created successfully + Author: Stefan Herbrechtsmeier + """ + + base_files_append = """ +do_install:append() { + cat <> ${D}${sysconfdir}/fstab +tmpfs /mnt/overlay tmpfs mode=1777,strictatime,nosuid,nodev 0 0 +EOT +} +""" + + self._test_correct_image('base-files', base_files_append) + + def test_correct_image_unit(self): + """ + Summary: Check that we can create an image when all parameters are + set correctly via mount unit + Expected: Image is created successfully + Author: Vyacheslav Yurkov + """ + + systemd_machine_unit_append = """ +SYSTEMD_SERVICE:${PN} += " \ + mnt-overlay.mount \ +" + +do_install:append() { + install -d ${D}${systemd_system_unitdir} + cat < ${D}${systemd_system_unitdir}/mnt-overlay.mount +[Unit] +Description=Tmpfs directory +DefaultDependencies=no + +[Mount] +What=tmpfs +Where=/mnt/overlay +Type=tmpfs +Options=mode=1777,strictatime,nosuid,nodev + +[Install] +WantedBy=multi-user.target +EOT +} + +""" + + self._test_correct_image('systemd-machine-units', systemd_machine_unit_append) + class OverlayFSEtcRunTimeTests(OESelftestTestCase): """overlayfs-etc class tests"""