Help compiling my first kernel - Android Q&A, Help & Troubleshooting

I've been trying to build a modified kernel and decided to start out by building the kernel I'm currently using on my device from the dev's github.
without modifying anything, I followed this guide: http://forum.xda-developers.com/android/software/ultimate-guide-compile-android-kernel-t2871276
I get to the point where I type "make -j<cores>"(in step 6) and I get this:
Code:
[email protected]:~/android/kernel# make
make: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/bin/sh: 1: /root/android/kernel/arm-eabi-4.4.3/bin/arm-eabi-gcc: not found
/root/android/kernel/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 127
Makefile:958: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
I dont know what I'm doing wrong, I've tried compiling with Kali Linux and Ubuntu.
I just can't get past this part.
Eventually I want to replace the wifi drivers with a modified one to allow the device to enter monitor mode.
Could someone please help?
Thank you.

Related

[Q] Compile L9 kernel

I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
amnik said:
I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
Click to expand...
Click to collapse
Does the file exist? Look into the path mentioned. Which toolchain are you using?
Sent from my LG-P760 using xda app-developers app
N00BY0815 said:
Does the file exist? Look into the path mentioned. Which toolchain are you using?
Sent from my LG-P760 using xda app-developers app
Click to expand...
Click to collapse
Should the path " include/lge/lge_blocking_monitor.h" under kernel or somewhere?
I am following the instruction inside the P760 V20B source.
2. Kernel Build
- Untar using following command at the android folder:
tar xvzf LGP760_JB_Kernel.tar.gz
- change directory to kernel root
cd kernel
- make configuration:
make u2_p760_defconfig ARCH=arm
- make kernel zImage:
make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- zImage
amnik said:
I have difficulty to compile the L9 kernel. The terminal output "include/lge/lge_blocking_monitor.h: No such file or directory".
Here is the whole compile log:
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC arch/arm/mach-omap2/lge/lge_blocking_monitor.o
arch/arm/mach-omap2/lge/lge_blocking_monitor.c:21:46: error: include/lge/lge_blocking_monitor.h: No such file or directory
make[2]: *** [arch/arm/mach-omap2/lge/lge_blocking_monitor.o] Error 1
make[1]: *** [arch/arm/mach-omap2/lge] Error 2
make: *** [arch/arm/mach-omap2] Error 2
Anyone can give me some help?
Click to expand...
Click to collapse
Edit files that give you errors like leg_blocking_monitor.c
Lookup "include/lge/lge_blocking_monitor.h"
and change that to "../include/lge/lge_blocking_monitor.h" or it may be ../../
Several files will have to be modified
edit : #include <../include/lge/lge_blocking_monitor.h>

[HELP] How to compile android kernel

Hi guys,
I tried to compile an android kernel following the tutorials that are on this forum, but there is something that doesn't works...
I installed the libraries indicated, and downloaded both NDK and Kernel sources, and I extracted it in my home folder.
Then I changed directory in the directory of the kernel and I made the three export indicated in tutorials:
export ARCH=arm
export CROSS_COMPILE=arm-linux-androideabi- (Here I also tried with "export CROSS_COMPILE=arm-eabi-")
export PATH=$PATH:~/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
Now I choosed a .config file in the arch/arm/configs directory and I used the command:
make *file config*
make menuconfig
And then, when I use the command "make -j2", I have some problems, in fact:
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-eabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
Can you tell me where I'm wrong please?
Thanks

Syntax error after repo sync

Hey,
I'm struggling with syntax error after last repo sync of CM11. I didn't have this problem before:
[...]
Using /home/lozohcum/CM11/kernel/sony/msm7x27a as source for kernel
GEN /home/lozohcum/CM11/out/target/product/jlo/obj/KERNEL_OBJ/Makefile
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[3]: `include/generated/mach-types.h' is up to date.
/bin/sh: Syntax error: "(" unexpected
make[3]: *** [kernel/bounds.s] Error 2
make[2]: *** [prepare0] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Opuszczenie katalogu `/home/lozohcum/CM11/kernel/sony/msm7x27a'
make: *** [TARGET_KERNEL_BINARIES] Error 2
[email protected]:~/CM11$
Click to expand...
Click to collapse
do you know where is the fine which causes syntax error? I understand that there is randomly added "(" but dunno where I can find it.
Solved:
I was using linaro-4.7-13.04 toolchain to build kernel and that caused the problem.
Can you only explain me why? I want to use linaro toolchains for whole rom

Errors trying to compile a kernel

Hello guys.
I have Galaxy s8 G950F Orero. I'm trying to compile a kernel to support monitoring mode and packet injection on external wifi adapter. I got a few errors when the build started.
I'm using Ubuntu 18.04 and aarch64/aarch64-linux-android-4.9 -b pie-release toolchain64
The error is:
/home/zerocount/kernel/kernel/Makefile:614: recipe for target 'scripts' failed
make[1]: *** [scripts] Error 2
make[1]: *** Waiting for unfinished jobs....
CHK include/generated/timeconst.h
CC kernel/bounds.s
UPD include/generated/timeconst.h
/home/zerocount/kernel/kernel/kernel/bounds.c:1:0: error: unknown value 'exynos-m1+crc+nofp' for -mcpu
/*
^
/home/zerocount/kernel/kernel/kernel/bounds.c:1:0: error: unknown value 'exynos-m1' for -mtune
/home/zerocount/kernel/kernel/./Kbuild:19: recipe for target 'kernel/bounds.s' failed
make[2]: *** [kernel/bounds.s] Error 1
/home/zerocount/kernel/kernel/Makefile:1117: recipe for target 'prepare0' failed
make[1]: *** [prepare0] Error 2
/home/zerocount/kernel/kernel/drivers/sensorhub/brcm/Makefile:57: ANDROID_MAJOR_VERSION : p
/home/zerocount/kernel/kernel/drivers/sensorhub/brcm/Makefile:58: ANDROID_PLATFORM_VERSION : 990000
make[1]: Leaving directory '/home/zerocount/kernel/out'
Makefile:150: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
I don't get it why it has to be so hard to build a kernel... I got errors and nothing more. Everytime i type make O=../out -j5 i got different errors.

Changing defconfig in kernel source tree

I want to add an option in a defconfig in the msm Android 10 kernel. Whenever I change the defconfig and run
build/build.sh
I get following error:
Code:
...
HOSTLD scripts/genksyms/genksyms
HOSTLD scripts/mod/modpost
UPD include/config/kernel.release
Using /home/mbuch/kernels/msm/private/msm-google as source for kernel
/home/mbuch/kernels/msm/private/msm-google is not clean, please run 'make mrproper'
in the '/home/mbuch/kernels/msm/private/msm-google' directory.
/home/mbuch/kernels/msm/private/msm-google/Makefile:1148: recipe for target 'prepare3' failed
make[2]: *** [prepare3] Error 1
Makefile:152: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
Makefile:24: recipe for target '__sub-make' failed
make: *** [__sub-make] Error 2
To change the defconfig I ran the following commands:
1. Copy existing defconfig template to arch/arm64/configs/mydefconfig
2. From private/msm-google I run
Code:
make ARCH=arm64 mydefconfig
make ARCH=arm64 savedefconfig
build/build.sh

Categories

Resources