blob: 8e67586a75e288ff1513cec12f91c701195d8201 [file] [log] [blame]
developercc441a02022-05-09 19:04:26 +08001require ccsp_common_filogic.inc
developer15a43312022-04-12 11:23:23 +08002
3FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:${THISDIR}/files:"
4
developercc441a02022-05-09 19:04:26 +08005DEPENDS_append_filogic = " breakpad"
6CXXFLAGS_append_filogic = " \
developer15a43312022-04-12 11:23:23 +08007 -I${STAGING_INCDIR}/breakpad \
8 -std=c++11 \
9 "
10
11SRC_URI_append = " \
12 file://ccsp_vendor.h \
13 file://wifiinitialized.service \
developercc441a02022-05-09 19:04:26 +080014 file://checkfilogicwifisupport.service \
developer15a43312022-04-12 11:23:23 +080015 file://wifiinitialized.path \
developercc441a02022-05-09 19:04:26 +080016 file://filogicwifiinitialized.path \
17 file://checkfilogicwifisupport.path \
developer15a43312022-04-12 11:23:23 +080018 file://wifi-initialized.target \
19 file://utopia.service \
20"
21
22SRC_URI_remove_dunfell = "file://0001-DBusLoop-SSL_state-TLS_ST_OK.patch"
developer15a43312022-04-12 11:23:23 +080023
24SRC_URI += "file://0003-add-dependency-to-pandm.patch;apply=no"
developercded8112023-12-21 20:30:42 +080025SRC_URI += "file://0004-fix-out-of-array-access.patch;apply=no"
developera1044a92022-08-09 15:06:11 +080026
developer15a43312022-04-12 11:23:23 +080027SRC_URI_append_dunfell = " file://0001-DBusLoop-SSL_state-TLS_ST_OK.patch;apply=no"
developer15a43312022-04-12 11:23:23 +080028
29
developercc441a02022-05-09 19:04:26 +080030# we need to patch to code for Filogic
31do_filogic_patches() {
developer15a43312022-04-12 11:23:23 +080032 cd ${S}
33 if [ ! -e patch_applied ]; then
developera1044a92022-08-09 15:06:11 +080034 bbnote "Patching 0003-add-dependency-to-pandm.patch"
developer15a43312022-04-12 11:23:23 +080035 patch -p1 < ${WORKDIR}/0003-add-dependency-to-pandm.patch
developercded8112023-12-21 20:30:42 +080036 patch -p1 < ${WORKDIR}/0004-fix-out-of-array-access.patch
developera1044a92022-08-09 15:06:11 +080037 if [ "${@bb.utils.contains('DISTRO_CODENAME', 'dunfell', 'dunfell', '', d)}" = "dunfell" ] ; then
38 bbnote "Patching 0001-DBusLoop-SSL_state-TLS_ST_OK.patch"
39 patch -p1 < ${WORKDIR}/0001-DBusLoop-SSL_state-TLS_ST_OK.patch
40
developera1044a92022-08-09 15:06:11 +080041 fi
developer15a43312022-04-12 11:23:23 +080042 touch patch_applied
43 fi
44}
developercc441a02022-05-09 19:04:26 +080045addtask filogic_patches after do_unpack before do_compile
developer15a43312022-04-12 11:23:23 +080046
47do_install_append_class-target(){
48 # Config files and scripts
49 install -m 777 ${S}/scripts/cli_start_arm.sh ${D}/usr/ccsp/cli_start.sh
50 install -m 777 ${S}/scripts/cosa_start_arm.sh ${D}/usr/ccsp/cosa_start.sh
51
52 # we need unix socket path
53 echo "unix:path=/var/run/dbus/system_bus_socket" > ${S}/config/ccsp_msg.cfg
54 install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/ccsp_msg.cfg
55 install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/cm/ccsp_msg.cfg
56 install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/mta/ccsp_msg.cfg
57 install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/pam/ccsp_msg.cfg
58 install -m 644 ${S}/config/ccsp_msg.cfg ${D}/usr/ccsp/tr069pa/ccsp_msg.cfg
59
60 install -m 777 ${S}/systemd_units/scripts/ccspSysConfigEarly.sh ${D}/usr/ccsp/ccspSysConfigEarly.sh
61 install -m 777 ${S}/systemd_units/scripts/ccspSysConfigLate.sh ${D}/usr/ccsp/ccspSysConfigLate.sh
62 install -m 777 ${S}/systemd_units/scripts/utopiaInitCheck.sh ${D}/usr/ccsp/utopiaInitCheck.sh
63 install -m 777 ${S}/systemd_units/scripts/ccspPAMCPCheck.sh ${D}/usr/ccsp/ccspPAMCPCheck.sh
64
65 install -m 777 ${S}/systemd_units/scripts/ProcessResetCheck.sh ${D}/usr/ccsp/ProcessResetCheck.sh
66 sed -i -e "s/source \/rdklogger\/logfiles.sh;syncLogs_nvram2/#source \/rdklogger\/logfiles.sh;syncLogs_nvram2/g" ${D}/usr/ccsp/ProcessResetCheck.sh
67 # install systemd services
68 install -d ${D}${systemd_unitdir}/system
69 install -D -m 0644 ${S}/systemd_units/ccspwifiagent.service ${D}${systemd_unitdir}/system/ccspwifiagent.service
70 install -D -m 0644 ${S}/systemd_units/CcspCrSsp.service ${D}${systemd_unitdir}/system/CcspCrSsp.service
71 install -D -m 0644 ${S}/systemd_units/CcspPandMSsp.service ${D}${systemd_unitdir}/system/CcspPandMSsp.service
72 install -D -m 0644 ${S}/systemd_units/PsmSsp.service ${D}${systemd_unitdir}/system/PsmSsp.service
73 install -D -m 0644 ${S}/systemd_units/rdkbLogMonitor.service ${D}${systemd_unitdir}/system/rdkbLogMonitor.service
74 install -D -m 0644 ${S}/systemd_units/CcspTandDSsp.service ${D}${systemd_unitdir}/system/CcspTandDSsp.service
75 install -D -m 0644 ${S}/systemd_units/CcspLMLite.service ${D}${systemd_unitdir}/system/CcspLMLite.service
76 install -D -m 0644 ${S}/systemd_units/CcspTr069PaSsp.service ${D}${systemd_unitdir}/system/CcspTr069PaSsp.service
77 install -D -m 0644 ${S}/systemd_units/snmpSubAgent.service ${D}${systemd_unitdir}/system/snmpSubAgent.service
78 install -D -m 0644 ${S}/systemd_units/snmpSubAgent.service ${D}${systemd_unitdir}/system/snmpSubAgent.service
79 install -D -m 0644 ${S}/systemd_units/CcspEthAgent.service ${D}${systemd_unitdir}/system/CcspEthAgent.service
80
81 #rfc service file
82 install -D -m 0644 ${S}/systemd_units/rfc.service ${D}${systemd_unitdir}/system/rfc.service
83
84 install -D -m 0644 ${WORKDIR}/wifiinitialized.service ${D}${systemd_unitdir}/system/wifiinitialized.service
developercc441a02022-05-09 19:04:26 +080085 install -D -m 0644 ${WORKDIR}/checkfilogicwifisupport.service ${D}${systemd_unitdir}/system/checkfilogicwifisupport.service
developer15a43312022-04-12 11:23:23 +080086
87 install -D -m 0644 ${WORKDIR}/wifiinitialized.path ${D}${systemd_unitdir}/system/wifiinitialized.path
developercc441a02022-05-09 19:04:26 +080088 install -D -m 0644 ${WORKDIR}/filogicwifiinitialized.path ${D}${systemd_unitdir}/system/filogicwifiinitialized.path
89 install -D -m 0644 ${WORKDIR}/checkfilogicwifisupport.path ${D}${systemd_unitdir}/system/checkfilogicwifisupport.path
developer15a43312022-04-12 11:23:23 +080090
91 install -D -m 0644 ${WORKDIR}/wifi-initialized.target ${D}${systemd_unitdir}/system/wifi-initialized.target
92
93 install -D -m 0644 ${S}/systemd_units/ProcessResetDetect.service ${D}${systemd_unitdir}/system/ProcessResetDetect.service
94 install -D -m 0644 ${S}/systemd_units/ProcessResetDetect.path ${D}${systemd_unitdir}/system/ProcessResetDetect.path
95
96 # Install wrapper for breakpad (disabled to support External Source build)
97 #install -d ${D}${includedir}/ccsp
98 #install -m 644 ${S}/source/breakpad_wrapper/include/breakpad_wrapper.h ${D}${includedir}/ccsp
99
100 # Install "vendor information"
101 install -m 0644 ${WORKDIR}/ccsp_vendor.h ${D}${includedir}/ccsp
102
103 sed -i -- 's/NotifyAccess=.*/#NotifyAccess=main/g' ${D}${systemd_unitdir}/system/CcspCrSsp.service
104 sed -i -- 's/notify.*/forking/g' ${D}${systemd_unitdir}/system/CcspCrSsp.service
105
106 #copy rfc.properties into nvram
107 sed -i '/ExecStartPre/ a\ExecStartPre=-/bin/cp /etc/rfc.properties /nvram/' ${D}${systemd_unitdir}/system/rfc.service
108 #reduce sleep time to 12 sconds
109 sed -i 's/300/12/g' ${D}${systemd_unitdir}/system/rfc.service
110
developercc441a02022-05-09 19:04:26 +0800111 #change for Filogic
developer15a43312022-04-12 11:23:23 +0800112 sed -i 's/PIDFile/#&/' ${D}${systemd_unitdir}/system/CcspPandMSsp.service
113
114 #WanManager - RdkWanManager.service
115 DISTRO_WAN_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','rdkb_wan_manager','true','false',d)}"
116 if [ $DISTRO_WAN_ENABLED = 'true' ]; then
117 install -D -m 0644 ${S}/systemd_units/RdkWanManager.service ${D}${systemd_unitdir}/system/RdkWanManager.service
118 sed -i "/WorkingDirectory/a ExecStartPre=/bin/sh /lib/rdk/run_rm_key.sh" ${D}${systemd_unitdir}/system/RdkWanManager.service
developer1495e4d2022-04-14 17:58:16 +0800119 sed -i "s/After=CcspCrSsp.service/After=CcspCrSsp.service utopia.service PsmSsp.service CcspEthAgent.service/g" ${D}${systemd_unitdir}/system/RdkWanManager.service
developer15a43312022-04-12 11:23:23 +0800120 sed -i "s/CcspPandMSsp.service/CcspCrSsp.service CcspPandMSsp.service/g" ${D}${systemd_unitdir}/system/CcspEthAgent.service
121 install -D -m 0644 ${WORKDIR}/utopia.service ${D}${systemd_unitdir}/system/utopia.service
122 install -D -m 0644 ${S}/systemd_units/RdkTelcoVoiceManager.service ${D}${systemd_unitdir}/system/RdkTelcoVoiceManager.service
123 install -D -m 0644 ${S}/systemd_units/RdkVlanManager.service ${D}${systemd_unitdir}/system/RdkVlanManager.service
developer2d1080e2023-11-27 13:24:55 +0800124 sed -i "s/After=CcspCrSsp.service/After=CcspCrSsp.service utopia.service PsmSsp.service CcspEthAgent.service/g" ${D}${systemd_unitdir}/system/RdkVlanManager.service
developer15a43312022-04-12 11:23:23 +0800125 fi
126
developer915d0d22022-07-15 15:11:26 +0800127 DISTRO_FW_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','fwupgrade_manager','true','false',d)}"
128 if [ $DISTRO_FW_ENABLED = 'true' ]; then
129 install -D -m 0644 ${S}/systemd_units/RdkFwUpgradeManager.service ${D}${systemd_unitdir}/system/RdkFwUpgradeManager.service
130 fi
developer15a43312022-04-12 11:23:23 +0800131 ##### erouter0 ip issue
132 sed -i '/Factory/a \
133IsErouterRunningStatus=\`ifconfig erouter0 | grep RUNNING | grep -v grep | wc -l\` \
134if [ \"\$IsErouterRunningStatus\" == 0 ]; then \
135ethtool -s erouter0 speed 1000 \
136fi' ${D}/usr/ccsp/ccspPAMCPCheck.sh
137
138}
139
140do_install_append_dunfell_class-target () {
141 #for yocto 3.1, Making psm to run after gwprovethwan
142 sed -i '/CcspCrSsp.service/c After=CcspCrSsp.service gwprovethwan.service' ${D}${systemd_unitdir}/system/PsmSsp.service
143}
144
145SYSTEMD_SERVICE_${PN} += "ccspwifiagent.service"
146SYSTEMD_SERVICE_${PN} += "CcspCrSsp.service"
147SYSTEMD_SERVICE_${PN} += "CcspPandMSsp.service"
148SYSTEMD_SERVICE_${PN} += "PsmSsp.service"
149SYSTEMD_SERVICE_${PN} += "rdkbLogMonitor.service"
150SYSTEMD_SERVICE_${PN} += "CcspTandDSsp.service"
151SYSTEMD_SERVICE_${PN} += "CcspLMLite.service"
152SYSTEMD_SERVICE_${PN} += "CcspTr069PaSsp.service"
153SYSTEMD_SERVICE_${PN} += "snmpSubAgent.service"
154SYSTEMD_SERVICE_${PN} += "CcspEthAgent.service"
155SYSTEMD_SERVICE_${PN} += "wifiinitialized.service"
developercc441a02022-05-09 19:04:26 +0800156SYSTEMD_SERVICE_${PN} += "checkfilogicwifisupport.service"
developer15a43312022-04-12 11:23:23 +0800157SYSTEMD_SERVICE_${PN} += "wifiinitialized.path"
developercc441a02022-05-09 19:04:26 +0800158SYSTEMD_SERVICE_${PN} += "filogicwifiinitialized.path"
159SYSTEMD_SERVICE_${PN} += "checkfilogicwifisupport.path"
developer15a43312022-04-12 11:23:23 +0800160SYSTEMD_SERVICE_${PN} += "wifi-initialized.target"
161SYSTEMD_SERVICE_${PN} += "ProcessResetDetect.path"
162SYSTEMD_SERVICE_${PN} += "ProcessResetDetect.service"
163SYSTEMD_SERVICE_${PN} += "rfc.service"
developer623cc8c2022-09-05 11:20:56 +0800164SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'rdkb_wan_manager', 'RdkWanManager.service utopia.service RdkVlanManager.service ', '', d)}"
developer915d0d22022-07-15 15:11:26 +0800165SYSTEMD_SERVICE_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'fwupgrade_manager', 'RdkFwUpgradeManager.service ', '', d)}"
developer15a43312022-04-12 11:23:23 +0800166
167FILES_${PN}_append = " \
168 /usr/ccsp/ccspSysConfigEarly.sh \
169 /usr/ccsp/ccspSysConfigLate.sh \
170 /usr/ccsp/utopiaInitCheck.sh \
171 /usr/ccsp/ccspPAMCPCheck.sh \
172 /usr/ccsp/ProcessResetCheck.sh \
173 ${systemd_unitdir}/system/ccspwifiagent.service \
174 ${systemd_unitdir}/system/CcspCrSsp.service \
175 ${systemd_unitdir}/system/CcspPandMSsp.service \
176 ${systemd_unitdir}/system/PsmSsp.service \
177 ${systemd_unitdir}/system/rdkbLogMonitor.service \
178 ${systemd_unitdir}/system/CcspTandDSsp.service \
179 ${systemd_unitdir}/system/CcspLMLite.service \
180 ${systemd_unitdir}/system/CcspTr069PaSsp.service \
181 ${systemd_unitdir}/system/snmpSubAgent.service \
182 ${systemd_unitdir}/system/CcspEthAgent.service \
183 ${systemd_unitdir}/system/wifiinitialized.service \
developercc441a02022-05-09 19:04:26 +0800184 ${systemd_unitdir}/system/checkfilogicwifisupport.service \
developer15a43312022-04-12 11:23:23 +0800185 ${systemd_unitdir}/system/wifiinitialized.path \
developercc441a02022-05-09 19:04:26 +0800186 ${systemd_unitdir}/system/filogicwifiinitialized.path \
187 ${systemd_unitdir}/system/checkfilogicwifisupport.path \
developer15a43312022-04-12 11:23:23 +0800188 ${systemd_unitdir}/system/wifi-initialized.target \
189 ${systemd_unitdir}/system/ProcessResetDetect.path \
190 ${systemd_unitdir}/system/ProcessResetDetect.service \
191 ${systemd_unitdir}/system/rfc.service \
192"
193FILES_${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)}"
developer915d0d22022-07-15 15:11:26 +0800194FILES_${PN}_append = "${@bb.utils.contains('DISTRO_FEATURES', 'fwupgrade_manager', ' ${systemd_unitdir}/system/RdkFwUpgradeManager.service ', '', d)}"