From patchwork Fri Dec 12 13:47:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Germann, Bastian" X-Patchwork-Id: 76377 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 769B1D4922B for ; Fri, 12 Dec 2025 13:49:55 +0000 (UTC) Received: from GVAP278CU002.outbound.protection.outlook.com (GVAP278CU002.outbound.protection.outlook.com [52.101.188.80]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13023.1765547238976542119 for ; Fri, 12 Dec 2025 05:47:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@duagon.com header.s=selector1 header.b=MhyPZ6q9; spf=pass (domain: duagon.com, ip: 52.101.188.80, mailfrom: bastian.germann@duagon.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XKxeRHLS4sLnR1Fm9ry0TJVOcAR5z13WrkVuT07GZ167AgFoKl5WKJS5i8qmxRkz08Y8yOTsuEdI9FhaEwHGiNcCgg3vh5u0lbEIwsHQLEyQ6Ye/9Imm+eUD/9HPLDx8VsjNt5eyfxs/z6TVtzTiCk4QkHGx0vEHWapPUzWp7RD4KWLHMM1KQyQeHj+sq6FhVJord1LxBki53vNgtVoIAy3eJNUiA7os6faQHgBhNcUB04xAutFk6dqQYuKiC0EJih2mrECUZVUluK27IkhbcT+EBMTs3VRl5HGTbXOerDLQnEXgmCVBbWlSQEgtSzjCarXzaDB4I+iLHXFMK5cs7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oBLPuV5wkUhZrU356cYuC7zEsMRJ3Dxgq9ZsRtzUVkw=; b=lSQ6dfYHaES3H9+VmAUPNtw39IMMqxjwREKRiHXHwTukwyBPz8qTne3XIiLGZuRKLaIXR3+OCsT3qQjrH26yYmPOK1aDGF3+morsZ5Fca0hGwJbhwZwievOo9NvwalM9NIya9plGiojdTXA2lRjxHQC+rXn0Nz6RQQf76npZ0s66fOjecNuyRLmIhPAPBBVbS2cYIXjNqnCyWWi+uDl7Xehaz9CIw3xXSVTNUqYw1vhExJzk8LzdL0hYUILTqZbG+RvcMUdCeM1CaP9hCPPSbMMHgPOqCNmRqNMbc8NbhAIAJiAqIK/1paC9kwSLlhn2+4dkQGcD4e4kqNbEcKnJ4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.93.86.6) smtp.rcpttodomain=gmail.com smtp.mailfrom=duagon.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=duagon.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=duagon.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oBLPuV5wkUhZrU356cYuC7zEsMRJ3Dxgq9ZsRtzUVkw=; b=MhyPZ6q9nWGMmuwxKYpWF80Zs62N0Wj6g2+uR/nCNTOoMclwUPzq+E3GjCWaaITOqmXO1FyI2BO9p/SHZCZd6pdwigiN08Uc0oIxVehIJRKOIbsqC0yvYGhvhr/OEtpf6b+uaBVuviqe8QPOm9UhnbCbHwsWwqE6PIRDTzLDehM= Received: from DUZPR01CA0034.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::10) by ZR3P278MB1273.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:71::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9412.11; Fri, 12 Dec 2025 13:47:13 +0000 Received: from DB1PEPF000509EF.eurprd03.prod.outlook.com (2603:10a6:10:468:cafe::83) by DUZPR01CA0034.outlook.office365.com (2603:10a6:10:468::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9412.10 via Frontend Transport; Fri, 12 Dec 2025 13:47:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.93.86.6) smtp.mailfrom=duagon.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=duagon.com; Received-SPF: Pass (protection.outlook.com: domain of duagon.com designates 40.93.86.6 as permitted sender) receiver=protection.outlook.com; client-ip=40.93.86.6; helo=GVAP278CU002.outbound.protection.outlook.com; pr=C Received: from hz-deliver01.de.seppmail.cloud (2a01:4f8:a0:900b::219) by DB1PEPF000509EF.mail.protection.outlook.com (2603:10a6:18:3::629) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Fri, 12 Dec 2025 13:47:12 +0000 Received: from hz-glue03.de.seppmail.cloud (unknown [10.11.0.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hz-deliver01.de.seppmail.cloud (Postfix) with ESMTPS id 4dSW3N1cVsz4wyG; Fri, 12 Dec 2025 14:47:12 +0100 (CET) Received: from hz-glue03.de.seppmail.cloud (unknown [172.18.0.6]) by hz-glue03.de.seppmail.cloud (Postfix) with SMTP id 4dSW3N1N5wz1xZv; Fri, 12 Dec 2025 14:47:12 +0100 (CET) X-SEPP-Suspect: 5d08d76d1f9d4003b6f895c2136b35eb Received: from hz-scan09.de.seppmail.cloud (unknown [10.11.0.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hz-glue03.de.seppmail.cloud (Postfix) with ESMTPS id 4dSW3N0vW0z1xZZ; Fri, 12 Dec 2025 14:47:12 +0100 (CET) Received: from hz-scan09 (localhost [127.0.0.1]) by hz-scan09.de.seppmail.cloud (Postfix) with SMTP id 4dSW3N0M6gz19B4; Fri, 12 Dec 2025 14:47:12 +0100 (CET) Received: from hz-m365gate03.de.seppmail.cloud (unknown [10.11.0.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hz-scan09.de.seppmail.cloud (Postfix) with ESMTPS; Fri, 12 Dec 2025 14:47:10 +0100 (CET) Received: from GVAP278CU002.outbound.protection.outlook.com (mail-switzerlandwestazlp17010006.outbound.protection.outlook.com [40.93.86.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (not verified)) by hz-m365gate03.de.seppmail.cloud (Postfix) with ESMTPS id 4dSW3J6gN5z1wJ8; Fri, 12 Dec 2025 14:47:08 +0100 (CET) Received: from GV0P278MB0688.CHEP278.PROD.OUTLOOK.COM (2603:10a6:710:44::7) by ZR1P278MB1137.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:5c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9412.12; Fri, 12 Dec 2025 13:47:07 +0000 Received: from GV0P278MB0688.CHEP278.PROD.OUTLOOK.COM ([fe80::4ee4:c505:4a4d:6b1b]) by GV0P278MB0688.CHEP278.PROD.OUTLOOK.COM ([fe80::4ee4:c505:4a4d:6b1b%5]) with mapi id 15.20.9388.013; Fri, 12 Dec 2025 13:47:07 +0000 From: "Germann, Bastian" To: Alexander Kanavin CC: "openembedded-core@lists.openembedded.org" Subject: [PATCH] run-postinsts: propagate exit state to run-postinsts.service Thread-Topic: [PATCH] run-postinsts: propagate exit state to run-postinsts.service Thread-Index: AQHca23ObLkmjxEWVUKP4ARNdYsbig== Date: Fri, 12 Dec 2025 13:47:07 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-codetwo-clientsignature-inserted: true x-codetwoprocessed: true x-ms-traffictypediagnostic: GV0P278MB0688:EE_|ZR1P278MB1137:EE_|DB1PEPF000509EF:EE_|ZR3P278MB1273:EE_ X-MS-Office365-Filtering-Correlation-Id: de1de9c5-b201-4562-0d41-08de3984f448 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|366016|1800799024|38070700021; X-Microsoft-Antispam-Message-Info-Original: =?iso-8859-1?q?gxe6BB0kMAmOibkdt?= =?iso-8859-1?q?IFOmqVFhIxk946EaCKPS91VC7/mNQkDAhNF1l4Mo33SWDVyK6kcC2VflBNmK?= =?iso-8859-1?q?hDvahx1IDsFYGoWEoZjebQF/drmwTCzchkpmTkZvg4bfez2lExYuLI/5hA3B?= =?iso-8859-1?q?bqbV9bHpttTsQ2tc3ktOCkKiCawZHnr0DpDEcZwO8oH6KimOpHbJ9mNSvPxc?= =?iso-8859-1?q?GKGYOxypM0xFFfwTkbwPYT2K6Hy2KBZzmV0FCl4jZW9CHme+uWNgoC2o/acV?= =?iso-8859-1?q?Bl+XNuGg2VXqaVb6lce3MFs7JIrLf6BTNQDM3cQauf/+lgiT3MxjNklQGY4h?= =?iso-8859-1?q?yTtj8U5tmDHO33RJmW1YQuxle7Fg3rmVwMtwI0QtMDnHn8z+0JQyWKvtOcHf?= =?iso-8859-1?q?lCN5fbImQ8un24mu9mnohvifm/ZP0oDfUUiqKvAtviPc9Tq7iVwkWbubYOT3?= =?iso-8859-1?q?SpT8ORwHggou7WyDA1rZ+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C6jrHOJTOe02DWj7wqVT?= =?iso-8859-1?q?PHxyC07NuhZmSQ4fqGmZ74bsKb3mZ7OcnXsUsyZ1QFooRPl0790UHY0ZIesv?= =?iso-8859-1?q?XUNEvnUAsTXEWZtlSjoBKZLSP6sfLuGcWwl4EPjIIZHotd5v3JOEJg3L9IAG?= =?iso-8859-1?q?qD10kF27xur0DXSSxMSfhpDHKhdIXD+HGn7d6iqpr4HXqJqQZsHaF+EEi41X?= =?iso-8859-1?q?c5wJ7YD0f/cT/q+Z951?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GV0P278MB0688.CHEP278.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700021);DIR:OUT;SFP:1102; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR1P278MB1137 X-SEPP-CCCVersion: 2025-12-11T08:12:51+01:00 9ed91da2 X-EOPAttributedMessage: 0 X-MS-Exchange-SkipListedInternetSender: ip=[40.93.86.6];domain=GVAP278CU002.outbound.protection.outlook.com X-MS-Exchange-ExternalOriginalInternetSender: ip=[40.93.86.6];domain=GVAP278CU002.outbound.protection.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509EF.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cf3a34c7-809b-4edd-8867-08de3984f0d6 X-SM-ruleversion: 2.1.0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|10070799003|14060799003|1800799024|35042699022|82310400026; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?mH79DRvaadZBH83SLzCUiKn1Fg?= =?iso-8859-1?q?N6Vx+wii3xgC3Uso9wOiOzXa9iAIXSdBas9dT9Emy8ADhELCo/WGpfZ1XWdc?= =?iso-8859-1?q?pjPOLV2ks9okIK5MXnndSzJmamXfFtV3QOQLSVGH+PaQ6TChVy+WoLzbMop0?= =?iso-8859-1?q?0ue73oN65/7tvKDB7CNnhKCHfsKQqmLzQDsUIh5b/VxOENATWczU3ffIUSsJ?= =?iso-8859-1?q?kGOX4AaGpX9JKRxpdzmRZXKmlTN6GNr4+PMyZrL8zKeoGgIe0/qGs4aOS7QP?= =?iso-8859-1?q?ikj+noa7/I5BfCFemTmJLSiMWsQ/kwRGK3VVzFJbiaeeFGpMAi+j/TR06Vaa?= =?iso-8859-1?q?2+hCj9yRxrAYiLAum9NdC9LM6gOQhWqJeo7qeDXvs1ITAendI8OWXxxuDHtg?= =?iso-8859-1?q?ZT0AMLLC4pOi0CzuC9CMQbnhwqMeA8aEQwOGhiK/ThtTc4DSJr5QDRnWWAPM?= =?iso-8859-1?q?QuL3J5y1w7GpI8N9dAw0VvGREXUnPlEDDBLA0Fuh280dmxdUbvxwqg50PnC8?= =?iso-8859-1?q?AjAkaqcUDiWEEwn7G734U+PT/PusWIpYqmXhla8UkGfxTJ0EbHc9awD7SGSe?= =?iso-8859-1?q?ah8SFvVECxme5E+LOCfUYuBW2kVw4FgEPRxbC8ClJJFSTNvZebP3MxionNW+?= =?iso-8859-1?q?bYP8lSha1FtK06udOZT7T425FT64BUrwV4JYK02opJcWKlsqkX88eptZbIqQ?= =?iso-8859-1?q?R9jrCn988shO1yNRjyDrKLju1e8uoYUhN4QcHPguIB5wPEej/3APCx4l48se?= =?iso-8859-1?q?VWXKcclVxixdS5eobW735vYqBqePA154lBFK0Dhu7vQfgALPWKATArqPfK3/?= =?iso-8859-1?q?y30zDhJWdMbfMeXbArSnB153u9pxpen/70AvbYCN6uazQ3r7FzromtvqNdG1?= =?iso-8859-1?q?ggUTxaY9dT7B7u/6H7ZHOWq8RbppBijldwA8MIP8X1flascj8M4L7/vVicZ+?= =?iso-8859-1?q?Tz9eTMqeRpkPcWOIhJ2pLemcXzjEkf2BwSZPJoFhFIdW9Pkzh18UJu8BTF4z?= =?iso-8859-1?q?0rSdgjHyyIOx6Oy1LHclwe1HABeWziYW7gTesuKuiPcJSZ1ILmlTUpzhOazF?= =?iso-8859-1?q?5we0z0mWCHiCClgxLHSnlHJA1xaTlq64HM/jPSs0/cacTueBBP2RvkXx3Mcg?= =?iso-8859-1?q?Bqt+OD6m/BIXmO/7WzqVeL6MI66i5KezJ83azCuaZqbPUD?= X-Forefront-Antispam-Report: CIP:2a01:4f8:a0:900b::219;CTRY:CH;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:GVAP278CU002.outbound.protection.outlook.com;PTR:mail-switzerlandwestazlp17010006.outbound.protection.outlook.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(10070799003)(14060799003)(1800799024)(35042699022)(82310400026);DIR:OUT;SFP:1102; X-OriginatorOrg: duagon.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2025 13:47:12.9022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de1de9c5-b201-4562-0d41-08de3984f448 X-MS-Exchange-CrossTenant-Id: e5e7e96e-8a28-45d6-9093-a40dd5b51a57 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5e7e96e-8a28-45d6-9093-a40dd5b51a57;Ip=[2a01:4f8:a0:900b::219];Helo=[hz-deliver01.de.seppmail.cloud] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509EF.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZR3P278MB1273 Content-Language: de-DE List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 12 Dec 2025 13:49:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/227591 In case an exec_postinst_scriptlets child process fails during installation we want indication that the run-postinsts.service had a problem. We still try to install all scriptlets and only run remove_rcsd_link if all postinst scripts ran without error. Otherwise on every following boot a new install attempt of the missing scriptlet(s) is performed. Signed-off-by: Bastian Germann --- .../run-postinsts/run-postinsts/run-postinsts | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts index a94a769b59..b7352aa24d 100755 --- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts @@ -62,22 +62,29 @@ if [ "$POSTINST_LOGGING" = "1" ]; then fi exec_postinst_scriptlets() { - for i in `ls $pi_dir`; do - i=$pi_dir/$i + ret=0 + for i in "$pi_dir"/*; do echo "Running postinst $i..." [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log - if [ -x $i ]; then - (sh -c $i $append_log) - rm $i + if [ -x "$i" ]; then + (sh -c "$i" $append_log) + status=$? + if [ $status -ne 0 ]; then + echo "ERROR: postinst $i failed with exit code $status." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed with exit code $status." $append_log + ret=1 + else + rm -f "$i" + fi else - echo "ERROR: postinst $i failed." - [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log - remove_rcsd_link=0 + echo "ERROR: postinst $i is not executable." + [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i is not executable." $append_log + ret=1 fi done + return $ret } -remove_rcsd_link=1 if $pm_installed; then case $pm in "ipk") @@ -96,10 +103,9 @@ if $pm_installed; then ;; esac else - exec_postinst_scriptlets -fi - -# since all postinstalls executed successfully, remove the rcS.d link -if [ $remove_rcsd_link = 1 ]; then + if ! exec_postinst_scriptlets; then + exit 1 + fi + # since all postinstalls executed successfully, remove the rcS.d link remove_rcsd_link fi