diff options
author | Ross Burton <ross@openedhand.com> | 2008-06-23 10:27:10 +0000 |
---|---|---|
committer | Ross Burton <ross@openedhand.com> | 2008-06-23 10:27:10 +0000 |
commit | 7717814038132be599f0df85a5b96a1fa9b3fa28 (patch) | |
tree | ab6c71ab6ca94c4b6e2e4ac1468e1543a62f9148 /meta/packages/udev | |
parent | f25cb73075ca077a82fa71f91ad0972868709f10 (diff) | |
download | poky-7717814038132be599f0df85a5b96a1fa9b3fa28.tar.gz |
udev: don't fork so much in mount.sh
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4717 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/udev')
-rw-r--r-- | meta/packages/udev/files/mount.sh | 13 | ||||
-rw-r--r-- | meta/packages/udev/udev_115.bb | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/meta/packages/udev/files/mount.sh b/meta/packages/udev/files/mount.sh index 48c7844690..160acbfdec 100644 --- a/meta/packages/udev/files/mount.sh +++ b/meta/packages/udev/files/mount.sh | |||
@@ -1,16 +1,15 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Called from udev | 3 | # Called from udev |
4 | # Attemp to mount any added block devices | ||
5 | # and remove any removed devices | ||
6 | # | 4 | # |
5 | # Attempt to mount any added block devices and umount any removed devices | ||
6 | |||
7 | 7 | ||
8 | MOUNT="/bin/mount" | 8 | MOUNT="/bin/mount" |
9 | PMOUNT="/usr/bin/pmount" | 9 | PMOUNT="/usr/bin/pmount" |
10 | UMOUNT="/bin/umount" | 10 | UMOUNT="/bin/umount" |
11 | name="`basename "$DEVNAME"`" | ||
12 | 11 | ||
13 | for line in `cat /etc/udev/mount.blacklist | grep -v ^#` | 12 | for line in `grep -v ^# /etc/udev/mount.blacklist` |
14 | do | 13 | do |
15 | if ( echo "$DEVNAME" | grep -q "$line" ) | 14 | if ( echo "$DEVNAME" | grep -q "$line" ) |
16 | then | 15 | then |
@@ -20,6 +19,8 @@ do | |||
20 | done | 19 | done |
21 | 20 | ||
22 | automount() { | 21 | automount() { |
22 | name="`basename "$DEVNAME"`" | ||
23 | |||
23 | ! test -d "/media/$name" && mkdir -p "/media/$name" | 24 | ! test -d "/media/$name" && mkdir -p "/media/$name" |
24 | 25 | ||
25 | if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name" | 26 | if ! $MOUNT -t auto -o sync $DEVNAME "/media/$name" |
@@ -50,8 +51,7 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then | |||
50 | fi | 51 | fi |
51 | 52 | ||
52 | # If the device isn't mounted at this point, it isn't configured in fstab | 53 | # If the device isn't mounted at this point, it isn't configured in fstab |
53 | cat /proc/mounts | awk '{print $1}' | grep -q "^$DEVNAME$" || automount | 54 | grep -q "^$DEVNAME " /proc/mounts || automount |
54 | |||
55 | fi | 55 | fi |
56 | 56 | ||
57 | 57 | ||
@@ -63,5 +63,6 @@ if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then | |||
63 | done | 63 | done |
64 | 64 | ||
65 | # Remove empty directories from auto-mounter | 65 | # Remove empty directories from auto-mounter |
66 | name="`basename "$DEVNAME"`" | ||
66 | test -e "/tmp/.automount-$name" && rm_dir "/media/$name" | 67 | test -e "/tmp/.automount-$name" && rm_dir "/media/$name" |
67 | fi | 68 | fi |
diff --git a/meta/packages/udev/udev_115.bb b/meta/packages/udev/udev_115.bb index 0a80af9bd0..b688ca88db 100644 --- a/meta/packages/udev/udev_115.bb +++ b/meta/packages/udev/udev_115.bb | |||
@@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod | |||
3 | the hotplug package and requires a kernel not older than 2.6.12." | 3 | the hotplug package and requires a kernel not older than 2.6.12." |
4 | RPROVIDES_${PN} = "hotplug" | 4 | RPROVIDES_${PN} = "hotplug" |
5 | 5 | ||
6 | PR = "r1" | 6 | PR = "r2" |
7 | 7 | ||
8 | SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ | 8 | SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ |
9 | file://noasmlinkage.patch;patch=1 \ | 9 | file://noasmlinkage.patch;patch=1 \ |