原文: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包了