Skip to content

Commit 6643669

Browse files
committed
DAHDI: Clean up old/dead patches, minor cosmetic improvements.
* Remove patch support for DAHDI Linux < 3.3.0 * Removed out-of-tree patches that are merged upstream or on GitHub * Remove dead/unused code and patches. There are some patches that are not currently used, but they are not quite "dead" as they are not merged upstream and need further investigation. * Don't try starting wanrouter service if the service isn't installed. * Don't use \n in echoerr, since that only works with printf, not echo.
1 parent 6c82101 commit 6643669

6 files changed

+9
-107
lines changed

patches/6112308.diff

-26
This file was deleted.

patches/dahdi_cfg.diff

-11
This file was deleted.

patches/dahdi_kern_61.diff

-13
This file was deleted.

patches/dahdi_pci.diff

-13
This file was deleted.

patches/dahdi_tools_inline_get_ver.diff

-11
This file was deleted.

phreaknet.sh

+9-33
Original file line numberDiff line numberDiff line change
@@ -650,17 +650,17 @@ ast_kill() {
650650
start_wanpipe() {
651651
if which wanrouter > /dev/null; then
652652
printf "Starting wanpipe\n"
653-
service wanrouter start
653+
service wanrouter start 2>&1 > /dev/null
654654
if [ $? -ne 0 ]; then
655-
wanrouter start
655+
wanrouter start # If the wanrouter service isn't installed, start manually
656656
fi
657657
wanrouter status
658658
fi
659659
}
660660

661661
stop_wanpipe() {
662662
if which wanrouter > /dev/null; then
663-
service wanrouter status
663+
service wanrouter status 2>&1 > /dev/null # The service may not be installed, but wanrouter may be running nonetheless
664664
if [ $? -eq 0 ]; then
665665
printf "Stopping wanpipe spans\n"
666666
if ! wanrouter stop all; then # stop all T1 spans on wanpipe
@@ -779,7 +779,8 @@ start_telephony() {
779779
printf "Starting driver: %s... " "$driver"
780780
modprobe --first-time $driver
781781
if [ $? -ne 0 ]; then
782-
echoerr "\nFailed to start driver $driver"
782+
# If modprobe fails, it will print an error ending in a newline, no need to add one here
783+
echoerr "Failed to start driver $driver"
783784
else
784785
printf "started!\n"
785786
fi
@@ -803,7 +804,8 @@ start_telephony() {
803804
printf "Automatically assigning spans, ignoring /etc/dahdi/assigned-spans.conf\n"
804805
num_spans=$( dahdi_span_assignments list | wc -l )
805806
if [ $num_spans -gt 1 ]; then
806-
echoerr "Detected that this machine has more than 1 DAHDI span.\nYou are HIGHLY ENCOURAGED to assign the span order explicitly in /etc/dahdi/assigned-spans.conf!"
807+
echoerr "Detected that this machine has more than 1 DAHDI span."
808+
echoerr "You are HIGHLY ENCOURAGED to assign the span order explicitly in /etc/dahdi/assigned-spans.conf!"
807809
echoerr "To do this, add 'options dahdi auto_assign_spans=0' to /etc/modprobe.d/dahdi.conf and run 'phreaknet restart'"
808810
sleep 1
809811
fi
@@ -1945,18 +1947,6 @@ install_dahdi() {
19451947
dahdi_unpurge $DAHDI_LIN_SRC_DIR # for some reason, this needs to be applied before the next branch patches
19461948
fi
19471949

1948-
# Compiler fixes for 5.17/5.18:
1949-
if [ $DAHDI_MM_VER -lt 33 ]; then
1950-
phreak_fuzzy_patch "dahdi_pci.diff"
1951-
custom_fuzzy_patch "b6d9b417e1992868549d443efad11e4f1513c9d7.diff" "https://gitea.osmocom.org/retronetworking/dahdi-linux/commit/b6d9b417e1992868549d443efad11e4f1513c9d7.diff"
1952-
custom_fuzzy_patch "09adb59cfe2aff9fc1c18cafb44ae0faf811adca.diff" "https://gitea.osmocom.org/retronetworking/dahdi-linux/commit/09adb59cfe2aff9fc1c18cafb44ae0faf811adca.diff"
1953-
# Compiler fixes for newer kernels (5.15, 5.17, 5.18)
1954-
#git_custom_patch "https://github.com/osmocom/dahdi-linux/commit/09adb59cfe2aff9fc1c18cafb44ae0faf811adca.diff"
1955-
1956-
# Compiler fixes for 6.1+
1957-
phreak_fuzzy_patch "dahdi_kern_61.diff"
1958-
fi
1959-
19601950
# Merged in master, but not yet in a current release
19611951
git_custom_patch "https://github.com/asterisk/dahdi-linux/commit/d7bbc8a96fe767bc4eee15dd43170f298282a4c3.diff" # RHEL fixes for const struct device *dev
19621952
git_custom_patch "https://github.com/asterisk/dahdi-linux/commit/d932d9fbc8b3559829a76fffcedceb78d1fc1887.diff" # dahdi_spantype fix
@@ -1973,17 +1963,6 @@ install_dahdi() {
19731963
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/77.diff" # EXTRA_CFLAGS removal
19741964
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/79.diff" # vpmadt032 binary blob
19751965

1976-
# Fix or skip compilation of the XPP driver for 32-bit
1977-
# OS_ARCH=$( uname -m )
1978-
# printf "Detected architecture: %s\n" "$OS_ARCH"
1979-
#if [ "$OS_ARCH" = "armv7l" ]; then
1980-
# I can't test this build at the moment, so to play it safe, I'm going to keep it disabled in this case,
1981-
# given that the xpp drivers are seldom used and especially unlikely to be used by someone with this architecture.
1982-
# TODO Slightly related, once GitHub allows free arm64 builds, do more testing: https://github.com/orgs/community/discussions/19197
1983-
#echoerr "Skipping compilation of XPP driver for this 32-bit architecture! ($OS_ARCH)"
1984-
#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
1985-
#fi
1986-
19871966
KERN_VER_MM=$( uname -r | cut -d. -f1-2 )
19881967
OS_DIST_2=$( printf "$OS_DIST_INFO" | cut -d' ' -f1-2)
19891968
if [ "$KERN_VER_MM" = "4.18" ] && [ "$OS_DIST_2" = "Rocky Linux" ]; then
@@ -2049,14 +2028,11 @@ install_dahdi() {
20492028
fi
20502029
cd $AST_SOURCE_PARENT_DIR/$DAHDI_TOOLS_SRC_DIR
20512030

2052-
# New Features
2053-
2054-
# fix static inline function get_ver (GitHub dahdi-tools #11)
2055-
phreak_fuzzy_patch "dahdi_tools_inline_get_ver.diff"
2056-
20572031
# Not yet merged
2032+
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-tools/pull/23.diff" # PR 23 (xpp/echo_loader.c: static get_ver)
20582033
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-tools/pull/22.diff" # PR 22 (dahdi_cfg: fix truncation warning)
20592034

2035+
# New Features
20602036
# hearpulsing
20612037
if [ "$EXTRA_FEATURES" = "1" ]; then
20622038
if [ "$HEARPULSING" = "1" ]; then

0 commit comments

Comments
 (0)