主要參考
https://dev.openwrt.org.cn/中的文檔另一個舊版文檔https://dev.openwrt.org.cn/wiki/OpenWrt%E7%BC%96%E8%AF%91%E6%95%99%E7%A8%8B
編譯環境準備sudo apt-get install subversion
需要安裝的包
sudo apt-get install libtool autoconf automake gcc-multilib bison screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core git build-essential libncurses5-dev zlib1g-dev gawk quilt asciidoc libz-dev
對于RHEL或fedora
yum install autoconf binutils bison bzip2 flex gawk gcc gcc-c++ gettext make ncurses-devel patch unzip wget zlib-devel
下載代碼主要參考https://dev.openwrt.org.cn/wiki/GetSource
安裝feeds主要參考https://dev.openwrt.org.cn/wiki/howto
之前一步要make defconfig檢查編譯環境 若可進行則生成默認配置配置menuconfig(注意:有些帶有--->的無法進入只需先把前面[ ]勾選即可進入子菜單)添加luci
LuCI ->Collections -> <*> luci
添加luci的中文語言包
LuCI ->Translations -> <*> luci-i18n-chinese
添加DDNS
LuCI ->Applications -> <*>luci-app-ddns
添加USB掛載
Base system -> <*>block-mount
添加自動掛載工具
Utilities -> Filesystem -> <*> badblocks
添加復位鍵支持
Utilities -> <*> restorefactory
添加一鍵開關無線
Utilities -> <*> wifitoggle
如果需要單獨配置OpenWrt-DreamBox的linux kernel,可以使用下面命令配置:$ make kernel_menuconfig
luci中的app可以按需選擇Translations: luci-i18n-chinese、luci-i18n-english
我編譯2440固件選中的選項Target System:Samsung S3C24xxSubtarget:Subtarget (MINI2440 Development Board) Target Profile:(router)MINI2440 Development Board(因為我主要是作為路由系統)Target Images:我只選了squashfs可以選jffs2Package features選umontuBase system去掉dnsmasq和firewall,選上librt、libpthreadluci里面第一項選luci,Translate里選上luci-i18n-chinese
Kernel modules是大頭Kernel modules -> Filesystems -> <*> kmod-fs-ext4 添加硬盤格式支持Kernel modules -> Native Language Support -> <*> kmod-nls-utf8 添加UTF8編碼Kernel modules -> USB Support -> <*> kmod-usb-storage-extras. 添加USB擴展支持其他還需選kmod-uѕb-core、kmod-uѕb-ohci、kmod-uѕb-storage、kmod-uѕb-storage-extras、kmod-uѕb-uhci、kmod-uѕb-video、kmod-uѕb2我還選了usbip相關的I2C support里選上kmod-i2c-core、kmod-i2c-s3c24xx.other里選kmod-input-coreVideo Support ---> kmod-video-core、kmod-video-uvc(我全選了)Wireless Drivers ---> 可以根據你的網卡類型選擇
Network中我還選了iftop aircrack-ng amuleUtilities選了vim相關
編譯選項 make -j 3 針對多核[/pre]我使用的完整編譯命令[/pre]make V=99 2>&1 |tee build.log |egrep -i '(warn|error)'[/pre]
出錯處理
如果因某種不知道的原因而編譯失敗,下面有種簡單的方法來得知編譯到底錯在哪里了:$ make V=99 2>&1 |tee build.log |grep -i error輸出詳細的編譯信息到build.log中,在終端只顯示error錯誤的信息,或者:$ make V=99 2>&1 |tee build.log |egrep -i '(warn|error)'輸出詳細的編譯信息到build.log中,在終端只顯示warn警告,和error Error錯誤的信息。(補充說明:tee指令會從標準輸入設備讀取數據,將其內容輸出到標準輸出設備,同時保存成文件。)[root@localhost ~]# who | tee who.out root pts/0 2009-02-17 07:47 (123.123.123.123) |
我在編譯過程中一開始是找不到transmission的包,用迅雷下載放到dl目錄下 就OK了然后又是一個 implicit declaration of function 'time' 我在router.c中添加了#include <time.h>結果錯誤解決 見http://blog.sina.com.cn/s/blog_77f90afc0100wu3n.html但是沒有uboot產生 make menuconfig中Bootloader項也無法選中沒有uboot估計是lintel哥沒有把uboot集成到svn源碼中placido回復說 ”原來配置編譯uboot不是這個選項,而是在Device下面“ 囧 mini2440 固件刷寫教程http://www.dixuerenqin.net.cn/read.php?tid-81329.html
本部分內容設定了隱藏,需要回復后才能看到
[ 此帖被feifei435在2014-02-07 18:11重新編輯 ]