编译华硕路由器ACRH17源代码小记

源码包中有说明:

The GPL source is created for ASUS wireless router related products. Please visit the ASUS support site (http://support.asus.com) to get the latest GPL tarball.It has a lot in common with many wireless router open source projects, including Oleg/Tomato/DD-WRT/OpenWRT. Thanks the developers of those projects for making the source code available.


Set Up Environment(Tested in Fedora 8/9 and Ubuntu)


    1. prepare environment


a. Ubuntu
Install these packages (I used synaptic: "sudo synaptic")


libncurses5
libncurses5-dev
m4
bison
gawk
flex
libstdc++6-4.4-dev
g++-4.4
g++
gengetopt
git (or git-core)
gitk
zlib1g-dev
autoconf
autopoint (or gettext)
libtool
shtool
autogen
mtd-utils
intltool
sharutils
docbook-xsl-*
libstdc++5
texinfo
dos2unix (or tofrodos)
xsltproc
uboot-mkimage
device-tree-compiler
python 2.7 or above.
qemu
gperf
liblzo2-dev
uuid-dev
build-essential
lzma-dev
liblzma-dev
lzma
binutils-dev
patch
cmake
intltool
libglib2.0-dev
gtk-doc-tools


If you are using Ubuntu amd64, you may need to install 32-bit packages listed below.
libc6-i386
lib32stdc++6
lib32z1
libelf1:i386
libncurses5:i386
ia32-libs
libc6-dev-i386


b. Fedora
python 2.7 or above.
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel libxml2-devel mtd-utils-ubi ncurses-devel \
zlib-devel intltool sharutils docbook-dtds docbook-style-xsl \
uboot-tools dtc gengetopt qemu gperf cmake glib2-devel gtk-doc


If you are using Fedora 19 or above, you need to install below packages.
sudo yum groupinstall "C Development Tools and Libraries"


If you are using Fedora x86_64, you may need to install 32-bit packages listed below.
elfutils-libelf.i686
glibc.i686
libstdc++.i686
zlib.i686


If you are using Fedora 24+, you may need to install 32-bit packages listed below.
ncurses-compat-libs.i686


   2. prepare source to, ex, $HOME/asuswrt


cd $HOME
tar xvfz [tar file]


   3. setup development system


Broadcom SoC models
===================


To install the tools:
    - copy the tools/brcm/ directory to /opt
    - add /opt/brcm/hndtools-mipsel-linux/bin to your path
    - add /opt/brcm/hndtools-mipsel-uclibc/bin to your path


Broadcom HND SoC models
=======================


Update your environment variables as following:
    - LD_LIBRARY_PATH=/opt/toolchains/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/lib
    - TOOLCHAIN_BASE=/opt/toolchains
    - PATH=/opt/toolchains/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin:/opt/toolchains/crosstools-aarch64-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin:/projects/hnd/tools/linux/hndtools-armeabi-2011.09/bin:$PATH


Mediatek/Ralink SoC models
==========================


To install the tools:
        - copy the tools/brcm/ directory to /opt
    - add /opt/brcm/hndtools-mipsel-linux/bin to your path
    - add /opt/brcm/hndtools-mipsel-uclibc/bin to your path
    If it is MT7621 or MT7628 chip:
        - extract tools/buildroot-gcc463_32bits.tar.bz2 to /opt
    - add /opt/buildroot-gcc463/bin to your path
    otherwise :
        - extract tools/buildroot-gcc342.tar.bz2 to /opt
    - add /opt/buildroot-gcc342/bin to your path


For MT7621 Uboot:
        - extract mips-2012.03.tar.bz2 directory to /opt
    - add /opt/mips-2012.03/bin to your uboot path


Qualcomm QCA9557 MIPS SoC models
================================


For example, RT-AC55U, 4G-AC55U.


For example, RT-AC55U, 4G-AC55U.


To install the tools:
        - extract tools/openwrt-gcc463.mips.tar.bz2 directory to /opt
    - add /opt/openwrt-gcc463.mips/bin to your path
    - If you want to build small utilities out of asuswrt box,
      add STAGING_DIR environment variable as below:


      export STAGING_DIR=/opt/openwrt-gcc463.mips


Qualcomm IPQ806x/IPQ40xx ARM SoC models
===============================


For example, BRT-AC828.


To install the tools:
    - extract tools/openwrt-gcc463.arm.tar.bz2 directory to /opt
    - add /opt/openwrt-gcc463.arm/bin to your path
    - If you want to build small utilities out of asuswrt box,
      add STAGING_DIR environment variable as below:

      export STAGING_DIR=/opt/openwrt-gcc463.arm


Note: Broadcom/Ralink(except 4708 series) platform use the same toolchain for user space program, so please set PATH to the same directory as above


   4. build firmware.


a. rt-n16
cd release/src-rt
make rt-n16


b. rt-n56u
cd release/src-ra
make rt-n56u


c. rt-n65u
cd release/src-ra-3.0
make rt-n65u


d. rt-n14u (/ rt-ac52u / rt-ac51u / rt-n11p / rt-n54u)
cd release/src-ra-mt7620
make rt-n14u
( make rt-ac52u  )
( make rt-ac51u  )
( make rt-n11p   )
( make rt-n54u   )


e. rt-ac56u (/ rt-ac68u / rt-n18uhp)
cd release/src-rt-6.x.4708
make rt-ac56u
( make rt-ac68u  )
( make rt-n18uhp )


f. rt-ac55u (/ rt-ac55uhp )
cd release/src-qca
make rt-ac55u
( make rt-ac55uhp )


g. brt-ac828 (/ rt-ac88q )
cd release/src-qca-ipq8064
make brt-ac828


h. rt-ac58u (/ rt-ac82u )
cd release/src-qca-dakota
make rt-ac58u
( make rt-ac82u )


i. rt-ac85u (/ rt-ac85u / rt-ac65u / rp-ac87 )
cd release/src-ra-5010
make rt-ac85u
( make rt-ac65u )
( make rp-ac87 )


j. rt-ac1200 (/ rt-n11p_b1 / rt-n10p_v3 / rt-ac1200gu / rt-ac51u+ / rt-ac53 )
cd release/src-ra-4300
make rt-ac1200
( make rt-n11p_b1 )
( make rt-n10p_v3 )
( make rt-ac1200gu )
( make rt-ac51u+ )
( make rt-ac53 )

——————————————————————————————————————————

先是用我装的centos7_x64编译,结果报Lib_tool未安装一类的错误,查看安装的软件包已经安过了x64版本的,然后搜索仓库没有x86版本的,猜没是这个原因。

然后就又在vbox上装了ubuntu的x86版本,再编译一切基本顺利。

我主要是想编译ebtables软件和内核模块,来开启真正的访客网络无线隔离。

编译完成后到linux源码目录,make menuconfig发现ebtable相关的都编译成了模块(M)。

又下载了一个此型号路由器的升级固件,用7zip打开,所有目录看了两遍,发现在\lib\modules\3.14.77\kernel\net\bridge\netfilter\目录已经有相关ko文件,

只是\lib\modules\modules.dep没有全部加载,尤其是ebt_ip.ko这个支持ipv4的没有加载,等有时间了把这些模块全部加载了,试下我以前的防火墙规则隔离无线是否正常。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值