summaryrefslogtreecommitdiff
path: root/packages/udev
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
parentc94c025f10f859e08b55053230e9e395da49abb2 (diff)
linux-handhelds-2.6: magician defconfig: I2C_PXA=y
Diffstat (limited to 'packages/udev')
-rw-r--r--packages/udev/files/mount.sh21
-rw-r--r--packages/udev/files/mount.whitelist4
-rw-r--r--packages/udev/udev_100.bb1
3 files changed, 18 insertions, 8 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"
diff --git a/packages/udev/files/mount.whitelist b/packages/udev/files/mount.whitelist
new file mode 100644
index 0000000000..b078373b1d
--- /dev/null
+++ b/packages/udev/files/mount.whitelist
@@ -0,0 +1,4 @@
+# This is a grep pattern matched against the device name
+# Only matched patterns will be mounted / removed by udevd
+/dev/mmcblk[01]
+/dev/hd[ab]
diff --git a/packages/udev/udev_100.bb b/packages/udev/udev_100.bb
index 288157ef3f..7c3058ee06 100644
--- a/packages/udev/udev_100.bb
+++ b/packages/udev/udev_100.bb
@@ -1,4 +1,3 @@
-DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_slugos = "1"
DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \