From 9a4f2b90368323e4ecf435c787b2d7c403cad072 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Tue, 23 Aug 2005 19:13:00 +0000 Subject: [PATCH] embed Nix generated hash into kernel image and module path svn path=/nixpkgs/trunk/; revision=3672 --- pkgs/os-specific/linux/kernel/builder.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh index e7784e19addf..3632ddc50d93 100644 --- a/pkgs/os-specific/linux/kernel/builder.sh +++ b/pkgs/os-specific/linux/kernel/builder.sh @@ -2,6 +2,15 @@ buildPhase() { cp $config .config + #mkdir $out + hashname=$(basename $out) + echo $hashname + if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then + hashname=$(echo "$hashname" | cut -c -32) + fi + + extraname=$(grep ^EXTRAVERSION Makefile) + perl -p -i -e "s/^EXTRAVERSION.*/$extraname-$hashname/" Makefile echo "export INSTALL_PATH=$out" >> Makefile export INSTALL_MOD_PATH=$out make @@ -10,7 +19,7 @@ buildPhase() { # move this to install later on # largely copied from early FC3 kernel spec files stripHash $out - version=$(echo $strippedName | cut -c 7-) + version=$(echo $strippedName | cut -c 7-)-$hashname # remove symlinks and create directories rm $out/lib/modules/${version}/build