-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathuboot_compile.sh
More file actions
executable file
·66 lines (58 loc) · 1.54 KB
/
uboot_compile.sh
File metadata and controls
executable file
·66 lines (58 loc) · 1.54 KB
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
#!/bin/bash
set -e
#################################
##
## Compile U-boot
## This script will compile u-boot and merger with scripts.bin, bl31.bin and dtb.
#################################
# ROOT must be top direct.
if [ -z $ROOT ]; then
ROOT=`cd .. && pwd`
fi
# PLATFORM.
if [ -z $PLATFORM ]; then
PLATFORM="OrangePiH5_PC2"
fi
# Uboot direct
UBOOT=$ROOT/uboot
# Compile Toolchain
TOOLS=$ROOT/toolchain/gcc-linaro-aarch/gcc-linaro/bin/arm-linux-gnueabihf-
BUILD=$ROOT/output
CORES=$((`cat /proc/cpuinfo | grep processor | wc -l` - 1))
# Perpar souce code
if [ ! -d $UBOOT ]; then
whiptail --title "OrangePi Build System" \
--msgbox "u-boot doesn't exist, pls perpare u-boot source code." \
10 50 0
exit 0
fi
cd $UBOOT
clear
echo "Compile U-boot......"
if [ ! -f $UBOOT/u-boot-sun50iw2p1.bin ]; then
make sun50iw2p1_config
fi
make -j${CORES}
echo "Complete compile...."
echo "Compile boot0......"
if [ ! -f $UBOOT/sunxi_spl/boot0/boot0_sdcard.bin ]; then
make sun50iw2p1_config
fi
make spl
cd -
echo "Complete compile...."
#####################################################################
###
### Merge uboot with different binary
#####################################################################
cd $ROOT/scripts/pack/
./pack
###
# Cpoy output file
cp $ROOT/output/pack/out/boot0_sdcard.fex $ROOT/output/boot0.bin
cp $ROOT/output/pack/out/boot_package.fex $ROOT/output/uboot.bin
rm -rf $ROOT/output/pack/out
# Change to scripts direct.
cd -
whiptail --title "OrangePi Build System" \
--msgbox "Build uboot finish. The output path: $BUILD" 10 60 0