主题 : Smart4418 WIFI网络接口怎么样才能自动命名为wlanX形式? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 143530
精华: 0
发帖: 1
金钱: 5 两
威望: 1 点
贡献值: 0 点
综合积分: 2 分
注册时间: 2019-12-17
最后登录: 2019-12-18
楼主  发表于: 66天前

 Smart4418 WIFI网络接口怎么样才能自动命名为wlanX形式?

Smart4418 WIFI网络接口不会自动命名为wlanX形式,而是wlx44d878eba2b5的形式,怎么做才好?
首先问题先说一下,是下面这样的:root@Smart4418SDK:~# insmod /home/wlan_mt7668_usb.ko
r
oot@Smart4418SDK:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 0e:e3:bc:51:93:87  
          inet6 addr: fe80::e3b4:5ac1:af56:8c91/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:842 (842.0 B)
          Interrupt:64 Base address:0x4000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:6560 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6560 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:485440 (485.4 KB)  TX bytes:485440 (485.4 KB)

wlx44d878eba2b5 Link encap:Ethernet  HWaddr 44:d8:78:eb:a2:b5  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

网络接口不是wlan0\wlan1那种形式,而是wlx44d878eba2b5 后来发现/etc/udev/rules.d/70-persistent-net.rules文件存在,但是空的。我从PC UBUNTU系统里拷了一个70-persistent-net.rules文件,放进去,并修改,重启后是能成 wlan0的名称。
这是修改过的:root@Smart4418SDK:~# cat /etc/udev/rules.d/70-persistent-net.rules# This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can modify it, as long as you keep each rule on a single# line, and change only the value of the NAME= key.
# USB device 0x:0xSUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="44:d8:78:eb:a2:b5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
root@Smart4418SDK:~# insmod /home/wlan_mt7668_usb.ko root@Smart4418SDK:~# ifconfig -aeth0      Link encap:Ethernet  HWaddr 0e:e3:bc:51:93:87            inet6 addr: fe80::e3b4:5ac1:af56:8c91/64 Scope:Link          UP BROADCAST MULTICAST  MTU:1500  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:0 (0.0 B)  TX bytes:842 (842.0 B)          Interrupt:64 Base address:0x4000 
lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:65536  Metric:1          RX packets:240 errors:0 dropped:0 overruns:0 frame:0          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1           RX bytes:17760 (17.7 KB)  TX bytes:17760 (17.7 KB)
wlan0     Link encap:Ethernet  HWaddr 44:d8:78:eb:a2:b5            BROADCAST MULTICAST  MTU:1500  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
问题来了,我拿这Smart4418 ARM板是要做生产检验的,检验生产的WIFI模块是否OK的,这样要先改文件再来改识别,根本就没法给生产使用。但找来找去,都没发现像 /lib/udev/write_net_rules类似的执行文件。有什么办法可以让这网络接口名称变成wlan0\wlan1那样正常呢?