This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-environment
executable file
·129 lines (114 loc) · 4.28 KB
/
setup-environment
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
#!/usr/bin/env bash
##########################################################################
# If not stated otherwise in this file or this component's LICENSE
# file the following copyright and licenses apply:
#
# Copyright 2014 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################
TOP_DIR=$(pwd)
# Call the meta-rdk setup script.
source meta-rdk/setup-environment $1
if [ $? -ne 0 ]; then
return 1
fi
# OPTIONAL: meta-rdk-asp for ASP components.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-asp') -eq 0 -a -d $TOP_DIR/meta-rdk-asp ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-rdk-asp"
EOF
fi
# Add meta-cmf-bsp-emulator ONLY if meta-rdk-bsp-emulator is included in the BBLAYERS.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-bsp-emulator') -eq 1 -a \
$(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-bsp-emulator') -eq 0 -a \
-d $TOP_DIR/meta-cmf-bsp-emulator ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-bsp-emulator"
EOF
fi
# Add meta-cmf-qt5 only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-qt5') -eq 0 -a -d $TOP_DIR/meta-cmf-qt5 ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-qt5"
EOF
fi
# Add meta-cmf-restricted only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-restricted') -eq 0 -a -d $TOP_DIR/meta-cmf-restricted ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-restricted"
EOF
fi
# Add meta-cmf-broadband only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-broadband[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf-broadband ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-broadband"
EOF
fi
# Add meta-cmf-broadband only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-mesh[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf-mesh ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-mesh"
EOF
fi
# Add meta-cmf-video only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-video[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf-video ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-video"
EOF
fi
# Add meta-cmf-video-restricted only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-video-restricted[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf-video-restricted ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-video-restricted"
EOF
fi
# Add meta-cmf-camera only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf-camera[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf-camera ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf-camera"
EOF
fi
# Add meta-cmf only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-cmf[^-]') -eq 0 -a -d $TOP_DIR/meta-cmf ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-cmf"
EOF
fi
# Add meta-rdk-voice-sdk only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-voice-sdk') -eq 0 -a -d $TOP_DIR/meta-rdk-voice-sdk ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-rdk-voice-sdk"
EOF
fi
# Add meta-spdxscanner only if not already present.
if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-spdxscanner') -eq 0 -a -d $TOP_DIR/meta-spdxscanner ]
then
cat >> conf/bblayers.conf <<EOF
BBLAYERS =+ "\${RDKROOT}/meta-spdxscanner"
EOF
fi
#for capturing the timestamp
CPC_CUSTOM_STAMP=`/bin/date -u +%Y%m%d%H%M%S`
echo 'CPC_CUSTOM_STAMP = "'${CPC_CUSTOM_STAMP}'"' >> conf/auto.conf