blob: 1f592e7b0da88fc4aea4663bade4b604e499e063 [file] [log] [blame]
developer15a43312022-04-12 11:23:23 +08001FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
2
3require ccsp_common_turris.inc
4
5DEPENDS_append = " utopia curl "
6
7CFLAGS_append = " \
8 -I=${includedir}/utctx \
9 -I=${includedir}/utapi \
10"
11LDFLAGS_append =" \
12 -lsyscfg \
13 -lbreakpadwrapper \
14"
15
16LDFLAGS_remove = " \
17 -lmoca_mgnt \
18"
19
20CFLAGS_remove = "-Werror"
21
22EXTRA_OECONF_append = " --with-ccsp-arch=arm"
23
24do_configure_prepend () {
25 #for WanManager support
26 #Below lines of code needs to be removed , once (Device.DHCPv4.Client.{i} and Device.DhCPv6,CLient.{i}) the mentioned parameters are permanently removed from TR181-USGv2.XML
27 DISTRO_WAN_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','rdkb_wan_manager','true','false',d)}"
28if [ $DISTRO_WAN_ENABLED = 'true' ]; then
29if [ ! -f ${WORKDIR}/WanManager_XML_UPDATED ]; then
30 GREP_WORD=`cat -n ${S}/config-arm/TR181-USGv2.XML | grep 9536 | cut -d '<' -f2 | cut -d '>' -f2`
31 if [ "$GREP_WORD" = "ClientNumberOfEntries" ]; then
32 #for DHCPv4.Client.{i}.
33 sed -i '9534s/<parameter>/<!-- <parameter>/g' ${S}/config-arm/TR181-USGv2.XML
34 sed -i '9542s/<\/parameter>/<\/parameter>-->/g' ${S}/config-arm/TR181-USGv2.XML
35 sed -i '9642s/<object>/<!-- <object>/g' ${S}/config-arm/TR181-USGv2.XML
36 sed -i '10058s/<\/object>/<\/object>-->/g' ${S}/config-arm/TR181-USGv2.XML
37 #for DHCPv6.Client.{i}.
38 sed -i '10832s/<parameter>/<!-- <parameter>/g' ${S}/config-arm/TR181-USGv2.XML
39 sed -i '10836s/<\/parameter>/<\/parameter>-->/g' ${S}/config-arm/TR181-USGv2.XML
40 sed -i '10839s/<object>/<!-- <object>/g' ${S}/config-arm/TR181-USGv2.XML
41 sed -i '11138s/<\/object>/<\/object>-->/g' ${S}/config-arm/TR181-USGv2.XML
42 fi
43 touch ${WORKDIR}/WanManager_XML_UPDATED
44fi
45fi
46}
47
48do_install_append(){
49 # Config files and scripts
50 install -m 644 ${S}/config-arm/CcspDmLib.cfg ${D}/usr/ccsp/pam/CcspDmLib.cfg
51 install -m 644 ${S}/config-arm/CcspPam.cfg -t ${D}/usr/ccsp/pam
52 install -m 644 ${S}/config-arm/TR181-USGv2.XML -t ${D}/usr/ccsp/pam
53 install -m 755 ${S}/scripts/email_notification_monitor.sh ${D}/usr/ccsp/pam/email_notification_monitor.sh
54 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/calc_random_time_to_reboot_dev.sh ${D}/usr/ccsp/pam/calc_random_time_to_reboot_dev.sh
55 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/network_response.sh ${D}/usr/ccsp/pam/network_response.sh
56 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/network_response.sh ${D}/etc/network_response.sh
57 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/redirect_url.sh ${D}/usr/ccsp/pam/redirect_url.sh
58 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/revert_redirect.sh ${D}/usr/ccsp/pam/revert_redirect.sh
59 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/redirect_url.sh ${D}/etc/redirect_url.sh
60 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/revert_redirect.sh ${D}/etc/revert_redirect.sh
61 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/restart_services.sh ${D}/etc/restart_services.sh
62 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/whitelist.sh ${D}/usr/ccsp/pam/whitelist.sh
63 install -m 755 ${S}/arch/intel_usg/boards/arm_shared/scripts/moca_status.sh ${D}/usr/ccsp/pam/moca_status.sh
64 install -m 777 ${D}/usr/bin/CcspPandMSsp -t ${D}/usr/ccsp/pam/
65
66 install -d ${D}/fss/gw/usr/sbin
67 ln -sf /sbin/ip.iproute2 ${D}/fss/gw/usr/sbin/ip
68
69 #captiveportal redirection
70 DISTRO_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','webui_jst','true','false',d)}"
71 if [ $DISTRO_ENABLED = 'false' ]; then
72 sed -i "/captiveportaldhcp/a fi" ${D}/etc/revert_redirect.sh
73 sed -i "/captiveportaldhcp/a lighttpd -f /var/lighttpd.conf" ${D}/etc/revert_redirect.sh
74 sed -i "/captiveportaldhcp/a sleep 2" ${D}/etc/revert_redirect.sh
75 sed -i "/captiveportaldhcp/a killall lighttpd" ${D}/etc/revert_redirect.sh
76 sed -i "/captiveportaldhcp/a sed -i '\$d' /var/lighttpd.conf" ${D}/etc/revert_redirect.sh
77 sed -i "/captiveportaldhcp/a sed -i '\$d' /var/lighttpd.conf" ${D}/etc/revert_redirect.sh
78 sed -i "/captiveportaldhcp/a sed -e '/url.redirect/ s/^#*/#/' -i /var/lighttpd.conf" ${D}/etc/revert_redirect.sh
79 sed -i "/captiveportaldhcp/a if [ \$CAPTIVEPORTAL == \"$\" ] ; then" ${D}/etc/revert_redirect.sh
80 sed -i "/captiveportaldhcp/a CAPTIVEPORTAL=\`cat /var/lighttpd.conf | grep captiveportal.php | cut -c1\`" ${D}/etc/revert_redirect.sh
81 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
82 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
83 sed -i "/dibbler-server start/a lighttpd -f \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
84 sed -i "/dibbler-server start/a sleep 2" ${D}/etc/restart_services.sh
85 sed -i "/dibbler-server start/a killall lighttpd" ${D}/etc/restart_services.sh
86 sed -i "/dibbler-server start/a sed -i '\$d' \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
87 sed -i "/dibbler-server start/a sed -i '\$d' \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
88 sed -i "/dibbler-server start/a sed -e '/url.redirect/ s/^#*/#/' -i \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
89 sed -i "/dibbler-server start/a if [ \$CAPTIVEPORTAL == \"\$\" ] ; then" ${D}/etc/restart_services.sh
90 sed -i "/dibbler-server start/a CAPTIVEPORTAL=\`cat /var/lighttpd.conf | grep captiveportal.php | cut -c1\`" ${D}/etc/restart_services.sh
91 sed -i "/dibbler-server start/a if [ \"\$CaptivePortal_flag\" == 1 ] && [ \"\$1\" == \"false\" ] ; then" ${D}/etc/restart_services.sh
92 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
93 sed -i "/dibbler-server start/a lighttpd -f \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
94 sed -i "/dibbler-server start/a sleep 2" ${D}/etc/restart_services.sh
95 sed -i "/dibbler-server start/a killall lighttpd" ${D}/etc/restart_services.sh
96 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
97 sed -i "/dibbler-server start/a echo \"}\" >> \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
98 sed -i "/dibbler-server start/a echo \"}\" >> \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
99 sed -i "/dibbler-server start/a echo \"\\\\\$HTTP[\\\\\"host\\\\\"] !~ \\\\\":8080\\\\\" { \\\\\$HTTP[\\\\\"url\\\\\"] !~ \\\\\"captiveportal.php\\\\\" { \\\\\$HTTP[\\\\\"referer\\\\\"] == \\\\\"\\\\\" { url.redirect = ( \\\\\".*\\\\\" => \\\\\"http://10.0.0.1/captiveportal.php\\\\\" ) url.redirect-code = 303 }\" >> \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
100 sed -i "/dibbler-server start/a else" ${D}/etc/restart_services.sh
101 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
102 sed -i "/dibbler-server start/a echo \"}\" >> \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
103 sed -i "/dibbler-server start/a echo \"}\" >> \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
104 sed -i "/dibbler-server start/a sed -i \"/captiveportal.php/ s/^#*//g\" \$LIGHTTPD_CONF" ${D}/etc/restart_services.sh
105 sed -i "/dibbler-server start/a else" ${D}/etc/restart_services.sh
106 sed -i "/dibbler-server start/a echo \"Already lighttpd was successfully running with captiveportal changes\"" ${D}/etc/restart_services.sh
107 sed -i "/dibbler-server start/a if [ \"\$lighttpd\" == \"\$\" ] ; then" ${D}/etc/restart_services.sh
108 sed -i "/dibbler-server start/a if [ \"\$lighttpd_flag\" == 1 ] ; then" ${D}/etc/restart_services.sh
109 sed -i "/dibbler-server start/a lighttpd=\`cat /var/lighttpd.conf | grep captiveportal.php | cut -c1\`" ${D}/etc/restart_services.sh
110 sed -i "/dibbler-server start/a lighttpd_flag=\`cat /var/lighttpd.conf | grep captiveportal.php | wc -l\`" ${D}/etc/restart_services.sh
111 sed -i "/dibbler-server start/a if [ \"\$CaptivePortal_flag\" == 1 ] && [ \"\$1\" == \"true\" ] ; then" ${D}/etc/restart_services.sh
112 sed -i "/dibbler-server start/a fi" ${D}/etc/restart_services.sh
113 sed -i "/dibbler-server start/a CaptivePortal_flag=1" ${D}/etc/restart_services.sh
114 sed -i "/dibbler-server start/a else" ${D}/etc/restart_services.sh
115 sed -i "/dibbler-server start/a CaptivePortal_flag=0" ${D}/etc/restart_services.sh
116 sed -i "/dibbler-server start/a if [ -f /nvram/reverted ] ; then" ${D}/etc/restart_services.sh
117 sed -i "/dibbler-server start/a LIGHTTPD_CONF=/var/lighttpd.conf" ${D}/etc/restart_services.sh
118 sed -i "/dibbler-server start/a #captiveportal redirection" ${D}/etc/restart_services.sh
119 fi
120
121########## ETHWAN Support
122 sed -i "s/www.comcast.net/www.google.com/g" ${D}/etc/partners_defaults.json
123 sed -i "s/\"Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.RDKB_UIBranding.AllowEthernetWAN\"\ :\ \"false\"\ \,/\"Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.RDKB_UIBranding.AllowEthernetWAN\" : \"true\" ,/g" ${D}/etc/partners_defaults.json
124
125}
126
127
128FILES_${PN}-ccsp += " \
129 ${prefix}/ccsp/pam/CcspPandMSsp \
130 /fss/gw/usr/sbin/ip \
131"
132
133RDEPENDS_${PN}-ccsp_append_dunfell = " bash"