Readonly files on openwrt

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?

"kernel": "4.19.205",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 0 (v8l)",
"model": "MediaTek evb6890v1_64_cpe_nand",
"board_name": "MediaTek generic board",
"release": {
"distribution": "OpenWrt",
"version": "19.07-SNAPSHOT",
"revision": "r0-8aa46fc",
"target": "mt6890/evb6890v1_64_cpe_nand",
"description": "OpenWrt 19.07-SNAPSHOT r0-8aa46fc"

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.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. 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.

1 Like

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.

1 Like

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.

1 Like

Is there a way to edit the /rom section? It's currently giving the error message "ready only system file".

ROM is, by definition, not writable. It is read only memory. Attempting to modify it may seriously damage the device.

You will need to reach out to the vendor again to ask for support since they have produced a customized firmware for their device.

The modem's system files are there, but after editing them and restarting, they revert to their original state. What's the exact problem now?

We cannot know what the problem is because the firmware was not provided by the official openwrt project.

can you connect to my device with remote and see what is this problem ?

Did you read my message?????

I will pay you for these services

my overlay is empty

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.

Before manipulating the file in the /mnt/data/etc/ folder, everything was correct, but now it's messed up and I can't do anything.

This topic was automatically closed after 60 minutes. New replies are no longer allowed.