forked from Gaohaoyang/gaohaoyang.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
titron_version-walkthrough.sh
154 lines (136 loc) · 4.81 KB
/
titron_version-walkthrough.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
#
# Copyright (C) Renesas Electronics Corporation 2017-2019 All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
set -eu
HAVE_OMX=${HAVE_OMX:="YES"}
HAVE_ADSP=${HAVE_ADSP:="YES"}
#echo ${HAVE_OMX} ${HAVE_ADSP}
TOP=`pwd`
if [ $# -ne 1 ]; then
echo "Usage: $ `basename $0` [H3|M3|M3N]" 1>&2
exit 1
fi
##TARGET=${1:-H3}
TARGET=$1
if [ ${TARGET} = "H3" ] ; then
echo "TARGET="$TARGET
HAVE_VP9=${HAVE_VP9:="NO"}
echo "HAVE_VP9="$HAVE_VP9
elif [ ${TARGET} = "M3" ] ; then
echo "TARGET="$TARGET
HAVE_VP9=${HAVE_VP9:="YES"}
echo "HAVE_VP9="$HAVE_VP9
elif [ ${TARGET} = "M3N" ] ; then
echo "TARGET="$TARGET
HAVE_VP9=${HAVE_VP9:="YES"}
echo "HAVE_VP9="$HAVE_VP9
else
echo "Invalid TARGET="$TARGET
exit 1
fi
#
# extract pkgs_dir/gfx/*
#
extract_gfx()
{
ls ${TOP}/pkgs_dir/gfx
cd ${TOP}/pkgs_dir/gfx
rm -fr RCH3G001A9001ZDO_1_1_0 || true
# rm -fr RCH3G002A9001ZNI_0_0_8 || true
rm -fr RTM0RC7795GQGG0001SA90C_1_1_0 || true
rm -fr RCM3G001A9001ZDO_1_1_0 || true
# rm -fr RCM3G002A9001ZNI_0_0_8 || true
rm -fr RTM0RC7796GQGG0001SA90C_1_1_0 || true
rm -fr RCN3G001A9001ZDO_1_1_0 || true
# rm -fr RCN3G002A9001ZNI_0_0_8 || true
rm -fr RTM0RC7796GQGGB001SA90C_1_1_0 || true
if [ ${TARGET} = "H3" ] ; then
# H3
unzip RCH3G001A9001ZDO_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RCH3G001A9001ZDO_1_1_0/RCH3G001A9001ZDO/renesas.imgtec.rogue_km.tar.gz ${TOP}/RELFILES/renesas-imgtec
unzip RTM0RC7795GQGG0001SA90C_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RTM0RC7795GQGG0001SA90C_1_1_0/RTM0RC7795GQGG0001SA90C/Software/renesas.imgtec.prebuilts.tar.gz ${TOP}/RELFILES/renesas-imgtec
elif [ ${TARGET} = "M3" ] ; then
# M3
unzip RCM3G001A9001ZDO_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RCM3G001A9001ZDO_1_1_0/RCM3G001A9001ZDO/renesas.imgtec.rogue_km.tar.gz ${TOP}/RELFILES/renesas-imgtec
unzip RTM0RC7796GQGG0001SA90C_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RTM0RC7796GQGG0001SA90C_1_1_0/RTM0RC7796GQGG0001SA90C/Software/renesas.imgtec.prebuilts.tar.gz ${TOP}/RELFILES/renesas-imgtec
elif [ ${TARGET} = "M3N" ] ; then
# M3N
unzip RCN3G001A9001ZDO_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RCN3G001A9001ZDO_1_1_0/RCN3G001A9001ZDO/renesas.imgtec.rogue_km.tar.gz ${TOP}/RELFILES/renesas-imgtec
unzip RTM0RC7796GQGGB001SA90C_1_1_0.zip
mv ${TOP}/pkgs_dir/gfx/RTM0RC7796GQGGB001SA90C_1_1_0/RTM0RC7796GQGGB001SA90C/Software/renesas.imgtec.prebuilts.tar.gz ${TOP}/RELFILES/renesas-imgtec
fi
cd ${TOP}
}
#
# extract pkgs_dir/omx/*
#
extract_omx()
{
ls ${TOP}/pkgs_dir/omx
cd RELFILES/renesas-omx/
HAVE_VP9=${HAVE_VP9} ./make_renesas-omx.sh ${TOP}/pkgs_dir/omx for_make_source_code
HAVE_VP9=${HAVE_VP9} ./make_hardware.renesas.omx.sh ${TOP}/pkgs_dir/omx for_make_source_code
./make_hardware.renesas.uvcs_km.sh ${TOP}/pkgs_dir/omx
cd ${TOP}
}
#
# extract pkgs_dir/adsp/*
#
extract_adsp()
{
ls ${TOP}/pkgs_dir/adsp
cd RELFILES/renesas-adsp/
./make_renesas-adsp.sh ${TOP}/pkgs_dir/adsp
./make_hardware.renesas.s492c.sh ${TOP}/pkgs_dir/adsp
cd ${TOP}
}
#
# procedure
#
rm ${TOP}/RELFILES/renesas-imgtec/renesas.imgtec.prebuilts.tar.gz || true
rm ${TOP}/RELFILES/renesas-imgtec/renesas.imgtec.rogue_km.tar.gz || true
extract_gfx
if [ ${HAVE_OMX} = "YES" ]; then
rm ${TOP}/RELFILES/renesas-omx/renesas.omx.tar.gz || true
extract_omx
fi
if [ ${HAVE_ADSP} = "YES" ]; then
rm ${TOP}/RELFILES/renesas-adsp/renesas.adsp.tar.gz || true
extract_adsp
fi
#./buildenv.sh # titron comment
### titron start
MYDROID_DIR=mydroid
cd ${TOP}
if [ ! -d ${MYDROID_DIR} ]; then
./buildenv.sh
fi
### titron end
##sed -i -e "s/USE_REFERENCE_OPTION=\"NO\"/USE_REFERENCE_OPTION=\"YES\"/" RELFILES/apply_patch.sh
cd RELFILES
HAVE_OMX=${HAVE_OMX} HAVE_ADSP=${HAVE_ADSP} ./apply_patch.sh
cd ${TOP}
echo "Done : TARGET="$TARGET "HAVE_VP9="$HAVE_VP9