blob: 35f2eb9aa30bfe90b3049ecee8242e60817869b3 [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001SRC_URI_append = " \
2 ${CMF_GIT_ROOT}/rdkb/devices/raspberrypi/sysint;module=.;protocol=${CMF_GIT_PROTOCOL};branch=${CMF_GIT_BRANCH};destsuffix=git/devicerpi;name=sysintdevicerpi \
3"
4SRCREV_sysintdevicerpi = "${AUTOREV}"
5SRCREV_FORMAT = "sysintgeneric_sysintdevicerpi"
6
developer15a43312022-04-12 11:23:23 +08007
8do_install_append() {
developer15a43312022-04-12 11:23:23 +08009 install -d ${D}${systemd_unitdir}/system
developer783a8a62024-01-17 12:34:31 +080010 install -m 0755 ${S}/device/lib/rdk/* ${D}${base_libdir}/rdk
11 install -m 0755 ${S}/rfc.service ${D}${base_libdir}/rdk
12 install -m 0755 ${S}/utils.sh ${D}${base_libdir}/rdk
13 install -m 0755 ${S}/getpartnerid.sh ${D}${base_libdir}/rdk
14 install -m 0755 ${S}/device/systemd_units/* ${D}${systemd_unitdir}/system/
15 echo "BOX_TYPE=rpi" >> ${D}${sysconfdir}/device.properties
16 echo "ARM_INTERFACE=erouter0" >> ${D}${sysconfdir}/device.properties
17 echo "MODEL_NAME=RPI" >> ${D}${sysconfdir}/device.properties
18 echo "ATOM_INTERFACE=br0" >> ${D}${sysconfdir}/device.properties
19 echo "ATOM_INTERFACE_IP=192.168.101.3" >> ${D}${sysconfdir}/device.properties
20 echo "ATOM_PROXY_SERVER=192.168.101.3" >> ${D}${sysconfdir}/device.properties
21 echo "PARODUS_URL=tcp://127.0.0.1:6666" >> ${D}${sysconfdir}/device.properties
22 echo "WEBPA_CLIENT_URL=tcp://192.168.101.3:6667" >> ${D}${sysconfdir}/device.properties
23 echo "CLOUDURL="https://xconf.rdkcentral.com:19092/xconf/swu/stb?eStbMac="" >> ${D}${sysconfdir}/include.properties
developer15a43312022-04-12 11:23:23 +080024
developer783a8a62024-01-17 12:34:31 +080025 sed -i -e 's/LOG_SERVER=.*$/LOG_SERVER=xconf.rdkcentral.com/' ${D}${sysconfdir}/dcm.properties
26 sed -i -e 's/DCM_LOG_SERVER=.*$/DCM_LOG_SERVER=https:\/\/xconf.rdkcentral.com\/xconf\/logupload.php/' ${D}${sysconfdir}/dcm.properties
27 sed -i -e 's/DCM_LOG_SERVER_URL=.*$/DCM_LOG_SERVER_URL=https:\/\/xconf.rdkcentral.com:19092\/loguploader\/getSettings/' ${D}${sysconfdir}/dcm.properties
28 sed -i -e 's/DCM_SCP_SERVER=.*$/DCM_SCP_SERVER=xconf.rdkcentral.com/' ${D}${sysconfdir}/dcm.properties
29 sed -i -e 's/HTTP_UPLOAD_LINK=.*$/HTTP_UPLOAD_LINK=https:\/\/xconf.rdkcentral.com\/xconf\/telemetry_upload.php/' ${D}${sysconfdir}/dcm.properties
30 sed -i -e 's/DCA_UPLOAD_URL=.*$/DCA_UPLOAD_URL=xconf.rdkcentral.com/' ${D}${sysconfdir}/dcm.properties
31 echo "DCM_HTTP_SERVER_URL="https://xconf.rdkcentral.com/xconf/telemetry_upload.php"" >> ${D}${sysconfdir}/dcm.properties
32 echo "DCM_LA_SERVER_URL="https://xconf.rdkcentral.com/xconf/logupload.php"" >> ${D}${sysconfdir}/dcm.properties
33 #For rfc Support
34 sed -i '/DEVICE_TYPE/c\DEVICE_TYPE=broadband' ${D}${sysconfdir}/device.properties
35 sed -i '/LOG_PATH/c\LOG_PATH=/rdklogs/logs/' ${D}${sysconfdir}/device.properties
36 #Erouter0 info
37 sed -i "/f11/c\ mac=\`ifconfig \$WANINTERFACE | grep HWaddr | cut -d \" \" -f7\`" ${D}${base_libdir}/rdk/utils.sh
38 sed -i '/Device.X_CISCO_COM_CableModem.MACAddress/{n;s/.*/ elif [ "$BOX_TYPE" = "XF3" ]; then/}' ${D}${base_libdir}/rdk/utils.sh
developer15a43312022-04-12 11:23:23 +080039 #DCM simulator Support
developer783a8a62024-01-17 12:34:31 +080040 install -m 0755 ${S}/devicerpi/lib/rdk/StartDCM.sh ${D}${base_libdir}/rdk
41 install -m 0755 ${S}/devicerpi/lib/rdk/DCMscript.sh ${D}${base_libdir}/rdk
42 install -m 0755 ${S}/devicerpi/lib/rdk/uploadSTBLogs.sh ${D}${base_libdir}/rdk
43 install -m 0755 ${S}/devicerpi/lib/rdk/interfaceCalls.sh ${D}${base_libdir}/rdk
44 install -m 0755 ${S}/devicerpi/lib/rdk/commonUtils.sh ${D}${base_libdir}/rdk
45 install -m 0755 ${S}/devicerpi/lib/rdk/logfiles.sh ${D}${base_libdir}/rdk
46 install -m 0755 ${S}/devicerpi/lib/rdk/backupLogs.sh ${D}${base_libdir}/rdk
47 install -m 0755 ${S}/devicerpi/lib/rdk/bank_image_switch.sh ${D}${base_libdir}/rdk
48 install -m 0755 ${S}/devicerpi/lib/rdk/deviceInitiatedFWDnld.sh ${D}${base_libdir}/rdk
49 install -m 0755 ${S}/devicerpi/lib/rdk/imageFlasher.sh ${D}${base_libdir}/rdk
50 install -m 0755 ${S}/devicerpi/lib/rdk/rpi_sw_install.sh ${D}${base_libdir}/rdk
51 install -m 0755 ${S}/devicerpi/lib/rdk/rpi_sw_install1.sh ${D}${base_libdir}/rdk
52 install -m 0755 ${S}/devicerpi/lib/rdk/snmpUtils.sh ${D}${base_libdir}/rdk
53 install -m 0755 ${S}/devicerpi/lib/rdk/rpi_image_Flasher.sh ${D}${base_libdir}/rdk
54 install -m 0755 ${S}/devicerpi/lib/rdk/swupdate_utility.sh ${D}${base_libdir}/rdk
55 install -m 0755 ${S}/devicerpi/lib/rdk/dcaSplunkUpload.sh ${D}${base_libdir}/rdk
56 install -m 0755 ${S}/devicerpi/lib/rdk/dca_utility.sh ${D}${base_libdir}/rdk
57 install -m 0755 ${S}/devicerpi/systemd_units/previous-log-backup.service ${D}${systemd_unitdir}/system
58 install -m 0755 ${S}/devicerpi/systemd_units/swupdate.service ${D}${systemd_unitdir}/system
59 install -m 0644 ${S}/devicerpi/systemd_units/hostapd_backup_check.service ${D}${systemd_unitdir}/system
60 rm ${D}${systemd_unitdir}/system/dcm-log.service
61
62 #NTPD
63 install -m 0644 ${S}/devicerpi/systemd_units/ntpd.service ${D}${systemd_unitdir}/system
64
65 # Factory Reset Support
66 install -d ${D}/fss/gw/rdklogger
67 install -m 0755 ${S}/backupLogs.sh ${D}/fss/gw/rdklogger
68 sed -i "s/RDK_LOGGER_PATH=\"\/rdklogger/RDK_LOGGER_PATH=\"\/lib\/rdk/g" ${D}/fss/gw/rdklogger/backupLogs.sh
69 sed -i "/lib\/rdk/a LOG_BACK_UP_REBOOT=\"\/nvram\/logbackupreboot\"" ${D}/fss/gw/rdklogger/backupLogs.sh
developer15a43312022-04-12 11:23:23 +080070
71 #Log Rotate Support
developer783a8a62024-01-17 12:34:31 +080072 install -m 0644 ${S}/logFiles.properties ${D}${sysconfdir}/
73 echo "NVRAM2_SUPPORTED=yes" >> ${D}${sysconfdir}/device.properties
74 # Commenting below line for proper working of telemetry cron job
75 # install -m 0755 ${S}/dca_utility.sh ${D}${base_libdir}/rdk
76 install -m 0755 ${S}/getaccountid.sh ${D}${base_libdir}/rdk
77 install -m 0644 ${S}/dcmlogservers.txt ${D}/rdklogger/
78 sed -i "/if \[ \! -f \/usr\/bin\/GetConfigFile \]\;then/,+4d" ${D}/rdklogger/logfiles.sh
developer15a43312022-04-12 11:23:23 +080079 sed -i "/uploadRDKBLogs.sh/a \ \t \t \t uploading_rdklogs" ${D}/rdklogger/rdkbLogMonitor.sh
80 sed -i "/uploadRDKBLogs.sh/d " ${D}/rdklogger/rdkbLogMonitor.sh
developer783a8a62024-01-17 12:34:31 +080081 sed -i "/upload_nvram2_logs()/i uploading_rdklogs() \n { \n \ \t \t TFTP_RULE_COUNT=\`iptables -t raw -L -n | grep tftp | wc -l\` \n \ \t \t if [ \"\$TFTP_RULE_COUNT\" == 0 ] \n \t \t then \n \ \t \t \t iptables -t raw -I OUTPUT -j CT -p udp -m udp --dport 69 --helper tftp \n \ \t \t \t sleep 2 \n \ \t \t fi \n \ \t \t cd /nvram2/logs \n \ \t \t FILENAME=\`ls *.tgz\` \n \ \t \t tftp -p -r \$FILENAME \$TFTP_SERVER_IP \n } " ${D}/rdklogger/rdkbLogMonitor.sh
82 echo "TFTP_SERVER_IP=35.161.239.220" >> ${D}${sysconfdir}/device.properties
83
84 #self heal support
85 install -d ${D}/usr/ccsp/tad
86 install -m 0755 ${S}/devicerpi/lib/rdk/corrective_action.sh ${D}/usr/ccsp/tad
87 install -m 0755 ${S}/devicerpi/lib/rdk/self_heal_connectivity_test.sh ${D}/usr/ccsp/tad
88 install -m 0755 ${S}/devicerpi/lib/rdk/resource_monitor.sh ${D}/usr/ccsp/tad
89 install -m 0755 ${S}/devicerpi/lib/rdk/task_health_monitor.sh ${D}/usr/ccsp/tad
90 install -m 0644 ${S}/devicerpi/systemd_units/disable_systemd_restart_param.service ${D}${systemd_unitdir}/system
91 install -m 0755 ${S}/devicerpi/lib/rdk/disable_systemd_restart_param.sh ${D}${base_libdir}/rdk
developer15a43312022-04-12 11:23:23 +080092
developer783a8a62024-01-17 12:34:31 +080093 #Firmware Upgrade support
94 echo "PART_SIZE_OFFSET=4194304" >> ${D}${sysconfdir}/device.properties
95
96 #Remote Management Support
97 install -m 0755 ${S}/devicerpi/lib/rdk/run_rm_key.sh ${D}${base_libdir}/rdk
98
99 if ${@bb.utils.contains('DISTRO_FEATURES', 'webconfig_bin', 'true', 'false', d)}; then
100 echo "WEBCONFIG_INTERFACE=erouter0" >> ${D}${sysconfdir}/device.properties
101 fi
developer15a43312022-04-12 11:23:23 +0800102}
103
developer783a8a62024-01-17 12:34:31 +0800104do_install_append_broadband-dev() {
105install -m 0755 ${S}/devicerpi/lib/rdk/build_component_script.sh ${D}${base_libdir}/rdk
106}
107do_install_append_bootbroadband() {
108 install -m 0755 ${S}/devicerpi/lib/rdk/flash.sh ${D}${base_libdir}/rdk
109 install -m 0755 ${S}/devicerpi/lib/rdk/vm-to-image.sh ${D}${base_libdir}/rdk
110 install -m 0755 ${S}/devicerpi/lib/rdk/curl-upload.sh ${D}${base_libdir}/rdk
111 install -m 0755 ${S}/devicerpi/lib/rdk/monitor-upload.sh ${D}${base_libdir}/rdk
112 install -m 0755 ${S}/devicerpi/systemd_units/boot-time-upload.service ${D}${systemd_unitdir}/system
113 install -m 0755 ${S}/devicerpi/systemd_units/monitor-upload.service ${D}${systemd_unitdir}/system
114}
115
116SYSTEMD_SERVICE_${PN}_append = " dropbear.service disable_systemd_restart_param.service ntpd.service swupdate.service "
117SYSTEMD_SERVICE_${PN}_remove_broadband = "dropbear.service"
118SYSTEMD_SERVICE_${PN}_append_bootbroadband += " boot-time-upload.service monitor-upload.service"
developer15a43312022-04-12 11:23:23 +0800119
developer783a8a62024-01-17 12:34:31 +0800120FILES_${PN}_append = " ${systemd_unitdir}/system/* /fss/gw/rdklogger/* /usr/ccsp/tad/*"
121FILES_${PN}_append_bootbroadband = " ${systemd_unitdir}/system/*"