From patchwork Fri Jan 6 18:02:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roberto.foglietta@linuxteam.org X-Patchwork-Id: 2417 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 06 Jan 2023 19:03:10 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-yb1-f187.google.com (mail-yb1-f187.google.com [209.85.219.187]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 306I39q1013680 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 6 Jan 2023 19:03:10 +0100 Received: by mail-yb1-f187.google.com with SMTP id x188-20020a2531c5000000b00716de19d76bsf2542226ybx.19; Fri, 06 Jan 2023 10:03:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673028184; cv=pass; d=google.com; s=arc-20160816; b=zkvr2sQHEBG/jHb1sRjv4DZPa+ZMOC3NilH8bdSSycNu45EJFTn12Knuz+nBniHu/B HZNMLAotUsgOQM1HXMANffjKvmKYqnqNBCuLuW+qid7hsOEUdODKZ5uMxguMME4ZZ8K8 EoSqOCnKp/7wotlVe/wOH9D5JjzaR55jJNuxOuiFBHLVX6+ENr/MeUAaoiNXCnUEXOV4 Sg1tK8k4zKGLQb/ti8hbhpXI6J3eiSh9R4swk+alzA/91ugrRns5icdl2xi9t16ggsy6 sEFyIjfrrEYF7pO0ynjD6E0huVBa++gTyDWrVs4Pe6tgXi2mi95TqHxJ2zDWz7ptXj+J 4RwA== ARC-Message-Signature: i=2; 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=ww1832w3e4Zm1erxhWza4S5hq/tnhqCTDSE+eKhJh28=; b=WRNPd4GztcvFnZqC/SmhjOdodeLCz2fsiVuxi1rc+i9xXi55fkCy+WuLEvYshZcCJX wFibicCOnpBugmAPQmvBkZUDk8tYAsSRVDByQ3ggbxtT+iro+YtDO3SrVbIaFycbMeyx fUTW7sIXYffSf2Qj8oljE5IRmg1GhURJFeimFMx80+CC8531CE/ywe6YFXcL7aUeREB4 u8N6OjGizUgVUCtjPfj/X5afevAmX7WmaBbYl0J8xtRXbMODfz7pQxQlhDwSaYPXOcSa FiH1Sa9QEShbIRAG3aSdcn4iQFOG69Jx5H5HOjLN1kEXnfBR9OOL/sc/xMNBIhNGjP3+ 8zPw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.164 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org 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=ww1832w3e4Zm1erxhWza4S5hq/tnhqCTDSE+eKhJh28=; b=o8Pq1a0OUWlEoVNXLoCS71msfdbqOuJvCGCqB5QYBsLneabkbbfg0SiiQFngudV5xL LG93QYoMRPA24XDABjq7kUQ4WhsYwoIet78XKgirEOsS9WBS+4fZCjiw7Iv2CsPip14q AlBdu1tj/Yv3n2tb2Oh4pzvrKk0z4c8NwVRX05488a6a1hNZdgQDiOr0JdKFD4fGUwSM +pUEvHJu7CELwDehKmVi7nswHSDyLBPA/q+DyPjZtYqx0OaI70rLE2VZqf5XPMAvRRt8 lRrnAuEcTB3Mj9Ge6Ruw5g3JB0W2IAI07/pAYLn3vfA0tTOFZWR0h5tD9tD5rD5z6c1Z iIAA== 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=ww1832w3e4Zm1erxhWza4S5hq/tnhqCTDSE+eKhJh28=; b=HUPgz3GFwJjjPmseXNz27wyXLyrzFh0/Oy7JHoAQJdveyJu4dDIqBD2+By4VqMQnAT +x26Lm0AS6l/eJsa8NvHSWQMYE2CZNSBTkdvOl/OVDHEwzjcHziVfNgoxzizOrqWhUu+ KuthheMwdCeviAliNdH/Yeucf1TJ5qiNejviWVZ2ovxVxykMYZ8qNRXcyIvh0ef3pFRk /7TPD24zrHM16ZNz3O12P/AmTkxQAyW7y72NZNDwxlpMqH5mSRpwp/VDpXQEbyU+KMwT +2F+cM1P8myeOX5ewmKsVEGs7zSu37ybcqrzF5VB2mhyPoNXYgEr68V1S/u+mCxe7CKG ZCdA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AFqh2kpWNSksvkgS9XO/fBbq5y6P3F7+DfUKuuY0z/B94SLwGclrc1pb jl6jmDcyYoFn3xpGAGlNNHA= X-Google-Smtp-Source: AMrXdXtz68V+J+HIGF/AY7diOt9y+rQwciF8zc7fZ1qP+BxRhVgXuJZP7/3MtPEmgGfCwuLSAWKE4g== X-Received: by 2002:a81:4f8a:0:b0:480:c531:5826 with SMTP id d132-20020a814f8a000000b00480c5315826mr3788700ywb.288.1673028183820; Fri, 06 Jan 2023 10:03:03 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:690c:310:b0:462:6db8:ed52 with SMTP id bg16-20020a05690c031000b004626db8ed52ls1115861ywb.1.-pod-prod-gmail; Fri, 06 Jan 2023 10:03:02 -0800 (PST) X-Received: by 2002:a05:7500:370d:b0:ea:5401:d668 with SMTP id gw13-20020a057500370d00b000ea5401d668mr3578366gab.65.1673028182278; Fri, 06 Jan 2023 10:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673028182; cv=none; d=google.com; s=arc-20160816; b=0Q9bHQe3AoPMv7A+5e0mecc1KkH1Kn9joEwtXcPpfRI4oFSWxbYUHVD5r5a5tQJlUZ arKB580qMz4HMRFOvUX++XmYi1Z7BkVY96kinrJxzp1TlpuWPfxDW7BoDoJ2o0Js3JUB DirvcXxgTR4mYsDEvLpfV8HSiZDtF1cWVTIFagGwKNiBMLZN0/TTRWaPwRCmw561NI5h OR7nS0MvKwZAhXZ/jVuZgtcZZUPxU/nZ5JAyQGGZ2aVytSMuj1TDl/eO7ThBw+ENaqLg NSLX6Ontvix/XQF0r938/BMwUhw09ln56E7j+5JMwyeYfDxJ0ndvAa4uzDX8zzqrJz/8 AJ5w== ARC-Message-Signature: i=1; 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; bh=XxxuM2LWgfNroze8RGAyNKr68KIy5qhP3qPRE13pokI=; b=wvn5XKdLamgFRdhje6ln1yrK/I2y43UEjwm3AVWB2ElOsT9U71z5BeYF4mQ+sUcHOX /tZQH9sdhtS/ET1d5x/bpCS0+kz/aethDE8VP8Iqri2gi2SNm9CbI4axStfzha/C/YnM ME2bRQoDxil6jTxKXv143yOZa39FecFTFVyvppplzKJUfQjM0lhzD/tvmySQpfhYClmh DyzK4DZet62xLAhmtsqL1ZulKlPVJ6ZySn7nie3zw82nFW2OvB6YbrwSDghpEXrOR9Hb uflsFbVg7bTuIhRs+cPBFQHd08CjUxMP5ZdNX61OHXbcP2SW/ExweM+namf459f3rJLN FSig== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.164 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Received: from relay03.th.seeweb.it (relay03.th.seeweb.it. [5.144.164.164]) by gmr-mx.google.com with ESMTPS id w83-20020a1f9456000000b003d995c67be1si78754vkd.4.2023.01.06.10.03.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 10:03:01 -0800 (PST) Received-SPF: pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.164 as permitted sender) client-ip=5.144.164.164; Received: from localhost.localdomain (unknown [IPv6:2a02:8071:3187:7b80:94ac:6ff9:3c29:fa3b]) by m-r1.th.seeweb.it (Postfix) with ESMTPA id 241C81F675; Fri, 6 Jan 2023 19:03:00 +0100 (CET) From: roberto.foglietta@linuxteam.org To: isar-users@googlegroups.com Cc: roberto.foglietta@gmail.com Subject: [PATCH v4] image: make sure do_rootfs_finalize can run multiple times, v4 Date: Fri, 6 Jan 2023 19:02:57 +0100 Message-Id: <20230106180257.3276801-1-roberto.foglietta@linuxteam.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Original-Sender: roberto.foglietta@linuxteam.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.164 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org 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?= From: "Roberto A. Foglietta" image: make sure do_rootfs_finalize can run multiple times, v4 The rootfs_finalize task currently cannot be re-executed, as it moves the sources-list into bootstrap.list. As this only has to be done once, it is not required on subsequent executions. To fix the rebuild issue, we simply ignore the return code of the mv statement. v2: essential code, only v3: code above the fix, rationalisation v4: like v3 but with the description provided by Felix Moessbauer Signed-off-by: Roberto A. Foglietta --- meta/classes/image.bbclass | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 629a0c1..7a5ced5 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -419,15 +419,13 @@ do_rootfs_finalize() { mountpoint -q '${ROOTFSDIR}/sys' && \ umount -l ${ROOTFSDIR}/sys - rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list" - rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt" - 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" + aptdir="${ROOTFSDIR}/etc/apt" + rm -f "${aptdir}/apt.conf.d/50isar" + rm -f "${aptdir}/preferences.d/isar-apt" + rm -f "${aptdir}/sources.list.d/isar-apt.list" + rm -f "${aptdir}/sources.list.d/base-apt.list" + mv -f "${aptdir}/sources-list" \ + "${aptdir}/sources.list.d/bootstrap.list" 2>/dev/null || : EOSUDO } addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess