From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 5/5] guest tools: installer for qemu-ga
Date: Mon, 22 Aug 2011 12:09:20 -0500 [thread overview]
Message-ID: <1314032960-23474-6-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1314032960-23474-1-git-send-email-mdroth@linux.vnet.ibm.com>
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
diff --git a/guest-tools-iso/projects/qemu-ga/install.linux b/guest-tools-iso/projects/qemu-ga/install.linux
new file mode 100755
index 0000000..1f200b6
--- /dev/null
+++ b/guest-tools-iso/projects/qemu-ga/install.linux
@@ -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.
--
1.7.0.4
prev parent reply other threads:[~2011-08-22 20:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 17:09 [Qemu-devel] [RFC] QEMU Guest Tools ISO Follow-up Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 1/5] guest tools: add iso/tarball generator for guest tools Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 2/5] guest tools: installer harness Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 3/5] guest tools: qemu-ga, debian init files Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 4/5] guest tools: qemu-ga, redhat init scripts Michael Roth
2011-08-22 17:09 ` Michael Roth [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314032960-23474-6-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).