简体   繁体   English

android内核构建(第一次)

[英]android kernel build (first time)

Ok so first off, Im brand new to android dev. 好的,首先,我是android开发人员的新手。 This is my first attempt at any form of kernel anything. 这是我第一次尝试任何形式的内核。 I have a limited knowledge of java and python, but no C. 我对Java和python的了解有限,但没有C。

I have a galaxy tab 4 sm-t330nu running 4.4.2. 我有一个运行4.4.2的星系标签4 sm-t330nu。 its running a qualcomm snapdragon 400 msm8226 cpu. 它运行的是高通骁龙400 msm8226 cpu。 im simply trying to do a test build with a vanilla kernel at this point. 我只是在此时尝试使用香草内核进行测试构建。 (also my build environment is the newest kali 1.1 and im loosely following the tutorial at https://github.com/offensive-security/kali-nethunter/wiki/Porting-Nethunter ) (也是我的构建环境是最新的kali 1.1,我大致遵循https://github.com/offensive-security/kali-nethunter/wiki/Porting-Nethunter上的教程)

so i have all of the required dependencies (i hope), and ive downloaded my source from samsung opensource. 所以我拥有所有必需的依赖项(我希望),并且我从三星开源网站下载了我的源代码。 unzipped and went through the available defconfigs. 解压缩并通过可用的defconfigs。 after finding "msm8226-sec_milletwifiue_defconfig" i decided it was the most likely candidate for my tablet. 找到“ msm8226-sec_milletwifiue_defconfig”后,我认为它是平板电脑最有可能的候选人。 (when doing a custom recovery i remember it being "philz touch milletwifiue something) (当执行自定义恢复时,我记得它是“ philz touch milletwifiue something”)

Ive done my exports (arch= subarch= cross_compile=) and all seems well. 我已经完成了导出(arch = subarch = cross_compile =),一切似乎都很好。 When i run a build following exactly as the tutorial says (using the defconfig in their example as a test) i receive an error stating "must define variant_defconfig". 当我完全按照教程中的说明运行构建时(使用其示例中的defconfig作为测试),我收到一条错误消息,指出“必须定义variant_defconfig”。 So i instead do "make variant_defconfig=msm8974_sec_defconfig" and it builds great. 因此,我改为执行“ make variant_defconfig = msm8974_sec_defconfig”,它的构建很棒。

Now the issue: When i change "msm8974_sec_defconfig" to my actual msm8226 i receive an error on every build that i cannot seem to workaround. 现在的问题是:当我将“ msm8974_sec_defconfig”更改为我的实际msm8226时,我会在似乎无法解决的每个构建上收到错误。 (cut down for size) (缩小尺寸)

CC      arch/arm/kernel/armksyms.o
CC      arch/arm/kernel/module.o
AS      arch/arm/kernel/sleep.o
CC      arch/arm/kernel/suspend.o
CC      arch/arm/kernel/io.o
arch/arm/kernel/io.c: In function '_memcpy_fromio':
arch/arm/kernel/io.c:14:3: error: implicit declaration of function 'nop'     [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/kernel/io.o] Error 1
make: *** [arch/arm/kernel] Error 2

My exact bash line reads 我确切的bash行显示

make VARIANT_DEFCONFIG=msm8226-sec_milletwifiue_defconfig

Any assistance on clearing this up would be great 任何帮助清除此问题的方法都会很棒

edit 编辑
although im not familiar with c, it seems to me that '_memcpy_fromio' is where the error lies. 尽管我不熟悉c,但在我看来,“ _ memcpy_fromio”是错误所在。 and my google searches tell me that the error is that a function is used without being declared. 和我的谷歌搜索告诉我,错误是一个函数未声明使用。 however i dont know if memcpy is a function? 但是我不知道memcpy是否是一个函数? or is the function within class memcpy (dont know if c has classes just closest equivalent that i know of) how do i debug this code and declare what needs to be declared (more importantly, if this is a stock kernel thats used by thousands of devices, how can it possibly have an undeclared function? 还是memcpy类中的函数(不知道c是否具有我所知道的最接近的类)我该如何调试该代码并声明需要声明的内容(更重要的是,如果这是数千个使用的普通内核)设备,它怎么可能具有未声明的功能?
/edit /编辑

found the answer! 找到了答案! needed 需要

#import linux/modules.h
#import linux/kernel.h

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM