Skip to content

Instantly share code, notes, and snippets.

@ArianK16a
Last active September 10, 2021 19:11
Show Gist options
  • Select an option

  • Save ArianK16a/b20a5129c490f4cd1509341a023ef444 to your computer and use it in GitHub Desktop.

Select an option

Save ArianK16a/b20a5129c490f4cd1509341a023ef444 to your computer and use it in GitHub Desktop.

Revisions

  1. ArianK16a revised this gist Sep 10, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TP1803_build-abl.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ I used this command, but just `repo sync` will be enough: `repo sync -j 16 --fai

    7. Apply a change to the msmnile tree. In order to build ABL you should apply [this commit](https://github.com/ArianK16a/device_qcom_msmnile/commit/5e5f213fc3901466efe900764d0ca45ad599a1d9), so that booting recovery will work with your built abl.

    8. Update the bootloader repository. The bootloader will work as is without changes, but you should apply some changes for it to work correctly:
    8. Update the bootloader repository; you can find it at `bootable/bootloader/edk2`. The bootloader will work as is without changes, but you should apply some changes for it to work correctly:
    1. Correct the button scan codes: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/45769ae28c21530ecf779f5683cfd6a27e6a2cbe
    2. Remove bootloader lock/unlock commands: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/0a6d07894da311ae2444c37d32dd7967dd1c5856
    3. (optional) Never display verified boot menu: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/8b5fab17685b414afa0932bf407dfb0df20fe1fc
  2. ArianK16a revised this gist Sep 10, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion TP1803_build-abl.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # How to build abl.elf for TP1803

    1. Initialize the tree:
    `# repo init -u https://source.codeaurora.org/quic/la/la/system/manifest/.git -b release`
    `# repo init -u https://source.codeaurora.org/quic/la/la/system/manifest.git -b release`

    2. Specify the system manifest you want to use:
    I wanted to use the `LA.QSSI.11.0.r1-13000.02-qssi.0` tag, so i added `.repo/manifest.xml` with the following content:
  3. ArianK16a revised this gist Sep 10, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions TP1803_build-abl.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # How to build abl.elf for TP1803

    1. Initialize the tree:
    `# repo init -u https://source.codeaurora.org/quic/la/la/system/manifest/.git -b release`

  4. ArianK16a created this gist Sep 10, 2021.
    70 changes: 70 additions & 0 deletions TP1803_build-abl.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,70 @@
    1. Initialize the tree:
    `# repo init -u https://source.codeaurora.org/quic/la/la/system/manifest/.git -b release`

    2. Specify the system manifest you want to use:
    I wanted to use the `LA.QSSI.11.0.r1-13000.02-qssi.0` tag, so i added `.repo/manifest.xml` with the following content:

    ```
    <manifest>
    <include name="LA.QSSI.11.0.r1-13000.02-qssi.0.xml"/>
    </manifest>
    ```

    3. Add the vendor manifest
    I wanted to use the `LA.UM.9.1.r1-11100-SMxxx0.0.xml` tag, so i grabbed the [according manifest](https://source.codeaurora.org/quic/la/la/vendor/manifest/tree/LA.UM.9.1.r1-11100-SMxxx0.0.xml?h=release) from [here](https://source.codeaurora.org/quic/la/la/vendor/manifest/tree/?h=release) (not the default_ variant, more on that later).
    You can add that manifest as .repo/local_manifests/vendor.xml

    4. Fix double default conflict
    Now we face the issue that both, the system and the vendor manifest, declare a different default remote. To fix this, we can just comment out the default remote in the vendor manifest, like this:
    ```
    <!--
    <remote fetch="https://source.codeaurora.org/quic/la/" name="caf" review="codeaurora.org"/>
    <default remote="caf" revision="LA.UM.9.1.r1"/>
    -->
    ```
    The difference to the default remote of the system manifest is the revision, but that is not an issue because our vendor manifest specifies the exact revision of all repos. The default_*.xml manifest's don't do this.
    Now we are all set to sync our caf tree, but we want to add vendor/qcom/proprietary first.

    5. Add custom repositories
    We can create a new local manifest, i named it z_bsp.xml (i went for the z_ prefix because i want it to be included after vendor.xml, we will override a repository of it).
    My z_bsp.xml looks like this:

    ```
    <manifest>
    <?xml version="1.0" encoding="UTF-8"?>
    <remote fetch="ssh://git@github.com" name="ssh" />
    <!-- Remove the default msmnile tree -->
    <remove-project name="platform/vendor/qcom/msmnile" />
    <!-- Sync the modified msmnile tree and it's proprietary vendor repository -->
    <project name="tadiphone-caf/device_qcom_msmnile" path="device/qcom/msmnile" remote="ssh" revision="eleven" />
    <project name="tadiphone-caf/vendor_qcom_msmnile" path="vendor/qcom/msmnile" remote="ssh" revision="eleven" />
    <!-- Sync the BSP, it will be responsible for signing the avb image -->
    <project name="tadiphone-caf/vendor_qcom_proprietary" path="vendor/qcom/proprietary" remote="ssh" revision="eleven" />
    </manifest>
    ```

    6. Sync all the repositories
    I used this command, but just `repo sync` will be enough: `repo sync -j 16 --fail-fast --force-sync -c --no-clone-bundle --no-tags --prune -q`

    7. Apply a change to the msmnile tree. In order to build ABL you should apply [this commit](https://github.com/ArianK16a/device_qcom_msmnile/commit/5e5f213fc3901466efe900764d0ca45ad599a1d9), so that booting recovery will work with your built abl.

    8. Update the bootloader repository. The bootloader will work as is without changes, but you should apply some changes for it to work correctly:
    1. Correct the button scan codes: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/45769ae28c21530ecf779f5683cfd6a27e6a2cbe
    2. Remove bootloader lock/unlock commands: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/0a6d07894da311ae2444c37d32dd7967dd1c5856
    3. (optional) Never display verified boot menu: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/8b5fab17685b414afa0932bf407dfb0df20fe1fc
    4. (optional) Enable offline charging: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commit/000a06406d953761174408a1564d82f1173f3a78
    5. (optional) You can apply some cosmetic changes: https://github.com/ArianK16a/android_bootable_bootloader_edk2/commits/8b5fab17685b414afa0932bf407dfb0df20fe1fc

    9. Build the abl image. After you got all the repositories right, you can start building it. To do so, you need to follow these commands in the root of the synced tree:
    ```
    . build/envsetup.sh
    lunch msmnile-userdebug
    make aboot
    ```

    10. After your build succeeded, you will find the abl image in `out/target/product/msmnile/abl.elf`. You can flash it from fastboot like this: `fastboot flash abl out/target/product/msmnile/abl.elf`

    Good luck!