diff options
-rwxr-xr-x | scripts/runqemu | 24 | ||||
-rwxr-xr-x | scripts/runqemu-internal | 10 |
2 files changed, 19 insertions, 15 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 82711606f6..a4d9a2306b 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -28,7 +28,7 @@ usage() { echo " MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)" echo " RAMFS - boot a ramfs-based image" echo " ISO - boot an ISO image" - echo " VM - boot a vmdk image" + echo " VM - boot a virtual machine image (= a file representing a full disk with boot loader)" echo " Simplified QEMU command-line options can be passed with:" echo " nographic - disables video console" echo " serial - enables a serial console on /dev/ttyS0" @@ -94,7 +94,7 @@ process_filename() { error "conflicting FSTYPE types [$FSTYPE] and [$EXT]" fi ;; - /vmdk/) + /hddimg/|/hdddirect/|/vmdk/) FSTYPE=$EXT VM=$filename ;; @@ -114,7 +114,7 @@ while true; do [ -z "$MACHINE" ] && MACHINE=$arg || \ error "conflicting MACHINE types [$MACHINE] and [$arg]" ;; - "ext2" | "ext3" | "ext4" | "jffs2" | "nfs" | "btrfs") + "ext2" | "ext3" | "ext4" | "jffs2" | "nfs" | "btrfs" | "hddimg" | "hdddirect" ) [ -z "$FSTYPE" -o "$FSTYPE" = "$arg" ] && FSTYPE=$arg || \ error "conflicting FSTYPE types [$FSTYPE] and [$arg]" ;; @@ -235,12 +235,12 @@ if [ "$FSTYPE" = "nfs" -a -z "$ROOTFS" ]; then fi if [ -z "$MACHINE" ]; then - if [ "x$FSTYPE" = "xvmdk" ]; then + if [ "x$FSTYPE" = "xvmdk" ] || [ "x$FSTYPE" = "xhddimg" ] || [ "x$FSTYPE" = "xhdddirect" ]; then MACHINE=`basename $VM | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'` if [ -z "$MACHINE" ]; then - error "Unable to set MACHINE from vmdk filename [$VM]" + error "Unable to set MACHINE from image filename [$VM]" fi - echo "Set MACHINE to [$MACHINE] based on vmdk [$VM]" + echo "Set MACHINE to [$MACHINE] based on image [$VM]" else MACHINE=`basename $KERNEL | sed -n 's/.*\(qemux86-64\|qemux86\|qemuarm64\|qemuarm\|qemumips64\|qemumips\|qemuppc\|qemush4\).*/\1/p'` if [ -z "$MACHINE" ]; then @@ -436,7 +436,7 @@ if [ -e "$ROOTFS" -a -z "$FSTYPE" ]; then fi fi -if [ -z "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then +if [ -z "$KERNEL" -a "x$FSTYPE" != "xvmdk" -a "x$FSTYPE" != "xhddimg" -a "x$FSTYPE" != "xhdddirect" ]; then setup_path_vars 1 eval kernel_file=\$${machine2}_DEFAULT_KERNEL KERNEL=$DEPLOY_DIR_IMAGE/$kernel_file @@ -462,10 +462,14 @@ fi if [ "$LAZY_ROOTFS" = "true" ]; then setup_path_vars 1 echo "Assuming $ROOTFS really means $DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE" - ROOTFS=$DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE + if [ "$FSTYPE" = "hddimg" -o "x$FSTYPE" = "xhdddirect" ]; then + VM=$DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE + else + ROOTFS=$DEPLOY_DIR_IMAGE/$ROOTFS-$MACHINE.$FSTYPE + fi fi -if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then +if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" -a "x$FSTYPE" != "xhddimg" -a "x$FSTYPE" != "xhdddirect" ]; then setup_path_vars 1 T=$DEPLOY_DIR_IMAGE eval rootfs_list=\$${machine2}_DEFAULT_ROOTFS @@ -481,7 +485,7 @@ ROOTFS=`readlink -f $ROOTFS` echo "" echo "Continuing with the following parameters:" -if [ "x$FSTYPE" != "xvmdk" ]; then +if [ "x$FSTYPE" != "xvmdk" -a "x$FSTYPE" != "xhddimg" -a "x$FSTYPE" != "xhdddirect" ]; then echo "KERNEL: [$KERNEL]" echo "ROOTFS: [$ROOTFS]" else diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index a691a80a46..15272683b8 100755 --- a/scripts/runqemu-internal +++ b/scripts/runqemu-internal @@ -315,13 +315,13 @@ case "$MACHINE" in ;; esac -if [ ! -f "$KERNEL" -a "x$FSTYPE" != "xvmdk" ]; then +if [ ! -f "$KERNEL" -a "x$FSTYPE" != "xvmdk" -a "x$FSTYPE" != "xhddimg" -a "x$FSTYPE" != "xhdddirect" ]; then echo "Error: Kernel image file $KERNEL doesn't exist" cleanup return 1 fi -if [ "$FSTYPE" != "nfs" -a "$FSTYPE" != "vmdk" -a ! -f "$ROOTFS" ]; then +if [ "$FSTYPE" != "nfs" -a "$FSTYPE" != "vmdk" -a "$FSTYPE" != "hddimg" -a "$FSTYPE" != "hdddirect" -a ! -f "$ROOTFS" ]; then echo "Error: Image file $ROOTFS doesn't exist" cleanup return 1 @@ -440,7 +440,7 @@ 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 + if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; then QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS" fi # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in @@ -476,7 +476,7 @@ 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 -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS" fi - if [ "$FSTYPE" = "vmdk" ]; then + if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; then QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS" fi # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in @@ -702,7 +702,7 @@ fi echo "Running $QEMU..." # -no-reboot is a mandatory option - see bug #100 -if [ "$FSTYPE" = "vmdk" ]; then +if [ "$FSTYPE" = "vmdk" -o "$FSTYPE" = "hddimg" -o "$FSTYPE" = "hdddirect" ]; 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 elif [ "$FSTYPE" = "iso" ]; then |