Update rcar gen3 script, compliant driver update
[AGL/meta-agl.git] / meta-agl-bsp / meta-rcar-gen3 / scripts / setup_mm_packages.sh
1 #!/bin/bash
2
3 ZIP_1="R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20170125.zip"
4 ZIP_2="R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20170125.zip"
5
6 COPY_SCRIPT="$METADIR/meta-renesas-rcar-gen3/meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh"
7
8 test -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs && source ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs
9 DOWNLOAD_DIR=${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
10 EXTRACT_DIR=$METADIR/binary-tmp
11
12
13 function copy_mm_packages() {
14         if [ -f $DOWNLOAD_DIR/$ZIP_1 -a -f $DOWNLOAD_DIR/$ZIP_2 ]; then
15                 mkdir -p $EXTRACT_DIR
16                 unzip -n $DOWNLOAD_DIR/$ZIP_1 -d $EXTRACT_DIR
17                 if [ $? -ne 0 ]; then
18                     echo -e "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_1+"\" NOT EXTRACTING CORRECTLY"
19                     return 1
20                 fi
21                 unzip -n $DOWNLOAD_DIR/$ZIP_2 -d $EXTRACT_DIR
22                 if [ $? -ne 0 ]; then
23                     echo -e "ERROR: FILES \""+$DOWNLOAD_DIR/$ZIP_2+"\" NOT EXTRACTING CORRECTLY"
24                     return 1
25                 fi
26         else
27                 echo -n "The graphics and multimedia acceleration packages for "
28                 echo -e "the R-Car Gen3 board can be downloaded from:"
29                 echo -e " https://www.renesas.com/en-us/software/D6000821.html"
30                 echo -e " https://www.renesas.com/en-us/software/D6000822.html"
31                 echo -e
32                 echo -n "These 2 files from there should be stored in your"
33                 echo -e "'$DOWNLOAD_DIR' directory."
34                 echo -e "  $ZIP_1"
35                 echo -e "  $ZIP_2"
36                 return 1
37         fi
38
39         if [ -f $COPY_SCRIPT ]; then
40                 cd $METADIR/meta-renesas-rcar-gen3/
41                 $COPY_SCRIPT -d -f $EXTRACT_DIR
42                 cd ..
43         else
44                 echo "scripts to copy drivers for Gen3 not found."
45                 return 1
46         fi
47 }