1. Install git , to conveniently download the OpenWrt source code, and build tools to do the cross-compilation process:
    apt-get update
    sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip
    Some feeds might not available over git but only via subversion (short: svn) or mercurial. If you want to obtain their source-code, you need to install svn and mercurial as well:
    sudo apt-get install subversion mercurial
  2. Download the OpenWrt bleeding edge(trunk Version) with git (see Downloading Sources for more options!):
    git clone git:git.openwrt.org/openwrt.git

    this creates a directory 'openwrt', which is the OpenWrt Buildroot build-directory 
    the OpenWrt toolchain "OpenWrt Buildroot" is included

  3. (optional) Download and install all available "feeds" (see OpenWrt Feeds for more options!):
    cd openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a
  4. Make OpenWrt Buildroot check for missing packages on your build-system using one of the following commands:
    make defconfig
    make prereq
    make menuconfig

    There you will need to select what you want to compile.

  5. Proceed with build (i.e. cross-compile the downloaded sources to binaries)

    After the cross-compilation process the ''trunk''-directory contained 244,451 files with a total size of 3.2GiB!


      其它版本号地址:http://git.openwrt.org/

      dl文件夹下载:http://downloads.openwrt.org.cn/sources/


我在第一次编译OpenWRT时,出现例如以下错误提示:

gconvert.c:66:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv

我在网上找解决方式,结果一致地都是说,又一次 ./configure 一下:

./configure --enable-iconv=no --with-libiconv=gnu
make

可问题的关键是:OpenWRT的trunk路径下没见有个 configure 呀!

后来,经过细致推敲,发现是在编glib时没通过。

$ find -name "gconvert.c"
./build_dir/host/pkg-config-0.28/glib/glib/gconvert.c

那我就直接进到 ./build_dir/host/pkg-config-0.28/glib/ 路径下。发现该路径下有 configure 文件。

那我说直接在该路径下编译 glib

$ cd build_dir/host/pkg-config-0.28/glib/
./configure --enable-iconv=no --with-libiconv=gnu
make

这样。glib 就顺利通过了编译。

再回到 OpenWRT的trunk路径下,继续 make.