From 037f7f59218507d4397e9211265f3c3d02128a7a Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 27 May 2018 10:35:32 +0900 Subject: [PATCH 1/2] Makefile: make it more flexible - let the user choose where to install (via PREFIX) - added targets install-mnexec/install-manpages --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a5ead63..d8c828e 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,9 @@ PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN) MNEXEC = mnexec MANPAGES = mn.1 mnexec.1 P8IGN = E251,E201,E302,E202,E126,E127,E203,E226 -BINDIR = /usr/bin -MANDIR = /usr/share/man/man1 +PREFIX ?= /usr +BINDIR ?= $(PREFIX)/bin +MANDIR ?= $(PREFIX)/share/man/man1 DOCDIRS = doc/html doc/latex PDF = doc/latex/refman.pdf @@ -46,9 +47,13 @@ slowtest: $(MININET) mnexec: mnexec.c $(MN) mininet/net.py cc $(CFLAGS) $(LDFLAGS) -DVERSION=\"`PYTHONPATH=. $(PYMN) --version`\" $< -o $@ -install: $(MNEXEC) $(MANPAGES) - install $(MNEXEC) $(BINDIR) - install $(MANPAGES) $(MANDIR) +install-mnexec: $(MNEXEC) + install -D $(MNEXEC) $(BINDIR)/$(MNEXEC) + +install-manpages: $(MANPAGES) + install -D -t $(MANDIR) $(MANPAGES) + +install: install-mnexec install-manpages python setup.py install develop: $(MNEXEC) $(MANPAGES) From 8a00c3abf8d694ef4d6c2a60565c0260eff8d588 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sun, 27 May 2018 10:37:57 +0900 Subject: [PATCH 2/2] bash: run with --noediting Having "set editing-mode vi" in ~/.inputrc can output characters that may induce mininet into (wrongly) thinking a process has failed. --- mininet/node.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index 704c798..42b3780 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -135,7 +135,9 @@ class Node( object ): # -s: pass $* to shell, and make process easy to find in ps # prompt is set to sentinel chr( 127 ) cmd = [ 'mnexec', opts, 'env', 'PS1=' + chr( 127 ), - 'bash', '--norc', '-is', 'mininet:' + self.name ] + 'bash', '--norc', '--noediting', + '-is', 'mininet:' + self.name ] + # Spawn a shell subprocess in a pseudo-tty, to disable buffering # in the subprocess and insulate it from signals (e.g. SIGINT) # received by the parent