LiqXanMod hybrid kernel: CI fixes for XanMod 6.19 compatibility - #1
Merged
Conversation
Merges XanMod (throughput) and Liquorix/Zen (low-latency) patch sets
into a single kernel image with runtime workload autodetection.
Key components:
- build.sh: unified build driver supporting hybrid/xanmod/liquorix/auto modes
- kernel/liqxanmod_autodetect.c: in-kernel kthread that samples RQ depth,
wakeup rate, and IRQ rate every 100ms and switches the active CFS tunable
set (throughput/balanced/latency) after 500ms of stable classification
- patches/hybrid/: three glue patches resolving XanMod<->Zen symbol conflicts
and exposing scheduler tunables via /sys/kernel/liqxanmod/
- configs/features/{xanmod,liquorix,hybrid}.config: layered Kconfig fragments
with hybrid.config resolving the preemption model conflict
- profiles/: desktop, gaming, server, rt, rog, arm64 named build profiles
- packaging/: distro installers for debian, arch, fedora, opensuse, gentoo, generic
- scripts/: patch fetcher, applier (with 3-way merge fallback), autodetect injector
- .github/workflows/: CI matrix across modes x distros x branches
Co-authored-by: Ona <no-reply@ona.com>
- profiles/*.sh: add SC2034 disable directive — vars are intentionally set without local use since they are sourced by build.sh - build.sh: replace A && B || C pattern with explicit if/else to fix SC2015 (C may run when A is true) Co-authored-by: Ona <no-reply@ona.com>
- SC2221/SC2222: reorder *archlinux*|*arch* so the more specific pattern comes first and is not shadowed - SC2237: replace '! [[ -n VAR ]]' with '[[ -z VAR ]]' Co-authored-by: Ona <no-reply@ona.com>
SC1091 (cannot follow sourced paths), SC2012 (ls in glob for kernel package filenames), and SC2016 (literal $ in Makefile heredoc) are info-level false positives that do not represent real bugs. Use -S warning so only genuine warnings and errors fail the build. Co-authored-by: Ona <no-reply@ona.com>
Liquorix publishes tags only, not GitHub Releases. The releases API returns an empty array, causing fallback to the stale 6.12.1-1 version. Switch to the tags API and update the fallback to 6.19-6.
grep exits 1 when no lines match; under set -e this killed the script when the Liquorix release has no lqx/ patch series (e.g. 6.19-6 only has zen/ patches). Refactor into a stage_patches helper that captures grep output safely.
XanMod already incorporates the zen patches, so applying them again produces "already applied" hunks. patch --merge treated these as conflicts and left markers in the tree. Switch to patch --forward which exits 0 for already-applied hunks; only fail on genuine rejects (.rej files).
Liquorix zen patches are named v{KVER}-lqx{N}.patch where KVER is the
stable point release they target. XanMod already tracks that stable
version, so the patch is a no-op and conflicts everywhere. Detect this
case by comparing the patch filename version against the tree version
and skip rather than fail.
merge_config.sh runs from kernel/src/ so relative paths like configs/base/x86-64-v2.config resolve against the wrong directory. Capture REPO_ROOT before cd and prefix all fragment paths.
patch --forward creates .rej files for reversed/already-applied hunks even when it exits non-zero. Using -newer patch_path was unreliable because the cached patch file is old. Use a mktemp sentinel created immediately before each patch attempt so only rejects from that specific attempt are detected. Also clean up .rej files on skip to avoid false positives in subsequent patches.
Fetching the latest Liquorix tag regardless of kernel version causes patch failures when building against older XanMod branches (e.g. 6.18 RT). Accept an optional KERNEL_MAJOR argument and return the latest Liquorix tag for that major, falling back to overall latest.
Move Resolve Liquorix version step after Fetch XanMod source so the kernel major (e.g. 6.18) is available. Pass it to resolve-lqx-version.sh so the correct Liquorix patch series is fetched for the branch.
XanMod always tracks stable, so the Liquorix zen patch (a stable backport, e.g. v6.18.16-lqx1.patch) will always conflict with an XanMod tree at the same series (e.g. 6.18.19). Match on major.minor rather than exact version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all CI failures on the
feature/liqxanmod-hybridbranch. All 5 build matrix jobs (debian/hybrid, debian/liquorix, debian/xanmod, arch/hybrid, fedora/hybrid) now pass.Changes
scripts/resolve-lqx-version.sh6.12.1-1versionKERNEL_MAJORargument (e.g.6.18) and return the latest Liquorix tag for that series, falling back to overall latest if no match6.12.1-1to6.19-6scripts/fetch-lqx-patches.shstage_patcheshelper to safely handlegrepexit-1 when a patch series has no entries for a given prefix (e.g.6.19-6has nolqx/patches)scripts/apply-patches.shv6.18.16-lqx1.patch) will always conflict with an XanMod tree at the same seriesmktempsentinel file to detect.rejfiles created by each specific patch attempt, replacing the unreliable-newer patch_fileapproach (cached patch files are old, causing false negatives).rejfiles after non-fatal skips to avoid false positives in subsequent patchespatches/hybrid/CONFIG_LIQXANMOD_HYBRIDfromkernel/sched/Kconfig(removed in 6.19) toinit/Kconfigafter the Scheduler features menuliqxanmod_sysfs.cfor the XanMod 6.19 scheduler API — replaces removedsysctl_sched_latency/sched_nr_latency/sysctl_sched_min_granularitywithsysctl_sched_base_slice; update Makefile hunk context to match restructuredkernel/sched/Makefilesched_nr_latencyno longer exists in XanMod 6.19.github/workflows/build.ymlResolve Liquorix versionstep afterFetch XanMod sourceso the kernel major is available; pass it toresolve-lqx-version.shREPO_ROOT) for config fragments in the merge step —merge_config.shruns fromkernel/src/so relative paths resolved against the wrong directorykernel/fetch.sh6.19, LTS6.12, RT6.18-rtNotes
The Liquorix zen patch is always skipped when building against XanMod because XanMod already incorporates the stable commits that the zen patch backports. The hybrid scheduler profile switching works via
sysctl_sched_base_sliceinliqxanmod_sysfs.crather than the Liquorix zen patch directly.