Skip to content

Commit 87338a0

Browse files
committed
DAHDI: Re-enable XPP drivers in 32-bit builds.
The XPP drivers were disabled from buildings on ~all 32-bit architectures in 91b66b3, as a temporary workaround to build failures with that architecture. Apply an unmerged patch for 32-bit to fix the compilation issue so that these drivers can be built in most (and possibly all?) cases on 32-bit systems. The driver is patched and available again on i386/i686 architectures (so 32-bit x86 systems). The XPP driver was initially disabled for 32-bit ARM in commit 6cedcea, and for now I am leaving it disabled in that case since I don't have a way to test that at the moment. If this can be tested, this exception can be removed.
1 parent a0a742c commit 87338a0

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

phreaknet.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# PhreakScript
44
# (C) 2021-2024 Naveen Albert, PhreakNet, and others - https://github.com/InterLinked1/phreakscript ; https://portal.phreaknet.org ; https://docs.phreaknet.org
5-
# v1.1.5 (2024-09-15)
5+
# v1.1.6 (2024-09-16)
66

77
# Setup (as root):
88
# cd /usr/local/src
@@ -13,6 +13,7 @@
1313
# phreaknet install
1414

1515
## Begin Change Log:
16+
# 2024-09-16 1.1.6 DAHDI: Add patch to enable building of XPP drivers on 32-bit architectures
1617
# 2024-09-15 1.1.5 DAHDI: Massive overhaul to DAHDI stop/start/restart logic, fixes for manual span assignment
1718
# 2024-09-11 1.1.4 DAHDI: Target DAHDI 3.4.0, update patches
1819
# 2024-03-17 1.1.3 DAHDI: Only build wanpipe if requested
@@ -1552,9 +1553,20 @@ install_dahdi() {
15521553
echoerr "Skipping DAHDI Linux feature patches..."
15531554
fi
15541555

1555-
# Don't compile the XPP driver for 32-bit
1556-
if [ "`uname -m`" = "armv7l" ] || [ "`uname -m`" = "i386" ] || [ "`uname -m`" = "i686" ]; then
1557-
echoerr "Not compiling XPP driver for 32-bit"
1556+
# Fix or skip compilation of the XPP driver for 32-bit
1557+
OS_ARCH=$( uname -m )
1558+
printf "Detected architecture: %s\n" "$OS_ARCH"
1559+
if [ "$OS_ARCH" = "i386" ] || [ "$OS_ARCH" = "i686" ]; then
1560+
printf "32-bit OS detected... patching division in XPP drivers\n"
1561+
# This fixes this issue:
1562+
# ERROR: modpost: "__divdi3" [/usr/src/dahdi-linux-3.4.0/drivers/dahdi/xpp/xpp.ko] undefined!
1563+
# ERROR: modpost: "__divmoddi4" [/usr/src/dahdi-linux-3.4.0/drivers/dahdi/xpp/xpp.ko] undefined!
1564+
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/32.patch" # PR 32, not yet merged
1565+
elif [ "$OS_ARCH" = "armv7l" ]; then
1566+
# I can't test this build at the moment, so to play it safe, I'm going to keep it disabled in this case,
1567+
# given that the xpp drivers are seldom used and especially unlikely to be used by someone with this architecture.
1568+
# TODO Slightly related, once GitHub allows free arm64 builds, do more testing: https://github.com/orgs/community/discussions/19197
1569+
echoerr "Skipping compilation of XPP driver for this 32-bit architecture! ($OS_ARCH)"
15581570
mv $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR/drivers/dahdi/xpp/Kbuild $AST_SOURCE_PARENT_DIR/$DAHDI_LIN_SRC_DIR/drivers/dahdi/xpp/Bad-Kbuild
15591571
fi
15601572

0 commit comments

Comments
 (0)