We are trying to implement a factory reset for our customers to flash their boards with a standard image that we provide.
The way it should work is this: a USB stick gets connected to the carrier board, the board gets powered on and with a little bit of ‘magic’ a new image gets installed from the USB stick.
The idea as to how that little bit of ‘magic’ should work is this:
Easy installer is on the USB stick and boots on startup
A TEZI image with the application gets installed (in the Image.json file autoinstall = true)
The question is: is this a good solution to do a factory reset? Are there any better ways? Our carrier board has only an USB port, no display port and no serial port. We want to use the factory reset on the colibri iMX6ULL and colibri iMX8X modules.
I’ve run some tests with an iMX6ULL module on an Iris board where I have a USB stick with TEZI (5.7.3) installed and also an image on the stick. I use a terminal, load TEZI at the u-boot command (run bootcmd_usb0) and get the easy installer running. Using a display and mouse I can select the image from the USB. But when it starts it comes up with the error: “Erasing flash failed, flash_erase: error!: /dev/, error 21 (is a directory)”. It seems that some variable points to /dev instead of the flash.
If I connect our image server, start TEZI from the USB stick and select an image from the server I get the same error. When I load TEZI form the PC via recovery mode it works fine. I can select an image from the server, flash gets erased and image installed. Can you point me in the right direction?
We recommend using a specialized Over-The-Air (OTA) solution for system updates. While it’s termed ‘Over-The-Air’, it still facilitates secure offline updates.
Thanks for the reply. We use Mender to update the rootfs and the application but we also have to provide our customer the possibility to do a factory reset.
Whilst updates of rootfs and application keep some settings like IP addresses, logs and application configuration a factory reset should put the system in its initial state the way it was when it came out of the ‘factory’. Ideally we want to repartition the flash and install a clean rootfs and application. As stated in my post this should be done via USB.
From what I’ve seen the OTA solutions you mention can’t do that. Or did I miss something?
Certainly, you can utilize the suggested scheme to reset your device. The primary prerequisite is that it should have a properly functioning U-Boot. Once that’s in place, you can enable distro boot to launch TEZI from a USB stick. Subsequently, TEZI can flash a new image from the same USB stick. However, if U-Boot becomes corrupted, your sole option would be to load TEZI via USB OTG in recovery mode.
You can create such a “clean” TorizonCore image with TorizonCore Builder. You can manipulate the rootfs with the filesystem changes in order to reset modified configurations and you can have a service that could be triggered once after the update to perform some file removals and check for the “factory state” of your files.
We have Online and Offline Secure Updates. So you can perform unattended Online and Offline updates. The Offline update can be performed by downloading the update payload (lockbox) to some external media on your computer and simply plugging it into your module. We have documentation and webinars about this: