-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkuboot.sh
executable file
·81 lines (73 loc) · 1.94 KB
/
mkuboot.sh
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
#!/usr/bin/env bash
mkdir -p build
if [ -z "$URL" ]
then
export URL="https://github.com/revyos/thead-u-boot"
fi
if [ -z "$BRANCH" ]
then
export BRANCH="lpi4a"
fi
if [ -z "$CROSS_COMPILE" ]
then
# must use thead's toolchain
# https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1663142514282/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.1-20220906.tar.gz
#export CROSS_COMPILE="riscv64-unknown-linux-gnu-"
# generic toolchain
export CROSS_COMPILE="riscv64-linux-gnu-"
fi
if [ -z "$COMMIT" ]
then
export COMMIT="34dd739d4c4e513e80f9e5afc088e2427090d106"
fi
set -eux
if [ ! -e build/uboot ]
then
git clone $URL build/uboot --branch=${BRANCH}
cd build/uboot
git reset --hard $COMMIT
find ../../uboot/ -name *.patch | sort | while read line
do
git am $line
done
cd ../../
fi
cd build/uboot
export ARCH=riscv
make clean
make light_lpi4a_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-sbc.bin
make clean
make light_lpi4a_16g_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-sbc-16g.bin
make clean
make light_lpi4a_console_defconfig
cp ../../overlay/boot/logos/sipeed-console.bmp tools/logos/custom.bmp
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-console.bin
make clean
make light_lpi4a_cluster_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-cluster-8g.bin
make clean
make light_lpi4a_cluster_16g_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-cluster-16g.bin
make clean
make light_lpi4a_console_16g_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-console-16g.bin
make clean
mv ../u-boot*.bin ../../overlay/opt/
make light_lpi4a_z14inch_m0_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-z14inch-m0.bin
make clean
mv ../u-boot*.bin ../../overlay/opt/
make light_lpi4a_z14inch_m0_16g_defconfig
make -j$(nproc)
cp u-boot-with-spl.bin ../u-boot-with-spl-z14inch-m0-16g.bin
make clean
mv ../u-boot*.bin ../../overlay/opt/