]> code.ossystems Code Review - openembedded-core.git/commitdiff
mount.sh: automount cdrom device even if no ID_FS_TYPE available
authorChen Qi <Qi.Chen@windriver.com>
Tue, 10 Sep 2013 13:27:55 +0000 (21:27 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 10 Sep 2013 21:58:29 +0000 (22:58 +0100)
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@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/udev/udev-extraconf/mount.sh

index 327cfc6477bc0a10a337f440d50a5a2b695f53e0..cb57e47a90623f581722572bc09f932e9f444ab8 100644 (file)
@@ -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