aboutsummaryrefslogtreecommitdiff
path: root/build
blob: a0f60e520f7878fad9242783c45fd0b4eaaf8f0b (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh

# set -x

export CROSS_COMPILE=../../cross/bin/arm-angstrom-linux-gnueabi-
make ARCH=arm silentoldconfig

PRODUCT=

if [ ! -z "`grep CONFIG_MACH_NEO1973_GTA01=y .config`" ] ; then
	START=30008000
	PRODUCT=GTA01
fi

if [ ! -z "`grep CONFIG_MACH_NEO1973_GTA02=y .config`" ] ; then
	START=30008000
	PRODUCT=GTA02
fi

if [ ! -z "`grep CONFIG_MACH_OPENMOKO_GTA03=y .config`" ] ; then
        START=50008000
        PRODUCT=GTA03
fi

if [ ! -z "`grep CONFIG_MACH_M800=y .config`" ] ; then
	START=30008000
	PRODUCT=M800
fi

if [ -z "$PRODUCT" ] ; then
	echo "Unable to figure out what we are building from the config"
	exit 1
fi

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=-$PRODUCT\_$BRANCH\_$HEAD
fi


echo $MKIMAGECMD

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 $START -e $START -n "OM $PRODUCT $BRANCH""_$HEAD" -d linux.bin uImage-$PRODUCT.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-$PRODUCT*.bin modules-$PRODUCT*.tar.gz
		cp uImage-$PRODUCT.bin uImage-moredrivers$VERSION.bin
		rm -rf staging
		mkdir -p staging
		if [ ! -z "$1" ] ; then
			make ARCH=arm modules_install INSTALL_MOD_PATH=staging
			cd staging
			tar czf ../modules$VERSION.tar.gz .
			cd ..
		fi
	fi
	exit 0
else
	exit 1
fi