From patchwork Tue Jul 9 07:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gassner, Tobias.ext" X-Patchwork-Id: 46095 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 4D623C3DA41 for ; Tue, 9 Jul 2024 07:03:38 +0000 (UTC) Received: from mx07-0040c702.pphosted.com (mx07-0040c702.pphosted.com [205.220.184.135]) by mx.groups.io with SMTP id smtpd.web11.7168.1720508610720917710 for ; Tue, 09 Jul 2024 00:03:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@karlstorz.com header.s=S-DKIM-20210427 header.b=cAE00p3j; spf=pass (domain: karlstorz.com, ip: 205.220.184.135, mailfrom: tobias.gassner.ext@karlstorz.com) Received: from pps.filterd (m0267679.ppops.net [127.0.0.1]) by mx07-0040c702.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4693ruEh022304 for ; Tue, 9 Jul 2024 07:03:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=karlstorz.com; h=content-type:date:from:message-id:mime-version:subject:to; s= S-DKIM-20210427; bh=MJua26jRB0fcLFccgnyXSYqEkptmOzbXorOlWSuR5PM=; b= cAE00p3jArQK1dfWbNKSQxslVC1nFVFZ2cgUOVhzdYp4KiVDxbEidaD8/fkgvtRd OzYLK9kFTAozuvwd3Y+9cto7fkjldheEk3suTPqi/tQqp5ugvWJ10T67WGlfXlr2 2149fQaDeKTQVuE9vmK6Ijw6KTPftJkr6p/CWekw6IpgNFv8kNJuIJY/EYTe/O9d P9yNEb+hPO9yoA4mNLv5z8LfaP1GfPIDobqtDPcbpIQuVL/zzoSC3N91wzYUsrmZ Ddu95YPIIuYFYoGb3pK722Y1hT+RmFKF/Nz2A4OhWxQqpFL/6QV9OfzB9GNCStAn D9Rm2eg212Fl5vr+OapPqA== Received: from eur03-am7-obe.outbound.protection.outlook.com (mail-am7eur03lp2233.outbound.protection.outlook.com [104.47.51.233]) by mx07-0040c702.pphosted.com (PPS) with ESMTPS id 406wdcmkjr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Jul 2024 07:03:28 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E+FmNU0O0CCQU2/SO6jBKuWLhMcVfJxYD1Waat53XhOIGROUfR9MDgIMuOgx0Hdrm2m0H3SpjDHFhqkYomCECwRqzCZwvFoVp1Jmt3KDzomiHCCSCR3dhyEtv9VveDzMns26j/IcET/8BSD2qQSAlHfyXxlFfBBTgCAFAPqsmxjetUt5WsAZ9DdDDvQ9cPqB7iEEPc8P2pKhcad8WMsepTEGUbY8QbxUfpPdsOH2VXQtSU8h86Aqj7WVBTivtyb+lseA4EtnVxf3fdkfYnlG09bzGhOJod3EGu+aN58sTy+yJI40lXKkVJfTlBRsIhYYUQOhsAm5y8fDep5sdG7UqQ== 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=MJua26jRB0fcLFccgnyXSYqEkptmOzbXorOlWSuR5PM=; b=Q1aipdoGcX2ZCZvMtpNA+s2NaTZ1uZaKxL+zrcQhGm+9AtZ3XmuHmD4NNScALV5DFWIRQJwWJO0BcH6vclawApxAa8b7Z6Zi8RvfsunbF2BfplYyGkNS0XFRTqe6pQ/KC1kio2gPqixiBppoUh/C9WdfA2Idyk+NqANt19C/p6hER9N9BdIP9RWSVVre+GpFMOaBMRLEwmx9NO39OeaOg5fu2HW4OByAd6QzN7GtnEDSAK7wtk4FiUe6Vw4aUsHu2mOWPcjnvCTi1YK1Pbyhp1s5OA67TrCrpxVM8xC6msbr/ia1RKNrwHCLPe/NS/KCp2MtUKifOnQ/KQDiQs3A1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=karlstorz.com; dmarc=pass action=none header.from=karlstorz.com; dkim=pass header.d=karlstorz.com; arc=none Received: from PA4PR01MB9356.eurprd01.prod.exchangelabs.com (2603:10a6:102:27e::19) by PAXPR01MB9975.eurprd01.prod.exchangelabs.com (2603:10a6:102:24a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Tue, 9 Jul 2024 07:03:25 +0000 Received: from PA4PR01MB9356.eurprd01.prod.exchangelabs.com ([fe80::25dd:b483:8f47:4413]) by PA4PR01MB9356.eurprd01.prod.exchangelabs.com ([fe80::25dd:b483:8f47:4413%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 07:03:25 +0000 From: "Gassner, Tobias.ext" To: "openembedded-core@lists.openembedded.org" Subject: [PATCH] execute pkg_postinst_ontarget task for read only rootfs when read-only-rootfs-delayed-postinsts is set Thread-Topic: [PATCH] execute pkg_postinst_ontarget task for read only rootfs when read-only-rootfs-delayed-postinsts is set Thread-Index: AQHa0c3dSfYY3QbjekeMPqy5lAIJMw== Date: Tue, 9 Jul 2024 07:03:25 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR01MB9356:EE_|PAXPR01MB9975:EE_ x-ms-office365-filtering-correlation-id: 0a21511a-b26f-4f53-0820-08dc9fe53a85 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?K2xai+5QYOF2VeKjz0ja4MtQJ/?= =?iso-8859-1?q?Z3WUMOYLZVoMd6vO1nmo3HAWpbHl/b/mNUqngMdue0kiIoPl3fic8qtpm3DL?= =?iso-8859-1?q?ynXtC8cZc5l46pvTms5AzgLsuOya5MWbtC3009n1rOmHTZdt+4vJxoO25g09?= =?iso-8859-1?q?HZYkKTxDPVZnj+v+uyc7Nd1hjdWACyJcd3iNfQuxubjhxMkisS4EYereDMkf?= =?iso-8859-1?q?kr03jwQSenK/m1Bx6nxqwIWsUZDDM/TCu57gNVIee56MpZ6Bz+o1NODDJKCB?= =?iso-8859-1?q?UjWC61NTPYMbcZU8y/CdQoN370P94ai37dI0pvZCXeX7cFGvbqPd6btvMd/R?= =?iso-8859-1?q?neu5YAH208LjXULim5gCd491pzXU9BuNu6BemPCvzalof+95oARtLSl84re0?= =?iso-8859-1?q?cX2y3CjifkqxreSp1RD7QNSVNxs0eEVDBpxoJD0EKTaOZgbjfqDUhW3tlqxp?= =?iso-8859-1?q?+JS1MUSOR7cPdmxpNH13+4F9hPYpK6w+/3ozFkh6pwShAuh1riQ/IwPjgaby?= =?iso-8859-1?q?hsPy4R0rsYnK1kmBhJkLV3kySmC59jyS5GouF+xAgA9Zf7onoAoGJsvJ+v+y?= =?iso-8859-1?q?iQ91lqMIE5SiVlWA4OQwINQY6zrsZL/F0QHJt/xrqpDsmtJ8rgT9QAjFMJEX?= =?iso-8859-1?q?aYXetpfjKMT9FcY2HAJTTFDOCGF1Pu+946fcsW1YMJ5Ap6wqe8Z5sII2Bsxv?= =?iso-8859-1?q?l5DQ77CvDLr0HPNBIi9EVjJ4BvAZ4Mj8XXOjdpRw/2KvF+1ydPuOcqJ0jip3?= =?iso-8859-1?q?GVkHnvbzEjcugDJhyg92vlFSZ0X/XxAtPL0AfAaIlyPQp8wv/pTp03+4FTWS?= =?iso-8859-1?q?KVCPWZBHZonc3g7NwroUFmOI5jI9hz3VxprUvPrp+8cG9+JRvSE3RddtVnpK?= =?iso-8859-1?q?40xJa0/Wbu10W7n3WyfRXw+2HDYpVcbApEAiNg8MU+l1R+Kw0XDrICTOZQFc?= =?iso-8859-1?q?RsZeD5Yq8kXYunrUzTI7xFuLQj2jmlHgRB2u0xfOAnUXDTJlvda6wjtu2bC4?= =?iso-8859-1?q?PB02xWdTB688/l+v3OuYXz545SpsB4R6zc6mXBXWrMDfiZqPLRUq4ieOqvFc?= =?iso-8859-1?q?Lyf6OX72fKJ3CshpEhMVKUBpAKZxXte83q5M6DtyrXXVBySWUXJFCXpvVEkT?= =?iso-8859-1?q?xOjgNzhl744Cqm2LPHzSii/W6YdFYOOrZXGiuvupohoR/rR75fAXt1GHlV6U?= =?iso-8859-1?q?pXdovx1oh2VLplcxZHvd5eMq+/OYopAK3PdKI19zJ2RRr4O9bR6RLQJ9B67B?= =?iso-8859-1?q?6XFTniwB8NUPcC16E5bgk5JPYdGyD54mPY/yLxz2nD9Ausw65SMKiIMGCsyM?= =?iso-8859-1?q?VT1L1IgI1TQFYUZflFfT8KenjPD7tt/j6TXcO3dJa2eVOsK8PRZ9gIgMq+Rj?= =?iso-8859-1?q?fZyJUj5mb99asrnfAnkz2ferdJCV3plrAtqxxgIGc=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR01MB9356.eurprd01.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?0jB8OGT2ZJAsNwk6BAlQ6hh?= =?iso-8859-1?q?duz08OjCSrp3vLZaBr7thKl0OER7BZIsHEMC5ds8yNIJbeIpprB226OSXl2Y?= =?iso-8859-1?q?fPXQqKwhWDpTg0n6ssCYNpDLSRnWKFSyMOiogsFPTsS4vZXgg8oYkAZ9WOOw?= =?iso-8859-1?q?jEsc9Nk2KAjnMuJlNRSEUzNMacrWNflcWZ1DxqiiDyeIwMmBElwq29R1BKtZ?= =?iso-8859-1?q?NG+i/7SvLgiIXQOa+4/lK8KGKjSdtJtrVxGFNSEGZA98iv5yFVZuMhrDu2B7?= =?iso-8859-1?q?CEjJUTgWieN+OlrpkMjdB+YyUyD3ex66BN7XvnUc/CKNLNi/MrJJbFiNfkD+?= =?iso-8859-1?q?I1lScuXpW7i5aj031LOLIEXXTKVHVWo8ejbGv0uKtEng7MBADk+g5/oXyYF3?= =?iso-8859-1?q?gGhmJsW/4XVxDITc8GWcdbliqG6Q9cjlcVw4zPL7jxb+8YlClXtTN3PF7jXv?= =?iso-8859-1?q?bTqOM2xWwLbxGKTsEM6rInUhQpOBSmM73FxPuPB30iuqGtZk8zWjvBGZDjMb?= =?iso-8859-1?q?d0GUKvqXq+9psEmzYK309z6O6xoR5WbfEnWeWNC96UNXxTk1TdK74clP6m+q?= =?iso-8859-1?q?bnzHvCjCUBhyrzmyCj2LVjmame9wk7zE2/5RLeGto/r5N9JNDu91pWOtQowJ?= =?iso-8859-1?q?6EhXw7ZXxRzbKV4j4xwDxWa74LAZfL/gvvPjg/ruQw1sSwGnw4RWkFL+g7aQ?= =?iso-8859-1?q?JjBF9r9vrOG3E+iihPMfyAr2OTVbxveYcAoBJDGzPQAhrQ0OQSIJYcgaSKCz?= =?iso-8859-1?q?tTOr0GVzkYBfq54DceNmbRrv5Z3WVKoh/uQCwCnBQ7XYUV68zU7Gbf5E9LSC?= =?iso-8859-1?q?JuoOmIyjlHYiNbTYHbP3y/iR2db3khislH6z70sVvogog+jKI3J9OA0yL2/4?= =?iso-8859-1?q?DnHdqEKQGWB71zim9kO5bUPfrhO8PDah4qA6UXZ85rBMBENvh1JqZhlMfugh?= =?iso-8859-1?q?Je1nw8xShsK6FWEvaUqFupxo1B/KlkVxatTVvZSgO4bGbvn3AdkrNuiO/owR?= =?iso-8859-1?q?VGelnQARS3gusZays64ThDHUO76lKXhpPf8Pt491LdV2uKDj+7DGNKSgERyJ?= =?iso-8859-1?q?64g900DLhCO2Oc7KdIX6G/HkUoKAPNbmNfeeWkP5TrWKzBacW5kWLb68epbg?= =?iso-8859-1?q?heFAvBJMhaYjB3cBiZunvlryEITJnLTFmJJ4s0q3jDCN74xEZRY7kd5g4vHi?= =?iso-8859-1?q?AZJhW96poyl36TGolL8h9CITGXdfl9k8slPY1ScQbIxkeEen3zAoduMNTbnt?= =?iso-8859-1?q?DlzYuKbjBrjkyTo8WydWeZllpq72toTuqIc2xpbVfw3BKAxOrIaTPHcQ3Snv?= =?iso-8859-1?q?rQcVpWnnmXau8oRCisdpTtaOuLs91rCffvQrsmw291p93KrhcBuyqXdJv0/q?= =?iso-8859-1?q?h8iW9k8inErCI9HZYUGI8nSPqDdPdv6fb4+9YGwEg3XANnrKKeVXlNFKBNfT?= =?iso-8859-1?q?wcea21GCad9+tgtUQnUMgBZZi1N62tB0AuHQKytqohFFj2nG5JPJO603cKF3?= =?iso-8859-1?q?wt+axARhqKMZqUVf7AuOJJMpIjf/LToC3T1e35iyXPsKsqB/giNncTimH6Bz?= =?iso-8859-1?q?P3P6/AaLGFqcaEZf/lhn30bZl0ROelSS0AZ+JNRi6ZjCcwmhaaVaA/xstEHf?= =?iso-8859-1?q?U7gPYVLcmVWT74d+eysUGDDBurkeGsexV8UDLoxbIM3qD91LPlg7QxFvDbVu?= =?iso-8859-1?q?T//93qLn7a0uxUhJRV2KIs3KW9u7PhcBNIbozUkmUGA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: karlstorz.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR01MB9356.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a21511a-b26f-4f53-0820-08dc9fe53a85 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2024 07:03:25.7341 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4a0b6f21-e6e1-4ed6-9dcf-e60e7190f648 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qiWU2ZOP7Hj4lT6B7BFhUVw5Vo65AuhW2jAV68NH6tWvruBqEETbRIiyzNwxlOZA6RBkgPlzn2G2ZLmr6ZBA3LXwsMzzlcssNg2j30jyshF4H95g+4m3Kpvq2yjUg6QU X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR01MB9975 X-Proofpoint-GUID: pVz5Dc6rTiH-6EEV-VoiBPUzb3DqSocO X-Proofpoint-ORIG-GUID: pVz5Dc6rTiH-6EEV-VoiBPUzb3DqSocO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-08_15,2024-07-08_01,2024-05-17_01 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 ; Tue, 09 Jul 2024 07:03:38 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/201643 Hi, this patch will ensure that pkg_postinst_ontarget task is executed for read only rootfs when read-only-rootfs-delayed-postinsts is set as IMAGE_FEATURES. In addition to the fix, a test in meta/lib/oeqa/selftest/cases/overlayfs.py testing the fix has been implemented. See https://lists.yoctoproject.org/g/poky/topic/106869018#msg13391 for the discussion of this patch; this patch consits of patches 608050984c5be67f506a0877fadbbe0b61575e54 and da51462765e24b186c55431b53856eebd5f6e8da in that discussion. Greetings -Tobias From ecf1d8c47ecb72c2f27464f01e932091374f4e6c Mon Sep 17 00:00:00 2001 From: "Gassner, Tobias.ext" Date: Tue, 9 Jul 2024 08:34:30 +0200 Subject: [PATCH] execute pkg_postinst_ontarget task for read only rootfs when read-only-rootfs-delayed-postinsts is set Signed-off-by: Gassner, Tobias.ext --- meta/lib/oe/rootfs.py | 4 +++ meta/lib/oeqa/selftest/cases/overlayfs.py | 41 ++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) -- 2.45.2 diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py index 8cd48f9450..5abce4ad7d 100644 --- a/meta/lib/oe/rootfs.py +++ b/meta/lib/oe/rootfs.py @@ -269,7 +269,11 @@ class Rootfs(object, metaclass=ABCMeta): self.pm.remove(["run-postinsts"]) image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", + True, False, self.d) and \ + not bb.utils.contains("IMAGE_FEATURES", + "read-only-rootfs-delayed-postinsts", True, False, self.d) + image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE') if image_rorfs or image_rorfs_force == "1": diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index e31063567b..580fbdcb9c 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -5,7 +5,7 @@ # from oeqa.selftest.case import OESelftestTestCase -from oeqa.utils.commands import bitbake, runqemu +from oeqa.utils.commands import bitbake, runqemu, get_bb_vars from oeqa.core.decorator import OETestTag from oeqa.core.decorator.data import skipIfNotMachine @@ -466,6 +466,45 @@ IMAGE_INSTALL:append = " overlayfs-user" line = getline_qemu(output, "Read-only file system") self.assertTrue(line, msg=output) + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently") + def test_postinst_on_target_for_read_only_rootfs(self): + """ + Summary: The purpose of this test case is to verify that post-installation + on target scripts are executed even if using read-only rootfs when + read-only-rootfs-delayed-postinsts is set + Expected: The test files are created on first boot + """ + + import oe.path + + vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal") + sysconfdir = vars["sysconfdir"] + self.assertIsNotNone(sysconfdir) + # Need to use oe.path here as sysconfdir starts with / + targettestdir = os.path.join(sysconfdir, "postinst-test") + + config = self.get_working_config() + + args = { + 'OVERLAYFS_INIT_OPTION': "", + 'OVERLAYFS_ETC_USE_ORIG_INIT_NAME': 1, + 'OVERLAYFS_ROOTFS_TYPE': "ext4", + 'OVERLAYFS_ETC_CREATE_MOUNT_DIRS': 1 + } + + # read-only-rootfs is already set in get_working_config() + config += 'EXTRA_IMAGE_FEATURES += "read-only-rootfs-delayed-postinsts"\n' + config += 'CORE_IMAGE_EXTRA_INSTALL = "postinst-delayed-b"\n' + + self.write_config(config.format(**args)) + + res = bitbake('core-image-minimal') + + with runqemu('core-image-minimal', image_fstype='wic') as qemu: + for filename in ("rootfs", "delayed-a", "delayed-b"): + status, output = qemu.run_serial("test -f %s && echo found" % os.path.join(targettestdir, filename)) + self.assertIn("found", output, "%s was not present on boot" % filename) + def get_working_config(self): return """ # Use systemd as init manager