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.
commitb2c96062ca28a9073b8deeab9855f23352a260f9
authorTuomas Tynkkynen <tuomas@tuxera.com>
dateMon 13 Mar 2017, 18:47 (10 years ago)
parent57e768f
pkgs/os-specific/linux/kernel/manual-config.nix+7
@@ -102,6 +102,13 @@ let
102102 make $makeFlags "''${makeFlagsArray[@]}" oldconfig
103103 runHook postConfigure
104104
105+ make $makeFlags prepare
106+ actualModDirVersion="$(cat $buildRoot/include/config/kernel.release)"
107+ if [ "$actualModDirVersion" != "${modDirVersion}" ]; then
108+ echo "Error: modDirVersion specified in the Nix expression is wrong, it should be: $actualModDirVersion"
109+ exit 1
110+ fi
111+
105112 # Note: we can get rid of this once http://permalink.gmane.org/gmane.linux.kbuild.devel/13800 is merged.
106113 buildFlagsArray+=("KBUILD_BUILD_TIMESTAMP=$(date -u -d @$SOURCE_DATE_EPOCH)")
107114 '';