Before flashing Foundation on an ARM device, perform the following tasks to ensure the device and software are compatible.
This guide uses ADB commands to perform some required functions. Learn more about installing and using ADB commands.
In this guide, we’ll walk through how to ensure your device is compatible with Esper Foundation by checking for Treble Compliance using Android’s generic system image (GSI).
In this article:
- Frequently Asked Questions
- Required Steps
- Flashing the Generic System Image
- Option 1: Classical partitioning method
- Option 2: Dynamic partitioning method
- Follow Up Actions
Frequently Asked Questions
What is Project Treble and Treble Compliance?
Before attempting to install Foundation, you’ll need to check if the device is Treble Compliant. In this guide, you’ll use a GSI to check for Treble Compliance before installing the Foundation image.
What is GSI and how does it relate to Foundation?
A generic system image (GSI) is an unmodified Android operating system. Esper used the GSI to help build Foundation, and, to understand a device’s compatibility with our Foundation image, we ask that you test your device with GSI first.
Required Steps
Before getting started, we recommend obtaining the current factory production image, drivers, and flashing instructions. You can use this to restore your device to factory defaults if the GSI fails to load. Then check if your device is compliant with Foundation by using the following methods:
- Check if the device is Treble Compliant.
- This article documents Treble-compliant devices.
- If there is a checkmark in the Supported by OEM column, the device is likely Treble compliant. You can proceed with the next steps. If you don’t see the device in the list, proceed to step 2 of this section.
- This article documents Treble-compliant devices.
- Next use the adb command:
The device will return one of the following:adb shell getprop ro.treble.enabled
- False or blank: the device is not Treble compliant.
- True: The device is likely Treble compliant. You can proceed with the next steps
- Unlock bootloader on the device
- Enable Developer Settings on the device. Usually, this involves tapping the build number several times in the Android Settings apps. Then, go to Developer Options and enable OEM Unlocking. The exact steps to unlock the bootloader may vary. See Android’s documentation for more information.
- Validate via fastboot with the following commands:
-
adb reboot bootloader
-
fastboot flashing unlock
- OEM unlocking may vary on devices. If the following methods do not work, reach out to your device manufacturer (OEM).
If the device is not Treble compliant, see the Follow-Up Actions section of this article for next steps.
Flashing the Generic System Image
- Download the generic system image matching your device’s current Android version and architecture. Extract the zip file and navigate to the system.img and vbmeta.img files.
- Once you’ve determined the device is compatible with Foundation, enter Fastboot Mode. Use adb to enter the following command:
adb reboot bootloader
- Flash the vbmeta file to disable the verified boot mode by using the following command:
fastboot --disable-verity --disable-verification flash vbmeta {path/to/vbmeta.img}
- The flashing setup is dependent on your device’s partitioning setup. In the next section, we’ll cover two of the most common command methods. Most of the time, you won’t know which option to use before testing it out. We recommend beginning with the first option (classical partitioning).
Option 1: Classical partitioning method
- If you are not already in the bootloader, enter the following command:
adb reboot bootloader
- Use the following command to flash the system image or GSI:
fastboot flash system {path/to/system.img}
- Select Post Installation Cleanup.
- Then enter the command:
fastboot reboot recovery
- Select Factory Reset/Wipe.
- Then reboot the device.
If the device boots, it is likely Treble compliant and you are ready to complete the test suite.
Troubleshooting the classical partitioning method
- If you receive an error, “System Partition Not Found” then use Option 2: Dynamic Partitioning Method.
Note: system messages may vary.
- If the device boots with a blank screen after installation, then the device is likely not Treble compliant. Restore the device to its default settings by flashing the factory production image.
Option 2: Dynamic partitioning method
The dynamic partitioning method requires the device to be in fastbootd mode.
- Use the following commands to enter fastbootd mode:
-
fastboot reboot fastboot
-
fastboot flash system {path/to/system.img}
Note: It may take a moment for the system to flash the image.
Post Installation Cleanup
At this step, it’s recommended to factory reset the device through the recovery menu in order to prevent a bootloop due to data corruption. To do this, follow the steps below:
- Enter the command:
fastboot reboot recovery
- Select Factory Reset/Wipe.
- Then reboot the device.
- If the device boots, it is likely Treble compliant and you are ready to provision it to Esper. You are ready to complete the test suite.
Troubleshooting the dynamic partitioning method
- The flashing process may vary depending on your device’s partitioning setup. If the two methods do not work, contact your device manufacturer for instructions on installing a GSI Suite section to ensure your device is operating correctly.
- If the device boots with a blank screen, then the device is likely not Treble compliant or compatible with Esper provisioning. Restore the device to its default settings by flashing the factory production image.
- If you receive this error, Resizing 'system_a' FAILED (remote: 'Not enough space to resize partition') fastboot: error: Command failed, after running the
command, enter the following command:fastboot flash system {path/to/system.img}
.fastboot delete-logical-partition product_a
Follow Up Actions
- If you were unable to flash the GSI, contact your device manufacturer. Due to partition variance, the above flashing instructions may not apply to all devices.
- If your device is not Treble Compliant, contact your Esper representative and ask about Foundation for non-Treble devices. Include the following information with your request:
- Is your OEM willing to share the BSP and associated GIT history with Esper?
- Flashing instructions, drivers, and firmware