Mastering Dynamic System Updates: A Guide to Using DSU on Android Devices

Dynamic System Updates (DSU) is a powerful Android system feature, streamlining how users and developers interact with system images. Think of DSU as a safe and efficient way to test drive new Android system versions or Generic System Images (GSIs) without altering your device’s core operating system. This guide will walk you through the process of using DSU, similar in concept to how specialized tools like Cara Menggunakan Spark Img Tool might be used in other technical contexts, but focusing specifically on Android system images.

DSU, introduced in Android 10, offers a seamless method to:

  • Download and install a GSI (or other compatible Android system image) onto your device.
  • Create a dedicated dynamic partition for the new image.
  • Load and boot the downloaded GSI as a separate guest operating system.

This innovative feature allows you to effortlessly switch between your device’s original system and the GSI. This means you can explore and test GSIs without the risk of corrupting your primary system image, providing a safe environment for experimentation and development.

DSU Prerequisites

Before diving into the usage of DSU, it’s important to understand the prerequisites that make this feature possible:

  • Android Dynamic Partition: DSU is built upon the foundation of Android Dynamic Partition. This partitioning scheme allows for flexible system updates and installations.
  • Trusted System Images: For security and integrity, GSIs used with DSU must be signed. These signatures are typically provided by Google or your device’s Original Equipment Manufacturer (OEM), ensuring you are using a trusted system image.
  • Manufacturer Support: DSU is ultimately a feature implemented by your device’s manufacturer. Availability can vary depending on the device and OEM. For Google Pixel devices, DSU has been enabled starting from Pixel 3 and newer models since Android 10 Beta 4. Check your device manufacturer’s support documentation to confirm DSU availability for your specific device.

Installing GSIs via DSU and Command Line

For users comfortable with command-line tools, ADB (Android Debug Bridge) offers a direct method to utilize DSU for GSI installation. Here’s a step-by-step guide:

  1. Obtain a GSI: First, you need a GSI to install. You can download one from the official GSI release page or from another trusted GSI image source.

  2. Compress the GSI: To optimize the file for transfer, compress the GSI using gzip:

    gzip -c system_raw.img > system_raw.gz
  3. Transfer the GSI to your Device: Use ADB to push the compressed GSI file to your device’s storage, specifically the Download directory in this example:

    adb push system_raw.gz /storage/emulated/0/Download/
  4. Initiate DSU Installation: Launch the DSU installation process using an ADB shell command. This command specifies the DSU activity, the install action, the location of your GSI file, and size parameters:

    adb shell am start-activity  -n com.android.dynsystem/com.android.dynsystem.VerificationActivity  -a android.os.image.action.START_INSTALL  -d file:///storage/emulated/0/Download/system_raw.gz  --el KEY_SYSTEM_SIZE $(du -b system_raw.img|cut -f1)  --el KEY_USERDATA_SIZE 8589934592

    After executing this command, you will see a notification on your device indicating the installation progress.

Booting into the GSI and Switching Back

Once DSU has successfully installed the GSI, a persistent notification will appear in your system notification drawer, providing control options (as seen in Figure 1).

Figure 1. DSU control notification providing options to restart or discard the GSI installation.

At this stage, you have the following choices:

  • Boot into GSI: Tap Restart in the notification to reboot your device into the newly installed GSI.
  • Discard GSI: If you choose not to boot into the GSI or want to remove it, tap Discard. This will clean up the installed GSI.

To revert back to your device’s original system image after testing the GSI, simply perform a cold reboot of your device.

DSU also offers a “sticky mode” feature which determines if the GSI installation persists across multiple reboots.

  • Enable Sticky Mode: The GSI will remain installed even after multiple reboots (until you discard it). Use this command to enable:

    adb shell gsi_tool enable
  • Disable Sticky Mode: The GSI will only be used for a single boot cycle. After rebooting back to the original system, the GSI will be discarded. Use these commands to disable:

    adb shell gsi_tool disable

    or

    adb shell gsi_tool enable -s

Installing GSIs via DSU Loader (Android 11+)

Android 11 introduced a more user-friendly approach to DSU with the DSU Loader. This tool, accessible through the device’s developer options, allows you to manage GSIs directly through the system UI, eliminating the need for command-line interaction.

To use the DSU Loader for GSI installation, follow these steps on devices running Android 11 or later:

  1. Enable Developer Options: If you haven’t already, enable developer options on your Android device by going to Settings > About phone > Software information and tapping “Build number” repeatedly (usually 7 times).
  2. Access DSU Loader: Navigate to Settings > System > Developer options > DSU Loader. (The exact path might slightly vary depending on your device).
  3. Select a GSI: The DSU Loader will present a list of available GSIs that you can install. Choose the desired GSI from the list.
  4. Accept Terms and Conditions: Review and agree to the GSI terms and conditions as prompted. Once accepted, the download process for the selected GSI will begin. You can monitor the download progress through a DSU notification.
  5. Boot into GSI: After the download is complete, tap Restart in the DSU notification to boot your device into the newly installed GSI.

To switch back to your device’s original system image when you are finished testing, simply tap Restart from the DSU system notification again.

Providing Feedback

Your feedback is invaluable in improving DSU and GSI features. If you encounter issues or have suggestions, please contribute by reporting GSI bugs and engaging in discussions on Stack Overflow. Your insights help shape the future of Android system updates.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *