aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:10:44 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:10:44 +0000
commit594a4cf10ea8516d0117f96f483c7c5dc181024e (patch)
tree86acc0930157bac272207dc89072b6b73cc57505 /build
parenta9466ad0d5fea4b6a9b4aa183a32d6740f698156 (diff)
add-build-git-head-info.patch
This patch adds the branch and truncated head has to the version of the kernel # cat /proc/version Linux version 2.6.26-andy-2.6.26:2b3bf342baac52b9-mokodev (agreen@pads.home.warmcat.com) (gcc version 4.1.2) #878 PREEMPT Sun Jul 27 14:45:25 BST 2008 Note this versioning is visible down /lib/modules Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'build')
-rwxr-xr-xbuild9
1 files changed, 8 insertions, 1 deletions
diff --git a/build b/build
index 8c78e8da403..b2c21b6973c 100755
--- a/build
+++ b/build
@@ -4,7 +4,14 @@ set -x
export CROSS_COMPILE=../../cross/bin/arm-angstrom-linux-gnueabi-
make ARCH=arm silentoldconfig
-if make -j5 ARCH=arm CONFIG_DEBUG_SECTION_MISMATCH=y ; then
+VERSION=
+if [ -d .git ] ; then
+ HEAD=`git show --pretty=oneline | head -n1 | cut -d' ' -f1 | cut -b1-16`
+ BRANCH=`git branch | grep ^\* | cut -d' ' -f2`
+ VERSION=-$BRANCH:$HEAD
+fi
+
+if make -j5 ARCH=arm CONFIG_DEBUG_SECTION_MISMATCH=y EXTRAVERSION=$VERSION; then
${CROSS_COMPILE}objcopy -O binary -R .note -R .comment -S arch/arm/boot/compressed/vmlinux linux.bin
mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008000 -n "Openmoko Kernel Image Neo1973(GTA02)" -d linux.bin uImage.bin
exit 0