blob: b881e8febde574fda89fb0ecadf99d7c227f24ad [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001# If not stated otherwise in this file or this component's LICENSE
2# file the following copyright and licenses apply:
3#
4#Copyright [2019] [RDK Management]
5#
6#Licensed under the Apache License, Version 2.0 (the "License");
7#you may not use this file except in compliance with the License.
8#You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12#Unless required by applicable law or agreed to in writing, software
13#distributed under the License is distributed on an "AS IS" BASIS,
14#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15#See the License for the specific language governing permissions and
16#limitations under the License.
17
18#!/usr/bin/env bash
19
20unset _RDK_FLAVOR
21
22TOP_DIR=$(pwd)
23export RDK_BSP_LAYER=none
24
developer3d785cd2022-05-05 16:20:47 +080025# default BSP layer is meta-filogic for filogic series board
developer15a43312022-04-12 11:23:23 +080026export RDK_BSP_LAYER=meta-cmf-filogic
27
28source meta-cmf/setup-environment $1
29if [ $? -ne 0 ]; then
30 return 1
31fi
32
33# at this point the current directory should be the build dir
34BUILD_DIR=$(pwd)
35_RDK_FLAVOR="rdkb"
36
37if [[ -z $(grep 'meta-cmf-filogic' conf/bblayers.conf) ]] && [[ -d ../meta-cmf-filogic ]]
38then
39 cat >> conf/bblayers.conf <<EOF
40BBLAYERS =+ "\${RDKROOT}/meta-cmf-filogic"
41EOF
42fi
43
44if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-filogic') -eq 0 ]] && [[ -d ../meta-filogic ]]
45then
46 cat >> conf/bblayers.conf <<EOF
47BBLAYERS =+ "\${RDKROOT}/meta-filogic"
48EOF
49fi
50
developerc27ead32023-01-03 16:32:58 +080051if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-filogic-logan') -eq 0 ]] && [[ -d ../meta-filogic-logan ]]
52then
53 cat >> conf/bblayers.conf <<EOF
54BBLAYERS =+ "\${RDKROOT}/meta-filogic-logan"
55EOF
56fi
57
developer15a43312022-04-12 11:23:23 +080058# Add meta-rdk-opensync only if not already present.
59if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-opensync') -eq 0 ]] && [[ -d ../meta-rdk-opensync ]]
60then
developer783a8a62024-01-17 12:34:31 +080061 echo 'LAYERSERIES_COMPAT_opensync = "dunfell kirkstone"' >> ../meta-rdk-opensync/conf/layer.conf
developer15a43312022-04-12 11:23:23 +080062 cat >> conf/bblayers.conf <<EOF
63BBLAYERS =+ "\${RDKROOT}/meta-rdk-opensync"
64EOF
65fi
66
67# Add meta-amx(prplmesh used) only if not already present.
68if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-amx') -eq 0 ]] && [[ -d ../meta-amx ]]
69then
70 cat >> conf/bblayers.conf <<EOF
71BBLAYERS =+ "\${RDKROOT}/meta-amx"
72EOF
73fi
74# Add meta-prplmesh only if not already present.
75if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-prplmesh') -eq 0 ]] && [[ -d ../meta-prplmesh ]]
76then
77 cat >> conf/bblayers.conf <<EOF
78BBLAYERS =+ "\${RDKROOT}/meta-prplmesh"
79EOF
80fi
81
82if [ -L ${TOP_DIR}/.repo/manifest.xml ] ; then
83 MANIFEST="$(basename `readlink -f ${TOP_DIR}/.repo/manifest.xml` .xml)"
84else
85 MANIFEST=$(grep include ${TOP_DIR}/.repo/manifest.xml | cut -d '"' -f 2 | xargs basename -s .xml )
86fi
87echo "Manifest Name = ${MANIFEST}.xml"
88if [ -f "${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf" ]; then
89 cat ${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf >> $BUILD_DIR/conf/auto.conf
90 if [ $? == 0 ]; then
91 echo "${MANIFEST}.conf copied to auto.conf successfully"
92 else
93 echo "FAILED to copy auto.conf"
94 fi
95fi
developer783a8a62024-01-17 12:34:31 +080096
97
98case "$(sed -n 's/^__version__ = "\(.*\)"/\1/p' ${TOP_DIR}/openembedded-core/bitbake/bin/bitbake)"
99in
100 2.0.*) YOCTO_CODENAME="kirkstone" ;;
101 2.2.*) YOCTO_CODENAME="kirkstone" ;;
102 1.46.*) YOCTO_CODENAME="dunfell" ;;
103 1.37.*|1.38.*) YOCTO_CODENAME="sumo" ;;
104 1.35.*|1.36.*) YOCTO_CODENAME="rocko" ;;
105 1.34.*) YOCTO_CODENAME="pyro" ;;
106 1.32.*) YOCTO_CODENAME="morty" ;;
107 1.30.*) YOCTO_CODENAME="krogoth" ;;
108 *) YOCTO_CODENAME="daisy" ;;
109esac
110
111if [ $(grep -c 'tune-cortexa53' $TOP_DIR/meta-filogic/conf/machine/filogic.conf) -eq 0 ]; then
112 if [ ${YOCTO_CODENAME} == "kirkstone" ]; then
113 echo "${YOCTO_CODENAME} tune-cortexa53.inc"
114 echo "require conf/machine/include/arm/armv8a/tune-cortexa53.inc" >> $TOP_DIR/meta-filogic/conf/machine/filogic.conf
115 else
116 echo "${YOCTO_CODENAME} tune-cortexa53.inc"
117 echo "require conf/machine/include/tune-cortexa53.inc" >> $TOP_DIR/meta-filogic/conf/machine/filogic.conf
118 fi
119fi
120
121if [ $(grep -c 'whitelist' $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc) -eq 0 ]; then
122 if [ ${YOCTO_CODENAME} == "kirkstone" ]; then
123 echo "${YOCTO_CODENAME} whitelist.inc"
124 echo "require conf/distro/include/whitelist_kirkstone.inc" >> $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc
125 else
126 echo "${YOCTO_CODENAME} whitelist.inc"
127 echo "require conf/distro/include/whitelist_dunfell.inc" >> $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc
128 fi
129fi