-
Install
git
, to conveniently download the OpenWrt source code, andbuild 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 viasubversion
(short:svn
) ormercurial
. If you want to obtain their source-code, you need to install svn and mercurial as well:sudo apt-get install subversion mercurial
-
for information about the build tools see
make
and build-essential -
for information about git see
git(7)
-
for information about the subversion tool see
svn
and subversion documentation (multiple languages)
-
-
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 -
(optional) Download and install all available "feeds" (see OpenWrt Feeds for more options!):
cd openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a
-
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.
-
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时,出现例如以下错误提示:
1 | gconvert.c:66:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv |
我在网上找解决方式,结果一致地都是说,又一次 ./configure 一下:
1 2 | . /configure -- enable -iconv=no --with-libiconv=gnu make |
可问题的关键是:OpenWRT的trunk路径下没见有个 configure 呀!
后来,经过细致推敲,发现是在编glib时没通过。
1 2 | $ 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
1 2 3 | $ cd build_dir /host/pkg-config-0 .28 /glib/ . /configure -- enable -iconv=no --with-libiconv=gnu make |
这样。glib 就顺利通过了编译。
再回到 OpenWRT的trunk路径下,继续 make.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步