forked from Lankaster/miZy-uboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuboot_build
executable file
·77 lines (55 loc) · 1.32 KB
/
uboot_build
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
69
70
71
72
73
74
75
76
77
#!/bin/sh
## hyphop ##
. ./,config
#export LOGO_BMP=$bdir/logo.bmp
ok=1
#dtc="dtc.bin -W no-unit_address_vs_reg"
arm-openwrt-linux-gcc -v 2>&1 | grep -q musl- || {
echo "[e] arm gcc not ready! try to fix it
./uboot_clear_all
./uboot_prepare
" 1>&2
exit 1
}
[ -f $src/Makefile ] || {
echo "[e] uboot source not ready
./uboot_clear_all
./uboot_prepare
" 1>&2
exit 1
}
[ "$ok" ] && {
echo "[i] build uboot + args $uboot_make_args"
#CONFIG_LZ4=1
time make -C $src $uboot_make_args $@ > $logs/uboot.log || {
echo "[i] try to fix errors first";
exit 1
}
echo "[i] info"
}
uboot=`readlink u-boot-sunxi-with-spl.bin`
uboot_size=`stat --printf %s $uboot`
echo "[i] uboot size: $uboot_size bytes => $uboot"
#ls -l1 $uboot
for addr in `grep -E "linux_logo$" $src/u-boot.sym`; do
mizy_logo_addr=$addr
break
done
#mizy_logo_addr_f=.mizy_logo_addr
f=`readlink $mizy_logo_addr_f`
d=`dirname $f`
[ -d $d ] || mkdir -p $d
echo -n $mizy_logo_addr > $mizy_logo_addr_f
echo "[i] miZy logo addr: $mizy_logo_addr => $mizy_logo_addr_f => $f"
#file $uboot
./tools/uboot_fel_imp $uboot
p=$PWD
[ -d ../miZy/ ] && cd ../miZy/ && ./uboot_fix_run
cd $p
uboot_there=`readlink $uboot_mizy`
cmd="cp $uboot $uboot_there"
echo $cmd
$cmd && echo "[i] ok
get compiled uboot there:
$uboot_mizy => $uboot_there
"