Openwrt最新分支LEDE编译教程
1、搭建编译环境;
官方提示需要安装以下包:
You need to have installed gcc, binutils, bzip2, flex, python, perl, make, find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers. 其中diff由diffutils代替,libc headers 为 libc6-dev。
在Ubuntu 16.04 LTS 中如果已搭建好openwrt编译环境,则以上包都已经安装完成。
2、下载官网源码;
$ git clone https://github.com/zxvv/lede 获取指定commit版本说明: 先查看指定版本的commit:
$ git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, \49260
$ git log | grep 49260
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49260 3c298f89-4303-0410-b956-a3cf2f4a3e73
$ git checkout 3c298f89-4303-0410-b956-a3cf2f4a3e73
这样就获取到了相应版本了。「RXXXXX」这个版本号可以自己换。
3、修改feeds源(非必要,可添加其他第三方软件包源) $ gedit ./feeds.conf.default
+src-git luci https://github.com/981213/luci-1.git
+src-git packages https://github.com/981213/packages.git -src-git packages https://github.com/openwrt/packages.git -src-git luci https://github.com/openwrt/luci.git 仍然使用的是openwrt的feeds源。
4、修改download源
$ gedit ./scripts/download.pl
#push @mirrors, 'http://mirror1.openwrt.org';
+push @mirrors, 'http://buildbot.openwrt.org:8010/src'; push @mirrors, 'http://mirror2.openwrt.org/sources'; push @mirrors, 'http://downloads.openwrt.org/sources'; 仍然使用的是openwrt的download源。
5、安装feeds $ cd lede
$ ./scripts/feeds update -a $ ./scripts/feeds install -a
6、修改源码(略)
修改完成后执行(非必要步骤)
$ git diff > change.diff #把所有修改生成到一个*.diff 文件中,当笔记用。
7、配置menuconfig $ rm -rf tmp
$ make menuconfig
选择 Target Profile 和 luci,其他包根据实际情况选择。
8、下载软件包源码 $ make download V=s
或者 软链接 已有的 dl 库
$ ln ./dl /lede/dl #./dl为源路径,/lede/dl为目标路径,都是绝对路径。
9、编译 $ make V=s 或者
$ make V=99
非第一次编译可带 -jN 使用多线程编译。
10、Over
相关推荐: