Code Monkey home page Code Monkey logo

local_manifests's Introduction

Project

This projects aims to create an upgradable AOSP build system for the Redmi K20 Pro (raphael). No repository from AOSP is changed: no commit over AOSP is at the moment present on these sources.

All the changes are provided in separate repositories: this allows to upgrade Android with minimal effort, potentially also for future major versions.

Most of the added repositories is provided by LineageOS and PixelExperience or CAF, so thanks to them for those repos.

Build instructions

Follow the instructions from Google to setup a machine to build AOSP master branch: https://source.android.com/setup/build/initializing

Then, sync all the sources:

$ repo init -u https://android.googlesource.com/platform/manifest -b master
$ cd .repo
$ git clone --branch master https://github.com/log1cs/local_manifests.git local_manifests
$ cd ..
$ repo sync -c --no-clone-bundle --no-tags

then:

$ source build/envsetup.sh
$ lunch aosp_raphael-user (or lunch aosp_raphael-userdebug)
$ make -j12

the images will be available in out/target/product/raphael.

To build an OTA:

$ source build/envsetup.sh
$ lunch aosp_raphael-user (or lunch aosp_raphael-userdebug)
$ make -j12
$ make otatools-package -j12
$ make otapackage_custom -j12

and the OTA zip will be available in out/target/product/raphael.

Flash instructions

The images can be flashed using fastboot:

$ fastboot flash boot out/target/product/raphael/boot.img
$ fastboot flash recovery out/target/product/raphael/recovery.img
$ fastboot flash system out/target/product/raphael/system.img
$ fastboot flash vendor out/target/product/raphael/vendor.img

Format data if this is a first flash:

$ fastboot format userdata

Note that not all the fastboot versions support the 'format' command.

The OTA can be flashed from the recovery (using the 'ADB sideload' feature) or using third party recoveries like TWRP.

Build the kernel

The ROM sources include a prebuilt kernel. To build a kernel from sources and update it in the Android sources, follow these instructions.

Download the sources and the cross compilers (needed only the first time):

$ cd ~
$ mkdir kernel_build
$ cd kernel_build
$ git clone --single-branch --branch thirteen https://github.com/log1cs/kernel_xiaomi_sm8150.git kernel_xiaomi_sm8150
$ git clone --depth 1 -b android12L-release --single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/ prebuilt_aarch64
$ git clone --depth 1 -b android12L-release --single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/ prebuilt_arm
$ git clone --depth 1 -b android-13.0.0_r6 --single-branch https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 prebuilt_clang
$ git clone --depth 1 -b android-13.0.0_r6 --single-branch https://android.googlesource.com/platform/prebuilts/build-tools prebuilt_tools

Build the kernel:

$ cd ~/kernel_build/kernel_xiaomi_sm8150
$ git pull
$ CC_ARM32_PATH=~/kernel_build/prebuit_arm/bin
$ CC_ARCH64_PATH=~/kernel_build/prebuilt_aarch64/bin
$ CC_CLANG_PATH=~/kernel_build/prebuilt_clang/clang-r450784d/bin
$ MAKE_PATH=~/kernel_build/prebuilt_tools/linux-x86/bin

$ ${MAKE_PATH}/make -j8 ARCH=arm64 CROSS_COMPILE_ARM32=arm-linux-androidkernel- CROSS_COMPILE=aarch64-linux-android- CC=clang CLANG_TRIPLE=aarch64-linux- PATH="${CC_ARM32_PATH}:${CC_ARCH64_PATH}:${CC_CLANG_PATH}:${PATH}" O=out LLVM=1 LLVM_IAS=1 lycoris_raphael_defconfig
$ ${MAKE_PATH}/make -j8 ARCH=arm64 CROSS_COMPILE_ARM32=arm-linux-androidkernel- CROSS_COMPILE=aarch64-linux-android- CC=clang CLANG_TRIPLE=aarch64-linux- PATH="${CC_ARM32_PATH}:${CC_ARCH64_PATH}:${CC_CLANG_PATH}:${PATH}" O=out LLVM=1 LLVM_IAS=1

Copy the Image.gz-dtb file from the prebuilt directory to the Android build system:

$ cp ~/kernel_build/kernel_xiaomi_sm8150/out/arch/arm64/boot/Image.gz-dtb ~/aosp_build_system/kernel/raphael/prebuilt/Image.gz-dtb

Build Android again to update the kernel.

Extra patches

Some patches are needed over AOSP to fix specific issues. At the moment, 2 patches are needed:

  1. To avoid crashes with some Gapps versions: https://github.com/crdroidandroid/android_external_setupcompat/commit/0450c92cbe5c75cc31d4cdc0958918836b28ca53
  2. To fix issues with SIM 2: https://github.com/crdroidandroid/android_frameworks_opt_telephony/commit/cbded5de818d1d23ea8ac7a67f178a95da64a9f0
  3. To enable the styles and colors selection under Settings -> Wallpaper & style: https://github.com/Flamingo-OS/packages_apps_Launcher3/commit/e6d6b64264ef45a72791347d9f39d85ff412e58f https://github.com/LineageOS/android_packages_apps_ThemePicker/commit/14584d051eb8959e8bfb3b29173a0c40b9e991c5
  4. To fix a Dialer crash when opening Settings -> Display options: https://github.com/RiceDroid/android_packages_apps_Dialer/commit/8c4ab1faf4d534d32f570c4bf9cf002ab3ad20d0
  5. Fix offline charging 'always on display' issue: https://android-review.googlesource.com/c/platform/bootable/recovery/+/2205736/

These patches are not necessary to boot or use Android.

local_manifests's People

Contributors

roberto-sartori-gl avatar xdevs23 avatar log1cs avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.