编译OpenWrt自动翻墙固件 for 网件Netgear WNDR4300路由器

经过前面几个步骤,一切准备就绪,下面就正确开始编译Netgear WNDR4300专用全自动翻墙固件了

🗻 编译OpenWrt自动翻墙固件前的系统准备

sudo apt-get update
sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip

🗽 OpenWrt Image Builder的三个命令行参数

  • PROFILE 指定设备类型,此处是 WNDR4300V1
  • PACKAGES 指定要编译进固件的包
  • FILES 指定要编译进固件的自定义文件,如网络有关配置文件, 默认目录:~/Downloads/openwrt-wndr4300

🍣 开始编译OpenWrt自动翻墙固件 for 网件Netgear WNDR4300路由器

命令:

cd ~/Downloads/openwrt-imagebuilder
make image PROFILE=WNDR4300V1 PACKAGES="libiwinfo-lua liblua liblucihttp liblucihttp-lua libubus-lua lua luci luci-app-firewall luci-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-proto-ipv6 luci-proto-ppp luci-theme-bootstrap rpcd rpcd-mod-rrdns uhttpd base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd kmod-gpio-button-hotplug swconfig kmod-ath9k wpad-mini uboot-envtools iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport luci-ssl ipset ipset-dns wget iptables-mod-nat-extra bind-dig dnsmasq-full libmbedtls libcares libev libsodium shadowsocks-libev -dnsmasq" FILES=~/Downloads/config-wndr4300

编译时报错:

opkg_install_cmd: Cannot install package kmod-ipv6

移除 kmod-ipv6后编译成功

编译好的的固件在:

~/Downloads/openwrt-imagebuilder/bin/targets/

其中包含:

openwrt-ar71xx-nand-wndr4300-ubi-factory.img
openwrt-ar71xx-nand-wndr4300-squashfs-sysupgrade.tar

可见生成了二种格式的固件,img 格式和 tar 格式。 其中 img 格式只能用 tftp 的方法进行刷入。而 tar 也只能通过 已刷了Openwrt的WEB端进行刷入

请同时参考使用Image Builder编译自动翻墙OpenWrt固件

部分编译错误处理

  • Build dependency: Please install the openssl library (with development headers)

    For Centos:

      yum install openssl-devel
    

    For Ubuntu:

      sudo apt-get install libssl-dev
    
  • Unable to open feeds configuration in line 42

    使用 svn co svn://svn.openwrt.org/openwrt/trunk/ 下载后再编译的方法没有遇到这个问题

  • configure: error: you should not run configure as root (set FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)

    See config.log' for more details

    将下载的文件的所有者改为自己,假设用户名是ubuntu

    sudo chown -Rv ubuntu  /home/ubuntu/openwrt
    

    再重新运行make

相关资源:

results matching ""

    No results matching ""