s5pc1xx: support secure boot image
[kernel/u-boot.git] / build.sh
1 #!/bin/sh
2
3 # Set default cross compiler
4 CROSS_COMPILER=/opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-
5
6 # Check this system has ccache
7 check_ccache()
8 {
9         type ccache
10         if [ "$?" -eq "0" ]; then
11                 CCACHE=ccache
12         fi
13 }
14
15 check_users()
16 {
17         USER=`whoami`
18         if [ "$USER" = "kmpark" ]; then
19                 CROSS_COMPILER=/pub/toolchains/gcc-4.4.1/bin/arm-none-linux-gnueabi-
20                 JOBS="-j 4"
21         fi
22         if [ "$USER" = "dofmind" ]; then
23                 CROSS_COMPILER=arm-none-linux-gnueabi-
24                 JOBS="-j 5"
25         fi
26         if [ "$USER" = "prom" ]; then
27                 CROSS_COMPILER=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
28                 JOBS="-j 5"
29         fi
30         if [ "$USER" = "jaehoon" ]; then
31                 CROSS_COMPILER=/usr/local/arm/arm-2008q3/bin/arm-none-linux-gnueabi-
32                 JOBS="-j 5"
33         fi
34         if [ "$USER" = "dh09.lee" ]; then
35                 CROSS_COMPILER=/usr/local/arm/arm-2008q3/bin/arm-none-linux-gnueabi-
36                 JOBS="-j 5"
37         fi
38 }
39
40 build_uboot()
41 {
42         make ARCH=arm CROSS_COMPILE="$CCACHE $CROSS_COMPILER" $JOBS $*
43 }
44
45 make_evt_image()
46 {
47         cat onenand_ipl/onenand-ipl-16k-evt0.bin u-boot.bin > u-boot-onenand-evt0.bin
48         cat onenand_ipl/onenand-ipl-16k-secure.bin u-boot.bin > u-boot-onenand-secure.bin
49         # To distinguish previous u-boot-onenand.bin, it uses the evt1 suffix
50         cp u-boot-onenand.bin u-boot-onenand-evt1.bin
51 }
52
53 check_ccache
54 check_users
55
56 build_uboot $*
57
58 make_evt_image
59
60 size=`ls -al u-boot-onenand.bin | awk -F' ' '{printf $5}'`
61 if [ "$size" -ge "262144" ]; then
62         echo "u-boot-onenand.bin execced the 256KiB 262144 -> $size"
63         exit
64 fi
65
66 if [ "$USER" = "kmpark" ]; then
67         ls -al u-boot.bin u-boot-onenand.bin u-boot-onenand-evt0.bin
68         # To prevent wrong program
69         cp -f u-boot-onenand-evt0.bin u-boot-onenand.bin
70         cp -f u-boot.bin u-boot-onenand.bin u-boot-onenand-evt0.bin /tftpboot
71         ls -al onenand_ipl
72         pushd ../images
73         ./system.sh
74         popd
75 elif [ "$USER" = "dofmind" ]; then
76         tar cvf system_uboot_evt0.tar u-boot-onenand-evt0.bin
77         tar cvf system_uboot_evt1.tar u-boot-onenand-evt1.bin
78         tar cvf system_uboot.tar u-boot-onenand.bin
79         mv -f system_uboot*.tar /home/work
80 elif [ "$USER" = "prom" ]; then
81         tar cvf system_uboot_evt0.tar u-boot-onenand-evt0.bin
82         tar cvf system_uboot_evt1.tar u-boot-onenand-evt1.bin
83         mv -f system_uboot* /home/share/Work/bin
84 fi