From cb16c6a4c5519eca1b1e511d7c048d5497b33afd Mon Sep 17 00:00:00 2001 From: Alexsander de Souza <61709370+alexsander-souza@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:42:44 -0300 Subject: [PATCH] fix esxi unmounting (#184) let the cleanup code unmount dirs --- vmware-esxi/post.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/vmware-esxi/post.sh b/vmware-esxi/post.sh index 9262edc0..72104d0c 100644 --- a/vmware-esxi/post.sh +++ b/vmware-esxi/post.sh @@ -1,15 +1,12 @@ #!/bin/sh -x +BOOT_DIR="${TMP_DIR:?}"/boot + echo 'Adding curtin-hooks to image...' -mount_part 1 "$TMP_DIR"/boot fusefat -cp -rv curtin "$TMP_DIR"/boot/ +mount_part 1 "$BOOT_DIR" fusefat +cp -rv curtin "$BOOT_DIR" echo 'Adding post-install scripts to image...' -cp -v scripts.tar.xz "$TMP_DIR"/boot/curtin/ - -echo 'Unmounting image...' -sync -f "$TMP_DIR"/boot -fusermount -z -u "$TMP_DIR"/boot -grep -qs "$TMP_DIR/boot " /proc/mounts && umount -f "$TMP_DIR"/boot +cp -v scripts.tar.xz "$BOOT_DIR"/curtin/ echo 'Done'