If those files are te correct size then no... Just note that most partitions are read-only and to restore them you need to install mtd-rw then load it modprobe mtd-rw i_want_a_brick=1 and only then will writing work.
the router I have is Zyxle LTE5398-M904 which is currently not supported by Openwrt (hope ported soon)
which has Openwrt based firmware
uname -a
Linux LTE5398-M904 3.10.14 #1 SMP Tue Jun 28 10:51:01 CST 2022 mips GNU/Linux
cat /etc/opkg.conf
src/gz barrier_breaker http://downloads.openwrt.org/snapshots/trunk/ramips/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
I have ssh access to the root user
but unfortunately I was unable to download any kernel modules
so my hands are tied.
I would like to understand how to make backup copies of the original firmware, in the hypothesis of executing the following commands (taken from a router very similar to the one I have)
I find the following commands:
nvram
Usage:
nvram get <section> <name>
Get a value from the section by name. It operates in cache.
nvram set <section> <name> <value>
Set a value into the section by name. It operates in cache.
nvram del <section> <name>
Delete an entry in the section by name. It operates in cache.
nvram commit
Flush cache into flash.
nvram layout
Display nvram sections layout.
nvram show [section]
Display all entries in nvram. Section name is optional.
nvram loadfile <section> <filename>
Load nvram entries from a file, and flush it into the partition's section.
nvram clear <section>
DANGEROUS! Clear all nvram entries to the partition inside flash.
root@LTE5398-M904:~# mt
mtd_write mtr
root@LTE5398-M904:~# mtd_write
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>
The device is in the format of mtdX (eg: mtd4) or its label.
mtd recognizes these commands:
unlock unlock the device
erase erase all data on device
write <imagefile>|- write <imagefile> (use - for stdin) to device
writeflash <imagefile> <n> <offset> <device> write <imagefile> to n bytes from offset of <device>
readflash <imagefile> <n> <offset> <device> read n bytes from offset of <device> to <imagefile>
erasesector <offset> <device> erase one sector from offset of <device>
Following options are available:
-q quiet mode (once: no [w] on writing,
twice: no status messages)
-r reboot after successful command
-e <device> erase <device> before executing the command
-v output writing info. (1 more -v would output HTML format.)
-o <num> file offset
-l <num> length in file
-w read after write action to check
Example: To write linux.trx to mtd4 labeled as linux and reboot afterwards
mtd -r write linux.trx linux
you can backup the Mtd's in real openwrt at lest later versions
you may have done this I can't tell
but presuming you have all the MTD's
if the factory format is the same as just a raw dump
then you may be able to craft the firmware to flash back
at lest the uboot / kernal part
but with NAND there is error correction and bad block management
if this charges it may not be easily able to put it back in a raw state
so unless you are intimate with the devices workings
it's hard to say how or if it would work it may need a device specific second layer
to handle bad blocks and partition locations in flash
it's better to find the OEM firmware files and factory recover modes to
return it back to operating conditions
at some point you many need to restore things like radio calibration data "ART"
but it's better to do this only if needed & a peace at a time
In any linux based system, you can read the contents of mtd partitions (and in your case, if you just concatenate the files you'll get the whole rom dump), so if you did everything correctly in the first post, you already have a backup.
Since you asked in OpenWrt forum, I incorrectly assumed that you are already running normal OpenWrt on the device.
Modern OpenWrt (19.07 and newer) versions for most targets use DTS (Device Tree) files to specify what hardware is available on the device, and this also includes MTD flash and partitions. Either way (using DTS or not), some partitions are intentionally marked as read-only so users don't overwrite them by mistake. To write to these you need kmod-mtd-rw - source on github, and OpenWrt provides it as a package.
You can always write to the flash chip using a dedicated external programmer hardware.
General note: having a router running some firmware "based on OpenWrt" doesn't help that much. It only means that the chip vendor used OpenWrt as a base (in your case version 14.07 - almost 10 years old at this point) and then added proprietary changes that we don't have access to unless someone sues them and requests GPL code or the vendor itself releases it. But if a similar device is supported and there are open or even upstream drivers, then it is not that much work to support it.