编译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 指定设备类型,此处是 WNDR4300
- PACKAGES 指定要编译进固件的包
- FILES 指定要编译进固件的自定义文件,如网络有关配置文件, 默认目录:~/Downloads/openwrt-wndr4300
开始编译OpenWrt自动翻墙固件 for 网件Netgear WNDR4300路由器
命令:
cd ~/Downloads/OpenWrt-ImageBuilder-ar71xx-nand.Linux-x86_64/
make image PROFILE=WNDR4300 PACKAGES="base-files busybox dropbear firewall fstools jsonfilter libc libgcc mtd netifd opkg procd swconfig ubox ubus ubusd uci usign kmod-lib-crc-ccitt kmod-ipv6 kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-nat kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-ipt kmod-nf-ipt6 kmod-nf-nat kmod-ppp kmod-pppoe kmod-pppox kmod-slhc kmod-gpio-button-hotplug kmod-spi-bitbang kmod-spi-gpio kmod-ath kmod-ath9k kmod-ath9k-common kmod-cfg80211 kmod-mac80211 libip4tc libip6tc libxtables libblobmsg-json libexpat libiwinfo libjson-c libnl-tiny libubox libubus libuci ip6tables iptables hostapd-common iw odhcp6c odhcpd ppp ppp-mod-pppoe wpad-mini iwinfo jshn libjson-script procd-nand ubi-utils uboot-envtools base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools kmod-gpio-button-hotplug swconfig kmod-ath9k wpad-mini uboot-envtools kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev ipset wget libopenssl shadowsocks-libev luci-ssl iptables-mod-nat-extra bind-dig dnsmasq-full" FILES=~/Downloads/openwrt-wndr4300
编译时报错:
opkg_install_cmd: Cannot install package kmod-ipv6
移除 kmod-ipv6后编译成功。
编译好的的固件在:
~/Downloads/OpenWrt-ImageBuilder-ar71xx-nand.Linux-x86_64/bin/ar71xx/
其中包含:
openwrt-ar71xx-nand-wndr4300-ubi-factory.img
openwrt-ar71xx-nand-wndr4300-squashfs-sysupgrade.tar
可见生成了二种格式的固件,img 格式和 tar 格式。 其中 img 格式只能用 tftp 的方法进行刷入。而 tar 也只能通过 已刷了Openwrt的WEB端进行刷入。
部分编译错误处理
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