summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/qemu')
-rw-r--r--app-emulation/qemu/ChangeLog9
-rw-r--r--app-emulation/qemu/files/qemu-ifdown20
-rw-r--r--app-emulation/qemu/files/qemu-ifup22
-rw-r--r--app-emulation/qemu/qemu-0.10.3.ebuild11
4 files changed, 55 insertions, 7 deletions
diff --git a/app-emulation/qemu/ChangeLog b/app-emulation/qemu/ChangeLog
index 59e85832846b..4a2ce198731e 100644
--- a/app-emulation/qemu/ChangeLog
+++ b/app-emulation/qemu/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-emulation/qemu
-# Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.63 2009/05/17 10:40:43 lu_zero Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/ChangeLog,v 1.64 2009/05/17 21:20:30 flameeyes Exp $
+
+ 17 May 2009; Diego E. Pettenò <flameeyes@gentoo.org> qemu-0.10.3.ebuild,
+ +files/qemu-ifdown, +files/qemu-ifup:
+ Add missing ifup/ifdown scripts, change install logic, make sure they are
+ not added executable to CVS.
*qemu-0.10.3 (17 May 2009)
diff --git a/app-emulation/qemu/files/qemu-ifdown b/app-emulation/qemu/files/qemu-ifdown
new file mode 100644
index 000000000000..c173e43a9813
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-ifdown
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -x /sbin/brctl ]; then
+ BRCTL="/sbin/brctl"
+elif [ -x /usr/sbin/brctl ]; then
+ BRCTL="/usr/sbin/brctl"
+else
+ echo "no bridge utils installed"
+ exit 1
+fi
+
+if [ -x /sbin/ip ]; then
+ switch=( $(/sbin/ip route list | awk '/^default / { sub(/.* dev /, ""); print $1 }') )
+ ${BRCTL} delif ${switch} $1
+ /sbin/ip link set $1 down
+else
+ switch=( $(/bin/netstat -rn | awk '/^0\.0\.0\.0/ { print $NF }') )
+ ${BRCTL} delif ${switch} $1
+ /sbin/ifconfig $1 down
+fi
diff --git a/app-emulation/qemu/files/qemu-ifup b/app-emulation/qemu/files/qemu-ifup
new file mode 100644
index 000000000000..4a30e7d5645f
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-ifup
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ -x /sbin/brctl ]; then
+ BRCTL="/sbin/brctl"
+elif [ -x /usr/sbin/brctl ]; then
+ BRCTL="/usr/sbin/brctl"
+else
+ echo "no bridge utils installed"
+ exit 1
+fi
+
+if [ -x /sbin/ip ]; then
+ switch=( $(/sbin/ip route list | awk '/^default / { sub(/.* dev /, ""); print $1 }') )
+ /sbin/ip link set $1 up
+else
+ switch=( $(/bin/netstat -rn | awk '/^0\.0\.0\.0/ { print $NF }') )
+ /sbin/ifconfig $1 0.0.0.0 up
+fi
+
+[[ ${switch#} -ne "1" ]] && logger -t qemu "$0 found more than one bridge connecting $1 to ${switch}"
+${BRCTL} addif ${switch} $1
+
diff --git a/app-emulation/qemu/qemu-0.10.3.ebuild b/app-emulation/qemu/qemu-0.10.3.ebuild
index 46dedf74c178..408298499a98 100644
--- a/app-emulation/qemu/qemu-0.10.3.ebuild
+++ b/app-emulation/qemu/qemu-0.10.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-0.10.3.ebuild,v 1.2 2009/05/17 13:56:38 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-0.10.3.ebuild,v 1.3 2009/05/17 21:20:30 flameeyes Exp $
EAPI="2"
@@ -127,10 +127,11 @@ src_configure() {
src_install() {
emake DESTDIR="${D}" install || die "make install failed"
- insinto /etc/qemu
- insopts -m0755
- doins "${FILESDIR}/qemu-ifup"
- doins "${FILESDIR}/qemu-ifdown"
+ exeinto /etc/qemu
+ doexe \
+ "${FILESDIR}/qemu-ifup" \
+ "${FILESDIR}/qemu-ifdown" \
+ || die "qemu interface scripts failed"
dodoc pc-bios/README
dodoc qemu-doc.html