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 unzipSome 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
make
and build-essential
git(7)
svn
and subversion documentation (multiple languages)
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
cd openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig make prereq make menuconfig
There you will need to select what you want to compile.
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.