Skip to content

Commit

Permalink
common/build: add backports modules build
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Bisson <[email protected]>
  • Loading branch information
gibsson committed Apr 8, 2024
1 parent 44f3d29 commit 4efd0a6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include ${product_path}/SharedBoardConfig.mk
include ${product_path}/UbootKernelBoardConfig.mk

include ${nxp_git_path}/common/build/kernel.mk
include ${nxp_git_path}/common/build/backports.mk
include ${nxp_git_path}/common/build/uboot.mk
-include ${product_path}/AndroidUboot.mk
-include ${product_path}/AndroidTee.mk
Expand Down
27 changes: 27 additions & 0 deletions common/build/backports.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BACKPORTS_PATH ?= $(ANDROID_BUILD_TOP)/vendor/boundary/backports/backport
BACKPORTS_OUT ?= $(TARGET_OUT_INTERMEDIATES)/BACKPORTS_OBJ

backports_build_make_env = KLIB_BUILD=$(realpath $(KERNEL_OUT)) ARCH=$(KERNEL_ARCH) \
CROSS_COMPILE=$(strip $(KERNEL_CROSS_COMPILE_WRAPPER)) $(CLANG_TO_COMPILE) \
KCFLAGS="$(KERNEL_CFLAGS) -Wno-strict-prototypes" KAFLAGS="$(KERNEL_AFLAGS)" -C $(BACKPORTS_PATH)

backports: $(BACKPORTS_PATH)
if [ ${clean_build} = 1 ]; then \
rm -rf $(BACKPORTS_OUT) ; \
$(kernel_build_shell_env) $(MAKE) $(backports_build_make_env) mrproper ; \
fi ;
mkdir -p $(BACKPORTS_OUT) ;
# workaround qcacld needing stdarg.h header
if [ ! -e $(BACKPORTS_PATH)/drivers/net/wireless/laird/qcacld/CORE/VOSS/inc/stdarg.h ]; then \
cp -v $(realpath $(TARGET_KERNEL_SRC)/include/linux/stdarg.h) \
$(BACKPORTS_PATH)/drivers/net/wireless/laird/qcacld/CORE/VOSS/inc/ ; \
fi ;
# use custom defconfig for our devices
if [ ! -e $(BACKPORTS_PATH)/.config ]; then \
cp -v $(realpath device/boundary/common/wifi/bdimx8) $(BACKPORTS_PATH)/defconfigs/ ;\
$(kernel_build_shell_env) $(MAKE) $(backports_build_make_env) defconfig-bdimx8 ; \
fi ;
$(kernel_build_shell_env) $(MAKE) $(backports_build_make_env)
$(kernel_build_shell_env) find $(BACKPORTS_PATH) -name "*.ko" -exec \
llvm-strip --strip-debug {} \;
find $(BACKPORTS_PATH) -name "*.ko" -exec cp -v {} $(BACKPORTS_OUT) \;
12 changes: 11 additions & 1 deletion common/tools/imx-make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cat << EOF
prebuilt-bootloader download latest prebuilt bootloader from BD server
bootloader bootloader will be compiled
kernel kernel, include the kernel modules and device tree files will be compiled
backports backports wlan & bt modules
galcore galcore.ko in GPU repo will be compiled
vvcam vvcam.ko, the ISP driver will be compiled
mxmwifi mlan.ko moal.ko, the MXMWifi driver will be compiled
Expand Down Expand Up @@ -92,6 +93,7 @@ build_kernel=""
build_kernel_modules=""
build_kernel_dts=""
build_kernel_oot_module_flag=0
build_backports=""
build_galcore=""
build_vvcam=""
build_mxmwifi=""
Expand Down Expand Up @@ -123,6 +125,8 @@ for arg in ${args[*]} ; do
kernel) build_kernel="${OUT}/kernel";
build_kernel_modules="KERNEL_MODULES";
build_kernel_dts="KERNEL_DTB";;
backports) build_kernel_oot_module_flag=1;
build_backports="backports";;
galcore) build_kernel_oot_module_flag=1;
build_galcore="galcore";;
vvcam) build_kernel_oot_module_flag=1
Expand Down Expand Up @@ -165,6 +169,12 @@ if [ -n "${build_kernel_modules}" ] && [[ "${TARGET_PRODUCT}" =~ "8mp" ]]; then
build_kernel_oot_module_flag=1;
fi

# build backports driver modules for platform with wifi feature
if [ -n "${build_kernel_modules}" ] && grep -q "android.hardware.wifi.xml" $product_makefile ; then
build_backports="backports";
build_kernel_oot_module_flag=1;
fi

# if uboot is to be compiled, remove the UBOOT_COLLECTION directory
if [ -n "${build_bootloader}" ]; then
rm -rf ${OUT}/obj/UBOOT_COLLECTION
Expand Down Expand Up @@ -196,7 +206,7 @@ fi
if [ ${build_kernel_oot_module_flag} -eq 1 ] || [ -n "${build_kernel_modules}" ]; then
soc_path=${soc_path} product_path=${product_path} nxp_git_path=${nxp_git_path} clean_build=${clean_build} \
skip_config_or_clean=${skip_config_or_clean} make -C ./ -f ${nxp_git_path}/common/build/Makefile ${parallel_option} \
${build_vvcam} ${build_galcore} ${build_mxmwifi} ${build_qcacld} </dev/null || exit
${build_vvcam} ${build_galcore} ${build_mxmwifi} ${build_backports} </dev/null || exit
fi

if [ ${build_android_flag} -eq 1 ] || [ ${build_whole_android_flag} -eq 1 ]; then
Expand Down

0 comments on commit 4efd0a6

Please sign in to comment.