git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitcdf9a78a3ebb535fa6ba88fce88c655776d2474f authorShea Levy <shea@shealevy.com> dateSun 25 Mar 2018, 17:45 (9 years ago) parentb048224
6 files changed+7−7
lib/meta.nix+2 lib/systems/inspect.nix−2 nixos/modules/system/boot/kexec.nix+1−1 pkgs/os-specific/linux/kexectools/default.nix+1 pkgs/os-specific/linux/systemd/default.nix+2−1 pkgs/top-level/all-packages.nix+1−3
lib/meta.nix+2
@@ -86,4 +86,6 @@ rec {
8686 then { system = elem; }
8787 else { parsed = elem; };
8888 in lib.matchAttrs pattern platform;
89+
90+ enableIfAvailable = p: if p.meta.available or true then [ p ] else [];
8991}
lib/systems/inspect.nix−2
@@ -39,8 +39,6 @@ rec {
3939 isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ];
4040 isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
4141
42− isKexecable = map (family: { kernel = kernels.linux; cpu.family = family; })
43− [ "x86" "arm" "aarch64" "mips" ];
4442 isEfi = map (family: { cpu.family = family; })
4543 [ "x86" "arm" "aarch64" ];
4644 isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; })
nixos/modules/system/boot/kexec.nix+1−1
@@ -1,7 +1,7 @@
11{ config, pkgs, lib, ... }:
22
33{
4− config = lib.mkIf (pkgs.kexectools != null) {
4+ config = lib.mkIf (pkgs.kexectools.meta.available) {
55 environment.systemPackages = [ pkgs.kexectools ];
66
77 systemd.services."prepare-kexec" =
pkgs/os-specific/linux/kexectools/default.nix+1
@@ -22,5 +22,6 @@ stdenv.mkDerivation rec {
2222 homepage = http://horms.net/projects/kexec/kexec-tools;
2323 description = "Tools related to the kexec Linux feature";
2424 platforms = platforms.linux;
25+ badPlatforms = platforms.riscv;
2526 };
2627}
pkgs/os-specific/linux/systemd/default.nix+2−1
@@ -41,7 +41,8 @@ in stdenv.mkDerivation rec {
4141 buildInputs =
4242 [ linuxHeaders libcap kmod xz pam acl
4343 /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
44− libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor
44+ libmicrohttpd ] ++ stdenv.lib.meta.enableIfAvailable kexectools ++
45+ [ libseccomp libffi audit lz4 bzip2 libapparmor
4546 iptables gnu-efi
4647 # This is actually native, but we already pull it from buildPackages
4748 pythonLxmlEnv
pkgs/top-level/all-packages.nix+1−3
@@ -3131,9 +3131,7 @@ with pkgs;
31313131
31323132 keepalived = callPackage ../tools/networking/keepalived { };
31333133
3134− kexectools = if hostPlatform.isKexecable
3135− then callPackage ../os-specific/linux/kexectools { }
3136− else null;
3134+ kexectools = callPackage ../os-specific/linux/kexectools { };
31373135
31383136 keybase = callPackage ../tools/security/keybase { };
31393137