有没有关于机型适配 device 改造的教程文章

有没有关于机型适配 device 改造的教程文章
0

红米 Note 8 的 kernel、vendor、device 都已经有开源的了,想适配 mokee,kernel、vendor 基本不用改太多,主要是 device 部分,代码依赖要改很多,已经参照已有的、类似平台机型的 device 做了很多修改,主要是 mokee sdk lib 相关的,但是还是报错。

lunch 之后输出的机型编译信息:

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=10
MK_VERSION=MK009–202005151543-EXPERIMENTAL
TARGET_PRODUCT=mk_ginkgo
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-99-generic-x86_64-Ubuntu-16.04.6-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=GSX.200514.009
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=vendor/xiaomi/ginkgo device/xiaomi/ginkgo

make 报错信息:
[100% 2/2] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
error: vendor/mokee/build/soong/Android.bp:32:8: module “generated_kernel_includes”: cmd: unknown variable ‘$(KERNEL_MAKE_CMD)’
16:12:27 soong bootstrap failed with: exit status 1

failed to build some targets (40 seconds)

想着简单的把该部分代码注释,删除依赖 generated_kernel_includes 的 bp 文件,最后还是不断编译报错,不知道有没有关于机型适配的教程文章?

发现是 vendor/mokee/config/BoardConfigMoKee.mk include了相关的mk文件
在源码根目录grep BoardConfigMoKee,发现并没有谁主动include这个mk文件啊,去device下边官方支持的机型目录,也未找到可能include这个mk文件的语句
在device/xiaomi/ginkgo/BoradConfig.mk,include了这个文件,发现可以进入编译了。

后边又遇到一个error:

make: Entering directory ‘/home/jokerman/space/mokee/alpha_q_mr1/kernel/xiaomi/ginkgo’
make[1]: Entering directory ‘/home/jokerman/space/mokee/alpha_q_mr1/out/target/product/ginkgo/obj/KERNEL_OBJ’
ccache: error: Could not find compiler “clang” in PATH

编译kernel时候,ccache报错,一个一个解决吧…

找了一些文章,从头开始学吧 - -!

https://source.android.com/setup/develop/new-device