explicitly specify ntfs binary to run, it needs to start with @ so systemd-enabled distros won't kill it

pull/40/head
TomasM 2017-12-14 05:46:23 -05:00
parent e2bd40a138
commit 225642def5
1 changed files with 36 additions and 3 deletions

View File

@ -298,17 +298,48 @@ device_bestfs()
# Filesystem options for mount
# $1 = filesystem or '-t filesystem'
# returns also the $1 parameter back where appropriate
#
fs_options()
{
debug_log "fs_options" "$*"
local FS
FS="$1"
if [ "$1" = "-t" ]; then
shift
else
FS="-t $FS"
fi
if [ "$1" = "ntfs-3g" ]; then
return
fi
echo -n "$FS"
if [ "$1" = "vfat" ]; then
echo " -o check=s,shortname=mixed,iocharset=utf8"
fi
}
# Mount command for given filesystem
# $1 = filesystem or '-t filesystem'
#
mount_command()
{
debug_log "mount_command" "$*"
if [ "$1" = "-t" ]; then
shift
fi
if [ "$1" = "vfat" ]; then
echo "-o check=s,shortname=mixed,iocharset=utf8"
if [ "$1" = "ntfs-3g" ]; then
echo "@mount.ntfs-3g"
return
fi
echo "mount"
}
@ -472,7 +503,9 @@ find_data_try()
FROM="$2"
FS="$(device_bestfs "$DEVICE")"
OPTIONS="$(fs_options $FS)"
mount -r "$DEVICE" "$1" $FS $OPTIONS 2>/dev/null
MOUNT="$(mount_command $FS)"
$MOUNT -r "$DEVICE" "$1" $OPTIONS 2>/dev/null
# if the FROM parameter is actual file, mount it again as loop (eg. iso)
if [ -f "$1/$FROM" ]; then