- Enter the build environment:
cd devenv
docker compose run --rm builder- Configure and build:
cp /repo/diffconfig .config
# Optional: disable signature verification
# Useful if using github's mirror, as packages there are not signed.
# echo "# CONFIG_SIGNED_PACKAGES is not set" >> .config
make defconfig
make -j$(nproc)Two configs are provided: diffconfig and diffconfig_default:
-
diffconfig_default: its just the target selected +
luci+luci-proto-qmi. In essence all the pakages that appear in the firmware-selector editor textarea... the ones that can be said to be defaults/minimum/standard. -
diffconfig: Includes a custom
defaultspackage, that will addkmod-tunandluci-proto-wireguardwith its dependencies, apart from creating some uci-defaults.
All changes can be seen in the device folder, but the main one is the mt7628an_tplink_8m.dtsi -> mt7628an_tplink_16m.dtsi. All the other are necessary for the device to compile with its own name.
Based on the discussion of this forum (https://forum.openwrt.org/t/new-device-tp-link-mr6400-v7/214794/10), the v5 and v7 have the same similar hardware apart from the memory expansion on the v7 that doubles the space from 8m -> 16m.
--- mt7628an_tplink_8m.dtsi
+++ mt7628an_tplink_16m.dtsi
@@ -30,17 +32,17 @@
partition@20000 {
compatible = "tplink,firmware";
label = "firmware";
- reg = <0x20000 0x7a0000>;
+ reg = <0x20000 0xfa0000>;
};
- partition@7c0000 {
+ partition@fc0000 {
label = "config";
- reg = <0x7c0000 0x10000>;
+ reg = <0xfc0000 0x10000>;
read-only;
};
- factory: partition@7d0000 {
+ factory: partition@fd0000 {
label = "factory";
- reg = <0x7d0000 0x30000>;
+ reg = <0xfd0000 0x30000>;
read-only;-reg = <0x20000 0x7a0000>;
+reg = <0x20000 0xfa0000>;The firmware partition was expanded from 7.875 MB (0x7a0000) to 15.625 MB (0xfa0000), gaining 8 MB of additional space for the firmware. This change maximizes the usable flash space on the 16MB device, allowing for larger OpenWrt builds with more packages and features.
-partition@7c0000 {
+partition@fc0000 {
-reg = <0x7c0000 0x10000>;
+reg = <0xfc0000 0x10000>;The config partition was relocated from offset 0x7c0000 to 0xfc0000 (shifted 8MB forward) to accommodate the expanded firmware partition. The partition size remains unchanged at 64 KB (0x10000), preserving the same storage capacity for device configuration data.
-factory: partition@7d0000 {
+factory: partition@fd0000 {
-reg = <0x7d0000 0x30000>;
+reg = <0xfd0000 0x30000>;The factory partition was also shifted from 0x7d0000 to 0xfd0000, maintaining its size at 192 KB (0x30000). This read-only partition contains critical WiFi calibration data and MAC addresses, which must be preserved at a fixed size for proper device operation.
Use these parameters for the TFTP recovery process. The only proven way to get out of official firmware.
| Parameter | Value |
|---|---|
| Bootloader TFTP server IP | 192.168.0.225 |
| Firmware TFTP image | tp_recovery.bin (rename OpenWrt -tftp-recovery.bin image) |
| TFTP window start | Power on holding RESET for 8s |
| Bootloader TFTP client IP | 192.168.0.2 |
- Install
tftpd-hpaand start the service. - Copy renamed
tp_recovery.binto/srv/tftp/, ensure permissions allow tftp user read access. - Set your Ethernet interface to 192.168.0.225/24 static IP matching the bootloader server address above.
- Connect Ethernet to router LAN port (powered off).
- Power on holding RESET ≥8s; monitor TFTP logs.
Power LED flashes ~3min, then reboots to OpenWrt (192.168.1.1).
