install: fix git error and support Ubuntu 22.04

refs #5204

Change-Id: Ic6e2ce789746a18cdb8b97e5a4e8175a89ad2e8d
This commit is contained in:
Junxiao Shi authored and Saurab Dulal committed 2022-08-01 14:53:33 -07:00
1 parent 63a330d317
commit 1e720875d2
4 files changed
+43 -13

No files matched your search

+1
View File
@@ -7,6 +7,7 @@ Prerequisites
Mini-NDN is tested on the following Linux distributions: Mini-NDN is tested on the following Linux distributions:
- Ubuntu 20.04 (recommended) - Ubuntu 20.04 (recommended)
- Ubuntu 22.04
- Debian 11 (WiFi scenario does not work) - Debian 11 (WiFi scenario does not work)
- Fedora 33 (WiFi scenario does not work) - Fedora 33 (WiFi scenario does not work)
+27 -6
View File
@@ -1,6 +1,6 @@
# -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -*- 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, # Arizona Board of Regents,
# Regents of the University of California. # Regents of the University of California.
# #
@@ -21,7 +21,7 @@
# along with Mini-NDN, e.g., in COPYING.md file. # along with Mini-NDN, e.g., in COPYING.md file.
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# 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 export PYTHON=python3
# DEP_INFO key should match *_VERSION variable name. # 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 $SUDO cp /usr/local/bin/mn /usr/local/bin/mn.mininet
} }
build_MNWIFI() { 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 # issue: util/install.sh attempts to patch hostap every time, causing "Assume -R?" prompt
# during reinstalls # 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 clean -fdx || true
$SUDO git -C hostap checkout -- . || true $SUDO git -C hostap checkout -- . || true
# issue: util/install.sh is not using 'sudo' where needed # issue: util/install.sh is not setting noninteractive mode for apt-get
# solution: run whole script in 'sudo' # workaround: temporarily disable needrestart
$SUDO env PYTHON="$PYTHON" ./util/install.sh -Wl 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 # issue: setup.py reports "Cannot load backend 'TkAgg' which requires the 'tk' interactive
# framework, as 'headless' is currently running" when running over SSH # framework, as 'headless' is currently running" when running over SSH
@@ -95,6 +108,14 @@ build_MNWIFI() {
if [[ -x /usr/local/bin/mn.mininet ]]; then if [[ -x /usr/local/bin/mn.mininet ]]; then
$SUDO cp /usr/local/bin/mn.mininet /usr/local/bin/mn $SUDO cp /usr/local/bin/mn.mininet /usr/local/bin/mn
fi 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 # Waf configure options
+2 -2
View File
@@ -1,6 +1,6 @@
# -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -*- 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, # Arizona Board of Regents,
# Regents of the University of California. # Regents of the University of California.
# #
@@ -45,7 +45,7 @@ install_pkgs() {
} }
prepare_ld() { 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' echo 'Enabling /usr/local/lib64 in dynamic linker'
$SUDO mkdir -p /etc/ld.so.conf.d $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 echo /usr/local/lib64 | $SUDO tee /etc/ld.so.conf.d/usr-local-lib64.conf >/dev/null
+13 -5
View File
@@ -1,6 +1,6 @@
# -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # -*- 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, # Arizona Board of Regents,
# Regents of the University of California. # Regents of the University of California.
# #
@@ -30,8 +30,16 @@ fi
source "$PKGDEPDIR/debian-like.sh" source "$PKGDEPDIR/debian-like.sh"
APT_PKGS+=( if [[ $VERSION_ID == '20.04' ]]; then
libigraph0-dev 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