Modify

Opened 5 years ago

Closed 3 years ago

Last modified 2 years ago

#10719 closed defect (too_vague)

troubles related to the firmware image size for ar71xx or tp-link

Reported by: desigabri Owned by: juhosg
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: jffs2 image size Too few erase blocks mounting /dev/mtdblock3 on /rom/overlay failed Cc:

Description

I get kernel jffs2 errors from compiled images when the sysupgrade image file size is bigger then 3.585kB as flashing the squash-factory as flashing the squash-sysupgrade image file.

If I upgrade from a working firmware those images and I don't keep setting, then the web gui turn on upgraded but I get system log and kernel log errors related to the jffs2 partition.

If I upgrade from a working firmware those images keping settings, then I get the router bricked:
no web access
no telnet access
no ping

If I reset to defaults from a "like working" firmware (3.649kB, 3.713kB, 3.777kB, 3.841kB sized squash-sysupgrade and its squash-factory related image file), then I get the router bricked:
no web access
no telnet access
no ping

I verified this on a WR-841ND_v7 and on a MR-3420ND but I think it is related about all ar71xx or about all tp-link boards with 4MB flash.

The size of sysupgrade images increase with 64kB steps size, because the size is related to the smallest flash block size; It seems strange to me that for a factory image size compiled of 3.840kB I get sysupgrade images of 3.649kB up to 3.841kb that seem to be shifted 1kB more in front of the 3.840kB max size of the factory image.

now just some examples if you need to reproduce the trouble:


'''== FIRMWARE UPGRADE WITH IMAGES COMPILED WHEN I GET sysupgrade images size <= 3.585kB =='''


