platform_system_core/fs_mgr
David Anderson d25f1c3775 fastbootd: Support two super partitions for retrofit devices.
Retrofit devices will have two super partitions, spanning the A and B
slots separately. By design an OTA will never cause "A" or "B"
partitions to be assigned to the wrong super. However, the same is not
true of fastbootd, where it is possible to flash the inactive slot. We
do not want, for example, logical "system_a" flashing to super_b.

When interacting with partitions, fastbootd now extracts the slot suffix
from a GetSuperSlotSuffix() helper. On retrofit devices, if the partition
name has a slot, that slot will override FastbootDevice::GetCurrentSlot.
This forces partitions in the inactive slot to be assigned to the correct
super.

There are two consequences of this. First, partitions with no slot
suffix will default to the current slot. That means it is possible to
wind up with two "scratch" partitions, if "adb remount" is used on both
the "A" and "B" slots. However, only the active slot's "scratch" will be
visible to the user (either through adb or fastboot).

Second, if one slot does not have dynamic partitions, flashing will
default to fixed partitions. For example, if the A slot is logical and B
is not, flashing "system_a" will be logical and "system_b" will be
fixed. This works no matter which slot is active. We do not try to
upgrade the inactive slot to dynamic partitions.

Bug: 116802789
Test: fastboot set_active a
      fastboot flashall # dynamic partitions
      fastboot getvar is-logical:system_a # true
      fastboot getvar is-logical:system_b # false
      fastboot set_active b
      fastboot flashall --skip-secondary
      fastboot getvar is-logical:system_a # true
      fastboot getvar is-logical:system_b # true
      Booting both slots works.

Change-Id: Ib3c91944aaee1a96b2f5ad69c90e215bd6c5a2e8
2018-11-20 13:47:01 -08:00
..
include fs_mgr: remove by_name_symlinks_map_ from AvpOps 2018-11-13 11:37:36 -08:00
include_fstab/fstab fs_mgr: Support checkpoints 2018-09-20 17:28:23 -07:00
libdm Add noexcept to move constructors and assignment operators. 2018-10-05 16:43:47 +00:00
liblp fastbootd: Support two super partitions for retrofit devices. 2018-11-20 13:47:01 -08:00
tests fs_mgr: overlayfs: test: adding diagnostic value 2018-11-15 23:02:29 +00:00
tools Adding bow dm-target 2018-10-02 10:12:30 -07:00
.clang-format
Android.bp Mount vendor overlay from the system partition 2018-11-01 10:26:12 +09:00
fs_mgr.cpp fs_mgr: remove by_name_symlinks_map_ from AvpOps 2018-11-13 11:37:36 -08:00
fs_mgr_avb.cpp fs_mgr: remove by_name_symlinks_map_ from AvpOps 2018-11-13 11:37:36 -08:00
fs_mgr_avb_ops.cpp fs_mgr: remove by_name_symlinks_map_ from AvpOps 2018-11-13 11:37:36 -08:00
fs_mgr_boot_config.cpp fs_mgr: reorder getting boot config 2018-06-12 00:16:14 +08:00
fs_mgr_dm_linear.cpp init: Regenerate uevents for dependent super partition devices. 2018-11-05 17:53:49 -08:00
fs_mgr_format.cpp fastboot, fs_mgr: set fsverity feature bit 2018-04-06 10:18:21 -07:00
fs_mgr_fstab.cpp fs_mgr: enable DT fstab based on its status node appropriately 2018-11-06 10:44:51 -08:00
fs_mgr_overlayfs.cpp fs_mgr: overlayfs earlier kernels do not need override_creds=off 2018-11-07 11:05:18 -08:00
fs_mgr_priv.h fs_mgr: Allow overriding the super partition name via the kernel commandline. 2018-11-02 14:51:16 -07:00
fs_mgr_priv_avb_ops.h fs_mgr: remove by_name_symlinks_map_ from AvpOps 2018-11-13 11:37:36 -08:00
fs_mgr_priv_boot_config.h fs_mgr: fs_mgr_get_boot_config_from_kernel_cmdline deal with quote 2018-06-08 16:04:17 -07:00
fs_mgr_priv_sha.h fs_mgr_avb: refactors how vbmeta is loaded 2017-04-14 21:50:55 +08:00
fs_mgr_slotselect.cpp init/fs_mgr: prototype first-stage dm-linear support 2018-05-14 12:43:42 -07:00
fs_mgr_vendor_overlay.cpp fs_mgr: overlayfs earlier kernels do not need override_creds=off 2018-11-07 11:05:18 -08:00
fs_mgr_verity.cpp fs_mgr/init: use unique_ptr + CLO_EXEC for setmntent()/fopen() 2018-10-03 13:19:04 -07:00
OWNERS Add OWNERS. 2017-12-07 13:30:03 -08:00