I'm trying to compile a Android Kernel from source and I believe I have downloaded all the right packages to do it but for some reason I get this error --->
arm-linux-androideabi-gcc: error: unrecognized command line option '-mgeneral-regs-only'
/home/livlogik/android/kernel/H901BK_L_Kernel/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make: *** [kernel/bounds.s] Error 1
Makefile:858: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
As it can be seen from build error message:
drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c:20:27: fatal error: ./mh1/msm_mh1.h: No such file or directory
compiler just can't find
msm_mh1.h file. This is because the path specified for
#include directive isn't correct. Most probably it's typo: instead
./ there should be
To fix that error, in
drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c file change this line:
to this line
make command should work fine. Also, kernel image file will be available at
arch/arm64/boot, and it's not
zImage as stated in documentation, it's actually
Image.gz. Uncompressed kernel image is
Answering your question in comments:
Is there any way to make it compress into a zImage?
The AArch64 kernel does not currently provide a decompressor and therefore requires decompression (gzip etc.) to be performed by the boot loader if a compressed
Image.gz) is used. For bootloaders that do not implement this requirement, the uncompressed
Imagetarget is available instead.
zImage is just gzipped and self-extracted
zImage file consists of program for unpacking gzip archive in the beginning, followed by gzipped
Image, and when kernel is run by bootloader its unpacking itself (hense "self-extracted" term) and then start running.
...So I can make it flashable
In case of arm64, you don't have
zImage, so most likely you need to use
Image file (which acts in the same way, but only its size is bigger). You can create
Image file and built AFS ramdisk (using
mkbootimg tool) and then just do
fastboot flash boot boot.img. Refer to this documentation for example. Of course for your platform some things can be different, so try to find instructions for your platform.