Skip to content

Commit e8aabef

Browse files
authored
install: Add flag to auto-set KVERS. (#56)
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.
1 parent cee2b4c commit e8aabef

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
- name: Build DAHDI and Asterisk
189189
run: |
190190
./phreaknet.sh make
191-
KVERS="6.13.0-0.rc2" phreaknet install --fast --dahdi --drivers --devmode
191+
phreaknet install --fast --dahdi --autokvers --drivers --devmode
192192
alma-9-5:
193193
runs-on: ubuntu-24.04
194194
name: Alma Linux 9.5
@@ -198,7 +198,7 @@ jobs:
198198
- name: Build DAHDI and Asterisk
199199
run: |
200200
./phreaknet.sh make
201-
KVERS="5.14.0-503.15.1" phreaknet install --fast --dahdi --drivers --devmode
201+
phreaknet install --fast --dahdi --autokvers --drivers --devmode
202202
rocky-9:
203203
runs-on: ubuntu-24.04
204204
name: Rocky Linux 9.3
@@ -208,7 +208,7 @@ jobs:
208208
- name: Build DAHDI and Asterisk
209209
run: |
210210
./phreaknet.sh make
211-
KVERS="5.14.0-503.16.1" phreaknet install --fast --dahdi --drivers --devmode
211+
phreaknet install --fast --dahdi --autokvers --drivers --devmode
212212
rocky-8:
213213
runs-on: ubuntu-24.04
214214
name: Rocky Linux 8.9
@@ -218,7 +218,7 @@ jobs:
218218
- name: Build DAHDI and Asterisk
219219
run: |
220220
./phreaknet.sh make
221-
KVERS="4.18.0-553.32.1" phreaknet install --fast --dahdi --drivers --devmode
221+
phreaknet install --fast --dahdi --autokvers --drivers --devmode
222222
opensuse:
223223
runs-on: ubuntu-24.04
224224
name: openSUSE Tumbleweed

phreaknet.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ The following options may be used with the **install** command.
291291
**--drivers**
292292
: Also install DAHDI drivers removed in 2018 by Sangoma
293293

294+
**--generic**
295+
: Use generic kernel headers that do not match the installed kernel version
296+
297+
**--autokvers**
298+
: Automatically pass the appropriate value for KVERS for DAHDI compilation (only needed on non-Debian systems)
299+
294300
**--experimental**
295301
: Install experimental features that may not be production ready
296302

phreaknet.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ SCRIPT_UPSTREAM="$PATCH_DIR/phreaknet.sh"
265265
DEBUG_LEVEL=0
266266
FREEPBX_GUI=0
267267
GENERIC_HEADERS=0
268+
AUTOSET_KVERS=0
268269
EXTERNAL_CODECS=0
269270
RTPULSING=1
270271
HEARPULSING=1
@@ -580,6 +581,7 @@ Options:
580581
--sccp install: Install chan_sccp channel driver (Cisco Skinny)
581582
--drivers install: Also install DAHDI drivers removed in 2018
582583
--generic install: Use generic kernel headers that do not match the installed kernel version
584+
--autokvers install: Automatically pass the appropriate value for KVERS for DAHDI compilation (only needed on non-Debian systems)
583585
--extcodecs install: Specify this if any external codecs are being or will be installed
584586
--freepbx install: Install FreePBX GUI (not recommended)
585587
--manselect install: Manually run menuselect yourself
@@ -1692,6 +1694,10 @@ install_dahdi() {
16921694
fi
16931695
if [ "$KERNEL_DEVEL_VERSION" != "$kernel_ver" ]; then
16941696
echoerr "kernel-devel mismatch still present? ($KERNEL_DEVEL_VERSION != $kernel_ver)"
1697+
if [ "$AUTOSET_KVERS" = "1" ]; then
1698+
printf "Auto-setting KVERS=%s\n" "$KERNEL_DEVEL_VERSION"
1699+
KVERS="$KERNEL_DEVEL_VERSION"
1700+
fi
16951701
if [ "$KVERS" != "" ]; then
16961702
# Kernel version override for GitHub CI builds, where the available headers on Fedora-based distros
16971703
# do not match the running kernel. This probably would not run successfully, but in this case,
@@ -2896,7 +2902,7 @@ else
28962902
fi
28972903

28982904
FLAG_TEST=0
2899-
PARSED_ARGUMENTS=$(getopt -n phreaknet -o bc:u:dfhostu:v:w -l backtraces,cc:,dahdi,force,flag-test,help,sip,testsuite,user:,version:,weaktls,alsa,cisco,sccp,clli:,debug:,devmode,disa:,drivers,experimental,extcodecs,fast,freepbx,generic,lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- "$@")
2905+
PARSED_ARGUMENTS=$(getopt -n phreaknet -o bc:u:dfhostu:v:w -l backtraces,cc:,dahdi,force,flag-test,help,sip,testsuite,user:,version:,weaktls,alsa,cisco,sccp,clli:,debug:,devmode,disa:,drivers,experimental,extcodecs,fast,freepbx,generic,autokvers,lightweight,api-key:,rotate,audit,boilerplate,upstream:,manselect,minimal,vanilla,wanpipe -- "$@")
29002906
VALID_ARGUMENTS=$?
29012907
if [ "$VALID_ARGUMENTS" != "0" ]; then
29022908
usage
@@ -2941,6 +2947,7 @@ while true; do
29412947
--fast ) FAST_COMPILE=1; shift ;;
29422948
--freepbx ) FREEPBX_GUI=1; shift ;;
29432949
--generic ) GENERIC_HEADERS=1; shift ;;
2950+
--autokvers ) AUTOSET_KVERS=1; shift ;;
29442951
--lightweight ) LIGHTWEIGHT=1; shift ;;
29452952
--api-key ) INTERLINKED_APIKEY=$2; shift 2;;
29462953
--rotate ) ASTKEYGEN=1; shift ;;

0 commit comments

Comments
 (0)