Modify

Opened 3 years ago

Last modified 19 months ago

#18456 new defect

OpenWRT of DIR-645 does not run firstboot after flashing

Reported by: jchessman Owned by: developers
Priority: normal Milestone:
Component: base system Version: Barrier Breaker 14.07
Keywords: Cc:

Description

After flashing my DIR-645 I was able to configure all settings however on reboot/power loss those setting changes were lost. rayknight identifies the issue (see https://forum.openwrt.org/viewtopic.php?pid=256141#p256141) being firstboot not running on the first boot after flashing. I was able to confirm this by re-flashing the DIR-645, telnet'ing in and running firstboot. This allowed me to save the configuration across reboots.

Hardware: DIR-645
OpenWrt version: BARRIER BREAKER (14.07, r42625)

Attachments (0)

Change History (5)

comment:1 Changed 3 years ago by bentware

This is still an issue in CHAOS CALMER (15.05-rc1, r45695)

comment:2 Changed 3 years ago by anonymous

Based on forum discussion there may be something wrong with the image generation or with the image handling / end detection at the boot after flashing. The initial "factory" image fails at the first boot to detect the end of the squashfs firmware, and does not generate the proper jffs2 partition.

[   54.260000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x003f0024: 0x6ac0 instead
[   54.270000] jffs2: Further such events for this erase block will not be printed
[   54.330000] jffs2: Old JFFS2 bitmask found at 0x003f2d88
[   54.340000] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[   54.640000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes

Manually running jffs2reset (=firstboot) then fixes things. Apparently it is bypasses the partition end code market search and just overwrites things. (based on partition sizes in mtd?)

This might be related to seama-header in DIR-645. It is one of the few devices with that header. Possibly the uci-defaults script does not run properly?
https://dev.openwrt.org/browser/trunk/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
The uci-defaults script runs in practice the command "mtd fixseama kernel". One of you with the problem might try flashing again with the factory image and try running that command after the boot. What errors do pop up?

This might be related to r45896, which fixed endianness detection for trx code in mtd. Might seama code in mtd have a similar endianness detection problem? seama.c uses both BYTE_ORDER and BIG_ENDIAN, but does not include <endian.h>. Adding that fixed things for trx.c.
https://dev.openwrt.org/browser/trunk/package/system/mtd/src/seama.c#L25

comment:3 Changed 2 years ago by tarpoon@…

I have the same issue using CHAOS CALMER (15.05, r46767). Though running jffs2reset via telnet didn't fix it for me.

root@OpenWrt:/# jffs2reset
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock8 is not mounted
/dev/mtdblock8 will be erased on next mount

comment:4 Changed 20 months ago by Vandelsand

This is still an issue for me, even doing the first boot stuff it doesn't solve it.

comment:5 Changed 19 months ago by mhowison

I had the same issue as @tarpoon using 15.05.1:

root@OpenWrt:/# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock8 is not mounted
/dev/mtdblock8 will be erased on next mount

However, after a reboot I tried doing this instead as suggested by @anonymous:

root@OpenWrt:/# mtd fixseama kernel
Trying to fix SEAMA header in kernel at 0x0...
the header is fixed already
root@OpenWrt:/# jffs2reset
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock8 is mounted as /overlay, only erasing files

This fixed the issue and allowed me to retain my configuration after a subsequent reboot.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.