new file mode 100755
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+#arch=""
+#distro=""
+
+get_arch() {
+ machine=`uname --machine`
+ if [ "$machine" = "x86_64" ]; then
+ arch="x86_64"
+ elif [ "`echo $machine | sed 's/i[3456]86/x86/'`" = "x86" ]; then
+ arch="x86"
+ else
+ echo "unsupported architecture"
+ exit 1
+ fi
+}
+
+get_distro() {
+ if [ -f /etc/redhat-release ]; then
+ distro="redhat"
+ elif [ -f /etc/fedora-release ]; then
+ distro="fedora"
+ elif [ -f /etc/debian_version ]; then
+ distro_id=`lsb_release -i | awk '{print $3}'`
+ if [ "$distro_id" = "Ubuntu" ]; then
+ distro="ubuntu"
+ else
+ distro="debian"
+ fi
+ else
+ echo "unsupported distribution"
+ exit 1
+ fi
+}
+
+get_arch
+get_distro
+
+echo detected arch: $arch
+echo detected distro: $distro
+echo installing...
+
+install -D -p -m 0755 qemu-ga.linux.$arch /usr/sbin/qemu-ga
+
+if [ "$distro" = "redhat" ] || [ "$distro" = "fedora" ]; then
+ install -D -p -m 0755 redhat/qemu-ga.init /etc/init.d/qemu-ga
+ install -D -p -m 0644 redhat/qemu-ga.sysconfig /etc/sysconfig/qemu-ga
+ /sbin/chkconfig --add qemu-ga
+ /sbin/chkconfig --level 2345 qemu-ga on
+ /sbin/service qemu-ga restart
+elif [ "$distro" = "ubuntu" ] || [ "$distro" = "debian" ]; then
+ install -D -p -m 0755 debian/qemu-ga.init /etc/init.d/qemu-ga
+ install -D -p -m 0644 debian/qemu-ga.sysconfig /etc/sysconfig/qemu-ga
+ /usr/sbin/update-rc.d qemu-ga defaults
+ /etc/init.d/qemu-ga restart
+else
+ "no associated init script for distro: $distro"
+ exit 1
+fi
+
+echo installation complete.
Detects host distro/architecture, then chooses the appropriate binary and init scripts to install. Support for more distros will be added as they're tested. Currently RHEL6, RHEL5, Fedora 15, Ubuntu 10.04, and Ubuntu 10.10 are known to be supported with qemu-ga binaries generated on a RHEL5 build host. RHEL6 builds will not work on RHEL5 due to glibc issues. These idiosyncrasies will need to be documented once everything is fleshed out. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> --- guest-tools-iso/projects/qemu-ga/install.linux | 61 ++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-) create mode 100755 guest-tools-iso/projects/qemu-ga/install.linux