1

https://source.android.com/docs/core/ota/dynamic_partitions/implement

The supported dynamic partitions are:
System
Vendor Product
System Ext
ODM
Note: Avoid placing userdata or any other permanent read-write partition inside super.

According to the source.android.com documentation, userdata is not dynamically partitioned?

version: Android 10

s:/ $ ls -l /dev/block/mapper/
total 0
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 odm -> /dev/block/dm-3
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 odm-verity -> /dev/block/dm-7
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 product -> /dev/block/dm-1
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 product-verity -> /dev/block/dm-5
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 system -> /dev/block/dm-0
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 system-verity -> /dev/block/dm-4
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 userdata -> /dev/block/dm-8
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 vendor -> /dev/block/dm-2
lrwxrwxrwx 1 root root 15 1970-04-02 04:41 vendor-verity -> /dev/block/dm-6

s:/ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/block/dm-4 3.8G 3.8G 0 100% / tmpfs 3.7G 1.1M 3.7G 1% /dev tmpfs 3.7G 0 3.7G 0% /mnt tmpfs 3.7G 0 3.7G 0% /apex /dev/block/dm-5 450M 449M 0 100% /product /dev/block/dm-6 2.3G 2.3G 0 100% /vendor /dev/block/dm-7 118M 900K 115M 1% /odm none 3.7G 0 3.7G 0% /sys/fs/cgroup /dev/block/sda29 356M 3.3M 341M 1% /cache /dev/block/sda13 4.9M 160K 4.8M 4% /dev/logfs /dev/block/sda31 976M 862M 87M 91% /cust /dev/block/dm-8 226G 100G 126G 45% /data ...

hrdom
  • 13
  • 3

1 Answers1

0

Roughly speaking, /dev/block/mapper/userdata partition is by the /dev/block/by name/userdata partition map. Through an encryption or decryption mechanism. It should encrypt or decrypt the original userdata partition using the key in the metadata partition to get a partition like dm-x.
I haven't looked too closely into the details.

Note that we make an exception for metadata-encrypted devices, since dm-default-key is already a wrapper.

https://cs.android.com/android/platform/superproject/+/master:system/core/fs_mgr/fs_mgr.cpp

static bool create_crypto_blk_dev(const std::string& dm_name, uint64_t nr_sec,
                                  const std::string& target_type, const KeyBuffer& crypt_params,
                                  std::string* crypto_blkdev)
bool fscrypt_mount_metadata_encrypted(const std::string& blk_device, const std::string& mount_point,
                                  bool needs_encrypt) {

https://cs.android.com/android/platform/superproject/+/master:system/vold/MetadataCrypt.cpp

hrdom
  • 13
  • 3