Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
openwrt-bot opened this issue Aug 5, 2020 · 9 comments
Closed
Labels

Comments

@openwrt-bot
Copy link

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

I wanted to add support fpr the Nanobeam AC Gen2. #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 0x0" 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

[[https://gist.githubusercontent.com/PolynomialDivision/1779cfd7126d9f5841063816b93d1324/raw/cd0e8d9fb1f955f9ee9ed8fd438ab2e307bad848/jffs2-firstboot|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

[[https://gist.githubusercontent.com/PolynomialDivision/47fc64fe5a9739576bec6faefa6cf459/raw/03ecbb18c5992a4d2891e4368fef49b7bbd857b9/jffs2-reboot|Full Log]]

Probably Related Issues

  • [[https://lists.openwrt.org/pipermail/openwrt-devel/2016-February/014119.html|Patch for disabling software protection]]
  • [[https://elixir.bootlin.com/linux/v5.4.51/source/drivers/mtd/spi-nor/spi-nor.c|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

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

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.

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

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

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

4.14 works also fine. (19.07)

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

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.

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

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?

@openwrt-bot
Copy link
Author

openwrt-bot commented Aug 5, 2020

PolynomialDivision:

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

@openwrt-bot
Copy link
Author

openwrt-bot commented Sep 3, 2020

PolynomialDivision:

The bug was reproduced on

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

@openwrt-bot
Copy link
Author

openwrt-bot commented Oct 25, 2020

PolynomialDivision:

Fixed with #3536.

@openwrt-bot
Copy link
Author

openwrt-bot commented Oct 25, 2020

adrianschmutzler:

Thanks for taking care, but this should only be closed when the PR is merged to master eventually, i.e. actually part of OpenWrt repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant