From 49d91d28d9e71e3b723f85f6dd4c3107fdd462dd Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Wed, 9 Oct 2024 12:43:22 +0200 Subject: [PATCH] Display message when CoCo disk creation abort (#709) Fix ALEPH-211 --- .../example_confidential_image/build_debian_image.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/example_confidential_image/build_debian_image.sh b/examples/example_confidential_image/build_debian_image.sh index 3be89a77e..c7a928dff 100644 --- a/examples/example_confidential_image/build_debian_image.sh +++ b/examples/example_confidential_image/build_debian_image.sh @@ -18,7 +18,6 @@ cleanup() { return fi CLEANUP_DONE=true - echo "Cleaning up..." if mountpoint -q "${MOUNT_POINT}"; then sudo umount --recursive "${MOUNT_POINT}" || echo "Failed to unmount ${MOUNT_POINT}" fi @@ -43,6 +42,15 @@ cleanup() { # - TERM (SIGTERM): Signal 15, sent by the kill command to request the process to terminate gracefully. trap cleanup EXIT HUP INT QUIT PIPE TERM +error_handler() { + echo "" + echo "An error occured while building the image and the process was not completed properly." + echo "Please check the log, fix any error if required and restart the script." + echo "For more help see https://docs.aleph.im/computing/confidential/encrypted-disk/" +} + +trap error_handler ERR + usage() { cat <&2 Usage: