From 631900e6ce0bb282ce5b738865148e954469ff4a Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Wed, 9 May 2018 21:57:49 +0800 Subject: [PATCH] Enable /cache mount point Non-A/B devices using AOSP OTA flow will mount /cache in the fstab file. Without setting BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE, /cache will be a symlink to /data/cache which introduces the failure of `mount_all /vendor/etc/fstab.{ro.hardware}`. This is because all devices laucned in P need to switch to "system-as-root". This CL sets board config to create /cache directory in rootfs (system-as-root GSI image). Note that A/B devices doesn't mount or use /cache so leaving an empty /cache in rootfs has no harm. Bug: 78485405 Test: Boot GSI on walleye Change-Id: Ic260d2917cc64c9497f5f60ea11303e953e80efd Merged-In: Ic260d2917cc64c9497f5f60ea11303e953e80efd --- target/board/generic/BoardConfig.mk | 5 +++++ target/board/generic_arm64/BoardConfig.mk | 5 +++++ target/board/generic_arm64_ab/BoardConfig.mk | 5 +++++ target/board/generic_arm_ab/BoardConfig.mk | 5 +++++ target/board/generic_x86/BoardConfig.mk | 5 +++++ target/board/generic_x86_64/BoardConfig.mk | 5 +++++ target/board/generic_x86_64_ab/BoardConfig.mk | 5 +++++ target/board/generic_x86_ab/BoardConfig.mk | 5 +++++ 8 files changed, 40 insertions(+) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 0bc0c3234..6af379932 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -70,6 +70,11 @@ BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/common BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index c861770f6..e2fa41f67 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -86,6 +86,11 @@ BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/common diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk index 00afee615..762051682 100644 --- a/target/board/generic_arm64_ab/BoardConfig.mk +++ b/target/board/generic_arm64_ab/BoardConfig.mk @@ -36,6 +36,11 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := true BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + # TODO(b/36764215): remove this setting when the generic system image # no longer has QCOM-specific directories under /. BOARD_SEPOLICY_DIRS += build/target/board/generic_arm64_ab/sepolicy diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index b21e907a0..051a4f778 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -33,6 +33,11 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := true BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + # TODO(b/36764215): remove this setting when the generic system image # no longer has QCOM-specific directories under /. BOARD_SEPOLICY_DIRS += build/target/board/generic_arm64_ab/sepolicy diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 64d942a65..16a8d64ea 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -58,6 +58,11 @@ BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + BOARD_SEPOLICY_DIRS += \ device/generic/goldfish/sepolicy/common \ device/generic/goldfish/sepolicy/x86 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 7a49f092b..3f20977fe 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -57,6 +57,11 @@ TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + BOARD_SEPOLICY_DIRS += \ device/generic/goldfish/sepolicy/common \ device/generic/goldfish/sepolicy/x86 diff --git a/target/board/generic_x86_64_ab/BoardConfig.mk b/target/board/generic_x86_64_ab/BoardConfig.mk index e49863a4b..a098dfe2a 100644 --- a/target/board/generic_x86_64_ab/BoardConfig.mk +++ b/target/board/generic_x86_64_ab/BoardConfig.mk @@ -24,6 +24,11 @@ TARGET_2ND_CPU_ABI := x86 TARGET_2ND_ARCH := x86 TARGET_2ND_ARCH_VARIANT := x86_64 +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true diff --git a/target/board/generic_x86_ab/BoardConfig.mk b/target/board/generic_x86_ab/BoardConfig.mk index 6e51102a2..db4dacd96 100644 --- a/target/board/generic_x86_ab/BoardConfig.mk +++ b/target/board/generic_x86_ab/BoardConfig.mk @@ -20,6 +20,11 @@ TARGET_CPU_ABI := x86 TARGET_ARCH := x86 TARGET_ARCH_VARIANT := x86 +# Set this to create /cache mount point for non-A/B devices that mounts /cache. +# The partition size doesn't matter, just to make build pass. +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216 + # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true