Skip to content

Commit

Permalink
Fix mergerfs call inside try
Browse files Browse the repository at this point in the history
  • Loading branch information
gliargovas committed Oct 13, 2023
1 parent 15e20ac commit ea6151b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions try
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ TRY_COMMAND="$TRY_COMMAND($0)"
make_overlay() {
sandbox_dir="$1"
lowerdirs="$2"
mountpoint="$3"
mount -t overlay overlay -o userxattr -o "lowerdir=$lowerdirs,upperdir=$sandbox_dir/upperdir/$mountpoint,workdir=$sandbox_dir/workdir/$mountpoint" "$sandbox_dir/temproot/$mountpoint"
overlay_mountpoint="$3"
mount -t overlay overlay -o userxattr -o "lowerdir=$lowerdirs,upperdir=$sandbox_dir/upperdir/$overlay_mountpoint,workdir=$sandbox_dir/workdir/$overlay_mountpoint" "$sandbox_dir/temproot/$overlay_mountpoint"
}
Expand Down Expand Up @@ -193,7 +193,6 @@ do
(/|/dev|/proc) continue;;
esac
# Try mounting everything normally
make_overlay "$SANDBOX_DIR" "$mountpoint" "$pure_mountpoint" 2>>"$try_mount_log"
# If mounting everything normally fails, we try using either using mergerfs or unionfs to mount them.
Expand All @@ -220,9 +219,7 @@ do
## Create a union directory
"$UNION_HELPER" $mountpoint $merger_dir 2>>"$try_mount_log" ||
printf "%s: Warning: Failed mounting $mountpoint via $UNION_HELPER, see \"$try_mount_log\"\n" "$TRY_COMMAND" >&2
## Make the overlay on the union directory which works as a lowerdir for overlay
make_overlay "$SANDBOX_DIR" "$merger_dir" "$mountpoint" 2>>"$try_mount_log" ||
make_overlay "$SANDBOX_DIR" "$merger_dir" "$pure_mountpoint" 2>>"$try_mount_log" ||
printf "%s: Warning: Failed mounting $mountpoint as an overlay via $UNION_HELPER, see \"$try_mount_log\"\n" "$TRY_COMMAND" >&2
fi
fi
Expand Down

0 comments on commit ea6151b

Please sign in to comment.