summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2017-03-13 18:47:21 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-03-13 18:47:21 +0200
commitb2c96062ca28a9073b8deeab9855f23352a260f9 (patch)
tree2c3f3c2c0a956e0cb5485a0dc9af6ada3eac0456 /pkgs/os-specific/linux/kernel/manual-config.nix
parent57e768f58e7d2019ea19520226d5fb6e05e98c96 (diff)
downloadnixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar.gz
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar.bz2
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar.lz
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar.xz
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.tar.zst
nixpkgs-b2c96062ca28a9073b8deeab9855f23352a260f9.zip
kernel: Add a validity check for modDirVersion
Because if you get it wrong, you get a very confusing error message at
the end of the kernel build, which is quite painful as the build can
take a long time.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 83020ad35a2..e07a89fc1e6 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -102,6 +102,13 @@ let
         make $makeFlags "''${makeFlagsArray[@]}" oldconfig
         runHook postConfigure
 
+        make $makeFlags prepare
+        actualModDirVersion="$(cat $buildRoot/include/config/kernel.release)"
+        if [ "$actualModDirVersion" != "${modDirVersion}" ]; then
+          echo "Error: modDirVersion specified in the Nix expression is wrong, it should be: $actualModDirVersion"
+          exit 1
+        fi
+
         # Note: we can get rid of this once http://permalink.gmane.org/gmane.linux.kbuild.devel/13800 is merged.
         buildFlagsArray+=("KBUILD_BUILD_TIMESTAMP=$(date -u -d @$SOURCE_DATE_EPOCH)")
       '';