From a139bf6669818232d025b69814953362f3894f24 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Thu, 15 Feb 2024 09:35:32 -0800
Subject: [PATCH] ci: integration: preserve boot-deploy's changes in the work
 dir (MR 54)

This fixes a problem where the kernel-dtb check in bootimg testing
failed, because the work dir only had artifacts from mkinitfs and not
from boot-deploy.
---
 .ci/integration_test.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.ci/integration_test.sh b/.ci/integration_test.sh
index 8540d68..a5c889f 100755
--- a/.ci/integration_test.sh
+++ b/.ci/integration_test.sh
@@ -130,7 +130,12 @@ do
 	esac
 done
 
-cp -r "\$work_dir" "\$work_dir.copy"
+# Move the work dir and create a symlink back to the original location to
+# preserve its contents, especially anything new created by boot-deploy that
+# will be used in later testing. mkinitfs will delete the symlink instead of
+# the actual work dir contents.
+mv "\$work_dir" "\$work_dir.copy"
+ln -s "\$work_dir.copy" "\$work_dir"
 
 # Boot-deploy gets run twice so clear the args file
 echo "" > /tmp/boot-deploy.args
-- 
GitLab