update_engine: Run backuptool script before normal postinstall script
* Check if the currently running /system has ever been mounted R/W.
If it has, we can assume that running backuptool_ab scripts won't
do anything catastrophic like break verity. Also this is a good
indicator that the partition has been messed with since the initial
installation of the rom (for instance if a gapps or su package had
been added).
* Mount the new target slot's /system partition at /postinstall R/W,
before the normal dex preopt script is run, and perform backuptool_ab
operations. This will allow retaining addon packages, similar to what
we've historically used in recovery flashes for non-A/B devices. This,
since it mounts the new /system R/W, will also ensure it gets triggered
again on the next flash.
* This assume that all backuptool operations are contained in /system
and that we won't ever screw around with retaining things on /vendor.
Change-Id: I00ca479ccc24080bf3457334a6c9e4c07dd20f45
1 file changed