3.openwrt mt7628 開發資料收集

1.0蒐集資料

1.不死boot鏈接

https://github.com/pepe2k/u-boot_mod

2.openwrt源碼編譯方法:

配置:sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev
xsltproc

sudo apt-get install g++ libncurses5-dev zlib1g-dev bison flex unzip autoconf gawk make gettext gcc binutils patch bzip2 libz-dev asciidoc subversion sphinxsearch libtool sphinx-common libssl-dev libssl0.9.8



buntu 終端輸入如下命令,下載源碼。
git clone -b chaos_calmer git://github.com/openwrt/openwrt.git
等待代碼下載完成。。。下載完成後,將在當前目錄下生成一個名爲"openwrt"的文
件夾,裏面存放的就是OpenWrt 的源碼了。
2)  在 ubuntu 終端中輸入以下命令:
cd openwrt  //進入 openwrt 主目錄
./scripts/feeds update -a //更新安裝包
./scripts/feeds install -a //安裝更新

3.js源碼:

在“JS7628 開發板配套資料\JS7628 開發板源碼\openwrt 源碼\
openwrt_CC_mt76xx_zhuotk_source_xxxx.tar.bz2”(xxxx 是日期)裏面已經提供了下載好的
openwrt 源碼,此源碼已經更新了安裝包、根據JS7628 開發板功能進行了修改,讀者可以將
該安裝包拷貝到當前登錄 ubuntu 的用戶的工作目錄中(即~/目錄下),執行
tar xjvf ./openwrt_CC_mt76xx_zhuotk_source_xxxx.tar.bz2 -C ./ //解壓源碼包
cd ./openwrt_CC_mt76xx_zhuotk_source //進入源碼目錄
./scripts/feeds install -a //安裝更新的軟件包
提示:這個源碼編譯出來的openwrt 固件可以在 JS7628 開發板上正確運行

4.openwrt模式選擇:

有關“IOT-device ”、“IOT-gateway ”模式的配置
進入到菜單
Kernel modules --->
Other modules --->
<*> kmod-sdhci-mt7620
如果選上“kmod-sdhci-mt7620”則開發板支持 micro SD 卡接口功能,同時啓用“IOT-device”
功能,如果選擇不啓用則開發板不支持 micro SD 卡接口功能,並啓用“IOT-gateway”功能

5.openwrt編譯後固件位置:

編譯完成後的 JS7628 的 OpenWrt 固件
“openwrt-ramips-mt7628-mt7628-squashfs-sysupgrade.bin”可以在“openwrt / bin/ramips/”
下找到
PK 安裝包在“openwrt/ bin/ramips/packages/”目錄下

6.openwrt交叉編譯鏈

6.1生成交叉工具鏈

用戶如果想自己編譯獲得 openwrt 的交叉工具鏈,只需要在 openwrt 的 menuconfig 頂
層配置界面中,勾選上“Build the OpenWrt based Toolchain”,然後保存退出,再 make V=s,生成的交叉工具鏈將在“openwrt 源碼目錄/ bin/ramips/
OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2”下找到

6.2安裝

這裏我們演示將交叉工具鏈安裝到 ubuntu 的“/opt”目錄下。首先切換到 openwrt 的
根目錄下,輸入如下命令:
sudo tar
jxvf ./bin/ramips/OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686
.tar.bz2 -C /opt/
在提示輸入超級用戶密碼後,將交叉工具鏈壓縮包解壓到ubuntu 系統的/opt/目錄下

執行命令
sudo vi /etc/bash.bashrc
在文件最後添加以下兩行配置
export
PATH=/opt/OpenWrt-Toolchain-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686/toolch
ain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin:$PATH
export STAGING_DIR=/your_openwrt_path/staging_dir
上面這個“STAGING_DIR”變量中的“your_openwrt_path”是讀者實際放 openwrt 源碼
的根目錄,如果這個“STAGING_DIR”變量不設置的話,會在用交叉工具鏈編譯文件時有警
告,但是不影響編譯結果。
最後保存退出。
接着在終端執行以下命令:
source /etc/bash.bashrc
檢查是否安裝成功
mipsel-openwrt-linux-gcc -v

7修改 ram flash

openwrt 源碼/target/linux/ramips/dts/MT7628.dts
修改支持的內存大小
JS7628 開發板有 3 種內存配置,分別是 64MB、128MB、256MB,讀者可以在這個 DTS
文件大約第 16~18 行找到這個配置
修改支持的 Flash 大小
找到大約第 118~120 行

修改管腳複用:
配置管腳複用功能
MT7628芯片裏面有很多管腳是複用,這裏我們以“spis”功能爲例做介紹如何配置JS7628
開發板的管腳功能複用。
找到 DTS 文件中的

在這裏插入圖片描述

7.0 openwrt加入看門狗wifidog

加wifidog:

在項目下終端:vim feeds.conf.default
增加這一行:src-git wifidog https://github.com/wifidog/wifidog-gateway.git
然後重新:./scripts/feeds update -a
./scripts/feeds install -a
終端執行 make menuconfig 在Network/captive portals/下選擇wifidog 就有選擇 WiFiDog 這一項了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章