developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 1 | # 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 | |
| 20 | unset _RDK_FLAVOR |
| 21 | |
| 22 | TOP_DIR=$(pwd) |
| 23 | export RDK_BSP_LAYER=none |
| 24 | |
developer | 3d785cd | 2022-05-05 16:20:47 +0800 | [diff] [blame^] | 25 | # default BSP layer is meta-filogic for filogic series board |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 26 | export RDK_BSP_LAYER=meta-cmf-filogic |
| 27 | |
| 28 | source meta-cmf/setup-environment $1 |
| 29 | if [ $? -ne 0 ]; then |
| 30 | return 1 |
| 31 | fi |
| 32 | |
| 33 | # at this point the current directory should be the build dir |
| 34 | BUILD_DIR=$(pwd) |
| 35 | _RDK_FLAVOR="rdkb" |
| 36 | |
| 37 | if [[ -z $(grep 'meta-cmf-filogic' conf/bblayers.conf) ]] && [[ -d ../meta-cmf-filogic ]] |
| 38 | then |
| 39 | cat >> conf/bblayers.conf <<EOF |
| 40 | BBLAYERS =+ "\${RDKROOT}/meta-cmf-filogic" |
| 41 | EOF |
| 42 | fi |
| 43 | |
| 44 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-filogic') -eq 0 ]] && [[ -d ../meta-filogic ]] |
| 45 | then |
| 46 | cat >> conf/bblayers.conf <<EOF |
| 47 | BBLAYERS =+ "\${RDKROOT}/meta-filogic" |
| 48 | EOF |
| 49 | fi |
| 50 | |
| 51 | # Add meta-rdk-opensync only if not already present. |
| 52 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-opensync') -eq 0 ]] && [[ -d ../meta-rdk-opensync ]] |
| 53 | then |
| 54 | echo 'LAYERSERIES_COMPAT_opensync = "dunfell"' >> ../meta-rdk-opensync/conf/layer.conf |
| 55 | cat >> conf/bblayers.conf <<EOF |
| 56 | BBLAYERS =+ "\${RDKROOT}/meta-rdk-opensync" |
| 57 | EOF |
| 58 | fi |
| 59 | |
| 60 | # Add meta-amx(prplmesh used) only if not already present. |
| 61 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-amx') -eq 0 ]] && [[ -d ../meta-amx ]] |
| 62 | then |
| 63 | cat >> conf/bblayers.conf <<EOF |
| 64 | BBLAYERS =+ "\${RDKROOT}/meta-amx" |
| 65 | EOF |
| 66 | fi |
| 67 | # Add meta-prplmesh only if not already present. |
| 68 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-prplmesh') -eq 0 ]] && [[ -d ../meta-prplmesh ]] |
| 69 | then |
| 70 | cat >> conf/bblayers.conf <<EOF |
| 71 | BBLAYERS =+ "\${RDKROOT}/meta-prplmesh" |
| 72 | EOF |
| 73 | fi |
| 74 | |
| 75 | if [ -L ${TOP_DIR}/.repo/manifest.xml ] ; then |
| 76 | MANIFEST="$(basename `readlink -f ${TOP_DIR}/.repo/manifest.xml` .xml)" |
| 77 | else |
| 78 | MANIFEST=$(grep include ${TOP_DIR}/.repo/manifest.xml | cut -d '"' -f 2 | xargs basename -s .xml ) |
| 79 | fi |
| 80 | echo "Manifest Name = ${MANIFEST}.xml" |
| 81 | if [ -f "${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf" ]; then |
| 82 | cat ${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf >> $BUILD_DIR/conf/auto.conf |
| 83 | if [ $? == 0 ]; then |
| 84 | echo "${MANIFEST}.conf copied to auto.conf successfully" |
| 85 | else |
| 86 | echo "FAILED to copy auto.conf" |
| 87 | fi |
| 88 | fi |