I have a Raspberry Pi CM4 with dfrobot mini routerboard and an Nanopi R4S.
Now the question isn't specifically related to the hardware.
Q- Both of them have a reset button. Initially when I downloaded the firmware, I had to make some custom changes in order for it to work in the way I want. Now, I know when I press the reset button it goes back to the factory setting meaning it would remove all of my configuration ?
If yes, what do I do to retain the configuration that works ? basically I do not want to start from step 0 rather I want to come back to be at step 2.
I am using the dfrobot image for raspberry pi and the friendlyelec image for nanopi r4s.
The reset button only works on squashfs based images (read-only rootfs + overlay on top, resetting means formatting the overlay), it has no function on ext4/ f2fs based images (fully writable, any change is persistent, without a known good state to return to).
That is the intention, the firmware can't know what you consider to be a known good state.
Nothing, it doesn't (and can't) work that way.
The alternative would be to save a configuration tarball (configuration, not user-installed packages) and store its for save keeping. On SBC like targets like this, you can also keep a known good sdhc card in storage and use that, if push come to shove.
Defaults can only be changed at build time, using the full buildroot or the image builder - probably more efforts than you want to spend right now, but the wiki has detailed instructions for either of these.