Skip to content

install: Verify that dahdi_tool is built. #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions phreaknet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,9 @@ install_prereq() {
PREREQ_PACKAGES=""
RHEL_MAJOR_VERSION_8=0
printf "Installing prerequisites for %s..." "$OS_DIST_INFO"
# libnewt-dev is needed for newt, which dahdi_tool requires. If it's not available, it won't get built.
if [ "$PAC_MAN" = "apt-get" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES git patch gcc pkg-config autoconf automake m4 libtool build-essential"
PREREQ_PACKAGES="$PREREQ_PACKAGES git patch gcc pkg-config autoconf automake m4 libtool build-essential libnewt-dev"
if [ "$1" = "1" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES curl subversion libcurl4-openssl-dev"
if [ "$ENHANCED_INSTALL" = "1" ]; then
Expand All @@ -932,26 +933,26 @@ install_prereq() {
if [ -f /etc/redhat-release ] && [ "$RHEL_MAJOR_VERSION" = "8" ]; then # RHEL or Rocky Linux major version 8
RHEL_MAJOR_VERSION_8=1
fi
PREREQ_PACKAGES="$PREREQ_PACKAGES git patch gcc gcc-c++ pkg-config autoconf automake m4 libtool"
PREREQ_PACKAGES="$PREREQ_PACKAGES git patch gcc gcc-c++ pkg-config autoconf automake m4 libtool newt-devel"
if [ "$1" = "1" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES subversion libuuid-devel libxml2-devel sqlite-devel"
if [ $RHEL_MAJOR_VERSION_8 -eq 0 ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES libedit-devel" # Required on Fedora, may fail initially on Rocky Linux 8.9
fi
fi
elif [ "$PAC_MAN" = "zypper" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk subversion bzip2 gcc-c++"
PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk subversion bzip2 gcc-c++ newt-devel"
if [ "$1" = "1" ]; then
# TODO Some of these should be in Asterisk's install_prereq script
PREREQ_PACKAGES="$PREREQ_PACKAGES libedit-devel libuuid-devel libxml2-devel sqlite3-devel"
fi
elif [ "$PAC_MAN" = "pacman" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES git make patch gcc pkg-config autoconf automake m4 libtool"
PREREQ_PACKAGES="$PREREQ_PACKAGES git make patch gcc pkg-config autoconf automake m4 libtool libnewt"
if [ "$1" = "1" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES subversion libedit"
fi
elif [ "$PAC_MAN" = "pkg" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES git gmake"
PREREQ_PACKAGES="$PREREQ_PACKAGES git gmake newt"
if [ "$1" = "1" ]; then
PREREQ_PACKAGES="$PREREQ_PACKAGES curl subversion e2fsprogs-libuuid sqlite3 xmlstarlet libsysinfo"
if [ "$ENHANCED_INSTALL" = "1" ]; then
Expand Down Expand Up @@ -1876,6 +1877,15 @@ install_dahdi() {
cp tonezone.h /usr/include/dahdi
fi

# Ensure that dahdi_tool is installed, since it's not built if the prereqs weren't available at compile time.
if ! which "dahdi_tool" > /dev/null; then
echoerr "dahdi_tool does not appear to have been built successfully... newt development package missing?"
if [ "$FORCE_INSTALL" != "1" ] && [ "$PAC_MAN" != "pacman" ]; then
# Even though we successfully install the newt dev package on Arch Linux, for some reason this still fails, so don't make it fatal on Arch
exit 1
fi
fi

# All right, here we go...
dahdi_scan -vvvvv
if [ ! -f /etc/dahdi/system.conf ]; then
Expand Down