-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathuboot_prepare
executable file
·100 lines (74 loc) · 1.57 KB
/
uboot_prepare
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/sh
## hyphop ##
. ./,config
[ -f $src/._PREPARED_ ] && {
echo "[i] prepared already!!!
NEXT:
./uboot_build
" 1>&2;
exit 0
}
[ -d $logs ] || mkdir $logs
[ -d ../bin/uboot ] || mkdir -p ../bin/uboot
[ -d ,tmp ] || mkdir -p ,tmp
[ -s $src/Makefile ] || {
# prefer squashfs source
[ -s $squash_src ] || {
cmd="wget $squash_src_link -O ../$squash_src_name"
echo $cmd
$cmd
}
[ -s $squash_src ] && {
echo "mount squash & overlay"
./mount_overlay_squash || echo "overlay method failed, trying another way..."
}
}
#exit;
[ -s $src/Makefile ] || {
echo "empty source dir"
a=uboot.tar.xz
[ -s $a ] && {
echo "unpack source $a"
tar -xf $a
rm uboot-mizy
mv uboot uboot-mizy
}
}
[ -s $src/Makefile ] || {
git clone --depth 1 -b v2017.01 https://github.com/RobertCNelson/u-boot $src
rm -rd $src/.git
}
#exit
[ -x $dtc/dtc ] || ./dtc_prepare_make
arm-openwrt-linux-gcc --version 2>/dev/null 1>/dev/null || {
[ -s ../$tc_gcc_squash ] || {
cmd="wget $squash_tc_link -O ../$squash_tc_name"
echo $cmd
$cmd
#exit 0
}
[ -s ../$tc_gcc_squash ] && {
[ -d ../$tc_gcc_dir ] || mkdir ../$tc_gcc_dir
cmd="mount -o ro ../$tc_gcc_squash ../$tc_gcc_dir"
echo $cmd
$cmd
}
# [ -s $tc_gcc.tar.bz2 ] || wget $tc_src
# tar -xf $tc_gcc.tar.bz2
# ln -s $tc_gcc/$tc_gcc_dir $tc_gcc_dir
}
cd $bdir
#exit;
#ls -l1 $patches/
cd $src
cat ../$patches/*.patch | patch -p1
rm configs/*
cp -a ../$add/* .
cd ..
./uboot_defconfig && {
echo 1 > $src/._PREPARED_
echo "[i] ok source is prepared
NEXT:
./uboot_build
"
}