From b496e59dce657c8ba18f004e46bd52e2bf031c9e Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 31 May 2024 15:26:02 +0800
Subject: [PATCH] Build:IGKBoard-All: Update driver build shell script

---
 drivers/igkboard-imx8mp/build.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/igkboard-imx8mp/build.sh b/drivers/igkboard-imx8mp/build.sh
index c552efd..0ff7d71 100755
--- a/drivers/igkboard-imx8mp/build.sh
+++ b/drivers/igkboard-imx8mp/build.sh
@@ -94,6 +94,10 @@
     export KER_PATH=$TOP_PATH/kernel/linux-imx
     export DRV_PATH=$TOP_PATH/kernel/install
 
+    export KER_VER=`echo $BSP_VER|awk -F"-" '{print $2}'`
+    export KER_MODPATH=`ls -d $DRV_PATH/lib/modules/${KER_VER}* | head -n 1`
+    export KER_MODNAME=`basename ${KER_MODPATH}`
+
     export JOBS=`cat /proc/cpuinfo | grep processor | wc -l`
 
     if [[ $BOARD =~ mx6ull ]] ; then
@@ -150,18 +154,16 @@
 
     pr_warn "start update $SRC USB WiFi driver source code"
 
-    KER_VER=`echo $BSP_VER|awk -F"-" '{print $2}'`
-
     sed -i "s|^KVER.*|KVER ?= $KER_VER|g" Makefile
     sed -i "s|^KSRC.*|KSRC := ${KER_PATH}|g" Makefile
-    sed -i "s|^MODDESTDIR.*|MODDESTDIR := ${DRV_PATH}/lib/modules/${KER_VER}-dirty/extra/|g" Makefile
+    sed -i "s|^MODDESTDIR.*|MODDESTDIR := ${KER_MODPATH}/extra/|g" Makefile
     sed -i "s|^FIRMWAREDIR.*|FIRMWAREDIR := ${DRV_PATH}/lib/firmware/|g" Makefile
 	sed -i '/depmod -a .*/d' Makefile
 
     pr_warn "start build $SRC USB WiFi driver"
     make -j ${JOBS}
 	make install
-    depmod -a -b ${DRV_PATH}/ ${KER_VER}-dirty
+    depmod -a -b ${DRV_PATH}/ ${KER_MODNAME}
 }
 
 

--
Gitblit v1.9.1