X-Wrt
July 29, 2010, 07:27:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the X-Wrt Forums
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Determination of Router Model  (Read 744 times)
chillifire
Newbie
*
Offline Offline

Posts: 48


View Profile
« on: July 22, 2009, 05:54:21 AM »

Hi,

I thought I had figured out over time that the router model is determined in /etc/init.d/webif. However, when I installed X-WRT on a Nanostation 2 today, There it was on the Info Page: Naostation 2 - however, the string Nanostation does not even appear in /etc/init.d/webif. The same happened with a Asus WL-520GU. X-WRT knew it was the model, although there seems nothing in /etc/init.d/webif to suggest how the system figgures out it is precisely that model.

Question to the developers: Where, other than in the /etc/init.d/webif is the router model determined?

Please advise.

Thanks

Logged
thepeople
X-Wrt Developer
Administrator
Hero Member
*****
Offline Offline

Posts: 1138


View Profile
« Reply #1 on: July 23, 2009, 01:21:23 PM »

See lines 32 and 33 in /etc/init.d/webif

Code:
[ -z "$device_name" ] && [ -f "/proc/diag/model" ] && device_name=$(cat "/proc/diag/model")
[ -z "$device_name" ] && [ -f "/proc/sys/dev/wifi0/dev_name" ] && device_name=$(cat "/proc/sys/dev/wifi0/dev_name")

The above code will grab the model name if it is set by openwrt. In the case of the nanostation line 33 would have the model name.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.08 seconds with 17 queries.