+29
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
snapuserd is used as a user-space block device implementation during Virtual A/B Compression-enabled updates. It has to be started in first-stage init, so that updated partitions can be mounted. Once init reaches second-stage, and sepolicy is loaded, we want to re-launch snapuserd at the correct privilege level. We accomplish this by rebuilding the device-mapper tables of each block device, which allows us to re-bind the kernel driver to a new instance of snapuserd. After this, the old daemon can be shut down. Ideally this transition happens as soon as possible, before any .rc scripts are run. This minimizes the amount of time the original snapuserd is running, as well as any ambiguity about which instance of snapuserd is the correct one. The original daemon is sent a SIGTERM signal once the transition is complete. The pid is stored in an environment variable to make this possible (these details are implemented in libsnapshot). Bug: 168259959 Test: manual test Change-Id: Ife9518e502ce02f11ec54e7f3e6adc6f04d94133