|
2 | 2 |
|
3 | 3 | # PhreakScript
|
4 | 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.0 (2024-11-03) |
| 5 | +# v1.2.1 (2024-12-30) |
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 | +# 2024-12-30 1.2.1 DAHDI Linux: Work around compilation failure for newer kernels |
16 | 17 | # 2024-11-03 1.2.0 Asterisk: Install Asterisk 22 by default
|
17 | 18 | # 2024-10-16 1.1.8 wanpipe: Installation procedure improvements
|
18 | 19 | # 2024-09-19 1.1.7 DAHDI: Slipstream critical build fixes, fix build issues on various distros and kernels
|
@@ -1951,6 +1952,40 @@ install_dahdi() {
|
1951 | 1952 |
|
1952 | 1953 | # if KSRC/KVERS env vars are set, they will automatically propagate to children
|
1953 | 1954 | $AST_MAKE -j$(nproc) $DAHDI_CFLAGS
|
| 1955 | + if [ $? -ne 0 ]; then |
| 1956 | + if [ -f drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o_shipped ]; then |
| 1957 | + # If this is PHREAKSCRIPT-61, apply temporary workaround for newer kernels failing with: |
| 1958 | + # No rule to make target 'vpmadt032_loader/vpmadt032_x86_64.o', needed by 'dahdi_vpmadt032_loader.o'. |
| 1959 | + # |
| 1960 | + # On newer kernels, there seems to be some kind of issue (not sure with what, exactly) |
| 1961 | + # where vpmadt032_x86_64.o doesn't exist. On older kernels, it's generated by a COPY: |
| 1962 | + # COPY /usr/src/dahdi-linux-3.4.0/drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o |
| 1963 | + # |
| 1964 | + # This is likely an issue somewhere in the DAHDI Linux build system, possibly drivers/dahdi/Kbuild... |
| 1965 | + # But until this issue is fixed, just manually copy the file at this point so compilation can continue. |
| 1966 | + ARCH=$( uname -m ) |
| 1967 | + # This logic is from drivers/dahdi/Kbuild |
| 1968 | + if [ "$ARCH" = "i386" ]; then |
| 1969 | + MY_DAHDI_ARCH=x86_32 |
| 1970 | + else |
| 1971 | + if [ "$ARCH" = "x86_64" ]; then |
| 1972 | + MY_DAHDI_ARCH=x86_64 |
| 1973 | + else |
| 1974 | + grep "CONFIG_X86_32=y" /boot/config-$(uname -r) |
| 1975 | + if [ $? -eq 0 ]; then |
| 1976 | + MY_DAHDI_ARCH=x86_32 |
| 1977 | + else |
| 1978 | + MY_DAHDI_ARCH=x86_64 |
| 1979 | + fi |
| 1980 | + fi |
| 1981 | + fi |
| 1982 | + printf "Detected DAHDI_ARCH: '%s'\n" "$MY_DAHDI_ARCH" |
| 1983 | + echoerr "Manually performing COPY for 'vpmadt032_${MY_DAHDI_ARCH}.o'" |
| 1984 | + printf "COPY %s %s\n" drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH}.o_shipped drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH}.o |
| 1985 | + cp -n drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH}.o_shipped drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH}.o |
| 1986 | + fi |
| 1987 | + $AST_MAKE -j$(nproc) $DAHDI_CFLAGS |
| 1988 | + fi |
1954 | 1989 | if [ $? -ne 0 ]; then
|
1955 | 1990 | die "DAHDI Linux compilation failed, aborting install"
|
1956 | 1991 | fi
|
@@ -3095,6 +3130,9 @@ elif [ "$cmd" = "make" ]; then
|
3095 | 3130 | # phreaknet install
|
3096 | 3131 |
|
3097 | 3132 | assert_root
|
| 3133 | + if [ "$FILE_PATH" = "/usr/local/sbin/phreaknet" ]; then |
| 3134 | + die "PhreakScript is already installed, to reinstall, execute 'make' using the new script, e.g. ./phreaknet.sh make" |
| 3135 | + fi |
3098 | 3136 | ln -nsf $FILE_PATH /usr/local/sbin/phreaknet
|
3099 | 3137 | if [ $? -eq 0 ]; then
|
3100 | 3138 | echo "PhreakScript added to path."
|
|
0 commit comments