Showing posts with label aosp. Show all posts
Showing posts with label aosp. Show all posts

Tuesday, April 19, 2022

Building AOSP for Google Pixel 3a (Sargo)

Building Android from Source for Pixel 3a

In this blog post, we will guide you through the process of building Android from source for the Pixel 3a smartphone. Building Android from source gives you full control over the operating system and allows for customization. We'll also cover how to handle common issues during the process.

Step 1: Get the Source Code

  1. Create a directory for the project:
    mkdir aosp12
    cd aosp12
          
  2. Initialize the repository with the Android source code:
    repo init -u https://android.googlesource.com/platform/manifest -b android-12.1.0_r27
          
  3. Sync the source code to your local machine:
    repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
          

Step 2: Handling Repo Sync Errors

If you encounter any errors during the repo sync process, follow these steps:

  1. Navigate to the .repo/repo directory:
    cd .repo/repo
          
  2. Check out forcefully:
    git checkout -f
          
  3. Retry the repo sync with the following command:
    repo sync -c
          

Step 3: Download Driver Binaries

Next, you'll need to download the driver binaries for the same Build ID that you selected previously. For Pixel 3a, you can find the drivers here.

After downloading, extract the driver binaries into your project directory (aosp12).

Step 4: Build Android

  1. Set up the build environment:
    source build/envsetup.sh
          
  2. Choose the build variant (userdebug in this case):
    lunch aosp_sargo-userdebug
          
  3. Build Android. You can specify the number of CPU cores to use for the build. For example, to use one core for kernel compilation and four cores for the rest of the build:
    m -j1 (till kernel compilation)
    m -j4 (after kernel compilation)
          

Step 5: Flash the Build

  1. Reboot your device into bootloader mode:
    adb reboot bootloader
          
  2. Flash the build onto your device. This will wipe all data, so be cautious:
    fastboot flashall -w
          

Step 6: Finalize and Test

After flashing, your device will reboot. You can then:

  1. Reconnect to the device:
    adb root
    adb remount
          
  2. Reboot your device:
    adb reboot
          

Conclusion

Congratulations! You've successfully built and flashed Android from source for your Pixel 3a smartphone. Enjoy your custom Android experience!

Friday, April 15, 2022

Build Pixel Experience 11 for Realme 3 pro

https://wiki.pixelexperience.org/devices/RMX1851/build

pixelexp11/.repo/manifests$ git remote -v
origin https://github.com/PixelExperience/manifest (fetch)
origin https://github.com/PixelExperience/manifest (push)

pixelexp11/.repo/manifests$ git branch -a
* default
  remotes/m/eleven -> origin/eleven
  remotes/origin/eleven

pixelexp$ repo status
project device/realme/RMX1851/                  (*** NO BRANCH ***)
 -m     device.mk
project kernel/realme/sdm710/                   (*** NO BRANCH ***)
 -m     Makefile
 -m     drivers/staging/qcacld-3.0/Kbuild 

pixelexp/device/realme/RMX1851$ git diff
diff --git a/device.mk b/device.mk
index d4a032a..736ab51 100644
--- a/device.mk
+++ b/device.mk
@@ -157,8 +157,8 @@ PRODUCT_COPY_FILES += \
 PRODUCT_PACKAGES += \
     libnl

-PRODUCT_BOOT_JARS += \
-    WfdCommon
+#PRODUCT_BOOT_JARS += \
+#    WfdCommon 

 # Wallpapers
 PRODUCT_PACKAGES += \

no changes added to commit (use "git add" and/or "git commit -a")
pixelexp/kernel/realme/sdm710$ git diff
diff --git a/Makefile b/Makefile
index 276f98015b43..05b4407fdf0d 100755
--- a/Makefile
+++ b/Makefile
@@ -692,6 +692,10 @@ CFLAGS_GCOV        := -fprofile-arcs -ftest-coverage \
        $(call cc-option,-fno-tree-loop-im) \
        $(call cc-disable-warning,maybe-uninitialized,)
 CFLAGS_KCOV    := $(call cc-option,-fsanitize-coverage=trace-pc,)
