编译arm平台的ethtool


id="BAIDU_SSP__wrapper_u653336_0_iframe" src="http://pos.baidu.com/kcjm?rdid=653336&dc=2&di=u653336&dri=0&dis=0&dai=1&ps=236x405&dcb=BAIDU_SSP_define&dtm=HTML_POST&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1472707969300&ti=%E7%BC%96%E8%AF%91arm%E5%B9%B3%E5%8F%B0%E7%9A%84ethtool_%E5%91%B5%E5%91%B5%E5%91%B5%E5%91%B5%E5%91%B5&ari=2&dbv=2&drs=1&pcs=1920x1011&pss=1920x236&cfv=22&cpl=29&chi=1&cce=true&cec=UTF-8&tlm=1472679169&rw=1011&ltu=http%3A%2F%2Fwww.hehehehehe.cn%2Fi%2F570.html&ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3D_JYKKLotPxhznp7axJwwVGYzHjJA2gzC_kwBNlgo0ULC7LDYwPRljh3HWceWCYLQ%26wd%3D%26eqid%3Ddbaa5231000013b40000000657c7bd71&ecd=1&psr=1920x1200&par=1920x1160&pis=-1x-1&ccd=32&cja=true&cmi=48&col=zh-CN&cdo=-1&tcn=1472707969&qn=2738fe5910c5ebf7&tt=1472707969284.16.94.110" width="120" height="270" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: border-box; border-width: 0px; vertical-align: bottom; margin: 0px;">
关闭

1.下载ethtool源代码
git clone git://git.kernel.org/pub/scm/network/ethtool/ethtool.git
2.准备交叉编译工具
可以从codesoucery下载
3.编译
假设目标机器的规格如下:
ABI: EABI version 4
little endian
armv5te

按如下顺序运行:
./autogen.sh
./configure CC=CROSS-COMPILER PATH CFLAGS=-march=armv5te --host=arm-xx-linux

或者 cat /proc/cpuinfo 查看mcpu属性或march属性,添加对应configure属性

./configure CC=CROSS-COMPILER CFLAGS=-mcpu=cortex-a7 --host=arm-xx-linux



如果需要静态编译则
打开vim Makefile 在CC= CROSS-COMPILER后面加上--static
保存
make

就在当前文件夹内生成一个可执行文件ethtool
确认编译后的文件
readelf -h ethtool
确认以下信息(具体内容要看自己的配置了)
OS/ABI UNIX - System V
Machine :ARM
Flags Version4 EABI


命令描述:

ethtool 是用于查询及设置网卡参数的命令。

使用概要:
ethtool ethx       //查询ethx网口基本设置,其中 x 是对应网卡的编号,如eth0、eth1等等
ethtool –h        //显示ethtool的命令帮助(help)
ethtool –i ethX    //查询ethX网口的相关信息 
ethtool –d ethX    //查询ethX网口注册性信息
ethtool –r ethX    //重置ethX网口到自适应模式
ethtool –S ethX    //查询ethX网口收发包统计
ethtool –s ethX [speed 10|100|1000] [duplex half|full]  [autoneg on|off]        //设置网口速率10/100/1000M、设置网口半/全双工、设置网口是否自协商


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值