Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix for bug YOCTO #7918
@ 2015-06-29 15:03 Cristian Iorga
  2015-06-29 15:03 ` [PATCH 1/1] runqemu-internal: correctly set format for root FS as raw Cristian Iorga
  0 siblings, 1 reply; 2+ messages in thread
From: Cristian Iorga @ 2015-06-29 15:03 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 2578ff3dfe55a1c07208401861f96e2e327eacaf:

  bitbake: codeparser: Add repr() methods (2015-06-27 22:51:21 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib ciorga/YB7918
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ciorga/YB7918

Cristian Iorga (1):
  runqemu-internal: correctly set format for root FS as raw

 scripts/runqemu-internal | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.1.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] runqemu-internal: correctly set format for root FS as raw
  2015-06-29 15:03 [PATCH 0/1] Fix for bug YOCTO #7918 Cristian Iorga
@ 2015-06-29 15:03 ` Cristian Iorga
  0 siblings, 0 replies; 2+ messages in thread
From: Cristian Iorga @ 2015-06-29 15:03 UTC (permalink / raw)
  To: openembedded-core

qemu guesses via probing the format of root FS, but
gives a warning and restricts write operations on block 0.
Fix it by setting correctly the format as raw for more
machines and non-KVM machines.
In some cases, replaced the way machine disk is set for qemu.

Fix for [YOCTO #7918]

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
---
 scripts/runqemu-internal | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 694815f..6878251 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -127,7 +127,7 @@ if [ "$SLIRP_ENABLED" = "yes" ]; then
     else
         QEMU_NETWORK_CMD=""
         DROOT="/dev/hda"
-        ROOTFS_OPTIONS="-hda $ROOTFS"
+        ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
     fi
 
 else
@@ -265,12 +265,12 @@ else
         else
             QEMU_NETWORK_CMD="-net nic,vlan=0 $QEMU_TAP_CMD"
             DROOT="/dev/hda"
-            ROOTFS_OPTIONS="-hda $ROOTFS"
+            ROOTFS_OPTIONS="-drive file=$ROOTFS,if=ide,format=raw"
         fi
         if [ "$MACHINE" = "qemuarm64" ]; then
             QEMU_NETWORK_CMD="-netdev tap,id=net0,ifname=$TAP,script=no,downscript=no -device virtio-net-device,netdev=net0 "
             DROOT="/dev/vda"
-            ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS -device virtio-blk-device,drive=disk0"
+            ROOTFS_OPTIONS="-drive id=disk0,file=$ROOTFS,format=raw -device virtio-blk-device,drive=disk0"
         fi
 
         KERNCMDLINE="mem=$QEMU_MEMORY"
@@ -357,7 +357,7 @@ if [ "$MACHINE" = "qemuarm" -o "$MACHINE" = "qemuarmv6" -o "$MACHINE" = "qemuarm
     # QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -force-pointer"
     if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
         KERNCMDLINE="root=/dev/sda rw console=ttyAMA0,115200 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY highres=off"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -M ${MACHINE_SUBTYPE} -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -501,7 +501,7 @@ if [ "$MACHINE" = "qemumips" -o "$MACHINE" = "qemumipsel" -o "$MACHINE" = "qemum
     if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
         #KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -526,7 +526,7 @@ if [ "$MACHINE" = "qemuppc" ]; then
     fi
     if [ "${FSTYPE:0:3}" = "ext" -o "$FSTYPE" = "btrfs" ]; then
         KERNCMDLINE="root=/dev/hda rw console=ttyS0 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE -M $MACHINE_SUBTYPE -drive file=$ROOTFS,format=raw -no-reboot $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-29 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 15:03 [PATCH 0/1] Fix for bug YOCTO #7918 Cristian Iorga
2015-06-29 15:03 ` [PATCH 1/1] runqemu-internal: correctly set format for root FS as raw Cristian Iorga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox