mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Boot] move kernel no-DRM patch to a sed expression
This commit is contained in:
parent
810b055e4d
commit
8f7bc11e09
2 changed files with 15 additions and 14 deletions
17
boot.nix
17
boot.nix
|
|
@ -279,7 +279,21 @@ in {
|
|||
moddedKernelAttrs = traceValWithPrefix "moddedKernelAttrs" (
|
||||
myLib.attrsets.mergeAttrsRecursive (traceValWithPrefix "aviallon.boot.kernel.addAttributes" cfg.kernel.addAttributes) optimizedKernelAttrs
|
||||
);
|
||||
moddedKernel = myLib.optimizations.addAttrs baseKernel moddedKernelAttrs;
|
||||
|
||||
noDRMKernel =
|
||||
if cfg.removeKernelDRM then
|
||||
baseKernel.overrideAttrs (old: {
|
||||
passthru = baseKernel.passthru;
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gnused ];
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
sed -i -e 's/_EXPORT_SYMBOL(sym, "_gpl")/_EXPORT_SYMBOL(sym, "")/g' -e 's/__EXPORT_SYMBOL(sym, "_gpl", __stringify(ns))/__EXPORT_SYMBOL(sym, "", __stringify(ns))/g' include/linux/export.h
|
||||
'';
|
||||
})
|
||||
else
|
||||
baseKernel
|
||||
;
|
||||
|
||||
moddedKernel = myLib.optimizations.addAttrs noDRMKernel moddedKernelAttrs;
|
||||
in mkOverride 2 (pkgs.linuxPackagesFor moddedKernel);
|
||||
|
||||
kernelPatches = []
|
||||
|
|
@ -289,7 +303,6 @@ in {
|
|||
++ optional (cfg.patches.amdClusterId.enable && kernelVersionOlder "6.4") customKernelPatches.amdClusterId
|
||||
++ optional (cfg.patches.zenLLCIdle.enable && kernelVersionOlder "6.5") customKernelPatches.backports.zenLLCIdle
|
||||
++ optional (isXanmod cfg.kernel.package && config.aviallon.optimizations.enable) (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpu.arch)
|
||||
++ optional cfg.removeKernelDRM customKernelPatches.removeKernelDRM
|
||||
;
|
||||
|
||||
loader.grub.enable = cfg.useGrub;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue