3
0
Fork 0
forked from mirrors/nixpkgs

Added module_aggregator. Pass some directories with modules to it, and it will give you a directory to use instead of pkgs.kernel . addSbinPath in builderDefs to use sbin/ in addToEnv . Some catching up in xlaunch.

svn path=/nixpkgs/trunk/; revision=10075
This commit is contained in:
Michael Raskin 2008-01-04 17:02:12 +00:00
parent 8c615616c7
commit 498d47b583
4 changed files with 49 additions and 3 deletions

View file

@ -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.
";
};
}

View file

@ -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

View file

@ -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;

View file

@ -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