I'm trying to implement function for firmware upgrade in an embedded linux system. Unlike most other embedded systems, the size of memory required for an embedded linux system is often larger. Take our system for example, the size of a complete firmware ( including kernel and ramdisk image. ) is about 5MB. I've tried both way, either
(1)Overwrite flash on the fly, without checksum. (2)Kill some processes,read it to allocated memory, do checksum,and upgrade.
For the first one, it is dangerous because possible link error or network failure. For the second one, I get OOM killer even after I've allocated memory and calculated checksum. Both of them are a little risky for me.
So here is the question: is there better design strategy for firmware upgrade for an embedded linux system?