[Boot] add KRUSTFLAGS to kernel build

This commit is contained in:
Antoine Viallon 2023-11-07 21:28:21 +01:00
parent ec9cfceda6
commit de157af8a9
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -256,12 +256,19 @@ in {
++ optional (! isNull cpuConfig.caches.lastLevel ) "--param l2-cache-size=${toString cpuConfig.caches.lastLevel}" ++ optional (! isNull cpuConfig.caches.lastLevel ) "--param l2-cache-size=${toString cpuConfig.caches.lastLevel}"
++ optional (! isNull cpuConfig.caches.l1d ) "--param l1-cache-size=${toString cpuConfig.caches.l1d}" ++ optional (! isNull cpuConfig.caches.l1d ) "--param l1-cache-size=${toString cpuConfig.caches.l1d}"
); );
kRustflags = traceValWithPrefix "kRustflags" (
[
"-Ctarget-cpu=${cpuConfig.arch}"
"-Ctune-cpu=${cpuConfig.tune or cpuConfig.arch}"
]
);
optimizedKernelAttrs = traceValWithPrefix "optimizedKernelAttrs" ( optimizedKernelAttrs = traceValWithPrefix "optimizedKernelAttrs" (
optionalAttrs config.aviallon.optimizations.enable ( optionalAttrs config.aviallon.optimizations.enable (
myLib.attrsets.mergeAttrsRecursive myLib.attrsets.mergeAttrsRecursive
{ {
KCFLAGS = kCflags; KCFLAGS = kCflags;
KRUSTFLAGS = kRustflags;
} }
(traceValWithPrefix "aviallon.boot.kernel.addOptimizationAttributes" cfg.kernel.addOptimizationAttributes) (traceValWithPrefix "aviallon.boot.kernel.addOptimizationAttributes" cfg.kernel.addOptimizationAttributes)
) )
@ -282,7 +289,6 @@ in {
++ optional cfg.removeKernelDRM customKernelPatches.removeKernelDRM ++ optional cfg.removeKernelDRM customKernelPatches.removeKernelDRM
; ;
loader.grub.enable = cfg.useGrub; loader.grub.enable = cfg.useGrub;
loader.grub = { loader.grub = {
device = mkIf cfg.efi "nodev"; device = mkIf cfg.efi "nodev";