mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
touchups and ordering
This commit is contained in:
parent
9a95a046c4
commit
52da42c146
1 changed files with 16 additions and 20 deletions
|
@ -96,34 +96,30 @@ if [ "$1" = add ]; then
|
||||||
USAGE=$(echo "$DEVINFO" | sed 's/.*[[:blank:]]USAGE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
|
USAGE=$(echo "$DEVINFO" | sed 's/.*[[:blank:]]USAGE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
|
||||||
|
|
||||||
if ! echo $USAGE | egrep -q "(filesystem|disklabel)"; then
|
if ! echo $USAGE | egrep -q "(filesystem|disklabel)"; then
|
||||||
log info "/$DEVNAME does not contain a filesystem or disklabel"
|
log debug "/$DEVNAME does not contain a filesystem or disklabel"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log debug "DEVNAME /$DEVNAME"
|
log debug "/$DEVNAME contains filesystem type $FSTYPE"
|
||||||
BOOTFW_DEV=$(/usr/bin/findmnt -no source /boot/firmware)
|
BOOTFW_DEV=$(/usr/bin/findmnt -no source /boot/firmware)
|
||||||
log debug "BOOTFW_DEV $BOOTFW_DEV"
|
log debug "BOOTFW_DEV $BOOTFW_DEV"
|
||||||
if [ $BOOTFW_DEV = /$DEVNAME ]; then
|
|
||||||
log debug "/$DEVNAME contains filesystem type $FSTYPE"
|
|
||||||
log debug "skipping BOOTFS_DEV $BOOTFS_DEV mounted at /boot/firmware"
|
|
||||||
lockfile-remove /var/run/usbmount/.mount
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
ROOT_DEV=$(/usr/bin/findmnt -no source /)
|
ROOT_DEV=$(/usr/bin/findmnt -no source /)
|
||||||
log debug "ROOT_DEV $ROOT_DEV"
|
log debug "ROOT_DEV $ROOT_DEV"
|
||||||
if [ $ROOT_DEV = /$DEVNAME ]; then
|
|
||||||
log debug "/$DEVNAME contains filesystem type $FSTYPE"
|
|
||||||
log debug "skipping ROOT_DEV $ROOT_DEV mounted at /"
|
|
||||||
lockfile-remove /var/run/usbmount/.mount
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
BOOT_DEV=$(/usr/bin/findmnt -no source /boot)
|
BOOT_DEV=$(/usr/bin/findmnt -no source /boot)
|
||||||
log debug "BOOT_DEV $BOOT_DEV"
|
log debug "BOOT_DEV $BOOT_DEV"
|
||||||
if [ $BOOT_DEV = /$DEVNAME ]; then
|
|
||||||
log debug "/$DEVNAME contains filesystem type $FSTYPE"
|
if [ $BOOTFW_DEV = /$DEVNAME ]; then
|
||||||
log debug "skipping BOOT_DEV $BOOT_DEV mount as /boot"
|
log debug "skipping BOOTFS_DEV $BOOTFS_DEV mounted at /boot/firmware"
|
||||||
lockfile-remove /var/run/usbmount/.mount
|
lockfile-remove /var/run/usbmount/.mount
|
||||||
exit
|
exit
|
||||||
|
elif [ $ROOT_DEV = /$DEVNAME ]; then
|
||||||
|
log debug "skipping ROOT_DEV $ROOT_DEV mounted at /"
|
||||||
|
lockfile-remove /var/run/usbmount/.mount
|
||||||
|
exit
|
||||||
|
elif [ $BOOT_DEV = /$DEVNAME ]; then
|
||||||
|
log debug "skipping BOOT_DEV $BOOT_DEV mount as /boot"
|
||||||
|
lockfile-remove /var/run/usbmount/.mount
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to use specifications in /etc/fstab to skip.
|
# Try to use specifications in /etc/fstab to skip.
|
||||||
|
@ -145,7 +141,7 @@ if [ "$1" = add ]; then
|
||||||
for v in $MOUNTPOINTS; do
|
for v in $MOUNTPOINTS; do
|
||||||
if [ -d "$v" ] && ! grep -q "^[^ ][^ ]* *$v " /proc/mounts; then
|
if [ -d "$v" ] && ! grep -q "^[^ ][^ ]* *$v " /proc/mounts; then
|
||||||
mountpoint="$v"
|
mountpoint="$v"
|
||||||
log debug "mountpoint $mountpoint is available for $DEVNAME"
|
log debug "mountpoint $mountpoint is available for /$DEVNAME"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue