From 8268a39690b036f9687ced0db23e9760505ec8c6 Mon Sep 17 00:00:00 2001 From: Ludovic Stordeur Date: Mon, 11 Jul 2011 13:59:37 +0000 Subject: [PATCH] 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 --- pkgs/os-specific/linux/kernel/builder.sh | 15 ++++----------- pkgs/os-specific/linux/kernel/generic.nix | 4 ++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh index 5bedebc11ec..61cb8f28081 100644 --- a/pkgs/os-specific/linux/kernel/builder.sh +++ b/pkgs/os-specific/linux/kernel/builder.sh @@ -16,8 +16,8 @@ postPatch() { } configurePhase() { - if test -n "$preConfigure"; then - eval "$preConfigure"; + if test -n "$preConfigure"; then + eval "$preConfigure"; fi export INSTALL_PATH=$out @@ -46,13 +46,6 @@ configurePhase() { } -postBuild() { - # After the builder did a 'make all' (kernel + modules) - # we force building the target asked: bzImage/zImage/uImage/... - make $makeFlags $kernelTarget - make $makeFlags -C scripts unifdef -} - installPhase() { ensureDir $out @@ -149,8 +142,8 @@ installPhase() { fi fi - if test -n "$postInstall"; then - eval "$postInstall"; + if test -n "$postInstall"; then + eval "$postInstall"; fi } diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 42cefd5b584..138c9a53d04 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -35,6 +35,10 @@ , extraMeta ? {} , ubootChooser ? null , postInstall ? "" + +, # After the builder did a 'make all' (kernel + modules) + # we force building the target asked: bzImage/zImage/uImage/... + postBuild ? "make $makeFlags $kernelTarget; make $makeFlags -C scripts unifdef" , ... }: