1、openwrt 基本介绍
openwrt 是一个编译工具,帮助自定义编译内核和应用(我的理解)。所以如果有定制自己需要的内核,并基于这个定制化内核编译一些应用的话,可以使用openwrt,openwrt 还是很成熟,很方便的。
(PS:最开始不知道openwrt的时候,我是自己配置编译环境,然后自己编译应用,当然是很复杂的,又要应用和内核版本一致,又有各种规范,一个OVS编了好久才编好;而使用openwrt ,只需要勾选上自己想要的应用就可以了(openwrt 应用源中的应用很多,基本满足我的需求),所以推荐大家使用openwrt)
我使用的openwrt 版本是:19.07.1,想要移植到的平台是:Xilinx ZC702。
2、编译前准备
openwrt源码下载:
网址是:https://github.com/openwrt/openwrt
这个不用记,直接谷歌里面输:openwrt github 第一个就是。
下载:git clone https://github.com.cnpmjs.org/openwrt/openwrt.git .
外部源码准备:
你需要使用的源码,放在一个位置。
.config 配置文件
其他应用或者库:
这个是说有些库或者软件openwrt 确实没有,那么你可以准备下这些库或者软件的源码,借助 openwrt去帮你编译。
(PS:当然,你不可能一上来就知道哪个库或者软件openwrt 没有,都是先进入到openwrt 里面,make menuconfig ,找一找,搜一搜,发现确实没有的话,你再去准备下这些东西。)
3、开始编译工作
选择版本:
git tag 看看有哪些版本,我是因为openwrt 对ZC702 的支持从19.07.1 才开始,所以选择这个版本,大家可以根据需求选择版本。
git checkout 版本号(直接复制git tag给出的某一个版本)
更新openwrt 库并下载:
./scripts/feeds update -a #更新feeds软件源
./scripts/feeds install -a #下载更新
功能选择:
make menuconfig
.config - OpenWrt Configuration
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq OpenWrt Configuration qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Arrow keys navigate the menu. <Enter> selects submenus ---> (or empty submenus ----). Highlighted letters x
x are hotkeys. Pressing <Y> includes, <N> excludes, <M> modularizes features. Press <Esc><Esc> to exit, <?> x
x for Help, </> for Search. Legend: [*] built-in [ ] excluded <M> module < > module capable x
x x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x Target System (Xilinx Zynq 7000 SoCs) ---> x x
x x Target Profile (Xilinx ZC702) ---> x x
x x Target Images ---> x x
x x Global build settings ---> x x
x x [*] Advanced configuration options (for developers) ---> x x
x x [ ] Build the OpenWrt Image Builder x x
x x [ ] Build the OpenWrt SDK x x
x x [ ] Package the OpenWrt-based Toolchain x x
x x [ ] Image configuration ---> x x
x x Base system ---> x x
x x Administration ---> x x
x x Boot Loaders ---- x x
x x Development ---> x x
x x Extra packages ---> x x
x mqqqqqqqqqqqqqqqqqqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqq