platform_system_core/fs_mgr
Sandeep Patil c20c0c2cdd early_mount: fs_mgr: move all fstab logic into fs_mgr
With init parsing fstab fragments from kernel separately, the fs_mgr
would completely miss the device tree entries. That leads to things like
'adb remount' to go through without warning for verity even if /system
is verified. This happens because 'verity_update_state' completely
misses the partitions passed to android through the device tree.

solution is to teach fs_mgr about device tree fstab entries and add 2
new public APIs.

1. fs_mgr_read_fstab_dt() - reads device tree and returns fstab
generated from it.

2. fs_mgr_read_fstab_default() - reads both device tree fstab and
/fstab.{ro.hardware} and returns the combined table.

This also reduces the hardcoded /fstab.{ro.hardware} occurence only to
fs_mgr and for eveyone who wants to read the "default" fstab must be
changed to call fs_mgr_read_fstab_default() instead. e.g. adb.

b/27805372

Test: Angler was used since it has 2 early mounted partitions instead of
one. 1 verified and 1 unverified.
- Boot angler successfully without early mount
- Boot angler successfully with /vendor early mount and test if 'adb
remount' warns us about verity
- Boot angler successfully with both /system and /vendor early mounted
and ensure 'adb remount' warns us about verity.
- check partitions.system.verified status after /system early mount ot
ensure it is set to VERITY_MODE_DEFAULT.
- 'adb disable-verity' with early mounted /system doesn't work due to
missing changes in adb

TODO:
change adb to use the new fs_mgr_read_fstab_default() API

Change-Id: I82038d87c7a44488e938acce2cc1082c08f6f73a
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-02-23 16:48:43 -08:00
..
include early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -08:00
.clang-format Fix-up coding style 2017-02-18 12:33:36 +08:00
Android.mk fs_mgr: add a generic fs_mgr_get_boot_config internal API 2017-02-22 12:58:15 -08:00
fs_mgr.cpp fs_mgr: make fs_mgr_setup_verity public API 2017-02-22 11:22:53 -08:00
fs_mgr_avb.cpp fs_mgr: add a generic fs_mgr_get_boot_config internal API 2017-02-22 12:58:15 -08:00
fs_mgr_avb_ops.cpp Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_avb_ops.h Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_boot_config.cpp early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -08:00
fs_mgr_dm_ioctl.cpp Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_format.cpp fs_mgr: Switch to LOG()/PLOG() defined in <android-base/logging.h> 2017-01-26 21:47:55 +08:00
fs_mgr_fstab.cpp early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -08:00
fs_mgr_main.cpp fs_mgr: Switch to LOG()/PLOG() defined in <android-base/logging.h> 2017-01-26 21:47:55 +08:00
fs_mgr_priv.h early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -08:00
fs_mgr_priv_avb.h Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_priv_boot_config.h early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -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 Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_slotselect.cpp fs_mgr: add a generic fs_mgr_get_boot_config internal API 2017-02-22 12:58:15 -08:00
fs_mgr_verity.cpp early_mount: fs_mgr: move all fstab logic into fs_mgr 2017-02-23 16:48:43 -08:00