首先敲一下 cd 命令,定位到自己的用户目录,
然后 mkdir openwrt 新建一个openwrt文件夹,然后开始装openwrt的编译用到的工具,
sudo apt-get install g++ sudo apt-get install libncurses5-dev sudo apt-get install zlib1g-dev sudo apt-get install bison sudo apt-get install flex sudo apt-get install unzip sudo apt-get install autoconf sudo apt-get install gawk sudo apt-get install make sudo apt-get install gettext sudo apt-get install gcc sudo apt-get install binutils sudo apt-get install patch sudo apt-get install bzip2 sudo apt-get install libz-dev sudo apt-get install asciidoc sudo apt-get install subversion sudo apt-get install sphinxsearch sudo apt-get install libtool sudo apt-get install sphinx-common
然后,git clone https://github.com/openwrt-mirror/openwrt.git
下载openwrt最新代码,
然后,cd openwrt ,定位到openwrt目录中,然后,vim feeds.conf.default,编辑要集成的模块,插入 src-git wifidog https://github.com/wifidog/wifidog-gateway.git
这一行,
最后的结果如下:
[email protected]:~/openwrt/openwrt$ cat feeds.conf.default
src-git packages https://github.com/openwrt/packages.git
src-git luci https://github.com/openwrt/luci.git
src-git routing https://github.com/openwrt-routing/packages.git
src-git telephony https://github.com/openwrt/telephony.git
src-git management https://github.com/openwrt-management/packages.git
src-git targets https://github.com/openwrt/targets.git
src-git wifidog https://github.com/wifidog/wifidog-gateway.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
#src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg
#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
#src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
#src-link custom /usr/src/openwrt/custom-feed
然后,运行一下,./script/feed update -a
然后,运行一下,./script/feed install -a
然后,运行,make defconfig
再运行,make menuxonfig,进行选择要安装的配置,
进入make menuconfig后的设置部分
选CPU型号
Target System ------------Ralink RT288x/RT3xxx
Subtarget ------------MT7620a based boards
如在代码中加入MTALL的模板,可编译时,只编译MTALL组件。
Target profile -----------MTALL
然后,运行,make V=99,开始编译
然后在bin文件夹中会生成 刷机固件
注意:
不能用root去做操作,要用普通用户,也不能用sudo 做操作,都用普通用户的权限就可以,要不然编译额时候 会报各种错误。
推荐一篇很不错的教程: