aboutsummaryrefslogtreecommitdiff
path: root/build
blob: d0155ec97503df9ba6c46f6f992045fe5a68a7c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

set -x

export CROSS_COMPILE=../../cross/bin/arm-angstrom-linux-gnueabi-
make ARCH=arm silentoldconfig
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 Freerunner Kernel" -d linux.bin uImage.bin

	# we can see if it is an "moredrivers" build by looking for USB Eth gadget
	# if it is then keep a stamped copy of last build

	if [ ! -z "`grep CONFIG_USB_USBNET=y .config`" ] ; then
		rm -f uImage-moredrivers*
		cp uImage.bin uImage-moredrivers$VERSION.bin
	fi
	exit 0
else
	exit 1
fi