开始发现这个问题始于我要在msm8916_M8_deconfig文件中加入编译TP的驱动,结果添加后没有作用,于是就查看make kernel 的编译log,如下
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
No private recovery resources for TARGET_DEVICE msm8916_32
vendor/qcom/build/tasks/generate_extra_images.mk:74: 警告:覆盖关于目标“out/target/product/msm8916_32/persist.img”的命令
device/qcom/common/generate_extra_images.mk:74: 警告:忽略关于目标“out/target/product/msm8916_32/persist.img”的旧命令
vendor/qcom/build/tasks/generate_extra_images.mk:104: 警告:覆盖关于目标“out/target/product/msm8916_32/dt.img”的命令
device/qcom/common/generate_extra_images.mk:104: 警告:忽略关于目标“out/target/product/msm8916_32/dt.img”的旧命令
记录了616+0 的读入
记录了616+0 的写出
630784字节(631 kB)已复制,0.0065 秒,315 MB/秒
vendor/qcom/build/tasks/generate_extra_images.mk:156: 警告:覆盖关于目标“out/target/product/msm8916_32/system/etc/cdrom_install.iso”的命令
device/qcom/common/generate_extra_images.mk:156: 警告:忽略关于目标“out/target/product/msm8916_32/system/etc/cdrom_install.iso”的旧命令
vendor/qcom/build/tasks/generate_extra_images.mk:403: 警告:覆盖关于目标“kernelclean”的命令
device/qcom/common/generate_extra_images.mk:403: 警告:忽略关于目标“kernelclean”的旧命令
make -C kernel O=../out/target/product/msm8916_32/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=arm-eabi- msm8916_defconfig
make[1]: 正在进入目录 `/home/litao/8x12_project/8939_TCL/kernel'
GEN /home/litao/8x12_project/8939_TCL/out/target/product/msm8916_32/obj/KERNEL_OBJ/Makefile
arch/arm/configs/msm8916_defconfig:330:warning: override: reassigning to symbol VIDEOBUF2_MSM_MEM
arch/arm/configs/msm8916_defconfig:470:warning: override: reassigning to symbol MSM_WATCHDOG_V2
warning: (SND_SOC_QDSP6V2) selects SND_SOC_MSM_QDSP6V2_INTF which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && MSM_QDSP6_APRV2)
warning: (ARCH_MSM_KRAIT && ARCH_MSM8916) selects DEVFREQ_GOV_MSM_BW_HWMON which has unmet direct dependencies (PM_DEVFREQ && (ARCH_MSM_KRAIT || ARCH_MSM_BIMC_BWMON))
warning: (SND_SOC_QDSP6V2) selects SND_SOC_MSM_QDSP6V2_INTF which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && MSM_QDSP6_APRV2)
warning: (ARCH_MSM_KRAIT && ARCH_MSM8916) selects DEVFREQ_GOV_MSM_BW_HWMON which has unmet direct dependencies (PM_DEVFREQ && (ARCH_MSM_KRAIT || ARCH_MSM_BIMC_BWMON))
#
# configuration written to .config
我需要的config文件是kernel/arch/arm/configs/msm8916_M8_defconfig,于是开始查看这个文件是怎样解析到的
找了一个之前的项目,查看log做对比,找到一句log---$(MAKE) -C kernel O=../$(KERNEL_OUT) ARCH=arm CROSS_COMPILE=arm-eabi- $(KERNEL_DEFCONFIG)
看到这句话是在out目录下的,但是有个疑问,KERNEL_DEFCONFIG这个文件是在哪里定义的,这个文件在kernl ,out目录下都有,而且上边的那句log在这两个目录下也有,于是就删减一些东西,判断应该是走的kernel下的AndroidKernel.mk,最后百度了下,得到如下:
/xwiki/bin/QAEP/Detailed Build Instructions
Make sure that the environment has been completely and correctly as described by the Android Open Source Projectinstructionsbefore attempting to build. If you get build errors about clearsilver.jni, verify the Java version and path. (javac version 1.5.0_16 is verfied as working).
Once the environment has been configured build Android as follows
Theenvsetup.shscript is responsible for setting Bash environment variables required by the Android build system.
Now usechoosecomboto set the desired build by specifyingBuild,Type,ProductandVariant.
Choosecombo is interactive or it can take arguments on the commandline
Start the build
By default, the build system uses the tip of kernel source from <platform>/kernel directory, including any modifications you've made.
If you want to compile the kernel with a specific configuration file other than the one defined in vendor/qcom/<product>/AndroidBoard.mk (e.g. msm7201a_defconfig) pass the KERNEL_DEFCONFIG flag on the Make command line.
The kernel objects, vmlinux and zImage will be at <platform>/out/target/product/msm7201a_surf/obj/KERNEL_OBJ and its subdirectories.
You can override the TARGET_PREBUILT_KERNEL flag with your own kernel image to build android with your kernel, as follows:
You can also build ''tiny android'' which is an Android build with a limited user-space environment useful for kernel development and verification. The ''tinyandroid'' build will not boot into the full UI. It will stay at one of the loading screens. ADB will be active, allowing you to run unit tests, etc. The build time for ''tiny android'' is significantly less than a full Android build.
You can also tell the build system to echo to stdout the full commands and parameters that it would use in building each file without actually building the file. This is useful to see all the compiler options provided
这个定义原来在vendor/../../device/qcom/msm8916_32/AndroidBoard.mk中,定义如下:
LOCAL_PATH := $(call my-dir)
#----------------------------------------------------------------------
# Compile (L)ittle (K)ernel bootloader and the nandwrite utility
#----------------------------------------------------------------------
ifneq ($(strip $(TARGET_NO_BOOTLOADER)),true)
# Compile
include bootable/bootloader/lk/AndroidBoot.mk
$(INSTALLED_BOOTLOADER_MODULE): $(TARGET_EMMC_BOOTLOADER) | $(ACP)
$(transform-prebuilt-to-target)
$(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_BOOTLOADER_MODULE)
droidcore: $(INSTALLED_BOOTLOADER_MODULE)
endif
#----------------------------------------------------------------------
# Compile Linux Kernel
#----------------------------------------------------------------------
ifeq ($(KERNEL_DEFCONFIG),)
KERNEL_DEFCONFIG := msm8916_defconfig
endif
include kernel/AndroidKernel.mk