blob: fa5a4ec8e7dd866fece671ba17dee8196b58aa02 [file] [log] [blame]
developer5ee7f522024-04-18 14:11:52 +08001#!/bin/sh
2# prepare hostapd patch
3hostapd=0
4wpa_supplicant=0
5
6for arg in $*; do
7 case "$arg" in
8 "hostapd")
9 hostapd=1
10 ;;
11 "wpa_supplicant")
12 wpa_supplicant=1
13 ;;
14 *)
15 esac
16done
17
18[ "$hostapd" = "1" ] && {
19 SRC_DIR="../src/wifi/wlan_daemon/hostapd"
20 MAKE_DIR="../meta-filogic-logan/recipes-wifi/hostapd/files"
21
22 echo "prepare hostapd patch"
23 mkdir ${MAKE_DIR}/patches
24 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/patches/ ${MAKE_DIR}/
25 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/src/ ${MAKE_DIR}/
26 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/files/hostapd-full.config ${MAKE_DIR}/
27 cp -rf ../meta-cmf-filogic/mtk_scripts/rdkb_inc_helper ${MAKE_DIR}/
28 ver=`grep "PKG_SOURCE_VERSION" ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/Makefile | cut -c 21-`
29 sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' ../meta-filogic-logan/recipes-wifi/hostapd/hostapd_2.10.bb
30 cd ${MAKE_DIR}
31 ./rdkb_inc_helper patches
32 mv patches.inc patches/
33 rm rdkb_inc_helper
34 sed -i 's/#include "wpa_supplicant_i.h"/#include "..\/..\/wpa_supplicant\/wpa_supplicant_i.h"/g' patches/mtk-hostapd-12map-000-mtk-map.patch
35 cd -
36}
37
38[ "$wpa_supplicant" = "1" ] && {
39 SRC_DIR="../src/wifi/wlan_daemon/hostapd"
40 MAKE_DIR="../meta-filogic-logan/recipes-wifi/wpa-supplicant/files"
41
42 echo "prepare wpa_supplicant patch"
43 mkdir ${MAKE_DIR}/patches
44 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/patches/ ${MAKE_DIR}/
45 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/src/ ${MAKE_DIR}/
46 cp -rf ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/files/wpa_supplicant-full.config ${MAKE_DIR}/
47 cp -rf ../meta-cmf-filogic/mtk_scripts/rdkb_inc_helper ${MAKE_DIR}/
48 ver=`grep "PKG_SOURCE_VERSION" ${SRC_DIR}/mt7988/mt7990/files/package/network/services/hostapd/Makefile | cut -c 21-`
49 sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' ../meta-filogic-logan/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.bb
50 cd ${MAKE_DIR}
51 ./rdkb_inc_helper patches
52 mv patches.inc patches/
53 rm rdkb_inc_helper
54 sed -i '/+OBJS += ..\/src\/ml\/ml_supplicant.o/ a +CFLAGS += -DHOSTAPD_PMKID_IN_DRIVER_SUPPORT\n+CFLAGS += -DCONFIG_MTK_PASSPOINT' patches/mtk-hostapd-0311be-000-mtk-mlo.patch
55 sed -i 's/@@ -377,6 +377,14 @@ NEED_MD5=y/@@ -377,6 +377,16 @@ NEED_MD5=y/' patches/mtk-hostapd-0311be-000-mtk-mlo.patch
56 cd -
57}