Commit graph

111 commits

Author SHA1 Message Date
Michael Raskin efb0c56db4 Update linux_testing and enable parallel build of Linux kernel 2014-06-30 10:52:33 +04:00
Austin Seipp 80d0e31a94 kernel: allow features to be used in common-config
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-18 08:49:32 -05:00
Shea Levy cb9cc87a39 kernel.passthru: Don't include meta to be consistent with stdenv.mkDerivation
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-21 21:12:58 -05:00
Shea Levy fd999ed570 Linux: Set passthru attr to contain full passthru
This fixes #1566, thanks @wizeman

Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-21 21:06:27 -05:00
Shea Levy d18bc25b95 Rename linuxManualConfig to buildLinux
Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-21 20:05:55 -05:00
Shea Levy ac2035287f Greatly reduce kernel closure size
Based on access analysis with strace, I determined an essentially
minimal required set of files from the kernel source that was needed to
build all current kernel packages on 3.10, which ultimately resulted in
keeping 30M of source. Generalizing from that minimal set, which
required ad-hoc specifications of which headers outside of include/ and
arch/*/include and which files in the scripts/ directory should be kept,
to a policy of keeping all non-arch-specific headers that aren't part of
the drivers/ directory and the entire scripts/ directory added an
additional 17M, but there was nothing in the analysis that indicated
that that ad-hoc specification was at all complete so I think the extra
hit is worth the likely greater compatibility.

For reference, we now keep:

* All headers that are NOT in arch/${notTargetArch}/include or drivers/
* The scripts/ directory
* Makefile
* arch/${targetArch}/Makefile

IMO the most likely cause of future problems are the headers in
drivers/, but hopefully they won't actually be needed as they add 50M
Ideally kernel packages would only use include and
arch/${targetArch}/include, but alas this is observably not the case.

master:
  * $out
    * size: 234M
    * references-closure: linux-headers, glibc, attr, acl, zlib, gcc,
      coreutils, perl, bash
merge-kernel-builds:
  * $out
    * size: 152M
    * references-closure: none
  * $dev
    * size: 57M
    * references-closure: linux-headers, glibc, zlib, gcc

So even with the non-minimal set we still beat out master. Keeping the
drivers headers would make us only slightly bigger.

Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-05 06:55:47 -05:00
Shea Levy 2c38df1c5b kernel build: limit dev output footprint
This makes the disk usage footprint of building the kernel smaller in 3
ways:

1) There is no separate kernel source derivation
2) Rather than using the entire build tree, only the output of make
modules_prepare is kept in the $dev output (plus the module symbol
versioning file generated during the build)
3) Only the subset of the source tree known to be needed for external
builds is kept in $dev

Note that while 2) is supported by official kernel documentation, I
couldn't find any source describing what we need to keep for 3). I've
started with the bare minimum (the main Makefile is called by the
Makefile generated by make modules_prepare) and we can/should add more
as needed for kernelPackages.

Signed-off-by: Shea Levy <shea@shealevy.com>
2014-01-01 23:56:24 -05:00
Shea Levy f95d214cfd 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>
2014-01-01 09:21:25 -05:00
Eelco Dolstra a2cbc77e4f Only show/build a package on the platforms listed in meta.platforms
The function ‘mkDerivation’ now checks whether the current platform
type is included in a package's meta.platform field.  If not, it
throws an exception:

  $ nix-build -A linux --argstr system x86_64-darwin
  error: user-thrown exception: the package ‘linux-3.10.15’ is not supported on ‘x86_64-darwin’

These packages also no longer show up in ‘nix-env -qa’ output.  This
means, for instance, that the number of packages shown on
x86_64-freebsd has dropped from 9268 to 4764.

Since meta.platforms was also used to prevent Hydra from building some
packages, there now is a new attribute meta.hydraPlatforms listing the
platforms on which Hydra should build the package (which defaults to
meta.platforms).
2013-11-05 00:06:10 +01:00
Eelco Dolstra d9a4706f73 linux: Use kmod instead of module-init-tools 2013-08-09 18:48:51 +02:00
Eelco Dolstra 7ce325f3e0 Unify the Linux kernel configurations
Having N different copies of the NixOS kernel configuration is bad
because these copies tend to diverge.  For instance, our 3.10 config
lacked some modules that were enabled in older configs, probably
because the 3.10 config had been copied off an earlier version of some
older kernel config.

So now there is a single kernel config in common-config.nix.  It has a
few conditionals to deal with new/removed kernel options, but
otherwise it's pretty straightforward.

Also, a lot of cut&paste boilerplate between the kernel Nix
expressions is gone (such as preConfigure).
2013-08-01 01:40:40 +02:00
Eelco Dolstra dccbdcf520 linux: Don't put the kernel version in meta 2013-08-01 01:40:40 +02:00
Eelco Dolstra 674c51af3c Merge remote-tracking branch 'origin/master' into stdenv-updates 2013-03-07 19:33:52 +01:00
Michael Raskin b72134dc11 Linux: Add 3.9-rc1 as lowPrio (it has a regression fix 3.8.2 lacks) 2013-03-06 23:59:49 +04:00
Peter Simons 5f32207dfc Merge remote-tracking branch 'origin/master' into stdenv-updates. 2013-02-24 19:27:08 +01:00
Shea Levy afe3758b1b Remove myself from kernel maintainers.
I use manual config now.
2013-02-21 12:39:25 -05:00
Eelco Dolstra ab3eeabfed Rename buildNativeInputs -> nativeBuildInputs
Likewise for propagatedBuildNativeInputs, etc.  "buildNativeInputs"
sounds like an imperative rather than a noun phrase.
2012-12-28 19:20:09 +01:00
Eelco Dolstra 5be0a9acd7 Rename hostDrv -> crossDrv, buildDrv -> nativeDrv
This is for consistency with terminology in stdenv (and the terms
"hostDrv" and "buildDrv" are not very intuitive, even if they're
consistent with GNU terminology).
2012-12-28 19:08:19 +01:00
Shea Levy 9ddd1cc78b Linux 3.7
Kernel configuration succeeds, I'll let hydra test the build
2012-12-11 11:57:04 -05:00
Eelco Dolstra 0874615fcc Remove User Mode Linux
It hasn't built in a long time and it's obsolete IMHO.
2012-09-21 13:32:37 -04:00
Nicolas Pierron 82b308bf11 Add armv7l support.
svn path=/nixpkgs/trunk/; revision=33798
2012-04-15 23:41:25 +00:00
Lluís Batlle i Rossell 4a1c721c01 Changing every reference from mips64-linux to mips64el-linux. That's
what the new nix thinks the fuloong is.

Anyone having the old nix should use a nixpkgs previous to this change to build
the new nix. And then, with the new nix, he can use any newer nixpkgs revision.

svn path=/nixpkgs/trunk/; revision=31751
2012-01-21 00:34:51 +00:00
Florian Friesdorf 805a4c0261 linux/kernel - added myself to maintainers
svn path=/nixpkgs/trunk/; revision=29811
2011-10-13 09:23:22 +00:00
Shea Levy 5a5602184e Whoops, forgot to re-inherit postBuild now that it's not set manually
I really should have done these changes in a topic branch, sorry

svn path=/nixpkgs/trunk/; revision=29567
2011-10-02 17:12:50 +00:00
Shea Levy 34144e835d Linux 3.x: Use our module directory during modules_install
The "unset MODULE_DIR" trick was enough to get Linux 3.x kernels compiling, but it was definitely the Wrong Thing
We NEED MODULE_DIR set so that depmod can store the right dependencies during the build. The REAL problem with the
3.x kernels was two-fold: Our module-init-tools was so old that the kernel build needed to introduce a hack when
calling depmod (involving creating a symlink prepending 99.98 to the version number), and the depmod wrapper was
moved out of the Makefile into scripts/depmod.sh, so our substituteInPlace to get rid of '-b $(INSTALL_MOD_PATH)' in
the Makefile was a noop and INSTALL_MOD_PATH was still being passed to depmod. This is now fixed and modprobe can
successfully find dependencies using the modules.dep created during install

svn path=/nixpkgs/trunk/; revision=29559
2011-10-02 11:01:08 +00:00
Shea Levy 4add420a48 aufs3 kernelPackage
svn path=/nixpkgs/trunk/; revision=29534
2011-09-28 21:46:07 +00:00
Shea Levy ffdc37215a kernel/generic.nix: Add a passed-thru modDirVersion attribute
With the new kernel versioning scheme, the first release in a series only has a version number and
a major revision number (e.g. linux 3.0, linux 3.1-rc1, etc.). Unfortunately, the module
directory for these kernels still has a minor revision number (e.g. lib/modules/3.0.0, lib/modules/3.0.1-rc1, etc.).
This causes problems for packages such as broadcom_sta that need to know the module directory, so
this attribute will allow setting the module directory version number separate from the
kernel version number when necessary.

svn path=/nixpkgs/trunk/; revision=28405
2011-08-08 20:49:49 +00:00
Shea Levy 20ebca303e Add comments explaining the purpose of the postBuild prepend
svn path=/nixpkgs/trunk/; revision=27922
2011-07-24 20:24:23 +00:00
Shea Levy 5db8c88547 Fix problem with linux 3.0 trying to install in /nix/store/...
Thanks to MarcWeber on IRC for helping with this

svn path=/nixpkgs/trunk/; revision=27921
2011-07-24 20:24:12 +00:00
Ludovic Courtès 5795d23320 Linux: Actually use `postBuild'.
svn path=/nixpkgs/trunk/; revision=27833
2011-07-19 09:03:09 +00:00
Ludovic Stordeur 69dca5f4aa Add meta.platforms to the Linux kernel expression.
svn path=/nixpkgs/trunk/; revision=27722
2011-07-11 14:07:21 +00:00
Ludovic Stordeur 8268a39690 Improved the Linux kernel building framework
Moved the hardcoded postBuild hook from the builder to generic.nix:

Some old kernel (such as 2.6.15) did not yet support the unifdef target.
As a result, compiling them with the current Linux builder leads to a
failure.
Fixed by moving this hook as argument of the top-level function of
generic.nix. This allows some kernel nix codes to overrides its default
value.

svn path=/nixpkgs/trunk/; revision=27708
2011-07-11 13:59:37 +00:00
Lluís Batlle i Rossell 2c5de61327 Updating from trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=23840
2010-09-17 19:10:21 +00:00
Eelco Dolstra 13f346058c * Add a branch of the Linux kernel that can be used in Xen's Dom0.
From http://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git;a=shortlog;h=refs/heads/xen/stable-2.6.32.x

svn path=/nixpkgs/trunk/; revision=23729
2010-09-10 16:27:39 +00:00
Lluís Batlle i Rossell 641f956581 Setting any stdenv.system references for the loongson2f system to 'mips64-linux'.
(my git-svn info:)
Merge branch 'mips64' into stdenv-updates

Conflicts:
	pkgs/applications/networking/browsers/firefox/3.6.nix
	pkgs/top-level/all-packages.nix

svn path=/nixpkgs/branches/stdenv-updates/; revision=23588
2010-09-01 09:50:12 +00:00
Lluís Batlle i Rossell f16353b6f2 Updated from trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=23275
2010-08-20 13:41:12 +00:00
Eelco Dolstra e4686546ec * Enable parallel building for the Linux kernel, an obvious candidate.
svn path=/nixpkgs/trunk/; revision=23109
2010-08-11 10:43:09 +00:00
Lluís Batlle i Rossell eddc9d6ab5 Fixing the nanonote kernel expressions so they work.
In fact only 2.6.34 boots fine, while 2.6.35 needs a fetchsvn new revision,
waiting for an upstream patch.

svn path=/nixpkgs/branches/stdenv-updates/; revision=23039
2010-08-08 18:46:57 +00:00
Lluís Batlle i Rossell 8783e812b5 More changes beyond stdenv-linux for the fuloong2f platform
svn path=/nixpkgs/branches/stdenv-updates/; revision=22973
2010-08-05 18:51:12 +00:00
Lluís Batlle i Rossell 11c20b3a2c Making the cross kernel builds take properly the cross-built uboot, when needed.
svn path=/nixpkgs/trunk/; revision=20455
2010-03-06 22:04:21 +00:00
Lluís Batlle i Rossell ef1918f200 Allowing the kernel to build in the sheevaplug natively.
svn path=/nixpkgs/trunk/; revision=20284
2010-02-28 08:58:07 +00:00
Lluís Batlle i Rossell 289d728337 Fixing the kernel expressions to allow normal and cross-building, depending
on the native and cross platforms.

I thought I already did that today in a previous commit, but I did all wrong.

svn path=/nixpkgs/trunk/; revision=20280
2010-02-27 21:48:48 +00:00
Lluís Batlle i Rossell 3b747e92e5 Fixing the correct handling of uboot in the initrd and the kernel derivations.
(nixos on sheevaplug)


svn path=/nixpkgs/trunk/; revision=20275
2010-02-27 18:51:06 +00:00
Lluís Batlle i Rossell 50e309f022 linux: Removing some assertions on armv5tel no more valid when cross-building.
svn path=/nixpkgs/trunk/; revision=20119
2010-02-18 21:10:53 +00:00
Lluís Batlle i Rossell 70cb7050f5 Trying to make the linux kernels also cross-build.
svn path=/nixpkgs/trunk/; revision=20080
2010-02-17 22:20:56 +00:00
Lluís Batlle i Rossell c86da889cc Made the kernel generate-config "build as modules as you can" an option.
Sepcifically, a nixpkgs "platform" option. So, for PC all remained the same
as it was.

svn path=/nixpkgs/trunk/; revision=20059
2010-02-16 19:27:51 +00:00
Lluís Batlle i Rossell 9183f21f7e Merging from trunk.
I fixed conflicts regarding the renaming 'kernel' -> 'linux' in all-packages.
Also a small conflict in all-packages about making openssl overridable.
And I some linux 2.6.31-zen kernel files also marked in conflict.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19438
2010-01-14 14:49:31 +00:00
Eelco Dolstra 0f38401813 * Latest and greatest kernels.
svn path=/nixpkgs/trunk/; revision=19287
2010-01-07 14:10:39 +00:00
Lluís Batlle i Rossell d5aa5641de Fixing the evaluation of the linux kernel (= /= ==)
svn path=/nixpkgs/branches/stdenv-updates/; revision=19138
2009-12-28 11:26:23 +00:00
Lluís Batlle i Rossell 1452ce46a4 Fixing the kernel configuration for the sheevaplug
svn path=/nixpkgs/branches/stdenv-updates/; revision=19137
2009-12-28 10:35:34 +00:00
Lluís Batlle i Rossell 9ef11e4c4d Made the linux kernel expressions support 'platform' again (thinking on reusing
most of the kernel expressions for the sheevaplug).
I still have not added anything in the kernels about cross compilation.
I moved the platform definitions out of all-packages.
I have not written good platform definitions for the sheevaplug - only for the
PC.
Only the linux-2.6.32 expression uses the platforms kernelConfig.
The linux-2.6.31 was broken, and I left it broken.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19046
2009-12-19 12:12:24 +00:00
Lluís Batlle i Rossell 5bae851b1e Merging from trunk. I had to give away some structure to build the native
sheevaplug kernel, so the kernel does not build in the sheevaplug right now.
I will try to fix that in next commits.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19045
2009-12-19 11:14:16 +00:00
Eelco Dolstra c3e80cbc9f * Get User-Mode Linux to build with a newer kernel. Yes, SHELL really
has to be "/bin/sh" - other values such as "sh" or "bash" or "$(type
  -tP sh)" cause a build error:

  LD      .tmp_vmlinux1
  /nix/store/1yv8i1m76cvwk5w5i5wrk4gj5zyfj6vh-binutils-2.19.1/bin/ld:arch/um/kernel/vmlinux.lds:1: ignoring invalid character `#' in expression
  /nix/store/1yv8i1m76cvwk5w5i5wrk4gj5zyfj6vh-binutils-2.19.1/bin/ld:arch/um/kernel/vmlinux.lds:1: syntax error
  collect2: ld returned 1 exit status

  This is caused by Bash 4.0
  (http://bugzilla.kernel.org/show_bug.cgi?id=13343).

svn path=/nixpkgs/branches/kernel-config/; revision=18941
2009-12-14 17:22:38 +00:00
Eelco Dolstra 71ed6194e1 * Get fbcondecor to work.
* Barf on ignored options.

svn path=/nixpkgs/branches/kernel-config/; revision=18914
2009-12-12 18:55:17 +00:00
Eelco Dolstra 03e45e0cb4 * Added a script to generate the kernel configuration.
`generate-config.pl' runs `make config' to generate a Linux kernel
  configuration file.  For each question (i.e. kernel configuration
  option), unless an override is provided, it answers "m" if possible,
  and otherwise uses the default answer (as determined by the default
  config for the architecture).  This is safer than allmodconfig,
  which answers "y" everywhere it can't answer "m" and thus ends up
  enabling a lot of experimental or debug options.  (For this reason,
  a configuration generated by allmodconfig must be carefully checked
  with every new release to ensure that nothing dangerous is enabled.
  The default config should be safer wrt new kernel releases.)

  Overrides are specified in the `config' argument to generic.nix,
  which is a string that contains lines such as `EXT2_FS_POSIX_ACL y'.
  The script warns about ignored options, and aborts if `make config'
  selects an answer inconsistent with the one in `config'.  This
  allows us to be sure that `make config' doesn't silently override
  our configuration values (e.g., depending on other options, it will
  set FB_TILEBLITTING to "y" even if we want it to be "n").

svn path=/nixpkgs/branches/kernel-config/; revision=18910
2009-12-12 13:51:07 +00:00
Lluís Batlle i Rossell 7769ad11bd Updating the logic to put the resulting kernel image into its store path.
svn path=/nixpkgs/branches/stdenv-updates/; revision=18289
2009-11-08 17:19:46 +00:00
Lluís Batlle i Rossell 4b27d28701 Porting changes from stdenv-updates into this branch.
This comes from:
svn diff  ^/nixpkgs/trunk/@18255 ^/nixpkgs/branches/stdenv-updates/ > diff
patch -p0 < diff
and then adding into svn all files new from the patch.

trunk@18255 comes from the last time I updated stdenv-updates from trunk.


svn path=/nixpkgs/stdenv-updates2/; revision=18272
2009-11-08 00:32:12 +00:00
Michael Raskin 491255bbb3 Trying to add Zen Linux Kernel
svn path=/nixpkgs/trunk/; revision=17050
2009-09-11 13:16:18 +00:00
Michael Raskin 8eefb03231 Fix typo
svn path=/nixpkgs/trunk/; revision=16383
2009-07-15 21:09:17 +00:00
Michael Raskin 4e9b120ad2 small fixes to build custom kernel
svn path=/nixpkgs/trunk/; revision=13795
2009-01-17 13:40:12 +00:00
Eelco Dolstra a0670a904e * Reduce duplication between kernel expressions.
svn path=/nixpkgs/trunk/; revision=13778
2009-01-15 15:40:23 +00:00
Renamed from pkgs/os-specific/linux/kernel/linux.nix (Browse further)