openwrt的一些瑣事


1、使路由器第一次啓動後默認開啓WIFI

修改文件openwrt/trunk/package/mac80211/files/lib/wifi/mac80211.sh的最後部分

# REMOVE THIS LINE TO ENABLE WIFI:

option disabled 1


2、如何單獨編譯內核模塊安裝包

make package/kernel/{compile, install} V=s

PS:OpenWRT的kernel modules 配置文件都在這


3、添加U盤/移動硬盤支持

添加USB掛載
Base system —> <*>block-mount   
添加硬盤格式支持()
Kernel modules —> Filesystems —> <*> kmod-fs-ext4 (移動硬盤EXT4格式選擇)
Kernel modules —> Filesystems —> <*> kmod-fs-vfat(FAT16 / FAT32 格式 選擇)
Kernel modules —> Filesystems —> <*> kmod-fs-ntfs (NTFS 格式 選擇)
添加UTF8編碼,CP437編碼,ISO8859-1編碼
Kernel modules —> Native Language Support —> <*> kmod-nls-cp437
Kernel modules —> Native Language Support —> <*> kmod-nls-iso8859-1
Kernel modules —> Native Language Support —> <*> kmod-nls-utf8
添加SCSI支持
Kernel modules —> Block Devices —> <*>kmod-scsi-core
添加USB相關支持
Kernel modules —> USB Support —> <*> kmod-usb-core.
Kernel modules —> USB Support —> <*> kmod-usb-ohci.
Kernel modules —> USB Support —> <*> kmod-usb-storage.
Kernel modules —> USB Support —> <*> kmod-usb-storage-extras.
Kernel modules —> USB Support —> <*> kmod-usb2.
添加自動掛載工具
Utilities —> Filesystem —> <*> badblocks

4、OpenWrt取消strip的方法
make package/foo/{clean,compile} V=99 STRIP=/bin/true

也就是說如果默認使用strip破壞了你的程序、庫,可以使用STRIP=/bin/true來取消strip操作,直接在Makefile中定義也是可以的


5、UBOOT移植編譯

http://www.right.com.cn/forum/thread-84684-1-1.html


6、用OpenWrt的交叉編譯器編譯外部程序文件,遇到如下錯誤:
mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined

    解決辦法是在命令行輸入:
export STAGING_DIR=(你的OpenWrt目錄的絕對路徑)/staging_dir

7、4G LTE的移植
大致步驟 移植4G網卡,改寫網絡配置文件,改寫4G撥號腳本,配置WIFI和WIFI的DHCP。
涉及文件:
內核部分   driver/usb/serial/option.c   加PID,VID
文件系統部分: 
/etc/config/network   加入WAN接口配置並配置爲4G模式;加入WIFI接口,並配置爲靜態地址模式以便能自動啓。
/etc/config/wireless  將wifi-iface的network字段與 /etc/config/network中的WIFI接口匹配相同
/etc/config/firewall    修改防火牆規則,使各個接口都可以通信。
/etc/config/dhcp      添加WIFI接口的DHCP功能
/etc/chatscripts/3g.ch  撥號腳本
 以上所有文件內容在這個網頁:
http://blog.csdn.net/sydjm/article/details/8490357

A、4G網卡移植,參照以下,把網卡的PID VID寫進內核中,否則可能不能轉換MODEM模式。

http://wiki.openwrt.org/zh-cn/doc/recipes/3gdongle

內核可能需要添加USB存儲支持和塊設備的SCSI支持。

http://www.hkepc.com/forum/viewthread.php?tid=1712898

http://www.hkepc.com/forum/viewthread.php?tid=1712898&rpid=26287429&ordertype=0&page=1#pid26287429

http://www.hkepc.com/forum/viewthread.php?tid=1661598

移植4G的APN是 CMNET ,需要寫進/etc/config/network,/etc/chatscripts/3g.chat


B、配置WIFI及其DHCP

http://wiki.openwrt.org/doc/recipes/routedap


8、SVN版本控制

svn 回滾 或 svn 指定版本  
需要的版本是 28007
操作:
1. SVN 最新的代碼 : svn co svn://svn.openwrt.org/openwrt/trunk -r 28007
2. 回滾或到指定版本:svn up -r 28007

指定LUCI版本

cd trunk/feeds/luci 
svn up -r r7612


9、OPENWRT  無線adhoc模式,啓動時無線IP和MAC地址配置失敗
無線國家選擇CN 中國,無線信道選擇自動(不太確定,有待於研究)

10、添加復位鍵支持
Utilities  ---> <*> restorefactory
添加一鍵開關無線
Utilities  ---> <*> wifitoggle
發佈了3 篇原創文章 · 獲贊 2 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章