summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/generate-config.pl
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-01-01 09:21:25 -0500
committerShea Levy <shea@shealevy.com>2014-01-01 09:21:25 -0500
commitf95d214cfdf115b9444acc5ce8060a5b1b23ed77 (patch)
tree50c8abd98c10500e3c4729bb910154d067261b4b /pkgs/os-specific/linux/kernel/generate-config.pl
parenta87b1f36e0095956b9b170f2c7071263a36ae155 (diff)
downloadnixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar.gz
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar.bz2
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar.lz
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar.xz
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.tar.zst
nixpkgs-f95d214cfdf115b9444acc5ce8060a5b1b23ed77.zip
Implement generic kernel build via manual-config
This has three major benefits:

1. We no longer have two kernel build processes to maintain

2. The build process is (IMO) cleaner and cleaves more closely to
upstream. In partuclar, we use make install to install the kernel and
development source/build trees, eliminating the guesswork about which
files to copy.

3. The derivation has multiple outputs: the kernel and modules are in
the default `out' output, while the build and source trees are in a
`dev' output. This makes it possible for the full source and build tree
to be kept (which is expected by out-of-tree modules) without bloating
the closure of the system derivation.

In addition, if a solution for how to handle queries in the presence of
imports from derivations ever makes it into nix, a framework for
querying the full configuration of the kernel in nix expressions is
already in place.

Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/os-specific/linux/kernel/generate-config.pl')
-rw-r--r--pkgs/os-specific/linux/kernel/generate-config.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl
index 78663098fb3..20abe1015c3 100644
--- a/pkgs/os-specific/linux/kernel/generate-config.pl
+++ b/pkgs/os-specific/linux/kernel/generate-config.pl
@@ -11,6 +11,9 @@
 
 use strict;
 use IPC::Open2;
+use Cwd;
+
+my $wd = getcwd;
 
 my $debug = $ENV{'DEBUG'};
 my $autoModules = $ENV{'AUTO_MODULES'};
@@ -36,7 +39,7 @@ close ANSWERS;
 sub runConfig {
 
     # Run `make config'.
-    my $pid = open2(\*IN, \*OUT, "make config SHELL=bash ARCH=$ENV{ARCH}");
+    my $pid = open2(\*IN, \*OUT, "make -C $ENV{SRC} O=$wd config SHELL=bash ARCH=$ENV{ARCH}");
 
     # Parse the output, look for questions and then send an
     # appropriate answer.