aboutsummaryrefslogtreecommitdiff
path: root/system/kqemu
diff options
context:
space:
mode:
authorhollywoodb <hollywoodb@fastmail.fm>2010-05-11 15:18:40 +0200
committerEric Hameleers <alien@slackbuilds.org>2010-05-11 15:18:40 +0200
commitc80246572d63bd0727df7e6294c59c92110931b5 (patch)
treeffa92402d7ee9ea0d97546e7e3aad05f100eb761 /system/kqemu
parent09185668b0756017df6d7387cd35f2bbe81f8c75 (diff)
system/kqemu: Initial import
Diffstat (limited to 'system/kqemu')
-rw-r--r--system/kqemu/README24
-rw-r--r--system/kqemu/doinst.sh11
-rw-r--r--system/kqemu/install.sh-install.patch17
-rw-r--r--system/kqemu/kqemu.SlackBuild78
-rw-r--r--system/kqemu/kqemu.info8
-rw-r--r--system/kqemu/rc.kqemu9
-rw-r--r--system/kqemu/slack-desc9
7 files changed, 156 insertions, 0 deletions
diff --git a/system/kqemu/README b/system/kqemu/README
new file mode 100644
index 0000000000000..b15df8bec19fa
--- /dev/null
+++ b/system/kqemu/README
@@ -0,0 +1,24 @@
+The QEMU Accelerator Module increases the speed of QEMU when a PC is emulated on a PC. It runs most of the target application code directly on the host processor to achieve near native performance. It is very useful when you want to run another Operating System (for example Windows) on a Linux desktop.
+
+With the QEMU Accelerator Module, QEMU can be compared to other commercial or free PC Virtualizers. It has the advantage of being free and to achieve good performances while necessitating no specific guest Operating System modifications.
+
+The QEMU Accelerator used to be a closed source (albeit free to use) product, but starting with the release of 1.3.0pre11 it's license changed to the GPL.
+
+By default the script will build the kqemu kernel module for the currently
+running kernel. If you would like to build the kqemu driver for a different
+kernel version, two things are required:
+ 1) kernel source
+ 2) run the script as: KERNELVERSION=<version> sh kqemu.SlackBuild
+In place of <version> use only the version, not the full path
+ Examples: KERNELVERSION=2.4.33.3 or KERNELVERSION=2.6.18
+The kernel module will then be installed to /lib/modules/<version>/....
+You may use this SlackBuild to build the kqemu module for as many *different*
+kernels as you like and they can be installed alongside each other without
+conflict.
+
+This SlackBuild also comes with a file called "rc.kqemu". This script will load the kernel module and create the /dev/kqemu node so that you can actually use kqemu with QEMU. This script isn't installed by default. To install it so it is run every boot you can either copy its contents to /etc/rc.d/rc.local, or use the script as-is by copying it to /etc/rc.d/, making sure ownership and permissions are correct, and manage it as any other 3rd-party initscript. If you would just like to use it once in a while, you can run it with `sh rc.kqemu`.
+
+Requires:
+
+2.4 or 2.6 series Linux kernel
+qemu >= 0.8.1
diff --git a/system/kqemu/doinst.sh b/system/kqemu/doinst.sh
new file mode 100644
index 0000000000000..64b4ec816bfc8
--- /dev/null
+++ b/system/kqemu/doinst.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -x sbin/depmod ]; then
+ chroot . /sbin/depmod -a 1> /dev/null 2> /dev/null
+fi
+
+# Create the kqemu device. No special priviledge is needed to use kqemu.
+device="dev/kqemu"
+rm -f $device
+mknod $device c 250 0
+chmod 666 $device
diff --git a/system/kqemu/install.sh-install.patch b/system/kqemu/install.sh-install.patch
new file mode 100644
index 0000000000000..a76498c4ae5eb
--- /dev/null
+++ b/system/kqemu/install.sh-install.patch
@@ -0,0 +1,17 @@
+--- install.sh.orig 2007-02-25 15:03:06.000000000 -0600
++++ install.sh 2007-02-25 15:05:54.000000000 -0600
+@@ -10,9 +10,10 @@
+ fi
+
+ # Find kernel install path
+-kernel_path="/lib/modules/`uname -r`"
++kernel_path="/lib/modules/$KERNELVERSION"
+
+-mkdir -p "$kernel_path/misc"
+-cp "$module" "$kernel_path/misc"
++mkdir -p "$DESTDIR/$kernel_path/misc"
++cp "$module" "$DESTDIR/$kernel_path/misc"
++
++# /sbin/depmod -a # Done in doinst.sh
+
+-/sbin/depmod -a
diff --git a/system/kqemu/kqemu.SlackBuild b/system/kqemu/kqemu.SlackBuild
new file mode 100644
index 0000000000000..81ee1bf9cfc40
--- /dev/null
+++ b/system/kqemu/kqemu.SlackBuild
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+## Written by hollywoodb (hollywoodb@fastmail.fm)
+
+## Feel free to use, modify, redistribute this script.
+## If you make changes please modify the "Written by"
+## so that I don't recieve emails about a script I
+## did not write. Thanks.
+## Modified by the SlackBuilds.org project
+
+set -k
+
+if [ "$(id -u)" != "0" ]; then
+ echo "This script must be run as root!"
+ exit
+fi
+
+KERNELVERSION=${KERNELVERSION:-`uname -r`}
+KERNELPATH=${KERNELPATH:-/lib/modules/${KERNELVERSION}/build}
+PATCHLEVEL=`echo $KERNELVERSION | cut -f 2 -d '.'`
+
+NAME=kqemu
+VERSION=1.3.0pre11
+ARCHIVE=tar.gz
+PKG_VERS=$VERSION\_$KERNELVERSION
+
+ARCH=${ARCH:-i486}
+CWD=`pwd`
+TMP=${TMP:-/tmp/SBo}
+PKG=${PKG:-$TMP/package-$NAME}
+OUTPUT=${OUTPUT:-/tmp}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+rm -rf $PKG $TMP/$NAME-$VERSION
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+tar zxvf $CWD/$NAME-$VERSION.$ARCHIVE || exit 1
+cd $NAME-$VERSION
+
+chown -R root:root .
+chmod -R u+w,go+r-w,a-s .
+
+# `make install` calls install.sh
+# Let's make install.sh respect DESTDIR, and move /dev node
+# creation and /sbin/depmod to doinst.sh
+patch -p0 < $CWD/install.sh-install.patch || exit 1
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+fi
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --kernel-path=$KERNELPATH \
+ || exit 1
+
+make || exit 1
+make install KERNELVERSION=$KERNELVERSION DESTDIR=$PKG || exit 1
+
+# Compress 2.4.x kernel modules like Slackware does by default:
+[ $PATCHLEVEL -eq 4 ] && find $PKG/lib/modules -name "*.?" -type f -exec gzip -9f {} \;
+
+mkdir -p $PKG/usr/doc/$NAME-$PKG_VERS
+cp -a {Changelog,LICENSE,README} $PKG/usr/doc/$NAME-$PKG_VERS
+cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$PKG_VERS/$NAME.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+chmod +x $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n -p $OUTPUT/$NAME-$PKG_VERS-$ARCH-$BUILD$TAG.tgz
+
diff --git a/system/kqemu/kqemu.info b/system/kqemu/kqemu.info
new file mode 100644
index 0000000000000..9629018c5cd87
--- /dev/null
+++ b/system/kqemu/kqemu.info
@@ -0,0 +1,8 @@
+PRGNAM="kqemu"
+VERSION="1.3.0pre11"
+HOMEPAGE="http://qemu.org/"
+DOWNLOAD="http://qemu.org/kqemu-1.3.0pre11.tar.gz"
+MD5SUM="970521874ef8b1ba4598925ace5936c3"
+MAINTAINER="hollywoodb"
+EMAIL="hollywoodb@fastmail.fm"
+APPROVED="alien"
diff --git a/system/kqemu/rc.kqemu b/system/kqemu/rc.kqemu
new file mode 100644
index 0000000000000..5f8d6c923a04d
--- /dev/null
+++ b/system/kqemu/rc.kqemu
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+/sbin/modprobe kqemu
+
+# Create the kqemu device. No special priviledge is needed to use kqemu.
+device="/dev/kqemu"
+rm -f $device
+mknod $device c 250 0
+chmod 666 $device
diff --git a/system/kqemu/slack-desc b/system/kqemu/slack-desc
new file mode 100644
index 0000000000000..44e9c09c887ba
--- /dev/null
+++ b/system/kqemu/slack-desc
@@ -0,0 +1,9 @@
+ |-----handy-ruler--------------------------------------------------------|
+kqemu: kqemu (QEMU accelerator module for 2.4/2.6 series kernels)
+kqemu:
+kqemu: The QEMU Accelerator Module increases the speed of QEMU when a PC is
+kqemu: emulated on a PC. It runs most of the target application code directly
+kqemu: on the host processor to achieve near native performance. It is very
+kqemu: useful when you want to run another Operating System (for example
+kqemu: Windows) on a Linux desktop.
+kqemu: \ No newline at end of file