From a9c5fccd4764927ccda3bf58f7930e84deabba6c Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 31 May 2023 10:51:24 +0200 Subject: [PATCH] dagger: Keep abandoned generations around for debugging When evolving to a new generation fails, users will typically abandon it (so that a new attempt can be made). However, the generated scripts and the logged output is very valuable from a debugging perspective. Therefore, keep the data around by just renaming the generation directory. Later, we can include these directories in the garbage collecting process, if we want to. --- board/common/rootfs/sbin/dagger | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/common/rootfs/sbin/dagger b/board/common/rootfs/sbin/dagger index cce3e09a..dc00f621 100755 --- a/board/common/rootfs/sbin/dagger +++ b/board/common/rootfs/sbin/dagger @@ -78,7 +78,8 @@ do_abandon() [ "$next" ] && [ -d "$basedir/$next" ] \ || abort "Next generation does not exist" - rm -rf "$basedir/$next" "$basedir/next" + mv "$basedir/$next" "$basedir/$next-ABANDONED-$(date +%F-%T)" + rm "$basedir/next" inform info "Abandoned generation $next" }