Introducción: Tuve un problema con la compilación, pero finalmente conseguí compilarlo e instalarlo en mi teléfono, como se explica aquí: No se encuentra el comando mkbootfs al intentar construir el kernel aosp He seguido la guía aquí: https://source.Android.com/setup/build/building-kernels
PERO... hice SIN CAMBIOS en el núcleo ya que quiero que funcione primero. Mi teléfono arranca bien, pero la pantalla táctil no funciona. ¿Me falta algo?
Para decirlo de nuevo si no estaba claro, tengo vanilla AOSP Android 11, no hizo ningún cambio, compilado el kernel, flasheado a mi teléfono, y la pantalla táctil no funciona.
Si no puedo resolverlo, al menos comparto una guía completa sobre cómo construir esto... ¡sin una pantalla táctil funcional!
Esto es exactamente lo que hice:
PREREQUISITOS:
Unlock bootloader (not covered here)
Install kernel-build-tools (not included in repo for some reason):
cd ~/
mkdir kernel-build-tools
git clone https://android.googlesource.com/kernel/prebuilts/build-tools
ls -l kernel-build-tools
nano ~/.profile
Add lines to path: (this will work as current user NOT SUDO!!)
# add Kernel tools to path
if [ -d "$HOME/kernel-build-tools/build-tools/linux-x86/bin" ] ; then
PATH="$HOME/kernel-build-tools/build-tools/linux-x86/bin:$PATH"
fi
Refresh environment: source ~/.profile
Install/Setup adb & fastboot
Download adb & fastboot & unzip:
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
sudo apt-get install unzip
unzip platform-tools-latest-linux.zip -d ~
nano ~/.profile
Add lines:
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
Update environment: source ~/.profile
Install build tools:
sudo apt-get update
sudo apt-get install -y bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
Create build directories:
mkdir -p ~/bin
mkdir -p ~/android/lineage
Install Repo cmd:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Fix Python:
sudo ln -s /usr/bin/python3 /usr/bin/python
Configure Git:
git config --global user.email "[email]"
git config --global user.name "[user]"
Turn on Caching to speed up build:
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
ccache -M 25G
PASOS:
AOSP REPO:
cd ~/
mkdir aosp && cd aosp
repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r38 --depth=1
repo sync
AOSP KERNEL REPO:
cd ~/
mkdir aosp-kernel && cd aosp-kernel
repo init -u https://android.googlesource.com/kernel/manifest -b android-msm-bonito-4.9-android11-qpr2
repo sync
KERNEL CONFIGS: (I did NOT do this; left here for reference for others)
ls -l ~/android/aosp-kernel/build.config -> [symbolic path to actual file]
->~/android/aosp-kernel/private/msm-google/build.config.bonito_no-cfi
Edit this file:
(orig) POST_DEFCONFIG_CMDS="check_defconfig && update_nocfi_config" ->
POST_DEFCONFIG_CMDS="update_nocfi_config"
*Note: This file indicates the kernel config file: bonito_defconfig
Edit & add to: ~/android/aosp-kernel/private/msm-google/arch/arm64/configs/bonito_defconfig
# Kevin added - IPTables TTL support
CONFIG_NETFILTER_XT_TARGET_HL=y
CONFIG_NETFILTER_XT_TARGET_HMARK=y
[Need a blank carriage return at bottom!]
BUILD Image.lz4 via AOSP Kernel repo: (I tried both)
build/build.sh
-OR: BUILD_CONFIG=./private/msm-google/build.config.bonito_no-cfi build/build.sh (if you want to specify a different build that the default)
CONVERT Image.lz4->boot.img via AOSP repo:
Copy newly created \aosp-kernel\out\android-msm-pixel-4.9\dist\Image.lz4
-> \aosp\device\google\bonito-kernel\
cd ~/android/aosp
source build/envsetup.sh
Setup device:
lunch aosp_sargo (Just lunch to get device list)
Make only boot image:
m bootimage
FLASH TO PHONE:
adb reboot bootloader
fastboot flash boot boot.img
fastboot reboot