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 [thread overview]
Message-ID: <20230106180257.3276801-1-roberto.foglietta@linuxteam.org> (raw)
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
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 <roberto.foglietta@gmail.com>
---
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
reply other threads:[~2023-01-06 18:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230106180257.3276801-1-roberto.foglietta@linuxteam.org \
--to=roberto.foglietta@linuxteam.org \
--cc=isar-users@googlegroups.com \
--cc=roberto.foglietta@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox