Basics of software updates
Updating software seems, at first sight, to be a simple task: you just need to overwrite some files with new copies. But then your engineer training kicks in as you begin to realize all the things that could go wrong. What if the power goes down during the update? What if a bug missed during testing of the update renders a percentage of the devices unbootable? What if a third party sends a fake update that enlists your device as part of a botnet? At the very least, the software update mechanism must be:
- Robust so that an update does not render the device unusable.
- Fail-safe so that there is a fallback mode if all else fails.
- Secure to prevent the device from being hijacked by people installing unauthorized updates.
In other words, we need a system that is not susceptible to Murphy’s law. Murphy’s law states that if something can go wrong, then it eventually will go wrong. Some of these problems are non-trivial...