Skip to content

Conversation

@htravis123
Copy link
Contributor

These commits make three changes to phreaknet.sh:

  1. RPi OS 13 replaced the old "raspberrypi-kernel-headers" package with a more standard "linux-headers-*" package. Since PhreakScript only checked for the old package name, kernel header installation will fail on RPi OS 13+. A check for this (or a newer version) has been added to ensure the correct package is installed (which it usually is out of the box, from what I can tell).
  2. The kbuild directory is still in /usr/lib (unlike openSUSE), but it not uses the full kernel and local version. And like openSUSE, the same kernel Makefile patch fails, as it can't find the kbuild directory. This directory format is now checked for if a major-minor directory cannot be found, and, failing that, a full-version directory in /usr/src.
  3. Related to 2, I discovered the line that gets the kernel version would leave part of the distribution-specific string if there were multiple hyphens. I tweaked this line to make sure that we only get the kernel version and local version string (i.e. the part of the kernel version string that is separated from the version number by a plus), which is what is used for the kbuild directory name.

Added a check for openSUSE Leap in the package manager detector section.
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.
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.
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.
…y code

I forgot a newline in the "no build directory found" message, so I added one.
Because autoconf wasn't installed, the DAHDI tools installation failed, so I added it to the list of packages.
…n 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.
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.
…n) 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant