mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 14:03:20 +09:00
1 parent
cd73f8eb38
commit
63aa822dcd
1 file changed
+16
-3
@@ -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 <<EOF
|
||||
set -e -o pipefail
|
||||
$MKISOFS -o $ISO_PATH.tmp -V CONTEXT -J -R $ISO_DIR
|
||||
mv $ISO_PATH.tmp $ISO_PATH
|
||||
EOF
|
||||
)
|
||||
|
||||
multiline_exec_and_set_error "$MKCONTEXT_CMD" "Error creating iso fs"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
COPY_CMD=$(cat <<EOF
|
||||
|
||||
Reference in new issue
Block a user