openbsd-ports/net/mininet/patches/patch-mininet_moduledeps_py
akoshibe 783f7e4069 Mininet creates a realistic virtual network, running real kernel, switch
and application code, on a single machine (VM, cloud or native), in
seconds, with a single command

Because you can easily interact with your network using the Mininet CLI
(and API), customize it, share it with others, or deploy it on real
hardware, Mininet is useful for development, teaching, and research.

This port is not connected to the build yet.

OK sthen@ jasper@ phessler@
2017-08-21 18:47:12 +00:00

34 lines
1008 B
Plaintext

$OpenBSD: patch-mininet_moduledeps_py,v 1.1.1.1 2017/08/21 18:47:12 akoshibe Exp $
Pull out mod* commands to mininet/linux, map kld* to mod* to avoid
more changes
Index: mininet/moduledeps.py
--- mininet/moduledeps.py.orig
+++ mininet/moduledeps.py
@@ -2,21 +2,12 @@
from mininet.util import quietRun
from mininet.log import info, error, debug
-from os import environ
+from os import environ, uname
-def lsmod():
- "Return output of lsmod."
- return quietRun( 'lsmod' )
-
-def rmmod( mod ):
- """Return output of lsmod.
- mod: module string"""
- return quietRun( [ 'rmmod', mod ] )
-
-def modprobe( mod ):
- """Return output of modprobe
- mod: module string"""
- return quietRun( [ 'modprobe', mod ] )
+if uname()[ 0 ] == 'FreeBSD':
+ from mininet.freebsd.util import ( lsmod, rmmod, modprobe )
+else:
+ from mininet.linux.util import ( lsmod, rmmod, modprobe )
OF_KMOD = 'ofdatapath'
OVS_KMOD = 'openvswitch_mod' # Renamed 'openvswitch' in OVS 1.7+/Linux 3.5+