Skip to contentSkip to conversation

Call stty sane always and expand qemu target list

PATCH Applied Khem Raj 2 participants 4 messages Mar 25, 2011 – Mar 31, 2011

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

cover Call stty sane always and expand qemu target list

This patch series has two patches, one calls stty sane always before exit previously it was only called if qemu crashed

Second patch introduces a new variable called QEMU_TARGET which can be set by distributions or appended in layers to select reduced set of targets to build in qemu-native
It weakly assigned and list is expanded to include SH and MIPS64 to help oe distros.

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

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

Khem Raj (2):
scripts/poky-qemu-internal: call stty sane before exit qemu.inc: Add sh4,sh4eb,mips64,mips64el targets

 meta/recipes-devtools/qemu/qemu-targets.inc |   18 ++++++++++++++++++
 meta/recipes-devtools/qemu/qemu.inc         |   12 +++++++++---
 scripts/poky-qemu-internal                  |    6 ++++--
 3 files changed, 31 insertions(+), 5 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu-targets.inc
Signature · 1 line
1.7.4.1
author
#1 lore raw

PATCH v3 1/2 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

---
 scripts/poky-qemu-internal |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
scripts/poky-qemu-internal +4 -2
index 8fd1834..c88d711 100755
@@ -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
Signature · 1 line
1.7.4.1
author
#2 lore raw

PATCH v3 2/2 qemu.inc: Add sh4, sh4eb, mips64, mips64el targets

In reply to Khem Raj

In order to leavarage more emulations in oe-core
these targets needs to be built as well

Introduce new variable QEMU_TARGETS which
can be set by user to decide what all machine support should be build into qemu-native

This one works adding same to qemu.inc does not
parse presumably a bitbake problem.

---
 meta/recipes-devtools/qemu/qemu-targets.inc |   18 ++++++++++++++++++
 meta/recipes-devtools/qemu/qemu.inc         |   12 +++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/qemu/qemu-targets.inc
meta/recipes-devtools/qemu/qemu-targets.inc new file +18 -0
new file mode 100644
index 0000000..550a7fe
@@ -0,0 +1,18 @@
+# possible arch values are arm mips mipsel mips64 mips64el ppc ppc64 ppc64abi32
+# ppcemb armeb alpha sparc32plus i386 x86_64 cris m68k microblaze sparc sparc32
+# sparc32plus
+
+def get_qemu_target_list(d):
+    import bb
+    archs = bb.data.getVar('QEMU_TARGETS', d, True).split()
+    targets = ""
+    for arch in ['mips64', 'mips64el', 'ppcemb']:
+        if arch in archs:
+            targets += arch + "-softmmu,"
+	    archs.remove(arch)
+    for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus']:
+        if arch in archs:
+            targets += arch + "-linux-user,"
+	    archs.remove(arch)
+    return targets + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+
meta/recipes-devtools/qemu/qemu.inc +9 -3
index f41b49c..0367f50 100644
@@ -3,8 +3,14 @@ HOMEPAGE = "http://qemu.org"
 LICENSE = "GPLv2 & LGPLv2.1"
 DEPENDS = "zlib alsa-lib"
 
-EXTRA_OECONF = "--target-list=arm-linux-user,arm-softmmu,i386-linux-user,i386-softmmu,x86_64-linux-user,x86_64-softmmu,mips-linux-user,mips-softmmu,ppc-linux-user,ppc-softmmu,mipsel-linux-user --disable-werror --disable-vnc-tls --enable-kvm --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370"
-#EXTRA_OECONF += "--disable-sdl"
+# QEMU_TARGETS is overridable variable
+QEMU_TARGETS ?= "arm i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
+
+require qemu-targets.inc
+
+EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --enable-kvm --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370"
+
+#EXTRA_OECOF += "--disable-sdl"
 
 inherit autotools
 
@@ -34,6 +40,6 @@ do_configure() {
 SRC_URI_append_virtclass-nativesdk = " file://glflags.patch;patch=1"
 DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk qemugl-nativesdk"
 RDEPENDS_virtclass-nativesdk = "libsdl-nativesdk"
-EXTRA_OECONF_virtclass-nativesdk = "--target-list=arm-linux-user,arm-softmmu,i386-softmmu,x86_64-softmmu,mips-linux-user,mipsel-linux-user,mips-softmmu,ppc-softmmu --disable-vnc-tls --cross-prefix=${TARGET_PREFIX}"
+EXTRA_OECONF_virtclass-nativesdk += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --cross-prefix=${TARGET_PREFIX}"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
1.7.4.1
#3 lore raw
In reply to Khem Raj
Quoted 13 lines · Khem Raj

This patch series has two patches, one calls stty sane always before exit previously it was only called if qemu crashed

Second patch introduces a new variable called QEMU_TARGET which can be set by distributions or appended in layers to select reduced set of targets to build in qemu-native
It weakly assigned and list is expanded to include SH and MIPS64 to help oe distros.

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

Quoted 8 lines

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

Khem Raj (2):
scripts/poky-qemu-internal: call stty sane before exit qemu.inc: Add sh4,sh4eb,mips64,mips64el targets

Merged to master, thanks.

Richard