Skip to content

Unify kernel flavors in one PKGBUILD - #944

Open
ventureoo wants to merge 19 commits into
masterfrom
ventureoo-unify-pkgbuild
Open

ventureoo wants to merge 19 commits into
masterfrom
ventureoo-unify-pkgbuild

Conversation

@ventureoo

@ventureoo ventureoo commented Jul 23, 2026

Copy link
Copy Markdown
Member

Based on #941 changes, but with less drastic changes in PKGBUILD structure.

Closes #750
Closes #894

@ventureoo
ventureoo requested review from 1Naim, ptr1337 and sirlucjan July 23, 2026 17:54
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from 1ca0588 to 915689b Compare July 23, 2026 18:15

@1Naim 1Naim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered doing profiles/flavors as well, but thought that would be restrictive if someone wants to build a custom kernel. I see that you added $_flavor but still kept the rest of the build options.

While this does solve the problem of having too many PKGBUILDs, I worry about the number of variables in the PKGBUILD. (although if u think about it, $_features just moves that into a string instead of a variable).

Aside from that, I don't have much problems with this. I'm fine with it if this gets merged instead of #941.

P.S. on moving rt to $_preempt, somehow that didn't come to mind. it seems fitting though. should probably go there regardless of any of these unification series(es?) gets merged.

Comment thread linux-cachyos/PKGBUILD Outdated
Comment thread linux-cachyos/PKGBUILD Outdated
Comment thread linux-cachyos/PKGBUILD Outdated
@ventureoo ventureoo changed the title [RFC} Unify kernel flavors in one PKGBUILD [RFC] Unify kernel flavors in one PKGBUILD Jul 24, 2026
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from d0cfe52 to 51b3f91 Compare July 24, 2026 09:30
@ventureoo
ventureoo requested a review from 1Naim July 24, 2026 09:31
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from 51b3f91 to 1ae7d7f Compare July 24, 2026 09:35
@ventureoo ventureoo changed the title [RFC] Unify kernel flavors in one PKGBUILD Unify kernel flavors in one PKGBUILD Jul 24, 2026
@ventureoo
ventureoo marked this pull request as ready for review July 24, 2026 09:43

@sirlucjan sirlucjan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, thanks.

@ptr1337

ptr1337 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Didnt review yet fully, but the only problem I do see would be if I want not build a specific variant, e.g deckify/hardened whatsoever.

But likely I would just edit the script then.

@ventureoo

Copy link
Copy Markdown
Member Author

Didnt review yet fully, but the only problem I do see would be if I want not build a specific variant, e.g deckify/hardened whatsoever.

In this case you just need to select cachyos flavor, which is used by default. It doesn't override any build options, so you can customize your build with environment variables as before.

@1Naim

1Naim commented Jul 24, 2026

Copy link
Copy Markdown
Member

In this case you just need to select cachyos flavor, which is used by default.

it'll be a little bit of a problem if you want to build some customized handheld kernel with a different cpusched, since it currently overrides it to BORE.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates multiple kernel “flavor” packages into a single linux-cachyos/PKGBUILD that is parameterized via a _flavor preset, and removes the now-redundant per-flavor PKGBUILD directories. It also updates local build helper scripts and the GitHub Actions workflow to build the new unified variants.

Changes:

  • Unifies previously separate kernel flavor PKGBUILDs (bore/bmq/eevdf/server/deckify/rt-bore) into linux-cachyos/PKGBUILD using a new _flavor preset mechanism and _package_suffix.
  • Updates packaging logic to use the appropriate strip tool (llvm-strip vs strip) during module signing and header packaging.
  • Refactors docker-based build scripts and tweaks CI build invocation.

Reviewed changes

