aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev-extraconf/mount.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/udev/udev-extraconf/mount.sh')
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 327cfc6477..cb57e47a90 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -58,7 +58,11 @@ rm_dir() {
fi
}
-if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" ]; then
+# No ID_FS_TYPE for cdrom device, yet it should be mounted
+name="`basename "$DEVNAME"`"
+[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
+
+if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
if [ -x "$PMOUNT" ]; then
$PMOUNT $DEVNAME 2> /dev/null
elif [ -x $MOUNT ]; then