I have an application that runs on an embedded Linux device and every now and then changes are made to the software and occasionally also to the root file system or even the installed kernel.
In the current update system the contents of the old application directory are simply deleted and the new files are copied over it. When changes to the root file system have been made the new files are delivered as part of the update and simply copied over the old ones.
Now, there are several problems with the current approach and I am looking for ways to improve the situation:
Requirements are:
dd
on the flash drive of the target?I absolutely need some way to do versioning of the root file system. This has to be done in a way, that I can compute some sort of diff
from it which can be used to update the rootfs of the target device.
I already looked into Subversion since we use that for our source code but that is inappropriate for the Linux root file system (file permissions, special files, etc.).
I've now created some shell scripts that can give me something similar to an svn diff
but I would really like to know if there already exists a working and tested solution for this.
Using such diff
's I guess an Upgrade would then simply become a package that contains incremental updates based on a known root file system state.
What are your thoughts and ideas on this? How would you implement such a system? I prefer a simple solution that can be implemented in not too much time.
It is vital that the software on an embedded system can be updated in an absolutely reliable way, as new features and fixes are added. On a Linux-based system, we can find in most cases the following elements: the boot loader.
A classic approach for updating the firmware of a running embedded system is by using a bootloader. Chip manufacturers often provide very simple pre-installed bootloaders, that can be used to update the partition images on a running system.
After a server for the updates has been chosen, the OS downloads a list where all package-version-numbers are contained. If the version-number is higher than the version installed, it should be upgraded. Packages contain references to other packages (dependencies) which will be checked.
SWUpdate: software update for embedded system. Update strategy examples. SWUpdate: syntax and tags with the default parser. Update images from verified source. Symmetrically Encrypted Update Images.
I believe you are looking wrong at the problem - any update which is non atomic (e.g. dd a file system image, replace files in a directory) is broken by design - if the power goes off in the middle of an update the system is a brick and for embedded system, power can go off in the middle of an upgrade.
I have written a white paper on how to correctly do upgrade/update on embedded Linux systems [1]. It was presented at OLS. You can find the paper here: https://www.kernel.org/doc/ols/2005/ols2005v1-pages-21-36.pdf
[1] Ben-Yossef, Gilad. "Building Murphy-compatible embedded Linux systems." Linux Symposium. 2005.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With