From b2c96062ca28a9073b8deeab9855f23352a260f9 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Mon, 13 Mar 2017 18:47:21 +0200 Subject: [PATCH] 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. --- pkgs/os-specific/linux/kernel/manual-config.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 83020ad35a2b..e07a89fc1e64 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)") '';