而试图编译在Ubuntu Android的内核错误 [英] Error while trying to compile android kernel in ubuntu
问题描述
我想从源码编译内核的Android,我相信我已经下载了所有正确的包做,但出于某种原因,我得到这个错误--->
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[1]: *** [kernel/bounds.s] Error 1
Makefile:858: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
我有最新的NDK,我使用Ubuntu 15.10 64位,如果这有助于。
I have the latest NDK and I'm using Ubuntu 15.10 64bit if this helps.
下面是我有NDK和内核--->
Here is where I have the NDK and kernel --->
NDK ---- /家庭/ livlogik /安卓/ NDK /
NDK ---- /home/livlogik/android/ndk/
内核 ---- /家庭/ livlogik /安卓/内核/ H901bk_L_Kernel /
Kernel ---- /home/livlogik/android/kernel/H901bk_L_Kernel/
如果有人能帮我,将是巨大的。很抱歉,如果这是已经发布我能找到一个答案。
If someone could help me that would be great. Sorry if this was already posted I could find a answer to it.
谢谢,
扎克
推荐答案
因为它可以从生成错误信息中可以看出:
As it can be seen from build error message:
驱动器/媒体/平台/ MSM / camera_v2 /传感器/ msm_sensor.c :20:27:致命错误:./mh1/msm_mh1.h:没有这样的文件或目录
drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c:20:27: fatal error: ./mh1/msm_mh1.h: No such file or directory
的#include< ./ MH1 / msm_mh1.h>
编译器无法找到 msm_mh1.h
文件。这是因为指定的路径的#include
指令是不正确的。最有可能是错字:代替 ./
应该有 ../
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 ../
.
要修复这个错误,在驱动器/媒体/平台/ MSM / camera_v2 /传感器/ msm_sensor.c
文件更改这一行:
To fix that error, in drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c
file change this line:
#include <./mh1/msm_mh1.h>
这行
#include "../mh1/msm_mh1.h"
在此之后制作
命令应该正常工作。此外,内核映像文件将在弓/ arm64的/ boot
,并且它不是的zImage
作为文件规定,它实际上是 Image.gz
。 Uncom pressed内核映像图片
文件。
After this 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 Image
file.
回答你的问题中的注释:
Answering your question in comments:
的有什么办法,使之融为一体preSS成的zImage?的
从<一个href=\"https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.txt\"相对=nofollow>文档/ arm64 / booting.txt :
该AArch64内核目前不提供DECOM pressor和
因此需要DECOM pression(的gzip等)被引导进行
装载机如果使用COM pressed 图片
目标(例如 Image.gz
)。对于
不实现这一要求引导程序中,uncom pressed
图片
目标可用来代替。
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
target (e.g.Image.gz
) is used. For bootloaders that do not implement this requirement, the uncompressedImage
target is available instead.
基本上的zImage
只是gzip压缩和自我提取图片
。因此,的zImage
文件由程序在开始拆包的gzip压缩文件,然后gzip压缩图片
,并运行内核时通过引导程序的拆包本身(hense自我提取一词),然后开始运行。
Basically zImage
is just gzipped and self-extracted Image
. So 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.
的 ...所以,我可以把它擦写的
在arm64的情况下,您不必的zImage
,所以最有可能你需要使用图片
文件(其作用以相同的方式,但只有其尺寸越大)。可以使用创建
工具),然后就做的boot.img
从图片
文件和内置AFS RAMDISK(mkbootimg FASTBOOT闪存启动的boot.img
。请参阅例如该文档。当然对于您的平台有些东西可以是不同的,所以要尽量找到适合你的平台的说明。
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 boot.img
from 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.
这篇关于而试图编译在Ubuntu Android的内核错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!