##1.准备linux下编译环境
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils git libncurses5-dev ncurses-term zlib1g-dev gawk libssl-dev python wget subversion xz-utils
64位系统还需
sudo apt-get install lib32gcc1 libc6-dev-i386
##2.下载源码
git clone git://git.openwrt.org/openwrt.git trunk
cd trunk
./scripts/feeds update -a
./scripts/feeds install -a
##3.检查编译环境
make defconfig
若提示缺少软件包或编译库等依赖,则按提示安装所缺软件包或库等即可 ##4.选择组件
make menuconfig
注意: *号是编译进固件,M 是编译但是不编译进固件,生成 ipkg 文件
,路由器 flash 不够大的话要考虑尽量编译成模块
##5.编译
make V=99 j=处理器数目+1
也可以直接
make V=99
##6.生成的固件在bin目录下 ###Fin
##以下杂记
make -j 10 download
预先用10连接数下载源码make package/cups/compile V=99
- Kernel modules -> USB Support -> <*> kmod-usb-ohci SUB1.1驱动
- Kernel modules -> USB Support -> <*> kmod-usb2 USB2.0驱动根据硬件选择
- Base system -> <*>block-mount
- Kernel modules -> Filesystems -> <*> kmod-fs-ext4
- Kernel modules -> USB Support -> <*> kmod-usb-storage-extras.
- Utilities -> Filesystem -> <*> badblocks
make clean
删除.o文件和.bin文件openwrt修改出厂默认语言 http://www.right.com.cn/forum/thread-100338-1-1.html
make 命令简单说明 make V=99 V=99表示输出详细的debug信息
make world 表示编译所有
make j=2 V=99 如是多核CPU,加j=2 选项理论上能加快编译速度 make -j 2 V=99可加快编译速度(不推荐使用)
只清除某个模块 make package/qos/clean
只编译某个模块 make package/qos/clean make package/qos/compile make package/qos/install
make V=99 | tee compile_v1.0.0.log 混合 tee 命令将编译信息放到compile_v1.0.0.log文件中方便查看。
留几个链接