platform_system_core/fs_mgr
Yu Ning 6a38aa83b6 Allow the use of a custom Android DT directory
On platforms that use ACPI instead of Device Tree (DT), such as
Ranchu x86/x86_64, /proc/device-tree/firmware/android/ does not
exist. As a result, Android O is unable to mount /system, etc.
at the first stage of init:

 init: First stage mount skipped (missing/incompatible fstab in
 device tree)

Those platforms may create another directory that mimics the layout
of the standard DT directory in procfs, and store early mount
configuration there. E.g., Ranchu x86/x86_64 creates one in sysfs
using information encoded in the ACPI tables:

 https://android-review.googlesource.com/442472
 https://android-review.googlesource.com/443432
 https://android-review.googlesource.com/442393
 https://android-review.googlesource.com/442395

Therefore, instead of hardcoding the Android DT path, load it from
the kernel command line using a new Android-specific property key
("androidboot.android_dt_dir"). If no such property exists, fall
back to the standard procfs path (so no change is needed for DT-
aware platforms).

Note that init/ and fs_mgr/ each have their own copy of the Android
DT path, because they do not share any global state. A future CL
should remove the duplication by refactoring.

With this CL as well as the above ones, the said warning is gone,
but early mount fails. That is a separate bug, though, and will be
addressed by another CL.

Test: Boot patched sdk_phone_x86-userdebug system image with patched
      Goldfish 3.18 x86 kernel in patched Android Emulator, verify
      the "init: First stage mount skipped" warning no longer shows
      in dmesg.

Signed-off-by: Yu Ning <yu.ning@intel.com>

(cherry picked from commit c08d2cb0fb7ce470e128c7571553aa12ae9b57a4)

Change-Id: Ia8d5f68e044fde0ecf5c7b14e40f040ff42bc35d
2017-07-31 15:27:09 -07:00
..
include resolve merge conflicts of 645026c74 to oc-dr1-dev-plus-aosp 2017-06-28 22:52:25 +09:00
include_fstab/fstab Merge changes from topic 'ext4_encryption_flag' am: 5be05733c2 am: 5a6226929e 2017-07-14 23:18:02 +00:00
.clang-format Fix-up coding style 2017-02-18 12:33:36 +08:00
Android.bp resolve merge conflicts of 645026c74 to oc-dr1-dev-plus-aosp 2017-06-28 22:52:25 +09:00
Android.mk fs_mgr: replace make_ext4 api with e2fsprogs 2017-06-20 13:53:56 -07:00
fs_mgr.cpp Merge changes from topic 'ext4_encryption_flag' am: 5be05733c2 am: 5a6226929e 2017-07-14 23:18:02 +00: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-31 15:27:09 -07:00
fs_mgr_dm_ioctl.cpp Fix-up coding style 2017-02-18 12:33:36 +08:00
fs_mgr_format.cpp fs_mgr: properly propagate exec child errors 2017-06-22 15:08:38 -07:00
fs_mgr_fstab.cpp Allow the use of a custom Android DT directory 2017-07-31 15:27:09 -07: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 Allow the use of a custom Android DT directory 2017-07-31 15:27:09 -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-31 15:27:09 -07: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 fs_mgr: adding fs_mgr_get_slot_suffix() public API 2017-04-14 21:49:33 +08:00
fs_mgr_verity.cpp fs_mgr_verity: allow verification error when the device is unlocked 2017-07-19 18:45:40 +08:00