From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 3/4] clean /tmp in rootfs postprocess
Date: Wed, 25 Jan 2023 14:46:31 +0000 [thread overview]
Message-ID: <20230125144632.2099908-3-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230125144632.2099908-1-felix.moessbauer@siemens.com>
This patch cleans all files below /tmp to ensure the rootfs is
reproducible, independent if provided by the sstate cache or rebuild.
In general, /tmp has to be considered volatile across boots, so
always cleaning it is not harmful.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes/rootfs.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 870fcf2c..1c253616 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -267,6 +267,12 @@ rootfs_postprocess_clean_ldconfig_cache() {
sudo rm -f ${ROOTFSDIR}/var/cache/ldconfig/aux-cache
}
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_postprocess_clean_tmp"
+rootfs_postprocess_clean_tmp() {
+ # /tmp is by definition non persistent across boots
+ sudo rm -rf "${ROOTFSDIR}/tmp/"*
+}
+
ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'generate-manifest', 'rootfs_generate_manifest', '', d)}"
rootfs_generate_manifest () {
mkdir -p ${ROOTFS_MANIFEST_DEPLOY_DIR}
--
2.34.1
next prev parent reply other threads:[~2023-01-25 14:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 14:46 [PATCH 1/4] set SOURCE_DATE_EPOCH in wic environment Felix Moessbauer
2023-01-25 14:46 ` [PATCH 2/4] remove apt cache dirs from final rootfs Felix Moessbauer
2023-01-25 14:46 ` Felix Moessbauer [this message]
2023-01-25 14:46 ` [PATCH 4/4] warn only once in case file timestamps are updated Felix Moessbauer
2023-02-01 6:21 ` [PATCH 1/4] set SOURCE_DATE_EPOCH in wic environment Uladzimir Bely
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=20230125144632.2099908-3-felix.moessbauer@siemens.com \
--to=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.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