* Fall back to the kernel modules used at boot time if the modules in
the current configuration don't match the running kernel. This ensures that modprobe still works after a "nixos-rebuild switch" to a configuration that has a different kernel version. svn path=/nixos/trunk/; revision=19696
This commit is contained in:
parent
442093d27d
commit
0432766399
|
@ -69,6 +69,7 @@ let
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
ln -s ${kernelPath} $out/kernel
|
ln -s ${kernelPath} $out/kernel
|
||||||
|
ln -s ${config.system.modulesTree} $out/kernel-modules
|
||||||
if [ -n "$grub" ]; then
|
if [ -n "$grub" ]; then
|
||||||
ln -s $grub $out/grub
|
ln -s $grub $out/grub
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,6 +19,14 @@ with pkgs.lib;
|
||||||
''
|
''
|
||||||
#! ${pkgs.stdenv.shell}
|
#! ${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
|
||||||
|
fi
|
||||||
|
|
||||||
exec ${pkgs.module_init_tools}/sbin/modprobe "$@"
|
exec ${pkgs.module_init_tools}/sbin/modprobe "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue