自编译Tl-wr745n-v2的OpenWrt固件

自编译Tl-wr745n-v2的OpenWrt固件:与wr845n-v2自编译一样,个人觉得wr745n-v2也不必采用新增设备的方式,而是直接采用wr741nd-v4的二次编译固件即可。当然你要是有时间,或者正好想练练手,那么可以参考wr886n-v5采用新增设备的方式来编译新固件。

编译环境:由于wr741nd-v4的官方固件目前最高支持到v18.06.9,所以我们也选择在这个版本环境下来编译wr745n-v2的固件。

硬改部分仍是建议16M/64M,以方便安装必要的应用程序,具体操作方法可参考:WR886N-V5刷OpenWrt固件

一、需要修改的部分

与wr845n-v2一样,只要修改两个文件即可:

1、~/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr741nd-v4.c

#define TL_WR741NDV4_GPIO_LED_WLAN	0

修改为

#define TL_WR741NDV4_GPIO_LED_WLAN	27
#define TL_WR741NDV4_GPIO_LED_WAN	13

修改为

#define TL_WR741NDV4_GPIO_LED_WAN	17
#define TL_WR741NDV4_GPIO_LED_LAN4	17
#define TL_WR741NDV4_GPIO_LED_SYSTEM	27

修改为

#define TL_WR741NDV4_GPIO_LED_LAN4	13
#define TL_WR741NDV4_GPIO_LED_SYSTEM	0
{
        .name		= "tp-link:green:lan4",
        .gpio		= TL_WR741NDV4_GPIO_LED_LAN4,
        .active_low	= 1,
    }, {
        .name		= "tp-link:green:qss",
        .gpio		= TL_WR741NDV4_GPIO_LED_QSS,
        .active_low	= 0,
    }, {
        .name		= "tp-link:green:system",
        .gpio		= TL_WR741NDV4_GPIO_LED_SYSTEM,
        .active_low	= 1,
    }, {
        .name		= "tp-link:green:wan",
        .gpio		= TL_WR741NDV4_GPIO_LED_WAN,
        .active_low	= 0,
    },

修改为

{
        .name		= "tp-link:green:lan4",
        .gpio		= TL_WR741NDV4_GPIO_LED_LAN4,
        .active_low	= 0,
    }, {
        .name		= "tp-link:green:qss",
        .gpio		= TL_WR741NDV4_GPIO_LED_QSS,
        .active_low	= 0,
    }, {
        .name		= "tp-link:green:system",
        .gpio		= TL_WR741NDV4_GPIO_LED_SYSTEM,
        .active_low	= 0,
    }, {
        .name		= "tp-link:green:wan",
        .gpio		= TL_WR741NDV4_GPIO_LED_WAN,
        .active_low	= 1,
    },
    ath79_setup_ar933x_phy4_switch(true, true);

修改为

    ath79_setup_ar933x_phy4_switch(false, false);

2、~/target/linux/ar71xx/base-files/etc/board.d/02_network

    tl-wr740n-v6|\
    tl-wr741nd-v4|\
    tl-wr840n-v2|\
    tl-wr840n-v3|\
    tl-wr841n-v11|\
    tl-wr841n-v9|\
    tl-wr842n-v3|\
    whr-g301n|\
    whr-hp-g300n|\
    whr-hp-gn|\
    wzr-hp-ag300h|\
    zbt-we1526)
        ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
        ucidef_add_switch "switch0" \
            "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
        ;;

修改为

    tl-wr740n-v6|\
    tl-wr741nd-v4|\
    tl-wr840n-v2|\
    tl-wr840n-v3|\
    tl-wr841n-v11|\
    tl-wr841n-v9|\
    tl-wr842n-v3|\
    whr-g301n|\
    whr-hp-g300n|\
    whr-hp-gn|\
    wzr-hp-ag300h|\
    zbt-we1526)
        ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
        ucidef_add_switch "switch0" \
            "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
        ;;
二、配置及编译
make menuconfig

自编译Tl-wr745n-v2的OpenWrt固件-1

make -j1 V=s

编译生成的固件:~/bin/targets/ar71xx/tiny/openwrt-ar71xx-tiny-tl-wr741nd-v4-squashfs-factory.bin

三、刷入新固件并测试

Breed刷入新固件,就可以进入OpenWrt系统的Luci界面了:

自编译Tl-wr745n-v2的OpenWrt固件-2

虽然型号指示是TP-link TL-WR741N/ND v4,但是所有功能都很正常,可放心使用。

这个新固件我已经放在下载中心供大家下载(提取码:lyzt)。