+
+KBUILD_CFLAGS += $(call cc-option,-Wno-error=maybe-uninitialized,)
+KBUILD_CFLAGS += $(call cc-option,-Wno-error=array-bounds,)
+
 export CFLAGS_GCOV CFLAGS_KCOV

 # Make toolchain changes before including arch/$(SRCARCH)/Makefile to ensure
diff --git a/drivers/staging/qcacld-3.0/Kbuild b/drivers/staging/qcacld-3.0/Kbuild
index 0631e4b76016..93df236bc784 100644
--- a/drivers/staging/qcacld-3.0/Kbuild
+++ b/drivers/staging/qcacld-3.0/Kbuild
@@ -1573,7 +1573,6 @@ ccflags-y += $(INCS)
  cppflags-y +=  -DANI_OS_TYPE_ANDROID=6 \
                -Wall\
-               -Werror\
                -D__linux__
 cppflags-$(CONFIG_PTT_SOCK_SVC_ENABLE) += -DPTT_SOCK_SVC_ENABLE

install android 10 to unlock bootloader using:
https://download.c.realme.com/flash/Rollbackpack/realme_3Pro/sign_RMX1851EX_11_OTA_1180_all_w236tl6xfsaL.ozip

Turn off your phone-->
Long press the volume down and power buttons at the same time enter recovery mode-->
Choose the language -->
Install from storage-->
Input your screen locked password-->
Find & tap the rollback package to go back to the previous version.

Follow steps to unlock bootloader:
https://c.realme.com/in/post-details/1243537172376584192

Flash recovery twrp:
https://www.right-brothers.net//how-to-unlock-bootloader-of-realme-3-pro-guide/n

Install pixel experience
https://www.right-brothers.net/how-to-install-pixel-experience-rom-on-realme-3-pro/

adb reboot bootloader
fastboot flash recovery twrp-3.4.0-0-RMX1851.img

Note: if there is problem with fastboot command, use usb2.0 port or usb2.0 hub

fastboot reboot
adb reboot recovery

wipe all except vendor partition.
install PixelExperience_RMX1851-11.0-20211216-0324-UNOFFICIAL.zip

Build AOSP 10 for Lenovo Vibe K5 Plus

Requirement: Ubuntu 21.04 with 16GB RAM and 10GB swap
https://github.com/AOSP-LEGACY/manifest#readme

mkdir aosp10

cd aosp10
repo init -u https://github.com/AOSP-LEGACY/manifest -b ten
repo sync -c -f --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all)

mkdir -p kernel/lenovo/msm8916 && cd kernel/lenovo/msm8916
git clone https://github.com/ArrowOS-Devices/android_kernel_lenovo_msm8916.git -b arrow-10.0

mkdir -p device/lenovo/A6020 && cd device/lenovo/A6020
git clone https://github.com/ArrowOS-Devices/android_device_lenovo_A6020.git -b arrow-10.0

mkdir -p vendor/lenovo/A6020 && cd vendor/lenovo/A6020
git clone https://github.com/ArrowOS-Devices/android_vendor_lenovo_A6020.git -b arrow-10.0


Add in file: hardware/qcom/wlan/wcnss-service/Android.mk

+ifneq ($(QCPATH),)
 LOCAL_CFLAGS += -DWCNSS_QMI -DMDM_DETECT
 LOCAL_SHARED_LIBRARIES += libwcnss_qmi
 else
 LOCAL_CFLAGS += -DWCNSS_QMI_OSS
 LOCAL_SHARED_LIBRARIES += libdl
+endif #QCPATH
+#include $(BUILD_SHARED_LIBRARY)

Add in file: device/lenovo/A6020/BoardConfig.mk
+ALLOW_MISSING_DEPENDENCIES=true

source build/envsetup.sh
lunch arrow_A6020-userdebug
m -j1 (j1 is set to avoid system hang and kernel failure)
m -j4 otapackage (to build zip flashable package)

make dist (http://jhshi.me/2014/11/09/aosp-release-tools/index.html)

adb reboot bootloader
fastboot boot twrp-3.3.1-0-A6020.img 

wipe all data and partition using twrp recovery 

install aosp-10-20220109-0926-A6020.zip
install open_gapps-arm64-10.0-pico-20211217.zip