The purpose of this document is to provide a guide on how to export new symbols using the Bazel Android server instead of the build_abi.sh script.
For a better reference how to build Android i.MX image please look at the next chapter 3 Building the Android Platform for i.MX in the Android User's Guide
1. Compile full AOSP or only kernel
Build full AOSP:
$ source build/envsetup.sh
$ lunch evk_8mp-eng
$ ./imx-make.sh -j8
Only build the kernel:
$ ./imx-make.sh kernel -j8
2. Generic Kernel Image GKI Development
Download GKI outside of android_build (MY_ANDROID).
# Make sure MY_ANDROID is set to the android_build folder.
$ export MY_ANDROID=`pwd`
# mkdir gki && cd gki (Make sure folder gki is not inside of ${MY_ANDROID})
$ repo init -u https://android.googlesource.com/kernel/manifest -b common-android14-6.1
$ repo sync
$ cd common
3. Export New Symbols
Switch the kernel in this common folder from AOSP to its device, and apply the patches required for your project. In this case Android
$ cd common
$ git remote add device https://github.com/nxp-imx/linux-imx.git
$ git remote update
$ git fetch device --tags
$ git checkout android-14.0.0_1.2.0
$ cd ..
$ ln -s ${MY_ANDROID}/vendor/nxp-opensource/verisilicon_sw_isp_vvcam verisilicon_sw_isp_vvcam
$ ln -s ${MY_ANDROID}/vendor/nxp-opensource/nxp-mwifiex nxp-mwifiex
$ BUILD_FOR_GKI=yes BUILD_CONFIG=common/build.config.imx
$ EXT_MODULES_MAKEFILE="verisilicon_sw_isp_vvcam/vvcam/v4l2/Kbuild"
$ EXT_MODULES="nxp-mwifiex/mxm_wifiex/wlan_src"
Note: Be sure that your Symbolic Link is pointing to the correct folder
Open the Makefile in the following path ../gki/nxp-mwifiex/mxm_wifiex/wlan_src/ and erase some ifreq lines that will generate a No such file or directory error.
#Automatically determine Android version from build information to streamline diff --git a/mxm_wifiex/wlan_src/Makefile b/mxm_wifiex/wlan_src/Makefile
index 3ec5308..7b6ca47 100644
--- a/mxm_wifiex/wlan_src/Makefile
+++ b/mxm_wifiex/wlan_src/Makefile
@@ -139,20 +139,7 @@ CONFIG_ANDROID_KERNEL=y
ifeq ($(ANDROID_PRODUCT_OUT),1)
ccflags-y += -DANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)
else
-include $(ANDROID_BUILD_TOP)/build/make/core/build_id.mk
-ifeq ($(shell echo "$(BUILD_ID)" | cut -c1),R)
- ccflags-y += -DANDROID_SDK_VERSION=30
-else ifeq ($(shell echo "$(BUILD_ID)" | cut -c1),S)
- ccflags-y += -DANDROID_SDK_VERSION=31
-else ifeq ($(shell echo "$(BUILD_ID)" | cut -c1),T)
- ccflags-y += -DANDROID_SDK_VERSION=33
-else ifeq ($(shell echo "$(BUILD_ID)" | cut -c1),U)
- ccflags-y += -DANDROID_SDK_VERSION=34
-else
- # Default optimization or actions
- ANDROID_SDK_VERSION := 0
- ccflags-y += -DANDROID_SDK_VERSION
-endif
+ccflags-y += -DANDROID_SDK_VERSION=34
endif
endif
endif
--
Then you could update the symbol list by typing the following command.
$ tools/bazel run //common:imx_abi_update_symbol_list
After the build process is successful, you should get an output like the image below.
Build GKI locally.
$ tools/bazel run //common:kernel_aarch64_dist
You could follow the next chapters to update the GKI image to your boot image.