pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/qemu Install example procedure that shows ho...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b2936a6308d6
branches:  trunk
changeset: 500018:b2936a6308d6
user:      hubertf <hubertf%pkgsrc.org@localhost>
date:      Sat Oct 01 04:12:32 2005 +0000

description:
Install example procedure that shows how to setup and network
several qemu nodes with the host's local ethernet using tap(4).

diffstat:

 emulators/qemu/Makefile                        |   7 ++-
 emulators/qemu/PLIST                           |   3 +-
 emulators/qemu/files/Makefile.multinode-NetBSD |  59 ++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 2 deletions(-)

diffs (104 lines):

diff -r 8752f5a46b17 -r b2936a6308d6 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile   Sat Oct 01 02:38:51 2005 +0000
+++ b/emulators/qemu/Makefile   Sat Oct 01 04:12:32 2005 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.17 2005/09/04 23:06:33 xtraeme Exp $
+# $NetBSD: Makefile,v 1.18 2005/10/01 04:12:32 hubertf Exp $
 #
 
 DISTNAME=              qemu-0.7.2
+PKGREVISION=           1
 CATEGORIES=            emulators
 MASTER_SITES=          http://fabrice.bellard.free.fr/qemu/
 
@@ -30,6 +31,10 @@
 # to build in the SSE code.
 BUILDLINK_TRANSFORM+=  rm-optarg:-march rm-optarg:-mcpu
 
+post-install:
+       ${INSTALL_DATA} ${FILESDIR}/Makefile.multinode-NetBSD \
+               ${PREFIX}/share/doc/qemu
+
 .include "../../devel/SDL/buildlink3.mk"
 .include "../../mk/ossaudio.buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
diff -r 8752f5a46b17 -r b2936a6308d6 emulators/qemu/PLIST
--- a/emulators/qemu/PLIST      Sat Oct 01 02:38:51 2005 +0000
+++ b/emulators/qemu/PLIST      Sat Oct 01 04:12:32 2005 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2005/07/29 16:38:15 xtraeme Exp $
+@comment $NetBSD: PLIST,v 1.5 2005/10/01 04:12:32 hubertf Exp $
 bin/qemu
 bin/qemu-img
 bin/qemu-system-mips
@@ -9,6 +9,7 @@
 man/man1/qemu.1
 share/doc/qemu/qemu-doc.html
 share/doc/qemu/qemu-tech.html
+share/doc/qemu/Makefile.multinode-NetBSD
 share/qemu/bios.bin
 share/qemu/keymaps/ar
 share/qemu/keymaps/common
diff -r 8752f5a46b17 -r b2936a6308d6 emulators/qemu/files/Makefile.multinode-NetBSD
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/qemu/files/Makefile.multinode-NetBSD    Sat Oct 01 04:12:32 2005 +0000
@@ -0,0 +1,59 @@
+# $Id: Makefile.multinode-NetBSD,v 1.1 2005/10/01 04:12:32 hubertf Exp $
+# Source: http://mail-index.netbsd.org/netbsd-help/2005/03/25/0005.html
+#
+# Starts up two qemu instances and networks bridges them to the local
+# ethernet (ETHER_IF}.  Works best with NetBSD configured to use serial
+# consoles in DISK[12]
+#
+# Usage:
+#      sudo make netbsd1
+#      sudo make netbsd2
+#
+#  - Hubert Feyrer <hubert%feyrer.de@localhost>
+#
+
+#NETBSD_NOGFX=
+NETBSD_NOGFX=          -nographic
+
+ETHER_IF=      tlp0
+QEMU_RAM=      20
+DISK1=         harddisk.netbsd1
+DISK2=         harddisk.netbsd2
+
+
+all: netbsd1 netbsd2
+
+netbsd1: bridge 
+       ifconfig tap1 create up      || echo tap1: already there
+       brconfig bridge0 add tap1 up || echo tap1: already on bridge0
+       brconfig bridge0 -learn tap1 # real hub mode, step 1b
+       brconfig bridge0 flush  # real hub more, step 2
+       qemu \  
+               -m ${QEMU_RAM} \
+               ${NETBSD_NOGFX} \
+               -boot c \
+               -tun-fd 3 3<>/dev/tap1 \
+               -macaddr de:ad:be:ef:00:01 \
+               ${DISK1}
+       brconfig bridge0 delete tap1 
+       ifconfig tap1 destroy
+
+netbsd2: bridge
+       ifconfig tap2 create up      || echo tap2: already there
+       brconfig bridge0 add tap2 up || echo tap2: already on bridge0
+       brconfig bridge0 -learn tap2 # real hub mode, step 1c
+       brconfig bridge0 flush       # real hub mode, step 2
+       qemu \
+               -m ${QEMU_RAM} \
+               ${NETBSD_NOGFX} \
+               -boot c \
+               -tun-fd 3 3<>/dev/tap2 \
+               -macaddr de:ad:be:ef:00:02 \
+               ${DISK2}
+       brconfig bridge0 delete tap2
+       ifconfig tap2 destroy
+       
+bridge:
+       ifconfig bridge0 create   || echo bridge0: already there
+       brconfig bridge0 add ${ETHER_IF} || echo bridge0: ${ETHER_IF} already there
+       brconfig bridge0 -learn ${ETHER_IF} # real hub mode, step 1a



Home | Main Index | Thread Index | Old Index