Copilot reviewed 18 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
script.sh Refactors docker build helper; now builds removed flavors via env-driven presets.
script-znver4.sh Same as script.sh, but for the znver4 build image.
script-v3-v4.sh Refactors v3/v4 build orchestration into helper functions for GCC vs LLVM LTO runs.
linux-cachyos/PKGBUILD Introduces _flavor presets, unified pkgdesc generation, and uses llvm-strip for LLVM builds during packaging.
linux-cachyos-server/PKGBUILD Removes standalone server flavor PKGBUILD (now handled by _flavor).
linux-cachyos-server/.SRCINFO Removes standalone server flavor metadata.
linux-cachyos-rt-bore/PKGBUILD Removes standalone rt-bore flavor PKGBUILD (now handled by _flavor).
linux-cachyos-rt-bore/.SRCINFO Removes standalone rt-bore flavor metadata.
linux-cachyos-rc/PKGBUILD Adds maintainer entry.
linux-cachyos-eevdf/PKGBUILD Removes standalone eevdf flavor PKGBUILD (now handled by _flavor).
linux-cachyos-eevdf/.SRCINFO Removes standalone eevdf flavor metadata.
linux-cachyos-deckify/PKGBUILD Removes standalone deckify flavor PKGBUILD (now handled by _flavor).
linux-cachyos-deckify/.SRCINFO Removes standalone deckify flavor metadata.
linux-cachyos-bore/PKGBUILD Removes standalone bore flavor PKGBUILD (now handled by _flavor).
linux-cachyos-bore/.SRCINFO Removes standalone bore flavor metadata.
linux-cachyos-bmq/PKGBUILD Removes standalone bmq flavor PKGBUILD (now handled by _flavor).
linux-cachyos-bmq/.SRCINFO Removes standalone bmq flavor metadata.
.github/workflows/build.yml Changes CI makepkg flags from --skipchecksums to --skipinteg.
Comments suppressed due to low confidence (3)

script.sh:30

  • These _flavor values (server/deckify) do not match the presets accepted by linux-cachyos/PKGBUILD (cachyos-server / cachyos-deckify), so the PKGBUILD will fail with "Invalid preset" for these builds.
build_pkg linux-cachyos -e "_flavor=server" -e _package_suffix=lto
build_pkg linux-cachyos -e "_flavor=deckify" -e _package_suffix=lto

script-znver4.sh:30

  • These _flavor values (server/deckify) do not match the presets accepted by linux-cachyos/PKGBUILD (cachyos-server / cachyos-deckify), so the PKGBUILD will fail with "Invalid preset" for these builds.
build_pkg linux-cachyos -e "_flavor=server" -e _package_suffix=lto
build_pkg linux-cachyos -e "_flavor=deckify" -e _package_suffix=lto

linux-cachyos/PKGBUILD:516

  • This condition checks for _flavor="deckify", but the preset names accepted earlier in the file use "cachyos-deckify". As written, the deckify-specific kernel config toggles will not be enabled when using the preset.
    if [ "$_flavor" = "deckify" ]; then
        echo "Enabling handheld configs"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script.sh Outdated
Comment thread script-znver4.sh Outdated
Comment thread script-v3-v4.sh
Comment thread linux-cachyos/PKGBUILD Outdated
Comment thread .github/workflows/build.yml
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch 2 times, most recently from fc20ff8 to c53f62e Compare July 24, 2026 16:50
@ventureoo

Copy link
Copy Markdown
Member Author

In this case you just need to select cachyos flavor, which is used by default.

it'll be a little bit of a problem if you want to build some customized handheld kernel with a different cpusched, since it currently overrides it to BORE.

That's now possible with c53f62e

@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from c53f62e to bb26a3b Compare August 11, 2026 16:32
@ventureoo

Copy link
Copy Markdown
Member Author

Rebased

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 24 changed files in this pull request and generated 3 comments.

Suppressed comments (7)

script-v3-v4.sh:34

  • This call runs in both the none and thin passes, but the later _use_llvm_lto=none always overrides build_env. The second pass therefore rebuilds linux-cachyos-gcc instead of producing the default ThinLTO linux-cachyos package. Let the per-pass LTO value take effect here.
    build_pkg "$image" linux-cachyos "${build_env[@]}" -e "_flavor=cachyos" -e "_use_llvm_lto=none" -e _package_suffix=gcc

script.sh:24

  • This replaces the script's previous default ThinLTO linux-cachyos build with linux-cachyos-gcc, and no subsequent call publishes the default package name. Keep the GCC build, but also build the default LTO flavor so repository updates do not drop linux-cachyos.
build_pkg linux-cachyos -e "_flavor=cachyos" -e "_use_llvm_lto=none" -e _package_suffix=gcc

script-znver4.sh:24

  • This replaces the script's previous default ThinLTO linux-cachyos build with linux-cachyos-gcc, and no subsequent call publishes the default package name. Keep the GCC build, but also build the default LTO flavor so repository updates do not drop linux-cachyos.
build_pkg linux-cachyos -e "_flavor=cachyos" -e "_use_llvm_lto=none" -e _package_suffix=gcc

linux-cachyos/PKGBUILD:290

  • The PKGBUILD now selects LLVM tools for LTO builds, but _package-headers no longer adds clang, llvm, and lld to runtime dependencies. Installed LTO headers therefore lack the toolchain needed to build external modules; linux-cachyos-rc/PKGBUILD:638-640 retains this dependency for the same case. Restore that conditional dependency in _package-headers.
