cross compile ethtool

http://www.kernel.org/pub/software/network/ethtool/

ethtool - utility for controlling network drivers and hardware
Introduction

ethtool is the standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. It can be used to:

    Get identification and diagnostic information
    Get extended device statistics
    Control speed, duplex, autonegotiation and flow control for Ethernet devices
    Control checksum offload and other hardware offload features
    Control DMA ring sizes and interrupt moderation
    Control receive queue selection for multiqueue devices
    Upgrade firmware in flash memory

Most features are dependent on support in the specific driver. See the manual page for full information.

cross compile ethtool
step 1: Download ethtool-3.6.tar.bz2 from http://www.kernel.org/pub/software/network/ethtool/
step 2: tar -jxvf ethtool-3.6.tar.bz2
step 3: cd ethtool-3.6, touch cross_configure.sh as follow:
        MIPS_TOOLCHAIN_DIR=/opt/mips-4.4/bin
        export CROSS_COMPILE="${MIPS_TOOLCHAIN_DIR}/mips-linux-gnu-"
        export AR="${CROSS_COMPILE}ar"
        export AS="${CROSS_COMPILE}as"
        export LD="${CROSS_COMPILE}ld"
        export NM="${CROSS_COMPILE}nm"
        export CC="${CROSS_COMPILE}gcc -Os -pipe -O2  -mtune=mips32r2 -mabi=32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -EL"
        export FC="${CROSS_COMPILE}gfortran "
        export RANLIB="${CROSS_COMPILE}ranlib"
        export STRIP="${CROSS_COMPILE}strip"
        export OBJCOPY="${CROSS_COMPILE}objcopy"  
        export CFLAGS="-Os -pipe -O2  -mtune=mips32r2 -mabi=32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -EL"
        export CXXFLAGS="-Os -pipe -O2  -mtune=mips32r2 -mabi=32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -EL"  
        ./configure --target=mipsel-linux --host=mipsel-linux
step 4: ./cross_configure.sh, make
step 5: cp ethtool-3.6/ethtool to target board.
step 6: use "./ethtool -S eth0" to watch network status.

你可能感兴趣的:(cross compile ethtool)