summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/os-specific/linux/module-init-tools/aggregator.nix33
-rw-r--r--pkgs/tools/X11/xlaunch/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix8
-rw-r--r--pkgs/top-level/builder-defs.nix7
4 files changed, 49 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/module-init-tools/aggregator.nix b/pkgs/os-specific/linux/module-init-tools/aggregator.nix
new file mode 100644
index 00000000000..b0a518cd216
--- /dev/null
+++ b/pkgs/os-specific/linux/module-init-tools/aggregator.nix
@@ -0,0 +1,33 @@
+args : with args;
+	with builderDefs {
+		addSbinPath = true;
+		src = "";
+		buildInputs = [lndir module_init_tools];
+		configureFlags = [];
+	} null; /* null is a terminator for sumArgs */
+let 
+
+doCollect = FullDepEntry (''
+ensureDir $out/
+cd $out/
+for i in $moduleSources; do 
+	lndir $i/
+done
+cd lib/modules/
+rm */modules.*
+MODULE_DIR=$PWD/ depmod -a 
+'') [minInit addInputs defEnsureDir];
+in
+stdenv.mkDerivation rec {
+	name = "module-aggregator";
+	inherit moduleSources;
+	builder = writeScript (name + "-builder")
+		(textClosure [doCollect doForceShare doPropagate]);
+	meta = {
+		description = "
+		A directory to hold all  the modules, including those 
+		built separately from kernel. Earlier directories in 
+		moduleSources have higher priority.
+";
+	};
+}
diff --git a/pkgs/tools/X11/xlaunch/default.nix b/pkgs/tools/X11/xlaunch/default.nix
index 73a85be7f12..89c94ffd515 100644
--- a/pkgs/tools/X11/xlaunch/default.nix
+++ b/pkgs/tools/X11/xlaunch/default.nix
@@ -37,7 +37,9 @@ EOF
 			_display=\${_display:-:0}
 			_display=\${_display#:}
 			echo Using :\$_display
-			(egrep \"^ +env\" /etc/event.d/xserver | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo X \\\$_XARGS_ ) | bash &
+			XCMD=\"\$(egrep \"^env\" /etc/event.d/xserver | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ )\" 
+			echo \"\$XCMD\" 
+			echo \"\$XCMD\" | bash &
 			while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done
 			su -l \${USER:-identityless-shelter} -c \"DISPLAY=:\$_display \$*\";
 		' >\$out/libexec/xlaunch
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 06cbd02097a..0c455514b94 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3314,7 +3314,6 @@ rec {
       [(getConfig ["kernel" "addConfig"] "")];
   };
 
-
   libselinux = import ../os-specific/linux/libselinux {
     inherit fetchurl stdenv libsepol;
   };
@@ -3409,6 +3408,13 @@ rec {
     inherit fetchurl stdenv;
   };
 
+  module_aggregation = moduleSources:  
+  import ../os-specific/linux/module-init-tools/aggregator.nix {
+    inherit fetchurl stdenv module_init_tools moduleSources 
+      builderDefs;
+    inherit (xorg) lndir;
+  };
+
   modutils = import ../os-specific/linux/modutils {
     inherit fetchurl bison flex;
     stdenv = overrideGCC stdenv gcc34;
diff --git a/pkgs/top-level/builder-defs.nix b/pkgs/top-level/builder-defs.nix
index 155743558d9..aa53c9ba157 100644
--- a/pkgs/top-level/builder-defs.nix
+++ b/pkgs/top-level/builder-defs.nix
@@ -3,7 +3,7 @@ args: with args; with stringsWithDeps; with lib;
 {
 	inherit writeScript; 
 
-
+	addSbinPath = getAttr ["addSbinPath"] false args;
 
 	forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"];
 
@@ -135,6 +135,11 @@ args: with args; with stringsWithDeps; with lib;
 			fail
 		    fi
 		" else "")
+		+(if addSbinPath then "
+		    if test -d \$1/sbin; then
+			export _PATH=\$_PATH\${_PATH:+:}\$1/sbin
+		    fi
+		" else "")
 		+"
 		    if test -d \$1/bin; then
 			export _PATH=\$_PATH\${_PATH:+:}\$1/bin