No description
Find a file
Akilesh Kailash bcae6b5e60 libsnapshot_cow: Prepare device to boot from pre-created snapshots
Two new API's have been added:

1: BootFromSnapshotsWithoutSlotSwitch: This will create a new marker
which indicates first-stage init to mount the partitions off snapshots.

We need this marker as during boot, there are couple of places during
mounting snapshots wherein the marker is used. However, there is no
change in the existing I/O path related to OTA.

2: PrepareDeviceToBootWithoutSnapshot: This will delete the marker so
that subsequent reboot will not have the partitions mounted without the
snapshots.

VTS tests covers both these API's. Additionally, when these
markers are present, new OTA's cannot be installed. All these
are covered in VTS tests.

===========================================================

snapshotctl: General flow to apply and revert pre-created snapshots

1: To install the pre-created snapshots:

$snapshotctl map-snapshots <directory path containing snapshots patches>

Now the device is ready to boot from snapshots.

2: After device reboots, partitions are mounted off the snapshots. There
   is no snapshot-merge.

3: In order to go back to previous build:

$snapshotctl revert-snapshots

Now the device is ready to boot from base build.

4: After device reboots back to previous build, all the snapshot states
   and COW images are removed.

============================================

Additional commands:

To delete the pre-created snapshots:

$snapshotctl delete-snapshots

======================================

Tested it on Pixel 6 Pro between two builds which are ~24 hours apart.

1: Creating snapshots on a linux-host - ~4-6 seconds
2: Applying pre-created snapshots - ~10-15 seconds (includes intermediate
   transfer of patches to the device). This depends on the size of snapshot patches.
3: Device reboot - ~12-14 seconds.

Bug: 299011882
Test: 1: Apply pre-created snapshots
2: Reboot device: Verify new build
3: Apply OTA when partitions are mounted of snapshots and verify OTA
   fails.
3: Revert-snapshot and reboot.
4: Verify device goes back to base build.

Full OTA on Pixel. vts_libsnapshot_test

Change-Id: I36a72d973d8f70ae49773ebd45dd996fac22a4e3
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-09-08 23:09:45 -07:00
bootstat Remove references to the pdk product variable 2023-08-03 10:54:59 -07:00
cli-test [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
code_coverage Disable code_coverage.other for riscv64 2022-10-13 13:49:10 -07:00
debuggerd debuggerd: add socksetopt to seccomp policy 2023-09-05 19:29:13 +00:00
diagnose_usb Support building diagnose_usb against musl 2021-12-16 14:04:06 -08:00
fastboot Merge "Disallow fastboot to modify locked DSU" into main 2023-09-08 02:59:32 +00:00
fs_mgr libsnapshot_cow: Prepare device to boot from pre-created snapshots 2023-09-08 23:09:45 -07:00
gatekeeperd Check AServiceManager_isDeclared before AServiceManager_getService 2023-06-14 02:43:54 +00:00
healthd Migrate from android::String isEmpty to empty 2023-08-18 22:07:28 +00:00
include Remove include/backtrace symlink. 2020-10-20 12:46:14 -07:00
init Revert "Use Apex sepolicy if it's available" 2023-09-06 10:52:49 +10:00
janitors Add myself to janitor owners. 2022-12-02 12:50:43 -08:00
libappfuse [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
libasyncio Set min_sdk_version 2021-12-02 09:23:42 +09:00
libcrypto_utils Set min_sdk_version 2021-12-02 09:23:42 +09:00
libcutils Revert "Revert "Remove cutils threads.h header completely."" 2023-08-16 22:37:14 +00:00
libgrallocusage Make apex_available explicit 2022-02-09 11:37:19 -08:00
libkeyutils Make libfs_mgr dependencies vendor_ramdisk_available. 2021-07-23 16:50:06 -07:00
libmodprobe Merge "libmodprobe: LPM: Cleanup of redundant check" 2023-06-29 17:21:18 +00:00
libnetutils add 'nodad' support to ifc_add_address() 2023-06-30 16:36:21 +00:00
libpackagelistparser Promote HWASan tests to presubmit. 2022-06-17 22:18:49 +00:00
libprocessgroup libprocessgroup: optimize SetAttributeAction::ExecuteForProcess performance 2023-07-27 21:55:48 +00:00
libsparse Make simg2img host-only 2023-08-28 09:53:30 -07:00
libstats Add safety comments. 2023-07-21 19:13:48 +01:00
libsuspend libsuspend: vendor_available. 2021-11-02 13:52:40 -07:00
libsync Declare the headers of the ndk_library 2022-09-08 21:59:20 +00:00
libsystem Add COLOR_MODE_DISPLAY_BT2020 to graphics header. 2022-12-01 22:25:40 -08:00
libsysutils NetlinkEvent: trivial simplification. 2023-07-10 22:46:12 +00:00
libusbhost libusbhost: factor out frameworks descriptors -> byte[] code. 2022-01-24 13:35:20 -08:00
libutils Merge "Revert "Revert "Drop all path-related methods from android::String8""" into main 2023-09-08 19:59:48 +00:00
libvndksupport Replace #apex with #systemapi 2022-07-17 17:43:24 +09:00
llkd llkd: Disable in userdebug builds by default 2021-11-04 16:21:46 -07:00
mini_keyctl Merge "Make libmini_keyctl_static available in recovery" 2021-11-23 17:54:31 +00:00
mkbootfs mkbootfs: consistency. 2023-01-12 04:34:15 +00:00
property_service Remove dalvik.vm.usejitprofiles system property. 2022-11-25 12:27:37 +00:00
reboot [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
rootdir Only restart media.tuner when it's running 2023-09-08 04:19:34 +00:00
run-as [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
sdcard [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
shell_and_utilities Update shell_and_utilities docs for U. 2023-03-01 22:05:37 +00:00
storaged Added defaults for storaged fuzzers 2023-05-05 23:55:27 +00:00
toolbox Remove stray newline from err() call. 2023-09-07 19:30:31 +00:00
trusty Add UUIDs to profraw filenames 2023-08-18 09:43:15 +00:00
usbd usb: migration to USB gadget AIDL 2023-01-10 11:24:36 +08:00
watchdogd [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
.clang-format
.clang-format-2 Move clang-formats to build. 2019-01-18 14:26:33 -08:00
.clang-format-4 Move clang-formats to build. 2019-01-18 14:26:33 -08:00
.gitignore
CleanSpec.mk snapshotctl don't auto-merge. 2020-03-03 13:19:49 -08:00
METADATA Add METADATA to system/core: Apache2+BSD=NOTICE 2020-04-29 13:16:41 -07:00
MODULE_LICENSE_APACHE2
OWNERS Add bug component to system/core 2023-07-26 07:57:58 -07:00
PREUPLOAD.cfg Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00
rustfmt.toml Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00