OEM AB partition updates

SDV enables A/B updates for the custom /oem_ab partition. Use the OEM AB Updater library to trigger and to roll back updates for the custom /oem_ab partition, with similar capabilities to Android system A/B updates.

See the sample code for an OEM AB Updater library implementation in system/software_defined_vehicle/samples/oem_partition_update_client.

The guide describes how to use the OEM AB Updater library and integrate it with your own Updater Service implementation. This guide assumes you are using Cuttlefish to build and test your changes.

Library location

The OEM AB Updater library is in the system/software_defined_vehicle/platform/oem directory.

Build required custom images

The OEM AB Updater library requires several custom images. These images are defined in device/google/sdv/sdv_core_base/oem_ab/oem_ab.mk and device/google/sdv/sdv_core_base/oem_ab/oem_ab_metadata.mk.

The required custom images defined in oem_ab.mk and oem_ab_metadata.mk are created when the target is built. For example, building sdv_core_cf creates the partition images:

source build/envsetup.sh
lunch sdv_core_cf-trunk_staging-userdebug
m

Specify custom block devices

Verify that your Cuttlefish lunch target sets the BOARD_BOOTCONFIG to map the block devices to the corresponding bootconfig property. For example, see device/google/sdv/sdv_core_cf/BoardConfig.mk.

BOARD_BOOTCONFIG += \
  androidboot.sdv.oem_slot_a_device=/dev/block/by-name/custom \
  androidboot.sdv.oem_slot_b_device=/dev/block/by-name/custom_1

Start a new VM

After verifying that the block devices are mapped, create a new VM with the three custom images:

cvd create --custom_partition_path="$OUT/oem_ab.img;$OUT/oem_ab.img;$OUT/oem_ab_metadata.img"

Use the OEM AB Updater library in a new service

To use the library in another service:

  1. Import the sdv_oem_updater::OemUpdater crate as demonstrated in system/software_defined_vehicle/samples/oem_partition_update_client/oem_partition_client.rs.

. Create a new.tepolicy similar to the SELinux policies defined indevice/google/sdv/sdv_core_cf/sepolicy/product/private/oem_partition_client.te`.