diff --git a/docs/install.rst b/docs/install.rst index 1697699..cd66d68 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -7,6 +7,7 @@ Prerequisites Mini-NDN is tested on the following Linux distributions: - Ubuntu 20.04 (recommended) +- Ubuntu 22.04 - Debian 11 (WiFi scenario does not work) - Fedora 33 (WiFi scenario does not work) diff --git a/util/pkgdep/common.sh b/util/pkgdep/common.sh index 9105fa2..60749ef 100644 --- a/util/pkgdep/common.sh +++ b/util/pkgdep/common.sh @@ -1,6 +1,6 @@ # -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -# Copyright (C) 2015-2021, The University of Memphis, +# Copyright (C) 2015-2022, The University of Memphis, # Arizona Board of Regents, # Regents of the University of California. # @@ -21,7 +21,7 @@ # along with Mini-NDN, e.g., in COPYING.md file. # If not, see . -# needed by Python version detection logic in Mininet & Mininet-WiFi install script +# needed by Python version detection logic in Mininet install script export PYTHON=python3 # DEP_INFO key should match *_VERSION variable name. @@ -75,15 +75,28 @@ build_MININET() { $SUDO cp /usr/local/bin/mn /usr/local/bin/mn.mininet } build_MNWIFI() { + # issue: git repository is not owned by root, causing "unsafe repository" error + # workaround: chown the git repository to root + $SUDO chown -R 0:0 . + # issue: util/install.sh attempts to patch hostap every time, causing "Assume -R?" prompt # during reinstalls - # workaround: revert hostap repository to clean state + # workaround: revert hostap submodule to clean state $SUDO git -C hostap clean -fdx || true $SUDO git -C hostap checkout -- . || true - # issue: util/install.sh is not using 'sudo' where needed - # solution: run whole script in 'sudo' - $SUDO env PYTHON="$PYTHON" ./util/install.sh -Wl + # issue: util/install.sh is not setting noninteractive mode for apt-get + # workaround: temporarily disable needrestart + if [[ -d /etc/needrestart/conf.d ]]; then + $SUDO tee /etc/needrestart/conf.d/99-disabled-by-minindn.conf > /dev/null <<'EOT' +$nrconf{restart} = 'l'; +$nrconf{kernelhints} = 0; +EOT + fi + + # issue: util/install.sh is not using 'sudo' where needed such as 'make install' + # workaround: run whole script in 'sudo' + $SUDO env PYTHON=$PYTHON ./util/install.sh -Wl # issue: setup.py reports "Cannot load backend 'TkAgg' which requires the 'tk' interactive # framework, as 'headless' is currently running" when running over SSH @@ -95,6 +108,14 @@ build_MNWIFI() { if [[ -x /usr/local/bin/mn.mininet ]]; then $SUDO cp /usr/local/bin/mn.mininet /usr/local/bin/mn fi + + # chown the git repository to current user, so that user can modify code without root + if [[ $(id -u) -ne 0 ]]; then + $SUDO chown -R $(id -u):$(id -g) . + fi + + # re-enable needrestart + $SUDO rm -f /etc/needrestart/conf.d/99-disabled-by-minindn.conf } # Waf configure options diff --git a/util/pkgdep/fedora.sh b/util/pkgdep/fedora.sh index b48dac2..a6876e8 100644 --- a/util/pkgdep/fedora.sh +++ b/util/pkgdep/fedora.sh @@ -1,6 +1,6 @@ # -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -# Copyright (C) 2015-2021, The University of Memphis, +# Copyright (C) 2015-2022, The University of Memphis, # Arizona Board of Regents, # Regents of the University of California. # @@ -45,7 +45,7 @@ install_pkgs() { } prepare_ld() { - if ! $SUDO ldconfig -v 2>/dev/null | grep -q /usr/local/lib64; then + if ! $SUDO ldconfig -v 2>/dev/null | grep -q /usr/local/lib64; then echo 'Enabling /usr/local/lib64 in dynamic linker' $SUDO mkdir -p /etc/ld.so.conf.d echo /usr/local/lib64 | $SUDO tee /etc/ld.so.conf.d/usr-local-lib64.conf >/dev/null diff --git a/util/pkgdep/ubuntu.sh b/util/pkgdep/ubuntu.sh index 91abc29..456ce40 100644 --- a/util/pkgdep/ubuntu.sh +++ b/util/pkgdep/ubuntu.sh @@ -1,6 +1,6 @@ # -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -# Copyright (C) 2015-2021, The University of Memphis, +# Copyright (C) 2015-2022, The University of Memphis, # Arizona Board of Regents, # Regents of the University of California. # @@ -30,8 +30,16 @@ fi source "$PKGDEPDIR/debian-like.sh" -APT_PKGS+=( - libigraph0-dev -) +if [[ $VERSION_ID == '20.04' ]]; then + APT_PKGS+=( + libigraph0-dev + ) +else + APT_PKGS+=( + libigraph-dev + ) +fi -PPA_AVAIL=1 +if [[ $VERSION_ID == '20.04' ]] || [[ $VERSION_ID == '21.10' ]]; then + PPA_AVAIL=1 +fi