diff options
Diffstat (limited to 'system/qemu-kvm/qemu-kvm.SlackBuild')
-rw-r--r-- | system/qemu-kvm/qemu-kvm.SlackBuild | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/system/qemu-kvm/qemu-kvm.SlackBuild b/system/qemu-kvm/qemu-kvm.SlackBuild index 2858fe03e63ae..b271df276b4c0 100644 --- a/system/qemu-kvm/qemu-kvm.SlackBuild +++ b/system/qemu-kvm/qemu-kvm.SlackBuild @@ -26,7 +26,7 @@ VERSION=${VERSION:-1.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -KVMGROUP=${KVMGROUP:-kvm} +KVMGROUP=${KVMGROUP:-users} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,24 +36,6 @@ if [ -z "$ARCH" ]; then esac fi -# The script builds only x86 and x86_64 Linux Target CPU emulators by default. -# Available Linux Target CPUs for full system emulation are: -# i386 x86_64 arm cris m68k microblaze mips mipsel mips64 mips64el -# ppc ppcemb ppc64 sh4 sh4eb sparc sparc64 -# Available Linux Target CPUs for user mode emulation are: -# i386 x86_64 alpha arm armeb cris m68k microblaze mips mipsel -# ppc ppc64 ppc64abi32 sh4 sh4eb sparc sparc64 sparc32plus -# -# If you need to emulate all target CPUs, set BUILD_ARCH to "all" but be -# aware that the compilation will take a lot longer, and you should really -# be using plain "qemu" for the others (since they can't use the KVM stuff -# anyway. The default "x86_64" value works fine for for 32-bit or 64-bit -# QEMU-KVM hosts providing full system emulation supporting Linux, BSD, and -# Windows guests. - -BUILD_ARCH=${BUILD_ARCH:-x86_64} -[ "$BUILD_ARCH" = "all" ] && unset BUILD_ARCH - CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -70,7 +52,7 @@ elif [ "$ARCH" = "x86_64" ]; then LIBDIRSUFFIX="64" fi -# Needed to build man pages if build is ran from su +# Needed to build man pages if build with plain "su" export PATH=$PATH:/usr/share/texmf/bin set -e @@ -88,29 +70,49 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Fixup the udev rules file to remove the NAME="%k" and allow for a different -# group to be used (no real need to require a kvm group) -patch -p1 < $CWD/fixup_udev_rules.patch +# Fixup udev rules file to remove NAME="%k" and allow use of a different group +patch -p1 < $CWD/patches/fixup_udev_rules.patch + +# Fix build on recent kernels +patch -p1 < $CWD/patches/deprecate-time-drift-fix.patch -# This translates the possible targets into the correct format for configure -TARGETS="$(for i in $BUILD_ARCH ; do printf "$i-softmmu " ; done)" +# Fix CVE-2012-029 +patch -p1 < $CWD/patches/qemu-kvm-1.0-CVE-2012-029.patch + +# Disable debug (hardcoded) and remove double CFLAGS +sed -i "s|^CFLAGS=\"-g\ |CFLAGS=\"|" configure +sed -i "s|^LDFLAGS=\"-g\ |LDFLAGS=\"|" configure +sed -i "s|^\ \ CFLAGS=\"-O2\ | CFLAGS=\"|" configure + +# The script builds only the 32/64 bit x86 compatible Linux Target CPU emulator. +# If you need to emulate other available architectures you should install the +# "qemu" package, not the "qemu-kvm" package. This package will only be useful +# for x86 architectures that can make use of KVM-KMOD kernel modules which are +# the kvm-intel, kvm-amd, and kvm modules. CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-mixemu \ - --audio-drv-list=oss,alsa,sdl,esd \ + --audio-drv-list=alsa,oss,sdl,esd \ --enable-system \ - --target-list="$TARGETS" + --target-list="x86_64-softmmu" make V=1 \ + OS_CFLAGS="$SLKCFLAGS" \ mandir=/usr/man \ docdir=/usr/doc/$PRGNAM-$VERSION make install \ mandir=/usr/man \ docdir=/usr/doc/$PRGNAM-$VERSION \ DESTDIR=$PKG + +# Rename the primary binary from "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 + +# Copy a missed binary cp -a kvm/kvm_stat $PKG/usr/bin/ mkdir -p $PKG/lib/udev/rules.d/ |