OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Kernel
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Polynomdivision - 05.08.2020

FS#3272 - jffs2 will erase on every reboot the rootfs_data partition

I wanted to add support fpr the Nanobeam AC Gen2. https://github.com/openwrt/openwrt/pull/3266

Everything works with trunk compiled with 4.19. Switching to 5.4 seems to not correctly unlock the flash. OpenWrt finds “End of filesystem marker found at 0×0” after a reboot and erases the flash again.

First Boot

Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
mount_root: jffs2 not ready yet, using temporary tmpfs overlay
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device...
jffs2_build_filesystem(): erasing all blocks after the end marker...
jffs2: Newly-erased block contained word 0x0 at offset 0x00420000
jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00410000
jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x003f0000
jffs2: Newly-erased block contained word 0xb3aedd63 at offset 0x003e0000
jffs2: Newly-erased block contained word 0xd31704ef at offset 0x003d0000
jffs2: Newly-erased block contained word 0x756c245f at offset 0x003c0000
jffs2: Newly-erased block contained word 0x672c1aa9 at offset 0x003b0000
jffs2: Newly-erased block contained word 0xb59345ff at offset 0x003a0000
jffs2: Newly-erased block contained word 0x45e1dc8b at offset 0x00390000
jffs2: Newly-erased block contained word 0x9e92aeea at offset 0x00380000
jffs2: Newly-erased block contained word 0xf9d35c83 at offset 0x00370000
jffs2: Newly-erased block contained word 0xc2075909 at offset 0x00360000
jffs2: Newly-erased block contained word 0x87facdde at offset 0x00350000
jffs2: Newly-erased block contained word 0x65c65c73 at offset 0x00340000
jffs2: notice: (1466) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
mount_root: failed to sync jffs2 overlay

Full Log

Reboot

Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00340000: 0x65c6 instead
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00360024: 0x02b5 instead
...
jffs2: Further such events for this erase block will not be printed
jffs2: Old JFFS2 bitmask found at 0x00369840
jffs2: You cannot use older JFFS2 filesystems with newer kernels
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00370000: 0xf9d3 instead
...
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00390024: 0x3669 instead
jffs2: Further such events for this erase block will not be printed
jffs2: Old JFFS2 bitmask found at 0x00395294
jffs2: You cannot use older JFFS2 filesystems with newer kernels
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003a0000: 0xb593 instead
...
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003e0024: 0x79a9 instead
jffs2: Further such events for this erase block will not be printed
jffs2: Empty flash at 0x003e1e98 ends at 0x003e2000
jffs2: Empty flash at 0x003e2004 ends at 0x003e4000
jffs2_scan_eraseblock(): End of filesystem marker found at 0x3f0000
jffs2_build_filesystem(): unlocking the mtd device...
jffs2_build_filesystem(): erasing all blocks after the end marker...
jffs2: Newly-erased block contained word 0x0 at offset 0x00420000
jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x00410000
jffs2: Newly-erased block contained word 0xdeadc0de at offset 0x003f0000
jffs2: Newly-erased block contained word 0xb3aedd63 at offset 0x003e0000
jffs2: Newly-erased block contained word 0xd31704ef at offset 0x003d0000
jffs2: Newly-erased block contained word 0x756c245f at offset 0x003c0000
jffs2: Newly-erased block contained word 0x672c1aa9 at offset 0x003b0000
jffs2: Newly-erased block contained word 0xb59345ff at offset 0x003a0000
jffs2: Newly-erased block contained word 0x45e1dc8b at offset 0x00390000
jffs2: Newly-erased block contained word 0x9e92aeea at offset 0x00380000
jffs2: Newly-erased block contained word 0xf9d35c83 at offset 0x00370000
jffs2: Newly-erased block contained word 0xc2075909 at offset 0x00360000
jffs2: Newly-erased block contained word 0x87facdde at offset 0x00350000
jffs2: Newly-erased block contained word 0x65c65c73 at offset 0x00340000
jffs2: notice: (500) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
mount_root: switching to jffs2 overlay

Full Log

Probably Related Issues - Patch for disabling software protection - SPI Nor Driver - [[https://dev.archive.openwrt.org/ticket/20982|jffs2-error / nanostation M5 xw / r47658]

Some Infos - NOR
- Flash Chip Supports 4K erases in addition to 64K
-

Layout AirOS 8.7

WA# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00100000 00010000 "kernel"
mtd3: 00e60000 00010000 "rootfs"
mtd4: 00040000 00010000 "cfg"
mtd5: 00010000 00010000 "EEPROM"

MTD 4.19

dev:    size   erasesize  name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00f60000 00010000 "firmware"
mtd3: 001c0000 00010000 "kernel"
mtd4: 00da0000 00010000 "rootfs"
mtd5: 00b30000 00010000 "rootfs_data"
mtd6: 00040000 00010000 "cfg"
mtd7: 00010000 00010000 "art"

MTD 5.4 TODO

Polynomdivision commented on 05.08.2020 08:17

Sry, I did not know that I can not edit the task anymore after publishing it.

With "Switching to 5.4 seems to not correctly unlock the flash.", I mean unlock the mtd device.

Polynomdivision commented on 05.08.2020 09:09

I just went from 4.19 to 5.4 without doing "-n" option of a sysupgrade, and it seems to work fine.

Polynomdivision commented on 05.08.2020 09:23

4.14 works also fine. (19.07)

Polynomdivision commented on 05.08.2020 09:43

I compiled 5.4 image and flashed the factory with the fwupdate.real (AirOS) procedure u can find here : https://openwrt.org/toh/ubiquiti/common Afterwards I did a sysupgrade with the sysupgrade-image to be sure. After setting a root password and doing a reboot, I was not able to login anymore (probably corruption of the data partition).

So I compiled 4.19 image. AirOs 8.7 → 4.19 factory → 4.19 sysupgrade
This worked.

Now I did
4.19 → 5.4 without "-n" option, so I saved the config files. For now everything works fine.

Polynomdivision commented on 05.08.2020 10:01

On the OpenWrt Page of the Lightbeam AC Gen2 some similar issue is described:
The Lightbeam has the same flash: mx25l12805d and a similar soc: Atheros AR9342-BL1A

"The above upgrade procedure left the filesystem in a slightly damaged state (i.e. changes are lost after reboot). This is indicated by kernel messages (dmesg) related to jffs2_scan_eraseblock. Another firmware upgrade fixes this."
But this happens only after dd the image directly from airos to the device.
https://openwrt.org/toh/ubiquiti/litebeam_5ac_gen2

I believe the Lightbeam AC Gen2 will have the same problems I have with 5.4 kernel.
Can someone test that on a lightbeam ac gen2?

Polynomdivision commented on 05.08.2020 10:03

This issue could be related since it is the same flash chip: mx25l12805d
https://bugs.openwrt.org/index.php?do=details&task_id=1547

Polynomdivision commented on 03.09.2020 09:47

The bug was reproduced on

  • LiteBeam AC Gen2
  • Nanobeam AC Gen2
  • Nanostation AC Loco

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing