Fix (and simplify) the blcr module.
This commit is contained in:
parent
12d77805ef
commit
c593065585
@ -3,15 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (pkgs.lib) mkOption mkIf;
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
cfg = config.environment.blcr;
|
cfg = config.environment.blcr;
|
||||||
kernelPkgs = config.boot.kernelPackages;
|
blcrPkg = config.boot.kernelPackages.blcr;
|
||||||
blcrPkg = kernelPkgs.blcr;
|
|
||||||
|
|
||||||
insmod = "${pkgs.module_init_tools}/sbin/insmod";
|
|
||||||
rmmod = "${pkgs.module_init_tools}/sbin/rmmod";
|
|
||||||
|
|
||||||
modulesDir = "${blcrPkg}/lib/modules/${kernelPkgs.kernel.version}";
|
|
||||||
blcr_imports_ko = "${modulesDir}/blcr_imports.ko";
|
|
||||||
blcr_ko = "${modulesDir}/blcr.ko";
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -23,35 +15,13 @@ in
|
|||||||
description =
|
description =
|
||||||
"Wheter to enable support for the BLCR checkpointing tool.";
|
"Wheter to enable support for the BLCR checkpointing tool.";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.blcr.autorun = mkOption {
|
|
||||||
default = true;
|
|
||||||
description =
|
|
||||||
"Whether to load BLCR kernel modules automatically at boot.";
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
boot.kernelModules = [ "blcr" "blcr_imports" ];
|
||||||
|
boot.extraModulePackages = [ blcrPkg ];
|
||||||
environment.systemPackages = [ blcrPkg ];
|
environment.systemPackages = [ blcrPkg ];
|
||||||
|
|
||||||
jobs.blcr = {
|
|
||||||
name = "blcr";
|
|
||||||
description = "Loads BLCR kernel modules";
|
|
||||||
task = true;
|
|
||||||
|
|
||||||
startOn = if cfg.autorun then "started udev" else null;
|
|
||||||
|
|
||||||
preStart = ''
|
|
||||||
${insmod} ${blcr_imports_ko}
|
|
||||||
${insmod} ${blcr_ko}
|
|
||||||
'';
|
|
||||||
postStop = ''
|
|
||||||
${rmmod} ${blcr_ko}
|
|
||||||
${rmmod} ${blcr_imports_ko}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user