developer | 15a4331 | 2022-04-12 11:23:23 +0800 | [diff] [blame] | 1 | require ccsp_common_turris.inc |
| 2 | |
| 3 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
| 4 | |
| 5 | LDFLAGS += " \ |
| 6 | -lutopiautil \ |
| 7 | " |
| 8 | #CFLAGS_append = " -Wno-error -DWIFI_HAL_VERSION_3" |
| 9 | CFLAGS_append = " -Wno-error" |
| 10 | |
| 11 | #work around for wifi restart_flag=false, for meshagent synchroniztaion |
| 12 | do_configure_prepend() { |
| 13 | sed -i '/wlanRestart == TRUE/!{p;d;};n;a #if defined(ENABLE_FEATURE_MESHWIFI)\n if ((sWiFiDmlSsidStoredCfg[wlanIndex].SSID, sWiFiDmlSsidRunningCfg[wlanIndex].SSID) != 0)\n {\n char arg[256] = {0};\n snprintf(arg, sizeof(arg), "RDK|%d|%s",wlanIndex,sWiFiDmlSsidStoredCfg[wlanIndex].SSID);\n char * const cmd[] = {"/usr/bin/sysevent", "set", "wifi_SSIDName", arg, NULL};\n execvp_wrapper(cmd);\n }\n #endif\n' ${S}/source/TR-181/sbapi/cosa_wifi_apis.c |
| 14 | } |
| 15 | |
| 16 | DEPENDS_append_dunfell = " avro-c" |
| 17 | |
| 18 | SRC_URI_append = " \ |
| 19 | file://wifiTelemetrySetup.sh \ |
| 20 | file://checkwifi.sh \ |
| 21 | file://radio_param_def.cfg \ |
| 22 | file://synclease.sh \ |
| 23 | file://handle_mesh-rename-opensync.patch;apply=no \ |
| 24 | file://avoid_gssidcount_error.patch;apply=no \ |
| 25 | " |
| 26 | |
| 27 | # we need to patch to code for ccsp-wifi-agent |
| 28 | do_turris_ccspwifiagent_patches() { |
| 29 | cd ${S} |
| 30 | if [ ! -e patch_applied ]; then |
| 31 | bbnote "Patching handle_mesh-rename-opensync.patch" |
| 32 | patch -p1 < ${WORKDIR}/handle_mesh-rename-opensync.patch ${S}/scripts/handle_mesh |
| 33 | patch -p1 < ${WORKDIR}/avoid_gssidcount_error.patch || echo "ERROR or Patch already applied" |
| 34 | touch patch_applied |
| 35 | fi |
| 36 | } |
| 37 | addtask turris_ccspwifiagent_patches after do_unpack before do_configure |
| 38 | |
| 39 | EXTRA_OECONF_append = " --with-ccsp-arch=arm" |
| 40 | |
| 41 | do_install_append(){ |
| 42 | install -m 777 ${D}/usr/bin/CcspWifiSsp -t ${D}/usr/ccsp/wifi/ |
| 43 | install -m 755 ${S}/scripts/cosa_start_wifiagent.sh ${D}/usr/ccsp/wifi |
| 44 | install -m 777 ${WORKDIR}/wifiTelemetrySetup.sh ${D}/usr/ccsp/wifi/ |
| 45 | install -m 777 ${WORKDIR}/checkwifi.sh ${D}/usr/ccsp/wifi/ |
| 46 | install -m 777 ${WORKDIR}/radio_param_def.cfg ${D}/usr/ccsp/wifi/ |
| 47 | install -m 777 ${WORKDIR}/synclease.sh ${D}/usr/ccsp/wifi/ |
| 48 | } |
| 49 | |
| 50 | FILES_${PN} += " \ |
| 51 | ${prefix}/ccsp/wifi/CcspWifiSsp \ |
| 52 | ${prefix}/ccsp/wifi/cosa_start_wifiagent.sh \ |
| 53 | ${prefix}/ccsp/wifi/wifiTelemetrySetup.sh \ |
| 54 | ${prefix}/ccsp/wifi/checkwifi.sh \ |
| 55 | ${prefix}/ccsp/wifi/radio_param_def.cfg \ |
| 56 | ${prefix}/ccsp/wifi/synclease.sh \ |
| 57 | " |
| 58 | |
| 59 | LDFLAGS_append_dunfell = " -lpthread" |