|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | 3 | # 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-23) |
6 | 6 |
|
7 | 7 | # Setup (as root): |
8 | 8 | # cd /usr/local/src |
|
13 | 13 | # phreaknet install |
14 | 14 |
|
15 | 15 | ## Begin Change Log: |
| 16 | +# 2025-01-23 1.2.2 Asterisk: Target 22.2.0 |
16 | 17 | # 2024-12-30 1.2.1 DAHDI Linux: Work around compilation failure for newer kernels |
17 | 18 | # 2024-11-03 1.2.0 Asterisk: Install Asterisk 22 by default |
18 | 19 | # 2024-10-16 1.1.8 wanpipe: Installation procedure improvements |
@@ -1493,24 +1494,26 @@ github_pr() { |
1493 | 1494 |
|
1494 | 1495 | # $2 = 1 to force |
1495 | 1496 | 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 |
1497 | 1499 | if [ $? -ne 0 ]; then |
1498 | 1500 | echoerr "Failed to download https://patch-diff.githubusercontent.com/raw/asterisk/asterisk/pull/$1.diff" |
1499 | 1501 | fi |
1500 | 1502 | if [ "$2" = "1" ]; then |
1501 | | - git apply -v "/tmp/$1.pr.diff" |
| 1503 | + git apply -v $PR_PATCH_FILE |
1502 | 1504 | if [ $? -ne 0 ]; then |
1503 | 1505 | 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 |
1505 | 1507 | fi |
1506 | 1508 | else |
1507 | | - git apply "/tmp/$1.pr.diff" |
| 1509 | + git apply $PR_PATCH_FILE |
1508 | 1510 | fi |
1509 | 1511 | if [ $? -ne 0 ]; then |
1510 | 1512 | echoerr "Failed to apply Asterisk PR... this should be reported..." |
| 1513 | + cat $PR_PATCH_FILE |
1511 | 1514 | exit 2 |
1512 | 1515 | fi |
1513 | | - rm "/tmp/$1.pr.diff" |
| 1516 | + rm $PR_PATCH_FILE |
1514 | 1517 | } |
1515 | 1518 |
|
1516 | 1519 | git_custom_patch() { |
@@ -1888,15 +1891,15 @@ install_dahdi() { |
1888 | 1891 | git_custom_patch "https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/32.patch" # PR 32: xpp: Fix 32-bit builds |
1889 | 1892 |
|
1890 | 1893 | # 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 |
1894 | 1897 | # I can't test this build at the moment, so to play it safe, I'm going to keep it disabled in this case, |
1895 | 1898 | # given that the xpp drivers are seldom used and especially unlikely to be used by someone with this architecture. |
1896 | 1899 | # 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 |
1900 | 1903 |
|
1901 | 1904 | KERN_VER_MM=$( uname -r | cut -d. -f1-2 ) |
1902 | 1905 | OS_DIST_2=$( printf "$OS_DIST_INFO" | cut -d' ' -f1-2) |
@@ -2355,17 +2358,17 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR |
2355 | 2358 | asterisk_pr_if 961 220200 210700 201200 182700 # config.c: fix template inheritance/overrides |
2356 | 2359 | asterisk_pr_if 994 220200 210700 201200 182700 # FGD regression fix |
2357 | 2360 | 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 |
2358 | 2362 | asterisk_pr_if 414 220200 210700 201200 182700 # IAX2 loopback warning |
2359 | 2363 | 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. |
2360 | 2367 |
|
2361 | 2368 | ## 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) |
2366 | 2370 | #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 |
| 2371 | + #asterisk_pr_unconditional 292 # GROUP VARs # Disabled temporarily as patch does not apply anymore |
2369 | 2372 | git_custom_patch "https://code.phreaknet.org/asterisk/dahdicleanup.diff" |
2370 | 2373 |
|
2371 | 2374 | if [ $AST_MAJOR_VER -lt 21 ]; then |
@@ -3405,6 +3408,7 @@ elif [ "$cmd" = "install" ]; then |
3405 | 3408 | fi |
3406 | 3409 |
|
3407 | 3410 | if [ $? -ne 0 ]; then |
| 3411 | + gcc -v |
3408 | 3412 | $AST_MAKE NOISY_BUILD=1 # show actual compilation command that failed |
3409 | 3413 | if [ ! -f channels/chan_dahdi.o ]; then |
3410 | 3414 | echoerr "Compilation of chan_dahdi failed?" |
|
0 commit comments