flar2 / marlin

ElementalX for Google Pixel
Other
21 stars 15 forks source link

Build Instructions? #5

Open gudenau opened 5 years ago

gudenau commented 5 years ago

I have tried to build this kernel a few times and have not managed to do so successfully. I wish to build it to create kernel modules for some kernel modifications without having to flash anything.

0E800 commented 5 years ago

@gudenau This will get you up to speed:

https://forum.xda-developers.com/android/software-hacking/reference-how-to-compile-android-kernel-t3627297

the gist of it:

git clone the kernel source git clone toolchain or use whatever is bundled with the rom you will compile check prebuild/gcc. goto your kernel source dir type something like this to let the build know what toolchain to use

export ARCH=arm64

export CROSS_COMPILE=/coolrom/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-

export CROSS_COMPILE_ARM32=/coolrom/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-

then type make elementalx_defconfig

next type: make menuconfig

enable the kernel options and setting you want

then type make -j$(nproc --all)

if the build succeeds then you will find the Image in build/arch/arm64/boot

You will need to use a tool to get the image into a flashable zip form.

to save your kernel config to make it quicker to build, you can type:

cp .config arch/arm64/configs/mykernel_defconfig

if the build fails then troubleshoot the errors by inspecting the files that error. before you rebuild you will need to clean the failed one type make mrproper to clean the build kernel build and start over.