OpenWrt是一个高度模块化、高度自动化的嵌入式linux发行版,其编译和安装过程比普通的linux发行版而言,要简单太多了。如果您是新手,您那恐惧的心大可放到肚子里,呵呵。对于新手来说最麻烦的恐怕是安装开发环境需要的软件了。
最基本条件:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.PC一台,性能强点,性能好编译得就快。linux推荐安装ubuntu 8.04中文版(或者suse)和fedora 11(对于初学者而言,最好是装在虚拟机如VM里,可省去很多麻烦。如何在VM里安装linux,您可多google或者baidu)
2.宽带一条,需要速度好点,因为有很多软件包是网络下载后安装。
3.耐心和时间。
编译环境准备(安装linux发行版和软件包):
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.安装好ubuntu8.04中文版本或者fedora 9或者11,搞定网络连接。
以非root用户登陆,打开“应用程序—-附件—-终端”。如果您已经安装好linux, 那么此步骤请略去。
2.如果您选择ubuntu, 那么ubuntu开发环境需要的软件有sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev
然后
sudo apt-get update
如您选择安装fedora11或者fedora9
Fedora 11 or 9:
# yum install autoconf binutils bison bzip2 flex gawk gcc gcc-c++ gettext make ncurses-devel patch unzip wget zlib-devel
由于fedora 安装包本来就很全面,所以需另外安装的东西较少。所以一般情况下,推荐安装fedora 11。对于初学者而言,最方便的方法是在VM上安装linux。
由于ubuntu本来就是基于suse, 所以如果您要以suse为开发环境,那么您参考ubuntu的安装步骤即可。
如果你能阅读英文,那么请参考
http://wiki.openwrt.org/doc/howto/buildroot,
OpenWrt英文论坛2006年文章:Building OpenWrt Kamikaze from source
https://forum.openwrt.org/viewtopic.php?id=9180
这里有更详细权威的说明。
4.获取OpenWrt源代码和安装包,更新
1. svn checkout svn://svn.openwrt.org/openwrt/trunk (开发版本,不稳定,不建议下载)
必须使用非root用户进行操作,添加一个普通用户。(注意:如果使用root进行操作的话,会提示检查失败:Checking 'non-root'... failed.)
[root@localhost trunk]# adduser openwrt
[root@localhost trunk]# su openwrt
为了防止文件读写权限造成问题,需要将源码copy到openwet的根目录下进行所有操作。
[openwrt@localhost openwrt]$ cd ~
[openwrt@localhost ~]$ cp -r /usr/src/test/trunk ./
[openwrt@localhost ~]$ cd trunk/
[openwrt@localhost trunk]$ ls
BSDmakefile LICENSE README feeds.conf.default package scripts toolchain
Config.in Makefile docs include rules.mk target tools