summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/udev/files/mount.sh
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-09-20 15:19:38 +0000
committerRichard Purdie <richard@openedhand.com>2005-09-20 15:19:38 +0000
commit8d66edc4085db428e67223f0f71cde6b3640f27e (patch)
treeda9dcd13d59b36f7350d3938f9094cb2ecc4449a /openembedded/packages/udev/files/mount.sh
parentb4a7122cacef647dbec3db5c9ebe1e504a7670df (diff)
downloadpoky-8d66edc4085db428e67223f0f71cde6b3640f27e.tar.gz
pcmciautils and udev updates. Slowly aiming to get rid of hotplug and pcmcia-cs
git-svn-id: https://svn.o-hand.com/repos/poky@27 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/udev/files/mount.sh')
-rw-r--r--openembedded/packages/udev/files/mount.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/openembedded/packages/udev/files/mount.sh b/openembedded/packages/udev/files/mount.sh
new file mode 100644
index 0000000000..7e641b08d7
--- /dev/null
+++ b/openembedded/packages/udev/files/mount.sh
@@ -0,0 +1,25 @@
1#!/bin/sh
2#
3# Called from udev
4# Attemp to mount any added block devices
5# and remove any removed devices
6#
7
8MOUNT="/bin/mount"
9PMOUNT="/usr/bin/pmount"
10UMOUNT="/bin/umount"
11
12if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
13 if [ -x "$PMOUNT" ]; then
14 $PMOUNT $DEVNAME 2> /dev/null
15 elif [ -x $MOUNT ]; then
16 $MOUNT $DEVNAME 2> /dev/null
17 fi
18fi
19
20if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
21 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
22 do
23 $UMOUNT $mnt
24 done
25fi