From 74d9478ec8671b7e5d89638ce1bb0b541a2026f5 Mon Sep 17 00:00:00 2001 From: Cai-shiwei159 Date: Tue, 14 Jan 2025 17:24:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E5=8F=B7=EF=BC=9AIBHRZG=20=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=EF=BC=9A5.0TPC=E6=95=B4=E6=94=B9WPA3=E6=96=B0?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E6=96=B9=E6=A1=88=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=20=E9=97=AE=E9=A2=98=E6=A0=B9=E5=9B=A0=EF=BC=9A?= =?UTF-8?q?=E6=97=A0=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=95=B4=E6=94=B9=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=8F=98=E6=88=90=E8=A7=84=E8=8C=83=E8=87=AA?= =?UTF-8?q?=E6=A3=80=EF=BC=9AY=20=E6=98=AF=E5=90=A6=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E4=B8=94=E9=AA=8C=E8=AF=81=E9=80=9A=E8=BF=87=EF=BC=9AY=20?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E7=9A=84=E8=AE=BE=E5=A4=87=E4=B8=8E=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E8=8C=83=E5=9B=B4=EF=BC=9A=E6=89=80=E6=9C=89=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=20=E5=9B=A2=E9=98=9F=EF=BC=9A=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=9B=A2=E9=98=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cai-shiwei159 --- common/bundle.json | 3 +- common/wpa_supplicant/BUILD.gn | 30 +++++++------ common/wpa_supplicant/cp_wpa.sh | 27 ++++++++++++ patches/build/build_allowlist_wifi.patch | 12 ++++++ .../wpa_supplicant/wpa_build_gn.patch | 42 +++++++++++++++++++ 5 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 common/wpa_supplicant/cp_wpa.sh create mode 100644 patches/build/build_allowlist_wifi.patch create mode 100644 patches/third_party/wpa_supplicant/wpa_build_gn.patch diff --git a/common/bundle.json b/common/bundle.json index 5785e17..a415170 100644 --- a/common/bundle.json +++ b/common/bundle.json @@ -64,7 +64,8 @@ "//device/soc/spreadtrum/common/modem:modem", "//device/soc/spreadtrum/common/telephony/etc:modem.para", "//device/soc/spreadtrum/common/alsa-lib:alsa_lib", - "//device/soc/spreadtrum/common/startup/reboot_loader:rebootloader" + "//device/soc/spreadtrum/common/startup/reboot_loader:rebootloader", + "//device/soc/spreadtrum/common/wpa_supplicant:wpa_supplicant" ], "inner_api": [ ], diff --git a/common/wpa_supplicant/BUILD.gn b/common/wpa_supplicant/BUILD.gn index 419f608..ff22433 100644 --- a/common/wpa_supplicant/BUILD.gn +++ b/common/wpa_supplicant/BUILD.gn @@ -13,22 +13,20 @@ import("//build/ohos.gni") wpa_supplicant_path="third_party/wpa_supplicant" -action("copy_wpa_supplicant") { - script = "/usr/bin/env" -print("==================================================") - outputs = [ "$target_out_dir/tmp_wpa_supplicant" ] # not use, just for gn complains - - args = [ - "cp", - "-rf", - ] - args += [ rebase_path("wpa_supplicant-2.9_standard/", root_build_dir) ] - args += [ "../../$wpa_supplicant_path" ] -} group("wpa_supplicant") { - deps = [ - ":copy_wpa_supplicant", - ] -} + deps = [ +# ":copy_wpa_supplicant", + ] + print("======================1111111111111111111111111============================") + print(rebase_path("wpa_supplicant-2.9_standard/", root_build_dir)) + + exec_script( + "cp_wpa.sh", + [ + rebase_path("wpa_supplicant-2.9_standard/", root_build_dir), + "../../$wpa_supplicant_path", + + ]) +} \ No newline at end of file diff --git a/common/wpa_supplicant/cp_wpa.sh b/common/wpa_supplicant/cp_wpa.sh new file mode 100644 index 0000000..307ce46 --- /dev/null +++ b/common/wpa_supplicant/cp_wpa.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Copyright (C) 2023 HiHope Open Source Organization. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e +cp -rf ${1} ${2} + + + +if [ $? -ne 0 ]; then + echo "上一条命令执行失败,即将异常退出脚本" + exit 1 # 使用 exit 命令并传入一个非零值(通常用1表示错误)来异常退出脚本 +fi + +echo "1111111111111111111111aaaaaaaaaaaaaaaaaaaaaa" + diff --git a/patches/build/build_allowlist_wifi.patch b/patches/build/build_allowlist_wifi.patch new file mode 100644 index 0000000..8c24345 --- /dev/null +++ b/patches/build/build_allowlist_wifi.patch @@ -0,0 +1,12 @@ +diff --git a/core/gn/ohos_exec_script_allowlist.gni b/core/gn/ohos_exec_script_allowlist.gni +index 63072b7f..b0fc37ff 100644 +--- a/core/gn/ohos_exec_script_allowlist.gni ++++ b/core/gn/ohos_exec_script_allowlist.gni +@@ -63,6 +63,7 @@ ohos_exec_script_config = { + "//device/board/hihope/dayu210/camera/vdi_impl/v4l2/BUILD.gn", + "//device/board/hihope/rk3568/camera/vdi_impl/v4l2/BUILD.gn", + "//device/board/hardmony/oriole/camera/vdi_impl/v4l2/BUILD.gn", ++ "//device/soc/spreadtrum/common/wpa_supplicant/BUILD.gn", + "//device/board/hisilicon/hispark_aries/liteos_a/BUILD.gn", + "//device/board/hisilicon/hispark_taurus/camera/BUILD.gn", + "//device/board/hisilicon/hispark_taurus/liteos_a/BUILD.gn", diff --git a/patches/third_party/wpa_supplicant/wpa_build_gn.patch b/patches/third_party/wpa_supplicant/wpa_build_gn.patch new file mode 100644 index 0000000..e85019d --- /dev/null +++ b/patches/third_party/wpa_supplicant/wpa_build_gn.patch @@ -0,0 +1,42 @@ +diff --git a/bundle.json b/bundle.json +index 0767b36..5784ab5 100644 +--- a/bundle.json ++++ b/bundle.json +@@ -19,6 +19,7 @@ + "syscap": [], + "features": [ + "wpa_supplicant_vendor_ext", ++ "wpa_supplicant_driver_nl80211_sprd", + "wpa_supplicant_driver_nl80211_hisi", + "wpa_supplicant_driver_nl80211", + "wpa_supplicant_wapi", +diff --git a/wpa_supplicant-2.9_standard/BUILD.gn b/wpa_supplicant-2.9_standard/BUILD.gn +index b574101..d00f5d4 100644 +--- a/wpa_supplicant-2.9_standard/BUILD.gn ++++ b/wpa_supplicant-2.9_standard/BUILD.gn +@@ -24,6 +24,7 @@ import( + declare_args() { + wpa_supplicant_driver_nl80211_hisi = false + wpa_supplicant_driver_nl80211 = false ++ wpa_supplicant_driver_nl80211_sprd = false + wpa_supplicant_ohos_certmgr = true + wpa_supplicant_ohos_eapauth = true + wpa_supplicant_config_hilog = true +@@ -617,6 +618,17 @@ ohos_shared_library("wpa_sys") { + cflags += [ "-DCONFIG_DRIVER_NL80211_HISI_TRUNK" ] + } + } ++ if (wpa_supplicant_driver_nl80211_sprd) { ++ sources += [ "$WPA_ROOT_DIR/wpa_supplicant_lib/driver_nl80211_sprd.c" ] ++ cflags += [ ++ "-DCONFIG_DRIVER_NL80211_SPRD", ++ "-DCONFIG_P2P_160M", ++ ] ++ if (use_musl) { ++ cflags += [ "-DCONFIG_DRIVER_NL80211_SPRD_TRUNK" ] ++ } ++ } ++ + cflags += ext_cflags + + if (wpa_supplicant_ohos_certmgr) { -- Gitee