diff options
author | Shea Levy <shea@shealevy.com> | 2016-08-15 19:01:44 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2016-08-15 19:01:44 -0400 |
commit | 57b2d1e9b0dcdd1d25bd2d450174764b9417ffc1 (patch) | |
tree | 73a214240d657ab03d4b52c3ba6c61f6538e030d /nixos | |
parent | 760b2b9048ea775c319cb348d74447a20dea513e (diff) | |
parent | b067b5301104c7d09d86d69febaa423a49ce14c0 (diff) |
Merge branch 'modprobe-fix' of git://github.com/abbradar/nixpkgs
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/config/zram.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/video/bumblebee.nix | 1 | ||||
-rw-r--r-- | nixos/modules/hardware/video/webcam/facetimehd.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/hardware/tlp.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/hardware/udev.nix | 5 | ||||
-rw-r--r-- | nixos/modules/services/network-filesystems/openafs-client/default.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/networking/fan.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/networking/strongswan.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/kernel.nix | 5 | ||||
-rw-r--r-- | nixos/modules/system/boot/modprobe.nix | 41 | ||||
-rw-r--r-- | nixos/modules/system/boot/stage-2-init.sh | 1 | ||||
-rw-r--r-- | nixos/modules/tasks/cpu-freq.nix | 2 | ||||
-rw-r--r-- | nixos/modules/virtualisation/docker.nix | 3 | ||||
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 26 |
14 files changed, 23 insertions, 74 deletions
diff --git a/nixos/modules/config/zram.nix b/nixos/modules/config/zram.nix index 019932b04e8d4..ad41ad4f3d7c4 100644 --- a/nixos/modules/config/zram.nix +++ b/nixos/modules/config/zram.nix @@ -8,7 +8,7 @@ let devices = map (nr: "zram${toString nr}") (range 0 (cfg.numDevices - 1)); - modprobe = "${config.system.sbin.modprobe}/sbin/modprobe"; + modprobe = "${pkgs.kmod}/bin/modprobe"; in diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix index b10846ac18a1a..69db518ab21cb 100644 --- a/nixos/modules/hardware/video/bumblebee.nix +++ b/nixos/modules/hardware/video/bumblebee.nix @@ -75,7 +75,6 @@ in serviceConfig = { ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${cfg.group} --driver ${cfg.driver}"; }; - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; }; } diff --git a/nixos/modules/hardware/video/webcam/facetimehd.nix b/nixos/modules/hardware/video/webcam/facetimehd.nix index 2a2fcf3057d4d..d311f600c3197 100644 --- a/nixos/modules/hardware/video/webcam/facetimehd.nix +++ b/nixos/modules/hardware/video/webcam/facetimehd.nix @@ -36,7 +36,6 @@ in # and load it back on resume powerManagement.resumeCommands = '' - export MODULE_DIR=/run/current-system/kernel-modules/lib/modules ${pkgs.kmod}/bin/modprobe -v facetimehd ''; diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix index 5ab7daafa85b4..281d02a8c65e3 100644 --- a/nixos/modules/services/hardware/tlp.nix +++ b/nixos/modules/services/hardware/tlp.nix @@ -72,8 +72,6 @@ in ExecStart = "${tlp}/bin/tlp init start"; ExecStop = "${tlp}/bin/tlp init stop"; }; - - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; tlp-sleep = { @@ -92,8 +90,6 @@ in ExecStart = "${tlp}/bin/tlp suspend"; ExecStop = "${tlp}/bin/tlp resume"; }; - - environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/"; }; }; diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix index e7741083d1ae7..7c4c93d0fcb32 100644 --- a/nixos/modules/services/hardware/udev.nix +++ b/nixos/modules/services/hardware/udev.nix @@ -58,7 +58,7 @@ let # Fix some paths in the standard udev rules. Hacky. for i in $out/*.rules; do substituteInPlace $i \ - --replace \"/sbin/modprobe \"${config.system.sbin.modprobe}/sbin/modprobe \ + --replace \"/sbin/modprobe \"${pkgs.kmod}/bin/modprobe \ --replace \"/sbin/mdadm \"${pkgs.mdadm}/sbin/mdadm \ --replace \"/sbin/blkid \"${pkgs.utillinux}/sbin/blkid \ --replace \"/bin/mount \"${pkgs.utillinux}/bin/mount \ @@ -316,8 +316,7 @@ in ''; systemd.services.systemd-udevd = - { environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; - restartTriggers = cfg.packages; + { restartTriggers = cfg.packages; }; }; diff --git a/nixos/modules/services/network-filesystems/openafs-client/default.nix b/nixos/modules/services/network-filesystems/openafs-client/default.nix index 61c66bb88357f..891f41c8dcdc3 100644 --- a/nixos/modules/services/network-filesystems/openafs-client/default.nix +++ b/nixos/modules/services/network-filesystems/openafs-client/default.nix @@ -80,7 +80,7 @@ in preStart = '' mkdir -p -m 0755 /afs mkdir -m 0700 -p ${cfg.cacheDirectory} - ${pkgs.kmod}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true + ${pkgs.kmod}/bin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true ${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} ${if cfg.sparse then "-dynroot-sparse" else "-dynroot"} -fakestat -afsdb ${openafsPkgs}/bin/fs setcrypt ${if cfg.crypt then "on" else "off"} ''; diff --git a/nixos/modules/services/networking/fan.nix b/nixos/modules/services/networking/fan.nix index 3170567e5b4a4..7f4e36478325d 100644 --- a/nixos/modules/services/networking/fan.nix +++ b/nixos/modules/services/networking/fan.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.networking.fan; - modprobe = "${config.system.sbin.modprobe}/sbin/modprobe"; + modprobe = "${pkgs.kmod}/bin/modprobe"; in diff --git a/nixos/modules/services/networking/strongswan.nix b/nixos/modules/services/networking/strongswan.nix index d6960a5df4712..8778b0364f9af 100644 --- a/nixos/modules/services/networking/strongswan.nix +++ b/nixos/modules/services/networking/strongswan.nix @@ -118,7 +118,7 @@ in systemd.services.strongswan = { description = "strongSwan IPSec Service"; wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ config.system.sbin.modprobe iproute iptables utillinux ]; # XXX Linux + path = with pkgs; [ kmod iproute iptables utillinux ]; # XXX Linux wants = [ "keys.target" ]; after = [ "network.target" "keys.target" ]; environment = { diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index a6bbca9b30bb7..0f342f44fe76a 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -228,7 +228,6 @@ in systemd.services."systemd-modules-load" = { wantedBy = [ "multi-user.target" ]; restartTriggers = [ kernelModulesConf ]; - environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; serviceConfig = { # Ignore failed module loads. Typically some of the # modules in ‘boot.kernelModules’ are "nice to have but @@ -238,10 +237,6 @@ in }; }; - systemd.services.kmod-static-nodes = - { environment.MODULE_DIR = "/run/booted-system/kernel-modules/lib/modules"; - }; - lib.kernelConfig = { isYes = option: { assertion = config: config.isYes option; diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index 9bb10eac98803..b915a98d5375b 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -8,41 +8,6 @@ with lib; options = { - system.sbin.modprobe = mkOption { - internal = true; - default = pkgs.stdenv.mkDerivation { - name = "modprobe"; - buildCommand = '' - mkdir -p $out/bin - for i in ${pkgs.kmod}/sbin/*; do - name=$(basename $i) - echo "$text" > $out/bin/$name - echo 'exec '$i' "$@"' >> $out/bin/$name - chmod +x $out/bin/$name - done - ln -s bin $out/sbin - ''; - text = - '' - #! ${pkgs.stdenv.shell} - export MODULE_DIR=/run/current-system/kernel-modules/lib/modules - - # Fall back to the kernel modules used at boot time if the - # modules in the current configuration don't match the - # running kernel. - if [ ! -d "$MODULE_DIR/$(${pkgs.coreutils}/bin/uname -r)" ]; then - MODULE_DIR=/run/booted-system/kernel-modules/lib/modules/ - fi - - ''; - meta.priority = 4; - }; - description = '' - Wrapper around modprobe that sets the path to the modules - tree. - ''; - }; - boot.blacklistedKernelModules = mkOption { type = types.listOf types.str; default = []; @@ -87,7 +52,7 @@ with lib; ''; environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases; - environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ]; + environment.systemPackages = [ pkgs.kmod ]; system.activationScripts.modprobe = '' @@ -95,11 +60,9 @@ with lib; # in the right location in the Nix store for kernel modules). # We need this when the kernel (or some module) auto-loads a # module. - echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe + echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe ''; - environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules"; - }; } diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh index 4a7f073ea8adc..c5a14f0766d57 100644 --- a/nixos/modules/system/boot/stage-2-init.sh +++ b/nixos/modules/system/boot/stage-2-init.sh @@ -207,6 +207,5 @@ exec {logOutFd}>&- {logErrFd}>&- # Start systemd. echo "starting systemd..." PATH=/run/current-system/systemd/lib/systemd \ - MODULE_DIR=/run/booted-system/kernel-modules/lib/modules \ LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive \ exec systemd diff --git a/nixos/modules/tasks/cpu-freq.nix b/nixos/modules/tasks/cpu-freq.nix index 1f4d1db33cef6..2fe7f4f8197a7 100644 --- a/nixos/modules/tasks/cpu-freq.nix +++ b/nixos/modules/tasks/cpu-freq.nix @@ -38,7 +38,7 @@ in description = "CPU Frequency Governor Setup"; after = [ "systemd-modules-load.service" ]; wantedBy = [ "multi-user.target" ]; - path = [ cpupower config.system.sbin.modprobe ]; + path = [ cpupower pkgs.kmod ]; unitConfig.ConditionVirtualization = false; serviceConfig = { Type = "oneshot"; diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index c99fc78d49e71..ebc2be087a5b2 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -95,8 +95,7 @@ in LimitNPROC = 1048576; } // proxy_env; - path = [ config.system.sbin.modprobe ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs); - environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules"; + path = [ pkgs.kmod ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs); postStart = if cfg.socketActivation then "" else cfg.postStart; diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index b77b319f4a283..777ee31e4dccb 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -135,13 +135,13 @@ let } '' # Create a /boot EFI partition with 40M - ${pkgs.gptfdisk}/sbin/sgdisk -G /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -a 1 -n 1:34:2047 -c 1:"BIOS Boot Partition" -t 1:ef02 /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -a 512 -N 2 -c 2:"EFI System" -t 2:ef00 /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -A 1:set:1 /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -A 2:set:2 /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -h 2 /dev/vda - ${pkgs.gptfdisk}/sbin/sgdisk -C /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -G /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -a 1 -n 1:34:2047 -c 1:"BIOS Boot Partition" -t 1:ef02 /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -a 512 -N 2 -c 2:"EFI System" -t 2:ef00 /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -A 1:set:1 /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -A 2:set:2 /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -h 2 /dev/vda + ${pkgs.gptfdisk}/bin/sgdisk -C /dev/vda ${pkgs.utillinux}/bin/sfdisk /dev/vda -A 2 . /sys/class/block/vda2/uevent mknod /dev/vda2 b $MAJOR $MINOR @@ -151,11 +151,11 @@ let ${pkgs.mtools}/bin/mlabel -i /dev/vda2 ::boot # Mount /boot; load necessary modules first. - ${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko.xz || true - ${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko.xz || true - ${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko.xz || true - ${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko.xz || true - ${pkgs.kmod}/sbin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko.xz || true + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko.xz || true + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko.xz || true + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko.xz || true + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko.xz || true + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko.xz || true mkdir /boot mount /dev/vda2 /boot @@ -370,7 +370,7 @@ in boot.initrd.extraUtilsCommands = '' # We need mke2fs in the initrd. - copy_bin_and_libs ${pkgs.e2fsprogs}/sbin/mke2fs + copy_bin_and_libs ${pkgs.e2fsprogs}/bin/mke2fs ''; boot.initrd.postDeviceCommands = |