From 7fe3bbba5f388b00007f3189d00845eba60ebb9c Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Wed, 12 Oct 2022 18:41:15 +0200 Subject: [PATCH] [Boot] Add energy model support in kernel (if enabled) Also fix syscall.x32 being on cmdline needlessly if not built into the kernel. --- boot.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/boot.nix b/boot.nix index 02de481..834d6fd 100644 --- a/boot.nix +++ b/boot.nix @@ -16,6 +16,12 @@ let RT_GROUP_SCHED y ''; }; + enableEnergyModel = { + name = "enable-energy-model"; + patch = null; extraConfig = '' + ENERGY_MODEL y + ''; + }; optimizeForCPUArch = arch: let archConfigMap = { "k8" = "K8"; "opteron" = "K8"; "athlon64" = "K8"; "athlon-fx" = "K8"; @@ -96,6 +102,8 @@ in }; kvdo.enable = mkEnableOption "dm-kvdo kernel module"; rtGroupSched.enable = mkEnableOption "RT cgroups"; + energyModel.enable = mkEnableOption "Energy Model"; + efi = mkOption rec { description = "Use EFI bootloader"; default = builtins.pathExists "/sys/firmware/efi"; @@ -133,7 +141,7 @@ in hardware.enableRedistributableFirmware = true; aviallon.boot.cmdline = { - "syscall.x32" = cfg.x32abi.enable; + "syscall.x32" = mkIf cfg.x32abi.enable true; # Reboot after 5 seconds on panic (prevent system lockup) "panic" = 5; @@ -153,6 +161,7 @@ in kernelPatches = [] ++ optional cfg.x32abi.enable customKernelPatches.enableX32ABI ++ optional cfg.rtGroupSched.enable customKernelPatches.enableRTGroupSched + ++ optional cfg.energyModel.enable customKernelPatches.enableEnergyModel ++ optional config.aviallon.optimizations.enable (customKernelPatches.optimizeForCPUArch config.aviallon.general.cpuArch) ;