* Suppress localversion from kernel patches, allow the user to set
one. * Allow the entire kernel configuration to be overridden through a function argument. svn path=/nixpkgs/trunk/; revision=8699
This commit is contained in:
parent
ceb097cd01
commit
311dc72bf1
@ -6,6 +6,19 @@ configurePhase() {
|
||||
export INSTALL_PATH=$out
|
||||
export INSTALL_MOD_PATH=$out
|
||||
|
||||
|
||||
# Get rid of any "localversion" files installed by patches.
|
||||
if test -z "$allowLocalVersion"; then
|
||||
rm -f localversion*
|
||||
fi
|
||||
|
||||
# Set our own localversion, if specified.
|
||||
if test -n "$localVersion"; then
|
||||
echo "$localVersion" > localversion-nix
|
||||
fi
|
||||
|
||||
|
||||
# Create the config file.
|
||||
cp $config .config
|
||||
chmod u+w .config
|
||||
|
||||
|
@ -8,6 +8,14 @@
|
||||
|
||||
, # Whether to build a User-Mode Linux kernel.
|
||||
userModeLinux ? false
|
||||
|
||||
, # Allows you to set your own kernel version suffix (e.g.,
|
||||
# "-my-kernel").
|
||||
localVersion ? ""
|
||||
|
||||
, # Your own kernel configuration file, if you don't want to use the
|
||||
# default.
|
||||
kernelConfig ? null
|
||||
}:
|
||||
|
||||
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
||||
@ -33,6 +41,7 @@ stdenv.mkDerivation {
|
||||
extraConfig = lib.concatStrings (map (p: "\n" + p.extraConfig + "\n") kernelPatches);
|
||||
|
||||
config =
|
||||
if kernelConfig != null then kernelConfig else
|
||||
if userModeLinux then ./config-2.6.20-uml else
|
||||
if stdenv.system == "i686-linux" then ./config-2.6.20-i686-smp else
|
||||
if stdenv.system == "x86_64-linux" then ./config-2.6.20-x86_64-smp else
|
||||
@ -44,12 +53,15 @@ stdenv.mkDerivation {
|
||||
if userModeLinux then "um" else
|
||||
if stdenv.system == "i686-linux" then "i386" else
|
||||
if stdenv.system == "x86_64-linux" then "x86_64" else
|
||||
abort "";
|
||||
abort "Platform ${stdenv.system} is not supported.";
|
||||
|
||||
makeFlags = if userModeLinux then "ARCH=um SHELL=bash" else "";
|
||||
|
||||
inherit module_init_tools;
|
||||
|
||||
allowLocalVersion = false; # don't allow patches to set a suffix
|
||||
inherit localVersion; # but do allow the user to set one.
|
||||
|
||||
meta = {
|
||||
description =
|
||||
(if userModeLinux then
|
||||
|
Loading…
Reference in New Issue
Block a user