From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7185601331657179136 X-Received: by 2002:a81:190a:0:b0:3dc:fd91:ef89 with SMTP id 10-20020a81190a000000b003dcfd91ef89mr310514ywz.347.1673028183912; 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-Google-Smtp-Source: AMrXdXvdknqXWtEWSs9X3PQwXlJBN4/v0XULhsR8ZJDtMdVP9Z6yjr8LJQugsLZ0Q2ryekWmO10Y 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 Return-Path: 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; 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 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 Content-Transfer-Encoding: 8bit X-TUID: cBPQgwOOuCCq 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 -- 2.34.1