Skip to content

Commit

Permalink
install: Add flag to auto-set KVERS.
Browse files Browse the repository at this point in the history
For a little while, we've been manually setting KVERS in the
CI definitions (main.yml) in order to successfully build
against the provided kernel in the CI. However, the version
updates over time, so this breaks frequently. Since we just
want to match the version actually available, add a flag to
automatically set KVERS to the available kernel header version,
and just use that instead.
  • Loading branch information
InterLinked1 committed Dec 17, 2024
1 parent cee2b4c commit 3b9b4a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
- name: Build DAHDI and Asterisk
run: |
./phreaknet.sh make
KVERS="6.13.0-0.rc2" phreaknet install --fast --dahdi --drivers --devmode
phreaknet install --fast --dahdi --autokvers --drivers --devmode
alma-9-5:
runs-on: ubuntu-24.04
name: Alma Linux 9.5
Expand All @@ -198,7 +198,7 @@ jobs:
- name: Build DAHDI and Asterisk
run: |
./phreaknet.sh make
KVERS="5.14.0-503.15.1" phreaknet install --fast --dahdi --drivers --devmode
phreaknet install --fast --dahdi --autokvers --drivers --devmode
rocky-9:
runs-on: ubuntu-24.04
name: Rocky Linux 9.3
Expand All @@ -208,7 +208,7 @@ jobs:
- name: Build DAHDI and Asterisk
run: |
./phreaknet.sh make
KVERS="5.14.0-503.16.1" phreaknet install --fast --dahdi --drivers --devmode
phreaknet install --fast --dahdi --autokvers --drivers --devmode
rocky-8:
runs-on: ubuntu-24.04
name: Rocky Linux 8.9
Expand All @@ -218,7 +218,7 @@ jobs:
- name: Build DAHDI and Asterisk
run: |
./phreaknet.sh make
KVERS="4.18.0-553.32.1" phreaknet install --fast --dahdi --drivers --devmode
phreaknet install --fast --dahdi --autokvers --drivers --devmode
opensuse:
runs-on: ubuntu-24.04
name: openSUSE Tumbleweed
Expand Down
6 changes: 6 additions & 0 deletions phreaknet.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ The following options may be used with the **install** command.
**--drivers**
: Also install DAHDI drivers removed in 2018 by Sangoma

**--generic**
: Use generic kernel headers that do not match the installed kernel version

**--autokvers**
: Automatically pass the appropriate value for KVERS for DAHDI compilation (only needed on non-Debian systems)

**--experimental**
: Install experimental features that may not be production ready

Expand Down
7 changes: 7 additions & 0 deletions phreaknet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ SCRIPT_UPSTREAM="$PATCH_DIR/phreaknet.sh"
DEBUG_LEVEL=0
FREEPBX_GUI=0
GENERIC_HEADERS=0
AUTOSET_KVERS=0
EXTERNAL_CODECS=0
RTPULSING=1
HEARPULSING=1
Expand Down Expand Up @@ -580,6 +581,7 @@ Options:
--sccp install: Install chan_sccp channel driver (Cisco Skinny)
--drivers install: Also install DAHDI drivers removed in 2018
--generic install: Use generic kernel headers that do not match the installed kernel version
--autokvers install: Automatically pass the appropriate value for KVERS for DAHDI compilation (only needed on non-Debian systems)
--extcodecs install: Specify this if any external codecs are being or will be installed
--freepbx install: Install FreePBX GUI (not recommended)
--manselect install: Manually run menuselect yourself
Expand Down Expand Up @@ -1692,6 +1694,10 @@ install_dahdi() {
fi
if [ "$KERNEL_DEVEL_VERSION" != "$kernel_ver" ]; then
echoerr "kernel-devel mismatch still present? ($KERNEL_DEVEL_VERSION != $kernel_ver)"
if [ "$AUTOSET_KVERS" = "1" ]; then
printf "Auto-setting KVERS=%s\n" "$KERNEL_DEVEL_VERSION"
KVERS="$KERNEL_DEVEL_VERSION"
fi
if [ "$KVERS" != "" ]; then
# Kernel version override for GitHub CI builds, where the available headers on Fedora-based distros
# do not match the running kernel. This probably would not run successfully, but in this case,
Expand Down Expand Up @@ -2941,6 +2947,7 @@ while true; do
--fast ) FAST_COMPILE=1; shift ;;
--freepbx ) FREEPBX_GUI=1; shift ;;
--generic ) GENERIC_HEADERS=1; shift ;;
--autokvers ) AUTOSET_KVERS=1; shift ;;
--lightweight ) LIGHTWEIGHT=1; shift ;;
--api-key ) INTERLINKED_APIKEY=$2; shift 2;;
--rotate ) ASTKEYGEN=1; shift ;;
Expand Down

0 comments on commit 3b9b4a4

Please sign in to comment.