1、安裝git工具(現在壹般是使用git去下載源碼)
2、安裝依賴的庫文件(壹起裝比較容易出現漏裝,建議逐個裝)
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils ncurses-term zlib1g-dev libncurses5-dev gawk libssl-dev subversion
或者逐個安裝:
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install binutils
sudo apt-get install patch
sudo apt-get install bzip2
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install make
sudo apt-get install autoconf
sudo apt-get install gettext
sudo apt-get install texinfo
sudo apt-get install unzip
sudo apt-get install sharutils
sudo apt-get install ncurses-term
sudo apt-get install zlib1g-dev
sudo apt-get install libncurses5-dev
sudo apt-get install gawk
sudo apt-get install libssl-dev
sudo apt-get install subversion
3、下載OpenWRT源碼
先創建OpenWRT目錄來保存源碼
mkdir OpenWRT
cd OpenWRT
git clone /openwrt-mirror/openwrt.git (下載源碼)
4、更新源碼上的軟件
為了使 OpenWrt 支持更多的軟件,需要更新和安裝其它源上面的軟件
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
5、進行OpenWRT配置
make menuconfig
1). 選擇 CPU 型號
Target System -> Ralink RT288x/RT3xxx
2). 選擇 CPU 子型號
Subtarget -> RT3x5x/RT5350 based boards
3). 選擇具體路由器型號
Target profile -> HAME-MPR-A2
保存退出
6、編譯源碼
make V=99
註意:編譯過程要聯網哦,如果編譯出錯大部分都是由於網絡不好。所以重新編譯就OK了
燒錄文件在哪? openwrt/bin/ramips/openwrt-ramips-rt305x-mpr-a2-squashfs-sysupgrade.bin
更多精彩文章,歡迎關註微信公眾號"嵌入式軟件開發交流"