diff options
author | Shea Levy <shea@shealevy.com> | 2018-03-25 17:45:22 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-03-27 08:15:07 -0400 |
commit | cdf9a78a3ebb535fa6ba88fce88c655776d2474f (patch) | |
tree | 494af986a0c2adc37a3c6d1173a0dc563ae96174 | |
parent | b0482248fefbf3b6cdd9c92053cfb49778a3a3a8 (diff) |
kexectools: Disable only on RISC-V if Linux.
The isKexecable flag treated Linux without kexec as just a normal variant, when it really should be treated as a special case incurring complexity debt to support.
-rw-r--r-- | lib/meta.nix | 2 | ||||
-rw-r--r-- | lib/systems/inspect.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/kexec.nix | 2 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kexectools/default.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/systemd/default.nix | 3 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
6 files changed, 7 insertions, 7 deletions
diff --git a/lib/meta.nix b/lib/meta.nix index 199030c103af5..8516cc1cd6f1b 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -86,4 +86,6 @@ rec { then { system = elem; } else { parsed = elem; }; in lib.matchAttrs pattern platform; + + enableIfAvailable = p: if p.meta.available or true then [ p ] else []; } diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index e8ea2bed25f55..2f0c402f39816 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -39,8 +39,6 @@ rec { isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ]; isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ]; - isKexecable = map (family: { kernel = kernels.linux; cpu.family = family; }) - [ "x86" "arm" "aarch64" "mips" ]; isEfi = map (family: { cpu.family = family; }) [ "x86" "arm" "aarch64" ]; isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; }) diff --git a/nixos/modules/system/boot/kexec.nix b/nixos/modules/system/boot/kexec.nix index 14ebe66e63204..3fc1af28f628e 100644 --- a/nixos/modules/system/boot/kexec.nix +++ b/nixos/modules/system/boot/kexec.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: { - config = lib.mkIf (pkgs.kexectools != null) { + config = lib.mkIf (pkgs.kexectools.meta.available) { environment.systemPackages = [ pkgs.kexectools ]; systemd.services."prepare-kexec" = diff --git a/pkgs/os-specific/linux/kexectools/default.nix b/pkgs/os-specific/linux/kexectools/default.nix index c4c5b7cc3b91c..26f3d89c66286 100644 --- a/pkgs/os-specific/linux/kexectools/default.nix +++ b/pkgs/os-specific/linux/kexectools/default.nix @@ -22,5 +22,6 @@ stdenv.mkDerivation rec { homepage = http://horms.net/projects/kexec/kexec-tools; description = "Tools related to the kexec Linux feature"; platforms = platforms.linux; + badPlatforms = platforms.riscv; }; } diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index d0f35d6736da6..763c28464ab3f 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -41,7 +41,8 @@ in stdenv.mkDerivation rec { buildInputs = [ linuxHeaders libcap kmod xz pam acl /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2 - libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor + libmicrohttpd ] ++ stdenv.lib.meta.enableIfAvailable kexectools ++ + [ libseccomp libffi audit lz4 bzip2 libapparmor iptables gnu-efi # This is actually native, but we already pull it from buildPackages pythonLxmlEnv diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 831fc8344cb94..8d2a17a79daa9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3131,9 +3131,7 @@ with pkgs; keepalived = callPackage ../tools/networking/keepalived { }; - kexectools = if hostPlatform.isKexecable - then callPackage ../os-specific/linux/kexectools { } - else null; + kexectools = callPackage ../os-specific/linux/kexectools { }; keybase = callPackage ../tools/security/keybase { }; |