Advertisement
metalx1000

Compile Android Kernel - Moto X4

Jul 7th, 2020
2,156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. #https://usmile.at/blog/how-to-build-android-kernel
  2. #https://gist.github.com/tangabc/a7767b5b22d2b44062e1b9636ba9f711
  3.  
  4. sudo apt install gcc-arm-linux-gnueabi build-essential git make libncurses5 libncurses5-dev python2 libssl-dev gcc-aarch64-linux-gnu bc
  5. #sudo dpkg --add-architecture i386
  6. #sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386 libz-dev:i386
  7.  
  8. mkdir kernel
  9. cd kernel
  10.  
  11. #get moto x4 kernel source
  12. wget "https://github.com/MotorolaMobilityLLC/kernel-msm/archive/MMI-PPVS29.266-45-6.tar.gz"
  13. tar xzvf MMI-PPVS29.266-45-6.tar.gz
  14.  
  15. #get toolchain
  16. #git clone https://android.googlesource.com/platform/prebuilt
  17. git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8
  18.  
  19. #set compile vars
  20. export ARCH=arm64
  21. export SUBARCH=arm64
  22. # export CROSS_COMPILE=<path to toolchain from googlesource>/toolchains/arm-eabi-4.4.3/bin/arm-eabi-
  23. #export CROSS_COMPILE=$PWD/prebuilt/linux-x86/toolchains/arm-eabi-4.4.3/bin/arm-eabi-
  24. #export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-
  25. export CROSS_COMPILE=/root/kernel/aarch64-linux-android-4.8/bin/aarch64-linux-android-
  26.  
  27. cd kernel-msm-MMI-PPVS29.266-45-6
  28. make defconfig
  29. //optional for configuration of the kernel
  30. # make menuconfig
  31.  
  32. make -j4 #number of cpu cores
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement