Skip to content

Commit cb51037

Browse files
committed
DAHDI Linux: Don't fail if kbuild Makefile can't be patched.
On certain systems, this fails, and it's not required for a successful installation, so patch if applicable but skip otherwise. PHREAKSCRIPT-60 #close
1 parent 157d8d3 commit cb51037

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

phreaknet.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,14 +1703,24 @@ install_dahdi() {
17031703
# https://github.com/aircrack-ng/rtl8188eus/issues/263#issuecomment-1715699688
17041704
# Fixed by commenting out lines 61-63
17051705
KERNEL_MM=$( uname -r | cut -d'.' -f1-2 )
1706+
printf "Kernel major.minor version is %s\n" "$KERNEL_MM"
17061707
KBUILD_DIR="/usr/lib/linux-kbuild-${KERNEL_MM}"
1707-
MODFINAL_FILE="${KBUILD_DIR}/scripts/Makefile.modfinal"
1708-
if [ -f "$MODFINAL_FILE" ]; then
1709-
sed -n 61,63p $MODFINAL_FILE
1710-
phreak_tree_patch $MODFINAL_FILE "modfinal.diff"
1711-
sed -n 61,63p $MODFINAL_FILE
1708+
if [ -d "$KBUILD_DIR" ]; then
1709+
MODFINAL_FILE="${KBUILD_DIR}/scripts/Makefile.modfinal"
1710+
if [ -f "$MODFINAL_FILE" ]; then
1711+
sed -n 61,63p $MODFINAL_FILE
1712+
sed -n 61,63p $MODFINAL_FILE | grep "CONFIG_DEBUG_INFO_BTF_MODULES"
1713+
if [ $? -eq 0 ]; then
1714+
phreak_tree_patch $MODFINAL_FILE "modfinal.diff"
1715+
sed -n 61,63p $MODFINAL_FILE
1716+
else
1717+
echoerr "Skipping modfinal patch, expected content differs on line 61"
1718+
fi
1719+
else
1720+
echoerr "Could not determine path to Makefile.modfinal"
1721+
fi
17121722
else
1713-
echoerr "Could not determine path to Makefile.modfinal"
1723+
echoerr "Could not determine path to kbuild dir"
17141724
fi
17151725

17161726
# Requests to downloads.digium.com usually use IPv4, but sometimes use IPv6

0 commit comments

Comments
 (0)