[oe-commits] Chen Qi : mount.sh: automount cdrom device even if no ID_FS_TYPE available

git at git.openembedded.org git at git.openembedded.org
Tue Sep 10 21:46:52 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 2df21a3b27543df912a3ce05bef2415fae13cb7c
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2df21a3b27543df912a3ce05bef2415fae13cb7c

Author: Chen Qi <Qi.Chen at windriver.com>
Date:   Tue Sep 10 21:27:55 2013 +0800

mount.sh: automount cdrom device even if no ID_FS_TYPE available

This script was modified to check whether $ID_FS_TYPE is empty before
automount, however, for cdrom devices on qemu, the ID_FS_TYPE is not
set, yet the device should be mounted. Otherwise, when booting an iso
image with runqemu, the boot process hangs at 'waiting for removable
media'.

This patch fixes this problem by first checking whether the block device
is a cdrom.

[YOCTO #4487]

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/udev/udev-extraconf/mount.sh |    6 +++++-
 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 327cfc6..cb57e47 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



More information about the Openembedded-commits mailing list