diff options
author | Eric Hameleers <alien@slackware.com> | 2012-02-18 21:31:16 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2012-02-18 21:31:16 +0000 |
commit | 7b9a60014aaacbed60d330f8143be71aea332952 (patch) | |
tree | 9a4385cf46ae70b23e57c320eb9e45a723fa6250 /qemu-kvm | |
parent | 62a8734b0022e899fe76cdb44c1d0e9f53544c68 (diff) | |
download | asb-7b9a60014aaacbed60d330f8143be71aea332952.tar.gz asb-7b9a60014aaacbed60d330f8143be71aea332952.tar.xz |
Get rid of CWD
Diffstat (limited to 'qemu-kvm')
-rwxr-xr-x | qemu-kvm/build/qemu-kvm.SlackBuild | 61 |
1 files changed, 38 insertions, 23 deletions
diff --git a/qemu-kvm/build/qemu-kvm.SlackBuild b/qemu-kvm/build/qemu-kvm.SlackBuild index 6884aa3a..b2c2d4cc 100755 --- a/qemu-kvm/build/qemu-kvm.SlackBuild +++ b/qemu-kvm/build/qemu-kvm.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright 2010, 2011 Eric Hameleers, Eindhoven, NL +# Copyright 2010, 2011, 2012 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -36,8 +36,14 @@ # * Update. # 0.15.0-1: 14/aug/2011 by Eric Hameleers <alien@slackware.com> # * Update. -# 1.0-1: 064/dec/2011 by Eric Hameleers <alien@slackware.com> +# 1.0-1: 06/dec/2011 by Eric Hameleers <alien@slackware.com> # * A 1.0 release !!! +# 1.0-2: 18/feb/2012 by Eric Hameleers <alien@slackware.com> +# * Align the package with the SlackBuild from slackbuilds.org +# which removes support for all architectures except x86, and +# renames the single binary qemu-system-x86_64 to qemu-kvm. +# This allows it to co-exist with a qemu package which supports +# all other virtualization targets. # # Run 'sh qemu-kvm.SlackBuild' to build a Slackware package. # The package (.tgz) and .txt file as well as build logs are created in /tmp . @@ -45,11 +51,14 @@ # # ----------------------------------------------------------------------------- -# Set initial variables: +# Note that qemu-kvm only offers kernel acceleration through KVM if the guest +# VM is x86_64 (in system emulation). +# If you need system emulation targets other than x86_64 and x86, then +# it is qemu (not qemu-kvm) which you should use. PRGNAM=qemu-kvm VERSION=${VERSION:-1.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:" -j4 "} TAG=${TAG:-alien} @@ -73,12 +82,14 @@ SRCURL="http://sourceforge.net/projects/kvm/files/${PRGNAM}/${VERSION}/${PRGNAM} ## # Automatically determine the architecture we're building on: +MARCH=$( uname -m ) if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) export ARCH=i486 ;; - arm*) export ARCH=arm ;; + case "$MARCH" in + i?86) export ARCH=i486 ;; + armv7hl) export ARCH=$MARCH ;; + arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: - *) export ARCH=$( uname -m ) ;; + *) export ARCH=$MARCH ;; esac fi @@ -89,6 +100,9 @@ case "$ARCH" in x86_64) SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" ;; + armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" + SLKLDFLAGS=""; LIBDIRSUFFIX="" + ;; *) SLKCFLAGS="-O2" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; @@ -150,11 +164,13 @@ echo "Extracting the source archive(s) for $PRGNAM..." tar -xvf ${SOURCE} cd ${PRGNAM}-${VERSION} -# Fix for build error (0.14.0 only): -if [ "${VERSION}" = "0.14.0" ]; then - cat $SRCDIR/qemu-kvm.nopci.patch | patch -p1 --verbose 2>&1 \ - | tee $OUTPUT/patch-$PRGNAM.log -fi +# Fix build on recent kernels: +cat $SRCDIR/patches/deprecate-time-drift-fix.patch | patch -p1 --verbose \ + 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log + +# Fix CVE-2012-029: +cat $SRCDIR/patches/qemu-kvm-1.0-CVE-2012-029.patch | patch -p1 --verbose \ + 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log chown -R root:root . chmod -R u+w,go+r-w,a+X-s . @@ -169,25 +185,24 @@ CFLAGS="$SLKCFLAGS" \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --enable-system \ - --enable-linux-user \ - --target-list="" \ + --target-list="x86_64-softmmu" \ + --audio-drv-list=oss,alsa,sdl,esd \ --enable-mixemu \ --enable-vde \ - --audio-drv-list=oss,alsa,sdl,esd \ 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log - # If you do not care for all the exotic target platforms, then you can add - # a subset of targets to the 'configure' block right above. For instance, - # to only build x86_64 and arm targets, change this line: - # --target-list="" \ - # to: - # --target-list=x86_64-softmmu,x86_64-linux-user,arm-softmmu,arm-linux-user \ - # The default configuration will cause 'make' to strip the binaries: make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}.log make DESTDIR=$PKG install 2>&1 | tee $OUTPUT/install-${PRGNAM}.log install -m0775 kvm/kvm_stat $PKG/usr/bin/kvm_stat +# Rename "qemu-system-x86_64" to "qemu-kvm" so that +# the regular "qemu" package won't overwrite it. +mv $PKG/usr/bin/qemu-system-x86_64 $PKG/usr/bin/qemu-kvm + +# Rename the manual page too: +mv $PKG/usr/man/man1/{qemu,qemu-kvm}.1 + # Preserve user modifications of this config file: mv -i $PKG/etc/qemu/target-x86_64.conf{,.new} |