summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev-extraconf/mount.sh
diff options
context:
space:
mode:
authorYasir-Khan <yasir_khan@mentor.com>2014-08-14 19:56:37 +0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-15 18:21:50 +0100
commit0cd5af027234735fe83d0681dbdddb197c02f262 (patch)
tree514b2f94a5a2edda2d10692ba78ae2050fd585fd /meta/recipes-core/udev/udev-extraconf/mount.sh
parenteb7a847190146f75b793a730f7a4ece2e3d3e98e (diff)
downloadpoky-0cd5af027234735fe83d0681dbdddb197c02f262.tar.gz
udev-extraconf: Unmount SD card after ejection
Adds udev rule to unmount SD card partitions in case of improper ejection from card reader. When SD card is ejected from card reader without being unmounted first, kernel does not generate a REMOVE event, instead it generates a CHANGE event(only if polling is enabled /sys/module/block/parameters/events_dfl_poll_msecs) and we don't have any udev rule in automount.rules to handle this event,so partitions never get unmounted. Unmounting of partitions can be done if udev rules handle this CHANGE event. (From OE-Core rev: 140d188b3665f914396834168feeff6ffcb64d76) Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com> Signed-off-by: Yasir-Khan <yasir_khan@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev/udev-extraconf/mount.sh')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 7df1b6e3e7..3eea910854 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -78,8 +78,7 @@ if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_t
78fi 78fi
79 79
80 80
81 81if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
82if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
83 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " ` 82 for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
84 do 83 do
85 $UMOUNT $mnt 84 $UMOUNT $mnt