All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
@ 2012-12-11  1:55 Trevor Woerner
  2012-12-12  5:55 ` Scott Garman
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Woerner @ 2012-12-11  1:55 UTC (permalink / raw)
  To: yocto

Allow vmdk images to be run through the 'runqemu' facility.
---
 scripts/runqemu          | 39 +++++++++++++++++++++++++++++----------
 scripts/runqemu-internal | 20 ++++++++++++++++----
 2 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index fb7ac56..190e3b4 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -27,6 +27,7 @@ usage() {
     echo "  ROOTFS - the rootfs image file or nfsroot directory to use"
     echo "  MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)"
     echo "  RAMFS - boot a ramfs-based image"
+    echo "  VM - boot a vmdk image"
     echo "  Simplified QEMU command-line options can be passed with:"
     echo "    nographic - disables video console"
     echo "    serial - enables a serial console on /dev/ttyS0"
@@ -41,6 +42,7 @@ usage() {
     echo "  $MYNAME qemux86 ramfs"
     echo "  $MYNAME qemux86 qemuparams=\"-m 256\""
     echo "  $MYNAME qemux86 bootparams=\"psplash=false\""
+    echo "  $MYNAME path/to/<image>-<machine>.vmdk"
     exit 1
 }
 
@@ -56,6 +58,7 @@ error() {
 MACHINE=${MACHINE:=""}
 KERNEL=${KERNEL:=""}
 ROOTFS=${ROOTFS:=""}
+VM=${VM:=""}
 FSTYPE=""
 LAZY_ROOTFS=""
 SCRIPT_QEMU_OPT=""
@@ -84,6 +87,10 @@ process_filename() {
 		    error "conflicting FSTYPE types [$FSTYPE] and [$EXT]"
 		fi
 		;;
+	/vmdk/)
+		FSTYPE=$EXT
+		VM=$filename
+		;;
 	*)
 		error "unknown file arg [$filename]"
 		;;
@@ -192,19 +199,27 @@ elif [ ! -w /dev/net/tun ] ; then
 fi
 
 # Report errors for missing combinations of options
-if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
-    error "you must specify at least a MACHINE or KERNEL argument"
+if [ -z "$MACHINE" -a -z "$KERNEL" -a -z "$VM" ]; then
+    error "you must specify at least a MACHINE, VM, or KERNEL argument"
 fi
 if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
     error "NFS booting without an explicit ROOTFS path is not yet supported"
 fi
 
 if [ -z "$MACHINE" ]; then
-    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
-    if [ -z "$MACHINE" ]; then
-        error "Unable to set MACHINE from kernel filename [$KERNEL]"
+    if [ "x$FSTYPE" = "xvmdk" ]; then
+        MACHINE=`basename $VM | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
+        if [ -z "$MACHINE" ]; then
+            error "Unable to set MACHINE from vmdk filename [$VM]"
+        fi
+        echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
+    else
+        MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
+        if [ -z "$MACHINE" ]; then
+            error "Unable to set MACHINE from kernel filename [$KERNEL]"
+        fi
+        echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
     fi
-    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
 fi
 
 YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
@@ -366,7 +381,7 @@ if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
     fi
 fi
 
