cat <<EOF
config wifi-device radio$devidx
option type mac80211
option channel ${channel}
option hwmode 11${mode_band}
$dev_id
$ht_capab
# REMOVE THIS LINE TO ENABLE WIFI:
# option disabled 1
config wifi-iface
option device radio$devidx
option network lan
option mode ap
option ssid 'OpenWrt SLboat Mod'
option encryption none
EOF
devidx=$(($devidx + 1))
done
}
# base on ORG version:14.07,r42656
# this file has mod by slboat,most mod for default wifi config file,so can default enable it
# org file is inside the source: package/mac80211/files/lib/wifi/mac80211.sh
# how we mod it:
# http://see.sl088.com/id/1xm
config wifi-device radio$devidx
option type mac80211
option channel ${channel}
option macaddr $(cat /sys/class/ieee80211/${dev}/macaddress)
option hwmode 11${mode_11n}${mode_band}
$ht_capab
# REMOVE THIS LINE TO DISABLE WIFI - SLBoat Mod:
# option disabled 1
config wifi-iface
option device radio$devidx
option network lan
option mode ap
option ssid 'OpenWrt SLBoat Mod'
option encryption none
EOF
devidx=$(($devidx + 1))
done
}
# ORG version:12.09-rc1
# this file has mod by slboat
# org file is inside the source: package/mac80211/files/lib/wifi/mac80211.sh
# how we mod it :
# http://see.sl088.com/wiki/Openwrt_%E5%9B%BA%E4%BB%B6%E7%BC%96%E8%AF%91/%E9%BB%98%E8%AE%A4%E5%BC%80%E5%90%AFwifi
vade 發(fā)表于 2011-5-25 12:01
多謝 xujifsad, 搞定了。
修改的文件為 openwrt/trunk/package/mac80211/files/lib/wifi/mac80211.sh, ...
config wifi-device radio$devidx
option type mac80211
option channel ${channel}
option hwmode 11${mode_11n}${mode_band}
$dev_id
$ht_capab
# REMOVE THIS LINE TO ENABLE WIFI:
# option disabled 1
config wifi-iface
option device radio$devidx
option network lan
option mode ap
option ssid Hello-World
option encryption none
option disabled 0
EOF
devidx=$(($devidx + 1))
done
紅色為我修改的內(nèi)容,第一個“#”是添加的,目的是注釋掉該行,后面添加的是使能wifi,
但我實際發(fā)現(xiàn)無線有時還是不能自動默認(rèn)打開,請問還能是什么問題呢?
1、使路由器第一次啟動后默認(rèn)開啟WIFI
修改文件openwrt/trunk/package/mac80211/files/lib/wifi/mac80211.sh的最后部分
option disabled 1
2、如何單獨編譯內(nèi)核模塊安裝包
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相關(guān)支持
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
也就是說如果默認(rèn)使用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網(wǎng)卡,改寫網(wǎng)絡(luò)配置文件,改寫4G撥號腳本,配置WIFI和WIFI的DHCP。
涉及文件:
內(nèi)核部分 driver/usb/serial/option.c 加PID,VID
文件系統(tǒng)部分:
/etc/config/network 加入WAN接口配置并配置為4G模式;加入WIFI接口,并配置為靜態(tài)地址模式以便能自動啟。
/etc/config/wireless 將wifi-iface的network字段與 /etc/config/network中的WIFI接口匹配相同
/etc/config/firewall 修改防火墻規(guī)則,使各個接口都可以通信。
/etc/config/dhcp 添加WIFI接口的DHCP功能
/etc/chatscripts/3g.ch 撥號腳本
以上所有文件內(nèi)容在這個網(wǎng)頁:
http://blog.csdn.net/sydjm/article/details/8490357