summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-03-17 16:33:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-31 15:38:46 +0100
commit201a43cce6171988999f954a5759f46b330a7812 (patch)
tree85169fb32c986f7de05eadd10749d018e27fcb61
parent52a85e805797bff2ec53b2356da8daf224460e9e (diff)
downloadopenembedded-core-201a43cce6171988999f954a5759f46b330a7812.tar.gz
openembedded-core-201a43cce6171988999f954a5759f46b330a7812.tar.bz2
openembedded-core-201a43cce6171988999f954a5759f46b330a7812.tar.xz
openembedded-core-201a43cce6171988999f954a5759f46b330a7812.zip
scripts/poky-qemu-internal: call stty sane before exit
When qemu is booted into console with -nographics then after exiting the terminal line settings are messed up. This patch calls stty sane to restore the terminal settings to default. stty is part of coreutils which is installed on all host distros hence there is no need to warn about it being available or not Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rwxr-xr-xscripts/poky-qemu-internal6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index 8fd1834ca..c88d71178 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -189,6 +189,9 @@ cleanup() {
echo "poky-export-rootfs stop $ROOTFS"
poky-export-rootfs stop $ROOTFS
fi
+ # If QEMU crashes or somehow tty properties are not restored
+ # after qemu exits, we need to run stty sane
+ stty sane
}
n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
@@ -458,8 +461,7 @@ 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'"'
-# If QEMU crashes, we need to run stty sane
-$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || stty sane
+$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT"
cleanup