實驗器材
設備名稱 | EDiMAX BR6478AC V2 |
SOC | MediaTek MT7620A 580MHz |
Flash* | 8MB |
RAM | 64MB |
OpenWrt Device Page |
https://openwrt.org/toh/hwdata/edimax/edimax_br-6478ac_v2 |
* Flash極其重要,由於使用opkg(OpenWrt的套件管理工具)安裝的套件大部分的東西(像是binary file等)都會裝在flash空間裡面,要是容量不足就會無法安裝套件
筆者這次就遇到Open Vswitch由於flash空間不足而無法安裝的問題,最後只好自己重新編譯firmware,並將Open Vswitch直接編譯進firmware裡。建議大家在買設備的時候選擇flash有16MB以上的設備
自行編譯OpenWrt
- 如果採購的設備在OpenWrt官網上有列為支援的設備,可以使用OpenWrt提供的image builder快速編譯出自己需要的firmware,本文即採用此種方式
- OpenWrt Image Builder Guide: https://openwrt.org/docs/guide-user/additional-software/imagebuilder
編譯步驟
-
編譯用的系統為
Ubuntu 20.04
,需要先安裝相依套件apt install build-essential libncurses5-dev libncursesw5-dev \ zlib1g-dev gawk git gettext libssl-dev xsltproc rsync wget unzip python
-
下載Image Builder (注意處理器架構與指令集,如筆者的AP是ramips跟mt7620) 並解壓縮
wget https://downloads.openwrt.org/releases/19.07.7/targets/ramips/mt7620/openwrt-imagebuilder-19.07.7-ramips-mt7620.Linux-x86_64.tar.xz tar Jxvf openwrt-imagebuilder-19.07.7-ramips-mt7620.Linux-x86_64.tar.xz
-
進到資料夾底下並編譯
cd openwrt-imagebuilder-19.07.7-ramips-mt7620.Linux-x86_64 make image PROFILE=edimax_br-6478ac-v2 PACKAGES="openvswitch luci"
make image PROFILE=<AP model> PACKAGES=<opkg package>
- 可用
make info
找到自己的AP model
-
編好之後的檔案會存在
./bin/targets/ramips/mt7620/
之後拿著編好的檔案去AP原廠的webUI做系統更新就好了