public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: isar-users@googlegroups.com
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH 2/4] remove apt cache dirs from final rootfs
Date: Wed, 25 Jan 2023 14:46:30 +0000	[thread overview]
Message-ID: <20230125144632.2099908-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230125144632.2099908-1-felix.moessbauer@siemens.com>

In 0c177a4b an improvement was added to not add the apt cache to the
sstate cache. This lead to reproducibility issues in case the rootfs is
provided by the sstate cache, compared to a newly assembled one.

As these folders are created on-the-fly when running apt, we simply
remove them from the final image.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/rootfs.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 86f228d0..870fcf2c 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -235,6 +235,8 @@ rootfs_postprocess_clean_package_cache() {
     sudo -E chroot '${ROOTFSDIR}' \
         /usr/bin/apt-get clean
     sudo rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
+    # remove apt-cache folder itself (required in case rootfs is provided by sstate cache)
+    sudo rm -rf "${ROOTFSDIR}/var/cache/apt/archives"
 }
 
 ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'clean-log-files', 'rootfs_postprocess_clean_log_files', '', d)}"
-- 
2.34.1


  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 ` Felix Moessbauer [this message]
2023-01-25 14:46 ` [PATCH 3/4] clean /tmp in rootfs postprocess Felix Moessbauer
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-2-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