Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions phreaknet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,14 @@ linux_headers_install_apt() {
if [ $? -ne 0 ]; then
apt-get install -y linux-headers-`uname -r`
else
apt-get install -y raspberrypi-kernel-headers
# raspberrypi-kernel-headers isn't used on Raspberry Pi OS 13+, instead it uses a more normal linux-headers-* package.
# If we are on Debian 13 or later, we will install that package instead.
DEB_VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"')
if [ $DEB_VERSION -ge 13 ]; then
apt-get install -y linux-headers-`uname -r`
else
apt-get install -y raspberrypi-kernel-headers
fi
fi
if [ $? -ne 0 ]; then
kernel=`uname -r`
Expand Down Expand Up @@ -2219,9 +2226,15 @@ install_dahdi() {
# Check if this directory exists, otherwise try looking in /usr/src
# This is for openSUSE compatibility
if [ ! -d "$KBUILD_DIR" ]; then
KERNEL_VER=$( uname -r | cut -d'-' -f1-2)
printf "No build directory found in /usr/lib, checking /usr/src for ${KERNEL_VER}...\n"
KBUILD_DIR="/usr/src/linux-${KERNEL_VER}"
# RPi OS/Debian 13 use the full kernel version string for their kbuild directory,
# So we'll check for that first before checking /usr/src.
KERNEL_VER=$( uname -r | cut -d'-' -f1-1)
printf "No /usr/lib/linux-kbuild-major.minor dir, checking for dir with full kernel version (${KERNEL_VER})...\n"
KBUILD_DIR="/usr/lib/linux-kbuild-${KERNEL_VER}"
if [ ! -d "$KBUILD_DIR" ]; then
printf "No build directory found in /usr/lib, checking /usr/src for ${KERNEL_VER}...\n"
KBUILD_DIR="/usr/src/linux-${KERNEL_VER}"
fi
fi
if [ -d "$KBUILD_DIR" ]; then
MODFINAL_FILE="${KBUILD_DIR}/scripts/Makefile.modfinal"
Expand Down