From 6f1172ac1e082bae9fc921d3f8cf2b422890427e Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Wed, 10 Jan 2007 07:37:23 +0000 Subject: linux-handhelds-2.6: magician defconfig: I2C_PXA=y --- packages/udev/files/mount.sh | 21 ++++++++++++++------- packages/udev/files/mount.whitelist | 4 ++++ packages/udev/udev_100.bb | 1 - 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 packages/udev/files/mount.whitelist (limited to 'packages/udev') 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 \ -- cgit v1.2.3