openwrt開發教程之下載配置編譯openwrt(MT7621A)
阿新 • • 發佈:2019-01-26
- 什麼是openwrt?
openwrt可以被描述為一個嵌入式Linux發行版,openwrt的包管理器提供了一個完全可寫的檔案系統。
openwrt是使用框架來構建應用程式的,對於使用者來說,這意味著其擁有完全定製的能力。
openwrt是一個高度模組化、自動化的嵌入式Linux作業系統,擁有強大的網路元件和可擴充套件性,常常應用於工控裝置、電話、小型機器人、智慧家居、路由器等裝置中。
同時,它還提供很多已經編譯好的軟體,簡化了軟體開發的工序。
openwrt是一個從零開始編寫的、功能齊全的、容易修改的路由器作業系統。
openwrt支援各種處理器架構,對arm、x86、PowerPC和MIPS都有很好的支援,可以方便快速的定製一個具有特定功能的嵌入式系統。 - openwrt開發環境構建
2.1. 硬體環境構建
一臺聯網且具有USB介面的PC機+newWiFi新路由+串列埠線+網線
2.2. 軟體環境構建
2.2.1在Windows上安裝VirtualBox虛擬機器
VirtualBox下載地址:http://rj.baidu.com/soft/detail/15321.html?ald
2.2.2在VirtualBox上安裝Ubuntu作業系統
Ubuntu下載地址:http://www.ubuntu.org.cn/download/ubuntu-kylin
2.2.3在Windows上安裝Xshell
Xshell下載地址:
(注:以上軟體的安裝及配置請自行Google,這裡由於篇幅原因,暫不講述~)
- 下載配置編譯openwrt
進入root使用者,然後分別執行以下命令列:
apt-get update
apt-get install vim
apt-get install ssh
apt-get install vsftpd
vim /etc/vsftpd.conf
將
#local_enable=YES
#write_enable=YES
更改為
local_enable=YES
write_enable= YES
更改完之後,wq儲存
/etc/init.d/vsftpd restart
apt-get install subversion
apt-get install git-core
apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils ncurses-term zlib1g-dev libncurses5-dev gawk
apt-get install build-essential libssl-dev
apt-get install mercurial
git clone git://git.openwrt.org/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make prereq
make menuconfig
選擇CPU的型號 target system --> Ralink RT288x/RT3xxx
選擇CPU子型號 subtarget --> MT7620 based boards
選擇路由器型號 target profile--> MT7620a EVB
openwrt不能以root方式編譯,所以先進入普通使用者許可權
然後sudo chmod 777 -R openwrt
之後在普通使用者下make V=99編譯,編譯完成後,在bin/ramips目錄下可以看到openwrt-XXX.bin檔案了
如果中途編譯出錯的話,需要make dirclean一下