[SOLVED]Build a WR840N v2 firmware failure : rootfs offset aligned to *** error: images are too big by ***

Hello, I'm a new to LEDE and apology my bad english.

I've read the basic developer guide from the LEDE website

I tried to build the firmware of [TL-WR840N V2 En] in the "windows subsystem for Linux" environment, but there was a problem when the firmware was final generated.

When I first configured, I just added Luci module & language package (because the default is disable), and then removed the USB module, and the output error log was as follows:


dd if=/home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs >> /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin

6297+1 records in
6297+1 records out
3224122 bytes (3.2 MB, 3.1 MiB) copied, 0.239021 s, 13.5 MB/s

/home/andyx/lede/staging_dir/host/bin/mktplinkfw -H 0x08400002 -W 0x1 -F 4Mlzma -N OpenWrt -V r5616-67c1c14 -m 1 -k /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tl-wr840n-v2-kernel.bin -r /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin -o /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin.new -j -X 0x40000 -a 0x4   && mv /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin.new /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin || rm -f /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin

**[mktplinkfw] rootfs offset aligned to 0x1421744**
**[mktplinkfw] *** error: images are too big by 975847 bytes**

cp /home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin /home/andyx/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin

**cp: cannot stat '/home/andyx/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin': No such file or directory**

Makefile:64: recipe for target '/home/andyx/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin' **failed**

make[5]: [/home/andyx/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory.bin] **Error 1 (ignored)**

So next, I tried to wipe configuration to default(make sure deleted Luci), and just removed the USB module, and the output error was the ...... same:


dd if=/home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/root.squashfs >> /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin

5846+1 records in
5846+1 records out
2993442 bytes (3.0 MB, 2.9 MiB) copied, 0.215815 s, 13.9 MB/s

/home/andyx/lede/lede/staging_dir/host/bin/mktplinkfw -H 0x08400002 -W 0x1 -F 4Mlzma -N OpenWrt -V r5616-67c1c14 -m 1 -k /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tl-wr840n-v2-kernel.bin -r /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin -o /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin.new -j -X 0x40000 -a 0x4 -C EU  && mv /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin.new /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin || rm -f /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin

**[mktplinkfw] rootfs offset aligned to 0x1421744**
**[mktplinkfw] error: images are too big by 745167 bytes**

cp /home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin /home/andyx/lede/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin

**cp: cannot stat '/home/andyx/lede/lede/build_dir/target-mips_24kc_musl/linux-ar71xx_generic/tmp/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin': No such file or directory**

Makefile:64: recipe for target '/home/andyx/lede/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin' **failed**

make[5]: [/home/andyx/lede/lede/bin/targets/ar71xx/generic/openwrt-ar71xx-generic-tl-wr840n-v2-squashfs-factory-eu.bin] **Error 1 (ignored)**

All LEDE source code are placed under the "C:\Users****\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home****"path, No permission issue.

Try to run "make defconfig" & "make download V=99" is fine.

:sob::sob::sob::sob::sob::sob::sob:
Does this look just images to big? what's the reason cause of this? How should I solve it?
I need help :persevere::persevere::persevere::persevere::persevere:

WR840N only has 4 MB flash, so LuCI can't be installed...

https://lede-project.org/toh/hwdata/tp-link/tp-link_tl-wr840n_v2

https://lede-project.org/meta/infobox/432_warning

Thank you for your reply!

So I tried to delete LUCI and USB support module to make the minimized firmware, but it still failed.

I find a Third-party firmware, It looks like modified from TL-WR841N v9, and it include Luci + OpenVPN + UPNP.

I tried to flash in My [TL-WR840N v2 En] 4M flash, It working fine, except the router's LED are upside-down.

I don't know how he did it

I found a solution! Refer the following link:

https://www.gargoyle-router.com/phpbb/viewtopic.php?f=7&t=8614

1-- Set SquashFS to 1024K
2-- Disable Kernel Debug
3-- Disable unnecessary package


And I have referenced some configuration from following link:

THX for @amq


OpenWRT Configuration:

_Target Devices -> TP-Link TL-WR840N-v2

【Enable】:
_Target Images -> squashfs -> Block size -> 1024
_Global build settings -> Strip unnecessary exports from the kernel image + Strip unnecessary functions from libraries
_LuCI -> Collections -> luci-ssl
_LuCI -> Applications -> luci-app-adblock
_LuCI -> Applications -> luci-app-ddns or luci-app-mqs
_LuCI -> Applications -> luci-app-upnp

【Disable】:
_Global build settings -> Kernel build options -> everything
_Global build settings -> Enable IPv6 support in package
_Kernel modules -> Wireless Drivers -> kmod-ath9k -> Support for Ubiquiti Unify Outdoor+
_Kernel modules -> Wireless Drivers -> kmod-mac80211 -> Export mac80211 internals in DebugFS
_Kernel modules -> Wireless Drivers -> kmod-ath -> Force Atheros drivers to respect the user's regdomain settings + Enable DFS support
_Kernel modules -> USB -> everything


I build a Test version(LEDE TP-Link TL-WR840N-v2 For 4M flash):

OPENWRT/LEDE TP-LINK WR840N v2 (Eu) Special Firmware for 4M Flash

Function List:
SFE(Qualcomm FAST PATCH) / SQM-QOS / UPNP / IPv6 Support / VLAN Support / WIFI-Schedule / Bandwidth-Montior / ARP Binding / Wake-On-Lan / Auto Reboot

https://drive.google.com/open?id=1UoCyLy-1t_ilAhGPI7XsLV4GygRN1kDv

[Update 2018-Feb-4] v0.42 (English+Chinese)
LUCI-SFE-SQM-UPNP-IPv6-VLAN-WifiSchedule-BandwidthMontior-ArpBinding-WOL-AutoReboot

1 Like