diff options
author | Raghavendra Rao Ananta <rananta@codeaurora.org> | 2020-03-12 22:56:37 -0700 |
---|---|---|
committer | Ashwini Muduganti <amudugan@codeaurora.org> | 2020-03-14 14:15:24 -0700 |
commit | e48d9d865ed846b2834231823efbd6b9c02722d3 (patch) | |
tree | 59e7c05ef18c3c95aafa96efc6f382850398a807 | |
parent | ba0b31a28f7b6292f26c0a31809f7d534458f4aa (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>
-rwxr-xr-x | buildkernel.sh | 7 |
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 |