Skip to contentSkip to conversation

Call stty sane before exiting qemu

PATCH In review Khem Raj 2 participants 5 messages Mar 21, 2011 – Mar 25, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

v2 cover Call stty sane before exiting qemu

In nographic mode when qemu is exited e.g. qemuppc then the shell does not respond as expected (experienced on ubuntu). So we add a call to stty sane just before exit which fixes the issue.

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/qemu-stty-sane
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/qemu-stty-sane

Thanks,
Khem Raj <[email protected]>
---

Khem Raj (1):
scripts/poky-qemu-internal: Add call to stty

 scripts/poky-qemu-internal |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH v2 1/1 scripts/poky-qemu-internal: Add call to stty

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

---
 scripts/poky-qemu-internal |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
scripts/poky-qemu-internal +1 -0
index 8fd1834..556ce69 100755
@@ -189,6 +189,7 @@ cleanup() {
         echo "poky-export-rootfs stop $ROOTFS"
         poky-export-rootfs stop $ROOTFS
     fi
+    stty sane
 }
 
 n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH V2 1/1] scripts/poky-qemu-internal: Add call to stty

Quoted 19 lines · Khem Raj

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

---
 scripts/poky-qemu-internal |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
scripts/poky-qemu-internal +0 -0
index 8fd1834..556ce69 100755

scripts/poky-qemu-internal cleanup() { · line 195

Quoted 7 lines
scripts/poky-qemu-internal +1 -0
@@ -189,6 +189,7 @@ cleanup() {
         echo "poky-export-rootfs stop $ROOTFS"
         poky-export-rootfs stop $ROOTFS
     fi
+    stty sane
 }
 
 n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]

With the recent change to the script to run:

$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || stty sane

is the above change still needed?

Cheers,

Richard

author
#3 lore raw

Re: [PATCH V2 1/1] scripts/poky-qemu-internal: Add call to stty

Quoted 26 lines · Richard Purdie
Quoted 25 lines · Khem Raj

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

---
 scripts/poky-qemu-internal |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
scripts/poky-qemu-internal +0 -0
index 8fd1834..556ce69 100755
@@ -189,6 +189,7 @@ cleanup() {

         echo "poky-export-rootfs stop $ROOTFS" poky-export-rootfs stop $ROOTFS
     fi
+    stty sane
 }

Quoted 7 lines
Quoted 1 line

 n1=$[ (echo $TAP | sed 's/tap//' * 2) + 1 ]

With the recent change to the script to run:

$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || stty sane

is the above change still needed?

this will only execute if the command fails I guess. But the problem happens even if qemu ran well.

Quoted 11 lines

Cheers,

Richard

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#4 lore raw

Re: [PATCH V2 1/1] scripts/poky-qemu-internal: Add call to stty

Quoted 32 lines · Khem Raj
Quoted 30 lines · Richard Purdie
Quoted 19 lines · Khem Raj

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

---
 scripts/poky-qemu-internal |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
scripts/poky-qemu-internal +0 -0
index 8fd1834..556ce69 100755

scripts/poky-qemu-internal cleanup() { · line 195

Quoted 7 lines
scripts/poky-qemu-internal +1 -0
@@ -189,6 +189,7 @@ cleanup() {
         echo "poky-export-rootfs stop $ROOTFS"
         poky-export-rootfs stop $ROOTFS
     fi
+    stty sane
 }
 
 n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]

With the recent change to the script to run:

Quoted 6 lines
Quoted 3 lines

$QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -no-reboot $SCRIPT_QEMU_OPT $SCRIPT_QEMU_EXTRA_OPT --append "$KERNCMDLINE $SCRIPT_KERNEL_OPT" || stty sane

is the above change still needed?

this will only execute if the command fails I guess. But the problem happens even if qemu ran well.

Ok, I'll take your version but can you update it to remove this other stty call please? :)

Cheers,

Richard