forked from cedesmith/cLK
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcompile
executable file
·47 lines (38 loc) · 1016 Bytes
/
compile
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
#!/bin/bash
export PATH=$PATH:/opt/codesourcery/bin/:/opt/arm-2009q1/bin/
if [ `which arm-none-eabi-gcc` ]; then
TOOLCHAIN_PREFIX="arm-none-eabi-"
elif [ `which arm-eabi-gcc` ]; then
TOOLCHAIN_PREFIX="arm-eabi-"
elif [ `which arm-none-linux-gnueabi-gcc` ]; then
TOOLCHAIN_PREFIX="arm-none-linux-gnueabi-"
else
echo "Cannot find compiler. Exit..."
exit 0
fi
export TOOLCHAIN_PREFIX
if [ "$1" = "clean" ]; then
cd lk
make htcleo clean
cd ..
rm bin/nbgen
fi
[ -f LEOIMG.nbh ] && rm LEOIMG.nbh
[ -f bin/lk.bin ] && rm bin/lk.bin
[ -f bin/os.nb.payload ] && rm bin/os.nb.payload
[ -f bin/os.nb ] && rm bin/os.nb
[ -f bin/RUU_signed.nbh ] && rm bin/RUU_signed.nbh
if [ ! -f bin/nbgen ]; then
gcc -std=c99 nbgen.c -o bin/nbgen
fi
cd lk
make htcleo DEBUG=1
[ $? -eq 0 ] || exit 1
cp build-htcleo/lk.bin ../bin/
cd ..
cd bin
chmod +x yang
./nbgen os.nb
./yang -F RUU_signed.nbh -f os.nb -t 0x400 -s 64 -d PB8110000 -c 11111111 -v CLK1.4.0.2 -l WWE
cd ..
cp bin/RUU_signed.nbh ./LEOIMG.nbh