How to overload default or device-specific Android HALs

This knowledge base article explains how to overload default or device-specific Android HALs included into emteria.OS with a user-specified HAL implementation. This empowers the user to customize their devices. Additional information on how to create a custom HAL based on Androids Health HAL can be found in the Android Documentation.

Note: This currently only works on Raspberry Pi 4 based devices.

  1. Extend the cmdline.txt at the boot partition with androidboot.product.board=<product-name>

    Eg. for our Health HAL this is:


    This could also be done through system properties.

  2. Create a prebuild of the HAL you want to overload with the naming scheme <HAL-name>.<product-name>.so.

    Eg. for the Health HAL we will create:
  3. Boot up your device.
  4. Copy the prebuild onto the odm partition.

    This can be done through adb.
    Place the prebuild under:

    /lib/hw or lib64/hw
  5. Reboot the device.
    The standard HAL should now be overloaded.