Added UZIP images support. Added another try to mount device in read only mode. Added optional ada(4) disks support. Added optional md(4) devices support. Added automatic kernel modules loading.

This commit is contained in:
vermaden 2021-11-15 17:02:00 +01:00
parent a164c8f444
commit e6e701bb49
3 changed files with 54 additions and 4 deletions

View File

@ -162,7 +162,7 @@ then
echo " / / // / // // / // \\\ \ \ \\\ \ \\\ \ \\\ \ \\\ \_ "
echo " \_____\\\____/ \__\\\____//__________\\\__\__\__\\\____/ \_____\\\__\__\\\___\ "
echo
echo "automount 1.7.5 2021/10/01"
echo "automount 1.7.6 2021/11/15"
exit 0
fi
@ -417,7 +417,7 @@ case ${2} in
# check if device still exists
if [ ! -e "${DEV}" ]
then
__log "${DEV}: device does not exists"
__log "${DEV}: device does not exist"
exit 1
fi
__log "${DEV}: attach"
@ -444,7 +444,7 @@ case ${2} in
MNT="${MNT_PREFIX}/${MNT_CANDIDATE}"
fi
else
# dir does not exists
# dir does not exist
MNT="${MNT_PREFIX}/${MNT_CANDIDATE}"
fi
else
@ -468,6 +468,10 @@ case ${2} in
__check_already_mounted "${DEV}" "${MNT}"
# make sure that data can be read from device
__wait_for_device "${DEV}"
# load needed kernel modules
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
# detect filesysytem type
case ${1} in
(iso9660*)
@ -480,7 +484,7 @@ case ${2} in
__guess_fs_type "${DEV}"
FS_TYPE=${?}
;;
(da*|mmcsd*)
(md*.uzip|md*|ada*|da*|mmcsd*)
__check_block_device "${DEV}"
__guess_fs_type "${DEV}"
FS_TYPE=${?}
@ -647,6 +651,18 @@ case ${2} in
COUNT=$(( ${COUNT} + 1 ))
if [ ${COUNT} -gt ${RETRY_COUNT} ]
then
# BEGIN | try to mount read only
FS_MOUNT_ARGS="-o ro ${FS_MOUNT_ARGS}"
${FS_MOUNT_CMD} ${FS_MOUNT_ARGS}
if [ ${?} -eq 0 ]
then
__log "${DEV}: mount OK: '${FS_MOUNT_CMD} ${FS_MOUNT_ARGS}'"
break
fi
# END | try to mount read only
__log "${DEV}: mount FAIL: '${FS_MOUNT_CMD} ${FS_MOUNT_ARGS}'"
exit 1
fi

View File

@ -0,0 +1,16 @@
# SUPPORT md(4) IMAGES/DISKS attach
notify 100 {
match "system" "DEVFS";
match "type" "CREATE";
match "cdev" "(md)[0-9]+.*";
action "/usr/local/sbin/automount $cdev attach &";
};
# SUPPORT md(4) IMAGES/DISKS detach
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(md)[0-9]+.*";
action "/usr/local/sbin/automount $cdev detach &";
};

View File

@ -0,0 +1,18 @@
# LOCAL DISKS attach
notify 100 {
match "system" "DEVFS";
match "type" "CREATE";
match "cdev" "(ada)[0-9]+.*";
action "/usr/local/sbin/automount $cdev attach &";
};
# LOCAL DISKS remove
notify 100 {
match "system" "DEVFS";
match "type" "DESTROY";
match "cdev" "(ada)[0-9]+.*";
action "/usr/local/sbin/automount $cdev detach &";
};