From 11c5e3e98827c301fc6a5364ae8b7dab93a22de4 Mon Sep 17 00:00:00 2001 From: Alistair Strachan Date: Tue, 31 Jul 2018 17:28:51 -0700 Subject: hikey{,960}: Enable system-as-root and verity. Add a build option TARGET_ANDROID_VERITY which can be set to anything but the empty string to enable dm-android-verity. This option is introduced because the UEFI bootloader for hikey and hikey960 has a bug where it incorrectly rejects boot.img files with no ramdisk (see https://bugs.96boards.org/show_bug.cgi?id=757). This change *will* work on a hikey960 with the non-UEFI bootloader installed. Test: local Bug: 72722987 Bug: 111829702 Change-Id: I75d0941866d9196e78e7c2943cdf05d35beb1879 Signed-off-by: Alistair Strachan --- hikey/BoardConfig.mk | 11 ++++++++++- hikey960/BoardConfig.mk | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/hikey/BoardConfig.mk b/hikey/BoardConfig.mk index c76ad35a..31a25ef6 100644 --- a/hikey/BoardConfig.mk +++ b/hikey/BoardConfig.mk @@ -12,8 +12,17 @@ else 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 09a1ed70..730d5f55 100644 --- a/hikey960/BoardConfig.mk +++ b/hikey960/BoardConfig.mk @@ -11,8 +11,17 @@ TARGET_NO_DTIMAGE := false 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) -- cgit v1.2.3