Options for kernel and checker for configuration.nix
svn path=/nixpkgs/trunk/; revision=9371
This commit is contained in:
parent
218ec9ae8b
commit
dd5daab9d1
26
pkgs/build-support/checker/default.nix
Normal file
26
pkgs/build-support/checker/default.nix
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Checks that all set options are described.
|
||||||
|
#
|
||||||
|
options: configuration:
|
||||||
|
with builtins;
|
||||||
|
with (import ../../lib);
|
||||||
|
|
||||||
|
let
|
||||||
|
findInList = p: list: default:
|
||||||
|
if (list == []) then default else
|
||||||
|
if (p (head list)) then (head list) else
|
||||||
|
findInList p (tail list) default;
|
||||||
|
|
||||||
|
attrSetToList = attrs: if (isAttrs attrs) then (concatLists (map
|
||||||
|
(s:
|
||||||
|
(map (l: ([s] ++ l))
|
||||||
|
(attrSetToList (getAttr s attrs))))
|
||||||
|
(attrNames attrs))) else [[]];
|
||||||
|
in
|
||||||
|
let opts = (map (a: a.name) options);
|
||||||
|
conf = attrSetToList configuration;
|
||||||
|
in
|
||||||
|
let res=findInList (a: (findInList (b: (eqLists a b)) opts null)==null) conf null;
|
||||||
|
in
|
||||||
|
#if res==null then null else map (l: ["<"] ++ l ++ [">"]) res
|
||||||
|
res
|
@ -22,8 +22,24 @@ configurePhase() {
|
|||||||
cp $config .config
|
cp $config .config
|
||||||
chmod u+w .config
|
chmod u+w .config
|
||||||
|
|
||||||
|
echo --extraConfig--;
|
||||||
|
echo "${extraConfig}";
|
||||||
|
|
||||||
|
echo "$extraConfig" | while read; do
|
||||||
|
optionName=$( echo "$REPLY" | sed -e 's/[^A-Z_]//g' );
|
||||||
|
echo --optionName--;
|
||||||
|
echo "$REPLY";
|
||||||
|
echo ${optionName};
|
||||||
|
if [ -n "${optionName}" ]; then
|
||||||
|
sed -e s/.'*'${optionName}.'*'/"$REPLY/" -i .config
|
||||||
|
fi;
|
||||||
|
done;
|
||||||
|
|
||||||
echo "$extraConfig" >> .config
|
echo "$extraConfig" >> .config
|
||||||
|
|
||||||
|
echo --finalConfig--
|
||||||
|
cat .config
|
||||||
|
|
||||||
#substituteInPlace scripts/kconfig/lxdialog/check-lxdialog.sh \
|
#substituteInPlace scripts/kconfig/lxdialog/check-lxdialog.sh \
|
||||||
# --replace /usr /no-such-path
|
# --replace /usr /no-such-path
|
||||||
|
|
||||||
|
@ -197,6 +197,15 @@ rec {
|
|||||||
} // extraAttrs co // co.pass // co.flags_prefixed );
|
} // extraAttrs co // co.pass // co.flags_prefixed );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
# Check absence of non-used options
|
||||||
|
checker = x: flag: opts: config:
|
||||||
|
(if flag then let result=(
|
||||||
|
(import ../build-support/checker)
|
||||||
|
opts config); in
|
||||||
|
(if (result==null) then x else
|
||||||
|
abort (toString result))
|
||||||
|
else x);
|
||||||
|
|
||||||
### STANDARD ENVIRONMENT
|
### STANDARD ENVIRONMENT
|
||||||
|
|
||||||
|
|
||||||
@ -275,7 +284,6 @@ rec {
|
|||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
### TOOLS
|
### TOOLS
|
||||||
|
|
||||||
|
|
||||||
@ -2766,9 +2774,18 @@ rec {
|
|||||||
{
|
{
|
||||||
name = "Enable-NO_HZ";
|
name = "Enable-NO_HZ";
|
||||||
patch = ../lib/empty.file;
|
patch = ../lib/empty.file;
|
||||||
extraConfig = "NO_HZ=y\n";
|
extraConfig = "CONFIG_NO_HZ=y\n";
|
||||||
}
|
}
|
||||||
] else [])
|
] else [])
|
||||||
|
++
|
||||||
|
(if (getConfig ["kernel" "timer_stats"] false) then [
|
||||||
|
{
|
||||||
|
name = "Enable-TIMER_STATS";
|
||||||
|
patch = ../lib/empty.file;
|
||||||
|
extraConfig = "CONFIG_TIMER_STATS=y\n";
|
||||||
|
}
|
||||||
|
] else [])
|
||||||
|
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user