-if [ -z "$KERNEL" ]; then
+if [ -z "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
     setup_tmpdir
     eval kernel_file=\$${machine2}_DEFAULT_KERNEL
     KERNEL=$OE_TMPDIR/deploy/images/$kernel_file
@@ -395,7 +410,7 @@ if [ "$LAZY_ROOTFS" = "true" ]; then
     ROOTFS=$OE_TMPDIR/deploy/images/$ROOTFS-$MACHINE.$FSTYPE
 fi
 
-if [ -z "$ROOTFS" ]; then
+if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
     setup_tmpdir
     T=$OE_TMPDIR/deploy/images
     eval rootfs_list=\$${machine2}_DEFAULT_ROOTFS
@@ -409,8 +424,12 @@ fi
 
 echo ""
 echo "Continuing with the following parameters:"
-echo "KERNEL: [$KERNEL]"
-echo "ROOTFS: [$ROOTFS]"
+if [ "x$FSTYPE" != "xvmdk" ]; then
+    echo "KERNEL: [$KERNEL]"
+    echo "ROOTFS: [$ROOTFS]"
+else
+    echo "VMDK:   [$VM]"
+fi
 echo "FSTYPE: [$FSTYPE]"
 
 setup_sysroot
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 7ca00f8..fd1304e 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -260,13 +260,13 @@ case "$MACHINE" in
     ;;
 esac
 
-if [ ! -f "$KERNEL" ]; then
+if [ ! -f "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
     echo "Error: Kernel image file $KERNEL doesn't exist"
     cleanup
     return
 fi
 
-if [ "$FSTYPE" != "nfs" -a ! -f "$ROOTFS" ]; then
+if [ "$FSTYPE" != "nfs" -a "$FSTYPE" != "vmdk" -a ! -f "$ROOTFS" ]; then
     echo "Error: Image file $ROOTFS doesn't exist"
     cleanup
     return
@@ -341,6 +341,9 @@ if [ "$MACHINE" = "qemux86" ]; then
         KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
     fi
+    if [ "$FSTYPE" = "vmdk" ]; then
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+    fi
     # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
     # qemux86 and qemux86-64. We can use timer interrupt mode for now.
     KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
@@ -365,6 +368,9 @@ if [ "$MACHINE" = "qemux86-64" ]; then
         KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
     fi
+    if [ "$FSTYPE" = "vmdk" ]; then
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+    fi
     # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
     # qemux86 and qemux86-64. We can use timer interrupt mode for now.
     KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
@@ -560,8 +566,14 @@ fi
 
 echo "Running $QEMU..."
 # -no-reboot is a mandatory option - see bug #100
-echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
-LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+if [ "$FSTYPE" = "vmdk" ]; then
+    echo $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
+    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
+else
+    echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
+    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+fi
+
 
 
 cleanup
-- 
1.8.0



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

* Re: [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
  2012-12-11  1:55 Trevor Woerner
@ 2012-12-12  5:55 ` Scott Garman
  2012-12-12 11:48   ` Trevor Woerner
  0 siblings, 1 reply; 6+ messages in thread
From: Scott Garman @ 2012-12-12  5:55 UTC (permalink / raw)
  To: yocto; +Cc: Saul Wold

On 12/10/2012 05:55 PM, Trevor Woerner wrote:
> Allow vmdk images to be run through the 'runqemu' facility.

This looks ok without having tested it personally. Could you just add a 
signed-off-by line to the commit?

Thanks for this,

Scott

> ---
>   scripts/runqemu          | 39 +++++++++++++++++++++++++++++----------
>   scripts/runqemu-internal | 20 ++++++++++++++++----
>   2 files changed, 45 insertions(+), 14 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index fb7ac56..190e3b4 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -27,6 +27,7 @@ usage() {
>       echo "  ROOTFS - the rootfs image file or nfsroot directory to use"
>       echo "  MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)"
>       echo "  RAMFS - boot a ramfs-based image"
> +    echo "  VM - boot a vmdk image"
>       echo "  Simplified QEMU command-line options can be passed with:"
>       echo "    nographic - disables video console"
>       echo "    serial - enables a serial console on /dev/ttyS0"
> @@ -41,6 +42,7 @@ usage() {
>       echo "  $MYNAME qemux86 ramfs"
>       echo "  $MYNAME qemux86 qemuparams=\"-m 256\""
>       echo "  $MYNAME qemux86 bootparams=\"psplash=false\""
> +    echo "  $MYNAME path/to/<image>-<machine>.vmdk"
>       exit 1
>   }
>
> @@ -56,6 +58,7 @@ error() {
>   MACHINE=${MACHINE:=""}
>   KERNEL=${KERNEL:=""}
>   ROOTFS=${ROOTFS:=""}
> +VM=${VM:=""}
>   FSTYPE=""
>   LAZY_ROOTFS=""
>   SCRIPT_QEMU_OPT=""
> @@ -84,6 +87,10 @@ process_filename() {
>   		    error "conflicting FSTYPE types [$FSTYPE] and [$EXT]"
>   		fi
>   		;;
> +	/vmdk/)
> +		FSTYPE=$EXT
> +		VM=$filename
> +		;;
>   	*)
>   		error "unknown file arg [$filename]"
>   		;;
> @@ -192,19 +199,27 @@ elif [ ! -w /dev/net/tun ] ; then
>   fi
>
>   # Report errors for missing combinations of options
> -if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
> -    error "you must specify at least a MACHINE or KERNEL argument"
> +if [ -z "$MACHINE" -a -z "$KERNEL" -a -z "$VM" ]; then
> +    error "you must specify at least a MACHINE, VM, or KERNEL argument"
>   fi
>   if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
>       error "NFS booting without an explicit ROOTFS path is not yet supported"
>   fi
>
>   if [ -z "$MACHINE" ]; then
> -    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> -    if [ -z "$MACHINE" ]; then
> -        error "Unable to set MACHINE from kernel filename [$KERNEL]"
> +    if [ "x$FSTYPE" = "xvmdk" ]; then
> +        MACHINE=`basename $VM | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> +        if [ -z "$MACHINE" ]; then
> +            error "Unable to set MACHINE from vmdk filename [$VM]"
> +        fi
> +        echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
> +    else
> +        MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
> +        if [ -z "$MACHINE" ]; then
> +            error "Unable to set MACHINE from kernel filename [$KERNEL]"
> +        fi
> +        echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
>       fi
> -    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
>   fi
>
>   YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
> @@ -366,7 +381,7 @@ if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
>       fi
>   fi
>
> -if [ -z "$KERNEL" ]; then
> +if [ -z "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
>       setup_tmpdir
>       eval kernel_file=\$${machine2}_DEFAULT_KERNEL
>       KERNEL=$OE_TMPDIR/deploy/images/$kernel_file
> @@ -395,7 +410,7 @@ if [ "$LAZY_ROOTFS" = "true" ]; then
>       ROOTFS=$OE_TMPDIR/deploy/images/$ROOTFS-$MACHINE.$FSTYPE
>   fi
>
> -if [ -z "$ROOTFS" ]; then
> +if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
>       setup_tmpdir
>       T=$OE_TMPDIR/deploy/images
>       eval rootfs_list=\$${machine2}_DEFAULT_ROOTFS
> @@ -409,8 +424,12 @@ fi
>
>   echo ""
>   echo "Continuing with the following parameters:"
> -echo "KERNEL: [$KERNEL]"
> -echo "ROOTFS: [$ROOTFS]"
> +if [ "x$FSTYPE" != "xvmdk" ]; then
> +    echo "KERNEL: [$KERNEL]"
> +    echo "ROOTFS: [$ROOTFS]"
> +else
> +    echo "VMDK:   [$VM]"
> +fi
>   echo "FSTYPE: [$FSTYPE]"
>
>   setup_sysroot
> diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
> index 7ca00f8..fd1304e 100755
> --- a/scripts/runqemu-internal
> +++ b/scripts/runqemu-internal
> @@ -260,13 +260,13 @@ case "$MACHINE" in
>       ;;
>   esac
>
> -if [ ! -f "$KERNEL" ]; then
> +if [ ! -f "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
>       echo "Error: Kernel image file $KERNEL doesn't exist"
>       cleanup
>       return
>   fi
>
> -if [ "$FSTYPE" != "nfs" -a ! -f "$ROOTFS" ]; then
> +if [ "$FSTYPE" != "nfs" -a "$FSTYPE" != "vmdk" -a ! -f "$ROOTFS" ]; then
>       echo "Error: Image file $ROOTFS doesn't exist"
>       cleanup
>       return
> @@ -341,6 +341,9 @@ if [ "$MACHINE" = "qemux86" ]; then
>           KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
>           QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
>       fi
> +    if [ "$FSTYPE" = "vmdk" ]; then
> +        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
> +    fi
>       # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
>       # qemux86 and qemux86-64. We can use timer interrupt mode for now.
>       KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
> @@ -365,6 +368,9 @@ if [ "$MACHINE" = "qemux86-64" ]; then
>           KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
>           QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
>       fi
> +    if [ "$FSTYPE" = "vmdk" ]; then
> +        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
> +    fi
>       # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
>       # qemux86 and qemux86-64. We can use timer interrupt mode for now.
>       KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
> @@ -560,8 +566,14 @@ fi
>
>   echo "Running $QEMU..."
>   # -no-reboot is a mandatory option - see bug #100
> -echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
> -LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
> +if [ "$FSTYPE" = "vmdk" ]; then
> +    echo $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
> +    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
> +else
> +    echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
> +    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
> +fi
> +
>
>
>   cleanup
>


-- 
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center


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

* [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
@ 2012-12-12 11:43 Trevor Woerner
  2012-12-15 12:18 ` Trevor Woerner
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Woerner @ 2012-12-12 11:43 UTC (permalink / raw)
  To: yocto

Allow vmdk images to be run through the 'runqemu' facility.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 scripts/runqemu          | 39 +++++++++++++++++++++++++++++----------
 scripts/runqemu-internal | 20 ++++++++++++++++----
 2 files changed, 45 insertions(+), 14 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index fb7ac56..190e3b4 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -27,6 +27,7 @@ usage() {
     echo "  ROOTFS - the rootfs image file or nfsroot directory to use"
     echo "  MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)"
     echo "  RAMFS - boot a ramfs-based image"
+    echo "  VM - boot a vmdk image"
     echo "  Simplified QEMU command-line options can be passed with:"
     echo "    nographic - disables video console"
     echo "    serial - enables a serial console on /dev/ttyS0"
@@ -41,6 +42,7 @@ usage() {
     echo "  $MYNAME qemux86 ramfs"
     echo "  $MYNAME qemux86 qemuparams=\"-m 256\""
     echo "  $MYNAME qemux86 bootparams=\"psplash=false\""
+    echo "  $MYNAME path/to/<image>-<machine>.vmdk"
     exit 1
 }
 
@@ -56,6 +58,7 @@ error() {
 MACHINE=${MACHINE:=""}
 KERNEL=${KERNEL:=""}
 ROOTFS=${ROOTFS:=""}
+VM=${VM:=""}
 FSTYPE=""
 LAZY_ROOTFS=""
 SCRIPT_QEMU_OPT=""
@@ -84,6 +87,10 @@ process_filename() {
 		    error "conflicting FSTYPE types [$FSTYPE] and [$EXT]"
 		fi
 		;;
+	/vmdk/)
+		FSTYPE=$EXT
+		VM=$filename
+		;;
 	*)
 		error "unknown file arg [$filename]"
 		;;
@@ -192,19 +199,27 @@ elif [ ! -w /dev/net/tun ] ; then
 fi
 
 # Report errors for missing combinations of options
-if [ -z "$MACHINE" -a -z "$KERNEL" ]; then
-    error "you must specify at least a MACHINE or KERNEL argument"
+if [ -z "$MACHINE" -a -z "$KERNEL" -a -z "$VM" ]; then
+    error "you must specify at least a MACHINE, VM, or KERNEL argument"
 fi
 if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then
     error "NFS booting without an explicit ROOTFS path is not yet supported"
 fi
 
 if [ -z "$MACHINE" ]; then
-    MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
-    if [ -z "$MACHINE" ]; then
-        error "Unable to set MACHINE from kernel filename [$KERNEL]"
+    if [ "x$FSTYPE" = "xvmdk" ]; then
+        MACHINE=`basename $VM | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
+        if [ -z "$MACHINE" ]; then
+            error "Unable to set MACHINE from vmdk filename [$VM]"
+        fi
+        echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]"
+    else
+        MACHINE=`basename $KERNEL | sed 's/.*\(qemux86-64\|qemux86\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/'`
+        if [ -z "$MACHINE" ]; then
+            error "Unable to set MACHINE from kernel filename [$KERNEL]"
+        fi
+        echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
     fi
-    echo "Set MACHINE to [$MACHINE] based on kernel [$KERNEL]"
 fi
 
 YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
@@ -366,7 +381,7 @@ if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then
     fi
 fi
 
-if [ -z "$KERNEL" ]; then
+if [ -z "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
     setup_tmpdir
     eval kernel_file=\$${machine2}_DEFAULT_KERNEL
     KERNEL=$OE_TMPDIR/deploy/images/$kernel_file
@@ -395,7 +410,7 @@ if [ "$LAZY_ROOTFS" = "true" ]; then
     ROOTFS=$OE_TMPDIR/deploy/images/$ROOTFS-$MACHINE.$FSTYPE
 fi
 
-if [ -z "$ROOTFS" ]; then
+if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
     setup_tmpdir
     T=$OE_TMPDIR/deploy/images
     eval rootfs_list=\$${machine2}_DEFAULT_ROOTFS
@@ -409,8 +424,12 @@ fi
 
 echo ""
 echo "Continuing with the following parameters:"
-echo "KERNEL: [$KERNEL]"
-echo "ROOTFS: [$ROOTFS]"
+if [ "x$FSTYPE" != "xvmdk" ]; then
+    echo "KERNEL: [$KERNEL]"
+    echo "ROOTFS: [$ROOTFS]"
+else
+    echo "VMDK:   [$VM]"
+fi
 echo "FSTYPE: [$FSTYPE]"
 
 setup_sysroot
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index 7ca00f8..fd1304e 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -260,13 +260,13 @@ case "$MACHINE" in
     ;;
 esac
 
-if [ ! -f "$KERNEL" ]; then
+if [ ! -f "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then
     echo "Error: Kernel image file $KERNEL doesn't exist"
     cleanup
     return
 fi
 
-if [ "$FSTYPE" != "nfs" -a ! -f "$ROOTFS" ]; then
+if [ "$FSTYPE" != "nfs" -a "$FSTYPE" != "vmdk" -a ! -f "$ROOTFS" ]; then
     echo "Error: Image file $ROOTFS doesn't exist"
     cleanup
     return
@@ -341,6 +341,9 @@ if [ "$MACHINE" = "qemux86" ]; then
         KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
     fi
+    if [ "$FSTYPE" = "vmdk" ]; then
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+    fi
     # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
     # qemux86 and qemux86-64. We can use timer interrupt mode for now.
     KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
@@ -365,6 +368,9 @@ if [ "$MACHINE" = "qemux86-64" ]; then
         KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
         QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
     fi
+    if [ "$FSTYPE" = "vmdk" ]; then
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+    fi
     # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
     # qemux86 and qemux86-64. We can use timer interrupt mode for now.
     KERNCMDLINE="$KERNCMDLINE oprofile.timer=1"
@@ -560,8 +566,14 @@ fi
 
 echo "Running $QEMU..."
 # -no-reboot is a mandatory option - see bug #100
-echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
-LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+if [ "$FSTYPE" = "vmdk" ]; then
+    echo $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
+    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN $VM $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT
+else
+    echo $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append '"'$KERNCMDLINE $SCRIPT_KERNEL_OPT'"'
+    LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
+fi
+
 
 
 cleanup
-- 
1.8.0



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

* Re: [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
  2012-12-12  5:55 ` Scott Garman
@ 2012-12-12 11:48   ` Trevor Woerner
  0 siblings, 0 replies; 6+ messages in thread
From: Trevor Woerner @ 2012-12-12 11:48 UTC (permalink / raw)
  To: Scott Garman; +Cc: yocto@yoctoproject.org, Saul Wold

Hi Scott,

Thank you for reviewing my patch.

On Wed, Dec 12, 2012 at 12:55 AM, Scott Garman <scott.a.garman@intel.com> wrote:
> This looks ok without having tested it personally. Could you just add a
> signed-off-by line to the commit?

D'oh! Sorry about that. It has obviously been too long since I last
contributed to a project :-)


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

* Re: [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
  2012-12-12 11:43 [PATCH runqemu] runqemu: add support for FSTYPE=vmdk Trevor Woerner
@ 2012-12-15 12:18 ` Trevor Woerner
  2012-12-18  5:38   ` Saul Wold
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Woerner @ 2012-12-15 12:18 UTC (permalink / raw)
  To: yocto@yoctoproject.org

Is there a chance this can get included?


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

* Re: [PATCH runqemu] runqemu: add support for FSTYPE=vmdk
  2012-12-15 12:18 ` Trevor Woerner
@ 2012-12-18  5:38   ` Saul Wold
  0 siblings, 0 replies; 6+ messages in thread
From: Saul Wold @ 2012-12-18  5:38 UTC (permalink / raw)
  To: Trevor Woerner; +Cc: yocto@yoctoproject.org

On 12/15/2012 04:18 AM, Trevor Woerner wrote:
> Is there a chance this can get included?
> ____________________
I believe a rebase is needed and please sent to oe-core mailing list.

Thanks
	Sau!

___________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>


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

end of thread, other threads:[~2012-12-18  5:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 11:43 [PATCH runqemu] runqemu: add support for FSTYPE=vmdk Trevor Woerner
2012-12-15 12:18 ` Trevor Woerner
2012-12-18  5:38   ` Saul Wold
  -- strict thread matches above, loose matches on Subject: below --
2012-12-11  1:55 Trevor Woerner
2012-12-12  5:55 ` Scott Garman
2012-12-12 11:48   ` Trevor Woerner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.