Snapshot in RO mode?

Hello, I already have finished two Wifi roters to OpenWRT. The 3rd one WSR-1166DHP noticed me that I am still at the beginners level. I went throgh FAQ for my basic question, I could not find any answer, so I write here.
WSR-1166DHP should be OpenWRT'ed via web browser, and the steps have been reported more than 3 years ago. I followed that very carefully without success.
There are two major steps for OpenWRTing for WSR-1166DHP. First is to indroduce factory.bin (lede-ramips-mt7621-wsr-1166dhp-initramfs-factory.bin) via the baffalo's ROM. This could easily be cleared. The next step, ssh login the factory.bin (maybe a snapshot, it does not include Luci), then do sysupgrade -v target.bin. The target.bin was copied by rcp beforehand. The sysupgrade 'seems' successful, but the system reboot with the factory.bin again. Yes, no upgrade. What is strange to me is ssh login the factory.bin, then change the root password. The next reboot ignore the newly set root password. Yes, there is no root password again.
The factory.bin ROM is working in RO mode? This is the basic question of me. Any clue could be appreciated.

Initramfs images are running exclusively from memory (RAM), while they might allow accessing the onboard flash (for sysupgrade), they won't write to flash on their own (the overlay is kept in RAM as well, meaning it loses its contents by rebooting).

Thank you for the reply. So, initramfs can be used for sysupgrade? If so, what prevent me from upgrading to target.bin. More help please.

df -Th shows:
Filesystem Type Size Used Available Use% Mounted on
tmpfs tmpfs 61.0M 60.0K 60.9M 0% /tmp
tmpfs tmpfs 512.0K 0 512.0K 0% /dev

'/' seems not mounted is this okay?

It depends, only if it correctly defines the flash configuration in its DTS.

Seems take longer time to solve. Thank you anyway for your reply again.

  • Boot
  • Then flash with sysupgrade
  • Done.

I don't know what "target bin" you used. It should be this one:
http://downloads.openwrt.org/releases/18.06.4/targets/ramips/mt7621/openwrt-18.06.4-ramips-mt7621-wsr-1166-squashfs-sysupgrade.bin
The initramfs is intended to boot once. It knows how to place a sysupgrade file into the flash. Once you are running the final "sysupgrade" flash-based image you can save changes.

2 Likes

Thank you for your advice. I tried what mentioned and a bit older
lede-17.01.4-ramips-mt7621-wsr-1166-squashfs-sysupgrade.bin
In both cases:

Unlocking firmware ...

Writing from <stdin> to firmware ...     
Appending jffs2 data from /tmp/sysupgrade.tgz to firmware..
.File /tmp/sysupgrade.tgz does not exist
    
Upgrade completed
Rebooting system...
umount: can't unmount /dev/pts: Resource busy
umount: can't unmount /dev: Resource busy
umount: can't unmount /: Invalid argument

Then, after a while 1166DHP reboot with the Factory.bin. initramfs is designed for boot once? I already booted several times. Is there a way to 'initialize'?
The Factory bin is now a solid ROM for my 1166DHP.

Solved!
I found in a site that 'initialization' for the Factory.bin can be done with:
mtd erase firmware
The erase operation could be successfully applied and then I applied
sysupgrade -v target.bin
It worked. The source of the problem was after I initially installed Factory.bin (initramfs), I did sysupgrade for too new target.bin. The unsuccessful firmware was left and prevent the right (I mean acceptable) target.bin from correctly write to the firmware area.
If you might experience the similar situation in factory.bin ROM, try 'mtd erase firmware'.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.