原文:http://wiki.openwrt.org/doc/howto/obtain.firmware.sdklinux
为何要使用SDK:git
Reasons for using the SDK are: Compile custom software for a specific release while ensuring binary and feature compatibility Compile newer versions of certain packages Recompile existing packages with custom patches or different features
如何得到OpenWrt的SDK,有两种方法:web
-----------------------------------编辑器
BTW, 看上面的图,这里ImageBuilder/SDK/Toolchain都分别做什么用途的呢?svn
Reasons for using Image Generator are: Embedding packages directly into the SquashFS to reduce space requirements on the target Preconfigure images by embedding packages and configuration files directly into SquashFS, and save manpower when flashing many devices Building minimal images. for example without the web interface Learning
----------------------------------- 工具
默认状况下,下载得的SDK里面没有包含任何的包。你须要安装的包要到openwrt官方源中下载,可使用svn或者git方式下载包(其实是下载包的Makefile文件,这个Makefile文件中指定了某个网址,可让SDK去下载真正的源码,后面咱们会在例子中看到)。ui
不过惋惜的是,我使用svn和git试过了许多源,都没有办法下载到任何包的Makefile文件,因此只能使用暴露一点的方法了:去TracBrowser下载,例如https://dev.openwrt.org/browser/packages/utils/nano下载nano编辑器的Makefile文件,将它们放到~/openwrt/package/nano/中。this
而后咱们在~/openwrt根目录下,执行下面命令就把源码下载下来了:spa
make package/nano/download
源码会下载到~/openwrt/dl中3d
而后输入prepare准备命令(解压源码到~/openwrt/build_dir/target-ips_r2~中,并执行打包patch文件,若是还有依赖没有下载的话也会自动下载,如nano须要ncurses库)
make package/nano/prepare
上图在编译过程当中出现了许多WARNING
WARNING: skipping <package> -- package not selected Run make menuconfig and enable compilation for your package. It should be labeled with <*> or <M> to work correctly. Read image.configuration further up in this article.
意思就是在make menuconfig中没有选中这些包,因此它不编译!我是直接修改.config的,在里面搜索相应的WARNING指出的名字,而后改成=y就能够了。
输入编译命令(上图)
make package/nano/compile
结果已经在~/openwrt/bin/ar71xx中看到有这个ipk包了