I seem to have read somewhere something to this effect:
The portion of flash memory to which an image is flashed becomes "fixed" so that no package can be removed from it to free up space. If you
opkg remove
a package in such "fixed" portion, it is simply treated "as gone."
Is that true? (Sorry I don't have the technical vocabulary for "fixed" etc.) That was question 1.
Question 2. If that is true, what happens if you remove a package in the "fixed" portion, say nano, and install it again? Is nano in the "fixed" portion now treated "as back"? Or does it remain "as gone" while the "free" portion of flash memory gets a new copy of nano (so you end up with two copies of nano taking up space)?
Question 3. Does a config file included in the image also become part of the "fixed" portion of flash? This would mean that editing such a config file, say /etc/config/wireless, would result in the original version (in the "fixed" portion) being treated "as gone" while the "free" portion gets the amended version of /etc/config/wireless.
Question 4. Assuming yes to 3, what happens if, subsequent to editing /etc/config/wireless, you edit it again so that it reverts to the original contents? Do you end up with one copy in the "fixed" portion and another identical copy in the "free" portion of flash (identical as to contents I suppose as timestamp may be different)?
Question 5. If all packages and files included in an image are "immutable once flashed" as above (never gone even if treated as gone), is there a way to reset the router to the condition of the image (i.e. to the condition just after flashing)? At least LuCI's 'Backup / Flash Firmware' menu item does not seem to have a sub-item for such reset.
ADDENDA
For questions 1 through 4, while I appreciate replies providing the right vocabulary and explaining how the process works, I would also appreciate replies to take an individual question (above) and expressly telling me that I was right or wrong in what I expected to happen. Thanks.
To question 5, I believe this User Guide is relevant:
https://openwrt.org/docs/guide-user/troubleshooting/failsafe_and_factory_reset
The Factory Reset section of the Guide states, "A factory reset returns your router to the configuration it had just after flashing." Such flashing should include flashing with a custom made image including config files (which would then survive the reset)?