1. 背景
在K2P A2路由器上刷机,由于官方提供的固件或多或少都有一些应用不适合自己使用,因此通过Pandora官网提供的[ImageBuilder]重新构建适合自己的固件。
2. Pandorabox
- 官网:https://pangubox.com
- 下载资源:http://downloads.pangubox.com:6380/
- Pandorabox:http://downloads.pangubox.com:6380/pandorabox/
3. K2P
斐讯的一款基于MTK 7621路由器,目前刷机固件也比较多。主流K2P A1、A2版本,A2版本在A1的基础上少了一些器件,不过固件是可以通用的。
4. 固件重构
现在开始对我们的固件进行定制,首先从Pandora官网下载[ImageBuilder],然后解压。
wget http://downloads.pangubox.com:6380/pandorabox/19.02/targets/ralink/mt7621/PandoraBox-ImageBuilder-ralink-mt7621.Linux-x86_64-2019-02-01-git-0231ad4b5.tar.xz
tar xvf PandoraBox-ImageBuilder-ralink-mt7621.Linux-x86_64-2019-02-01-git-0231ad4b5.tar.xz
cd PandoraBox-ImageBuilder-ralink-mt7621.Linux-x86_64-2019-02-01-git-0231ad4b5
查看可以编译的固件型号以及包含的软件包。
make info
以下是K2P的软件包信息
Phicomm K2P
Packages: pb_ubisplit pbfw-fwcheck gpioctl kmod-gpio-dev kmod-leds-gpio kmod-ledtrig-gpio kmod-ledtrig-timer kmod-ledtrig-netdev kmod-ledtrig-usbport kmod-ledtrig-heartbeat kmod-ledtrig-lightflow kmod-gpio-button-pandorabox wireless-tools iwinfo firewall netifd rpcd ubusd logd kmod-ppp ppp kmod-pptp ppp-mod-pptp kmod-pppol2tp ppp-mod-pppol2tp kmod-ipt-fullconenat iptables-mod-fullconenat kmod-gre iptables-mod-nat-extra dnsmasq-full kmod-nf-nat6 kmod-nf-conntrack6 ip6tables ip6tables-mod-nat ip6tables-extra kmod-nf-nathelper-extra pbr-optimizer wan-discovery http_hook detect_internet maccalc swconfig ralink-utils kmod-gre nvram-ralink uhttpd luci luci-app-uhttpd luci-i18n-uhttpd-zh-cn luci-proto-ppp luci-proto-ipv6 luci-mod-admin-full luci-i18n-base-zh-cn luci-app-update luci-i18n-update-zh-cn luci-theme-darkmatter luci-app-bandwidth luci-i18n-bandwidth-zh-cn luci-app-firewall luci-i18n-firewall-zh-cn luci-app-ddns luci-i18n-ddns-zh-cn luci-app-upnp luci-i18n-upnp-zh-cn luci-app-arpbind luci-i18n-arpbind-zh-cn luci-app-optimizer luci-i18n-optimizer-zh-cn luci-app-hwacc luci-i18n-hwacc-zh-cn kmod-shortcut-fe kmod-shortcut-fe-cm kmod-shortcut-fe-drv luci-app-sfe luci-i18n-sfe-zh-cn luci-app-syncdial luci-app-mwan3 luci-i18n-mwan3-zh-cn 8021xd bndstrg mtkiappd ralink-apctrl kmod-mt7615-dbdc
4.1 通过默认配置构建固件
首先我们通过构建默认固件,来对构建环境进行检测。
命令
make image PROFILE="k2p"
问题及解决方案
- 依赖包
在执行了make image PROFILE="k2p"
后遇到以下问题:Build dependency: Please install a static zlib. (Missing libz.a or zlib.h) Build dependency: Please install the Objective Caml compiler (ocaml-nox) v3.11 or later Build dependency: Please install GNU help2man Build dependency: Please install GNU texinfo Build dependency: Please install golang Build dependency: Please install node npm
依次安装以下软件包:
yum -y install zlib-static ocaml help2man texinfo golang npm