openwrt配置方法
编译环境准备:
一.安装ubuntu,32位,配置基本工具。升级组件包
sudo apt-get update
安装编译需要的组件
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 subversion
sudo apt-get install libncurses5-dev
sudo apt-get install ncurses-term
sudo apt-get install zlib1g-dev
sudo apt-get install subversion
sudo apt-get install git
sudo apt-get install gawk
sudo apt-get install asciidoc
sudo apt-get install libz-dev
sudo apt-get install libssl-dev
二.下载OpenWrt源码并编译
OpenWrt源码分两种,一种是最新但不是最稳定的Trunk开发版,一种是最稳定的Backfire版
建议下载官方源码。下载前先在本地创建文件夹:
mkdir openwrt
sudo chmod 777 openwrt
cd openwrt
选择你想要的版本然后执行下载命令,下载结束会显示版本号:Trunk版下载命令:
svn co svn://https://www.360docs.net/doc/2b4256676.html,/openwrt/trunk/
(Backfire版下载命令:
svn co svn://https://www.360docs.net/doc/2b4256676.html,/openwrt/branches/backfire/)
添加软件扩展包,将feeds.conf.default修改为feeds.conf:
1. cp feeds.conf.default feeds.conf
更新扩展,安装扩展:
1. ./scripts/feeds update -a
2. ./scripts/feeds install -a
测试编译环境:
make defconfig
到这里就可以开始编译自己的固件了。进入定制界面:
make menuconfig
开始编译:
make
或者
make V=99
或者
make -j V=99
make是编译命令,V=99表示输出debug信息,V一定要大写.
如果要让CPU全速编译,就加上 -j 参数,第一次编译最好不带-j 参数。
记得选cubieboard,按照图上的选,不要选703n去了……Target Images 里面可以设置ext4的大小,这就是你root分区的大小,默认是48,估计不够用,所以建议大点比较好,我设置了450M,因为我要用一张512Mb的卡来安装系统,还有一个启动分区需要用呢,建议把nano 给编译进去,好编辑东西,但是在minicom下好像有点不好用,大家可以随便选,反正别选坏了就是,我就顺便把wpa_supplicant等东西安装上了,openwrt的菜单真是极其丰富,可以随意挑选,大家也可
以选择编译SDK来用就是。