Openwrt最新分支LEDE编译教程

Openwrt最新分支LEDE编译教程
Openwrt最新分支LEDE编译教程

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://https://www.360docs.net/doc/d78721497.html,/zxvv/lede

获取指定commit版本说明:

先查看指定版本的commit:

$ git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }'

49260

$ git log | grep 49260

git-svn-id: svn://https://www.360docs.net/doc/d78721497.html,/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://https://www.360docs.net/doc/d78721497.html,/981213/luci-1.git

+src-git packages https://https://www.360docs.net/doc/d78721497.html,/981213/packages.git

-src-git packages https://https://www.360docs.net/doc/d78721497.html,/openwrt/packages.git

-src-git luci https://https://www.360docs.net/doc/d78721497.html,/openwrt/luci.git

仍然使用的是openwrt的feeds源。

4、修改download源

$ gedit ./scripts/download.pl

#push @mirrors, 'https://www.360docs.net/doc/d78721497.html,';

+push @mirrors, 'https://www.360docs.net/doc/d78721497.html,:8010/src';

push @mirrors, 'https://www.360docs.net/doc/d78721497.html,/sources';

push @mirrors, 'https://www.360docs.net/doc/d78721497.html,/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

相关主题
相关文档
最新文档