소스 검색

add basic support to preconfigure wpa2

Waldemar Brodkorb 9 년 전
부모
커밋
d4507e6231
2개의 변경된 파일29개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      package/base-files/Makefile
  2. 23 0
      target/config/Config.in.runtime

+ 6 - 0
package/base-files/Makefile

@@ -110,6 +110,12 @@ endif
 
 ifeq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_DHCP},y)
 	printf "\nauto wlan0\niface wlan0 inet dhcp\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces
+ifeq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2},y)
+	printf "\twireless-mode sta\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces
+	printf "\twireless-ssid ${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2_SSID}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces
+	printf "\twireless-security wpa2\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces
+	printf "\twireless-passphrase ${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2_PW}\n\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces
+endif
 endif
 ifeq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_STATIC},y)
 	printf "\nauto wlan0\niface wlan0 inet static\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces

+ 23 - 0
target/config/Config.in.runtime

@@ -349,6 +349,29 @@ config ADK_SIMPLE_NETWORK_CONFIG_WLAN0_GW
 
 endmenu
 
+choice
+prompt "WLAN Security"
+depends on ADK_SIMPLE_NETWORK_CONFIG_WLAN0_STATIC || ADK_SIMPLE_NETWORK_CONFIG_WLAN0_DHCP
+default ADK_SIMPLE_NETWORK_CONFIG_WLAN0_NOSEC
+
+config ADK_SIMPLE_NETWORK_CONFIG_WLAN0_NOSEC
+	bool "No security"
+
+config ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2
+	bool "WPA2"
+
+endchoice
+
+config ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2_SSID
+	depends on ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2
+	string "SSID"
+	default ""
+
+config ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2_PW
+	depends on ADK_SIMPLE_NETWORK_CONFIG_WLAN0_WPA2
+	string "Password"
+	default ""
+
 menu "eth1 Configuration"
 depends on ADK_SIMPLE_NETWORK_CONFIG && \
 	ADK_TARGET_SYSTEM_MIKROTIK_RB532