交叉编译OpenWrt 定制固件
在Centos7上交叉编译生成OpenWrt固件
安装ss-*
获取最新的ss, 当前是
wget https://github.com/shadowsocks/shadowsocks-libev/archive/v2.5.6.tar.gz
解压后 ./configure, make, make install
设置代理
[root@u02 ~]# more /etc/shadowsocks-local.json
{
"server": "milton.somewhere.com",
,
"local_address":"127.0.0.1",
,
"password": "foobar",
,
"method": "aes-256-cfb"
}
启动本地代理
/usr/local/bin/ss-local -c /etc/shadowsocks-local.json -b
如果要在后台启动
nohup /usr/local/bin/ss-local -c /etc/shadowsocks-local.json -b 0.0.0.0 -l 1080 > /dev/null 2>&1 & # 检查是否成功启动 netstat -lnp| # 加入开机自启动 echo " nohup ss-local -c /etc/shadowsocks/config.json /dev/null 2>&1 &" /etc/rc.local # 查看后台进程 ps aux |grep ss-local
配置为git的代理
git config --global http.proxy 'socks5://127.0.0.1:1080'orgit config --local http.proxy 'socks5://127.0.0.1:18001' #这个无效, 必须用global # 检查是否生效 git config --list
Git导出代码
# The development branch (trunk) contains everything from documentation to experimental patches. git clone git://github.com/openwrt/openwrt.git # 15.05 branch (Chaos Calmer) git clone -b chaos_calmer git://github.com/openwrt/openwrt.git # 14.07 branch (Barrier Breaker) git clone -b barrier_breaker git://github.com/openwrt/openwrt.git # 更新代码 git pull
(可选)下载并安装所有可用的"feeds"
cd openwrt ./scripts/feeds update -a# 中间会出很多warning, 不用管它 ./scripts/feeds install -a
让OpenWrt构建系统检查缺失的package, 这里你需要选择编译的配置和目标
make menuconfig (most likely you would like to use this) make defconfig
在make menuconfig中, 对已经选择好的配置, 最好通过save, 保存成单独的config, 否则, 在选择新的芯片类型的时候, 选择的信息就全被重置了
编译
make defconfig sudo yum install zlib-static patch subversion make defconfigmake menuconfig make V=smake V=99 TARGET_DEVICES=y1
如果需要后台运行可以通过
nohup .log >& &
Proceed with build (i.e. cross-compile the downloaded sources to binaries)
\\After the cross-compilation process the trunk-directory contained over 240000 files with a total size of above 3GiB!
编译结果
编译成功后, 生成的文件可以在 <buildroot_dir>/bin 目录找到. The compiled files are additionally classified by the target platform, so e.g. a firmware built for an ar71xx device will be located in <buildroot_dir>/bin/ar71xx directory.
E.g. if your <buildroot_dir> is ~/openwrt/trunk, the binaries are in ~/openwrt/trunk/bin/ar71xx.
注: 构建中需要的库
yum install openssl-devel ncurses-devel yum install zlib-static patch subversion
清理工作目录
# 只清理 /bin 和 /build_dir make clean # 只清理 /bin , /build_dir , /staging_dir , /toolchain 和 /logs make dirclean # 清理所有, 包括下载的feeds contents 和 package sources, 以及清除编译配置文件 make distclean
增加对新设备支持需要修改的文件
以下以MTK(ralink)芯片系列的路由为例
1. 在 target/linux/ramips/image/ 目录下能看到对应的mt7***.mk和rt****.mk文件, 这些文件会被同一目录的Makefile所引用, 需要在对应的芯片型号mk文件中添加新设备的信息, 如下, 其中DEVICE_PACKAGES是此型号默认需要安装的package
define Device/pbr-m1
DTS := PBR-M1
IMAGE_SIZE := $(ralink_default_fw_size_16M)
DEVICE_TITLE := PBR-M1
DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
kmod-rtc-pcf8563 kmod-i2c-mt7621
endef
TARGET_DEVICES += pbr-m1
2. target/linux/ramips/base-files/etc/board.d/目录下的 01_leds 和 02_network 是用来设置设备的led灯和网口定义的
3. target/linux/ramips/base-files/lib/ramips.sh
4. target/linux/ramips/base-files/lib/upgrade/platform.sh
5. 在 target/linux/ramips/dts/ 目录下新增对应的dts或dtsi文件
Update 2017-01-19
如果编译过程中出现 config.status: error: cannot find input file: `po/Makefile.in.in' 错误, 需要安装glib2-devel
Update 2017-01-21
如果中途有下载失败的文件包, 可以手动下载后, 上传到dl目录, 再继续进行编译
交叉编译OpenWrt 定制固件的更多相关文章
- 使用 OpenWrt Image Generator 为 WR703N 路由器定制固件
标题:使用 OpenWrt Image Generator 为 WR703N 路由器定制固件 之前试着自己编译固件,编译是成功了,但是在后期安装官方仓库的ipk时出现问题,因为自己编译的固件和官方固件 ...
- openwrt MT7620 固件编译记录
下载,安装相关软件 git clone git@github.com:openwrt-mirror/openwrt.git sudo apt-get install gcc g++ binutils ...
- openwrt定制管理
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/qianguozheng/article/details/24673097 近期这个比較火,可是改了东 ...
- openwrt(三) 固件的烧录
导航: 方法1: tftp: 方法2: 在线升级 方法3: BIOS烧录 方法1:TFTP 这应该是最万能的一种方法了.TFTP是一种依靠网口传送数据的一种通信协议,没错,只是传输数据,并不是烧录,所 ...
- openwrt装载固件
方法1. 确定串口号以后(在设备管理器可以查看) 打开SecureCRT软件,选择串口,设置合适的波特率(我用的115200),然后快速连接, 板子通电启动,在启动的时候会提示按任意键中断,这时按下任 ...
- openwrt官方固件怎么中继网络
关键一点,取消勾
- TL-WR703Nv1.7刷写openwrt固件
TP-LINK TL-WR703N是一个小型的路由器,可以有线转WiFi,3G转WiFi,很多人拿它刷openwrt系统,然后可以在上面各种搞事. V1.7以前 通常刷openwrt的做法是, 下载一 ...
- openwrt的sysupgrade和factory固件的区别
openwrt的固件一般分两种类型:factory原厂固件.sysupgrade固件 factory多了一些验证的东西,用于在原厂固件的基础上进行升级. 普通家用路由一般不是openwrt固件,如果要 ...
- OpenWRT介绍
1. 介绍 OpenWRT是一款第三方路由器固件, 其特别在于开放性, 如它的文件系统可写, 用户可在路由器上安装需要的第三方软件.通过刷入OpenWRT, 我们可以完成如下事情 - DLNA共享 - ...
随机推荐
- x-superobject
x-superobject GITHUB: https://github.com/onryldz/x-superobject **Delphi Cross Platform Rapid JSON**- ...
- 5.跟我学solr---QueryResponseWriter具体解释
简单介绍 QueryResponseWriter是solr的一个插件,与上一章讲的SolrRequestHandler是配对的,用于定义solr查询结果的返回格式. 回到solr admin的查询页面 ...
- linux 字符终端terminal下 ftp的配置和启用
1. ftp组件一般不是linux的自带组件,在ubuntu 12中,就自带了ftp组件 vsftp,而在redhat 9中,就没有自带需要从安装光盘中或下载相应的ftp的rpm包. ~$ sudo ...
- [翻译] Fast Image Cache
https://github.com/path/FastImageCache Fast Image Cache is an efficient, persistent, and—above all—f ...
- 页面中基于JSTL标签调用函数--之${fn:}内置函数
调用这样一个头文件<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions " ...
- 手机网站和PC网站兼容的响应式网页设计
今天跟大家介绍的这个网站叫 媒体查询 官网域名:http://mediaqueri.es/ 该酷站收集了很多响应式设计的案例.全部都是收集的一些励志精美而时尚的网站,使用媒体查询和响应的网页设计. ...
- 【BZOJ】【1419】Red is good
数学期望/期望DP 还是戳<浅析竞赛中一类数学期望问题的解决方法>这篇论文…… $$ f[i][j]= \begin{cases} 0 &, &i==0 \\ f[i-1] ...
- 第九章 Redis过期策略
注:本文主要参考自<Redis设计与实现> 1.设置过期时间 expire key time(以秒为单位)--这是最常用的方式 setex(String key, int seconds, ...
- Depth of field --Circle of confusion 推导
https://en.wikipedia.org/wiki/Circle_of_confusion https://developer.download.nvidia.com/books/HTML/g ...
- 手写一个关于title属性自定义提示框解决浏览器(IE)不兼容问题
<html> <head> <meta charset="utf-8"> <title>无标题页</title> < ...