meta-rcar-gen3/setup_mm_packages.sh: always clean workdir 84/21684/2
authorStephane Desneux <stephane.desneux@iot.bzh>
Thu, 20 Jun 2019 07:41:04 +0000 (07:41 +0000)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 20 Jun 2019 10:54:39 +0000 (10:54 +0000)
The script setup_mm_packages.sh setups a temp dir to extract proprietary
drivers for Renesas BSP, but it's not re-entrant: the temp dir is not cleaned
after execution.

With the introduction of the change 9bc6c25 (hotfix for GFX issues), more cleanup
is needed to avoid duplicate zips detection in the copy script located in
meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh

This change makes some initial cleanup in the workdir (in case of transition
from a previous script without this patch) and also removes the workdir at the end

Bug-AGL: SPEC-2253, SPEC-2480

Change-Id: Ia95f9045d8a695d550a061710a17676088a92c0a
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
meta-agl-bsp/meta-rcar-gen3/scripts/setup_mm_packages.sh

index 798ebfb..f53025e 100644 (file)
@@ -44,6 +44,9 @@ function log() {
 }
 
 function copy_mm_packages() {
+       # first clean up workdir
+       [[ -d $EXTRACT_DIR ]] && rm -r $EXTRACT_DIR
+
     if [ -f $DOWNLOAD_DIR/$ZIP_1 -a -f $DOWNLOAD_DIR/$ZIP_2 ]; then
         mkdir -p $EXTRACT_DIR
         cp --update $DOWNLOAD_DIR/$ZIP_1 $EXTRACT_DIR
@@ -113,4 +116,7 @@ function copy_mm_packages() {
     rm -r $EXTRACT_DIR/$GFX_ARCHIVE_NAME
 
     log   "The graphics hotfix for BUG SPEC-2253 has been successfully applied."
+
+       # clean up workdir if not done by older script
+       rm -r $EXTRACT_DIR
 }