From ea6151ba3d166b13e3036536b69388d36cf989d7 Mon Sep 17 00:00:00 2001 From: gliargovas Date: Fri, 13 Oct 2023 11:15:35 -0600 Subject: [PATCH] Fix mergerfs call inside try --- try | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/try b/try index 1ea3b25a..a0b3fa2d 100755 --- a/try +++ b/try @@ -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" } @@ -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. @@ -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