forked from loboris/OrangePI-Kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_scripts.sh
executable file
·130 lines (109 loc) · 5.2 KB
/
build_scripts.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
# **********************************************************************************
# build/orange_pi.h *
# build/orange_pi2.fex contains orange pi2 specific configuration *
# build/orange_pi_plus.fex contains orange pi PLUS specific configuration *
# build/orange_pi_pc.fex contains orange pi PC specific configuration *
# **********************************************************************************
### RUN Under lichee/tools/pack !!
# ==================================================================================
# !!! Before building check env settings in:
# orange_pi2.h -> #define CONFIG_EXTRA_ENV_SETTINGS !!!
# ==================================================================================
# Fex file compiler requires fex file in CRLF format
# dos2unix build/sys_config.fex
#=============
build_script() {
# === Building boot0 image =========================================================
echo "Building script.bin.${1}_${2}_${3}"
if [ "${1}" = "OPI-PLUS" ]; then
cp build/orange_pi_plus.fex build/sys_config.fex
elif [ "${1}" = "OPI-2" ]; then
cp build/orange_pi2.fex build/sys_config.fex
elif [ "${1}" = "OPI-PC" ]; then
cp build/orange_pi_pc.fex build/sys_config.fex
else
return 0
fi
if [ "${3}" = "dvi" ]; then
cat build/sys_config.fex | sed s/";hdcp_enable = 0"/"hdcp_enable = 0"/g > build/_sys_config.fex
cat build/sys_config.fex | sed s/";hdmi_cts_compatibility = 1"/"hdmi_cts_compatibility = 1"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
fi
if [ "${2}" = "720p50" ]; then
cat build/sys_config.fex | sed s/"screen0_output_mode = 10"/"screen0_output_mode = 4"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
cat build/sys_config.fex | sed s/"screen1_output_mode = 10"/"screen1_output_mode = 4"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
elif [ "${2}" = "720p60" ]; then
cat build/sys_config.fex | sed s/"screen0_output_mode = 10"/"screen0_output_mode = 5"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
cat build/sys_config.fex | sed s/"screen1_output_mode = 10"/"screen1_output_mode = 5"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
elif [ "${2}" = "1080p50" ]; then
cat build/sys_config.fex | sed s/"screen0_output_mode = 10"/"screen0_output_mode = 9"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
cat build/sys_config.fex | sed s/"screen1_output_mode = 10"/"screen1_output_mode = 9"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
elif [ "${2}" = "480p" ]; then
cat build/sys_config.fex | sed s/"screen0_output_mode = 10"/"screen0_output_mode = 31"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
cat build/sys_config.fex | sed s/"screen1_output_mode = 10"/"screen1_output_mode = 31"/g > build/_sys_config.fex
mv build/_sys_config.fex build/sys_config.fex
fi
cp build/sys_config.fex chips/sun8iw7p1/configs/dolphin-p1/sys_config.fex
cp build/orange_pi.h brandy/u-boot-2011.09/include/configs/sun8iw7p1.h
cp chips/sun8iw7p1/bin/boot0_sdcard_sun8iw7p1.bin build/boot0_sdcard.fex
fex2bin build/sys_config.fex build/sys_config.bin
if [ $? -ne 0 ]; then
echo " Error."
exit 1
fi
pctools/linux/mod_update/update_boot0 build/boot0_sdcard.fex build/sys_config.bin SDMMC_CARD > build_script_${1}_${2}.log 2>&1
if [ $? -ne 0 ]; then
echo " Error."
exit 1
fi
cp build/sys_config.bin build/script.bin.${1}_${2}_${3}
rm build_script_${1}_${2}.log > /dev/null 2>&1
}
echo ""
rm build_script_*.log > /dev/null 2>&1
rm build/script.bin.OPI-* > /dev/null 2>&1
rm build/sys_config* > /dev/null 2>&1
if [ "${1}" = "clean" ]; then
echo "Cleaning."
exit 0
fi
build_script "OPI-2" "1080p60" "hdmi"
build_script "OPI-2" "1080p50" "hdmi"
build_script "OPI-2" "720p50" "hdmi"
build_script "OPI-2" "720p60" "hdmi"
build_script "OPI-2" "480p" "hdmi"
build_script "OPI-PLUS" "1080p60" "hdmi"
build_script "OPI-PLUS" "1080p50" "hdmi"
build_script "OPI-PLUS" "720p50" "hdmi"
build_script "OPI-PLUS" "720p60" "hdmi"
build_script "OPI-PLUS" "480p" "hdmi"
build_script "OPI-PC" "1080p60" "hdmi"
build_script "OPI-PC" "1080p50" "hdmi"
build_script "OPI-PC" "720p50" "hdmi"
build_script "OPI-PC" "720p60" "hdmi"
build_script "OPI-PC" "480p" "hdmi"
build_script "OPI-2" "1080p60" "dvi"
build_script "OPI-2" "1080p50" "dvi"
build_script "OPI-2" "720p50" "dvi"
build_script "OPI-2" "720p60" "dvi"
build_script "OPI-2" "480p" "dvi"
build_script "OPI-PLUS" "1080p60" "dvi"
build_script "OPI-PLUS" "1080p50" "dvi"
build_script "OPI-PLUS" "720p50" "dvi"
build_script "OPI-PLUS" "720p60" "dvi"
build_script "OPI-PLUS" "480p" "dvi"
build_script "OPI-PC" "1080p60" "dvi"
build_script "OPI-PC" "1080p50" "dvi"
build_script "OPI-PC" "720p50" "dvi"
build_script "OPI-PC" "720p60" "dvi"
build_script "OPI-PC" "480p" "dvi"
echo "END."
# ==================================================================================