if _is_lto_kernel; then
    makedepends+=(clang llvm lld)
    source+=("${_patchsource}/misc/dkms-clang.patch")
    _strip_bin=llvm-strip

linux-cachyos/PKGBUILD:243

  • The package metadata changed here, but linux-cachyos/.SRCINFO was not regenerated: it still contains the old description and the removed linux-cachyos-lto provides/replaces entries. AUR and repository tooling consuming .SRCINFO will therefore expose metadata that disagrees with the PKGBUILD. Regenerate and commit .SRCINFO.
pkgdesc="Linux kernel by CachyOS with patches and improvements ($(_generate_build_desc))"

linux-cachyos/PKGBUILD:13

  • These presets inherit the shared ThinLTO/toolchain-suffix defaults, although every removed flavor PKGBUILD (bore, bmq, eevdf, rt-bore, server, and deckify) defaulted to unsuffixed GCC packages. Using a ready-to-use preset directly therefore produces an LLVM kernel under the legacy unsuffixed package name. Default non-cachyos presets to GCC with no suffix while still honoring explicit environment overrides.
### Ready-to-use named options preset
: "${_flavor:="cachyos"}"

linux-cachyos/PKGBUILD:98

  • dynamic is listed as a valid preemption mode, but the selection case only accepts full, lazy, and rt; choosing dynamic reaches _die. Remove it from the documented options unless support is implemented.
## Choose between full, lazy, rt or dynamic

Comment thread linux-cachyos/PKGBUILD
Comment on lines +299 to +300
if [ "$_preempt" = "rt" ]; then
source+=("${_patchsource}/misc/0001-rt-i915.patch")
Comment thread linux-cachyos/PKGBUILD
Comment on lines +320 to +323
source+=(
"${_patchsource}/misc/0001-acpi-call.patch"
"${_patchsource}/misc/0001-handheld.patch"
)
Comment thread linux-cachyos/PKGBUILD
Comment on lines +347 to 350
bore) ## Burst-Oriented Response Enhancer (BORE) scheduler
source+=("${_patchsource}/sched/0001-bore-cachy.patch");;&
bmq) ## Project C Scheduler
source+=("${_patchsource}/sched/0001-prjc-cachy.patch");;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that b2sums is below source array, and it can't be extended. So we either need to move b2sums to the same place as source array, but this will lead to more complicated checksum updating process.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has always been a problem and theres really not a good solution for this since u can't automate the checksums for the conditional source files. I say we just ignore this like we always have.

@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch 2 times, most recently from 99e9b52 to d0cd79a Compare August 20, 2026 20:48
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from d0cd79a to 7839ced Compare August 24, 2026 11:56
ventureoo and others added 19 commits August 28, 2026 17:49
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-bmq in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-server in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-eevdf in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-deckify in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-rt-bore in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It replaced by _flavor=cachyos-bore in linux-cachyos PKGBUILD.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Fixes: #894
Signed-off-by: Eric Naim <dnaim@cachyos.org>
linux-cachyos-lto is no longer in repos, so noone should have this
obsolete package anymore.

Signed-off-by: Eric Naim <dnaim@cachyos.org>
Both of these options are mutually exclusive, so it makes sense to merge
them together to a single variable.

Signed-off-by: Eric Naim <dnaim@cachyos.org>
Having hardened in $_cpusched is fundamentally incorrect because, well,
it's not a CPU scheduler! Regardless, having that as an option is also
not possible to do correctly since:
1. version can lag behind current stable
2. it needs a different config that isn't easily toggleable so a
   different file must be provided

With that in mind, remove it from $_cpusched.

Signed-off-by: Eric Naim <dnaim@cachyos.org>

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Refactor the build scripts to make use of the newly written PKGBUILD.
This removes 6 PKGBUILDs that are just there for different build
configurations. LTS, RC and hardened PKGBUILDs are still kept because
they differ by version and not configuration.

Co-authored-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Signed-off-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Eric Naim <dnaim@cachyos.org>
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
It is the same as EEVDF value, but can cause some confuse due to
generated package description.

Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
@ventureoo
ventureoo force-pushed the ventureoo-unify-pkgbuild branch from 7839ced to a52d2c6 Compare August 28, 2026 14:51
@ventureoo

Copy link
Copy Markdown
Member Author

Rebased

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.

[BUG] Hardcoded GNU strip in _package-headers() fails on Clang builds due to fakeroot interference [BUG] Conflicting scheduler config for all kernels

5 participants