Fix mounting /data on Virtual A/B devices without metadata encryption.
When using partitions backed by /data, for example during a Virtual A/B merge or "adb remount" on a Virtual A/B device, the userdata block device is seen as in-use when /data mounts in second-stage init. This subsequently prevents mount() or e2fsck from working. Metadata-encrypted devices are not affected, because dm-default-key provides a wrapping block device that can be used exclusively. This patch addresses the problem by detecting when userdata has device-mapper dependencies. If it does, and the device is not metadata-encrypted, we introduce a dm-linear wrapper around userdata. It is created on demand, but like logical partitions, it exists until the device reboots. Bug: 134949511 Test: adb remount, cuttlefish boots Change-Id: Ifbfea1591a6e58978fdaffd6ef889afabd10e270
Loading
Please register or sign in to comment