From 104928bb22ae73ab29d3f7408e528124806de846 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Wed, 12 Nov 2025 19:42:49 -0600 Subject: [PATCH 1/9] Update phreaknet.sh Added a check for openSUSE Leap in the package manager detector section. --- phreaknet.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phreaknet.sh b/phreaknet.sh index b0a408f..e7be1c5 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -328,6 +328,8 @@ elif [ -f /etc/redhat-release ]; then PAC_MAN="yum" elif [ "$OS_DIST_INFO" = "SLES" ]; then PAC_MAN="zypper" +elif [ "$OS_DIST_INFO" = "openSUSE Leap" ]; then + PAC_MAN="zypper" elif [ "$OS_DIST_INFO" = "openSUSE Tumbleweed" ]; then PAC_MAN="zypper" elif [ -r /etc/arch-release ]; then From 4d3182ef0154432dd89f6385fba3d84bb0398cf4 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 18:32:05 -0600 Subject: [PATCH 2/9] install: Add kernel header detection for openSUSE openSUSE uses a different path format for kernel headers that was not checked for by install_kernel_headers(), resulting in an error. This commit adds detection for these paths. --- phreaknet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index 88dc026..26f3243 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -2045,7 +2045,8 @@ install_kernel_headers() { # Check that the kernel sources are really present # /usr/src/linux-headers-* on Debian # /usr/src/kernels on Rocky Linux - numkernheaders=$( ls /usr/src/linux-headers-* /usr/src/kernels/* 2>/dev/null | wc -w ) + # /usr/src/linux-* on openSUSE + numkernheaders=$( ls /usr/src/linux-headers-* /usr/src/kernels/* /usr/src/linux-* 2>/dev/null | wc -w ) if [ "$numkernheaders" = "0" ]; then echoerr "Kernel headers do not appear to be installed... compilation will likely fail" sleep 2 From 5386813665aa9c318f5d64556f53f209bcdda818 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 18:48:34 -0600 Subject: [PATCH 3/9] install: Add missing kernel package for zypper In openSUSE, one of the "kernel-*-devel" packages is required to build kernel modules, otherwise PhreakScript fails to find the kernel build directory. This commit adds the "default" version (a safe assumption, given it's for the standard kernel) of this package to the list of kernel module-related packages that zypper is told to install. --- phreaknet.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index 26f3243..c20084c 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -2005,7 +2005,8 @@ install_kernel_headers() { echog "kernel-devel is matched with kernel. Package provides $KERNEL_DEVEL_VERSION, and running kernel is $kernel_ver" fi elif [ "$PAC_MAN" = "zypper" ]; then - install_package "kmod kernel-source" + # There are multiple kernel-*-devel packages in the openSUSE repos. The default one should be a safe assumption. + install_package "kmod kernel-source kernel-devel kernel-default-devel" elif [ "$PAC_MAN" = "pacman" ]; then install_package "kmod linux-headers" elif [ "$PAC_MAN" = "apk" ]; then From b0b21d0c478e76f48da7cc1637dbcfdfcb9c9fb6 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 19:10:32 -0600 Subject: [PATCH 4/9] install: Check for build directory on openSUSE openSUSE does not place kernel build directories in /usr/lib/linux-kbuild-*. This commit adds a check for /usr/src/linux-*, where it is located, in case the first path doesn't exist. --- phreaknet.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phreaknet.sh b/phreaknet.sh index c20084c..c8df514 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -2215,6 +2215,13 @@ install_dahdi() { KERNEL_MM=$( uname -r | cut -d'.' -f1-2 ) printf "Kernel major.minor version is %s\n" "$KERNEL_MM" KBUILD_DIR="/usr/lib/linux-kbuild-${KERNEL_MM}" + # 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}..." + KBUILD_DIR="/usr/src/linux-${KERNEL_VER}" + fi if [ -d "$KBUILD_DIR" ]; then MODFINAL_FILE="${KBUILD_DIR}/scripts/Makefile.modfinal" if [ -f "$MODFINAL_FILE" ]; then From 5743757424db85c69a52451b1c0e19d996899dc0 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 19:14:12 -0600 Subject: [PATCH 5/9] install: add a missing newline to the previously-added build directory code I forgot a newline in the "no build directory found" message, so I added one. --- phreaknet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index c8df514..0cbfafd 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -2219,7 +2219,7 @@ install_dahdi() { # 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}..." + printf "No build directory found in /usr/lib, checking /usr/src for ${KERNEL_VER}...\n" KBUILD_DIR="/usr/src/linux-${KERNEL_VER}" fi if [ -d "$KBUILD_DIR" ]; then From ae2273edf8f860cb9decba08014eb711adb26190 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 19:33:29 -0600 Subject: [PATCH 6/9] install: zypper: added autoconf Because autoconf wasn't installed, the DAHDI tools installation failed, so I added it to the list of packages. --- phreaknet.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index 0cbfafd..0812cd5 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -1075,7 +1075,7 @@ install_prereq() { fi fi elif [ "$PAC_MAN" = "zypper" ]; then - PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk subversion bzip2 gcc-c++" + PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk autoconf subversion bzip2 gcc-c++" if [ "$CHAN_DAHDI" = "1" ]; then PREREQ_PACKAGES="$PREREQ_PACKAGES newt-devel dwarves" fi From de9d25731af412bbf687f96061ba9e15b0c892f0 Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Mon, 12 Jan 2026 21:53:19 -0600 Subject: [PATCH 7/9] install: add two more zypper packages, add message for zypper users on unsupported modules. After installing libtool and automake, DAHDI finally built sucessfully, so I added them to the prereqs. I also discovered that openSUSE disables the loading of "unsupported" (i.e. external, not signed by SUSE) kernel modules, so I added a message that displays on zypper-based systems that have installed DAHDI that tells the user how to enable loading them, otherwise DAHDI won't work. --- phreaknet.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index 0812cd5..b581a4b 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -1075,7 +1075,7 @@ install_prereq() { fi fi elif [ "$PAC_MAN" = "zypper" ]; then - PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk autoconf subversion bzip2 gcc-c++" + PREREQ_PACKAGES="$PREREQ_PACKAGES git-core make patch gawk autoconf automake libtool subversion bzip2 gcc-c++" if [ "$CHAN_DAHDI" = "1" ]; then PREREQ_PACKAGES="$PREREQ_PACKAGES newt-devel dwarves" fi @@ -4216,6 +4216,10 @@ elif [ "$cmd" = "install" ]; then if [ "$CHAN_DAHDI" = "1" ]; then echog "Note that DAHDI was installed and requires a reboot (or hotswap of kernel modules, e.g. phreaknet restart) before it can be used." echog "Note that you will need to manually configure /etc/dahdi/system.conf appropriately for your spans." + if [ "$PAC_MAN" = "zypper" ]; then + echog "Additionally, since you appear to be using openSUSE/SUSE Linux Enterprise, you will need to enable the loading of unsupported kernel modules." + echog "See https://support.scc.suse.com/s/kb/Enable-loading-of-unsupported-kernel-modules for details on how to do this." + fi fi if [ "$FREEPBX_GUI" = "1" ]; then printf "%s\n" "Installation of FreePBX GUI will begin in 5 seconds..." From 9ae721a57c2810e3cdbb86c0e74edd8adf7f26de Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Thu, 15 Jan 2026 22:12:13 -0600 Subject: [PATCH 8/9] install: fix header install failing on RPi OS/Debian 13+ on RPi The "raspberrypi-kernel-headers" package appears to have been removed with RPi OS 13 "trixie", with kernel headers instead being provided as more traditional "linux-headers-*" packages. This commit adds a check for this condition to ensure the correct package is installed. --- phreaknet.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phreaknet.sh b/phreaknet.sh index a58b06a..dd541b4 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -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` From b106efcf432203d75be885ba54ca986fa833bdaf Mon Sep 17 00:00:00 2001 From: Harley Travis Date: Thu, 15 Jan 2026 22:33:56 -0600 Subject: [PATCH 9/9] install_dahdi: kbuild directory detection for RPi OS (and maybe Debian) 13 RPi OS (and possibly Debian) 13 uses the full kernel version (everything before the first hyphen, and including the local version string) for the kbuild directories, which are still in /usr/lib. This commit adds a check for this directory format, and also corrects the line that gets the kernel version to exclude everything after the kernel/local version. --- phreaknet.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/phreaknet.sh b/phreaknet.sh index dd541b4..8c7101c 100755 --- a/phreaknet.sh +++ b/phreaknet.sh @@ -2226,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"