Skip to contentSkip to conversation

Fix qemu iso image hang problem

PATCH New [email protected] 1 participant 2 messages Sep 10, 2013

lore
Share & tools
lore
#0 lore raw

cover Fix qemu iso image hang problem

From: Chen Qi <[email protected]>

The following changes since commit 2ab1bf27f79beadc45e86a26c85fc0b95ae3496f:

bitbake: prserv: Ensure data is committed (2013-09-08 10:51:56 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/qemu-iso-hang
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/qemu-iso-hang

Chen Qi (1):
mount.sh: automount cdrom device even if no ID_FS_TYPE available

 meta/recipes-core/udev/udev-extraconf/mount.sh |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#1 lore raw

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

From: Chen Qi <[email protected]>

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]

---
 meta/recipes-core/udev/udev-extraconf/mount.sh |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/udev/udev-extraconf/mount.sh +5 -1
index 327cfc6..cb57e47 100644
@@ -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
Signature · 1 line
1.7.9.5