-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tcpdump to mx-rdma-tools and rdma-tools Docker images
- Add `install-tcpdump.sh` to build and install tcpdump and libpcap from source. Signed-off-by: lou-lan <[email protected]>
- Loading branch information
Showing
10 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2024 Authors of spidernet-io | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -x | ||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
echo "build libpcap ${ENV_VERSION_LIBCAP}" | ||
echo "build tcpdump ${ENV_VERSION_TCPDUMP}" | ||
|
||
cd /tmp | ||
rm -rf * || true | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends bison make gcc flex xz-utils | ||
|
||
|
||
#!/bin/bash | ||
|
||
# Check if environment variables are defined | ||
if [ -z "${ENV_VERSION_LIBCAP}" ] || [ -z "${ENV_VERSION_TCPDUMP}" ]; then | ||
echo "Environment variables ENV_VERSION_LIBCAP or ENV_VERSION_TCPDUMP are not defined" | ||
exit 1 | ||
fi | ||
|
||
# Download files | ||
wget https://www.tcpdump.org/release/${ENV_VERSION_LIBCAP}.tar.xz || { echo "Failed to download libcap"; exit 1; } | ||
wget https://www.tcpdump.org/release/${ENV_VERSION_TCPDUMP}.tar.xz || { echo "Failed to download tcpdump"; exit 1; } | ||
|
||
|
||
echo "========= File List =========" | ||
ls -lh | ||
|
||
# Check if files exist | ||
if [ ! -f "${ENV_VERSION_LIBCAP}.tar.xz" ] || [ ! -f "${ENV_VERSION_TCPDUMP}.tar.xz" ]; then | ||
echo "Downloaded files do not exist" | ||
exit 1 | ||
fi | ||
|
||
# Extract files | ||
tar -xvf ${ENV_VERSION_LIBCAP}.tar.xz || { echo "Failed to extract libcap"; exit 1; } | ||
tar -xvf ${ENV_VERSION_TCPDUMP}.tar.xz || { echo "Failed to extract tcpdump"; exit 1; } | ||
|
||
cd /tmp/${ENV_VERSION_LIBCAP} | ||
./configure | ||
make && make install | ||
|
||
cd /tmp/${ENV_VERSION_TCPDUMP} | ||
./configure | ||
make && make install | ||
|
||
cd /tmp | ||
rm -rf * || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ packages=( | |
hwloc | ||
libgomp1 | ||
kmod | ||
tcpdump | ||
ethtool | ||
iptables | ||
#-------------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2024 Authors of spidernet-io | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -x | ||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
echo "build libpcap ${ENV_VERSION_LIBCAP}" | ||
echo "build tcpdump ${ENV_VERSION_TCPDUMP}" | ||
|
||
cd /tmp | ||
rm -rf * || true | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends bison make gcc flex xz-utils | ||
|
||
|
||
#!/bin/bash | ||
|
||
# Check if environment variables are defined | ||
if [ -z "${ENV_VERSION_LIBCAP}" ] || [ -z "${ENV_VERSION_TCPDUMP}" ]; then | ||
echo "Environment variables ENV_VERSION_LIBCAP or ENV_VERSION_TCPDUMP are not defined" | ||
exit 1 | ||
fi | ||
|
||
# Download files | ||
wget https://www.tcpdump.org/release/${ENV_VERSION_LIBCAP}.tar.xz || { echo "Failed to download libcap"; exit 1; } | ||
wget https://www.tcpdump.org/release/${ENV_VERSION_TCPDUMP}.tar.xz || { echo "Failed to download tcpdump"; exit 1; } | ||
|
||
|
||
echo "========= File List =========" | ||
ls -lh | ||
|
||
# Check if files exist | ||
if [ ! -f "${ENV_VERSION_LIBCAP}.tar.xz" ] || [ ! -f "${ENV_VERSION_TCPDUMP}.tar.xz" ]; then | ||
echo "Downloaded files do not exist" | ||
exit 1 | ||
fi | ||
|
||
# Extract files | ||
tar -xvf ${ENV_VERSION_LIBCAP}.tar.xz || { echo "Failed to extract libcap"; exit 1; } | ||
tar -xvf ${ENV_VERSION_TCPDUMP}.tar.xz || { echo "Failed to extract tcpdump"; exit 1; } | ||
|
||
cd /tmp/${ENV_VERSION_LIBCAP} | ||
./configure | ||
make && make install | ||
|
||
cd /tmp/${ENV_VERSION_TCPDUMP} | ||
./configure | ||
make && make install | ||
|
||
cd /tmp | ||
rm -rf * || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,6 @@ packages=( | |
hwloc | ||
libgomp1 | ||
kmod | ||
tcpdump | ||
ethtool | ||
iptables | ||
#-------------- | ||
|