Compare commits

..

No commits in common. "master" and "1.7.8" have entirely different histories.

3 changed files with 20 additions and 63 deletions

39
README
View File

@ -13,7 +13,6 @@ It supports most popular file systems:
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
I N S T A L L I N S T A L L
=================== ===================
@ -32,49 +31,27 @@ Now plugin Your USB thumb drive and have fun ;)
These ports/packages are needed for all filesystems: These ports/packages are needed for all filesystems:
* sysutils/e2fsprogs // EXT2/EXT3/EXT4 fsck(8) * sysutils/exfat-utils // exFAT
* sysutils/xfsprogs // XFS fsck(8)
* sysutils/exfat-utils // exFAT exfatfsck(8)
* sysutils/fusefs-exfat // exFAT * sysutils/fusefs-exfat // exFAT
* sysutils/fusefs-ntfs // NTFS (read write support) * sysutils/fusefs-ntfs // NTFS (read write support)
* sysutils/fusefs-ext2 // EXT4
* sysutils/fusefs-hfsfuse // HFS * sysutils/fusefs-hfsfuse // HFS
* sysutils/fusefs-lkl // XFS/EXT2/EXT3/EXT4 * sysutils/fusefs-lkl // XFS
* sysutils/fusefs-simple-mtpfs // MTP * sysutils/fusefs-simple-mtpfs // MTP
All of the above are available as pkg(8) packages. Regards,
vermaden
Shortcut:
# pkg install -y \
sysutils/e2fsprogs \
sysutils/xfsprogs \
sysutils/exfat-utils \
sysutils/fusefs-exfat \
sysutils/fusefs-ntfs \
sysutils/fusefs-hfsfuse \
sysutils/fusefs-lkl \
sysutils/fusefs-simple-mtpfs
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
C H A N G E L O G C H A N G E L O G
========================= =========================
VERSION 1.7.9 (CURRENT)
Fix XORG detection.
Implement proposed BLACKLIST_REGEX option.
Use 'sysutils/fusefs-lkl' for all ext2/ext3/ext4 mounts.
Fix exFAT detection.
Fix small problem with checking the mount state.
Implement better old directory cleanup.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
VERSION 1.7.8 VERSION 1.7.8 (CURRENT)
Fix harmless gpart(8) rant about ugen(4) devices. Fix XORG detection.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@ -489,8 +466,6 @@ The only additional configuration it requires is to add these lines as
Remember to restart /etc/rc.d/devd daemon after adding Remember to restart /etc/rc.d/devd daemon after adding
/usr/local/etc/devd/automount_devd.conf file. /usr/local/etc/devd/automount_devd.conf file.
------------------------------------------------------------------------------
Have Fun ;) Have Fun ;)
vermaden vermaden

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (c) 2012-2024 Slawomir Wojciech Wojtczak <vermaden@interia.pl> # Copyright (c) 2012-2022 Slawomir Wojciech Wojtczak <vermaden@interia.pl>
# Copyright (c) 2019 Rozhuk Ivan <rozhuk.im@gmail.com> # Copyright (c) 2019 Rozhuk Ivan <rozhuk.im@gmail.com>
# All rights reserved. # All rights reserved.
# #
@ -35,6 +35,7 @@ UFS/FAT/exFAT/NTFS/EXT2/EXT3/EXT4/MTP/HFS/ISO9660
Add these to mount NTFS/exFAT/EXT4/HFS/XFS/MTP respectively: Add these to mount NTFS/exFAT/EXT4/HFS/XFS/MTP respectively:
o sysutils/fusefs-ntfs o sysutils/fusefs-ntfs
o sysutils/fusefs-exfat o sysutils/fusefs-exfat
o sysutils/fusefs-ext4fuse
o sysutils/fusefs-hfsfuse o sysutils/fusefs-hfsfuse
o sysutils/fusefs-lkl o sysutils/fusefs-lkl
o sysutils/fusefs-simple-mtpfs o sysutils/fusefs-simple-mtpfs
@ -124,15 +125,6 @@ BLACKLIST (unset by default)
example: BLACKLIST='da0 da3s1a' example: BLACKLIST='da0 da3s1a'
BLACKLIST_REGEX (unset by default)
The boolean flag option complements the above BLACKLIST option
if one wants regex match instead of exact match for ignoring devices.
Below will ignore all partitions ada0p1/ada0p2/... of ada0 device.
example: BLACKLIST='ada0'
BLACKLIST_REGEX=true
USER (root by default) USER (root by default)
If set to some username, the mount command will If set to some username, the mount command will
chown(1) the mount directory with the user and chown(1) the mount directory with the user and
@ -175,7 +167,7 @@ then
echo " / / // / // // / // \\\ \ \ \\\ \ \\\ \ \\\ \ \\\ \_ " echo " / / // / // // / // \\\ \ \ \\\ \ \\\ \ \\\ \ \\\ \_ "
echo " \_____\\\____/ \__\\\____//__________\\\__\__\__\\\____/ \_____\\\__\__\\\___\ " echo " \_____\\\____/ \__\\\____//__________\\\__\__\__\\\____/ \_____\\\__\__\\\___\ "
echo echo
echo "automount 1.8.0 2024/03/05" echo "automount 1.7.9 2022/05/24"
exit 0 exit 0
fi fi
@ -267,11 +259,10 @@ __guess_fs_type() { # 1=DEV
# second time guess with file(1) tool with -k option # second time guess with file(1) tool with -k option
# (do not stop at the first match and keep going) # (do not stop at the first match and keep going)
unset FS_TYPE unset FS_TYPE
local FS_TYPE=$( file -k -r -b -L -s ${1} 2> /dev/null | tr '\n' ' ' | sed -E 's/label:\ \".*\"//g' ) local FS_TYPE=$( file -k -r -b -L -s ${1} 2> /dev/null | sed -E 's/label:\ \".*\"//g' )
case ${FS_TYPE} in case ${FS_TYPE} in
(*Unix\ Fast\ File*) return ${FS_TYPE_UFS} ;; (*Unix\ Fast\ File*) return ${FS_TYPE_UFS} ;;
(*NTFS*) return ${FS_TYPE_NTFS} ;; (*NTFS*) return ${FS_TYPE_NTFS} ;;
(*ExFAT*) return ${FS_TYPE_EXFAT} ;;
(*\ FAT\ *|*MSDOS*) return ${FS_TYPE_FAT} ;; (*\ FAT\ *|*MSDOS*) return ${FS_TYPE_FAT} ;;
esac esac
# try with fstyp(8) last (exFAT on UFS issue) # try with fstyp(8) last (exFAT on UFS issue)
@ -345,8 +336,7 @@ __remove_dir() { # 1=TARGET
if [ -d "${1}" ] if [ -d "${1}" ]
then then
sleep 1 sleep 1
# find "${1}" -type d -empty -maxdepth 1 -exec rm -r {} '+' 2> /dev/null find "${1}" -type d -empty -maxdepth 1 -exec rm -r {} '+' 2> /dev/null
find "${MNT_PREFIX}" -depth 1 -empty -prune -delete 2> /dev/null
fi fi
fi fi
} }
@ -489,10 +479,6 @@ case ${2} in
then then
__log "${DEV}: device blocked by BLACKLIST option" __log "${DEV}: device blocked by BLACKLIST option"
exit 0 exit 0
elif [ -n "${BLACKLIST_REGEX}" ] && echo ${DEV} | grep -q "${I}" 1> /dev/null 2> /dev/null
then
__log "${DEV}: device blocked by BLACKLIST_REGEX option"
exit 0
fi fi
done done
fi fi
@ -505,6 +491,7 @@ case ${2} in
# load needed kernel modules # load needed kernel modules
kldload fusefs 1> /dev/null 2> /dev/null kldload fusefs 1> /dev/null 2> /dev/null
kldload fuse 1> /dev/null 2> /dev/null
kldload geom_uzip 1> /dev/null 2> /dev/null kldload geom_uzip 1> /dev/null 2> /dev/null
# detect filesysytem type # detect filesysytem type
@ -549,17 +536,15 @@ case ${2} in
FS_CHECK_PORT='sysutils/e2fsprogs' FS_CHECK_PORT='sysutils/e2fsprogs'
FS_CHECK_CMD='fsck.ext2' FS_CHECK_CMD='fsck.ext2'
FS_CHECK_ARGS="-y" FS_CHECK_ARGS="-y"
FS_MOUNT_PORT='sysutils/fusefs-lkl' FS_MOUNT_CMD='mount'
FS_MOUNT_CMD='lklfuse' FS_MOUNT_ARGS="-t ext2fs ${OPTS} ${DEV} ${MNT}"
FS_MOUNT_ARGS="-o type=ext2 -o allow_other -o intr -o uid=${UID} -o gid=${GID} -o umask=002 ${DEV} ${MNT}"
;; ;;
(${FS_TYPE_EXT3}) (${FS_TYPE_EXT3})
FS_CHECK_PORT='sysutils/e2fsprogs' FS_CHECK_PORT='sysutils/e2fsprogs'
FS_CHECK_CMD='fsck.ext3' FS_CHECK_CMD='fsck.ext3'
FS_CHECK_ARGS="-y" FS_CHECK_ARGS="-y"
FS_MOUNT_PORT='sysutils/fusefs-lkl' FS_MOUNT_CMD='mount'
FS_MOUNT_CMD='lklfuse' FS_MOUNT_ARGS="-t ext2fs ${OPTS} ${DEV} ${MNT}"
FS_MOUNT_ARGS="-o type=ext3 -o allow_other -o intr -o uid=${UID} -o gid=${GID} -o umask=002 ${DEV} ${MNT}"
;; ;;
(${FS_TYPE_EXT4}) (${FS_TYPE_EXT4})
FS_CHECK_PORT='sysutils/e2fsprogs' FS_CHECK_PORT='sysutils/e2fsprogs'
@ -752,7 +737,6 @@ case ${2} in
continue continue
fi fi
( # put entire umount/find/rm block into background ( # put entire umount/find/rm block into background
# umount(8) two times to make sure its unmounted
umount -f "${TARGET}" 1> /dev/null 2>&1 umount -f "${TARGET}" 1> /dev/null 2>&1
umount -f "${TARGET}" 1> /dev/null 2>&1 umount -f "${TARGET}" 1> /dev/null 2>&1
__log "${DEV}: (state) umount '${TARGET}'" __log "${DEV}: (state) umount '${TARGET}'"
@ -765,8 +749,6 @@ case ${2} in
# code for NICENAMES mounting instead of the /dev/${DEV} default # code for NICENAMES mounting instead of the /dev/${DEV} default
if [ "${NICENAMES}" != YES ] if [ "${NICENAMES}" != YES ]
then then
# umount(8) two times to make sure its unmounted
umount -f "${MNT_PREFIX}/${1}" 1> /dev/null 2>&1
umount -f "${MNT_PREFIX}/${1}" 1> /dev/null 2>&1 umount -f "${MNT_PREFIX}/${1}" 1> /dev/null 2>&1
__log "${DEV}: (direct) umount '${MNT_PREFIX}/${1}'" __log "${DEV}: (direct) umount '${MNT_PREFIX}/${1}'"
__remove_dir "${MNT_PREFIX}/${1}" & __remove_dir "${MNT_PREFIX}/${1}" &

Binary file not shown.