@@ -1845,7 +1845,8 @@ install_dahdi() {
1845
1845
sed -n 61,63p $MODFINAL_FILE
1846
1846
sed -n 61,63p $MODFINAL_FILE | grep " CONFIG_DEBUG_INFO_BTF_MODULES"
1847
1847
if [ $? -eq 0 ]; then
1848
- phreak_tree_patch $MODFINAL_FILE " modfinal.diff"
1848
+ # The file only needs to be patched the first time, not on future installs
1849
+ phreak_tree_patch_forward_only $MODFINAL_FILE " modfinal.diff"
1849
1850
sed -n 61,63p $MODFINAL_FILE
1850
1851
else
1851
1852
echoerr " Skipping modfinal patch, expected content differs on line 61"
@@ -1949,6 +1950,9 @@ install_dahdi() {
1949
1950
git_custom_patch " https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/69.diff" # PR 69: DEFINE_SEMAPHORE for RHEL
1950
1951
git_custom_patch " https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/32.patch" # PR 32: xpp: Fix 32-bit builds
1951
1952
1953
+ # Not yet merged
1954
+ git_custom_patch " https://patch-diff.githubusercontent.com/raw/asterisk/dahdi-linux/pull/77.diff"
1955
+
1952
1956
# Fix or skip compilation of the XPP driver for 32-bit
1953
1957
# OS_ARCH=$( uname -m )
1954
1958
# printf "Detected architecture: %s\n" "$OS_ARCH"
@@ -2012,7 +2016,7 @@ install_dahdi() {
2012
2016
fi
2013
2017
2014
2018
# if KSRC/KVERS env vars are set, they will automatically propagate to children
2015
- $AST_MAKE -j $( nproc ) $DAHDI_CFLAGS
2019
+ $AST_MAKE $DAHDI_CFLAGS
2016
2020
if [ $? -ne 0 ]; then
2017
2021
if [ -f drivers/dahdi/vpmadt032_loader/vpmadt032_x86_64.o_shipped ]; then
2018
2022
# If this is PHREAKSCRIPT-61, apply temporary workaround for newer kernels failing with:
@@ -2045,7 +2049,7 @@ install_dahdi() {
2045
2049
printf " COPY %s %s\n" drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH} .o_shipped drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH} .o
2046
2050
cp -n drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH} .o_shipped drivers/dahdi/vpmadt032_loader/vpmadt032_${MY_DAHDI_ARCH} .o
2047
2051
fi
2048
- $AST_MAKE -j $( nproc ) $DAHDI_CFLAGS
2052
+ $AST_MAKE $DAHDI_CFLAGS
2049
2053
fi
2050
2054
if [ $? -ne 0 ]; then
2051
2055
die " DAHDI Linux compilation failed, aborting install"
@@ -2231,6 +2235,17 @@ phreak_tree_patch() { # $1 = patched file, $2 = patch name
2231
2235
rm " /tmp/$2 "
2232
2236
}
2233
2237
2238
+ phreak_tree_patch_forward_only () { # $1 = patched file, $2 = patch name
2239
+ printf " Applying forward patch %s to %s\n" " $2 " " $1 "
2240
+ cp " $GIT_REPO_PATH /patches/$2 " " /tmp/$2 "
2241
+ if [ $? -ne 0 ]; then
2242
+ echoerr " Failed to copy patch: $2 "
2243
+ exit 2
2244
+ fi
2245
+ patch -u -N -b " $1 " -i " /tmp/$2 "
2246
+ rm " /tmp/$2 "
2247
+ }
2248
+
2234
2249
phreak_fuzzy_patch () {
2235
2250
printf " Applying patch %s to %s\n" " $1 " " $1 "
2236
2251
cp " $GIT_REPO_PATH /patches/$1 " " /tmp/$1 "
0 commit comments