主页 > 路由器 > ubuntu 64位编译华硕AC1200G+固件

ubuntu 64位编译华硕AC1200G+固件

2017年4月13日 ubuntu 64位编译华硕AC1200G+固件有1条评论 阅读: 19,716 次

Ubuntu版本16.04

1、安装依赖包

sudo apt-get install --no-install-recommends  autoconf automake bash bison bzip2 diffutils file flex g++ gawk gcc-multilib gettext gperf groff-base libncurses-dev libexpat1-dev libslang2 libssl-dev libtool libxml-parser-perl make patch perl pkg-config python sed shtool tar texinfo unzip zlib1g zlib1g-dev

sudo apt-get install lib32stdc++6 lib32z1-dev

sudo apt-get --no-install-recommends install automake1.11

sudo apt-get install libelf-dev:i386 libelf1:i386

sudo apt-get --no-install-recommends install lib32z1-dev lib32stdc++6

2、下载源码

wget http://dlcdnet.asus.com/pub/ASUS/wireless/RT-AC1200G+/GPL_RT_AC1200G_PLUS_30043801234.zip

unzip GPL_RT_AC1200G_PLUS_30043801234.zip && tar -zxvf *1234.gz && mv -r /root/*1234/asuswrt /opt/ac1200g

3、配置环境变量

export PATH=$PATH:/opt/ac1200g/asuswrt/release/src-rt-9.x/src/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin:

4、编译

修改GPIO,适配AC9,asuswrt\release\src-rt-9.x\src\router\rc\init.c

nvram_set_int("btn_rst_gpio", 7|GPIO_ACTIVE_LOW);
nvram_set_int("btn_wps_gpio", 9|GPIO_ACTIVE_LOW);
nvram_set_int("led_pwr_gpio", 15);
nvram_set_int("led_wps_gpio", 10);
//        nvram_set_int("led_5g_gpio", 11);    // active high
nvram_set_int("led_usb_gpio", 1);

 

cd /opt/ac1200g/asuswrt/release/src-rt-9.x/src/ && make RT-AC1200G+

 

5、排错处理

提示:

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/opt/ac1200g/asuswrt/release/src-rt-9.x/src/linux/linux-2.6.36/kernel/Makefile:137: recipe for target 'kernel/timeconst.h' failed
解决:

将kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了

if (!@val) {
@val = compute_values($hz);
}

编译3.0.0.4.380_4089版本时提示:
*** No rule to make target 'tcode.c', needed by 'tcode.o'。
解决:
修改src/router/shared/Makefile,将“%.o: prebuild/%.o”改变一下位置:

%.o: prebuild/%.o
@echo " [shared] cp $@"
@cp -f $< $@

%.o: %.c .%.depend
@echo " [shared] CC $@"
@$(CC) $(CFLAGS) -o $@ -c $<

.depend: $(OBJS:%.o=%.c)
@$(CC) $(CFLAGS) -M $^ > .depend

编译成功:

a2

生成的固件在/opt/ac1200g/asuswrt/release/src-rt-9.x/src/image目录下

评论:1

  1. a123456 回复
    2017年4月21日 于 上午6:42

    还需要安装一个依赖 apt-get install intltool

发表评论

新用户的评论需审核后才会显示;

电子邮件地址不会被公开;
必填项已用*标注