developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 1 | DESCRIPTION = "mt76-test" |
| 2 | SECTION = "applications" |
| 3 | LICENSE = "GPLv2" |
| 4 | LIC_FILES_CHKSUM = "file://../COPYING;md5=c188eeeb69c0a05d0545816f1458a0c9" |
| 5 | |
| 6 | DEPENDS += "libnl-tiny" |
| 7 | |
| 8 | inherit pkgconfig cmake |
| 9 | |
| 10 | PV = "1.0" |
| 11 | |
| 12 | require mt76.inc |
| 13 | SRC_URI = " \ |
| 14 | git://git@github.com/openwrt/mt76.git;protocol=https \ |
| 15 | file://COPYING;subdir=git \ |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 16 | file://0001-mt76-add-internal-wed_tiny-header-file.patch;apply=no \ |
developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 17 | " |
| 18 | |
| 19 | |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 20 | |
| 21 | |
developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 22 | DEPENDS += "virtual/kernel" |
| 23 | DEPENDS += "linux-mac80211" |
| 24 | DEPENDS += "linux-mt76" |
| 25 | |
| 26 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
| 27 | |
| 28 | |
| 29 | CFLAGS_append = " -I=${includedir}/libnl-tiny " |
| 30 | |
| 31 | S = "${WORKDIR}/git/tools" |
| 32 | |
| 33 | SRC_URI += "file://*.patch;apply=no" |
| 34 | |
developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 35 | do_mtk_patches() { |
| 36 | cd ${S}/../ |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 37 | DISTRO_FlowBlock_ENABLED="${@bb.utils.contains('DISTRO_FEATURES','flow_offload','true','false',d)}" |
| 38 | |
developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 39 | if [ ! -e mtk_wifi_patch_applied ]; then |
developer | ddae150 | 2022-11-16 18:00:20 +0800 | [diff] [blame] | 40 | for i in ${WORKDIR}/*.patch |
| 41 | do |
| 42 | if [ $DISTRO_FlowBlock_ENABLED = 'true' ]; then |
| 43 | patch -p1 < $i; |
| 44 | else |
| 45 | prefix=$(echo -n "${WORKDIR}"|wc -c) |
| 46 | patch_number_start=$(expr $prefix + 2) |
| 47 | patch_number_end=$(expr $patch_number_start + 3 ) |
| 48 | patch_number=$(echo "$i" | cut -c"$patch_number_start"-"$patch_number_end") |
| 49 | |
| 50 | if [ "$patch_number" -ge "3000" ]; then |
| 51 | continue; |
| 52 | else |
| 53 | patch -p1 < $i; |
| 54 | fi |
| 55 | fi |
| 56 | done |
developer | 9ac79da | 2022-10-31 14:57:29 +0800 | [diff] [blame] | 57 | fi |
| 58 | touch mtk_wifi_patch_applied |
| 59 | } |
| 60 | addtask mtk_patches after do_patch before do_configure |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |