From 7e2ae40cbde87a23faf5abb24cd9bad11c77b613 Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Sun, 10 Apr 2022 01:03:55 -0400 Subject: [PATCH] Update Mininet patch for 2022 apr (#464) * Update the patch applied when installing Mininet * Additional changes intended to be part of previous commit * Specify a particular recent commit of Mininet to use --- vm-ubuntu-20.04/Vagrantfile | 3 +- ...ininet-dont-install-python2-2022-apr.patch | 36 +++++++++++++++++++ vm-ubuntu-20.04/user-common-bootstrap.sh | 4 ++- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 vm-ubuntu-20.04/patches/mininet-dont-install-python2-2022-apr.patch diff --git a/vm-ubuntu-20.04/Vagrantfile b/vm-ubuntu-20.04/Vagrantfile index 33e9efd..8e34f66 100644 --- a/vm-ubuntu-20.04/Vagrantfile +++ b/vm-ubuntu-20.04/Vagrantfile @@ -18,7 +18,7 @@ Vagrant.configure(2) do |config| dev.vm.provision "shell", inline: "chmod 755 /home/vagrant/py3localpath.py" dev.vm.provision "file", source: "patches/disable-Wno-error-and-other-small-changes.diff", destination: "/home/vagrant/patches/disable-Wno-error-and-other-small-changes.diff" dev.vm.provision "file", source: "patches/behavioral-model-use-correct-libssl-pkg.patch", destination: "/home/vagrant/patches/behavioral-model-use-correct-libssl-pkg.patch" - dev.vm.provision "file", source: "patches/mininet-dont-install-python2.patch", destination: "/home/vagrant/patches/mininet-dont-install-python2.patch" + dev.vm.provision "file", source: "patches/mininet-dont-install-python2-2022-apr.patch", destination: "/home/vagrant/patches/mininet-dont-install-python2-2022-apr.patch" dev.vm.provision "file", source: "clean.sh", destination: "/home/vagrant/clean.sh" dev.vm.provision "shell", inline: "chmod 755 /home/vagrant/clean.sh" dev.vm.provision "shell", path: "root-dev-bootstrap.sh" @@ -31,6 +31,7 @@ Vagrant.configure(2) do |config| release.vm.provider "virtualbox" do |v| v.name = "P4 Tutorial Release" + Time.now.strftime(" %Y-%m-%d") end + release.vm.provision "file", source: "patches/mininet-dont-install-python2-2022-apr.patch", destination: "/home/vagrant/patches/mininet-dont-install-python2-2022-apr.patch" release.vm.provision "shell", path: "root-release-bootstrap.sh" release.vm.provision "shell", path: "root-common-bootstrap.sh" release.vm.provision "shell", privileged: false, path: "user-common-bootstrap.sh" diff --git a/vm-ubuntu-20.04/patches/mininet-dont-install-python2-2022-apr.patch b/vm-ubuntu-20.04/patches/mininet-dont-install-python2-2022-apr.patch new file mode 100644 index 0000000..422424d --- /dev/null +++ b/vm-ubuntu-20.04/patches/mininet-dont-install-python2-2022-apr.patch @@ -0,0 +1,36 @@ +diff --git a/util/install.sh b/util/install.sh +index fd584b8..5886199 100755 +--- a/util/install.sh ++++ b/util/install.sh +@@ -5,6 +5,7 @@ + + # Fail on error + set -e ++set -x + + # Fail on unset var usage + set -o nounset +@@ -175,9 +176,9 @@ function mn_deps { + else # Debian/Ubuntu + pf=pyflakes + pep8=pep8 +- # Starting around 20.04, installing pyflakes instead of pyflakes3 ++ # Starting around 18.04, installing pyflakes instead of pyflakes3 + # causes Python 2 to be installed, which is exactly NOT what we want. +- if [ "$DIST" = "Ubuntu" -a `expr $RELEASE '>=' 20.04` = "1" ]; then ++ if [ "$DIST" = "Ubuntu" -a `expr $RELEASE '>=' 18.04` = "1" ]; then + pf=pyflakes3 + fi + # Debian 11 "bullseye" renamed +@@ -189,9 +190,10 @@ function mn_deps { + fi + + $install gcc make socat psmisc xterm ssh iperf telnet \ +- ethtool help2man $pf pylint $pep8 \ ++ ethtool help2man pylint3 \ + net-tools \ + ${PYPKG}-pexpect ${PYPKG}-tk ++ $install --no-install-recommends $pf $pep8 + # Install pip + $install ${PYPKG}-pip || $install ${PYPKG}-pip-whl + if ! ${PYTHON} -m pip -V; then diff --git a/vm-ubuntu-20.04/user-common-bootstrap.sh b/vm-ubuntu-20.04/user-common-bootstrap.sh index c347bba..8656df9 100755 --- a/vm-ubuntu-20.04/user-common-bootstrap.sh +++ b/vm-ubuntu-20.04/user-common-bootstrap.sh @@ -4,10 +4,12 @@ set -xe # --- Mininet --- # +MININET_COMMIT="aa0176fce6fb718a03474f8719261b07b670d30d" # 2022-Apr-02 git clone https://github.com/mininet/mininet mininet cd mininet +git checkout ${MININET_COMMIT} PATCH_DIR="${HOME}/patches" -patch -p1 < "${PATCH_DIR}/mininet-dont-install-python2.patch" || echo "Errors while attempting to patch mininet, but continuing anyway ..." +patch -p1 < "${PATCH_DIR}/mininet-dont-install-python2-2022-apr.patch" || echo "Errors while attempting to patch mininet, but continuing anyway ..." cd .. # TBD: Try without installing openvswitch, i.e. no '-v' option, to see # if everything still works well without it.