File: mount.fuse.passthrough

package info (click to toggle)
fuse3 3.18.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 31,440 kB
  • sloc: ansic: 25,058; perl: 6,044; cpp: 3,960; python: 1,201; sh: 416; javascript: 313; makefile: 59
file content (40 lines) | stat: -rwxr-xr-x 1,099 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

ulimit -n 1048576

dev="$1"
shift
mnt="$1"
shift
# -o
shift
mntopts="$1"
shift

# source can be provided as NFS style device (e.g. TEST_DEV=source:/${TEST_SOURCE})
# and/or it can already be inside mount options (passthrough_ll style)
if ( echo "$mntopts" | grep -q "source=" ) ; then
	# Don't pass source as position argument
	source=
elif [[ "$dev" == "source:"* ]]; then
	source="${dev#"source:"}"
else
    >&2 echo "passthrough source is undefined, aborting!"
fi

if ( echo "$mntopts" | grep -q remount ) ; then
	exec mount -i "$dev" "$mnt" -o "$mntopts"
fi

# set default to SUBTYPE (extracted from this script name)
# example:
#   Copy or link this script to /sbin/mount.fuse.passthrough_hp
#   If xfstests local.config does not set PASSTHROUGH_PATH,
#   PASSTHROUGH_PATH will be set to 'passthrough_hp' and exec below
#   will look that up from $PATH

[ -n "$PASSTHROUGH_PATH" ] || PASSTHROUGH_PATH=${0#*mount.fuse.}

#echo "EXTRA_BIN_OPTIONS='${EXTRA_BIN_OPTIONS}'"

exec "$PASSTHROUGH_PATH" ${EXTRA_BIN_OPTIONS} -o fsname=$dev,allow_other,dev $source "$mnt" -o "$mntopts" "$@"