'''web firmware upgrade to squash-factory image file'''
 	gets from system log:

	''Sep  8 15:44:23 OpenWrt kern.warn kernel: [   34.130000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
	Sep  8 15:44:23 OpenWrt kern.warn kernel: [   34.140000] jffs2_build_filesystem(): unlocking the mtd device... done.
	Sep  8 15:44:27 OpenWrt kern.warn kernel: [   34.140000] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
	Sep  8 15:44:27 OpenWrt kern.notice kernel: [   38.230000] JFFS2 notice: (1397) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
	Sep  8 15:44:28 OpenWrt user.info sysinit: copying files ... done''




'''
== FIRMWARE UPGRADE WITH IMAGES COMPILED WHEN I GET sysupgrade images size = 3.841kB, 3.777kB, 3.713kB, 3.649kB =='''


'''web firmware upgrade to squash-sysupgrade (keeping settings)'''
	gets:

	''no web
	no telnet access
	no ping
	(bricked)''



'''emergency state then telnet + firstboot'''
	gets:

''	root@(none):/# firstboot
	Unlocking rootfs_data ...
	Erasing rootfs_data ...
	mount: mounting /dev/mtdblock3 on /overlay failed: Invalid argument
	root@(none):/#''

'''turn off then turn on'''
	gets:

	''no web
	no telnet access
	no ping
	(bricked)''
'''
emergency state then telnet + sysupgrade to squash-sysupgrade'''
	gets:

	''root@(none):/# sysupgrade http://192.168.1.100:8080/openwrt-ar71xx-generic-tl-wr841nd-v7-squashfs-sysupgrade.bin
	Collected errors:
	 * opkg_conf_load: Could not create lock file /var/lock/opkg.lock: No such file or directory.
	Saving config files...
	killall: watchdog: no process killed
	Sending TERM to remaining processes ... hotplug2 lock
	Sending KILL to remaining processes ...
	Switching to ramdisk...
	Performing system upgrade...
	Unlocking firmware ...

	Writing from <stdin> to firmware ...
	Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...TRX header not found
	Error fixing up TRX header
'''''
turn off then turn on'''
	gets:

	''no web
	no telnet access
	no ping
	(bricked)''

'''emergency state then telnet + sysupgrade to squash-factory'''
	gets:

	''root@(none):/# sysupgrade http://192.168.1.100:8080/openwrt-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin
	Collected errors:
	 * opkg_conf_load: Could not create lock file /var/lock/opkg.lock: No such file or directory.
	Saving config files...
	killall: watchdog: no process killed
	Sending TERM to remaining processes ... hotplug2 lock
	Sending KILL to remaining processes ...
	Switching to ramdisk...
	Performing system upgrade...
	Unlocking firmware ...

	Writing from <stdin> to firmware ...
	Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...TRX header not found
	Error fixing up TRX header''

'''turn off then turn on'''
	gets:

	''no web
	no telnet access
	no ping
	(bricked)''
	


'''
== FIRMWARE UPGRADE WITH IMAGES COMPILED WHEN I GET sysupgrade images size <= 3.585kB =='''


'''emergency state then telnet + sysupgrade to squash-factory'''
	gets:

''	root@(none):/# sysupgrade http://192.168.1.100:8080/openwrt-ar71xx-generic-tl-wr841nd-v7-squashfs-factory.bin
	Collected errors:
	 * opkg_conf_load: Could not create lock file /var/lock/opkg.lock: No such file or directory.
	Saving config files...
	killall: watchdog: no process killed
	Sending TERM to remaining processes ... hotplug2 lock
	Sending KILL to remaining processes ...
	Switching to ramdisk...
	Performing system upgrade...
	Unlocking firmware ...

	Writing from <stdin> to firmware ...
	Appending jffs2 data from /tmp/sysupgrade.tgz to firmware...TRX header not found
	Error fixing up TRX header

	Writing from <stdin> to firmware ...  [w]''
'''
''OK web access!!!'''''
	from system log:
	''Sep  8 15:44:07 OpenWrt kern.warn kernel: [    8.850000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
	Sep  8 15:44:07 OpenWrt kern.warn kernel: [    8.860000] jffs2_build_filesystem(): unlocking the mtd device... done.
	Sep  8 15:44:07 OpenWrt kern.warn kernel: [    8.860000] jffs2_build_filesystem(): erasing all blocks after the end marker... done.
	Sep  8 15:44:07 OpenWrt kern.notice kernel: [   12.260000] JFFS2 notice: (413) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
''


'''
== FIRMWARE UPGRADE WITH IMAGES COMPILED WHEN I GET sysupgrade images size = 3.777kB, 3.713kB, 3.649kB =='''


'''web firmware upgrade to squash-sysupgrade (do not keep settings)'''
	gets:

	'''''OK web access!!!'''
	seems working
	from system log:	
	Sep  8 15:44:24 OpenWrt kern.err kernel: [   34.230000] jffs2: Too few erase blocks (3) 
	Sep  8 15:44:24 OpenWrt user.info sysinit: mount: mounting /dev/mtdblock3 on /rom/overlay failed: Invalid argument

	from kernel log:
	for 3.649kB sysupgrade compiled images
	[   34.230000] jffs2: Too few erase blocks (4)

	for 3.713kB sysupgrade compiled images
	[   34.230000] jffs2: Too few erase blocks (3)

	for 3.777kB sysupgrade compiled images	
	[   34.230000] jffs2: Too few erase blocks (2)''


'''perform e reset to defaults'''
	gets:
	
''	no web
	no telnet access
	no ping
	(bricked)''

Attachments (0)

Change History (14)

comment:1 Changed 5 years ago by jow

  • Owner changed from developers to juhosg
  • Status changed from new to assigned

comment:2 Changed 5 years ago by almursi

Hi, I can confirm it over r30850 and MR3220 (however, on trunk/files I put my configuration and it is not a problem, but any configuration change need a new compiling...).

comment:3 Changed 5 years ago by xiangfu@…

Hi, I can confirm it over r30834 on TP-LINK WR703N more info:

root@OpenWrt:/# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=14760k)
tmpfs on /dev type tmpfs (rw,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,noatime,mode=600)
root on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/tmp/root)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
none on /proc/bus/usb type usbfs (rw,relatime)
root@OpenWrt:/# mount /dev/mtdblock3 /mnt -t jffs2
[ 64.420000] jffs2: Too few erase blocks (4)
mount: mounting /dev/mtdblock3 on /mnt failed: Invalid argument

comment:4 Changed 5 years ago by xiangfu@…

By google. it says there are at least 5 erase blcok for /dev/mtdblock3. now I am try to exclude some package and compile again...

comment:5 follow-up: Changed 4 years ago by Israel Miranda <israelnogueiramiranda@…>

I used to use and old version of openwrt on a tplink TL-WR740N v1 and it used to work fine!
Do you know of a known stable revision that works all right ?

comment:6 in reply to: ↑ 5 Changed 4 years ago by xiangfu@…

Replying to Israel Miranda <israelnogueiramiranda@…>:

I used to use and old version of openwrt on a tplink TL-WR740N v1 and it used to work fine!
Do you know of a known stable revision that works all right ?

Hi
My problem is that I include too many packages. make the Image size > 4MB. there is nothing wrong with the source code. (r30834)

comment:7 Changed 4 years ago by Israel Miranda <israelnogueiramiranda@…>

I did a build with no packages at all!
I only selected the model and router, and with no installed packages, but the size of the firmware size is
3,932,160 for factory.bin and
2,949,124 for sysupgrade.bin

I will try a backfire build and post the result later.
Thanks!

comment:8 Changed 4 years ago by anonymous

I have that issue too.
Model: TP-LINK tl-wr841nd-v7
Version: last AA(rev. 36276)

comment:9 Changed 4 years ago by jow

  • Resolution set to invalid
  • Status changed from assigned to closed

I find nothing in this ticket that indicates an actual problem, therfore I am going to close it as invalid.

comment:10 Changed 3 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened

I got this bug. I have an image, do sysupgrade and got brick. In failsafe mod i got an error "mount: mounting /dev/mtdblock3 on /overlay failed: Invalid argument" when try to run "firstboot".

TP-LINK tl-wr841nd-v7
Last AA.

comment:11 Changed 3 years ago by anonymous

TP-LINK TL-WA901ND v2 has same problem...

comment:12 Changed 3 years ago by jow

  • Resolution set to too_vague
  • Status changed from reopened to closed

It is not even clear what "this bug" is, the original issue was due to a too big rootfs which is a problem we cannot fix, just include less stuff.

comment:13 Changed 3 years ago by Jacobo Pantoja

Dear jow,

I think that the problem is that the compilation runs fine, but then the actual result is that the overlay partition is not mounted because of the error (jffs2: Too few erase blocks). Is there any way to prevent this? I mean, compile with a warning or similar. Take into account that, as the overlay is not mounted, the router is in vanilla state (i.e. as first boot); WiFi is disabled, WAN is firewalled and LAN is set as DHCP server, so in a great bunch of scenarios this situation is equivalent to a brick, requiring physical access to the device and so on.

Thanks for your support!!

comment:14 Changed 2 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.