developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 1 | require ccsp_common_filogic.inc |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 2 | |
| 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:${THISDIR}/files:" |
| 4 | |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 5 | DEPENDS_append_filogic = " breakpad" |
| 6 | CXXFLAGS_append_filogic = " \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 7 | -I${STAGING_INCDIR}/breakpad \ |
| 8 | -std=c++11 \ |
| 9 | " |
| 10 | |
| 11 | SRC_URI_append = " \ |
| 12 | file://ccsp_vendor.h \ |
| 13 | file://wifiinitialized.service \ |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 14 | file://checkfilogicwifisupport.service \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 15 | file://wifiinitialized.path \ |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 16 | file://filogicwifiinitialized.path \ |
| 17 | file://checkfilogicwifisupport.path \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 18 | file://wifi-initialized.target \ |
| 19 | file://utopia.service \ |
| 20 | " |
| 21 | |
| 22 | SRC_URI_remove_dunfell = "file://0001-DBusLoop-SSL_state-TLS_ST_OK.patch" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 23 | |
| 24 | SRC_URI += "file://0003-add-dependency-to-pandm.patch;apply=no" |
developer | a1044a9 | 2022-08-09 15:06:11 +0800 | [diff] [blame] | 25 | |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 26 | SRC_URI_append_dunfell = " file://0001-DBusLoop-SSL_state-TLS_ST_OK.patch;apply=no" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 27 | |
| 28 | |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 29 | # we need to patch to code for Filogic |
| 30 | do_filogic_patches() { |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 31 | cd ${S} |
| 32 | if [ ! -e patch_applied ]; then |
developer | a1044a9 | 2022-08-09 15:06:11 +0800 | [diff] [blame] | 33 | bbnote "Patching 0003-add-dependency-to-pandm.patch" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 34 | patch -p1 < ${WORKDIR}/0003-add-dependency-to-pandm.patch |
developer | a1044a9 | 2022-08-09 15:06:11 +0800 | [diff] [blame] | 35 | if [ "${@bb.utils.contains('DISTRO_CODENAME', 'dunfell', 'dunfell', '', d)}" = "dunfell" ] ; then |
| 36 | bbnote "Patching 0001-DBusLoop-SSL_state-TLS_ST_OK.patch" |
| 37 | patch -p1 < ${WORKDIR}/0001-DBusLoop-SSL_state-TLS_ST_OK.patch |
| 38 | |
developer | a1044a9 | 2022-08-09 15:06:11 +0800 | [diff] [blame] | 39 | fi |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 40 | touch patch_applied |
| 41 | fi |
| 42 | } |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 43 | addtask filogic_patches after do_unpack before do_compile |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 44 | |
| 45 | do_install_append_class-target(){ |
| 46 | # Config files and scripts |
| 47 | install -m 777 ${S}/scripts/cli_start_arm.sh ${D}/usr/ccsp/cli_start.sh |
| 48 | install -m 777 ${S}/scripts/cosa_start_arm.sh ${D}/usr/ccsp/cosa_start.sh |
| 49 | |
| 50 | # we need unix socket path |
| 51 | echo "unix:path=/var/run/dbus/system_bus_socket" > ${S}/config/ccsp_msg.cfg |
| 52 | install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/ccsp_msg.cfg |
| 53 | install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/cm/ccsp_msg.cfg |
| 54 | install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/mta/ccsp_msg.cfg |
| 55 | install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/pam/ccsp_msg.cfg |
| 56 | install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/tr069pa/ccsp_msg.cfg |
| 57 | |
| 58 | install -m 777 ${S}/systemd_units/scripts/ccspSysConfigEarly.sh ${D}/usr/ccsp/ccspSysConfigEarly.sh |
| 59 | install -m 777 ${S}/systemd_units/scripts/ccspSysConfigLate.sh ${D}/usr/ccsp/ccspSysConfigLate.sh |
| 60 | install -m 777 ${S}/systemd_units/scripts/utopiaInitCheck.sh ${D}/usr/ccsp/utopiaInitCheck.sh |
| 61 | install -m 777 ${S}/systemd_units/scripts/ccspPAMCPCheck.sh ${D}/usr/ccsp/ccspPAMCPCheck.sh |
| 62 | |
| 63 | install -m 777 ${S}/systemd_units/scripts/ProcessResetCheck.sh ${D}/usr/ccsp/ProcessResetCheck.sh |
| 64 | sed -i -e "s/source \/rdklogger\/logfiles.sh;syncLogs_nvram2/#source \/rdklogger\/logfiles.sh;syncLogs_nvram2/g" ${D}/usr/ccsp/ProcessResetCheck.sh |
| 65 | # install systemd services |
| 66 | install -d ${D}${systemd_unitdir}/system |
| 67 | install -D -m 0644 ${S}/systemd_units/ccspwifiagent.service ${D}${systemd_unitdir}/system/ccspwifiagent.service |
| 68 | install -D -m 0644 ${S}/systemd_units/CcspCrSsp.service ${D}${systemd_unitdir}/system/CcspCrSsp.service |
| 69 | install -D -m 0644 ${S}/systemd_units/CcspPandMSsp.service ${D}${systemd_unitdir}/system/CcspPandMSsp.service |
| 70 | install -D -m 0644 ${S}/systemd_units/PsmSsp.service ${D}${systemd_unitdir}/system/PsmSsp.service |
| 71 | install -D -m 0644 ${S}/systemd_units/rdkbLogMonitor.service ${D}${systemd_unitdir}/system/rdkbLogMonitor.service |
| 72 | install -D -m 0644 ${S}/systemd_units/CcspTandDSsp.service ${D}${systemd_unitdir}/system/CcspTandDSsp.service |
| 73 | install -D -m 0644 ${S}/systemd_units/CcspLMLite.service ${D}${systemd_unitdir}/system/CcspLMLite.service |
| 74 | install -D -m 0644 ${S}/systemd_units/CcspTr069PaSsp.service ${D}${systemd_unitdir}/system/CcspTr069PaSsp.service |
| 75 | install -D -m 0644 ${S}/systemd_units/snmpSubAgent.service ${D}${systemd_unitdir}/system/snmpSubAgent.service |
| 76 | install -D -m 0644 ${S}/systemd_units/snmpSubAgent.service ${D}${systemd_unitdir}/system/snmpSubAgent.service |
| 77 | install -D -m 0644 ${S}/systemd_units/CcspEthAgent.service ${D}${systemd_unitdir}/system/CcspEthAgent.service |
| 78 | |
| 79 | #rfc service file |
| 80 | install -D -m 0644 ${S}/systemd_units/rfc.service ${D}${systemd_unitdir}/system/rfc.service |
| 81 | |
| 82 | install -D -m 0644 ${WORKDIR}/wifiinitialized.service ${D}${systemd_unitdir}/system/wifiinitialized.service |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 83 | install -D -m 0644 ${WORKDIR}/checkfilogicwifisupport.service ${D}${systemd_unitdir}/system/checkfilogicwifisupport.service |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 84 | |
| 85 | install -D -m 0644 ${WORKDIR}/wifiinitialized.path ${D}${systemd_unitdir}/system/wifiinitialized.path |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 86 | install -D -m 0644 ${WORKDIR}/filogicwifiinitialized.path ${D}${systemd_unitdir}/system/filogicwifiinitialized.path |
| 87 | install -D -m 0644 ${WORKDIR}/checkfilogicwifisupport.path ${D}${systemd_unitdir}/system/checkfilogicwifisupport.path |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 88 | |
| 89 | install -D -m 0644 ${WORKDIR}/wifi-initialized.target ${D}${systemd_unitdir}/system/wifi-initialized.target |
| 90 | |
| 91 | install -D -m 0644 ${S}/systemd_units/ProcessResetDetect.service ${D}${systemd_unitdir}/system/ProcessResetDetect.service |
| 92 | install -D -m 0644 ${S}/systemd_units/ProcessResetDetect.path ${D}${systemd_unitdir}/system/ProcessResetDetect.path |
| 93 | |
| 94 | # Install wrapper for breakpad (disabled to support External Source build) |
| 95 | #install -d ${D}${includedir}/ccsp |
| 96 | #install -m 644 ${S}/source/breakpad_wrapper/include/breakpad_wrapper.h ${D}${includedir}/ccsp |
| 97 | |
| 98 | # Install "vendor information" |
| 99 | install -m 0644 ${WORKDIR}/ccsp_vendor.h ${D}${includedir}/ccsp |
| 100 | |
| 101 | sed -i -- 's/NotifyAccess=.*/#NotifyAccess=main/g' ${D}${systemd_unitdir}/system/CcspCrSsp.service |
| 102 | sed -i -- 's/notify.*/forking/g' ${D}${systemd_unitdir}/system/CcspCrSsp.service |
| 103 | |
| 104 | #copy rfc.properties into nvram |
| 105 | sed -i '/ExecStartPre/ a\ExecStartPre=-/bin/cp /etc/rfc.properties /nvram/' ${D}${systemd_unitdir}/system/rfc.service |
| 106 | #reduce sleep time to 12 sconds |
| 107 | sed -i 's/300/12/g' ${D}${systemd_unitdir}/system/rfc.service |
| 108 | |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 109 | #change for Filogic |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 110 | sed -i 's/PIDFile/#&/' ${D}${systemd_unitdir}/system/CcspPandMSsp.service |
| 111 | |
| 112 | #WanManager - RdkWanManager.service |
| 113 | DISTRO_WAN_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','rdkb_wan_manager','true','false',d)}" |
| 114 | if [ $DISTRO_WAN_ENABLED = 'true' ]; then |
| 115 | install -D -m 0644 ${S}/systemd_units/RdkWanManager.service ${D}${systemd_unitdir}/system/RdkWanManager.service |
| 116 | sed -i "/WorkingDirectory/a ExecStartPre=/bin/sh /lib/rdk/run_rm_key.sh" ${D}${systemd_unitdir}/system/RdkWanManager.service |
developer | 1495e4d | 2022-04-14 17:58:16 +0800 | [diff] [blame] | 117 | sed -i "s/After=CcspCrSsp.service/After=CcspCrSsp.service utopia.service PsmSsp.service CcspEthAgent.service/g" ${D}${systemd_unitdir}/system/RdkWanManager.service |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 118 | sed -i "s/CcspPandMSsp.service/CcspCrSsp.service CcspPandMSsp.service/g" ${D}${systemd_unitdir}/system/CcspEthAgent.service |
| 119 | install -D -m 0644 ${WORKDIR}/utopia.service ${D}${systemd_unitdir}/system/utopia.service |
| 120 | install -D -m 0644 ${S}/systemd_units/RdkTelcoVoiceManager.service ${D}${systemd_unitdir}/system/RdkTelcoVoiceManager.service |
| 121 | install -D -m 0644 ${S}/systemd_units/RdkVlanManager.service ${D}${systemd_unitdir}/system/RdkVlanManager.service |
| 122 | fi |
| 123 | |
developer | 915d0d2 | 2022-07-15 15:11:26 +0800 | [diff] [blame] | 124 | DISTRO_FW_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','fwupgrade_manager','true','false',d)}" |
| 125 | if [ $DISTRO_FW_ENABLED = 'true' ]; then |
| 126 | install -D -m 0644 ${S}/systemd_units/RdkFwUpgradeManager.service ${D}${systemd_unitdir}/system/RdkFwUpgradeManager.service |
| 127 | fi |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 128 | ##### erouter0 ip issue |
| 129 | sed -i '/Factory/a \ |
| 130 | IsErouterRunningStatus=\`ifconfig erouter0 | grep RUNNING | grep -v grep | wc -l\` \ |
| 131 | if [ \"\$IsErouterRunningStatus\" == 0 ]; then \ |
| 132 | ethtool -s erouter0 speed 1000 \ |
| 133 | fi' ${D}/usr/ccsp/ccspPAMCPCheck.sh |
| 134 | |
| 135 | } |
| 136 | |
| 137 | do_install_append_dunfell_class-target () { |
| 138 | #for yocto 3.1, Making psm to run after gwprovethwan |
| 139 | sed -i '/CcspCrSsp.service/c After=CcspCrSsp.service gwprovethwan.service' ${D}${systemd_unitdir}/system/PsmSsp.service |
| 140 | } |
| 141 | |
| 142 | SYSTEMD_SERVICE_${PN} += "ccspwifiagent.service" |
| 143 | SYSTEMD_SERVICE_${PN} += "CcspCrSsp.service" |
| 144 | SYSTEMD_SERVICE_${PN} += "CcspPandMSsp.service" |
| 145 | SYSTEMD_SERVICE_${PN} += "PsmSsp.service" |
| 146 | SYSTEMD_SERVICE_${PN} += "rdkbLogMonitor.service" |
| 147 | SYSTEMD_SERVICE_${PN} += "CcspTandDSsp.service" |
| 148 | SYSTEMD_SERVICE_${PN} += "CcspLMLite.service" |
| 149 | SYSTEMD_SERVICE_${PN} += "CcspTr069PaSsp.service" |
| 150 | SYSTEMD_SERVICE_${PN} += "snmpSubAgent.service" |
| 151 | SYSTEMD_SERVICE_${PN} += "CcspEthAgent.service" |
| 152 | SYSTEMD_SERVICE_${PN} += "wifiinitialized.service" |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 153 | SYSTEMD_SERVICE_${PN} += "checkfilogicwifisupport.service" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 154 | SYSTEMD_SERVICE_${PN} += "wifiinitialized.path" |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 155 | SYSTEMD_SERVICE_${PN} += "filogicwifiinitialized.path" |
| 156 | SYSTEMD_SERVICE_${PN} += "checkfilogicwifisupport.path" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 157 | SYSTEMD_SERVICE_${PN} += "wifi-initialized.target" |
| 158 | SYSTEMD_SERVICE_${PN} += "ProcessResetDetect.path" |
| 159 | SYSTEMD_SERVICE_${PN} += "ProcessResetDetect.service" |
| 160 | SYSTEMD_SERVICE_${PN} += "rfc.service" |
developer | 623cc8c | 2022-09-05 11:20:56 +0800 | [diff] [blame] | 161 | SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'rdkb_wan_manager', 'RdkWanManager.service utopia.service RdkVlanManager.service ', '', d)}" |
developer | 915d0d2 | 2022-07-15 15:11:26 +0800 | [diff] [blame] | 162 | SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'fwupgrade_manager', 'RdkFwUpgradeManager.service ', '', d)}" |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 163 | |
| 164 | FILES_${PN}_append = " \ |
| 165 | /usr/ccsp/ccspSysConfigEarly.sh \ |
| 166 | /usr/ccsp/ccspSysConfigLate.sh \ |
| 167 | /usr/ccsp/utopiaInitCheck.sh \ |
| 168 | /usr/ccsp/ccspPAMCPCheck.sh \ |
| 169 | /usr/ccsp/ProcessResetCheck.sh \ |
| 170 | ${systemd_unitdir}/system/ccspwifiagent.service \ |
| 171 | ${systemd_unitdir}/system/CcspCrSsp.service \ |
| 172 | ${systemd_unitdir}/system/CcspPandMSsp.service \ |
| 173 | ${systemd_unitdir}/system/PsmSsp.service \ |
| 174 | ${systemd_unitdir}/system/rdkbLogMonitor.service \ |
| 175 | ${systemd_unitdir}/system/CcspTandDSsp.service \ |
| 176 | ${systemd_unitdir}/system/CcspLMLite.service \ |
| 177 | ${systemd_unitdir}/system/CcspTr069PaSsp.service \ |
| 178 | ${systemd_unitdir}/system/snmpSubAgent.service \ |
| 179 | ${systemd_unitdir}/system/CcspEthAgent.service \ |
| 180 | ${systemd_unitdir}/system/wifiinitialized.service \ |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 181 | ${systemd_unitdir}/system/checkfilogicwifisupport.service \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 182 | ${systemd_unitdir}/system/wifiinitialized.path \ |
developer | cc441a0 | 2022-05-09 19:04:26 +0800 | [diff] [blame] | 183 | ${systemd_unitdir}/system/filogicwifiinitialized.path \ |
| 184 | ${systemd_unitdir}/system/checkfilogicwifisupport.path \ |
developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 185 | ${systemd_unitdir}/system/wifi-initialized.target \ |
| 186 | ${systemd_unitdir}/system/ProcessResetDetect.path \ |
| 187 | ${systemd_unitdir}/system/ProcessResetDetect.service \ |
| 188 | ${systemd_unitdir}/system/rfc.service \ |
| 189 | " |
| 190 | FILES_${PN}_append = "${@bb.utils.contains('DISTRO_FEATURES', 'rdkb_wan_manager', ' ${systemd_unitdir}/system/RdkWanManager.service ${systemd_unitdir}/system/utopia.service ${systemd_unitdir}/system/RdkVlanManager.service ${systemd_unitdir}/system/RdkTelcoVoiceManager.service ', '', d)}" |
developer | 915d0d2 | 2022-07-15 15:11:26 +0800 | [diff] [blame] | 191 | FILES_${PN}_append = "${@bb.utils.contains('DISTRO_FEATURES', 'fwupgrade_manager', ' ${systemd_unitdir}/system/RdkFwUpgradeManager.service ', '', d)}" |