Modify

Opened 6 years ago

Last modified 4 years ago

#11621 new defect

Use Hardware type and macaddr as ssid

Reported by: xinglp <xinglp@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

diff -Narzu openwrt.orig/package/base-files/files/etc/functions.sh openwrt/package/base-files/files/etc/functions.sh
--- openwrt.orig/package/base-files/files/etc/functions.sh
+++ openwrt/package/base-files/files/etc/functions.sh
@@ -337,4 +337,13 @@
 	return 0
 }
 
+mac_ssid(){
+        local mac=${1:12:2}${1:15:2}
+        local info=$(cat /proc/cmdline)
+        info=${info##*board=}
+        info=${info%% *}
+        echo $info-$mac|tr A-Z a-z
+}
+
 [ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
+
diff -Narzu openwrt.orig/package/base-files/files/lib/functions.sh openwrt/package/base-files/files/lib/functions.sh
--- openwrt.orig/package/base-files/files/lib/functions.sh
+++ openwrt/package/base-files/files/lib/functions.sh
@@ -337,4 +337,13 @@
 	return 0
 }
 
+mac_ssid(){
+        local mac=${1:12:2}${1:15:2}
+        local info=$(cat /proc/cmdline)
+        info=${info##*board=}
+        info=${info%% *}
+        echo $info-$mac|tr A-Z a-z
+}
+
 [ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
+
diff -Narzu openwrt.orig/package/broadcom-wl/files/lib/wifi/broadcom.sh openwrt/package/broadcom-wl/files/lib/wifi/broadcom.sh
--- openwrt.orig/package/broadcom-wl/files/lib/wifi/broadcom.sh
+++ openwrt/package/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -384,7 +384,7 @@
 	option device   wl${i}
 	option network	lan
 	option mode     ap
-	option ssid     OpenWrt${i#0}
+	option ssid	$(mac_ssid 00:00:00:00:00:00)
 	option encryption none
 
 EOF
diff -Narzu openwrt.orig/package/hostap-driver/files/lib/wifi/hostap.sh openwrt/package/hostap-driver/files/lib/wifi/hostap.sh
--- openwrt.orig/package/hostap-driver/files/lib/wifi/hostap.sh
+++ openwrt/package/hostap-driver/files/lib/wifi/hostap.sh
@@ -261,7 +261,7 @@
 	option device	radio$devidx
 	option network	lan
 	option mode	ap
-	option ssid	OpenWrt
+	option ssid	$(mac_ssid $(cat /sys/class/net/${dev}/address))
 	option encryption none
 
 EOF
diff -Narzu openwrt.orig/package/mac80211/files/lib/wifi/mac80211.sh openwrt/package/mac80211/files/lib/wifi/mac80211.sh
--- openwrt.orig/package/mac80211/files/lib/wifi/mac80211.sh
+++ openwrt/package/mac80211/files/lib/wifi/mac80211.sh
@@ -585,7 +585,7 @@
 	option device   radio$devidx
 	option network  lan
 	option mode     ap
-	option ssid     OpenWrt
+	option ssid     $(mac_ssid $(cat /sys/class/ieee80211/${dev}/macaddress))
 	option encryption none
 
 EOF
diff -Narzu openwrt.orig/package/madwifi/files/lib/wifi/madwifi.sh openwrt/package/madwifi/files/lib/wifi/madwifi.sh
--- openwrt.orig/package/madwifi/files/lib/wifi/madwifi.sh
+++ openwrt/package/madwifi/files/lib/wifi/madwifi.sh
@@ -489,7 +489,7 @@
 	option device	radio$devidx
 	option network	lan
 	option mode	ap
-	option ssid	OpenWrt
+	option ssid	$(mac_ssid $(cat /sys/class/net/${dev}/address))
 	option encryption none
 
 EOF

Attachments (1)

mac_ssid.patch (2.8 KB) - added by xinglp <xinglp@…> 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by xinglp <xinglp@…>

comment:1 Changed 6 years ago by xinglp <xinglp@…>

I don't know how to get macaddr for openwrt/package/broadcom-wl/files/lib/wifi/broadcom.sh

comment:2 follow-up: Changed 6 years ago by anonymous

Ekm: etc/functions.sh and lib/functions.sh is the same file...Ekm: etc/functions.sh and lib/functions.sh is the same file...

comment:3 in reply to: ↑ 2 Changed 6 years ago by xinglp <xinglp@…>

Replying to anonymous:

Ekm: etc/functions.sh and lib/functions.sh is the same file...Ekm: etc/functions.sh and lib/functions.sh is the same file...

Yes, one of them is a symbol link to another.

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.