Hi, I have a 4G modem that after modifying a /mnt/data/etc/ file and rebooting it, any changes I make are reverted to the original state. It appears to be readonly and is getting the information from the /rom folder. Additionally, /proc/mtd also has mtd files available. What is the way to fix it?
It appears you are using firmware that is not from the official OpenWrt project.
When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.
Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).
If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.
The Chinese company is not providing any information or assistance in resolving the issue. Is the modem now in failsafe mode? Is there really no way to get it back to normal? Are the mtd files I have useless?
I have access to all of the modem's files. Even when I make changes to the manufacturer's files, they remain the same after a reboot. However, system changes such as mtk_netagent revert back to their original state after a reboot.
We cannot know what the vendor has done with their highly customized fork of OpenWrt. It is a black box as far as we are concerned. So we really have no way to help you because only the vendor/maintainer knows how that firmware should work.
Besides, it is also based on an old, eol, and unsupported version of OpenWrt.
In general, OpenWrt flash filesystems are built on the idea of r/o firmware image (as /rom ) and r/w overlay for changes (as /overlay/upper), and the overlayfs combines them into a single root "/" filesystem.
mtd files are not really files, but block level access to the flash contents. Not really for modifying anything.
If there is no writable flash (or not enough free space on the overlay partition), the overlay gets mapped into RAMdisk and its contents are lost in reboot.
Sounds like you are suffering from that.
It may be that the 4G modem manufacturer has wanted to prevent any changes by users. Or the small writable flash area might be full and gets mounted as readonly.
There is no easy cure unless you are familiar with manipulating Linux filesystems, including overlayfs. And if it is intentional by the OEM, likely no semi-hard cure either.
Please reach out to the vendor again or seek help in more appropriate places such as forums dedicated to the device you are using or sites that offer general network support.
The openwrt forums are here to support the official openwrt firmware and very closely related topics such as the community builds.