From patchwork Thu Jan 5 18:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henning Schild X-Patchwork-Id: 2407 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 05 Jan 2023 19:43:50 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f186.google.com (mail-lj1-f186.google.com [209.85.208.186]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 305IhnZB009206 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 Jan 2023 19:43:49 +0100 Received: by mail-lj1-f186.google.com with SMTP id e28-20020a05651c039c00b0028112f8e550sf601505ljp.23; Thu, 05 Jan 2023 10:43:49 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1672944224; cv=pass; d=google.com; s=arc-20160816; b=m+MS3t2YsnNlXPAV+naytvry3wMIQbUWUb0uL4L3w1X6Z55fkmRnNA8qfZ4SojTTv0 ylAfzyqFNstw9zhsa3sEWceor3XIyoOyAZcMePEDieu/8XZTu1v7ibDI5HV7jJ9ASMYq 6xsCr+3Ck2M8/VPOEcAzOP50/04te7wvDXhPMgQCbPCpL3mjfptG/d1jwcgMmkcgIeMy Md7+7I+YAKsLatQab/Q0iaK8mRW7SQ6Ed2RIMn/Bi0fWcaAQViTFFAOdd09OdzUszmmY 9EaJK3A0cZeAA0ShorFXBMpZx+bkPEp0y4iMJLNFKTwt6WJT/vUq+QMR3ewgy4N3KTED K+MA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=pVxSekjBX/hQCS6/1DLUJk76JkooJJg8+3hXyp5tFCI=; b=xREkoXKNXvLy6ERDBxZuKBhoYE4FuSbmBAqMAn6HJ3HE8uYD2Fyjs/Vu/RhQ/t8tbN f/e+pZa89vPaUPZ4wdZAW3pSqyhIJ6crYcTjHMxRTVlX/YxLNRwuUPceyZP+oc4ptJzb BiE11qz17MaEePP1/5ZS+Xm5B7KQCSwxDOI4yc2FLkkR8f+8uZ67iWdasbGvVR5TsV6c GD55u/SbhLj7jFXNk87VUNj0nSLJNIs1OBZcjZ+HrUPS/yPzCRIjapMt00IF9AnGaDan G9es4b/R/Wg6+oD36q++eQwFDOMZf8y+ipP5fWIwpL1yVcsyU+dHWFF6QgUtoG679bIy PAlQ== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=FRHjfgK+; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of henning.schild@siemens.com designates 40.107.7.53 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=pVxSekjBX/hQCS6/1DLUJk76JkooJJg8+3hXyp5tFCI=; b=mMnaMQDwIhHGabqRpGRtXExUHaq6Wg6dUUYYiW3ZuhBnf69eTC5S5dY2wwokaBCXAl wAwYmlAAejTemh3effY91sDrNXVm7WjXreBzzbUdE2Tr82fMo2hs7BxQ3SIe95/EOwcT UPIu8yuwEaouP2W4GxRK4JLQ/7OG6+XKAatXpNET5AAi5nlqxAaMnJIgULsFR5FlnOyo tMVAMkeITpmQ8fLiPtfX/BK+kKUcDxq7pOEWL+S4B62kGfcinExi5ubAli9j5fXewT+4 5KSlL47qdydnxWaQQ7hDkrV4W12xD4bndMrLODR0WPRr3O7BXmKb0Zfi3YR5LOnJ0Rru WyIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=pVxSekjBX/hQCS6/1DLUJk76JkooJJg8+3hXyp5tFCI=; b=h+EmCU0VIh3ZpDx9pwkXOnc7dul0UKLtqzd9b+EE69aap/xesauB3lkh1E73FYNRoq DvrNhpW2pC+PGSy05BQUqOMZtgsGHjzfUskMgu0nh0GIwSuTnxgvLDxW9LTKMQJ5CFSR 6iSIvom0PCz6j0ZEPh8tRPNXN2alrIanYk5HCxNw+7CBkbTinA1IAMkmED6BO0B9WG/0 nbyoq1QCL7lUy52mwdhdzxuJXtoIlWVGrf2AgLm3vm1pq/e9YxUxMV1W+Bsa6IZpt3gV 9TI7iPg5wHHjm9HTbYzDmREdMdv9jYVncK1u1H+3cq2PGRA4Hz5CI8yRjzIPbCPoz4eM MJdQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AFqh2kq0IOKfrZV24kj2ltiyNS3ZaNZuBEL0bqY52feO0Mkae920f4ub xDqNw92z+wTMce0G/rwQFGg= X-Google-Smtp-Source: AMrXdXvcAtJB7HUz+QQXfoksTKw3d0mJYEAmfZWDKe33TTRkH6fPBvj/PcUmNl9VZ8hSICs7P+m6zg== X-Received: by 2002:ac2:4851:0:b0:4cc:5a57:ba99 with SMTP id 17-20020ac24851000000b004cc5a57ba99mr231865lfy.678.1672944223999; Thu, 05 Jan 2023 10:43:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:a309:0:b0:281:15f8:128c with SMTP id l9-20020a2ea309000000b0028115f8128cls221597lje.8.-pod-prod-gmail; Thu, 05 Jan 2023 10:43:42 -0800 (PST) X-Received: by 2002:a2e:9616:0:b0:27f:e5d1:2cca with SMTP id v22-20020a2e9616000000b0027fe5d12ccamr5077085ljh.46.1672944222792; Thu, 05 Jan 2023 10:43:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672944222; cv=pass; d=google.com; s=arc-20160816; b=YVi35BWf9yysMfVRFnQBDqx1NR8MtWKRXHiM2FE+1zJIagR6bWgcmCKiOHBmIKDuoI MT/ADsYxZfP0LFfbXcSFMQzVM2/J3e3VB8wudF8gqUXRhGHXVHJpYsm1Un6BlE295h36 rvGmaU4r5/hn4oPYSTcOMT1e7I5P5YmNfmDHlsD4FJit+eJEfynMTOI/X4ySM2SCQuNs PJkDzA/U9Fq2k09czfOiQmNN+Cx7qr79aczEr2mgirdnlmVHNt4SV6M6d9pi/KzV5XCN Myune2Z0gvN8ajKexwtnI9g8Bp36GxS7sQ6LkJxC7XaqtLiAdoOpnhDEDKrRQX0M/O6p +Pqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=m05KyRbauVgk7LyGd9DuOflwbMReAhk7A1dI4+d1NSY=; b=dZjVgi+NA3LhDJJyxqB37JS9kI6sJyEYwNAOW4owemk9jDsCeEsa+rHdxBLWSjTwYb tCZl0l4/dW556HQnBq9MIc82jpMQ6wpuugnk2cNgVQWwGJDuOdU+9iVVdZn95Xul/g/w TV7Ud4I8Bi4fxP/p5VVy/5IxCxuYbIyYnjT6FhBKNJDymXh1Wjn3MvDdFI+ExR87MBF/ xTvOIT84Mu0Qn7zDcbKyiDaz2VL8VGVeoPXYluwnnWTyFlwtmZ/9QtwLc1Yr52NH99AN lszAzd24zyKpKR4uzpIppiDe5Eo7oCQ5sVNsHiuci/N7xN7HuXMSTzOU09YqKOccB699 hQnA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=FRHjfgK+; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of henning.schild@siemens.com designates 40.107.7.53 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2053.outbound.protection.outlook.com. [40.107.7.53]) by gmr-mx.google.com with ESMTPS id s4-20020a056512202400b004abdb5d1128si1316095lfs.2.2023.01.05.10.43.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2023 10:43:42 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 40.107.7.53 as permitted sender) client-ip=40.107.7.53; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VSrh1z/pqEaB4wfVkx4xGmNunIczxtYbDxIUmlKyCVAIVXc+avDu7RPoy3kZQvDCMDNq/uciOzTDXWpJ3r1ztpWCqe1i0Mbhrj7cY6L7YjYzhAHxExX4jRvR62KSPSVFp4+cK4n8ucp8jCBWxKRt8t2UqWAUcrWypBoqL1qzfj8uZozeL1b6n5iIVCH7BDZI9BjZobg3iyUejq1Zg0Q8HmJxmhb+vfJuASm52C7NZx19n5Ylz13e96LYviAOcpfttjj4RvNTWT0fMfwC2HksYTJFzMonR0hdS3LbPursmkVto1p5hHw5ygryTrKlSBzSvGZExZxIHvB4BGM98bm+lA== 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=m05KyRbauVgk7LyGd9DuOflwbMReAhk7A1dI4+d1NSY=; b=Xztzq+hKKyXV/EYR8JruQ+uwQvb4QeV4eAzKmfk4JnpGYJGHZeuoWlkXmKQnv7s358F7yRsviK0eD/2z/B+w8/4XQRi9SaMlAO6jHOkpWi1WecuhmV2QKXiRE9i9S0cHthoOosxpVg6CfkGgPvHcWHJAR2zdSuGGhKzfrwDwCSq+K3iWWtSj8eVO3h2ofLStQLtU+sZ6LIL5iqshW6FD6lmp6RQ1cPmHdW6Jlsfg/DuQ9/2WUqbsNIfJtbgAu9FDfqKgduzrW8UXpJNi+2pBrxAO1Jzv6/VB9KOEIWMQhoMVAzTyYZFCfobJL2EibhdY7mqNtBDgxg6vchiaV9VkiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.76) smtp.rcpttodomain=googlegroups.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none Received: from FR0P281CA0118.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::19) by AS8PR10MB7255.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:618::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Thu, 5 Jan 2023 18:43:41 +0000 Received: from VE1EUR01FT093.eop-EUR01.prod.protection.outlook.com (2603:10a6:d10:a8:cafe::f9) by FR0P281CA0118.outlook.office365.com (2603:10a6:d10:a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.14 via Frontend Transport; Thu, 5 Jan 2023 18:43:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.76) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.76 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.76; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.76) by VE1EUR01FT093.mail.protection.outlook.com (10.152.3.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.14 via Frontend Transport; Thu, 5 Jan 2023 18:43:41 +0000 Received: from DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) by DEMCHDC8VSA.ad011.siemens.net (194.138.21.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Thu, 5 Jan 2023 19:43:39 +0100 Received: from localhost.localdomain (139.22.43.151) by DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.20; Thu, 5 Jan 2023 19:43:39 +0100 From: Henning Schild To: CC: Henning Schild Subject: [PATCH] image: make sure do_rootfs_finalize can run multiple times Date: Thu, 5 Jan 2023 19:43:28 +0100 Message-ID: <20230105184328.25277-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.38.2 MIME-Version: 1.0 X-Originating-IP: [139.22.43.151] X-ClientProxiedBy: DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) To DEMCHDC8WBA.ad011.siemens.net (139.25.226.105) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR01FT093:EE_|AS8PR10MB7255:EE_ X-MS-Office365-Filtering-Correlation-Id: 3409520b-0510-4898-fa3f-08daef4cc44c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l9NPfspzs+qZa0y2AFeKxe5lhbxlFGvbNAwqWgoaBKuLUj3TaH2kK8WnH97kzdr26wCQONkSXB/MCM/6wiC5ZkBb9ztQGLHO2SWA4RGnCDhKFPvxF3VmHD/2d+LZ6v2se+Squa/6sNNlh2memqm3anpyKk89nVY3SVNBpreK9F52X95nnesxV1daGJ7a7qb8rqIbyl0Qnp23lC7ReBszn4cdkj7kiDrFnESVbEtZCKAO4KH/RGnXB8MfmDf4vdmZHudC9tNGILi/ShVpg+G2F8dlztmozDFHIArD8EgSS9c6UjJ5tbzFhjVt1kpuqNXu8Ke7b48c2wWbsH0njkV/jIqzKf074kq7ud+TufZnZ7gIfTNa/fSOvOrAXVOthtKCCzF4SEYeF1ZBpqV4rlmpEtb7/qkBAzwwBRLtczntfPE3S+wKNEnojusEdYvcAOdvfmUAcftY3cLVqmlNdGVA61SNlBRJiXPOrUlYFchYQ5piym3/TAdnWSDbT3RMRvl02SnrDB3f4Yui9kxuUfuVJ2KDklwHdoAnBUZ3uhBjjv6Up6S5mJBIsDh6I5NGkGFxjIQPIiibhllTfbDrIYYGDNrQ1h2IB6H0PdkoEWkRtkvHIa8679Mbid3dlFb7+LR2Fn15AMHNv/3BEvldPLCSPjydb6fkvFe7uyuOSPwXUiBJVI5rhSUzgfIwF3jew+BLjZvw8fNmLQ8jL6DF+1niGlM/nsTX1JMc9mc9rIiL2Qk= X-Forefront-Antispam-Report: CIP:194.138.21.76;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(136003)(346002)(39860400002)(451199015)(36840700001)(40470700004)(46966006)(83380400001)(82960400001)(36860700001)(82740400003)(86362001)(8676002)(5660300002)(81166007)(44832011)(4326008)(2906002)(70206006)(70586007)(6916009)(82310400005)(2616005)(41300700001)(186003)(47076005)(26005)(107886003)(40480700001)(6666004)(8936002)(16526019)(956004)(1076003)(40460700003)(316002)(356005)(478600001)(336012)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2023 18:43:41.5809 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3409520b-0510-4898-fa3f-08daef4cc44c X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;Ip=[194.138.21.76];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT093.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB7255 X-Original-Sender: henning.schild@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=FRHjfgK+; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of henning.schild@siemens.com designates 40.107.7.53 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= There have been several places that would not work twice in a row. All the test && not covering || have been moved to if. The rm at the end tried to remove a file that was just moved. And that mv would not work a second time because its source would be gone. Signed-off-by: Henning Schild --- meta/classes/image.bbclass | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 629a0c1daa55..125eba192a65 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -396,13 +396,16 @@ addtask deploy before do_build after do_image do_rootfs_finalize() { sudo -s <<'EOSUDO' set -e - test -e "${ROOTFSDIR}/chroot-setup.sh" && \ + + if [ -e "${ROOTFSDIR}/chroot-setup.sh" ]; then "${ROOTFSDIR}/chroot-setup.sh" "cleanup" "${ROOTFSDIR}" + fi rm -f "${ROOTFSDIR}/chroot-setup.sh" - test ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" && \ + if [ ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" ]; then find "${ROOTFSDIR}/usr/bin" \ -maxdepth 1 -name 'qemu-*-static' -type f -delete + fi mountpoint -q '${ROOTFSDIR}/isar-apt' && \ umount -l ${ROOTFSDIR}/isar-apt && \ @@ -424,10 +427,10 @@ do_rootfs_finalize() { rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list" rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar" - mv "${ROOTFSDIR}/etc/apt/sources-list" \ - "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" - - rm -f "${ROOTFSDIR}/etc/apt/sources-list" + if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ]; then + mv "${ROOTFSDIR}/etc/apt/sources-list" \ + "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list" + fi EOSUDO } addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess