Skip to content

Commit 2e6e503

Browse files
committed
install: Target Asterisk 22.2.0.
1 parent d460a51 commit 2e6e503

File tree

2 files changed

+35
-29
lines changed

2 files changed

+35
-29
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, dev ]
66
pull_request:
77
branches: [ master ]
88
# Retest weekly to ensure nothing has broken

phreaknet.sh

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

33
# PhreakScript
4-
# (C) 2021-2024 Naveen Albert, PhreakNet, and others - https://github.com/InterLinked1/phreakscript ; https://portal.phreaknet.org ; https://docs.phreaknet.org
5-
# v1.2.1 (2024-12-30)
4+
# (C) 2021-2025 Naveen Albert, PhreakNet, and others - https://github.com/InterLinked1/phreakscript ; https://portal.phreaknet.org ; https://docs.phreaknet.org
5+
# v1.2.2 (2025-01-24)
66

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

1515
## Begin Change Log:
16+
# 2025-01-24 1.2.2 Asterisk: Target 22.2.0
1617
# 2024-12-30 1.2.1 DAHDI Linux: Work around compilation failure for newer kernels
1718
# 2024-11-03 1.2.0 Asterisk: Install Asterisk 22 by default
1819
# 2024-10-16 1.1.8 wanpipe: Installation procedure improvements
@@ -1493,24 +1494,26 @@ github_pr() {
14931494

14941495
# $2 = 1 to force
14951496
asterisk_pr() {
1496-
wget -q "https://patch-diff.githubusercontent.com/raw/asterisk/asterisk/pull/$1.diff" -O /tmp/$1.pr.diff --no-cache
1497+
PR_PATCH_FILE=/tmp/$1.pr.diff
1498+
wget -q "https://patch-diff.githubusercontent.com/raw/asterisk/asterisk/pull/$1.diff" -O $PR_PATCH_FILE --no-cache
14971499
if [ $? -ne 0 ]; then
14981500
echoerr "Failed to download https://patch-diff.githubusercontent.com/raw/asterisk/asterisk/pull/$1.diff"
14991501
fi
15001502
if [ "$2" = "1" ]; then
1501-
git apply -v "/tmp/$1.pr.diff"
1503+
git apply -v $PR_PATCH_FILE
15021504
if [ $? -ne 0 ]; then
15031505
echoerr "Failed to apply patch using git apply, retrying directly using patch..."
1504-
patch -p1 -F 3 -f --verbose < "/tmp/$1.pr.diff"
1506+
patch -p1 -F 3 -f --verbose < $PR_PATCH_FILE
15051507
fi
15061508
else
1507-
git apply "/tmp/$1.pr.diff"
1509+
git apply $PR_PATCH_FILE
15081510
fi
15091511
if [ $? -ne 0 ]; then
15101512
echoerr "Failed to apply Asterisk PR... this should be reported..."
1513+
cat $PR_PATCH_FILE
15111514
exit 2
15121515
fi
1513-
rm "/tmp/$1.pr.diff"
1516+
rm $PR_PATCH_FILE
15141517
}
15151518

15161519
git_custom_patch() {
@@ -1888,15 +1891,15 @@ install_dahdi() {
18881891
git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/32.patch" # PR 32: xpp: Fix 32-bit builds
18891892

18901893
# Fix or skip compilation of the XPP driver for 32-bit
1891-
OS_ARCH=$( uname -m )
1892-
printf "Detected architecture: %s\n" "$OS_ARCH"
1893-
if [ "$OS_ARCH" = "armv7l" ]; then
1894+
# OS_ARCH=$( uname -m )
1895+
# printf "Detected architecture: %s\n" "$OS_ARCH"
1896+
#if [ "$OS_ARCH" = "armv7l" ]; then
18941897
# I can't test this build at the moment, so to play it safe, I'm going to keep it disabled in this case,
18951898
# given that the xpp drivers are seldom used and especially unlikely to be used by someone with this architecture.
18961899
# TODO Slightly related, once GitHub allows free arm64 builds, do more testing: https://github.com/orgs/community/discussions/19197
1897-
echoerr "Skipping compilation of XPP driver for this 32-bit architecture! ($OS_ARCH)"
1898-
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
1899-
fi
1900+
#echoerr "Skipping compilation of XPP driver for this 32-bit architecture! ($OS_ARCH)"
1901+
#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
1902+
#fi
19001903

19011904
KERN_VER_MM=$( uname -r | cut -d. -f1-2 )
19021905
OS_DIST_2=$( printf "$OS_DIST_INFO" | cut -d' ' -f1-2)
@@ -2355,17 +2358,18 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR
23552358
asterisk_pr_if 961 220200 210700 201200 182700 # config.c: fix template inheritance/overrides
23562359
asterisk_pr_if 994 220200 210700 201200 182700 # FGD regression fix
23572360
asterisk_pr_if 245 220200 210700 201200 182700 # config.c: fix template inheritance/overrides
2361+
asterisk_pr_if 971 220200 210700 201200 182700 # config.c fix issues w/ whitespace in comments
23582362
asterisk_pr_if 414 220200 210700 201200 182700 # IAX2 loopback warning
23592363
asterisk_pr_if 1030 220200 210700 201200 182700 # chan_dahdi: Fix wrong channel state when RINGING recieved
2364+
asterisk_pr_if 1055 220200 210700 201200 182700 # chan_iax2: Avoid unnecessarily backlogging frames
2365+
#asterisk_pr_if 918 220200 210700 201200 182700 # config.c #tryinclude fixes. Temporarily disabled since patch fails to apply: main/config.c:2750
2366+
#asterisk_pr_if 438 220200 210700 201200 182700 # Last Number Redial. This now conflicts with 272, so temp. disabled.
23602367

23612368
## Unmerged patches: remove or switch to asterisk_pr_if once merged
2362-
#asterisk_pr_unconditional 918 # config.c #tryinclude fixes. Temporarily disabled since patch fails to apply: main/config.c:2750
2363-
asterisk_pr_unconditional 971 # config.c fix issues w/ whitespace in comments
2364-
asterisk_pr_unconditional 1055 # chan_iax2: Avoid unnecessarily backlogging frames
2365-
2369+
asterisk_pr_unconditional 1086 # Fix for Fedora 42 (old style definitions for libdb)
2370+
asterisk_pr_unconditional 1089 # app_sms: Ignore false positive gcc warning
23662371
#asterisk_pr_unconditional 272 # Call Waiting Deluxe. This also now conflicts (with the latest revisions), so temp. disabled.
2367-
#asterisk_pr_unconditional 438 # Last Number Redial. This now conflicts with 272, so temp. disabled.
2368-
asterisk_pr_unconditional 292 # GROUP VARs
2372+
#asterisk_pr_unconditional 292 # GROUP VARs # Disabled temporarily as patch does not apply anymore
23692373
git_custom_patch "https://code.phreaknet.org/asterisk/dahdicleanup.diff"
23702374

23712375
if [ $AST_MAJOR_VER -lt 21 ]; then
@@ -3405,15 +3409,17 @@ elif [ "$cmd" = "install" ]; then
34053409
fi
34063410

34073411
if [ $? -ne 0 ]; then
3408-
$AST_MAKE NOISY_BUILD=1 # show actual compilation command that failed
3409-
if [ ! -f channels/chan_dahdi.o ]; then
3410-
echoerr "Compilation of chan_dahdi failed?"
3411-
ls -la /usr/include/dahdi
3412-
# Debug failed chan_dahdi compilation
3413-
# chan_dahdi.c:7677:18: error: unused variable 'x' [-Werror=unused-variable]
3414-
# 7677 | int res, x;
3415-
sed -n 7677,7800p channels/chan_dahdi.c
3416-
fi
3412+
gcc -v
3413+
$AST_MAKE # Finish compiling antyhing that would build successfully, from the parallel build, so the noisy build only builds the offending target
3414+
$AST_MAKE NOISY_BUILD=1 # show actual compilation command that failed, with no parallelism
3415+
#if [ ! -f channels/chan_dahdi.o ]; then
3416+
# echoerr "Compilation of chan_dahdi failed?" # Only suggest this if we got around to compiling some channel drivers to begin with
3417+
# ls -la /usr/include/dahdi
3418+
# # Debug failed chan_dahdi compilation
3419+
# # chan_dahdi.c:7677:18: error: unused variable 'x' [-Werror=unused-variable]
3420+
# # 7677 | int res, x;
3421+
# sed -n 7677,7800p channels/chan_dahdi.c
3422+
#fi
34173423
if [ "$DEVMODE" = "1" ] && [ -f doc/core-en_US.xml ]; then # run just make validate-docs for doc validation
34183424
$XMLSTARLET val -d doc/appdocsxml.dtd -e doc/core-en_US.xml # by default, it doesn't tell you whether the docs failed to validate. So if validation failed, print that out.
34193425
fi

0 commit comments

Comments
 (0)