我最近尝试对android10内核进行编译,个人感觉现在android内核很难编译,编译出来得都没有触屏功能,早先那些修改内核缺省配置文件: b1c1_defconfig的方法好像都失效了。即使将那些必须的触屏加入到这个文件,但是根本无法生效,编译生成的新配置文件和最终的编译结果还是原先的,根本没变。楼主有什么好的方法吗?多谢
我的手机是pixel3的,打算用android10,所以下载的版本是: android-msm-crosshatch-4.9-android10
在ubuntu20.04上编译的,一切正常,顺利的编译完成了。接着我更换了内核。
adb reboot bootloader
fastboot boot Image.lz4-dtb
但当我更换了新的镜像之后,手机完全没有反应,无法操作,无奈刷机恢复:
在网上查询,发现原始编译的内核不支持手机触屏,于是,我需要将下面配置定制到手机的配置中,但是,我尝试了很多次,完全做不到。
修改b1c1_defconfig之后,直接编译会报编译错误,
#需要修改的配置:
#add by fly
CONFIG_MODVERSIONS=n
CONFIG_MODULE_SIG=n
CONFIG_MODULE_SIG_FORCE=n
CONFIG_MODULE_SIG_SHA512=n
CONFIG_MODULE_SIG_ALL=n
CONFIG_QCA_CLD_WLAN=y
CONFIG_QCACLD_WLAN_LFR3=y
CONFIG_PRIMA_WLAN_OKC=y
CONFIG_PRIMA_WLAN_11AC_HIGH_TP=y
CONFIG_WLAN_FEATURE_11W=y
CONFIG_WLAN_FEATURE_LPSS=y
CONFIG_QCOM_VOWIFI_11R=y
CONFIG_HELIUMPLUS=y
CONFIG_QCOM_TDLS=y
CONFIG_QCOM_LTE_COEX=y
CONFIG_MPC_UT_FRAMEWORK=y
CONFIG_WLAN_OFFLOAD_PACKETS=y
CONFIG_WLAN_FASTPATH=y
CONFIG_WLAN_NAPI=y
CONFIG_WLAN_TX_FLOW_CONTROL_V2=y
CONFIG_WLAN_SYNC_TSF=y
CONFIG_LFR_SUBNET_DETECTION=y
CONFIG_MCC_TO_SCC_SWITCH=y
CONFIG_QCACLD_WLAN_LFR2=y
CONFIG_WLAN_FEATURE_DISA=y
CONFIG_WLAN_SPECTRAL_SCAN=y
因为单纯修改了b1c1_defconfig后,编译会直接报错。
savedefconfig does not match
所以修改b1c1_defconfig之后需要调整:
- 注释掉里面的
POST_DEFCONFIG_CMDS
行build.config
- 这些执行
check_defconfig
,update_nocfig_config
这将阻止您自定义 defconfig
- 我注释掉了 makefile 中如下代码(
msm/private/msm-google/Makefile
):#ifneq ($(KBUILD_SRC),)
# @$(kecho) ' Using $(srctree) as source for kernel'
# $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
# echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \
# echo >&2 " in the '$(srctree)' directory.";\
# /bin/false; \
# fi;
#endif
接着我执行了如下步骤:
$ cd private/msm-google
$ make ARCH=arm64 b1c1_defconfig
$ make menuconfig
现在编辑内核配置并将其保存为“ .config ”,这是默认的。
完成后:
代码:
$ make savedefconfig
但是当我对比的时候,发现修改根本没有生效。
diff -u .config ./arch/arm64/configs/my_defconfig | diffstat
我编译之后,镜像和原来的大小还是一样的,安装之后,依然没有触屏功能。
无论我怎么操作,这个针对配置文件b1c1_defconfig的修改始终都无法生效,
这样的话也就无法为手机添加触屏功能。
请大神们多多指教,多谢。
我添加了调试项:
make ARCH=arm64 b1c1_defconfig --debug
发现修编译中找不到b1c1_defconfig文件
File 'b1c1_defconfig' does not exist.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
File 'b1c1_defconfig' does not exist.
File 'scripts_basic' does not exist.
Must remake target 'scripts_basic'.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
File '__build' does not exist.
File 'FORCE' does not exist.
Must remake target 'FORCE'.
Successfully remade target file 'FORCE'.
Prerequisite 'FORCE' of target 'scripts/basic/fixdep' does not exist.
Must remake target 'scripts/basic/fixdep'.
Successfully remade target file 'scripts/basic/fixdep'.
Must remake target '__build'.
Successfully remade target file '__build'.
Successfully remade target file 'scripts_basic'.
File 'outputmakefile' does not exist.
Must remake target 'outputmakefile'.
Successfully remade target file 'outputmakefile'.
File 'FORCE' does not exist.
Must remake target 'FORCE'.
Successfully remade target file 'FORCE'.
Must remake target 'b1c1_defconfig'.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
File 'b1c1_defconfig' does not exist.
File 'FORCE' does not exist.
Must remake target 'FORCE'.
Successfully remade target file 'FORCE'.
Prerequisite 'FORCE' of target 'scripts/kconfig/conf.o' does not exist.
Must remake target 'scripts/kconfig/conf.o'.
Successfully remade target file 'scripts/kconfig/conf.o'.
Prerequisite 'FORCE' of target 'scripts/kconfig/zconf.tab.o' does not exist.
Must remake target 'scripts/kconfig/zconf.tab.o'.
Successfully remade target file 'scripts/kconfig/zconf.tab.o'.
Prerequisite 'FORCE' of target 'scripts/kconfig/conf' does not exist.
Must remake target 'scripts/kconfig/conf'.
Successfully remade target file 'scripts/kconfig/conf'.
Must remake target 'b1c1_defconfig'.
#
# configuration written to .config
#
Successfully remade target file 'b1c1_defconfig'.
Successfully remade target file 'b1c1_defconfig'.
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
最后于 2022-6-5 08:37
被david1008编辑
,原因: