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 | |
developer | c27ead3 | 2023-01-03 16:32:58 +0800 | [diff] [blame] | 51 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-filogic-logan') -eq 0 ]] && [[ -d ../meta-filogic-logan ]] |
| 52 | then |
| 53 | cat >> conf/bblayers.conf <<EOF |
| 54 | BBLAYERS =+ "\${RDKROOT}/meta-filogic-logan" |
| 55 | EOF |
| 56 | fi |
| 57 | |
developer | bc656ac | 2024-04-24 13:46:00 +0800 | [diff] [blame] | 58 | if [[ -d ../meta-filogic-logan ]] && [[ ! -d ../meta-filogic-logan/recipes-wifi/hostapd/files/patches ]] |
developer | 5ee7f52 | 2024-04-18 14:11:52 +0800 | [diff] [blame] | 59 | then |
| 60 | sh ../meta-cmf-filogic/mtk_scripts/sync_hostapd_patch.sh hostapd |
| 61 | fi |
| 62 | |
developer | bc656ac | 2024-04-24 13:46:00 +0800 | [diff] [blame] | 63 | if [[ -d ../meta-filogic-logan ]] && [[ ! -d ../meta-filogic-logan/recipes-wifi/wpa-supplicant/files/patches ]] |
developer | 5ee7f52 | 2024-04-18 14:11:52 +0800 | [diff] [blame] | 64 | then |
| 65 | sh ../meta-cmf-filogic/mtk_scripts/sync_hostapd_patch.sh wpa_supplicant |
| 66 | fi |
| 67 | |
developer | fd8c284 | 2024-05-13 13:01:33 +0800 | [diff] [blame] | 68 | # Add meta-rdk-wan only if not already present. |
| 69 | if [ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-wan') -eq 0 -a -d $TOP_DIR/meta-rdk-wan ] |
| 70 | then |
| 71 | cat >> conf/bblayers.conf <<EOF |
| 72 | BBLAYERS =+ "\${RDKROOT}/meta-rdk-wan" |
| 73 | EOF |
| 74 | fi |
| 75 | |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 76 | # Add meta-rdk-opensync only if not already present. |
| 77 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-rdk-opensync') -eq 0 ]] && [[ -d ../meta-rdk-opensync ]] |
| 78 | then |
developer | 783a8a6 | 2024-01-17 12:34:31 +0800 | [diff] [blame] | 79 | echo 'LAYERSERIES_COMPAT_opensync = "dunfell kirkstone"' >> ../meta-rdk-opensync/conf/layer.conf |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 80 | cat >> conf/bblayers.conf <<EOF |
| 81 | BBLAYERS =+ "\${RDKROOT}/meta-rdk-opensync" |
| 82 | EOF |
| 83 | fi |
| 84 | |
| 85 | # Add meta-amx(prplmesh used) only if not already present. |
| 86 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-amx') -eq 0 ]] && [[ -d ../meta-amx ]] |
| 87 | then |
| 88 | cat >> conf/bblayers.conf <<EOF |
| 89 | BBLAYERS =+ "\${RDKROOT}/meta-amx" |
| 90 | EOF |
| 91 | fi |
| 92 | # Add meta-prplmesh only if not already present. |
| 93 | if [[ $(grep '^BBLAYERS' conf/bblayers.conf | grep -c 'meta-prplmesh') -eq 0 ]] && [[ -d ../meta-prplmesh ]] |
| 94 | then |
| 95 | cat >> conf/bblayers.conf <<EOF |
| 96 | BBLAYERS =+ "\${RDKROOT}/meta-prplmesh" |
| 97 | EOF |
| 98 | fi |
| 99 | |
| 100 | if [ -L ${TOP_DIR}/.repo/manifest.xml ] ; then |
| 101 | MANIFEST="$(basename `readlink -f ${TOP_DIR}/.repo/manifest.xml` .xml)" |
| 102 | else |
| 103 | MANIFEST=$(grep include ${TOP_DIR}/.repo/manifest.xml | cut -d '"' -f 2 | xargs basename -s .xml ) |
| 104 | fi |
| 105 | echo "Manifest Name = ${MANIFEST}.xml" |
| 106 | if [ -f "${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf" ]; then |
| 107 | cat ${TOP_DIR}/.repo/manifests/turris-tags/${MANIFEST}.conf >> $BUILD_DIR/conf/auto.conf |
| 108 | if [ $? == 0 ]; then |
| 109 | echo "${MANIFEST}.conf copied to auto.conf successfully" |
| 110 | else |
| 111 | echo "FAILED to copy auto.conf" |
| 112 | fi |
| 113 | fi |
developer | 783a8a6 | 2024-01-17 12:34:31 +0800 | [diff] [blame] | 114 | |
| 115 | |
| 116 | case "$(sed -n 's/^__version__ = "\(.*\)"/\1/p' ${TOP_DIR}/openembedded-core/bitbake/bin/bitbake)" |
| 117 | in |
| 118 | 2.0.*) YOCTO_CODENAME="kirkstone" ;; |
| 119 | 2.2.*) YOCTO_CODENAME="kirkstone" ;; |
| 120 | 1.46.*) YOCTO_CODENAME="dunfell" ;; |
| 121 | 1.37.*|1.38.*) YOCTO_CODENAME="sumo" ;; |
| 122 | 1.35.*|1.36.*) YOCTO_CODENAME="rocko" ;; |
| 123 | 1.34.*) YOCTO_CODENAME="pyro" ;; |
| 124 | 1.32.*) YOCTO_CODENAME="morty" ;; |
| 125 | 1.30.*) YOCTO_CODENAME="krogoth" ;; |
| 126 | *) YOCTO_CODENAME="daisy" ;; |
| 127 | esac |
| 128 | |
| 129 | if [ $(grep -c 'tune-cortexa53' $TOP_DIR/meta-filogic/conf/machine/filogic.conf) -eq 0 ]; then |
| 130 | if [ ${YOCTO_CODENAME} == "kirkstone" ]; then |
| 131 | echo "${YOCTO_CODENAME} tune-cortexa53.inc" |
| 132 | echo "require conf/machine/include/arm/armv8a/tune-cortexa53.inc" >> $TOP_DIR/meta-filogic/conf/machine/filogic.conf |
| 133 | else |
| 134 | echo "${YOCTO_CODENAME} tune-cortexa53.inc" |
| 135 | echo "require conf/machine/include/tune-cortexa53.inc" >> $TOP_DIR/meta-filogic/conf/machine/filogic.conf |
| 136 | fi |
| 137 | fi |
| 138 | |
| 139 | if [ $(grep -c 'whitelist' $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc) -eq 0 ]; then |
| 140 | if [ ${YOCTO_CODENAME} == "kirkstone" ]; then |
| 141 | echo "${YOCTO_CODENAME} whitelist.inc" |
| 142 | echo "require conf/distro/include/whitelist_kirkstone.inc" >> $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc |
| 143 | else |
| 144 | echo "${YOCTO_CODENAME} whitelist.inc" |
| 145 | echo "require conf/distro/include/whitelist_dunfell.inc" >> $TOP_DIR/meta-cmf-filogic/conf/distro/include/rdk-filogic.inc |
| 146 | fi |
| 147 | fi |