From 63aa822dcdb6f18435d3c751bcb1960af9eca0ee Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Fri, 13 Nov 2020 19:44:17 +0100 Subject: [PATCH] F #5058: Context ISO creation w/a for FUSE mounts (#421) --- src/tm_mad/common/context | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/tm_mad/common/context b/src/tm_mad/common/context index ce2a4a8e07..a67b109244 100755 --- a/src/tm_mad/common/context +++ b/src/tm_mad/common/context @@ -69,8 +69,11 @@ ISO_DIR="$DS_DIR/.isofiles/$VM_ID" ISO_FILE="$VM_ID.iso" ISO_PATH="$ISO_DIR/$ISO_FILE" +exec_and_log "rm -rf $ISO_DIR" \ + "Could not delete temp. to make context dev" + exec_and_set_error "mkdir -p $ISO_DIR" \ - "Could not create tmp dir to make context dev" + "Could not create temp. dir to make context dev" [ -n "$ERROR" ] && exit_error for f in "${SRC[@]}"; do @@ -95,8 +98,18 @@ for f in "${SRC[@]}"; do [ -n "$ERROR" ] && exit_error done -exec_and_set_error "$MKISOFS -o $ISO_PATH -V CONTEXT -J -R $ISO_DIR" \ - "Error creating iso fs" +# This generates context ISO first into a temporary file and renames to final +# file, to workaround problem when datastores are on FUSE mounted volume +# (e.g,. fuse-overlayfs), cached files metadata are not consistent and +# and tar sparse detection algorithm could identify file as empty. +MKCONTEXT_CMD=$(cat <