Is it possible to accommodate a rootfs reset on the device to bring it back to the original state when the image was originally flashed? Kinda like a factory reset function to wipe out any custom modifications the user made. Obviously, we can do this by reflashing the image, but we would like to implement this on the device.
Our device uses iMX8MNANO and we use yocto to build the image. Thank you.
Yes. You could store the backup image in another storage device or another partition. So you could restore the image on the device.
Okay. We don't have another storage device, but we have plenty of space on our mmc flash. Could you please provide instructions or documentation on how we could store another image and trigger the reload of this image? Thanks!
You may take this for reference.
@jimmychan the link you provided is in regards to OTA (software update over-the-air). I am asking for the recommended way to reset the rootfs to the original image state. This is something done locally and doesn't require software update or network connection to that matter. Similar to how most Linux devices offer factory reset.
I think you could simply store the backup rootfs image in a backup partition. And then run a script that contain linux commands for formatting the rootfs partition, and extract a .tar.gz rootfs image file to there.
That could work. Could you please provide the instructions for how you would implement this? This is a common use case and clear instructions would be very helpful. Thank you.
The linux commands like "fdisk" for creating partition, "mkfs.ext4" for formatting, "tar" for extracting the compressed file and etc. You may refer to the Linux User's guide (https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf) for more details.