mirror of
https://git.yoctoproject.org/poky
synced 2026-09-15 15:49:32 +02:00
runqemu: change terminal's INTR key in 'serial' mode
If you are using an image in '-serial stdio' mode, temporarily change the terminal's interrupt character to 'Ctrl-]' for the duration of the image run. In this way, hitting 'Ctrl-C' for something running in the image doesn't accidentally abort the entire qemu session. (From OE-Core rev: 642cfaac0cb515008cfc91aafe04ab1db7a51581) Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4491154b21
commit
ae84362fcc
@@ -64,6 +64,7 @@ LAZY_ROOTFS=""
|
|||||||
SCRIPT_QEMU_OPT=""
|
SCRIPT_QEMU_OPT=""
|
||||||
SCRIPT_QEMU_EXTRA_OPT=""
|
SCRIPT_QEMU_EXTRA_OPT=""
|
||||||
SCRIPT_KERNEL_OPT=""
|
SCRIPT_KERNEL_OPT=""
|
||||||
|
SERIALSTDIO=""
|
||||||
|
|
||||||
# Determine whether the file is a kernel or QEMU image, and set the
|
# Determine whether the file is a kernel or QEMU image, and set the
|
||||||
# appropriate variables
|
# appropriate variables
|
||||||
@@ -138,6 +139,7 @@ while true; do
|
|||||||
"serial")
|
"serial")
|
||||||
SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
|
SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
|
||||||
SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
|
SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
|
||||||
|
SERIALSTDIO="1"
|
||||||
;;
|
;;
|
||||||
"qemuparams="*)
|
"qemuparams="*)
|
||||||
SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
|
SCRIPT_QEMU_EXTRA_OPT="${arg##qemuparams=}"
|
||||||
|
|||||||
@@ -444,6 +444,7 @@ if [ "$MACHINE" = "qemush4" ]; then
|
|||||||
#KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
#KERNCMDLINE="root=/dev/hda console=ttyS0 console=tty0 $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
||||||
KERNCMDLINE="root=/dev/hda rw console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
KERNCMDLINE="root=/dev/hda rw console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
||||||
QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
|
QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -hda $ROOTFS -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
|
||||||
|
SERIALSTDIO="1"
|
||||||
fi
|
fi
|
||||||
if [ "$FSTYPE" = "nfs" ]; then
|
if [ "$FSTYPE" = "nfs" ]; then
|
||||||
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
|
if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
|
||||||
@@ -453,6 +454,7 @@ if [ "$MACHINE" = "qemush4" ]; then
|
|||||||
fi
|
fi
|
||||||
KERNCMDLINE="root=/dev/nfs console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
KERNCMDLINE="root=/dev/nfs console=ttySC1 noiotrap earlyprintk=sh-sci.1 console=tty nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
|
||||||
QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
|
QEMUOPTIONS="$QEMU_NETWORK_CMD -M $MACHINE_SUBTYPE -no-reboot $QEMU_UI_OPTIONS -monitor null -serial vc -serial stdio"
|
||||||
|
SERIALSTDIO="1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -565,6 +567,11 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "x$SERIALSTDIO" = "x1" ]; then
|
||||||
|
echo "Interrupt character is '^]'"
|
||||||
|
stty intr ^]
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Running $QEMU..."
|
echo "Running $QEMU..."
|
||||||
# -no-reboot is a mandatory option - see bug #100
|
# -no-reboot is a mandatory option - see bug #100
|
||||||
if [ "$FSTYPE" = "vmdk" ]; then
|
if [ "$FSTYPE" = "vmdk" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user