summaryrefslogtreecommitdiff
path: root/buildkernel.sh
diff options
context:
space:
mode:
authorRaghavendra Rao Ananta <rananta@codeaurora.org>2020-03-12 22:56:37 -0700
committerRaghavendra Rao Ananta <rananta@codeaurora.org>2020-03-12 22:56:37 -0700
commit822f820f288485419ce76502edf97ef50768e6d8 (patch)
tree59e7c05ef18c3c95aafa96efc6f382850398a807 /buildkernel.sh
parentd5c37efdde6724977baa5286f53622cd6bec5b29 (diff)
buildkernel: Clean the dlkm directory prior to copying the binaries
In the case of incremental builds it's possible that the $KERNEL_MODULES_OUT directory contains stale .ko files from previous builds. This would inturn get packaged into the final image, which is incorrect. Hence, make sure to clean and start with a fresh directory to stage the modules. Change-Id: I7c22527baf9d181f1aa88a12fd8123ec35342fda Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
Diffstat (limited to 'buildkernel.sh')
-rwxr-xr-xbuildkernel.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/buildkernel.sh b/buildkernel.sh
index d11e7b5..b018f5d 100755
--- a/buildkernel.sh
+++ b/buildkernel.sh
@@ -145,9 +145,10 @@ copy_modules_to_prebuilt()
{
PREBUILT_OUT=$1
- if [[ ! -e ${KERNEL_MODULES_OUT} ]]; then
- mkdir -p ${KERNEL_MODULES_OUT}
- fi
+ # Clean the DLKM directory to remove stale modules
+ rm -rf ${KERNEL_MODULES_OUT}
+
+ mkdir -p ${KERNEL_MODULES_OUT}
MODULES=$(find ${MODULES_STAGING_DIR} -type f -name "*.ko")
if [ -n "${MODULES}" ]; then