moby: kernel: build the in-tree MFD_RK8XX, just plumb it so nixos doesnt complain about conflicting module suppliers

This commit is contained in:
2024-10-02 11:31:42 +00:00
parent 16d31669d1
commit d0cd8ed691
2 changed files with 20 additions and 6 deletions

View File

@@ -120,6 +120,20 @@ in
config.boot.kernelPackages.rk818-charger #< rk818 battery/charger isn't mainline as of 2024-10-01 config.boot.kernelPackages.rk818-charger #< rk818 battery/charger isn't mainline as of 2024-10-01
]; ];
# default nixos behavior is to error if a kernel module is provided by more than one package.
# in fact, i'm _intentionally_ overwriting the in-tree modules, so inline this buildEnv logic
# from <repo:nixos/nixpkgs:nixos/modules/system/boot/kernel.nix> AKA pkgs.aggregateModules
# but configured to **ignore collisions**
system.modulesTree = lib.mkForce [(
(pkgs.aggregateModules
( config.boot.extraModulePackages ++ [ config.boot.kernelPackages.kernel ])
).overrideAttrs {
# earlier items override the contents of later items
ignoreCollisions = true;
# checkCollisionContents = false;
}
)];
boot.kernelModules = [ boot.kernelModules = [
# these don't get probed automatically, not sure why (shouldn't the device tree cause it to be auto-loaded?) # these don't get probed automatically, not sure why (shouldn't the device tree cause it to be auto-loaded?)
# but are needed for battery capacity/charging info # but are needed for battery capacity/charging info

View File

@@ -384,12 +384,12 @@ linux_latest.override {
name = "make-module-for-out-of-tree"; name = "make-module-for-out-of-tree";
patch = null; patch = null;
extraStructuredConfig = with lib.kernel; { extraStructuredConfig = with lib.kernel; {
MFD_RK8XX = no; # MFD_RK8XX = no;
MFD_RK8XX_I2C = no; # MFD_RK8XX_I2C = no;
MFD_RK8XX_SPI = no; #< necessary for MFD_RK8XX=... to apply # MFD_RK8XX_SPI = no; #< necessary for MFD_RK8XX=... to apply
# MFD_RK8XX = module; MFD_RK8XX = module;
# MFD_RK8XX_I2C = module; MFD_RK8XX_I2C = module;
# MFD_RK8XX_SPI = module; MFD_RK8XX_SPI = module;
}; };
} }
]; ];