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: jan.kiszka@siemens.com, daniel.bovensiepen@siemens.com,
	henning.schild@siemens.com, venkata.pyla@toshiba-tsip.com
Subject: [PATCH v3 01/10] image: make sure do_rootfs_finalize can run multiple times
Date: Mon, 16 Jan 2023 03:35:43 +0000	[thread overview]
Message-ID: <20230116033552.139048-2-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20230116033552.139048-1-felix.moessbauer@siemens.com>

From: Henning Schild <henning.schild@siemens.com>

There have been several places that would not work twice in a row. All
the test && not covering || have been moved to if. The rm at the end
tried to remove a file that was just moved. And that mv would not work a
second time because its source would be gone.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/image.bbclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 629a0c1..125eba1 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -396,13 +396,16 @@ addtask deploy before do_build after do_image
 do_rootfs_finalize() {
     sudo -s <<'EOSUDO'
         set -e
-        test -e "${ROOTFSDIR}/chroot-setup.sh" && \
+
+        if [ -e "${ROOTFSDIR}/chroot-setup.sh" ]; then
             "${ROOTFSDIR}/chroot-setup.sh" "cleanup" "${ROOTFSDIR}"
+        fi
         rm -f "${ROOTFSDIR}/chroot-setup.sh"
 
-        test ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" && \
+        if [ ! -e "${ROOTFSDIR}/usr/share/doc/qemu-user-static" ]; then
             find "${ROOTFSDIR}/usr/bin" \
                 -maxdepth 1 -name 'qemu-*-static' -type f -delete
+        fi
 
         mountpoint -q '${ROOTFSDIR}/isar-apt' && \
             umount -l ${ROOTFSDIR}/isar-apt && \
@@ -424,10 +427,10 @@ do_rootfs_finalize() {
         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"
+        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ]; then
+            mv "${ROOTFSDIR}/etc/apt/sources-list" \
+                "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
+        fi
 EOSUDO
 }
 addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess
-- 
2.34.1


  reply	other threads:[~2023-01-16  3:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16  3:35 [PATCH v3 00/10] Make rootfs build reproducible Felix Moessbauer
2023-01-16  3:35 ` Felix Moessbauer [this message]
2023-01-16  3:35 ` [PATCH v3 02/10] image.bbclass: fix non-reproducible file time-stamps inside rootfs Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 03/10] rootfs postprocess: clean python cache Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 04/10] remove non-portable ldconfig aux-cache Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 05/10] generate deterministic clear-text password hash Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 06/10] update debian initramfs in deterministic mode Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 07/10] create custom " Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 08/10] make deb_add_changelog idempotent Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 09/10] deb_add_changelog: set timestamp to valid epoch Felix Moessbauer
2023-01-16  3:35 ` [PATCH v3 10/10] make custom linux-image bit-by-bit reproducible Felix Moessbauer
2023-01-25  7:16 ` [PATCH v3 00/10] Make rootfs build reproducible 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=20230116033552.139048-2-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=daniel.bovensiepen@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=venkata.pyla@toshiba-tsip.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