summaryrefslogtreecommitdiff
path: root/packages/udev/files/mount.sh
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2007-01-10 07:37:23 +0000
committerPhilipp Zabel <philipp.zabel@gmail.com>2007-01-10 07:37:23 +0000
commit6f1172ac1e082bae9fc921d3f8cf2b422890427e (patch)
tree2d3c566f6d2dce1169fb4648fa4d601c368acd58 /packages/udev/files/mount.sh
parentc94c025f10f859e08b55053230e9e395da49abb2 (diff)
linux-handhelds-2.6: magician defconfig: I2C_PXA=y
Diffstat (limited to 'packages/udev/files/mount.sh')
-rw-r--r--packages/udev/files/mount.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/packages/udev/files/mount.sh b/packages/udev/files/mount.sh
index be8b3dfca9..2220c020c8 100644
--- a/packages/udev/files/mount.sh
+++ b/packages/udev/files/mount.sh
@@ -10,16 +10,23 @@ PMOUNT="/usr/bin/pmount"
UMOUNT="/bin/umount"
name="`basename "$DEVNAME"`"
-for line in `cat /etc/udev/mount.blacklist | grep -v ^#`
-do
- if ( echo "$DEVNAME" | grep -q "$line" )
+cat /etc/udev/mount.whitelist | sed -n 's/^#.*/;/[^[:space:]]/p' > /tmp/mount.whitelist
+if ( echo "$DEVNAME" | grep -q -f /tmp/mount.whitelist )
+then
+ logger "udev/mount.sh" "[$DEVNAME] is not whitelisted, ignoring"
+ exit 0
+fi
+rm /tmp/mount.whitelist
+
+automount() {
+ # don't mount a block device if it contains partitions
+ if ( echo "$DEVNAME" | grep -q "[0-9]$" )
then
- logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
- exit 0
+ ls "$DEVNAME"p[1-9] > /dev/null 2>&1 && return
+ else
+ ls "$DEVNAME"[1-9] > /dev/null 2>&1 && return
fi
-done
-automount() {
! test -d "/media/$name" && mkdir -p "/media/$name"
if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name"