From 017c2d0964cd0338fc101a9fac11497cd12b96bd Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Thu, 9 Jan 2020 11:29:23 +0100 Subject: [PATCH] wpa_supplicant: unify config file for all platforms WPA and P2P configuration files are basically the same between all platforms, so we remove all duplicated files to use a common file and modify it in the recipe logic. Signed-off-by: Arturo Buzarra --- meta-digi-arm/conf/machine/ccimx6qpsbc.conf | 1 + meta-digi-arm/conf/machine/ccimx6sbc.conf | 3 +++ meta-digi-arm/conf/machine/ccimx8mn-dvk.conf | 10 -------- .../conf/machine/ccimx8x-sbc-express.conf | 10 -------- .../conf/machine/ccimx8x-sbc-pro.conf | 10 -------- .../conf/machine/include/ccimx6ul.inc | 1 + .../conf/machine/include/ccimx8mn.inc | 7 ++++++ .../conf/machine/include/ccimx8x.inc | 7 ++++++ .../ccimx6qpsbc/wpa_supplicant.conf-sane | 18 --------------- .../ccimx6qpsbc/wpa_supplicant_p2p.conf | 8 ------- .../ccimx6sbc/wpa_supplicant_p2p.conf | 2 +- .../ccimx6ul/wpa_supplicant.conf-sane | 18 --------------- .../ccimx6ul/wpa_supplicant_p2p.conf | 8 ------- .../ccimx8mn/wpa_supplicant.conf-sane | 18 --------------- .../ccimx8x/wpa_supplicant.conf-sane | 18 --------------- .../ccimx8x/wpa_supplicant_p2p.conf | 8 ------- .../wpa-supplicant/wpa_supplicant.conf-sane | 22 +++++++----------- .../{ccimx8mn => }/wpa_supplicant_p2p.conf | 2 +- .../wpa-supplicant/wpa-supplicant_%.bbappend | 23 ++++++++++++++++++- 19 files changed, 51 insertions(+), 143 deletions(-) delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant.conf-sane delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant_p2p.conf delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant.conf-sane delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant.conf-sane delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant.conf-sane delete mode 100644 meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant_p2p.conf rename meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/{ccimx8mn => }/wpa_supplicant_p2p.conf (82%) diff --git a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf index 334639e36..9696a2445 100644 --- a/meta-digi-arm/conf/machine/ccimx6qpsbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6qpsbc.conf @@ -10,6 +10,7 @@ WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-mod # Wireless p2p interface WLAN_P2P_INTERFACE ?= "p2p0" +WLAN_P2P_DEVICE_NAME ?= "ccimx6qp-p2p" MACHINE_EXTRA_RRECOMMENDS += " \ cryptoauthlib \ diff --git a/meta-digi-arm/conf/machine/ccimx6sbc.conf b/meta-digi-arm/conf/machine/ccimx6sbc.conf index 5d399b38e..afb4d2515 100644 --- a/meta-digi-arm/conf/machine/ccimx6sbc.conf +++ b/meta-digi-arm/conf/machine/ccimx6sbc.conf @@ -5,6 +5,9 @@ # Contains the ConnectCore 6 module. include conf/machine/include/ccimx6.inc +# Wireless p2p interface +WLAN_P2P_DEVICE_NAME ?= "ccimx6-p2p" + # Firmware MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1' , 'firmware-atheros-ar3k', '', d)}" MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1' , 'firmware-atheros-ath6kl', '', d)}" diff --git a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf index b76dd0eb6..7850be6ba 100644 --- a/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf +++ b/meta-digi-arm/conf/machine/ccimx8mn-dvk.conf @@ -5,16 +5,6 @@ # Include the machine configuration for Digi's ConnectCore 8M Nano module. include conf/machine/include/ccimx8mn.inc -# Wireless external module -WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}" - -# Wireless p2p interface -WLAN_P2P_INTERFACE ?= "p2p0" - -# Firmware -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6564-bt', '', d)}" -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6564-wifi', '', d)}" - # U-Boot configurations # Last one is the default (the one the symlinks point at) UBOOT_CONFIG ??= "ccimx8mn_dvk" diff --git a/meta-digi-arm/conf/machine/ccimx8x-sbc-express.conf b/meta-digi-arm/conf/machine/ccimx8x-sbc-express.conf index 0d7f05cab..3884f0242 100644 --- a/meta-digi-arm/conf/machine/ccimx8x-sbc-express.conf +++ b/meta-digi-arm/conf/machine/ccimx8x-sbc-express.conf @@ -5,16 +5,6 @@ # Include the machine configuration for Digi's ConnectCore 8X module. include conf/machine/include/ccimx8x.inc -# Wireless external module -WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}" - -# Wireless p2p interface -WLAN_P2P_INTERFACE ?= "p2p0" - -# Firmware -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6574-bt', '', d)}" -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6574-wifi', '', d)}" - # U-Boot configurations # Last one is the default (the one the symlinks point at) UBOOT_CONFIG ??= "ccimx8x_sbc_express2GB ccimx8x_sbc_express1GB" diff --git a/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf b/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf index 6a5191ad3..875384504 100644 --- a/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf +++ b/meta-digi-arm/conf/machine/ccimx8x-sbc-pro.conf @@ -5,16 +5,6 @@ # Include the machine configuration for Digi's ConnectCore 8X module. include conf/machine/include/ccimx8x.inc -# Wireless external module -WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}" - -# Wireless p2p interface -WLAN_P2P_INTERFACE ?= "p2p0" - -# Firmware -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6574-bt', '', d)}" -MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6574-wifi', '', d)}" - # U-Boot configurations # Last one is the default (the one the symlinks point at) UBOOT_CONFIG ??= "ccimx8x_sbc_pro512MB ccimx8x_sbc_pro1GB ccimx8x_sbc_pro2GB" diff --git a/meta-digi-arm/conf/machine/include/ccimx6ul.inc b/meta-digi-arm/conf/machine/include/ccimx6ul.inc index fda7ce35d..c848046f5 100644 --- a/meta-digi-arm/conf/machine/include/ccimx6ul.inc +++ b/meta-digi-arm/conf/machine/include/ccimx6ul.inc @@ -18,6 +18,7 @@ WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-mod # Wireless p2p interface WLAN_P2P_INTERFACE ?= "p2p0" +WLAN_P2P_DEVICE_NAME ?= "ccimx6ul-p2p" # Firmware MACHINE_FIRMWARE ?= "firmware-imx-sdma" diff --git a/meta-digi-arm/conf/machine/include/ccimx8mn.inc b/meta-digi-arm/conf/machine/include/ccimx8mn.inc index 5a370becb..617add729 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8mn.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8mn.inc @@ -24,9 +24,16 @@ KERNEL_DEFCONFIG ?= "arch/arm64/configs/ccimx8_defconfig" # Wireless external module WIRELESS_MODULE ?= "" +WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}" + +# Wireless p2p interface +WLAN_P2P_INTERFACE ?= "p2p0" +WLAN_P2P_DEVICE_NAME ?= "ccimx8mn-p2p" # Firmware MACHINE_FIRMWARE ?= "firmware-imx-sdma firmware-imx-easrc" +MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6564-bt', '', d)}" +MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6564-wifi', '', d)}" MACHINE_EXTRA_RDEPENDS += " \ e2fsprogs-mke2fs \ diff --git a/meta-digi-arm/conf/machine/include/ccimx8x.inc b/meta-digi-arm/conf/machine/include/ccimx8x.inc index 0caea5a08..ea765ec12 100644 --- a/meta-digi-arm/conf/machine/include/ccimx8x.inc +++ b/meta-digi-arm/conf/machine/include/ccimx8x.inc @@ -31,9 +31,16 @@ KERNEL_DEFCONFIG ?= "arch/arm64/configs/ccimx8x_defconfig" # Wireless external module WIRELESS_MODULE ?= "" +WIRELESS_MODULE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}" + +# Wireless p2p interface +WLAN_P2P_INTERFACE ?= "p2p0" +WLAN_P2P_DEVICE_NAME ?= "ccimx8x-p2p" # Firmware MACHINE_FIRMWARE ?= "firmware-imx-vpu-imx8 firmware-imx-sdma" +MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6574-bt', '', d)}" +MACHINE_FIRMWARE_append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6574-wifi', '', d)}" MACHINE_EXTRA_RDEPENDS += " \ e2fsprogs-mke2fs \ diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant.conf-sane b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant.conf-sane deleted file mode 100644 index c58546a06..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant.conf-sane +++ /dev/null @@ -1,18 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -ctrl_interface_group=0 -fast_reauth=1 -update_config=1 - -ap_scan=1 - -# Static scheduled scan interval time in seconds -# -# The wpa-supplicant dynamically adjusts the scheduled scan time interval. On -# occassions, fixing the interval time is helpful, for example on DFS channels. -#sched_scan_interval=2 - -network={ - scan_ssid=1 - ssid="" - key_mgmt=NONE -} diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant_p2p.conf deleted file mode 100644 index c6d16f32d..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6qpsbc/wpa_supplicant_p2p.conf +++ /dev/null @@ -1,8 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -update_config=1 -device_name=ccimx6qp-p2p -manufacturer=QCA -model_name=McK -device_type=1-0050F204-1 -config_methods=display keypad push_button -persistent_reconnect=1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6sbc/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6sbc/wpa_supplicant_p2p.conf index c1146257f..36d8277bf 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6sbc/wpa_supplicant_p2p.conf +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6sbc/wpa_supplicant_p2p.conf @@ -1,6 +1,6 @@ ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 -device_name=ccimx6-p2p +device_name=##WLAN_P2P_DEVICE_NAME## device_type=10-0050F204-5 config_methods=virtual_push_button keypad display pin persistent_reconnect=1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant.conf-sane b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant.conf-sane deleted file mode 100644 index c58546a06..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant.conf-sane +++ /dev/null @@ -1,18 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -ctrl_interface_group=0 -fast_reauth=1 -update_config=1 - -ap_scan=1 - -# Static scheduled scan interval time in seconds -# -# The wpa-supplicant dynamically adjusts the scheduled scan time interval. On -# occassions, fixing the interval time is helpful, for example on DFS channels. -#sched_scan_interval=2 - -network={ - scan_ssid=1 - ssid="" - key_mgmt=NONE -} diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf deleted file mode 100644 index 30a6699e6..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx6ul/wpa_supplicant_p2p.conf +++ /dev/null @@ -1,8 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -update_config=1 -device_name=ccimx6ul-p2p -manufacturer=QCA -model_name=McK -device_type=1-0050F204-1 -config_methods=display keypad push_button -persistent_reconnect=1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant.conf-sane b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant.conf-sane deleted file mode 100644 index c58546a06..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant.conf-sane +++ /dev/null @@ -1,18 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -ctrl_interface_group=0 -fast_reauth=1 -update_config=1 - -ap_scan=1 - -# Static scheduled scan interval time in seconds -# -# The wpa-supplicant dynamically adjusts the scheduled scan time interval. On -# occassions, fixing the interval time is helpful, for example on DFS channels. -#sched_scan_interval=2 - -network={ - scan_ssid=1 - ssid="" - key_mgmt=NONE -} diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant.conf-sane b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant.conf-sane deleted file mode 100644 index c58546a06..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant.conf-sane +++ /dev/null @@ -1,18 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -ctrl_interface_group=0 -fast_reauth=1 -update_config=1 - -ap_scan=1 - -# Static scheduled scan interval time in seconds -# -# The wpa-supplicant dynamically adjusts the scheduled scan time interval. On -# occassions, fixing the interval time is helpful, for example on DFS channels. -#sched_scan_interval=2 - -network={ - scan_ssid=1 - ssid="" - key_mgmt=NONE -} diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant_p2p.conf deleted file mode 100644 index af04ee92b..000000000 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8x/wpa_supplicant_p2p.conf +++ /dev/null @@ -1,8 +0,0 @@ -ctrl_interface=/var/run/wpa_supplicant -update_config=1 -device_name=ccimx8x-p2p -manufacturer=QCA -model_name=McK -device_type=1-0050F204-1 -config_methods=display keypad push_button -persistent_reconnect=1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane index ac94bd5c7..c58546a06 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane @@ -3,22 +3,16 @@ ctrl_interface_group=0 fast_reauth=1 update_config=1 -## -- Example MANAGED network -ap_scan=1 # MANAGED mode +ap_scan=1 + +# Static scheduled scan interval time in seconds +# +# The wpa-supplicant dynamically adjusts the scheduled scan time interval. On +# occassions, fixing the interval time is helpful, for example on DFS channels. +#sched_scan_interval=2 + network={ scan_ssid=1 ssid="" key_mgmt=NONE } - -# -- SoftAP mode -# ap_scan=2 -# network={ -# ssid="ath6kl-ap" -# mode=2 -# frequency=2412 -# key_mgmt=WPA-PSK -# proto=RSN -# pairwise=CCMP -# psk="12345678" -# } diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant_p2p.conf b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant_p2p.conf similarity index 82% rename from meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant_p2p.conf rename to meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant_p2p.conf index d4fba6e05..b3ba3b1f7 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/ccimx8mn/wpa_supplicant_p2p.conf +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant_p2p.conf @@ -1,6 +1,6 @@ ctrl_interface=/var/run/wpa_supplicant update_config=1 -device_name=ccimx8mn-p2p +device_name=##WLAN_P2P_DEVICE_NAME## manufacturer=QCA model_name=McK device_type=1-0050F204-1 diff --git a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend index 7867dd56c..8fc798194 100644 --- a/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend +++ b/meta-digi-dey/recipes-connectivity/wpa-supplicant/wpa-supplicant_%.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2019 Digi International. +# Copyright (C) 2013-2020 Digi International. FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:" @@ -12,6 +12,27 @@ SRC_URI += " \ do_install_append() { install -m 600 ${WORKDIR}/wpa_supplicant_p2p.conf ${D}${sysconfdir}/wpa_supplicant_p2p.conf + sed -i -e "s,##WLAN_P2P_DEVICE_NAME##,${WLAN_P2P_DEVICE_NAME},g" \ + ${D}${sysconfdir}/wpa_supplicant_p2p.conf +} + +do_install_append_ccimx6sbc() { + # Customize supplicant file + cat <>${D}${sysconfdir}/wpa_supplicant.conf + +# -- SoftAP mode +# ap_scan=2 +# network={ +# ssid="ath6kl-ap" +# mode=2 +# frequency=2412 +# key_mgmt=WPA-PSK +# proto=RSN +# pairwise=CCMP +# psk="12345678" +# } + +EOF } PACKAGE_ARCH = "${MACHINE_ARCH}"