]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: support booting ramfs-based images
authorScott Garman <scott.a.garman@intel.com>
Mon, 13 Aug 2012 20:20:38 +0000 (13:20 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 17 Aug 2012 17:04:09 +0000 (18:04 +0100)
Added support for booting ramfs-based images (e.g, poky-tiny) which
do not have block device support.

This fixes [YOCTO #2612].

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
scripts/runqemu
scripts/runqemu-internal

index 7454dd4a16463f92b28675b653ff7e551bac81f6..7e4bcc4e5f8d0cfc367c78c8fc1d8c815ac2c062 100755 (executable)
@@ -26,6 +26,7 @@ usage() {
     echo "  KERNEL - the kernel image file to use"
     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 "  Simplified QEMU command-line options can be passed with:"
     echo "    nographic - disables video console"
     echo "    serial - enables a serial console on /dev/ttyS0"
@@ -37,6 +38,7 @@ usage() {
     echo "  $MYNAME qemuarm"
     echo "  $MYNAME qemux86-64 core-image-sato ext3"
     echo "  $MYNAME path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial"
+    echo "  $MYNAME qemux86 ramfs"
     echo "  $MYNAME qemux86 qemuparams=\"-m 256\""
     echo "  $MYNAME qemux86 bootparams=\"psplash=false\""
     exit 1
@@ -118,6 +120,10 @@ while true; do
                 LAZY_ROOTFS="true"
             fi
             ;;
+        "ramfs")
+            FSTYPE=cpio.gz
+            RAMFS=true
+            ;;
         "nographic")
             SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -nographic"
             SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
index eeadb24ebe3e411cef1990194dd051590a690a5b..0d4f4a1d08d68afeb5d4ab9f76ffaff335fdddfc 100755 (executable)
@@ -453,6 +453,11 @@ if [ "$MACHINE" = "akita" ]; then
     fi
 fi
 
+if [ "x$RAMFS" = "xtrue" ]; then
+    QEMUOPTIONS="-initrd $ROOTFS -nographic"
+    KERNCMDLINE="root=/dev/ram0"
+fi
+
 if [ "x$QEMUOPTIONS" = "x" ]; then
     echo "Error: Unable to support this combination of options"
     cleanup