Merge "hikey{,960}: Enable system-as-root and verity."
am: 72ef1bb611
Change-Id: Id065e6377d132e51f4a3cfd0d8ddda4ccab4d699
diff --git a/hikey/BoardConfig.mk b/hikey/BoardConfig.mk
index c76ad35..31a25ef 100644
--- a/hikey/BoardConfig.mk
+++ b/hikey/BoardConfig.mk
@@ -12,8 +12,17 @@
BOARD_KERNEL_CMDLINE := console=ttyFIQ0 androidboot.console=ttyFIQ0 androidboot.hardware=hikey firmware_class.path=/vendor/firmware efi=noruntime
endif
-#Enable dtb fstab for treble
+ifneq ($(TARGET_ANDROID_VERITY),)
+# Enable dtb fstab for treble, with verity and system-as-root
+# NOTE: Disabled by default until b/111829702 is fixed
+BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab_v2
+BOARD_KERNEL_CMDLINE += rootwait ro init=/init root=/dev/dm-0
+BOARD_KERNEL_CMDLINE += dm=\"system none ro,0 1 android-verity 179:9\"
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+else
+# Enable dtb fstab for treble
BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab
+endif
ifneq ($(TARGET_SENSOR_MEZZANINE),)
BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_$(TARGET_SENSOR_MEZZANINE)
diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk
index 09a1ed7..730d5f5 100644
--- a/hikey960/BoardConfig.mk
+++ b/hikey960/BoardConfig.mk
@@ -11,8 +11,17 @@
BOARD_KERNEL_CMDLINE := androidboot.hardware=hikey960 console=ttyFIQ0 androidboot.console=ttyFIQ0
BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware loglevel=15 efi=noruntime
-#Enable dtb fstab for treble
+ifneq ($(TARGET_ANDROID_VERITY),)
+# Enable dtb fstab for treble, with verity and system-as-root
+# NOTE: Disabled by default until b/111829702 is fixed
+BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab_v2
+BOARD_KERNEL_CMDLINE += rootwait ro init=/init root=/dev/dm-0
+BOARD_KERNEL_CMDLINE += dm=\"system none ro,0 1 android-verity 8:58\"
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+else
+# Enable dtb fstab for treble
BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab
+endif
ifneq ($(TARGET_SENSOR_MEZZANINE),)
BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_$(TARGET_SENSOR_MEZZANINE)