From a9e4eca8bfc34dee99b0557e04b0f3a0e7cd58ee Mon Sep 17 00:00:00 2001 From: Evgeny Egorochkin Date: Fri, 10 May 2013 16:07:56 +0300 Subject: [PATCH] Apparmor: check that we are running an AppArmor-enabled kernel. --- modules/security/apparmor.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/security/apparmor.nix b/modules/security/apparmor.nix index 46bbb5374d9c..ec371e554230 100644 --- a/modules/security/apparmor.nix +++ b/modules/security/apparmor.nix @@ -35,6 +35,11 @@ AppArmor. config = mkIf (cfg.enable) { + assertions = [ { assertion = config.boot.kernelPackages.kernel.features ? apparmor + && config.boot.kernelPackages.kernel.features.apparmor; + message = "AppArmor is enabled, but the kernel doesn't have AppArmor support"; } + ]; + jobs.apparmor = { startOn = "startup";