From 6f03065dcee8ddab1b815796a159ed5621d0f9d0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Mar 2012 22:02:27 +0000 Subject: [PATCH] * Move the setting of $MODULE_DIR to modprobe.nix. * Add a slash to the end of $MODULE_DIR, as expected by depmod. (Not that running depmod from the command line is all that useful, since you can't use it to update the tree in the Nix store. But at least commands like "depmod -n" work now.) Reported by Kirill Elagin on IRC. svn path=/nixos/trunk/; revision=33312 --- modules/programs/bash/bash.nix | 1 - modules/programs/bash/profile.sh | 1 - modules/system/boot/modprobe.nix | 9 +++++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/programs/bash/bash.nix b/modules/programs/bash/bash.nix index 626ed722536d..51654b164a07 100644 --- a/modules/programs/bash/bash.nix +++ b/modules/programs/bash/bash.nix @@ -30,7 +30,6 @@ in source = pkgs.substituteAll { src = ./profile.sh; wrapperDir = config.security.wrapperDir; - modulesTree = config.system.modulesTree; shellInit = config.environment.shellInit; }; target = "profile"; diff --git a/modules/programs/bash/profile.sh b/modules/programs/bash/profile.sh index 152b83107a1e..c0f8702117e9 100644 --- a/modules/programs/bash/profile.sh +++ b/modules/programs/bash/profile.sh @@ -14,7 +14,6 @@ export __ETC_PROFILE_DONE=1 # Initialise a bunch of environment variables. export LOCALE_ARCHIVE=/var/run/current-system/sw/lib/locale/locale-archive export LD_LIBRARY_PATH=/var/run/opengl-driver/lib:/var/run/opengl-driver-32/lib # !!! only set if needed -export MODULE_DIR=@modulesTree@/lib/modules export NIXPKGS_CONFIG=/nix/etc/config.nix export NIX_PATH=nixpkgs=/etc/nixos/nixpkgs:nixos=/etc/nixos/nixos:nixos-config=/etc/nixos/configuration.nix:services=/etc/nixos/services export PAGER="less -R" diff --git a/modules/system/boot/modprobe.nix b/modules/system/boot/modprobe.nix index ef3ed3bed94a..f210ecec26d8 100644 --- a/modules/system/boot/modprobe.nix +++ b/modules/system/boot/modprobe.nix @@ -18,13 +18,13 @@ with pkgs.lib; text = '' #! ${pkgs.stdenv.shell} - export MODULE_DIR=${config.system.modulesTree}/lib/modules + export MODULE_DIR=${config.system.modulesTree}/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=/var/run/booted-system/kernel-modules/lib/modules + MODULE_DIR=/var/run/booted-system/kernel-modules/lib/modules/ fi exec ${pkgs.module_init_tools}/sbin/modprobe "$@" @@ -102,6 +102,11 @@ with pkgs.lib; echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe ''; + environment.shellInit = + '' + export MODULE_DIR=${config.system.modulesTree}/lib/modules/ + ''; + }; }