platform_system_core/fs_mgr
Bowgo Tsai 5ee7dae840 Adds /dev/block/by-name/<partition> symlinks
During uevent processing, some "by-name" symlinks will be created.
    /dev/block/<type>/<device>/by-name/<partition>

<type> can be: platform, pci or vbd.
<device> might be: soc.0/f9824900.sdhci, soc.0/f9824900.sdhci, etc.
<partition> might be: system, vendor, system_a, system_b, etc.

e.g., on a non-A/B device:
    /dev/block/platform/soc.0/f9824900.sdhci/by-name/system
    /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor

On a A/B device:
    /dev/block/platform/soc/1da4000.ufshc/by-name/system_a
    /dev/block/platform/soc/1da4000.ufshc/by-name/system_b
    /dev/block/platform/soc/1da4000.ufshc/by-name/vendor_a
    /dev/block/platform/soc/1da4000.ufshc/by-name/vendor_b

However, those symlinks are "device-specific".

This change adds the "generic" symlinks in ueventd, in addition to
the existing symlinks, when the possible "boot devices" are specified
in device tree. e.g.,

    &firmware_android {
	compatible = "android,firmware";
	boot_devices ="soc/1da4000.ufshc,soc.0/f9824900.sdhci";
    }

The following symlinks will then be created on the aforementioned non-A/B
and A/B devices, respectively.

    /dev/block/by-name/system
    /dev/block/by-name/vendor

    /dev/block/by-name/system_a
    /dev/block/by-name/system_b
    /dev/block/by-name/vendor_a
    /dev/block/by-name/vendor_b

Note that both <type> and <device> are skipped in the newly create symlinks.
It assumes there is no more than one devices with the same <partition>,
which is the assumption of current first stage mount flow.

Finally, when 'boot_devices' in DT is absent, it fallbacks to extract
'boot_devices' from fstab settings. e.g., using 'soc/1da4000.ufshc',
'soc.0/f9824900.sdhci' for a fstab with the following content:

   /dev/block/platform/soc/1da4000.ufshc/by-name/system
   /dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor

Bug: 78613232
Test: adb shell ls /dev/block/by-name
Change-Id: Iec920b5a72409b6a2bdbeeb290f0a3acd2046b5d
Merged-In: Iec920b5a72409b6a2bdbeeb290f0a3acd2046b5d
(cherry picked from commit 8eec38f4e4)
2018-05-19 09:31:35 +08:00
..
include Merge "fs_mgr: removing __BEGIN_DECLS and __END_DECLS" 2017-10-11 01:53:35 +00:00
include_fstab/fstab Adds /dev/block/by-name/<partition> symlinks 2018-05-19 09:31:35 +08:00
.clang-format Fix-up coding style 2017-02-18 12:33:36 +08:00
Android.bp first stage mount: support mount points like /vendor/abc 2017-12-14 09:48:26 +08:00
OWNERS Add OWNERS. 2017-12-07 13:30:03 -08:00
fs_mgr.cpp Use vold's mount with metadata encryption service. 2018-02-01 14:54:04 -08:00
fs_mgr_avb.cpp Merge "fs_mgr: Adding logs when failing to wait for a device file" 2017-07-06 04:19:00 +00:00
fs_mgr_avb_ops.cpp fs_mgr: Adding logs when failing to wait for a device file 2017-07-06 09:51:02 +08:00
fs_mgr_boot_config.cpp Allow the use of a custom Android DT directory 2017-07-28 11:10:48 +08:00
fs_mgr_dm_ioctl.cpp Fix-up coding style 2017-02-18 12:33:36 +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 Adds /dev/block/by-name/<partition> symlinks 2018-05-19 09:31:35 +08:00
fs_mgr_priv.h Fix FDE 2018-04-16 12:58:14 -07:00
fs_mgr_priv_avb_ops.h fs_mgr: Update for new libavb API. 2017-05-15 12:04:18 -04:00
fs_mgr_priv_boot_config.h Allow the use of a custom Android DT directory 2017-07-28 11:10:48 +08:00
fs_mgr_priv_dm_ioctl.h Fix-up coding style 2017-02-18 12:33:36 +08: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 Merge "DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back" 2017-11-13 16:36:34 +00:00
fs_mgr_verity.cpp fs_mgr: removing is_device_secure() 2017-10-13 06:34:12 +08:00