I need to develop/use a package manager for an embedded Linux system with the following properties:
- A master fully controls which packages need to be installed (the slave has no possibility to ask the master anything)
- Download speed on the device is slow that not just everything from the master distribution can be download to the target
- Upgrading/Downgrading of packages must be possible
- It should be possible to replace the package manager on the system itself
- Possibility to replace the operating system itself
- It's easily to recover from failures (power loss, ...), especially relevant when considering the two points above
- Locks on the slave which have to be deleted manually are by no means allowed
- If a new (meta?) package replaces an old (meta) package and there are some unneeded packages left, they're removed, to save space on the device
- Define some form of order or dependency to install packages
- Perhaps some form of a recovery system is need (how to detect that it is needed, how to boot it, ...)
Some points are just repeating other points, and some points are not necessarily something the package manager itself has to do.
I started to copy ideas from dpkg (especially how it install files and renames them later to reduce the time frame where something bad can happen) and use the deb format for packages itself (not using all of the fields).
I'm not sure myself, if this questions belongs to Programmers, but instead asking for a solution or anything like that, I'm more interested if other programmers faced the same problem and if there are any notable resources how this kind of problem is solved. Personally it happened to me too many times that embedded devices could be almost destroyed by a software update without any possibility (without special hardware) for recovery.
Some links that may be relevant for others are the following ones:
I could as well provide a pseudo code alike description for what I intend to do.