By adding global hooks (preinst/postinst files in a directory) we can enable several use cases: - Rollbacks : clients can use preinst to make snapshots that they can rollback to on postinst in case of errors - Drive GPIO lines to make memory readable
The return code from the global hook should be passed on to opkg. This will enable use cases were global hooks can be used to signal reboots. By passing the global hook return value to opkg, opkg caller can act on it.