主要参考
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.aiothome.net/read.php?tid-81329.html
本部分内容设定了隐藏,需要回复后才能看到
[ 此帖被feifei435在2014-02-07 18:11重新编辑 ]