This fork tracks upstream closely and adds some spice on top.
Note
New to linux-tkg? Start with the upstream project README to get familiar with the general concept, the available options and the build workflow. Come back here once you know the basics.
All on top of what upstream already offers — knobs live in customization.cfg.
- Linux-tkg
- This fork tracks upstream closely and adds some spice on top.
- Extra knobs in
customization.cfg_nvidia_open— builds the open-source NVIDIA kernel modules alongside the kernel package_module_drv— build third-party out-of-tree (e.g. motherboard chipset) kernel modules alongside the kernel package_aggressive_glitched_base— aggressive VM/scheduler tuning defaults (experimental)_aggressive_misc_adds— aggressive misc additions (experimental)_aggressive_more_opts— CPU/scheduler misc optimizations (experimental)_clang_polly— Clang Polly loop optimizer support (experimental)
- Kernel config fragments (
.myfrag) - Install procedure
| Value | Description |
|---|---|
"false" |
Disable (skips prompt) |
"latest" |
Lastest NVIDIA driver branch |
"vulkan" |
Vulkan developer beta branch |
"legacy" |
Older NVIDIA LTS driver branch |
Examples:
_nvidia_open="vulkan"Driver versions and supported kernels are pinned in linux-tkg-config/prepare.
_module_drv — build third-party out-of-tree (e.g. motherboard chipset) kernel modules alongside the kernel package
Examples:
# enable modules
_module_drv="nct6687 v4l2loopback"
# disable all — skips prompt
_module_drv="false"Builds selected out-of-tree kernel modules into the main kernel package at build time. Supported modules:
| Module | Chip / Controller | Description | Source |
|---|---|---|---|
nct6687 |
Nuvoton NCT6687-R (common on MSI & Gigabyte boards) | Hardware monitoring driver (fans, temps, voltages) | Fred78290/nct6687d |
it87 |
ITE IT8689E / IT8792E / IT87xx series (common on ASUS & ASRock boards) | Hardware monitoring driver (fans, temps, voltages) | frankcrawford/it87 |
v4l2loopback |
Virtual (no physical chip; kernel-level loopback) | Creates virtual video devices usable as webcam sources (e.g. OBS → Zoom) | v4l2loopback/v4l2loopback |
Companion options (all ignored when _module_drv is empty):
| Option | Description |
|---|---|
_module_drv_autoload |
Space-separated subset of modules to autoload at boot via /usr/lib/modules-load.d/. v4l2loopback is autoloaded by default for compatibility. |
_module_drv_options_<name> |
Per-module modprobe options written to /usr/lib/modprobe.d/. Available for nct6687, it87, and v4l2loopback. |
_module_drv_git_<name> |
Pin a specific git ref (branch, tag, or commit) for a module, or set a full URL (https://… / git@…) to clone from a different fork entirely. Leave empty to use the default upstream repository at its default branch. |
Examples:
# Enable two modules
_module_drv="nct6687 v4l2loopback"
# Autoload nct6687 at boot
_module_drv_autoload="nct6687"
# modprobe options for nct6687 (space-separated, produces a single "options" line)
_module_drv_options_nct6687="fan_config=msi_alt1 msi_fan_brute_force=1"
# Pin nct6687 to a specific commit
_module_drv_git_nct6687="abc1234"
# Or switch to a completely different fork URL
_module_drv_git_nct6687="https://github.com/otherfork/nct6687d.git"_aggressive_glitched_base=""Applies 0014-aggressive-glitched-base.patch: workingset protection ratios, extended readahead, adjusted writeback and dirty thresholds, scheduler base slice and migration cost tuning, hugepage compaction tweaks — all gated behind CONFIG_TKG. Targets reduced stuttering on some workloads by keeping more file caches in memory. Requires _glitched_base="true". Leave empty to be asked at build time.
_aggressive_misc_adds=""Applies 0014-aggressive-misc-additions.patch: may contain temporary fixes pending upstream or distro-specific compatibility fixes. Leave empty to be asked at build time.
_aggressive_more_opts=""Applies 0014-aggressive-more-opts.patch: reduces timer_slack_ns, avoids sched_move_task lock contention, removes schedutil dependency, disables split-lock mitigation. Most noticeable on high core-count CPUs. Leave empty to be asked at build time.
_clang_polly=""Applies 0014-clang-polly.patch when available, enabling LLVM Polly for additional loop optimizations at compile time. Only meaningful when building with _compiler="llvm". Leave empty to be asked at build time.
Any file with a .myfrag extension placed next to the PKGBUILD is picked up and merged into the kernel config at build time. Requires _config_fragments="true" in customization.cfg (staging default).
Useful for enabling or disabling specific CONFIG_ entries without touching the base config file.
Example — NVMe storage only:
CONFIG_TKG=y
CONFIG_NVME_CORE=y
CONFIG_NVME_PCI=y
CONFIG_NVME_HWMON=y
CONFIG_BLK_DEV_NVME=y
These options below were added for personal testing and are left in for anyone who might find it useful.
_nvidia_open_sign="false"When set to "true", all nvidia*.ko files in the NVIDIA open modules package are signed using the kernel's module signing key after building.
Useful in combination with _RESIGN_AFTER_STRIP to prevent unsigned-module taint messages. Requires CONFIG_MODULE_SIG=y. Has no effect when _nvidia_open is "false" or empty.
_RESIGN_AFTER_STRIP="false"When set to "true", all .ko files are re-signed with the kernel's module signing key after stripping. Prevents "module verification failed" taint messages caused by INSTALL_MOD_STRIP=1 removing embedded signatures. Requires CONFIG_MODULE_SIG=y. Has no effect when _STRIP is not "true".
_module_drv_sign="false"When set to "true", all active out-of-tree modules are signed using the kernel's module signing key after building. Alternatively, pass a space-separated subset of module names to sign only those selectively. Requires CONFIG_MODULE_SIG=y. Has no effect when _module_drv is empty.
_install_signing_keys="false"When set to "true", the kernel module signing key and certificate are installed into the linux-headers package (useful for Secure Boot workflows or to prevent unsigned-module taint messages). Requires CONFIG_MODULE_SIG=y. Has no effect when is "false" or empty.
Warning
The key is stored unencrypted on disk. It is installed with permissions 400 (root-readable only), but anyone with root or physical access to the machine can extract it and sign arbitrary modules. If security is a concern, use full-disk encryption (e.g. LUKS) to protect the key against physical access.
(Arch & derivatives)
git clone https://github.com/damachine/linux-tkg.git
cd linux-tkg
makepkg -si(Generic / Gentoo)
git clone https://github.com/damachine/linux-tkg.git
cd linux-tkg
./install.sh install
_module_drvand its companion options should also work on Generic and Gentoo. Untested, use at your own risk.
install.shhas no effect when using on Debian, Ubuntu, Fedora.