Add ODM partition to Cuttlefish
This can be used by derived targets downstreams to add
additional behaviors (e.g. specific ueventd rules)
Bug: 150094400
Bug: 150478175
Test: acloud create --local-image --local-instance
Change-Id: Ief5b33288de3fcad0f320f0994a7f2c13386f60b
diff --git a/shared/BoardConfig.mk b/shared/BoardConfig.mk
index 3e5fe6b..97c368f 100644
--- a/shared/BoardConfig.mk
+++ b/shared/BoardConfig.mk
@@ -50,6 +50,11 @@
BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_SYSTEM_EXT := system_ext
+# Build a separate odm.img partition
+BOARD_USES_ODMIMAGE := true
+BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
+TARGET_COPY_OUT_ODM := odm
+
BOARD_USES_GENERIC_AUDIO := false
USE_CAMERA_STUB := true
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
@@ -141,7 +146,7 @@
BOARD_SUPER_PARTITION_SIZE := 6442450944
BOARD_SUPER_PARTITION_GROUPS := google_dynamic_partitions
-BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := system vendor product system_ext
+BOARD_GOOGLE_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor
BOARD_GOOGLE_DYNAMIC_PARTITIONS_SIZE := 6442450944
BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true
BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true
@@ -163,4 +168,3 @@
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION)
PRODUCT_COPY_FILES += device/google/cuttlefish/dtb.img:dtb.img
BOARD_BUILD_SYSTEM_ROOT_IMAGE := false
-
diff --git a/shared/config/fstab b/shared/config/fstab
index 73e5112..715c68b 100644
--- a/shared/config/fstab
+++ b/shared/config/fstab
@@ -6,8 +6,9 @@
/dev/block/by-name/metadata /metadata ext4 nodev,noatime,nosuid,errors=panic wait,formattable,first_stage_mount
/dev/block/by-name/misc /misc emmc defaults defaults
# Add all dynamic partitions except system, after this comment
-vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
+odm /odm ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
product /product ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
system_ext /system_ext ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
+vendor /vendor ext4 noatime,ro,errors=panic wait,logical,first_stage_mount,slotselect
/dev/block/zram0 none swap defaults zramsize=75%
/tmp /sdcard none defaults,bind recoveryonly
diff --git a/shared/device.mk b/shared/device.mk
index ed0de4d..4f5a100 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -27,6 +27,7 @@
AB_OTA_UPDATER := true
AB_OTA_PARTITIONS += \
+ odm \
product \
system \
system_ext \
diff --git a/shared/releasetools.py b/shared/releasetools.py
index 198fcc2..bab60f9 100644
--- a/shared/releasetools.py
+++ b/shared/releasetools.py
@@ -24,6 +24,7 @@
# deleted. When generating an incremental OTA package, this script needs to
# know that an image is present in source build but not in target build.
USERIMAGE_PARTITIONS = [
+ "odm",
"product",
"system_ext",
]