Implementing firmware update
Are there any guides for implementing firmware update on ARM?
I'm trying to setup a headless linux system on one of those small ARM boards that have flooded the market recently. The board has NAND flash on it and is capable of booting from it directly. The board also has a removable HDD attached to it, and the linux (debian wheezy ARM) is going to be installed on the NAND.
What's the recommended setup for a system that supports a firmware upgrade?
Personally I had an idea to split the NAND into multiple partitions. The first partition will be the /boot partiton with kernel images. The second one is going to contain the root filesystem, the third will hold program settings (I wanted to mount the /etc folder on it), and the last one is going to contain a maintenance firmware.
The device automatically boots and uses the main root partition for normal operation. At first I wanted to perform a firmware upgrade from the root partition itself, but I figured it's not a good idea to overwrite the root partition while the system is using it. This is why I added a secondary maintenance OS.
The next question is how to make the device boot the maintenance OS. We could have the main OS modify the boot settings, so that the next time device boots it will bring up the special OS. The downside is that if the main OS becomes corrupted somehow, we'd have no way to signal the device to boot the maintenance OS. The device could also boot onto this special OS by having a user hold down a button (GPIO signal high/low) on early boot.
This OS would display a web interface where the user can upload new firmware, and overwrite the main partition with it. Then reboot. Since this maintenance image cannot be overwritten it's a fool-proof method to do firmware upgrades.
Ideas, comments, suggestions?