libsnapshot: Move snapshot metadata to super partition.
snapshot metadata files are stored in /metadata. This means, we cannot
wipe after installing any update.
This patch does the following:
1: Create a scratch space in super partition. The scratch space for ota
metadata is just about 1MB.
2: Create ext4 filesystem on top of scratch block device.
3: Mount the scratch on /mnt/scratch_super
4: When snapshot-manager instance is created, point the /mnt/scratch/ota
to metadata_dir_ so that all the snapshot files are stored in the new
path.
All the logic of OTA remains the same. This flow is enabled only on userdebug builds for now and the only consumer would be snapshotctl
$snapshotctl apply-update /data/nbd/ -w
During init, we would have to mount the scratch partition to detect
if there is any pending updates.
With this, we would now be able to wipe the device along with the update flow. This will help incremental flashing wherein we would end up saving ~35-40 seconds on Pixel devices.
With this flow, the end-to-end update for incremental builds takes
~20-30 seconds.
Bug: 330744468
Test: Pixel 6 incremental flashing with wipe, Full OTA, vts_libsnapshot
Change-Id: Iac6ce2cf37b70ea221cd18175c8962988d03d95b
Signed-off-by: Akilesh Kailash <akailash@google.com>
16 files changed